query
stringlengths
7
6.41k
document
stringlengths
12
28.8k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
DELETE /vertices_scene2s/1 DELETE /vertices_scene2s/1.json
def destroy @vertices_scene2.destroy respond_to do |format| format.html { redirect_to vertices_scene2s_url, notice: 'Vertices scene2 was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @vertices_scene1.destroy\n respond_to do |format|\n format.html { redirect_to vertices_scene1s_url, notice: 'Vertices scene1 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @vertices_scene3.destroy\n respond_to do |format|\n ...
[ "0.78343654", "0.75292665", "0.7244982", "0.70935315", "0.6968717", "0.69178855", "0.6843969", "0.6831027", "0.68111956", "0.6796898", "0.6775774", "0.6680293", "0.6621608", "0.6571068", "0.65028137", "0.6434007", "0.6402335", "0.63747233", "0.6347253", "0.62845534", "0.62845...
0.79399365
0
Returns the value of attribute evaluate_erb. source://config//lib/config/sources/yaml_source.rb8
def evaluate_erb; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def erb_render( yml )\n # b = binding\n ERB.new( yml ).result binding \n end", "def evaluate_dynamic_content(filename, value)\n ruby_content = \"\"\n begin\n # non greedy matching of dynamic code\n value.gsub!(/<%=((.|\\n)*?)%>/) do |match|...
[ "0.62462497", "0.6189276", "0.61206526", "0.6038587", "0.58523905", "0.58523905", "0.58178556", "0.58178556", "0.57887393", "0.5745351", "0.5662924", "0.5615107", "0.55976003", "0.55462205", "0.55359626", "0.5506897", "0.5506897", "0.54801047", "0.5437212", "0.54339075", "0.5...
0.72779334
0
Assigns schema configuration option source://config//lib/config/validation/schema.rb5
def schema=(value); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def schema(s)\n @config[:schema] = s\n end", "def schema=(value)\n @schema = value\n end", "def schema_validations(opts={})\n @schema_validations_config = SchemaValidations.config.merge({:auto_create => true}.merge(opts))\n end", "def set_schema(schema)\n...
[ "0.7026263", "0.6995551", "0.6780172", "0.65998435", "0.6563061", "0.6254537", "0.6254537", "0.62522465", "0.61755645", "0.6158466", "0.6156333", "0.6099835", "0.6099835", "0.6099835", "0.60090715", "0.59078896", "0.5862081", "0.5813409", "0.5806674", "0.5802986", "0.5798427"...
0.69994205
1
Writes the value val to the port at address val: The value to be written, on a standard parallel port it should be an integer from 0 to 255
def write(val) @writer.call(@address, val) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_to_port(port, value)\n value = value.to_i\n @values[port.to_i] = value\n # log.debug \"write bar #{port} value #{value}\"\n client.pwm_write(@ports[port.to_i], value)\n end", "def write(val)\n @file.seek(@address)\n @file.putc(val)\n @file.flush\n...
[ "0.7519882", "0.6933992", "0.67638654", "0.6631152", "0.6546859", "0.6461342", "0.64356935", "0.6395855", "0.6369654", "0.63486123", "0.6345872", "0.63431937", "0.6281699", "0.62803227", "0.625247", "0.6180186", "0.60496193", "0.6027364", "0.5999612", "0.5996619", "0.59815866...
0.74100333
1
get the line that changes in `matrix_elements` dimensions
def line_in(matrix_elements = [0]) matrix_elements.each { |dimension| return nil unless self[dimension] == self[matrix_elements[0]] # no line in these dimensions } line = [line_start(matrix_elements)] (1...@grid_size).each { |step| new_position = line[-1].dup matrix_eleme...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lines\n dimension_matrix.map { |e| line_in(e) }.delete_if { |e| e.nil? }\n end", "def line_start(matrix_elements = [0])\n return self if self[matrix_elements[0]] == 0\n beginning = self.dup\n matrix_elements.each { |dimension| beginning[dimension] = 0 }\n beginning\n end", "d...
[ "0.70925945", "0.63139445", "0.60887736", "0.56650805", "0.56617624", "0.55709463", "0.55396515", "0.54946804", "0.54681027", "0.54679346", "0.5400276", "0.53841287", "0.53674173", "0.5366052", "0.53460944", "0.53036284", "0.527523", "0.52292985", "0.5212864", "0.51800954", "...
0.7965298
0
get the beginning endpoint for line_in(matrix_elements)
def line_start(matrix_elements = [0]) return self if self[matrix_elements[0]] == 0 beginning = self.dup matrix_elements.each { |dimension| beginning[dimension] = 0 } beginning end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def line_in(matrix_elements = [0])\n matrix_elements.each { |dimension|\n return nil unless self[dimension] == self[matrix_elements[0]] # no line in these dimensions\n }\n line = [line_start(matrix_elements)]\n (1...@grid_size).each { |step|\n new_position = line[-1].dup\n ...
[ "0.7314854", "0.6110601", "0.60606664", "0.6059343", "0.59560186", "0.5921548", "0.5900465", "0.5809032", "0.5753452", "0.57524705", "0.5738383", "0.5738383", "0.5738383", "0.56988466", "0.56912464", "0.5667065", "0.56540996", "0.55949", "0.55949", "0.55898595", "0.55598646",...
0.76597834
0
Grab the .cardComponentContainer that corresponds with this card. Flip, split, and transform cards override this method. It's possible we can replace the whole thing with `containers.first` for StandardCards?
def container containers.find do |container| subtitle_display = CARD_NAME_OVERRIDES[self.multiverse_id] || self.page.css('[id$="subtitleDisplay"]').text.strip container.css('[id$="nameRow"] .value').text.strip == subtitle_display end || containers.first end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def current_card\n @deck.cards[0]\n end", "def retrieve_card\n card = @cards.pop\n if card.nil?\n self.reset\n card = @cards.pop\n end\n return card\n end", "def container\n @container ||= Container.new(spec[:containers].first)\n end", "def get_card\n @deck.pop\n en...
[ "0.611116", "0.60422534", "0.59901977", "0.5879107", "0.5867026", "0.57456887", "0.5744254", "0.57324237", "0.57012403", "0.563453", "0.5606449", "0.55878705", "0.5544244", "0.54933137", "0.54893273", "0.54732376", "0.54395735", "0.54326504", "0.5411488", "0.53702754", "0.535...
0.6323297
0
def custom_file_browser_field(name, title, id,args)
def custom_file_browser_field(name, title, id,*args) args[0] ||= {} args.first[:col] ||= "8" @template.content_tag :div, class: "mdl-cell--#{args.first[:col]}-col mdl-cell--#{args.first[:col]}-col-tablet ml-color--shades-white m-8" do @template.content_tag :div, class: "mdl-grid mdl-grid--no-spacing" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def file_field; end", "def ui_file_field(name, options = nil, html_options = nil, &block)\n UiBibz::Ui::Core::Forms::Files::FileField.new(name, options, html_options, &block).render\n end", "def field_file libelle, prop, value = nil, options = nil\n Field.new(:file, libelle, prop, value, options).form_r...
[ "0.7091276", "0.70364183", "0.6828986", "0.6605833", "0.6561108", "0.65572584", "0.65572584", "0.64541304", "0.6431657", "0.64101475", "0.6352945", "0.63424796", "0.63353616", "0.6335191", "0.62682366", "0.6262432", "0.62244105", "0.61848384", "0.6143828", "0.613153", "0.6101...
0.8291101
0
GET /request_calls GET /request_calls.json
def index @request_calls = RequestCall.all respond_to do |format| format.html # index.html.erb format.json { render json: @request_calls } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_calls()\n @client.make_request(:get, @client.concat_user_path(\"#{BRIDGE_PATH}/#{id}/calls\"))[0].map do |item|\n Call.new(item, @client)\n end\n end", "def list_requests\n # stub\n end", "def list_on_calls_with_http_info(opts = {})\n if @api_client.config.debug...
[ "0.72396", "0.69030493", "0.67614275", "0.6607695", "0.6523535", "0.6482832", "0.6448999", "0.644767", "0.643058", "0.64209247", "0.63128704", "0.6263518", "0.6254998", "0.62433106", "0.6203758", "0.6197783", "0.61847645", "0.61830366", "0.6123246", "0.6105023", "0.6105023", ...
0.7176577
1
GET /request_calls/1 GET /request_calls/1.json
def show @request_call = RequestCall.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @request_call } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @request_calls = RequestCall.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @request_calls }\n end\n end", "def get_calls()\n @client.make_request(:get, @client.concat_user_path(\"#{BRIDGE_PATH}/#{id}/calls\"))[0].map do |item|\n ...
[ "0.69868183", "0.6708752", "0.6390263", "0.6364997", "0.635036", "0.63403076", "0.62846786", "0.62324476", "0.6203766", "0.61763835", "0.6086661", "0.6046995", "0.6025186", "0.6008489", "0.60016567", "0.59357786", "0.5928012", "0.59245217", "0.59020066", "0.5846727", "0.58467...
0.6807683
1
GET /request_calls/new GET /request_calls/new.json
def new @request_call = RequestCall.new respond_to do |format| format.html { render :layout => false }# new.html.erb format.json { render json: @request_call } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @call = Call.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @call }\n end\n end", "def new\n @call = Call.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @call }\n end\n end", "d...
[ "0.7570223", "0.7570223", "0.7289024", "0.7241099", "0.7227112", "0.72069055", "0.7102262", "0.7102262", "0.7102262", "0.7102262", "0.7102262", "0.70091295", "0.686218", "0.68277895", "0.68175894", "0.67750186", "0.677351", "0.67507035", "0.67399645", "0.6625151", "0.66250163...
0.75836015
0
PUT /request_calls/1 PUT /request_calls/1.json
def update @request_call = RequestCall.find(params[:id]) respond_to do |format| if @request_call.update_attributes(params[:request_call]) format.html { redirect_to @request_call, notice: 'Request call was successfully updated.' } format.json { head :no_content } else format....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @call.update(call_params)\n record_call_activity\n format.html { redirect_to @call, notice: 'Call was successfully updated.' }\n format.json { render :show, status: :ok, location: @call }\n else\n format.html { render :edit }\n ...
[ "0.61090994", "0.6036481", "0.6036481", "0.6036481", "0.6036481", "0.6016668", "0.6016668", "0.6004341", "0.59873927", "0.59873927", "0.59844536", "0.59723574", "0.58889925", "0.58869594", "0.58085865", "0.57597584", "0.57488567", "0.5734006", "0.5681333", "0.567185", "0.5668...
0.6666148
0
DELETE /request_calls/1 DELETE /request_calls/1.json
def destroy @request_call = RequestCall.find(params[:id]) @request_call.destroy respond_to do |format| format.html { redirect_to request_calls_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @call = Call.find(params[:id])\n @call.destroy\n\n respond_to do |format|\n format.html { redirect_to calls_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @call = Call.find(params[:id])\n @call.destroy\n\n respond_to do |format|\n format.h...
[ "0.7194826", "0.7194826", "0.7194826", "0.71394026", "0.7096699", "0.7096699", "0.70731574", "0.6978694", "0.6923051", "0.6923051", "0.6923051", "0.6923051", "0.69183767", "0.6914151", "0.6914151", "0.6912736", "0.6858527", "0.68489075", "0.6804764", "0.6803171", "0.6803171",...
0.79205394
0
Reads the job directories from the staging mount
def sync_staging get_jobs_directories.each do |job_dir| crawl_item = CrawlItem.find_by job_directory: job_dir if crawl_item.nil? CrawlItem.create(job_directory: job_dir, on_disk: true) else crawl_item.update(on_disk: true) end end en...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def jobdirs\n @target.exist? ? @target.children.select { |i| jobdir?(i) } : []\n end", "def input_paths\n reads_from_elasticsearch? ? elasticsearch_hdfs_tmp_dir(input_index) : super()\n end", "def taken_paths\n if @target.exist?\n @target.children.select { |path| jobdir_name?(path.basen...
[ "0.6517754", "0.6026671", "0.5861813", "0.58395696", "0.5729982", "0.5724051", "0.5707711", "0.57060057", "0.56994474", "0.5698686", "0.56689376", "0.56667835", "0.54825526", "0.54326105", "0.54273224", "0.5426677", "0.5426677", "0.5418287", "0.5366225", "0.534322", "0.531656...
0.651793
0
control of data records, e.g. sample left store more times or not returned to store print warnings in terminal
def check_data_structur(data) data.each do |id, values| count = values.size if count.odd? or count > 2 puts "+%s+" % ["-" * 57] puts "|%32s%26s" % ["WARNING", "|"] puts "+%s+" % ["-" * 57] end if count.odd? last = values.keys.last puts "%s%17s" % ["| S...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_data_values(data)\n data.each do |id, values|\n out, back = values[values.keys[0]], values[values.keys[1]]\n if back > out\n puts \"+%s+\" % [\"-\" * 57]\n puts \"|%32s%26s\" % [\"WARNING\", \"|\"]\n puts \"+%s+\" % [\"-\" * 57]\n puts \"%s%21s\" % [\"| Bad data r...
[ "0.60775405", "0.5808391", "0.5757706", "0.5541705", "0.5541705", "0.55058223", "0.5490732", "0.5435693", "0.53850746", "0.5383345", "0.53753465", "0.53498876", "0.5339073", "0.5339073", "0.52981645", "0.52877617", "0.5282425", "0.52397865", "0.52371275", "0.52278054", "0.520...
0.62344974
0
exponential decrease of PDE f(t) = aexp(bt) find coeficients a, b and integrate from t1 to t2
def get_integrate(t1, pde1, t2, pde2) b = (Math.log(pde1) - Math.log(pde2)) / (t2 - t1) a = (pde1 - pde2) / (Math.exp(-b * t1) - Math.exp(-b * t2)) (-a / b) * ((Math.exp(-b * t2) - Math.exp(-b * t1))) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_Delta(_T)\n #equation 13\n #kPa/C\n _Delta = 4098.0 * (0.6108 * Math.exp(17.27 * _T / (_T + 237.3))) / (_T + 237.3) ** 2\nend", "def exp1(b, e)\n return 1 if e == 0\n exp1(b, e - 1) * b\nend", "def coeficiente(p1,p2)\n return p2.abs.subPoint(p1.abs)\n end", "def exp(a, b)\n if b == ...
[ "0.57481825", "0.57071304", "0.5687986", "0.5626539", "0.5624755", "0.5426081", "0.53895324", "0.52308685", "0.5173513", "0.51666194", "0.5158718", "0.5146646", "0.5134331", "0.5118735", "0.5114854", "0.5098928", "0.5093425", "0.5093378", "0.5087912", "0.5067612", "0.50643855...
0.68842834
0
print results to csv for gnuplot columns 1 sample id; 2 stay duration in lab; 3 total dose
def print_csv_results FileUtils.mkdir_p("data") File.open("data/results.csv", "w") do |f| @data.sort_by{|id, values| values["sum_dose"]}.each do |id, values| f.puts "%s\t%d\t%.4f" % [id, values["ddays"], dose_unit(values["sum_dose"])] end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stamp_cvs \n @DAS_file.puts \"#{get_t},#{get_psi},#{get_amps}\"\n end", "def format_output_with_CSV()\r\n\t\theadings = [] << \"Run\"\r\n\t\trows = []\r\n\t\t@actual_parameters.each {|t| headings << t[0]}\r\n\t\t@runs.each_with_index do |run,i|\r\n\t\t\ttemp = [\"#{i+1}\"];\r\n\t\t\trun.each_with_index d...
[ "0.6280467", "0.604097", "0.5860263", "0.5718157", "0.55795133", "0.5573042", "0.54657906", "0.5388484", "0.53815806", "0.53267777", "0.53177845", "0.5300797", "0.52702063", "0.526276", "0.5257923", "0.5242353", "0.52403", "0.52085", "0.5207281", "0.52063924", "0.5198688", ...
0.61603034
1
draw a scatter plot by using erb template
def scatter_plot print_csv_results FileUtils.mkdir_p(%w(gnuplot plots)) erb("templates/scatter_plot.gp.erb", "gnuplot/scatter_plot.gp", {:config => @config}) system("#{@config["path_gnuplot"] || "gnuplot"} gnuplot/scatter_plot.gp") puts "Draw a scatter_plot.#{@config["output_format"] || "png"} in pl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scatter_plot\n validate(\n x_axis: [:optional, :security_default],\n y_axis: [:optional, :security_default],\n x_axis_type: [:optional, :security_default],\n y_axis_type: [:optional, :security_default],\n x_axis_notation: [:optional, :security_default],\n y_axis_not...
[ "0.64595914", "0.6376525", "0.6284191", "0.60495037", "0.59810233", "0.5898604", "0.5885096", "0.57880175", "0.5757935", "0.56989616", "0.5674529", "0.5657719", "0.55842525", "0.5548021", "0.5525229", "0.5507244", "0.5506216", "0.55000955", "0.54904675", "0.54780126", "0.5473...
0.7677649
0
draw a histogram by using erb template histogram types histogram_stay; histogram_dose data_column 2 stay duration in lab; 3 total dose
def histogram(htype, data_column) print_csv_results if data_column == 2 var = "ddays" unit = 1 elsif data_column == 3 var = "sum_dose" if @config["dose_unit"] == "mSv" unit = 1 else unit = 1000 end end # min_value -- where binning starts; max_valu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def histogram(params = {})\n params[:name] ||= File.join(@pictureName.gsub(\".png\", \"Histogram.html\"))\n bins = Hash.new(0)\n \n (0...@picture.height).each do |j|\n (0...@picture.width).each do |i|\n r = ChunkyPNG::Color.r(@picture[i,j])\n g = ChunkyPNG::Color.g(@picture[i,j])\n ...
[ "0.57893574", "0.56322277", "0.5576621", "0.55680966", "0.54814816", "0.5466973", "0.539877", "0.53794307", "0.53156483", "0.5293825", "0.5293644", "0.52649856", "0.521051", "0.5197524", "0.5196199", "0.5173043", "0.51557505", "0.51451486", "0.5132006", "0.51063013", "0.50905...
0.7443856
0
Informs player of an incorrect answer, shows the actual answer and displays score of current player.
def incorrect_answer puts "Incorrect! #{@current_player[:name]} answered #{@input} but the answer was #{@question1 + @question2}. Your score is now #{@current_player[:lives]}".red end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_answer(player, other_player)\n p_answer = gets.chomp.to_i\n # If the answer is correct, message and proceed\n if p_answer == @q_answer\n puts \" \"\n puts \"✅ #{player.name}: Yes! You are correct! ✅\"\n puts \" \"\n puts \"#{player.identifier}: #{player.lives}/3 vs #{other_pl...
[ "0.70541555", "0.7052968", "0.6964371", "0.6886891", "0.6866074", "0.68317", "0.66903776", "0.6679022", "0.66376287", "0.6634476", "0.6625245", "0.6543579", "0.6494029", "0.649243", "0.6454135", "0.6431826", "0.64268494", "0.6330829", "0.63098526", "0.6239867", "0.6197911", ...
0.7429924
0
Runs when player answers correctly and shows current player's score.
def correct_answer puts "Correct! You live to play another round. Your score is #{@current_player[:lives]}.".green end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_answer(question, current_player)\n\n if question.answer == question.actual_answer\n result = \"won round\"\n current_player.score += 1\n else\n result = \"lost round\"\n current_player.score -= 1\n end\n\n result\n\nend", "def handle\n self.status\n output << \"Your f...
[ "0.7525639", "0.7431866", "0.7250591", "0.723847", "0.72226727", "0.7212327", "0.71508884", "0.71300244", "0.7094056", "0.7014394", "0.6999723", "0.6992055", "0.69812495", "0.6960721", "0.6930431", "0.69292516", "0.6907048", "0.68710846", "0.6845927", "0.6841256", "0.68218845...
0.76135623
0
GET /ccls/1 GET /ccls/1.xml
def show @ccl = Ccl.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @ccl } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @clenum = Clenum.find(params[:ids])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @clenum }\n end\n end", "def index\n @csos = Cso.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :...
[ "0.61068946", "0.6087096", "0.6064824", "0.60427564", "0.59971416", "0.5956154", "0.594386", "0.5901933", "0.5864091", "0.58422035", "0.58379066", "0.5835093", "0.58173466", "0.5815989", "0.579352", "0.5782878", "0.5765289", "0.5763469", "0.5744406", "0.57331336", "0.5724247"...
0.66856915
0
GET /ccls/new GET /ccls/new.xml
def new @ccl = Ccl.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @ccl } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @cadd = Cadd.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cadd }\n end\n end", "def new\n @conseq = Conseq.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @conseq }\n end\n ...
[ "0.70606786", "0.7039532", "0.700834", "0.69671154", "0.6852367", "0.6850593", "0.68100643", "0.6809874", "0.68049026", "0.6781982", "0.6781982", "0.6781215", "0.6777926", "0.6772178", "0.6765867", "0.67626125", "0.67567825", "0.6755781", "0.67189664", "0.6701333", "0.6695965...
0.7543288
0
POST /ccls POST /ccls.xml
def create @ccl = Ccl.new(params[:ccl]) respond_to do |format| if @ccl.save format.html { redirect_to(@ccl, :notice => 'Ccl was successfully created.') } format.xml { render :xml => @ccl, :status => :created, :location => @ccl } else format.html { render :action => "new" } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @clclass = Clclass.new(params[:clclass])\n\n respond_to do |format|\n if @clclass.save\n format.html { redirect_to @clclass, notice: 'Clclass was successfully created.' }\n format.json { render json: @clclass, status: :created, location: @clclass }\n else\n format....
[ "0.5446717", "0.531062", "0.51560307", "0.5086591", "0.50710994", "0.5070324", "0.5059857", "0.50549716", "0.5033041", "0.502844", "0.50252235", "0.501035", "0.5004762", "0.49827406", "0.49695453", "0.49586284", "0.49492902", "0.49214458", "0.49204344", "0.49196455", "0.49179...
0.6012256
0
PUT /ccls/1 PUT /ccls/1.xml
def update @ccl = Ccl.find(params[:id]) respond_to do |format| if @ccl.update_attributes(params[:ccl]) format.html { redirect_to(@ccl, :notice => 'Ccl was successfully updated.') } format.xml { head :ok } else format.html { render :action => "edit" } format.xml { r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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...
[ "0.59757984", "0.565918", "0.5630085", "0.5609688", "0.5603866", "0.55587316", "0.5543452", "0.5497286", "0.54658777", "0.54519445", "0.5437922", "0.54319674", "0.5415057", "0.5410527", "0.53845584", "0.5380364", "0.53642434", "0.5336168", "0.5328921", "0.530447", "0.53042835...
0.62881684
0
DELETE /ccls/1 DELETE /ccls/1.xml
def destroy @ccl = Ccl.find(params[:id]) @ccl.destroy respond_to do |format| format.html { redirect_to(ccls_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 destroy\n @cadd = Cadd.find(params[:id])\n @cadd.destroy\n\n respond_to do |format|\n format.html { redirect_to(cadds_url) }\n format.x...
[ "0.68413967", "0.63449526", "0.62486756", "0.6161626", "0.6140294", "0.61165947", "0.61057866", "0.6064629", "0.6042689", "0.6024344", "0.6021604", "0.60151327", "0.60108083", "0.59867173", "0.59827954", "0.5963307", "0.5960132", "0.5935805", "0.5932161", "0.59208107", "0.592...
0.68796736
0
Set `flash[:notice]` based on the current action and user name.
def set_flash_notice(message = nil, action: nil, user: nil, **opt) message ||= status_message(status: :success, action: action, user: user) flash_notice(*message, **opt) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_flash_alert(message = nil, action: nil, user: nil, **opt)\n message ||= status_message(status: :failure, action: action, user: user)\n flash_alert(*message, **opt)\n end", "def flash_notice\n if flash[:notice]\n message = flash[:notice]\n flash.clear\n flash[:success] = message\n...
[ "0.6989493", "0.6852936", "0.6745143", "0.6642631", "0.6581899", "0.64946675", "0.64673567", "0.6345989", "0.6278397", "0.6213557", "0.6203444", "0.6184359", "0.6171773", "0.61208457", "0.61158127", "0.61139226", "0.6049408", "0.5993831", "0.59928644", "0.595753", "0.59566045...
0.7720346
0
Set `flash[:alert]` based on the current action and user name.
def set_flash_alert(message = nil, action: nil, user: nil, **opt) message ||= status_message(status: :failure, action: action, user: user) flash_alert(*message, **opt) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_alert\n unless params[:alert].blank?\n # remove single/double quotes from name to avoid display error:\n params[:alert][:name] = params[:alert][:name].gsub(/'/, '').gsub(/\"/, '') unless params[:alert][:name].blank?\n end\n @alert = current_user.alerts.find(params[:id])\n end", "def s...
[ "0.7083128", "0.67555606", "0.65926373", "0.65031296", "0.63558835", "0.62663186", "0.6199877", "0.61988246", "0.61452955", "0.6140514", "0.6121424", "0.6121424", "0.60781556", "0.6068983", "0.5957212", "0.59527314", "0.59466344", "0.5882384", "0.5855879", "0.5836547", "0.581...
0.77530503
0
Indicate whether handling of the current request should be wrapped by session_update.
def session_updatable? !devise_controller? && !request_xhr? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last_request_update_allowed?\n action_name != \"timeout\"\n end", "def last_request_update_allowed?\n if controller.respond_to?(:last_request_update_allowed?, true)\n controller.send(:last_request_update_allowed?)\n else\n true\n end\n end", "def last_request...
[ "0.60385936", "0.600619", "0.59612", "0.5950399", "0.5936609", "0.5772619", "0.5771055", "0.5761239", "0.56923264", "0.5659793", "0.564638", "0.55863863", "0.5575847", "0.5575847", "0.55555207", "0.5544736", "0.5525236", "0.55152494", "0.5498403", "0.54521775", "0.5451526", ...
0.65219986
0
If a reboot occurred since the last session update, ensure consistency by performing a signout and cleaning up related session data.
def session_check return if (t_last = last_operation_time).zero? return if (t_boot = BOOT_TIME.to_i) < t_last __debug { "last_operation_time #{t_last} < BOOT_TIME #{t_boot}" } Log.info { "Signed out #{current_user&.to_s || 'user'} after reboot." } local_sign_out end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sign_out_expired_session\n return unless current_user.present?\n return if current_user.last_sign_in_check.present? && current_user.last_sign_in_check <= 5.minutes.ago\n\n current_user.update last_sign_in_check: Time.now\n\n if UniversumSsoClient.signed_out?(current_user.uid)\n session[:user_i...
[ "0.6499206", "0.6371934", "0.6334601", "0.6129529", "0.61194247", "0.6110563", "0.6067938", "0.6034721", "0.60261935", "0.60055107", "0.5977042", "0.5941724", "0.5940702", "0.5911377", "0.5901863", "0.58920926", "0.58461297", "0.5803605", "0.580112", "0.580057", "0.57575566",...
0.77132314
0
Always coerce :index_as attributes into an Array
def index_as Array(@index_as) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index_as\n Array(@index_as)\n end", "def index_as\n if @index_as\n Array(@index_as)\n else\n self.proxied_term.index_as\n end\n end", "def to_a\n a = []\n @index.each_value do |s|\n s.each do |t|\n a << t\n end\n end\n a\n end", "def a...
[ "0.8392007", "0.76280636", "0.693168", "0.6586094", "0.6584008", "0.6500779", "0.6377581", "0.6351982", "0.634341", "0.6330375", "0.63119614", "0.62990487", "0.62671155", "0.62453264", "0.6059039", "0.60117006", "0.60097337", "0.59949774", "0.5953346", "0.5941069", "0.5916787...
0.83437407
1
Generates absolute, relative, and constrained xpaths for the term, setting xpath, xpath_relative, and xpath_constrained accordingly. Also triggers update_xpath_values! on all child nodes, as their absolute paths rely on those of their parent nodes.
def generate_xpath_queries! self.xpath = OM::XML::TermXpathGenerator.generate_absolute_xpath(self) self.xpath_constrained = OM::XML::TermXpathGenerator.generate_constrained_xpath(self) self.xpath_relative = OM::XML::TermXpathGenerator.generate_relative_xpath(self) self.children.each_value {|chil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_xpath_queries!\n self.xpath = OM::XML::TermXpathGenerator.generate_absolute_xpath(self)\n self.xpath_constrained = OM::XML::TermXpathGenerator.generate_constrained_xpath(self)\n self.xpath_relative = OM::XML::TermXpathGenerator.generate_relative_xpath(self)\n self.children.each_value {|chi...
[ "0.7140871", "0.5256425", "0.51980406", "0.5114924", "0.5061323", "0.5000471", "0.49454653", "0.49387884", "0.4924898", "0.49128103", "0.48552287", "0.48277554", "0.4805899", "0.4772028", "0.47551036", "0.47551036", "0.47509974", "0.47363228", "0.4722519", "0.46981475", "0.46...
0.7154293
0
returns the bitmask as array from an integer
def bitmask(int) return int.to_s(2).reverse.split('') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_i\n bitmask\n end", "def to_i\n bitmask\n end", "def to_bit_array\n BitMapping.number_to_bit_array(number)\n end", "def number_to_set_bit_positions_array(number)\n assert_non_negative(number)\n array = []\n position = 0\n while number > 0\n array << position ...
[ "0.7535293", "0.74162626", "0.7145627", "0.6952776", "0.6727877", "0.65521663", "0.64817303", "0.64782596", "0.63075525", "0.6226659", "0.6170422", "0.61541104", "0.6036056", "0.60222757", "0.60050684", "0.59849066", "0.5965097", "0.59092975", "0.5895768", "0.5888315", "0.581...
0.7799511
0
finds the next occurrence in a bitmask
def find_next_in_bitmask(bits, day, mask_length=nil, reverse=false) return 0 if bits == 0 mask = bitmask(bits) if mask_length != nil while mask.length < mask_length do mask.push('0') end end if reverse day = mask.length - day mask = mask.reverse...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bitpos(key, bit, start = T.unsafe(nil), stop = T.unsafe(nil)); end", "def find_bit(data, idx_bit_begin_search)\n data_32bits = data.unpack('N*')\n # Mask the ignored bits with 0\n data_32bits[0] = data_32bits[0] & ((1 << (32-idx_bit_begin_search))-1) if (idx_bit_begin_search > 0)\n ...
[ "0.6467996", "0.6360079", "0.61068326", "0.5846021", "0.5803831", "0.5696685", "0.5672289", "0.5632603", "0.5626342", "0.5621886", "0.5621886", "0.559588", "0.55927813", "0.5592451", "0.55197346", "0.5510483", "0.5504783", "0.5490779", "0.54575324", "0.54171866", "0.5404503",...
0.79480606
0
finds the next run date if period is 'days'
def find_next_day day = @date.to_date + ((@schedule.start_date - @date.to_date) % @schedule.period_num) return day end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_next_non_specific(date)\n values = ['first', 'second', 'third', 'fourth']\n\n case @schedule.days_month\n when 'last'\n d = Date.new(date.year, date.month, -1)\n\n return d if @schedule.days_month_day == nil\n\n d -= ((d.wday - @schedule.days_month_day) % 7)\n\n ...
[ "0.6993096", "0.6871792", "0.67856485", "0.67787784", "0.67531824", "0.674377", "0.668687", "0.6575289", "0.6570024", "0.6503255", "0.649602", "0.64753944", "0.64246583", "0.6333905", "0.63024694", "0.62877846", "0.62412566", "0.6240175", "0.6180989", "0.6160838", "0.6137125"...
0.80174106
0
finds the next run date if period is 'weeks'
def find_next_week if @schedule.days == 0 date = @date + ((@schedule.start_date.wday - @date.wday) % 7) + (7 * ((@schedule.start_date - @date) % @schedule.period_num)) return date else date = @date + find_next_in_bitmask(@schedule.days, @date.wday, 7) if @date.wday >= bitmas...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_week_in weeks\n Week.find_by(initial_day: initial_day+( weeks * 7.days))\n end", "def date_of_next_week_count(find_week)\n current = Time.current\n week_count = find_week_count(current)\n while week_count != 1\n current += 1.week\n week_count = find_week_count(current)\n end\n\...
[ "0.7235398", "0.6851406", "0.6753695", "0.66331285", "0.66331285", "0.66198653", "0.6555539", "0.65316784", "0.63963413", "0.6392733", "0.6360371", "0.6338188", "0.6265999", "0.61454207", "0.6138615", "0.61232185", "0.6081596", "0.60582894", "0.6042648", "0.602293", "0.602001...
0.75968724
0
calculates how many periods (weeks / months) to add
def periods_to_add(date=nil) date ||= @date case @schedule.period when 'weeks' weeks_to_add = 0 if date.wday >= bitmask(@schedule.days).length weeks_since_startdate = (date - @schedule.start_date) / 7 weeks_to_add = (@schedule.period_num - (weeks_since_startdate % @...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def total_weeks\n ((self.deadline - self.start_date) / 7).to_i\n end", "def weeks ; Duration[self * 604800] ; end", "def total_weeks\n week_split.size\n end", "def weeks ; self * 7.days ; end", "def weeks() 7 * days end", "def calculate_no_of_periods(start_date, end_date, period, options = {}...
[ "0.7209502", "0.6962653", "0.6891247", "0.6788901", "0.67796224", "0.6743313", "0.66228795", "0.6598143", "0.6572005", "0.649136", "0.64183336", "0.6405061", "0.6367946", "0.6367946", "0.6367946", "0.6324924", "0.62811387", "0.62758636", "0.62632996", "0.62627715", "0.6251883...
0.77842146
0
runs the 'cancel' exclusion option to find the next date
def run_cancel_exclusion(date) date += 1 return find_next_non_specific(date) if @schedule.days_month != '' && @schedule.days_month !='specific' date += find_next_in_bitmask(get_days_month(date), date.day, month_length(date)) date += periods_to_add(date).months # required for dates with ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_exclusion(date)\n case @schedule.exclusion_met\n when 'next'\n return date + ((@schedule.exclusion_met_day - date.wday) % 7)\n when 'previous'\n return date - ((date.wday - @schedule.exclusion_met_day) % 7)\n when 'cancel'\n return run_cancel_exclusion(date)\n ...
[ "0.7232072", "0.59910834", "0.59341407", "0.5900992", "0.5778857", "0.57580674", "0.571906", "0.56657875", "0.5603328", "0.55878854", "0.5561118", "0.555016", "0.55418175", "0.55209637", "0.55171126", "0.55036443", "0.5462801", "0.54616034", "0.54616034", "0.5455533", "0.5431...
0.7788369
0
returns true if the given date is excluded
def is_excluded(date) return false if @schedule.days_exclude == 0 days_bitmask_exclude = bitmask(@schedule.days_exclude) if @schedule.days_month == 'specific' || (@schedule.days_month != 'specific' && @schedule.days_month_day == nil) day_idx = (date.wday) % 7 else day_idx = date...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def was_excluded(date)\n if @schedule.days_month == 'specific'\n return false if bitmask(@schedule.days)[date.day] == '1'\n\n if @schedule.exclusion_met_day\n return date.wday == @schedule.exclusion_met_day\n end\n elsif @schedule.days_month == 'last' \n if @schedule....
[ "0.81093025", "0.7165996", "0.6902935", "0.68694615", "0.66455734", "0.6524175", "0.648779", "0.6485894", "0.64722943", "0.63966054", "0.634343", "0.6329522", "0.6261143", "0.62366104", "0.62244797", "0.6194266", "0.6126365", "0.6067935", "0.604206", "0.60051423", "0.59853286...
0.8177156
0
returns true if given date was the result of an exclusion rule
def was_excluded(date) if @schedule.days_month == 'specific' return false if bitmask(@schedule.days)[date.day] == '1' if @schedule.exclusion_met_day return date.wday == @schedule.exclusion_met_day end elsif @schedule.days_month == 'last' if @schedule.days_month_da...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_excluded(date)\n return false if @schedule.days_exclude == 0\n\n days_bitmask_exclude = bitmask(@schedule.days_exclude)\n if @schedule.days_month == 'specific' || (@schedule.days_month != 'specific' && @schedule.days_month_day == nil)\n day_idx = (date.wday) % 7\n else\n da...
[ "0.7909287", "0.73390824", "0.69474816", "0.6705651", "0.66401064", "0.6639603", "0.6613943", "0.65632", "0.6542741", "0.6516941", "0.6495131", "0.6448187", "0.6429188", "0.6423655", "0.6396399", "0.6374925", "0.63558775", "0.6332524", "0.63301945", "0.6300632", "0.6288682", ...
0.8104133
0
find the next nonspecific date
def find_next_non_specific(date) values = ['first', 'second', 'third', 'fourth'] case @schedule.days_month when 'last' d = Date.new(date.year, date.month, -1) return d if @schedule.days_month_day == nil d -= ((d.wday - @schedule.days_month_day) % 7) if d < date ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_next date\n loop do \n \treturn date if include?(date)\n \t# puts \"#{@resolution} : #{date}\"\n \tdate = beginning_of_next @resolution, date\n end\n end", "def date_of_next(day)\n\t day_required = DateTime.parse(day)\n\t delta = day_required > DateTime.now ? 0 : 7\n\...
[ "0.7811541", "0.732358", "0.72570723", "0.7080728", "0.70081514", "0.69141906", "0.68891984", "0.6833107", "0.6797498", "0.6793637", "0.6789494", "0.6788903", "0.6760965", "0.6755853", "0.67404747", "0.67226225", "0.6708484", "0.6693501", "0.6654671", "0.6596504", "0.6579393"...
0.7595022
1
returns true if the schedule has expired
def schedule_expired return @schedule.end_date && @date > @schedule.end_date end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def expired?\n expiration_date <= Time.now\n end", "def expired?\n Time.now > self.to_be_expired_at\n end", "def expired?\n false\n end", "def expired?\n @expiry_time < Time.now\n end", "def is_expired?\n (!end_time.nil? and end_time < Clock.time)\n end", "def ...
[ "0.7945187", "0.7896941", "0.7893933", "0.78887576", "0.78766245", "0.78754133", "0.7866801", "0.78295827", "0.7802961", "0.7790818", "0.7787895", "0.7741852", "0.77070576", "0.77070105", "0.7706858", "0.7704401", "0.7683255", "0.76807505", "0.7669182", "0.76587677", "0.76498...
0.869365
0
execute the rule if a match is found procees to the expected outcome it gets the data parameter :message it sets the data parameter :match
def process(process_id, plan, data) message = data[:message] || data["message"] data[:matches] = [] data[:misses] = [] match_words.each do |match_word| filter = case match_type when RulesEngine::Rule::<%=rule_name.camelize%>::MESSAGE_MATCH_ALL ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post_match() end", "def post_match\n m = @match\n m.post_match if (not m.equal?(nil))\n end", "def handle_match(status, user, match); end", "def perform_match message\n return false if reject_not_ack(message)\n return false unless type_match?(message)\n #@notifier.log \"#{identifier...
[ "0.66830266", "0.62800753", "0.62203836", "0.61428314", "0.60946536", "0.60901815", "0.60403913", "0.60390174", "0.60380805", "0.59787637", "0.5966275", "0.58978295", "0.58978295", "0.58775586", "0.58775586", "0.5859487", "0.58125234", "0.5809943", "0.5784876", "0.5764642", "...
0.68409747
0
case 1: notification created_at + ae_definition.due_by_days case 2: case1 is wrong if a kid registered and theirs age between the occurring days and due by days EX case1: occurring_days = 365(kid age in days) and due_by_days = 10 => created_at + 10 => 10 days from notification created Ex case2: below
def due_by #occurring_days = ae_definition.occurring_days dob = profile.kids_type.birthdate.to_date dob + (ae_definition.occurring_days + ae_definition.due_by_days ) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def overdue_by\n @overdue_str = \"minutes\"\n \n overdue = (((self.is_due?) ? (Time.zone.now - self.datetime) : (self.datetime - Time.zone.now)) / 60).to_i \n\n if overdue > 60\n overdue /= 60\n @overdue_str = \"hours\"\n if overdue > 24\n overdue /= 24\n @overdue_str = \"...
[ "0.59878725", "0.5912112", "0.5912112", "0.59037596", "0.5826869", "0.57996583", "0.57196796", "0.5676732", "0.5664504", "0.5587349", "0.5576492", "0.55677015", "0.55677015", "0.55677015", "0.55677015", "0.55562854", "0.5547048", "0.5547048", "0.5529467", "0.5514217", "0.5513...
0.7234346
0
GET /simple_models/1 GET /simple_models/1.xml
def show @simple_model = SimpleModel.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @simple_model } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @models = self.class.model_class.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @models }\n end\n end", "def new\n @simple_model = SimpleModel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format....
[ "0.67289424", "0.657313", "0.654499", "0.654499", "0.65102214", "0.6471235", "0.64358073", "0.6298236", "0.6262776", "0.6251646", "0.6215485", "0.615817", "0.615817", "0.6157836", "0.6147338", "0.5972542", "0.59651023", "0.592647", "0.5905705", "0.5870383", "0.584539", "0.5...
0.735273
0
GET /simple_models/new GET /simple_models/new.xml
def new @simple_model = SimpleModel.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @simple_model } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @models = self.class.model_class.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @models }\n end\n end", "def new\n @title = t :new_model_title\n @model = Model.new\n\n respond_to do |format|\n format.html # new.html.erb\n ...
[ "0.76324636", "0.7521962", "0.72366685", "0.7053671", "0.7028785", "0.6994692", "0.6977905", "0.6903356", "0.68935364", "0.68506527", "0.6833227", "0.6833227", "0.6775215", "0.6734394", "0.67272747", "0.67272747", "0.67272747", "0.67269313", "0.67208624", "0.67078584", "0.669...
0.79237974
0
POST /simple_models POST /simple_models.xml
def create @simple_model = SimpleModel.new(params[:simple_model]) respond_to do |format| if @simple_model.save flash[:notice] = 'SimpleModel was successfully created.' format.html { redirect_to(@simple_model) } format.xml { render :xml => @simple_model, :status => :created, :loca...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @model = Model.new(params[:model])\n\n respond_to do |format|\n if @model.save\n format.html { redirect_to(models_path, :notice => t(:model_created)) }\n format.xml { render :xml => @model, :status => :created, :location => @model }\n else\n @title = t :new_model_...
[ "0.6146866", "0.61241084", "0.60904104", "0.57754123", "0.5724278", "0.57189554", "0.5674893", "0.55372137", "0.550462", "0.5489274", "0.5489274", "0.5475973", "0.5457693", "0.5456883", "0.5453054", "0.54339164", "0.5429607", "0.54139686", "0.5386503", "0.5366431", "0.5342206...
0.69839716
0
PUT /simple_models/1 PUT /simple_models/1.xml
def update @simple_model = SimpleModel.find(params[:id]) respond_to do |format| if @simple_model.update_attributes(params[:simple_model]) flash[:notice] = 'SimpleModel was successfully updated.' format.html { redirect_to(@simple_model) } format.xml { head :ok } else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @model = Model.find(params[:id])\n\n respond_to do |format|\n if @model.update_attributes(params[:model])\n format.html { redirect_to(models_path, :notice => t(:model_updated)) }\n format.xml { head :ok }\n else\n @title = t :editing_model\n format.html { r...
[ "0.6128035", "0.60561967", "0.5947449", "0.592948", "0.59163386", "0.58662564", "0.5811312", "0.57879263", "0.56492555", "0.56492555", "0.56492555", "0.56487656", "0.56302994", "0.5627651", "0.5622063", "0.5604512", "0.5594016", "0.557943", "0.55726975", "0.55623245", "0.5539...
0.6793195
0
DELETE /simple_models/1 DELETE /simple_models/1.xml
def destroy @simple_model = SimpleModel.find(params[:id]) @simple_model.destroy respond_to do |format| format.html { redirect_to(simple_models_url) } format.xml { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @model = Model.find(params[:id])\n @model.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_models_path) }\n format.xml { head :ok }\n end\n end", "def destroy\n @model.destroy\n \n respond_to do |format|\n format.html { redirect_to(models_pa...
[ "0.7187179", "0.7164141", "0.7154152", "0.7051674", "0.70382994", "0.68786377", "0.68786377", "0.6810556", "0.6661678", "0.6639477", "0.6633247", "0.66226625", "0.6615803", "0.66103977", "0.6586067", "0.6582602", "0.6582602", "0.6582602", "0.6566438", "0.6566325", "0.65624774...
0.7846581
0
Create a `CGPoint` from the first two elements in the array.
def to_point CGPoint.new(first, second) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_point\n if length == 2\n p = Point.new(*self)\n elsif length == 1\n p = self[0].clone\n end\n return p\n end", "def other_vector(arry)\n\t\treturn [(arry[0] - first_point[0]), (arry[1] - first_point[1])]\n\tend", "def preprocessing_args(args)\n args.map do |v|\n if...
[ "0.66191226", "0.5686646", "0.56600374", "0.56600374", "0.5609248", "0.5535284", "0.541115", "0.52582544", "0.5252926", "0.5216419", "0.5189993", "0.5171288", "0.51255196", "0.5084086", "0.50680155", "0.5062223", "0.5024925", "0.4993972", "0.49879718", "0.49868554", "0.496798...
0.6679162
0
Create a `CGSize` from the first two elements in the array.
def to_size CGSize.new(first, second) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def first(*args)\n if args.size >= 2\n raise ArgumentError, \"wrong number of arguments (#{args.size + 1} for 1..2)\"\n end\n\n if args.size == 1\n width = args[0]\n width = [width, size].min if has_size?\n\n return self[0...width]\n else\n return at(0)\n end\n end", "def...
[ "0.5393042", "0.5168135", "0.5146855", "0.50879604", "0.5054752", "0.49181414", "0.4801297", "0.47592896", "0.47441", "0.47410423", "0.47340173", "0.47291726", "0.46665815", "0.4636938", "0.46357697", "0.4631334", "0.4631334", "0.46217594", "0.46203777", "0.45915443", "0.4580...
0.66757065
0
Create a `CGRect` from the first four elements in the array.
def to_rect CGRectMake(*self[0,4]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def item_rect(index)\n rect = Rect.new(0, 0, 0, 0)\n rect.x = index % 10 * 32 + index % 10 / 5 * 16\n rect.y = index / 10 * WLH\n rect.width = 32\n rect.height = WLH\n return rect\n end", "def split\n sw = (w / 2.0).round\n sh = (h / 2.0).round\n return Rect.new(x, y, sw, sh),\n...
[ "0.564816", "0.5434551", "0.54113114", "0.5179993", "0.5130065", "0.51110137", "0.5047759", "0.5006448", "0.49829942", "0.49576566", "0.4953402", "0.48846325", "0.48564747", "0.4775611", "0.47708696", "0.47673544", "0.47601613", "0.47547358", "0.47413957", "0.4736996", "0.471...
0.66858405
0
Takes a method name and singularizes it, including the case where the method name is a predicate.
def singularized_method_name method (method.predicate? ? method[0..-2] : method).singularize.to_sym end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def depredicate(method_name)\n method_name.to_s.chomp('?').to_sym\n end", "def sanitize_method_name( name )\n name.to_s.camelize\n end", "def aliased_method_name(method_name)\r\n last_letter = method_name.to_s[method_name.to_s.size-1]\r\n if %w(? !).member? last_letter\r\n...
[ "0.66375035", "0.65315646", "0.61935085", "0.61511725", "0.5936329", "0.5911817", "0.59091187", "0.58986396", "0.5863251", "0.58544797", "0.57770485", "0.57770485", "0.57667536", "0.56783557", "0.5652287", "0.564957", "0.56271785", "0.5556398", "0.55511296", "0.553953", "0.55...
0.8472812
0
Find the center of a rectangle, treating `self` as the origin and the given `size` as the size of the rectangle.
def center size x = self.x + (size.width / 2.0) y = self.y + (size.height / 2.0) CGPoint.new(x, y) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_center\n abs_size = get_absolute_size\n Vector.new(abs_size.x * 0.5, abs_size.y * 0.5)\n end", "def center\r\n Point.from_x_y((lower_corner.x + upper_corner.x)/2,(lower_corner.y + upper_corner.y)/2)\r\n end", "def rect_of_size(size)\n CGRect.new([self.x, self.y], size)\n en...
[ "0.67128366", "0.6414304", "0.62913007", "0.6112253", "0.5989211", "0.59821945", "0.58890206", "0.5842566", "0.5828817", "0.57863206", "0.57432455", "0.5720176", "0.57200015", "0.567666", "0.5619502", "0.5604607", "0.55926096", "0.5587166", "0.5554103", "0.55063444", "0.55055...
0.7581285
0
allows Celluloid actors a little time to process messages in their mailboxes
def process_messages sleep 0.05 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dispatch(obj)\n msg = @source.receive(TIMEOUT)\n ::Celluloid.mailbox << msg if msg\n end", "def process_mailbox\n handler.process\n end", "def send_pending_messages\n self.mailbox.conversations.where(mailboxer_label_id: Mailboxer::Label::INFORMATION.id).each do |conversation|\n ...
[ "0.63115394", "0.62774616", "0.6269818", "0.6186796", "0.6146515", "0.6127236", "0.60720026", "0.60677886", "0.5995079", "0.5983613", "0.5959847", "0.5936566", "0.58514506", "0.5845446", "0.58376956", "0.58248", "0.5822425", "0.5807074", "0.5761716", "0.57528317", "0.57490665...
0.6419403
0
implement the following function so that it returns true if ALL the elements in A are bigger than ALL elements in B. In other words, whatever element of A we pick, it will always be bigger of all B's elements. We can express the function logic also with the following statement: Given Ai as ith element of A and Bj as jt...
def bigger(a, b) i=0 a.each { |n| break if n > b[i] i += 1 } if a.length == i return false else return true end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def leq aa, bb\n aa.each_with_index do |a, i|\n if a < bb[i]\n return true\n elsif a > bb[i]\n return false\n end\n end\n return true\nend", "def can_nest(arr1, arr2)\r\n arr1.min > arr2.min && arr1.max < arr2.max\r\nend", "def get_larger_numbers(a, b)\n x = 0\n result = []\n loop do\...
[ "0.65516555", "0.6505661", "0.6475298", "0.6404006", "0.63331354", "0.6316511", "0.62645346", "0.62172717", "0.6180972", "0.6076285", "0.5996296", "0.5985033", "0.5974274", "0.5952416", "0.5911554", "0.5895004", "0.58639675", "0.58297217", "0.582397", "0.58075064", "0.5805403...
0.71895045
0
generate vouchers (and save) return boolean success
def generate_vouchers(order) success = true Voucher.transaction do order.quantity.times do voucher = order.vouchers.build(:valid_date => Time.zone.now.beginning_of_day, :expiration_date => self.end_date, :notes => ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_vouchers(order)\n success = true\n Voucher.transaction do\n order.quantity.times do\n voucher = order.vouchers.build(:valid_date => Time.zone.now.beginning_of_day, \n :redemption_date => Time.zone.now.beginning_of_day, \n ...
[ "0.74494606", "0.5963245", "0.56333554", "0.5490058", "0.54417247", "0.54402083", "0.54185826", "0.5344749", "0.5337876", "0.53268605", "0.526553", "0.52428573", "0.518562", "0.51720095", "0.51545334", "0.5143069", "0.51369166", "0.5121757", "0.5117764", "0.5104989", "0.51016...
0.7328577
1
Return lazy enumerator on the result rows
def rows @rows.lazy end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def each\n if block_given?\n rows.each do |row|\n yield row\n end\n self\n else\n to_enum(:each)\n end\n end", "def next\n return nil if @eof\n\n @stmt.must_be_open!\n\n unless @first_row\n result = @driver.step( @stmt.handle )\n ...
[ "0.68964183", "0.68646985", "0.68087804", "0.6769356", "0.67387664", "0.6716939", "0.6716939", "0.67150056", "0.67050964", "0.66648245", "0.66367024", "0.663266", "0.6605881", "0.6595651", "0.65738094", "0.6545183", "0.6519644", "0.64933616", "0.6486731", "0.6457591", "0.6442...
0.7095494
0
Returns enumerator of all the drawdowns as negative floats (e.g. 0.1 for a drawdown of 10%)
def drawdowns Enumerator.new do |y| peak, trough = nil, nil yield_drawdown = -> { y << Quandl::Drawdown.new(peak, trough) if trough } rows.each do |row| # mark new peak, report previous drawdown if peak.nil? or row.high > peak.high yield_drawdown.call ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def maximum_drawdown\n self.drawdowns.min_by(&:to_f)\n end", "def percentage_of_detractors\n calculator.percentage_of_detractors\n end", "def build_drawdown_data\n high_values = []\n low_values = []\n\n @values.dig(:values).map do |_codes, _date, _open, high, low, _close|\n high_...
[ "0.6281832", "0.5581034", "0.52758485", "0.5268131", "0.51954406", "0.51802033", "0.5158175", "0.5139546", "0.5138235", "0.511833", "0.51140016", "0.51070994", "0.50973785", "0.5084129", "0.5083931", "0.505676", "0.5049904", "0.5044311", "0.50262856", "0.50255", "0.50188136",...
0.59828556
1
Returns the maximum drawdown
def maximum_drawdown self.drawdowns.min_by(&:to_f) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_level\n\t\t\t[to_level(@raw_width), to_level(@raw_height)].max\n\t\tend", "def depth_max; depths.max end", "def max\n\t\t\t@count*@sides\n\t\tend", "def sprite_max\r\n (@power * 10).to_i\r\n end", "def max\n move(180)\n end", "def highest_height\n i = acc.reverse.find_index{|...
[ "0.6931548", "0.6747165", "0.6504352", "0.64495754", "0.641356", "0.6413231", "0.64021224", "0.6382669", "0.6376872", "0.6360558", "0.6333528", "0.63058645", "0.62823987", "0.6280105", "0.62775946", "0.62621284", "0.62337446", "0.6232174", "0.62258416", "0.62225926", "0.62143...
0.89655316
0
refresh_library does an API call to check if the user has added any games from their Steam Library and adds them to the site if this is the case
def refresh_library if self.steam_uid != nil #Steam_username has to exist to call API #Call owned games using Steam API url = "http://api.steampowered.com/IPlayerService/GetOwnedGames/v1/?key=#{ENV["STEAM_WEB_API_KEY"]}&include_played_free_games=1&format=json&steamid=#{self.steam_uid}" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch_new_games!\n if session && apns_devices.length > 0\n ActiveRecord::Base.transaction do\n if session.expired?\n handle_expired_session\n else\n fetch_games\n end\n end\n end\n ensure\n touch(:last_checked_at)\n end", "def update\n authorize ...
[ "0.61288804", "0.60912335", "0.593275", "0.5558539", "0.54325837", "0.5366755", "0.5308884", "0.52392566", "0.523818", "0.5233165", "0.51928735", "0.51742584", "0.5148099", "0.5116739", "0.50938946", "0.5085695", "0.5070482", "0.5068412", "0.5054349", "0.5038821", "0.50249565...
0.86807877
0
Search for a label biography
def biography(query = {}) options = { query: query } response = client.get('label/biography', options) Struct::Biography.new(response['biography']) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search_in(label, string)\n if !LABELS.include? label.to_sym\n raise ArgumentError, \"Unknown key: #{label}\"\n end\n\n find_all do |entry|\n text = entry.send(label).str\n text.match(/#{string}/i)\n end\n end", "def exact_find(label)\n do_query(\"SELECT ad.label...
[ "0.61924887", "0.61896974", "0.6162736", "0.6080721", "0.60540617", "0.5907513", "0.58931655", "0.5760336", "0.57350975", "0.5711497", "0.56776625", "0.5675978", "0.5644901", "0.56131566", "0.55913734", "0.5587577", "0.55555236", "0.55151916", "0.5511785", "0.5504103", "0.550...
0.6306515
0
Write a method that returns a boolean indicating whether an array is in sorted order. Use the equality operator (==), which returns a boolean indicating whether its operands are equal, e.g., 2 == 2 => true, ["cat", "dog"] == ["dog", "cat"] => false
def in_order?(arr) arr == arr.sort end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def in_order?(arr)\r\n # your code goes here\r\n\r\n arr == arr.sort\r\nend", "def in_order?(arr)\n arr.sort == arr\nend", "def in_order?(arr)\n arr.sort == arr\nend", "def in_order?(arr)\n # your code goes here\n arr.sort == arr\nend", "def in_order?(arr)\n # your code goes here\n arr == arr.sort\...
[ "0.826255", "0.8243177", "0.8243177", "0.8138437", "0.81280357", "0.81129616", "0.80832607", "0.7946038", "0.76974696", "0.7630396", "0.76140493", "0.761034", "0.76091784", "0.76078844", "0.7544819", "0.75000393", "0.7489987", "0.7487177", "0.74859893", "0.7472775", "0.746857...
0.82782936
1
tweets is 'how many recent tweets you want'
def recent_tweets(count) start("/recent/tweets/#{count}") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def todays_auto_tweet_count\n self.twitter_tweets.count\n end", "def feeds_with_top_tweets\n\n end", "def tweets_count\n @_tweets_count ||= tweets.count\n end", "def list_tweets\n tweets\n end", "def get_tweets(screen_name, num_tweets)\n\t\n\tresult = \"\"\n #Query num_tweets tweets from sc...
[ "0.76123244", "0.757498", "0.753315", "0.7159936", "0.70973897", "0.7066875", "0.7030899", "0.7019118", "0.6991239", "0.68750906", "0.6739066", "0.66396797", "0.6633047", "0.66174084", "0.6576809", "0.6533287", "0.6523256", "0.6513765", "0.6491607", "0.64891154", "0.64731234"...
0.7812099
0
Check for an invitation token and process the invite. If an invitation is found, the user claims the invite. Use this only when creating a new user. Invoke manually or from an after_action: after_action :process_invite, only: [:create] Invoke with new_user, or set an instance variable with the standard 'underscore' nam...
def process_invite_token(new_user = nil) new_user = user_instance_variable if new_user.nil? token = params[:invite_token] new_user.claim_invite token if !token.nil? && !new_user.nil? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def invite_member\n @organization = MnoEnterprise::Organization.find(params[:id])\n\n # Find or create a new user - We create it in the frontend as MnoHub will send confirmation instructions for newly\n # created users\n user = MnoEnterprise::User.find_by(email: user_params[:email]) || create_unconfirm...
[ "0.7044274", "0.69503844", "0.691068", "0.6878519", "0.6814124", "0.67714155", "0.6765168", "0.67640334", "0.66809183", "0.662025", "0.65538055", "0.65261275", "0.6511681", "0.6463573", "0.6438153", "0.64137685", "0.6386161", "0.63745946", "0.6366413", "0.63503975", "0.634693...
0.79462945
0
Populate 'users also view' for initial notebook uploads
def initial_upload(notebook, user) # When a notebook is uploaded, nobody has seen it but the author, so # populate users also view with the last few notebooks the author viewed other_notebooks = user .clicks .joins(:notebook) .where(action: 'viewed notebook') .where('cl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @user = User.first # instead of User.find(params[:id]), to handle importing new user\n @textfiles = Textfile.in_home.by_join_date\n @tags = ActsAsTaggableOn::Tag.all\n changes = ModelInstanceRefresher.everything # Changes is an array of hashes\n @user = User.first # user attributes may ha...
[ "0.5997689", "0.5964312", "0.5896333", "0.58048874", "0.5527144", "0.5503779", "0.54938954", "0.5481962", "0.5479157", "0.54386646", "0.5421621", "0.539394", "0.538869", "0.5369433", "0.53681415", "0.5357598", "0.53348255", "0.53326607", "0.53326607", "0.53164697", "0.5267002...
0.7450139
0
Abort the current hydra run as good as possible. This means that it only clears the queued requests and can't do anything about already running requests.
def abort queued_requests.clear end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def abort\n @thread.kill\n unset_thread_task\n end", "def abort\n return unless @running\n @loop = nil\n @abort = true\n @running = false\n end", "def abort\n unless @finished\n do_abort\n end\n end", "def abort\n synchronize do\n @abort...
[ "0.7297452", "0.72456455", "0.6921017", "0.6752607", "0.6641554", "0.6575322", "0.6546511", "0.64691895", "0.6428079", "0.63426983", "0.63255376", "0.63050526", "0.6272669", "0.62491196", "0.6245613", "0.62247133", "0.62084", "0.62061757", "0.6187", "0.61527663", "0.61454517"...
0.8439353
0
Enqueues a request in order to be performed by the hydra. This can even be done while the hydra is running. Also sets hydra on request.
def queue(request) request.hydra = self queued_requests << request end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def queue_front(request)\n request.hydra = self\n queued_requests.unshift request\n end", "def queued\n hydra.queued_requests\n end", "def send_request\n request = Request.new(@floor, @direction)\n @elevator.requests_queue.append(request)\n end", "def enqueue(reque...
[ "0.7364387", "0.62871426", "0.62390214", "0.6104164", "0.60978335", "0.6094689", "0.6010826", "0.5997437", "0.5908464", "0.58925515", "0.5829835", "0.579046", "0.5765798", "0.56946707", "0.55715734", "0.5556866", "0.55541307", "0.55254316", "0.54533875", "0.54477644", "0.5426...
0.79818845
0
Pushes a request to the front of the queue, to be performed by the hydra. Also sets hydra on request
def queue_front(request) request.hydra = self queued_requests.unshift request end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def queue(request)\n request.hydra = self\n queued_requests << request\n end", "def queue(link)\n\t\t####binding.pry\n\t\treq = request(link)\n\t\t######binding.pry\n\t\treq.on_complete {|res| \n\t\t\t######binding.pry\n\t\t\thandle_response(req, res)\n\t\t}\n\t\t#####binding.pry\n\t\thydra.q...
[ "0.80650586", "0.6483895", "0.63389975", "0.6279263", "0.62789786", "0.6271012", "0.62266636", "0.6187091", "0.61797935", "0.6082086", "0.60650384", "0.6059212", "0.60525084", "0.6040893", "0.60063475", "0.60048234", "0.5992375", "0.5992375", "0.5942811", "0.5918623", "0.5911...
0.877536
0
Removes a request from queued_requests and adds it to the hydra in order to be performed next.
def dequeue add(queued_requests.shift) unless queued_requests.empty? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def queue(request)\n request.hydra = self\n queued_requests << request\n end", "def queue_front(request)\n request.hydra = self\n queued_requests.unshift request\n end", "def abort\n queued_requests.clear\n end", "def queued\n hydra.queued_requests\n ...
[ "0.74471575", "0.69850403", "0.64190745", "0.6373043", "0.6201235", "0.61398643", "0.61096793", "0.6084638", "0.6000987", "0.59522617", "0.59173745", "0.5900349", "0.58162487", "0.57930744", "0.57615024", "0.56892544", "0.5662312", "0.5642789", "0.56143504", "0.56055933", "0....
0.73988545
1
Removes requests from queued_requests and adds them to the hydra until max_concurrency is reached.
def dequeue_many number = multi.easy_handles.count until number == max_concurrency || queued_requests.empty? add(queued_requests.shift) number += 1 end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dequeue\n add(queued_requests.shift) unless queued_requests.empty?\n end", "def flush\n until @work_queue.empty? && @requests.zero?\n @main_queue.drain!\n sleep 0.1\n end\n end", "def queued\n hydra.queued_requests\n end", "def queue(request)\n reques...
[ "0.6902429", "0.63790673", "0.6377491", "0.6172078", "0.59640074", "0.57404965", "0.5702146", "0.5691955", "0.56723773", "0.564655", "0.55878913", "0.5577519", "0.55546653", "0.5532445", "0.5485411", "0.5471587", "0.54514533", "0.537625", "0.53591585", "0.5339739", "0.5334717...
0.64374304
1
def bsearch(array, target) raise "unsorted array!" unless array.sort == array return nil if array.empty? return 0 if array[0] == target n = array.size bottom, top = array[0...n/2], array[n/2..1] if target <= bottom.last bsearch(bottom, target) else bsearch(top, target) + bottom.size end end
def bsearch(array, target) return nil if array.empty? n = array.size / 2 bottom = array[0...n] mid = array[n] top = array[n + 1..-1] if target < mid bsearch(bottom, target) elsif target > mid top_search = bsearch(top, target) top_search.nil? ? nil : top_search + bottom.size + 1 else mi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bsearch(array, target)\n return nil if array.length <= 1 && array[0] != target\n\n mid_idx = (array.length - 1) / 2\n if array[mid_idx] == target\n mid_idx\n elsif array[mid_idx] < target\n response = bsearch(array[(mid_idx + 1)..-1], target)\n response.nil? ? nil : response + mid_idx + 1\n else\...
[ "0.94277585", "0.9406529", "0.93219405", "0.9302", "0.93017465", "0.92887306", "0.9267716", "0.9266238", "0.9261175", "0.92082214", "0.91573644", "0.9136651", "0.9095466", "0.9082955", "0.90607053", "0.90585357", "0.90484494", "0.9038642", "0.9013417", "0.9003319", "0.9003129...
0.9509559
0
GET /components/rim_strips GET /components/rim_strips.xml
def index @components_rim_strips = Components::RimStrip.all respond_to do |format| format.html # index.html.erb format.xml { render :xml => @components_rim_strips } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @components_rim_strip = Components::RimStrip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @components_rim_strip }\n end\n end", "def destroy\n @components_rim_strip = Components::RimStrip.find(params[:id])\n @compon...
[ "0.65081817", "0.63865", "0.6101752", "0.5951274", "0.5769653", "0.5522302", "0.5492739", "0.54599774", "0.54455817", "0.5400777", "0.53371215", "0.53060484", "0.5249434", "0.520608", "0.51844025", "0.50440866", "0.5024974", "0.49150807", "0.49031886", "0.48583108", "0.483180...
0.71380156
0
GET /components/rim_strips/1 GET /components/rim_strips/1.xml
def show @components_rim_strip = Components::RimStrip.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @components_rim_strip } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @components_rim_strips = Components::RimStrip.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @components_rim_strips }\n end\n end", "def destroy\n @components_rim_strip = Components::RimStrip.find(params[:id])\n @components_rim_s...
[ "0.72704726", "0.6674605", "0.6427591", "0.60049385", "0.59926194", "0.5813801", "0.5548533", "0.53439677", "0.5321695", "0.52862585", "0.51715976", "0.5052659", "0.502023", "0.4823091", "0.4784584", "0.47829244", "0.4727025", "0.47070026", "0.46786717", "0.46452916", "0.4618...
0.7052027
1
GET /components/rim_strips/new GET /components/rim_strips/new.xml
def new @components_rim_strip = Components::RimStrip.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @components_rim_strip } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @components_rim_strip = Components::RimStrip.new(params[:components_rim_strip])\n\n respond_to do |format|\n if @components_rim_strip.save\n format.html { redirect_to(@components_rim_strip, :notice => 'Rim strip was successfully created.') }\n format.xml { render :xml => @com...
[ "0.7049164", "0.6330829", "0.61287844", "0.60005885", "0.58607846", "0.5690273", "0.56623214", "0.56386757", "0.55896395", "0.55432224", "0.5477564", "0.5461319", "0.54499006", "0.54402405", "0.54283434", "0.54227924", "0.54227376", "0.54205877", "0.5419991", "0.540906", "0.5...
0.752064
0
POST /components/rim_strips POST /components/rim_strips.xml
def create @components_rim_strip = Components::RimStrip.new(params[:components_rim_strip]) respond_to do |format| if @components_rim_strip.save format.html { redirect_to(@components_rim_strip, :notice => 'Rim strip was successfully created.') } format.xml { render :xml => @components_rim...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rstrip() end", "def rstrip!() end", "def destroy\n @components_rim_strip = Components::RimStrip.find(params[:id])\n @components_rim_strip.destroy\n\n respond_to do |format|\n format.html { redirect_to(components_rim_strips_url) }\n format.xml { head :ok }\n end\n end", "def remove...
[ "0.6345628", "0.6079151", "0.6075402", "0.5756826", "0.57451844", "0.5672741", "0.5490983", "0.5421804", "0.5396807", "0.53907174", "0.5370269", "0.53268504", "0.52633446", "0.52176034", "0.5203216", "0.51720935", "0.5147509", "0.5132717", "0.51250523", "0.5103659", "0.508072...
0.61379623
1
PUT /components/rim_strips/1 PUT /components/rim_strips/1.xml
def update @components_rim_strip = Components::RimStrip.find(params[:id]) respond_to do |format| if @components_rim_strip.update_attributes(params[:components_rim_strip]) format.html { redirect_to(@components_rim_strip, :notice => 'Rim strip was successfully updated.') } format.xml { hea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @components_rim_strip = Components::RimStrip.find(params[:id])\n @components_rim_strip.destroy\n\n respond_to do |format|\n format.html { redirect_to(components_rim_strips_url) }\n format.xml { head :ok }\n end\n end", "def create\n @components_rim_strip = Components::Rim...
[ "0.6394639", "0.61524147", "0.568658", "0.55935585", "0.54854524", "0.54719293", "0.53145695", "0.52434844", "0.5114058", "0.5088775", "0.5083899", "0.5067108", "0.4974908", "0.49628082", "0.49606365", "0.48763445", "0.48534617", "0.48494202", "0.48436928", "0.4723309", "0.46...
0.6896142
0
DELETE /components/rim_strips/1 DELETE /components/rim_strips/1.xml
def destroy @components_rim_strip = Components::RimStrip.find(params[:id]) @components_rim_strip.destroy respond_to do |format| format.html { redirect_to(components_rim_strips_url) } format.xml { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @strip = Strip.find(params[:id])\n @strip.destroy\n respond_to do |format|\n format.html { redirect_to strips_url }\n format.xml { head :ok }\n end\n end", "def netdev_resxml_delete( xml )\n top = netdev_resxml_top( xml )\n par = top.instance_variable_get(:@parent)\n ...
[ "0.656616", "0.6447388", "0.62879866", "0.60000706", "0.5897924", "0.58463895", "0.5810617", "0.57654196", "0.5725122", "0.5667916", "0.55678487", "0.5557391", "0.555261", "0.5547465", "0.55456614", "0.55345017", "0.55151784", "0.5497999", "0.54838216", "0.5471534", "0.546864...
0.7545618
0
GET /tweet_stores GET /tweet_stores.json
def index @tweet_stores = TweetStore.all.desc(:tweeted_on) respond_to do |format| format.json {render json: @tweet_stores,:callback => params['callback']} format.html end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @stores = Store.all\n render json: @stores\n end", "def index\n @tweets = Tweet.all\n\n render json: @tweets\n end", "def create\n @tweet_store = TweetStore.new(tweet_store_params)\n\n respond_to do |format|\n if @tweet_store.save\n format.html { re...
[ "0.65657324", "0.64120424", "0.6363957", "0.6355794", "0.6292905", "0.627311", "0.62696135", "0.6215489", "0.6185762", "0.6164517", "0.6158585", "0.6101994", "0.6089388", "0.6085769", "0.59945315", "0.5989766", "0.5989766", "0.5989766", "0.5989766", "0.5989766", "0.59737396",...
0.6916018
0
POST /tweet_stores POST /tweet_stores.json
def create @tweet_store = TweetStore.new(tweet_store_params) respond_to do |format| if @tweet_store.save format.html { redirect_to @tweet_store, notice: 'Tweet store was successfully created.' } format.json { render action: 'show', status: :created, location: @tweet_store } else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(add_params = nil)\n params = {\n }\n api_call('/stores(.:format)',:post,params,add_params)\n end", "def create\n user = user_from_token\n @tweet = user.tweets.new()\n @tweet.tweet = params[:tweet]\n if @tweet.save\n render :json => @tweet, :status => :created\n el...
[ "0.6339322", "0.6330865", "0.6299935", "0.62950075", "0.60773367", "0.6076264", "0.6005205", "0.58528423", "0.58006483", "0.58006483", "0.5794102", "0.5754554", "0.57369584", "0.57172835", "0.5713197", "0.5707005", "0.5706495", "0.57056946", "0.568994", "0.56676817", "0.56458...
0.7317572
0
PATCH/PUT /tweet_stores/1 PATCH/PUT /tweet_stores/1.json
def update respond_to do |format| if @tweet_store.update(tweet_store_params) format.html { redirect_to @tweet_store, notice: 'Tweet store was successfully updated.' } format.json { head :no_content } else format.html { render action: 'edit' } format.json { render json: @t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @tweet.update(tweet_params)\n respond_with(@tweet)\n end", "def update(url, data)\n RestClient.put url, data, :content_type => :json\nend", "def update(tweet)\n client.update tweet\n end", "def update\n # Add in this #MDM\n @tweet = Tweet.find(params[:id]) \n \n respon...
[ "0.6203117", "0.6122188", "0.61092323", "0.6075905", "0.60346675", "0.6018218", "0.5990131", "0.5988456", "0.5967546", "0.5967546", "0.5967546", "0.5945365", "0.59345883", "0.59061444", "0.5865372", "0.5864135", "0.5861701", "0.5861701", "0.5861701", "0.5861701", "0.5853271",...
0.686927
0
DELETE /tweet_stores/1 DELETE /tweet_stores/1.json
def destroy @tweet_store.destroy respond_to do |format| format.html { redirect_to tweet_stores_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @store.destroy\n respond_to do |format|\n format.html { redirect_to stores_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @store.destroy\n respond_to do |format|\n format.html { redirect_to stores_url }\n format.json { head :no_content }\n ...
[ "0.6885618", "0.6885618", "0.6885618", "0.6885618", "0.68815815", "0.688096", "0.688096", "0.688096", "0.688096", "0.68800914", "0.67828345", "0.6767278", "0.6723063", "0.6691982", "0.667828", "0.6671189", "0.66526544", "0.6651525", "0.66422224", "0.6639575", "0.6639167", "...
0.78226763
0
get XRDS document from Resource Descriptor URL
def rd2xrds(rdurl) r = agent.get_xrds(rdurl) validate_response(r) Document.new(r.read) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(resource_uri, format = \"text/turtle\")\n uri = build_uri_for_resource resource_uri \n log \"get #{uri}\"\n request = Net::HTTP::Get.new(uri)\n request[\"Accept\"] = format\n response = Net::HTTP.start(uri.hostname, uri.port) {|http|\n http.request(request)\n }\n doc = FedoraD...
[ "0.6208631", "0.604543", "0.60169166", "0.5871978", "0.58291763", "0.5658551", "0.56053483", "0.55739653", "0.5568472", "0.5548802", "0.553543", "0.5529831", "0.5498723", "0.54828066", "0.5470303", "0.5423762", "0.53673625", "0.5345785", "0.53361297", "0.53306735", "0.5328503...
0.64318794
0
The height of the barcode in px For 2D barcodes this is the number of "lines" ydim
def height barcode.two_dimensional? ? (ydim * encoding.length) : (@height || 100) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def height\n dimensions()[:y]\n end", "def height\n @dimensions.y\n end", "def height\n lines.size\n end", "def height\n lines.size\n end", "def height\n @y1 - @y0\n end", "def height\n @screenplay.line_height * @lines.size\n end", "def height\n (self....
[ "0.7902343", "0.78133965", "0.77516776", "0.77516776", "0.77078986", "0.7637291", "0.75352687", "0.7500244", "0.7479794", "0.7479794", "0.7431902", "0.74120575", "0.73943883", "0.73943883", "0.737208", "0.73567563", "0.7340565", "0.7331321", "0.7276529", "0.72385603", "0.7190...
0.8886505
1
Y dimension. Only for 2D codes
def ydim @ydim || xdim end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sizeY()\n return @device.sizeY() ;\n end", "def pixel_y_at(y)\n\t\t(block_size * y) + @y_offset\n\tend", "def height\n dimensions()[:y]\n end", "def y2\n y + height\n end", "def y\n @components[:y]\n end", "def y\n @data[:y]\n end", "def getY() @y end", "def y2d(y)\n\tretu...
[ "0.67707896", "0.65789026", "0.6464521", "0.64531636", "0.6449049", "0.63596165", "0.632227", "0.62953544", "0.6203863", "0.6203863", "0.62001264", "0.6197975", "0.61336744", "0.6091579", "0.6087133", "0.6071057", "0.60461444", "0.59729224", "0.5943056", "0.5924216", "0.59110...
0.8012366
1
Public: Create an ImportResult object. Throws an exception if not valid
def build_and_save_imported_result(hash, raw, user, competition, is_start_time) ImportResult.create!( hash.merge( raw_data: convert_array_to_string(raw), user: user, competition: competition, is_start_time: is_start_time ) ) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n authorize Import\n @import = Import.new(sanitized_params)\n @import.user = current_user\n @import.institution = current_institution\n begin\n @import.save!\n rescue => e\n render partial: \"shared/validation_messages\",\n locals: { object: @im...
[ "0.63861275", "0.6370358", "0.6344669", "0.62935865", "0.62528735", "0.6244071", "0.6229764", "0.61747915", "0.6169173", "0.6072444", "0.59878296", "0.59568363", "0.5925117", "0.59101164", "0.5873839", "0.5792086", "0.578436", "0.5783542", "0.5778465", "0.57358426", "0.572533...
0.6471243
0
POST /member_classes POST /member_classes.json
def create @user = User.find_by(id: params[:user]) @member_class = @user.member_classes.new(member_class_params) #@member_class = MemberClass.new(member_class_params) respond_to do |format| if @member_class.save format.html { redirect_to @member_class, notice: 'Member class was successfu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @pe_classmember = PeClassmember.new(params[:pe_classmember])\n\n respond_to do |format|\n if @pe_classmember.save\n format.html { redirect_to @pe_classmember, :notice => 'Pe classmember was successfully created.' }\n format.json { render :json => @pe_classmember, :status => :c...
[ "0.64053965", "0.60420966", "0.6019919", "0.59898317", "0.59058386", "0.58943707", "0.58621985", "0.5825394", "0.5811443", "0.5796348", "0.5790214", "0.57618296", "0.57303894", "0.5713052", "0.57106334", "0.56758803", "0.56637627", "0.56330085", "0.56227326", "0.5621104", "0....
0.7232525
0
PATCH/PUT /member_classes/1 PATCH/PUT /member_classes/1.json
def update respond_to do |format| if @member_class.update(member_class_params) format.html { redirect_to @member_class, notice: 'Member class was successfully updated.' } format.json { head :no_content } else format.html { render action: 'edit' } format.json { render json...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @pe_classmember = PeClassmember.find(params[:id])\n\n respond_to do |format|\n if @pe_classmember.update_attributes(params[:pe_classmember])\n format.html { redirect_to @pe_classmember, :notice => 'Pe classmember was successfully updated.' }\n format.json { head :no_content }\...
[ "0.6601019", "0.63887113", "0.63313144", "0.63135284", "0.6262074", "0.6202069", "0.6184935", "0.61462396", "0.61234254", "0.61192274", "0.60919917", "0.60371745", "0.60240996", "0.60206807", "0.5992583", "0.59876305", "0.5984312", "0.59231186", "0.5907298", "0.590324", "0.59...
0.7426327
0
DELETE /member_classes/1 DELETE /member_classes/1.json
def destroy @member_class.destroy respond_to do |format| format.html { redirect_to member_classes_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @pe_classmember = PeClassmember.find(params[:id])\n @pe_classmember.destroy\n\n respond_to do |format|\n format.html { redirect_to pe_classmembers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @member_type = MemberType.find(params[:id])\n @member...
[ "0.73468375", "0.70508254", "0.69887066", "0.69284797", "0.6919691", "0.69182926", "0.6863636", "0.6854911", "0.6842205", "0.68343365", "0.6827213", "0.67873263", "0.67873263", "0.6784606", "0.6781608", "0.6781608", "0.6781608", "0.6781608", "0.6781608", "0.6781608", "0.67816...
0.8116263
0
Fetches and returns the list of groups from the server or, if it has already been fetched, returns the saved list.
def groups @groups ||= fetch_groups end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def groups\n return [] if new_record?\n cached_groups do\n fetch_groups!\n end\n end", "def list_groups\n BrickFTP::API::Group.all\n end", "def list_groups\n BrickFTP::API::Group.all\n end", "def groups\n UserGroups.new(:id => id).get.items\n end", "def groups\n re...
[ "0.7527059", "0.68103427", "0.68103427", "0.6743752", "0.67327154", "0.6720032", "0.6708294", "0.6708294", "0.67069733", "0.66565293", "0.6656419", "0.66547596", "0.6646699", "0.6590911", "0.65258694", "0.65094733", "0.6503903", "0.65017104", "0.6498225", "0.64800453", "0.642...
0.74468493
1
GET /registration_tables GET /registration_tables.json
def index @registration_tables = RegistrationTable.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_registration_table\n @registration_table = RegistrationTable.find(params[:id])\n end", "def create\n @registration_table = RegistrationTable.new(registration_table_params)\n\n respond_to do |format|\n if @registration_table.save\n format.html { redirect_to @registration_table, notic...
[ "0.6677792", "0.6644053", "0.6623487", "0.6466973", "0.62992233", "0.6219271", "0.6061873", "0.60132957", "0.5961727", "0.5898598", "0.5898265", "0.584719", "0.5834072", "0.58230406", "0.57920784", "0.5783692", "0.5783692", "0.5783692", "0.5783692", "0.5783692", "0.5734744", ...
0.7645458
0
POST /registration_tables POST /registration_tables.json
def create @registration_table = RegistrationTable.new(registration_table_params) respond_to do |format| if @registration_table.save format.html { redirect_to @registration_table, notice: 'Registration table was successfully created.' } format.json { render :show, status: :created, locati...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @registration_table = RegistrationTable.new(registration_table_params)\n\n unless event_host?\n @registration_table.user_event_id = user_event_id == current_user.registration_for_event(event).id\n end\n\n # TODO: - is there a better way to do this?\n seat = RegistrationTable.where(...
[ "0.6939706", "0.6902818", "0.65427357", "0.64661425", "0.6461791", "0.6447815", "0.6431551", "0.6271039", "0.5995012", "0.5862286", "0.5818378", "0.5784823", "0.5773946", "0.57735586", "0.5766944", "0.5764026", "0.574761", "0.5741756", "0.5712762", "0.56961554", "0.5690268", ...
0.7550617
0
PATCH/PUT /registration_tables/1 PATCH/PUT /registration_tables/1.json
def update respond_to do |format| if @registration_table.update(registration_table_params) format.html { redirect_to @registration_table, notice: 'Registration table was successfully updated.' } format.json { render :show, status: :ok, location: @registration_table } else format....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @registration_table.update(registration_table_params)\n format.html do\n redirect_to [@event, @session, @table, @registration_table],\n notice: 'Registration table was successfully updated.'\n end\n format.json { re...
[ "0.68853784", "0.61508363", "0.61494964", "0.6130272", "0.5978093", "0.5889381", "0.58148026", "0.57920176", "0.5787074", "0.57670766", "0.5758103", "0.5753879", "0.57537484", "0.575145", "0.57318795", "0.57261544", "0.56839097", "0.56578875", "0.557831", "0.55673504", "0.556...
0.7119448
0
DELETE /registration_tables/1 DELETE /registration_tables/1.json
def destroy @registration_table.destroy respond_to do |format| format.html { redirect_to registration_tables_url, notice: 'Registration table was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @registration_table.destroy\n respond_to do |format|\n format.html { redirect_to [@event], notice: 'RSVP was removed from table.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @registration_request.destroy\n\n head :no_content\n end", "def delete_tab...
[ "0.7026821", "0.6645284", "0.6634872", "0.6582237", "0.65326315", "0.6532285", "0.6508933", "0.65061516", "0.65061516", "0.64854753", "0.6481906", "0.64746064", "0.64746064", "0.644089", "0.64337057", "0.64271003", "0.6425938", "0.6424468", "0.64218926", "0.64177674", "0.6417...
0.76243746
0
deploy:rolling [PROCESS] deploy processes for an app with a rolling restart if PROCESS is not specified, deploy all processes on the app Example: $ heroku deploy:rolling web Deploying web processes... (========= ) $ heroku deploy:rolling Deploying processes... (========= )
def rolling process = shift_argument validate_arguments! processes = api.get_ps(app).body.map do |p| p.merge("process_type" => p["process"].split(".")[0], "process_num" => p["process"].split(".")[1].to_i) end processes = processes.select do |p| process.nil? || p["process_ty...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deploy\n if phase.has_key?('deploy')\n execute(\"deploy\", phase['deploy'])\n end\n end", "def application_specific_tasks\n # system 'cap deploy:whenever:update_crontab'\n # system 'cap deploy:delayed_job:stop'\n # system 'cap deploy:delayed_job:start n=1'\n # system 'cap deploy:run_command c...
[ "0.6077121", "0.60717285", "0.6045251", "0.6045251", "0.6045251", "0.58970624", "0.5815915", "0.5805684", "0.5805684", "0.5787433", "0.5730413", "0.5722132", "0.5708604", "0.5702061", "0.5678902", "0.56419516", "0.5619019", "0.55586654", "0.55075157", "0.54973733", "0.5490353...
0.7184086
0
GET /businesslines GET /businesslines.json
def index @businesslines = Businessline.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n\t\t@business = business.find(params[:id, as: :business_line])\n\tend", "def index\n @batting_lines = BattingLine.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @batting_lines }\n end\n end", "def index\n @businesses = Business.all.of...
[ "0.67633384", "0.6749061", "0.6387102", "0.6319929", "0.6279327", "0.6244523", "0.62208575", "0.6215003", "0.61855084", "0.61353683", "0.61353683", "0.61353683", "0.61353683", "0.6116769", "0.61095417", "0.61048645", "0.60941917", "0.6074602", "0.6053455", "0.60294545", "0.60...
0.7377717
0
POST /businesslines POST /businesslines.json
def create @businessline = Businessline.new(businessline_params) respond_to do |format| if @businessline.save format.html { redirect_to @businessline, notice: 'Businessline was successfully created.' } format.json { render :show, status: :created, location: @businessline } else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n\t\t@business = business.new(business_params)\n\t\trespond_to do |format|\n\t\t\tif @business.save\n\t\t\t\tformat.html { redirect_to @business, notice: 'Business Line was successfully created.' }\n\t\t\t\tformat.json { render action: 'show', status: :created, location @business }\n\t\t\telse\n\t\t\t\t...
[ "0.718138", "0.6564765", "0.6303776", "0.6273528", "0.62292814", "0.6176173", "0.60549045", "0.60106164", "0.5992633", "0.59351397", "0.590623", "0.5887081", "0.5878151", "0.58671755", "0.58460975", "0.5836172", "0.582326", "0.58034956", "0.5768201", "0.5767291", "0.5762716",...
0.7527385
0
PATCH/PUT /businesslines/1 PATCH/PUT /businesslines/1.json
def update respond_to do |format| if @businessline.update(businessline_params) format.html { redirect_to @businessline, notice: 'Businessline was successfully updated.' } format.json { render :show, status: :ok, location: @businessline } else format.html { render :edit } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n\t\trespond_to do |format|\n\t\t\tif @business.update(business_params)\n\t\t\t\tformat.html { redirect_to @business, notice: 'Business Line was successfully updated.' }\n\t\t\t\tformat.json { render json: @business.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "def update\n ...
[ "0.73452", "0.67810327", "0.6449317", "0.6419417", "0.63937813", "0.6392741", "0.63458914", "0.63345534", "0.6324771", "0.62742966", "0.62498343", "0.6232317", "0.6227566", "0.62270594", "0.6222787", "0.61528194", "0.6150818", "0.61082155", "0.6105949", "0.6105949", "0.610594...
0.7353592
0
DELETE /businesslines/1 DELETE /businesslines/1.json
def destroy @businessline.destroy respond_to do |format| format.html { redirect_to businesslines_url, notice: 'Businessline was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @line_of_business = LineOfBusiness.find(params[:id])\n @line_of_business.destroy\n\n respond_to do |format|\n format.html { redirect_to(line_of_businesses_url) }\n format.xml { head :ok }\n end\n rescue ActiveRecord::RecordNotFound => e\n prevent_access(e)\n end", "def...
[ "0.72284615", "0.717277", "0.70603615", "0.70232844", "0.7016682", "0.68757087", "0.68564844", "0.6835797", "0.6832398", "0.68290865", "0.6801442", "0.6799794", "0.6799794", "0.67992556", "0.67973363", "0.67968976", "0.67968976", "0.67968976", "0.67968976", "0.6796586", "0.67...
0.773269
0
POST /pexes POST /pexes.json
def create @pex = Pex.new(pex_params) respond_to do |format| if @pex.save format.html { redirect_to @pex, notice: 'Pex was successfully created.' } format.json { render :show, status: :created, location: @pex } else format.html { render :new } format.json { render js...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pex_params\n params.require(:pex).permit(:doc, :razon, :red, :ruc_red, :placa, :nromiddia, :categoria, :fecha_inicio, :hora_inicio, :fecha_fin, :hora_fin, :fecha_apro, :hora_apro, :plaza, :pista, :importe, :nro_compro, :fecha_compro)\n end", "def create\n puts 'AQQQQQUUUUUUUIIIIII'\n json = Act...
[ "0.6051709", "0.6030814", "0.5714717", "0.5687592", "0.56504226", "0.55856496", "0.5558881", "0.55545634", "0.5532031", "0.54828346", "0.54579085", "0.54469544", "0.54175293", "0.5414839", "0.5389546", "0.5387352", "0.537486", "0.53728443", "0.5362736", "0.5362392", "0.535092...
0.6529506
0