query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
651e340ec1f77c716caa115aa14e177a
GET /events/new GET /events/new.json
[ { "docid": "b2b85cf5eec48ec8656904b17480743a", "score": "0.0", "text": "def new\n @event = Event.new\n @event.users.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end", "title": "" } ]
[ { "docid": "f02ab5fdc7f5e6d44bf5a5fd0bec71f7", "score": "0.81601626", "text": "def new\n @event = Event.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "220a62a4f40b7d22da89cb0fdb1b07d...
5d5228f9cde5b67bf8da4734d56743af
Skill Range Determines range for skills
[ { "docid": "42fae01f33cc58e84694127d399861e8", "score": "0.7686718", "text": "def skill_range(skill_id)\n base_range = GTBS.skill_range(skill_id).clone\n return base_range if GTBS::Prevent_Skill_Range_Mod.include?(skill_id)\n base_range = skill_range_mod?(base_range)\n base_range = adjust_ra...
[ { "docid": "e6e5eb7ee9a3556bffdd231550a43d13", "score": "0.802843", "text": "def optimal_skill_range\n if self.optimal_skill_rating.nil? || self.optimal_skill_rating.zero?\n set_optimal_skill_rating\n end\n\n # As the game time gets closer, we should expand the range\n # that we send to...
a83c49f65918974da67cf66fa9be179e
returns label elements uri
[ { "docid": "19aa95d4e4fe57b9c6a1bbfc70472603", "score": "0.79254824", "text": "def label_elements_uri (identifier)\n label_uri = uri(identifier)\n return \"#{label_uri}/elements\"\n end", "title": "" } ]
[ { "docid": "7f030424877c81ba7df070bf1142d821", "score": "0.6733718", "text": "def label endpoint, uri\n query_for_solution = \"select ?label where { <#{uri}> rdfs:label ?label }\"\n endpoint.query(query_for_solution).map { |s| s.to_h[:label] }.first.to_s\n end", "title": "" }, { ...
bd739c9d89df5b57af59c37b6ade49b9
enqueue loop through elements to solve in O(n) time need to use dequeue, enqueue of O(n) =begin to get O(1) dequeing: pop from stack1 need O(n) enqueue: if stack1 not empty move all elements from stack1 to stack2 add element to stack1 move all elements from stack2 to stack1 to get O(1) enqueue: stack1 << x need O(n) de...
[ { "docid": "55f9e0370600151fa580e3f4dc701c11", "score": "0.0", "text": "def better_windowed_max_range(arr,w)\n current_max_range=0\n queue=MinMaxStackQueue.new\n \n (0...w).each do |i|\n \n queue.enqueue(arr[i])\n end\n max=queue.max\n min=queue.min\n current_max_ra...
[ { "docid": "8d88d7781436c9cb8c2c55c77486a6c7", "score": "0.68681794", "text": "def pop()\n last = nil\n @q1.size.times do\n last = @q1.shift\n @q2.push last\n end\n (@q2.size-1).times do \n @q1.push(@q2.shift)\n end\n @q2.shift\n last\n ...
4368d503f850515b919c4da534ee340d
POST /prcs POST /prcs.xml
[ { "docid": "82b4ae8b44ac4ff21991089e3e395995", "score": "0.0", "text": "def create\n create_or_update\n end", "title": "" } ]
[ { "docid": "76a25f6a2ec5525ea047b02bbf470c82", "score": "0.5925517", "text": "def create\n @pr = Pr.new(params[:pr])\n\n respond_to do |format|\n if @pr.save\n format.html { redirect_to(@pr, :notice => 'Pr was successfully created.') }\n format.xml { render :xml => @pr, :status...
869dbd299dcad23931cae83ace8e6786
This method can be called from outside the class.
[ { "docid": "de9160fd04ff5eec161ca01d07993d9e", "score": "0.0", "text": "def about_me\n puts \"I'm #{@name} and I'm #{@age} years old!\"\n end", "title": "" } ]
[ { "docid": "2290804b238fc95bfd6b38f87c6d2895", "score": "0.7110612", "text": "def override; end", "title": "" }, { "docid": "6ab77a9219ee157923bc58599ba6aa77", "score": "0.704751", "text": "def in_use; end", "title": "" }, { "docid": "6ab77a9219ee157923bc58599ba6aa77", ...
9e25d4440ab1999386d911d16791a823
The deserialization information for the current model
[ { "docid": "90f1d9b31e1ae9fc74a4e7a1734f9cba", "score": "0.0", "text": "def get_field_deserializers()\n return {\n \"allowedMemberTypes\" => lambda {|n| @allowed_member_types = n.get_collection_of_primitive_values(String) },\n \"description\" => lambd...
[ { "docid": "613f62eeb3655523fae5d548dc6e7875", "score": "0.6580273", "text": "def get_field_deserializers()\n return {\n \"downloadUrl\" => lambda {|n| @download_url = n.get_string_value() },\n \"fileName\" => lambda {|n| @file_name = n.get_string_val...
748197b4e30c1293f19138a57e71e856
Returns transaction info for the tid
[ { "docid": "360e170cae40a24a4c8c61d5a54193b5", "score": "0.75169134", "text": "def fetch_transaction(tid, address: nil)\n straighten_transaction(api_request(\"/rawtx/#{tid}\"), address: address)\n end", "title": "" } ]
[ { "docid": "d1befedeeec1cb2d939ef5297eb0f1f3", "score": "0.79539466", "text": "def get_transaction_by_tid(tid)\n response = get_transaction(tid, nil)\n end", "title": "" }, { "docid": "db1489dee8dd55c8073c6f709ceb72ec", "score": "0.76906836", "text": "def transactio...
5897f043b891c6db8ffd5b8cb5955c85
GET /homeworks GET /homeworks.json
[ { "docid": "73bf441971f81e46d2b4653f311c328d", "score": "0.7035891", "text": "def index\n @homeworks = Homework.all\n end", "title": "" } ]
[ { "docid": "0a640235106f76685e8b44268e4697e6", "score": "0.7965033", "text": "def index\n @homeworks = Homework.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @homeworks }\n end\n end", "title": "" }, { "docid": "0a640235106f766...
60c9dfdc83491d1992f0945c926c37d4
add Deprecated warning here
[ { "docid": "497cd32076c96ecbd5f6e1220a015c87", "score": "0.0", "text": "def signature_request_final_copy opts\n HelloSign::Resource::SignatureRequest.new get(\"/signature_request/final_copy/#{opts[:signature_request_id]}\")\n end", "title": "" } ]
[ { "docid": "11a441722b7d20049517ac0117251a2a", "score": "0.7798357", "text": "def deprecated(msg)\n loc = caller_locations[1]\n Kernel.warn(\"#{loc.path}:#{loc.lineno}: warning: #{msg}\")\n end", "title": "" }, { "docid": "346558317398b53af9fda8318a2c05e4", "score": "0.76171...
44e5eca615c9456314134ec3406d89e6
The attributes used to update the document
[ { "docid": "de8c1af6c050044b9d44cd462e809b01", "score": "0.0", "text": "def updateable_attributes(include_id = false)\n include_id ? attributes.except(:created_at, :updated_at) : attributes.except(:created_at, :updated_at, :id)\n end", "title": "" } ]
[ { "docid": "f182a2f1ec7e19741c86129661e43fdb", "score": "0.75140566", "text": "def attributes\n @attributes ||= attributes_hash(@doc)\n end", "title": "" }, { "docid": "a277376d69952483140898718223eaf2", "score": "0.73832273", "text": "def attributes_for_update(attribute_...
bcb3207ae5b2e93aa7ddfb3b3fe9f868
Processes click and drag based on what the user is currently dragging
[ { "docid": "748e3d201c0bf57b698bd5d1b01c2578", "score": "0.8143965", "text": "def process_click_and_drag\n if state.click_and_drag == :star\n input_star\n elsif state.click_and_drag == :remove_wall\n input_remove_wall\n elsif state.click_and_drag == :add_wall\n input_add_wall\n ...
[ { "docid": "bd77c778d078a64d98df894cb0f92c4a", "score": "0.82035166", "text": "def process_click_and_drag\n if state.click_and_drag == :slider\n input_slider\n elsif state.click_and_drag == :star\n input_star\n elsif state.click_and_drag == :remove_wall\n input_remove_wall\n e...
73c5fa0667cc24b0fb494702105e1c41
Get summoner objects mapped by standardized summoner name for a given list of summoner names
[ { "docid": "14ed04dd4cab2002a9831b68859e33ee", "score": "0.0", "text": "def by_names(names)\n request_url + \"/by-name/\" + names \n end", "title": "" } ]
[ { "docid": "d571dc12dd3e52294063fe827ebf3420", "score": "0.71736616", "text": "def summoner_by_name(summoner_name)\n summoner_names = array_options(summoner_name)\n summoner_name = summoner_names.first\n raise ArgumentError, 'invalid summoner name' if summoner_names.size != 1\n\n summoners_b...
8a7a7e63314ff0b1c4398b1b99b0d787
Perform a HTTP PATCH request
[ { "docid": "ea5e3871706a2c37ae4b785a01574722", "score": "0.75465417", "text": "def patch(url, options = {}, &block)\n request HttpPatch, url, options, &block\n end", "title": "" } ]
[ { "docid": "8d6a61f3186174209e44862cb0ae05d7", "score": "0.802021", "text": "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'...
543237849569753cd3325e89519cfb34
Identify and describe the ruby method you implemented. sort method sorts based on value Person 4
[ { "docid": "141e178b4c60f791f756fda4cb9a6638", "score": "0.0", "text": "def my_array_deletion_method(source, thing_to_delete)\n source.delete_if {|x| x.to_s.include?(thing_to_delete) }\nend", "title": "" } ]
[ { "docid": "8f26dd2635c1eb29aca80bc1bd5bd467", "score": "0.78851116", "text": "def sort_method; end", "title": "" }, { "docid": "3a19ceba7cdcb752bb2cba11e625d9c2", "score": "0.7370922", "text": "def sort_by\n end", "title": "" }, { "docid": "08a64502f8fb6ce87ca8598914e1e...
d4c11b048f9e6e6f875facb5bb0bb595
Write a method that takes a string, and returns a new string in which every character is doubled. =begin def repeater(str) new_str = '' str.chars.each do |char| new_str << char + char end new_str end =end
[ { "docid": "4b2769409653c4dcb39040ef241ff7b4", "score": "0.8727734", "text": "def repeater(str)\n str.chars.each_with_object('') {|char, str| str << char * 2}\nend", "title": "" } ]
[ { "docid": "feb1ffb0a137d405d6ff3b1222ae409a", "score": "0.90565395", "text": "def repeater(string)\n doubled_str = \"\"\n string.each_char do |char|\n doubled_str << char << char\n # doubled_str.concat(char*2)\n # doubled_str.concat(char, char)\n end\n \n doubled_str\nend", "title": "...
92cc11808cba70a2f3117860baa723fd
Returns an observable sequence that terminates with an exception.
[ { "docid": "1881b010598e7cd9a15c9177a67d5902", "score": "0.5555319", "text": "def raise_error(error, scheduler = ImmediateScheduler.instance)\n AnonymousObservable.new do |observer|\n scheduler.schedule lambda {\n observer.on_error error\n }\n end\n end", ...
[ { "docid": "7a73d3ce5f992063440286512c72df00", "score": "0.59482926", "text": "def defer\n AnonymousObservable.new do |observer|\n result = nil\n e = nil\n begin\n result = yield\n rescue => err\n e = Observable.raise_error(err).subscribe(...
8021269d1f11a0d92efc2ab75e78a447
DELETE /courses/1 DELETE /courses/1.json
[ { "docid": "7db57bdbfd08c0bac5169e26c780473c", "score": "0.77079666", "text": "def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "cbd6685a1a54e9ae70a3fc3d8bd142e7", "score": "0.77230847", "text": "def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :ok }\n end\n end", "title": "" }, { ...
93cdd144ddc1065bddd4915c041fbb6b
DELETE /technique_categories/1 DELETE /technique_categories/1.json
[ { "docid": "96ab46a286b617d791af98959d3df32a", "score": "0.79347974", "text": "def destroy\n @technique_category = TechniqueCategory.find(params[:id])\n @technique_category.destroy\n\n respond_to do |format|\n format.html { redirect_to technique_categories_url }\n format.json { head :...
[ { "docid": "38e6828892e6b6bd682d75ecca0de1fe", "score": "0.74500114", "text": "def destroy\n @technique.destroy\n respond_to do |format|\n format.html { redirect_to techniques_url, notice: t('technique.delete_technique') }\n format.json { head :no_content }\n end\n end", "title":...
a58adfe991d64ecccd71471cde1b8e4b
Return :: (String) check if user is active or not Author:: NamTV
[ { "docid": "a5b3d860cf1ccb00ab521e36507c1aec", "score": "0.0", "text": "def active_for_authentication?\n super && !self.is_deleted\n end", "title": "" } ]
[ { "docid": "29142bc0e63eee3202b0b7cba8403cdd", "score": "0.70573264", "text": "def check_if_author(author)\n if User.find(session[:user_id]).username == author\n true\n else \n false\n end\n end", "title": "" }, { "docid": "a264af3592794175d22d4bfd051419f6", "score":...
f3b7eb264709c5cdc8bba5f1ba0d3cf1
Cancel all streaming. A little more data will be sent, but eventually the upload will be canceled and no more new data will be queued for upload. This happens asynchronously in the stream_file function.
[ { "docid": "afdd559438c6ae5e1530eff87523b689", "score": "0.7507232", "text": "def cancel_streaming\n @looping = false\n @canceled = true\n end", "title": "" } ]
[ { "docid": "e7cfb5146b4b573f4390422c8b08b455", "score": "0.76995754", "text": "def cancel!\n @stream.cancel\n unblock!\n end", "title": "" }, { "docid": "01066422987108e5b88ba6e2b1253439", "score": "0.6788515", "text": "def cancel\n send({type: :rst_stream, error: :...
53751e2c5f215ca5bab777d4f2d4c8d7
Initialize the different permissions with respect to the attributes of the user parameter.
[ { "docid": "ef228fbe5b6b967b4d9773004d75806f", "score": "0.6465256", "text": "def initialize(user)\n # Define abilities for the passed in user here. For example:\n #\n # user ||= User.new # guest user (not logged in)\n # if user.admin?\n # can :manage, :all\n # else\n # ...
[ { "docid": "918d55d8f7a349ca45ee6ceba54cd6b4", "score": "0.7373769", "text": "def initialize user\n @user = user\n\n if user.blank?\n user_blank_permission\n else\n common_user_permission\n end\n\n end", "title": "" }, { "docid": "0aa148ae2ad8c2ffe47300e3ce846e1b", ...
d43698ff96ecdaffec73656f7ffb030c
Does the project has any plugins as submodule installed?
[ { "docid": "84955fa8d1bcd04c6eca36c8db78ee94", "score": "0.7948939", "text": "def plugins_installed?\n !@plugins.empty?\n end", "title": "" } ]
[ { "docid": "1f4e93a1bfd5847060be79b58150fca2", "score": "0.7975237", "text": "def plugin?\n @root.parent.basename.to_s == 'plugins'\n end", "title": "" }, { "docid": "49a5d94b4afad90fd601bc03e742aafb", "score": "0.78233796", "text": "def some_plugins?\n Dir.glob(File.join(...
dbd39889717a961353d666c3531404d0
O(n) list = [ 0, 3, 5, 4, 5, 10, 1, 90 ] p my_min_1(list) => 5 p my_min_2(list) => 5 You have an array of integers and you want to find the largest contiguous (together in sequence) subsum. Find the sums of all contiguous subarrays and return the max.
[ { "docid": "236b6f7b45295b3ecbeb5e813321b95a", "score": "0.0", "text": "def sub_sum_1(list)\r\n subarr = []\r\n\r\n list.each_with_index do |ele1, idx1|\r\n list.each_with_index do |ele2, idx2|\r\n if idx2 >= idx1\r\n subarr << list[idx1..idx2]\r\n end\r\n end\r\n end\r\n suba...
[ { "docid": "285f57f927d1a1dfd37f43894eb28ee6", "score": "0.8773588", "text": "def largest_contiguous_subsum_1(list)\n subs = []\n (0...list.length).each do |idx| #O(n)\n (idx...list.length).each do |idx_2| #O(n)\n subs << list[idx..idx_2] #O(n)\n end\n end\n max = l...
a206e431b208f379d540905f60821f3a
UNFORTUNATELY has_many ASSOCIATION DOESN'T WORK IN DEEP LEVEL (active_model_serializer notorious bug)
[ { "docid": "c6a3dcd9b5f833c631aadd3f543fb12c", "score": "0.0", "text": "def children\n nested_children(object.children)\n end", "title": "" } ]
[ { "docid": "2423ba271598ab15b33bf5cdd0a5da0d", "score": "0.659118", "text": "def associated_records\n super || []\n end", "title": "" }, { "docid": "afa82b693cbcc26f6897deb38909946c", "score": "0.653243", "text": "def use_active_record_serialization\n\n # Activate checking...
746ed6734b3474a81985e3120cf5e6b1
Returns the node at the given index.
[ { "docid": "031ab4670089107887f1585e7d17ee65", "score": "0.0", "text": "def at(index)\n\t\tcount = 1\n\t\tif @head == nil\n\t\t\treturn nil\n\t\telse\n\t\t\ttmp = @head\n\t\t\tuntil count == index \n\t\t\t\tif tmp.next == nil\n\t\t\t\t\treturn nil\n\t\t\t\telse\n\t\t\t\t\ttmp = tmp.next\n\t\t\t\t\tcount...
[ { "docid": "562cc9d4a7a56414c6f0abe2812a0d69", "score": "0.8734538", "text": "def node_at(index)\r\n tree_at(index).first\r\n end", "title": "" }, { "docid": "562cc9d4a7a56414c6f0abe2812a0d69", "score": "0.8734538", "text": "def node_at(index)\r\n tree_at(index).first\r\...
eb8462affba7b1e0706ea235cd99fa00
Test validation for sets containing different types
[ { "docid": "a11bb0f22a377ac273d99e1a808ba5a2", "score": "0.6044361", "text": "def test_validation_heterogeneous_sets()\n sb = @dfp.new_statement_builder do |b|\n b.with_bind_variable('var_name', [1,2,'3'])\n end\n assert_raise(RuntimeError) { sb.to_statement() }\n end", "title": "" ...
[ { "docid": "4a72c25e16375fda215433f2d260efdd", "score": "0.6813579", "text": "def test_typecheck\n\t\tassert_raise( RuntimeError ) { Statset.new(\"1\", [:s]) }\n\t\tassert_raise( RuntimeError ) { Statset.new(1, \"[:s]\") }\n\t\tassert_raise( RuntimeError ) { Statset.new(1, []) }\n\t\tassert_raise( Runti...
7b43e4455f3b7f161f76110c39fdc3a4
Dispose of Command Window
[ { "docid": "b31b0341f7c87029bc0b42e984b5d8b0", "score": "0.90551305", "text": "def dispose_command_window\n @command_window.dispose\n end", "title": "" } ]
[ { "docid": "0b406b560af6c08ea98ead8e8fcac112", "score": "0.6843894", "text": "def destroy\n # typically the ensure block should have this\n # @panel = @window.panel if @window\n #Ncurses::Panel.del_panel(@panel) if !@panel.nil? \n #@window.delwin if !@window.nil?\n $log.debug ...
17b2c3c8f35f9a13fc845004335b9a65
Find patient and set params def find_patient
[ { "docid": "f1aa397c7be211c0aeb841e92a56a4e6", "score": "0.0", "text": "def set_patient_params\n params.require(:patient).permit(:first_name, :last_name, :email, :password, :password_confirmation)\n end", "title": "" } ]
[ { "docid": "d0c889c467527027483ffe16334f4678", "score": "0.77171963", "text": "def find_patient\n @patient = Patient.find(params[:id])\n end", "title": "" }, { "docid": "c8f6de9ea7ad98c7392fe3ea324e7f8c", "score": "0.72706145", "text": "def set_patient\n \n @patient = P...
633fb87cce47a18cc7acbc3c14a0f7b7
def green(text) colorize(text, 32) end
[ { "docid": "688042d3f311e75f781383f6bb90b579", "score": "0.8969604", "text": "def yellow(text)\n colorize(text,33)\n end", "title": "" } ]
[ { "docid": "c9bddbadab64d2a20ef07337c7624fbb", "score": "0.9841234", "text": "def green(text); colorize(text, 32);end", "title": "" }, { "docid": "458697e2dc78f15363f4acc85b4e6bbf", "score": "0.9749481", "text": "def green(text)\n colorize(text, 32)\nend", "title": "" }, { ...
0d377eb3e47c19b15ef6fb15f9b0dae3
GET /user_settings/1 GET /user_settings/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "d571eb6b52f1effba45455ed6fcfc5bb", "score": "0.75871843", "text": "def settings\n @user = current_user\n \n respond_to do |format|\n format.json { render :json => @user }\n format.html { render :layout => 'home'}\n end\n end", "title": "" }, { "docid": "8db...
c0fcc19d4878a7b066083168728ab0bc
DELETE /travels/1 DELETE /travels/1.json
[ { "docid": "d283c39be7205769fd6a67b3eccbf31e", "score": "0.67553216", "text": "def destroy\n @travel.destroy\n respond_to do |format|\n format.html { redirect_to travels_url, notice: 'Travel was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": ...
[ { "docid": "f7c5dbe52c6f82c2aa3b21135579d57d", "score": "0.7158701", "text": "def destroy\n @travel = Travel.find(params[:id])\n @travel.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_travels_url) }\n format.xml { head :ok }\n end\n end", "title": "" }...
8cd3c99bb57288e9ba2765b1710b203b
NOTE: this has caused problems in the past. Remove this section to use surveyor's builtin tools.
[ { "docid": "209ca7276da5de5dccb5cd8152a0eed5", "score": "0.0", "text": "def index\n\tredirect_to :controller => 'consent', :action => 'nothing_here'\n end", "title": "" } ]
[ { "docid": "954c5828178f6e4a659c40ef92736547", "score": "0.6089646", "text": "def helpful!\n\n\t\tend", "title": "" }, { "docid": "f5190a25e970d6e0a162027de30e8cfe", "score": "0.58561224", "text": "def tools\n end", "title": "" }, { "docid": "20888292727941835888e2d0f908...
975a830017e0ab4ceeaa88a427ee27fb
Constructs a new instance.
[ { "docid": "9d2a130c422e750cd1935fe30b8c5b95", "score": "0.0", "text": "def initialize(ruby_values = nil, struct_value = nil)\n super(self.class.binding_type, ruby_values, struct_value)\n end", "title": "" } ]
[ { "docid": "e2b31d60b2b5b380040a867c381a1b70", "score": "0.8045547", "text": "def new\n \n end", "title": "" }, { "docid": "e2b31d60b2b5b380040a867c381a1b70", "score": "0.8045547", "text": "def new\n \n end", "title": "" }, { "docid": "e2b31d60b2b5b380040a867c381a1b70...
c050839e26c108c991d74b16c98382dc
DELETE /projects/1 DELETE /projects/1.json
[ { "docid": "e4eabccf3254c09325b990a2565f4cb9", "score": "0.0", "text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: 'Project was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" ...
[ { "docid": "ce10449f9ce0fd62fdc6ce11492b8372", "score": "0.7899063", "text": "def destroy\n @root = \"projects\"\n \n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\...
a7320f4ac86993df15198434b9263f7e
Consume HTTP response details and set them into a response object. == Parameters: res:: A WEBrick::HTTPResponse object headers:: A hash containing HTTP response headers body:: A string containing the HTTP response body status:: An integer indicating the response status
[ { "docid": "2cdf610951b17afbbdab81fe18063468", "score": "0.82076836", "text": "def set_response! res, headers, body, status\n headers.each do |name, value|\n res.header[name] = value\n end\n res.body = body\n res.status = status\n end", "title": "" } ]
[ { "docid": "bbe5ec31c8876fea22ddcd5fa66a6abd", "score": "0.68615735", "text": "def process_http_request(res)\n case res\n when HTTP_SUCCESS\n Log.debug('Http success')\n res\n when HTTP_CLIENT_ERROR\n fail Error.from_http_response(res)\n else\n Log.debug('...
dcf062deb170e2de34a7163e23f53315
remove columns with link and procs Links are not rendered so sending them is a waste Proc cannot be serialized so are not sendable.
[ { "docid": "d9bf95065965886dd6a42149078e987e", "score": "0.5370591", "text": "def _sanitize_data(d)\r\n data = d.dup\r\n #Rails::logger.info(\"TableBuilder#_sanitize_data data=#{data.inspect}\")\r\n num = 1\r\n data.delete_if { |element| element[:method_name] == :link || element[:bod...
[ { "docid": "42d66668addbde937880f403dc6def3f", "score": "0.5351568", "text": "def free_arel_columns\n @arel_columns = nil\n end", "title": "" }, { "docid": "1bfcb7b219a520ac719d671c3d7b5d94", "score": "0.5347646", "text": "def strip_columns\n user_fields = %W(\n t...
f7e15cf5da56da199dc66c2adc7094ad
Sets the value of the `delete_protected` attribute.
[ { "docid": "833a372d099c14ac3a5b7bd3115b22f5", "score": "0.9125941", "text": "def delete_protected=(value)\n @delete_protected = value\n end", "title": "" } ]
[ { "docid": "e20ba2ecfb8a3769bc1b2bbe84da39e6", "score": "0.7924948", "text": "def delete_protected\n @delete_protected\n end", "title": "" }, { "docid": "e20ba2ecfb8a3769bc1b2bbe84da39e6", "score": "0.79239273", "text": "def delete_protected\n @delete_protected\n end"...
b842228023ab285b0fbc3a3285b12fe0
Watch the backup dirs for changes startup = true or false, if true it forces a sync without checking if something changed.
[ { "docid": "1160bf42e6f8a68cfa62dd3f01dba7fb", "score": "0.6810996", "text": "def watchDirs\n Daemons.daemonize\n\n\t@backupList.each do |dir|\n\t\tputs \"Watching #{dir}\"\n\t pid = fork do \n Listen.to(dir) do |modified, added, removed|\n syncNow(dir)\n\t\t\t\tend\n\t \t\t\tsyncNow(...
[ { "docid": "1024b5c7d0120f953c72103ae1210d04", "score": "0.64289385", "text": "def start_wake_on_filesystem_change\n listener = Listen.to('.') do |_modified, _added, _removed|\n @wake_up_now = true if @wake_up_now == false\n end\n listener.start\n end", "title": "" }, { "docid...
40937a870438e9731fb09f97ec481cd6
context.frame_method(frame_position=0) > sym Returns the sym of the called method.
[ { "docid": "7612a7e9409361fe8de2df5a02355d21", "score": "0.0", "text": "def frame_id(*args)\n #This is a stub, used for indexing\n end", "title": "" } ]
[ { "docid": "c48f716c42f9842f906468893376e18f", "score": "0.69512594", "text": "def method_symbol; end", "title": "" }, { "docid": "b061f8bf77110c8d9f1e8aa1bc79cd2e", "score": "0.66349834", "text": "def sym\n @sym\n end", "title": "" }, { "docid": "6c0988e45fd576518b8a...
59c2d83d66fbf92647f315aec72be419
Supported options: :extension file extension for URL links (default is .html)
[ { "docid": "d4d497004ec7f062a977c296e27f25c5", "score": "0.0", "text": "def initialize(processed_docs, paths, deployment_info, options = {})\n # this class relies on graphwiz (dot), make sure we can access that\n raise \"Could not find the 'dot' tool needed to generate a dependency graph!\" un...
[ { "docid": "11219e7885ff1fc12515049efbda2d56", "score": "0.72136873", "text": "def file_extension\n 'html'\n end", "title": "" }, { "docid": "b938b37982f493d01719e636b5310b74", "score": "0.7069441", "text": "def extension\n @extension #||= '.html'\n end", "title": "" ...
1804fc92889b58920996c27073b05505
def after_sign_in_path_for(resource) request.env['omniauth.origin'] || stored_location_for(resource) || root_path end
[ { "docid": "0ea990439bf971adc3088904bac1f378", "score": "0.8375176", "text": "def after_sign_in_path_for(resource)\n session[:previous_url] || root_path\n end", "title": "" } ]
[ { "docid": "becf1c70ed4034c48a02040d6f4d9a6d", "score": "0.9818072", "text": "def after_sign_in_path_for(resource)\n request.env['omniauth.origin'] || stored_location_for(resource) || root_path\n end", "title": "" }, { "docid": "becf1c70ed4034c48a02040d6f4d9a6d", "score": "0.9818072"...
6d25741a59daf1f8ec009284eabc56ff
Darwin: Open the webpage in a new chrome tab.
[ { "docid": "87e3030f5598b8e30e05a7b63d47974a", "score": "0.8389033", "text": "def browser_open_darwin(url)\n system(\"open\", \"-a\", \"chrome\", url)\n end", "title": "" } ]
[ { "docid": "2ca304c4087b8c19a68c7fe1e2ff279b", "score": "0.78198725", "text": "def open_in_browser(url)\n uri = URI.parse(url)\n uri = URI.parse(\"http://#{url}\") unless uri.is_a? URI::HTTP\n\n ascript <<-EOD\n tell application \"Google Chrome\"\n open location \"#{url}\"...
09a6c7b1501a5e3be52fe20c5896b803
Determines whether or not the attributes that were updated constitute a versionable change for example a user requesting feedback will change the :feedback_requested flag but that should not create a new version or notify any subscribers! Note that some associated models :touch the plan when they are updated so that a ...
[ { "docid": "9184fe2685477ae2099c634716021af7", "score": "0.7449975", "text": "def versionable_change?\n saved_change_to_title? || saved_change_to_description? || saved_change_to_identifier? ||\n saved_change_to_visibility? || saved_change_to_complete? || saved_change_to_template_id? ||\n sa...
[ { "docid": "9ebb7bd5e95da3bfe5daaa455ed54b0d", "score": "0.74152017", "text": "def versioned_attributes_changed?\n versioned_attributes != original_attributes\n end", "title": "" }, { "docid": "3e47bec5177f9b1097cba27c63d67305", "score": "0.67333806", "text": "def require...
a4a3822fe3aa3e7cc43f68f19b240ae0
accept connections from client processes
[ { "docid": "673ebbef81bf97258a33a3f8c4b931aa", "score": "0.77528644", "text": "def accept_connections\n loop do\n # socket open for clients\n # handle multiple client requests\n Thread.start(listening_socket.accept) do |client|\n yield(client)\n client.close\n end\n ...
[ { "docid": "9ccee50bec418eea84fb7f2e1ed2db90", "score": "0.7325659", "text": "def accept\n\t\t\tclient = @client_queue.pop\n\t\t\t@clients << DRbSSHServerConn.new(uri, @config, client)\n\t\t\t@clients.last\n\t\tend", "title": "" }, { "docid": "967f55031ae08ffe3efe8c6e2df6c7a4", "score": ...
b61df1079fb0a94ef99efd648c77b1c5
setup_carthage_env check and setup the environments
[ { "docid": "6a59a366f93dcd3d6b295a66acf0ed42", "score": "0.71958435", "text": "def setup_carthage_env(current_dir)\n # mkdir if folder is NOT existed.\n %W(#{current_dir}/Carthage #{current_dir}/Carthage/.tmp #{current_dir}/Carthage/Checkouts #{current_dir}/Carthage/Build #{current_dir}/Carthage/Repo)...
[ { "docid": "bd688e9c22e3f7616caaa7e222117c91", "score": "0.75262123", "text": "def check_and_set_environment\n check_env\n set_env\n end", "title": "" }, { "docid": "a14a1f31374c591082d08ee44d27b53c", "score": "0.7341856", "text": "def setup_environment; end", "title...
9504185465acbb8c094ebf81d4845adf
p bsearch([1, 2, 3], 1) => 0 p bsearch([2, 3, 4, 5], 3) => 1 p bsearch([2, 4, 6, 8, 10], 6) => 2 p bsearch([1, 3, 4, 5, 9], 5) => 3 p bsearch([1, 2, 3, 4, 5, 6], 6) => 5 p bsearch([1, 2, 3, 4, 5, 6], 0) => nil p bsearch([1, 2, 3, 4, 5, 7], 6) => nil Merge Sort base Case if the the current element has an array length of...
[ { "docid": "31de807e9bd527c0663dc2681f1fd4b9", "score": "0.6933465", "text": "def merge_sort(array)\n p array\n return array if array.length < 2\n\n mid_i = array.length / 2\n left_arr = array[0...mid_i] \n right_arr = array[mid_i..-1] \n\n sorted_left = merge_sort(left_arr)\n so...
[ { "docid": "a58caa264c93ec7e7e4d9c00245ed6af", "score": "0.77733964", "text": "def bsearch(arr, target)\n if arr.length == 1 \n if arr[0] == target\n return 0\n else\n return nil\n end\n end\n arr.sort!\n middle = arr.length / 2\n left = arr[0......
599ee80ec83b1e30663fb62cc57236be
GET /hostels/new GET /hostels/new.xml
[ { "docid": "cb67a70296abe753b30e56e8cc574647", "score": "0.7862856", "text": "def new\n @hostel = Hostel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @hostel }\n end\n end", "title": "" } ]
[ { "docid": "dcb0b3ad3a99238fefb4e755a8406fe2", "score": "0.7233975", "text": "def new\n @search = Host.search params[:search]\n @host = Host.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @host }\n end\n end", "title": "" }, { ...
7a87decfa4b36192954e241faf95760a
DELETE /isbns/1 DELETE /isbns/1.json
[ { "docid": "0f38dd8d3e7ce88adaeb5dab2027d3fd", "score": "0.0", "text": "def destroy\n @isbn.destroy\n respond_to do |format|\n format.html { redirect_to isbns_url, notice: 'Isbn was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "8c41a800fd4e0a250bab5f25f5b73b81", "score": "0.6843892", "text": "def destroy\n @sn = Sn.find(params[:id])\n @sn.destroy\n\n respond_to do |format|\n format.html { redirect_to sns_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "doci...
0603400b85844b0c69822cb96f4dceda
Gets name of a politician.
[ { "docid": "131a73efb1c1a62eb5bbaaab8e5d2646", "score": "0.0", "text": "def find_name(response, selector)\n return nil unless response.css(\"#{selector} > p.mb-0\")[0]\n\n response.css(\"#{selector} > p.mb-0\")[0].text\nend", "title": "" } ]
[ { "docid": "728822bb03e5b9941e6238ac20e79522", "score": "0.73482496", "text": "def technician_name\n\t\tself.technician.name\n\tend", "title": "" }, { "docid": "b88617f1a81a7bf6d54b6cd9c2444723", "score": "0.6464145", "text": "def name\n if person\n person.name\n els...
402fe06a7e8047874bc633fa70602320
Instantiate the new test operation.
[ { "docid": "957c89bee36e286321c3cc7b65725e0f", "score": "0.7104606", "text": "def initialize(test, spec)\n @test = test\n @arrange = spec['arrange']\n @act = spec['act']\n @op = @act['operation']\n @arguments = @act['arguments']\n @assert = spec['ass...
[ { "docid": "a98d48c5bc479d816d850a2dbf3f818a", "score": "0.69606525", "text": "def initialize(data, test)\n @pre_data = data\n @description = test['description']\n @upload_date = Time.now\n if test['assert']['error']\n @operation = UnsuccessfulOp.new(self, test)\n ...
dd19bcc2bb3921b304b4d8a53b853880
POST /v1/users/:user_id/playlists Add a playlist
[ { "docid": "4c27d4a6308aca38ff8312d1f280fd35", "score": "0.8163068", "text": "def create\n @playlist = @user.playlists.new(playlist_params)\n if @playlist.save\n render json: @playlist\n else\n render json: { error: @playlist.errors }, status: :unprocessable_entity\n en...
[ { "docid": "f2934fe59104d3762f73f052d484b7ff", "score": "0.8097459", "text": "def create\n @user = current_user\n @playlist = @user.playlists.new playlist_params\n if @playlist.save\n redirect_to user_path(@user)\n else\n render 'new'\n end\n end", "title": "" }, { ...
353e375fabc398d53bdb58291f7d7187
End class methods Overrides Devise method to allow nonpassword updates for Facebook users
[ { "docid": "3f7a832fd610336a8e5893eecdf2218d", "score": "0.7541278", "text": "def update_with_password(params = {})\n if has_facebook_profile?\n params.delete(:current_password)\n update_without_password(params)\n else\n super\n end\n end", "title": "" } ]
[ { "docid": "245e174ebc62326d8d828efea5cad1e1", "score": "0.7187441", "text": "def password_required?\n super unless has_facebook_auth\n end", "title": "" }, { "docid": "385c1872898bebe07bcfe4292eeb1353", "score": "0.7122851", "text": "def update\n @user = User.find(current_use...
9bb0a5b3b137cf40f6c1fc11edd3d8b0
ask eventmachine reactor to track its latency
[ { "docid": "7a0d628acb6d9dbc7136de31e89bde6d", "score": "0.5036174", "text": "def recent_latency\n Goliath::Plugin::Latency.recent_latency\n end", "title": "" } ]
[ { "docid": "293c5f15df2caa9bc9970021974f3031", "score": "0.6719956", "text": "def latency; end", "title": "" }, { "docid": "05e84072bbe30189b22fcfb5f4aaf39c", "score": "0.64958453", "text": "def latency=(_arg0); end", "title": "" }, { "docid": "1f2a015b4abd0cfa72aa27e3c7a...
ecb2fc76b8ee89b9969588edb357b86d
Get the component of v
[ { "docid": "080bf9d507d205cdec14518a67255532", "score": "0.86071366", "text": "def component_of(v)\n @component[v]\n end", "title": "" } ]
[ { "docid": "2e6321b098c7654406983bd26c88d924", "score": "0.6543584", "text": "def vertex_value(v)\n x, y = *vertex_value_coords(v)\n label(x, y, format_angle(f.angle(v), t.angles.unit))\n end", "title": "" }, { "docid": "a3bc9c0141fb23805c811175543cf23c", "score"...
3a444b30752d6fe6b5110a498b6937be
Sets the allowCreateUpdateRemoveTabs property value. If set to true, members can add, update, and remove tabs.
[ { "docid": "230ff2b209cec5e3d45d8609dd7324fb", "score": "0.75009185", "text": "def allow_create_update_remove_tabs=(value)\n @allow_create_update_remove_tabs = value\n end", "title": "" } ]
[ { "docid": "856f162809c57ea9288d6c9fa61005d7", "score": "0.7216565", "text": "def allow_create_update_remove_tabs\n return @allow_create_update_remove_tabs\n end", "title": "" }, { "docid": "7cef41ee7c98006f0043272aff07c015", "score": "0.5443148", "text": "d...
b14a32a14d71a8401dda759c04cce7e5
Return the accessibility settings of the given service ('ICMP', 'web', or 'SNMP')
[ { "docid": "027401a3a3047e54c9251fa9863a3e7d", "score": "0.0", "text": "def get_network_firewalled_service(options = {})\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'network_id' => options['network_id'],\r\n 'service' => options['service']\r\n )\r\n ...
[ { "docid": "1aa253d35f8183272b948cabdab5c1d0", "score": "0.58991367", "text": "def get_settings(service, number)\n get(Fastly::Settings, service, number)\n end", "title": "" }, { "docid": "a00f167936eb0b666f5fb757d7519c8e", "score": "0.5788064", "text": "def get_nat_service_confi...
6ae68a792253f576d5e5d4730497257f
GET /sales_orders/1 GET /sales_orders/1.xml
[ { "docid": "76b8aca7185f31d74d3049f48c3b4fc8", "score": "0.7111975", "text": "def show\n @sales_order = SalesOrder.show(params[:id])[0]\n @items = @sales_order.order_items\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @sales_order }\n ...
[ { "docid": "bea41773350461628bbf322d85fe56be", "score": "0.75625783", "text": "def index\n @sales_orders = SalesOrder.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sales_orders }\n end\n end", "title": "" }, { "docid": "ee1a...
850a1e27d1f3f9fc94f18b83faa5f163
Internal logic used by delete_logic delete a resource immediately.
[ { "docid": "d43c887da50686f4c1c96b70ea763895", "score": "0.0", "text": "def delete_now\n revisions.each do |rev_id| \n CouchDB.delete( \"#{uri}?rev=#{rev_id}\" )\n end\n true \n end", "title": "" } ]
[ { "docid": "c9ec6c9a6cd087d7c6f23ed42685e98a", "score": "0.73792756", "text": "def delete_resource\n nil\n end", "title": "" }, { "docid": "618b8a7e9f73f2daeb32a81371864250", "score": "0.72594213", "text": "def delete\n if(resource.exist?)\n resource.lock_check if res...
3a22b739f9a2d5ffb30db706432ac77f
Date of first vocab entry
[ { "docid": "74e3933a1411da22b07ec6010ea3eb41", "score": "0.820833", "text": "def first_vocab_date \n arr = []\n self.student_books.each do |student_book|\n if student_book.vocab_activities.length > 0 \n arr << student_book.first_vocab\n end\n end...
[ { "docid": "300d1e54ad49803ef9c54721efd9e456", "score": "0.71571624", "text": "def start_date\n entries.map { |e| Date.parse e.date }.sort.first\n end", "title": "" }, { "docid": "7fb57f808e813c78c1e12fd9445f0b9b", "score": "0.6720013", "text": "def date_created\n first(...
60ce6f3613dbba1a063afddc8ffb12ae
the 'end' on the above line is not required.
[ { "docid": "a5b4083cba1553ae230699b236f1f1d0", "score": "0.0", "text": "def looper\r\n for i in 1..10\r\n puts i\r\n end\r\n # missing 'return i' here\r\nend", "title": "" } ]
[ { "docid": "a6960725efed274cd9e888f404be15d7", "score": "0.7921519", "text": "def end_line; end", "title": "" }, { "docid": "a6960725efed274cd9e888f404be15d7", "score": "0.7921519", "text": "def end_line; end", "title": "" }, { "docid": "a6960725efed274cd9e888f404be15d7",...
6cb1893932124bb1ddad22b28dd5e1d7
check if the stop is on the left side of "Union Square" in the given line
[ { "docid": "3caa7d0f1ddf109387df344d5ae039f0", "score": "0.74680626", "text": "def is_left_to_union(line, on_stop, changing_stop)\n line.index(on_stop) <= line.index(changing_stop)\nend", "title": "" } ]
[ { "docid": "11ce3a41d2e5cc9e25b3e2a841941156", "score": "0.66364115", "text": "def trip_one_bwd( line_one, first_stop )\n i = $line[line_one].index( first_stop ) - 1\n while i >= $line[line_one].index( \"Union Square\" )\n $stop_array.push($line[line_one][i])\n i -= 1\n end\nend", ...
9ffeaa3bfea6ed9612fc22b7cdb256a1
Me busca la ciudad por el id
[ { "docid": "84cd2cb23914182b9698ee96429587d6", "score": "0.7486979", "text": "def set_ciudad\n @ciudad = Ciudad.find(params[:id])\n end", "title": "" } ]
[ { "docid": "8128d182f3ca910012f1b8753ee398ca", "score": "0.7545522", "text": "def set_ciudad\n @ciudad = Ciudad.find(params[:id])\n end", "title": "" }, { "docid": "a620342c1aab8af52bf9c257da87f6be", "score": "0.70802015", "text": "def set_ciudadano\n @ciudadano = Ciudad...
e330b6c57627da9e9b2a61adca180db6
murmur(3) Create a function finalGrade, which calculates the final grade of a student depending on two parameters: a grade for the exam and a number of completed projects. This function should take two arguments: exam grade for exam (from 0 to 100); projects number of completed projects (from 0 and above); This functio...
[ { "docid": "151b49c88196211aedda848db5dd30fe", "score": "0.6857967", "text": "def finalGrade(exam, num)\n if exam > 90 || num > 10\n return '100'\n elsif exam > 75 && num > 5\n return '90'\n elsif exam > 50 && num > 2\n return '75'\n else\n return '0'\n end\ne...
[ { "docid": "1bc5ab584a922b9b75b6d1c0ce1e3c78", "score": "0.8100012", "text": "def final_grade(exam, projects)\n return 100 if exam > 90 || projects > 10\n return 90 if exam > 75 && projects >= 5\n return 75 if exam > 50 && projects >= 2\n 0\nend", "title": "" }, { "docid": "b12a78b2c67c9...
a3b2044f0008bf788299dd2565f32579
returns groups that are most credited the maximum number of results is set by limit
[ { "docid": "69bf92161d9934ee0f8670a76aa8a718", "score": "0.68955016", "text": "def most_credited(limit=10)\n type = self.to_s\n title_or_name = (type.downcase == \"user\" ? \"name\" : \"title\")\n self.find_by_sql(\"SELECT n.* FROM #{type.downcase.pluralize} n JOIN creditation...
[ { "docid": "a9cd2c3e74d0e81d5cb4503fe987ecbe", "score": "0.6978772", "text": "def top_groups\n groups.select{|x| x.rank < 10}\n end", "title": "" }, { "docid": "2fd7ffd28557efdde33654de2be0b621", "score": "0.62885594", "text": "def by_at_most(maximum); end", "title": "" }, ...
11d9cdc2e7cf3744b90f646010af3967
GET /recruitments GET /recruitments.json
[ { "docid": "4a33bff7c3e1818153d269f8d7123e19", "score": "0.71406853", "text": "def index\n @recruitments = Recruitment.all\n end", "title": "" } ]
[ { "docid": "fe17c59a25bddba94a6bbea471e7d929", "score": "0.7062497", "text": "def index\n @recruiters = Recruiter.all\n\n render json: @recruiters\n end", "title": "" }, { "docid": "ccb1fdb1bd74270442c5e7eeaa9fd48d", "score": "0.65674734", "text": "def index\n @recruits = R...
d969e7b8c50640c00831bede8a05fafd
convertthe string to an int before pushing onto the array
[ { "docid": "e9bf2aa8e284a6a22936d8b777de6e37", "score": "0.0", "text": "def quicksort array\n len = array.length \n #base case\n return array if len <= 1\n\n $numOfcomparisons += len - 1 \n\n #set pivot value to last element and move it to first element in the array\n pivot, array[len-...
[ { "docid": "fd27601f702ada397819bcfa83a2e8fc", "score": "0.6807323", "text": "def convert_To_Int( string_of_ints )\n string_of_ints.split(\" \").map { |s| s.to_i }\nend", "title": "" }, { "docid": "c8d46cdcf89448cb2ee70dd6498296a6", "score": "0.6570023", "text": "def str_to_int(str_...
3f52973818698070d105a2c20fdb77a5
Serializes information the current object
[ { "docid": "ccf5c1679fc201492ac944a27cdb3934", "score": "0.0", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"alternateNotificationEmails\", @alternate_notification_emails)\n ...
[ { "docid": "d162e297d0f84ca205afa381c3f6a428", "score": "0.782961", "text": "def serialize\n Marshal.dump(self)\n end", "title": "" }, { "docid": "762bca0e2db3ff19d91cc4521bb1e1d9", "score": "0.7646631", "text": "def serialize(object) end", "title": "" }, { "docid": "...
498a077dbe2fbf4fc402df11b746f392
GET /categories/new GET /categories/new.json
[ { "docid": "9725a72642308bd15c95907601e9402f", "score": "0.79364836", "text": "def new\n @category = Category.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @category }\n end\n end", "title": "" } ]
[ { "docid": "917053f9504e476ec58a62ab77d5eba0", "score": "0.79390717", "text": "def new\n @category = Category.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @category }\n end\n end", "title": "" }, { "docid": "c5c04c315d378b861d4e59...
f28d4dd51b97a68cf6126ed7cd7716ea
Relative path to the Dockerfile for image building
[ { "docid": "acbe4a730bb4d79b0f9aa1745fbb89b2", "score": "0.7290292", "text": "def dockerfile\n fetch(:dockerfile, 'Dockerfile')\n end", "title": "" } ]
[ { "docid": "3eec554fa16103ea5437106a223b3978", "score": "0.7104532", "text": "def image_dir(image)\n relative = File.join \"docker\", env, image\n File.expand_path relative, Dir.pwd\n end", "title": "" }, { "docid": "135373e45ab9f92c576fb55c5633f5df", "score": "0.7097674", ...
3528b935e82de6f38a4520ae86e4b81f
=begin Essai pour des tests particuliers =end
[ { "docid": "ccf3285de5d38987fabf927665a298c6", "score": "0.0", "text": "def log mess\n SiteHtml::TestSuite::log mess\nend", "title": "" } ]
[ { "docid": "8fbc98d9068bd9c82033a031286f0a1e", "score": "0.7354219", "text": "def tests; end", "title": "" }, { "docid": "8fbc98d9068bd9c82033a031286f0a1e", "score": "0.7354219", "text": "def tests; end", "title": "" }, { "docid": "8f1c94592f39e6f7649463118849a3c2", "...
b697921879140a3974d1fdf1d7eb5f55
DELETE /sessions/1 DELETE /sessions/1.json
[ { "docid": "98efac2fd21df00d29f5e556c61241e9", "score": "0.0", "text": "def destroy\n sign_out\n redirect_to login_url, alert: \"Successfully logged out\"\n end", "title": "" } ]
[ { "docid": "4817ee133904703ad0d703c6c8a7919b", "score": "0.7547095", "text": "def destroy\n @session = Session.find(params[:id])\n @session.destroy\n\n respond_to do |format|\n format.html { redirect_to sessions_url }\n format.json { head :ok }\n end\n end", "title": "" }, ...
6cdf6de1d56756d21cd3250ad4812df2
Get the shell command to link the project WIX object files
[ { "docid": "8cfb5247a19b7500535108723a8b79b7", "score": "0.51017255", "text": "def light_command(out_file, is_bundle: false)\n if is_bundle\n <<-EOH.split.join(\" \").squeeze(\" \").strip\n light.exe\n -nologo\n #{wix_light_delay_validation}\n -ext WixUIExte...
[ { "docid": "b256582ed58a5ad17d6b33d48cd8271b", "score": "0.6409834", "text": "def do_link exe, objects\n sh \"#{$CC} #{objects.join ' '} -o #{exe} #{$L_FLAGS.join ' '}\"\nend", "title": "" }, { "docid": "24383b8adea1524077087ed8b4710364", "score": "0.6338946", "text": "def link_it(e...
935b1055afe6f4f4bb11d0d7486e8456
Return the real class name
[ { "docid": "aead1edaf4fcb17e61509677972d5387", "score": "0.0", "text": "def realname\n alias? ? aliasof.name : name\n end", "title": "" } ]
[ { "docid": "5ffb25bb6de398db660b368b95ed323b", "score": "0.86456037", "text": "def class_name\n @class_name ||= derive_class_name\n end", "title": "" }, { "docid": "8de6a8803463d03859b0a5bc9d1e77f7", "score": "0.84982204", "text": "def class_name\n name = @klass.name\n...
4cf0db82c66036df0d6614c512447888
connects record to virtual (self)
[ { "docid": "a463b61a4b8d523045d437c351d86a00", "score": "0.6234847", "text": "def connect!\n record.connect_to(self)\n end", "title": "" } ]
[ { "docid": "0126b1a0ea437285337e4a804bb03e2b", "score": "0.65893126", "text": "def set_new_record(record); end", "title": "" }, { "docid": "bd896cd85d00402445003a46f3f5ae71", "score": "0.6213855", "text": "def record; end", "title": "" }, { "docid": "bd896cd85d00402445003...
d2ea1792b58f578f2a3741d73ee58784
test "the truth" do assert true end
[ { "docid": "1b6f47eb5eb28e646c81f3ef9094ceea", "score": "0.0", "text": "def new_phonestatus(phoneApplyStatus)\n \tApply.new(\n \t\tapplyNumber: 292,\n \t\tnameOrFIO: \"Айдол Уильям\",\n \t\tstreet: \"ул.Ленина\", \n\t\t\thouse: 88,\n\t\t\tphoneApplyStatus: phoneApplyStatus,\n\t\t\tapplyTreatedBy: \"...
[ { "docid": "c2125db88556c19c7c74d67db3bdefbc", "score": "0.9148474", "text": "def test_true\n assert true\n end", "title": "" }, { "docid": "7bea728be8b7c29dd40451830363b35a", "score": "0.91415703", "text": "def test_true\n assert true\n end", "title": "" }, { "doci...
43a83609ff3e3a3640bb9154d02972a5
PATCH/PUT /unit_templates/1 PATCH/PUT /unit_templates/1.json
[ { "docid": "2d4dfa789f0dff3e6e75cd19ee5eeea9", "score": "0.69676995", "text": "def update\n respond_to do |format|\n if @unit_template.update(unit_template_params)\n format.html { redirect_to development_area_building_url(@building.development_area, @building), notice: 'Unit template was ...
[ { "docid": "76947a495f8371e8e772fdb40663d3b8", "score": "0.6653482", "text": "def update_report_template(args = {}) \n put(\"/reports.json/template/#{args[:templateId]}\", args)\nend", "title": "" }, { "docid": "ddba937b47ed093b8511ff72da694e19", "score": "0.6601521", "text": "def up...
9566a3b6c50754306f1a2bf06e8528b8
Raise exception if action was not completed successfully
[ { "docid": "75ac3bc910bcd3000ec8bfa45fa85a90", "score": "0.6567731", "text": "def successful_action(action)\n status = action.complete!\n unless(status.success?)\n raise Error::CommandFailed.new \"Command failed `#{action.command}` - #{action.stderr.read}\"\n else\n yield\n ...
[ { "docid": "04dff28b61b66548621e4176d285decb", "score": "0.7295559", "text": "def attempted_action; end", "title": "" }, { "docid": "3badfd1164d63951912328f21aa1c098", "score": "0.6617957", "text": "def fail?(action)\n !success? action\n end", "title": "" }, { "do...
892e89a1ac1f8f32b6a72c4d8f6df3c8
> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 230, 57960] inputs: Array (an arr of denoms that are part of an Egyptian Fraction rep of the num) outputs: a Rational Number (two ints reping the num and denom of a rat num) reqs: take an arr reping an Egyptian Fraction rep of the num rtn a Rational Number struct: num (to hold sum ...
[ { "docid": "9402e88e7a70fb16cc4a013d9d465527", "score": "0.7453417", "text": "def unegyptian(arr)\n sum = 0\n arr.each { |denom| sum += Rational(1, denom) }\n sum\nend", "title": "" } ]
[ { "docid": "15d68e5ca234332f6c529776b939b0c3", "score": "0.74681574", "text": "def egyptian(rat_num)\n arr = []\n sum = 0\n temp_sum = sum\n denom = 1\n while sum < rat_num && denom < 1_000_000\n temp_sum += Rational(1, denom)\n if temp_sum > rat_num # overshot\n temp_sum = sum # reset\n...
20670571a617533d54897240fa06241b
POST /workhours POST /workhours.json
[ { "docid": "afe4f715731a190d414f04c965fcda7e", "score": "0.72800684", "text": "def create\n @workhour = Workhour.new(workhour_params)\n\n respond_to do |format|\n if @workhour.save\n format.html { redirect_to @workhour, notice: 'Workhour was successfully created.' }\n format.jso...
[ { "docid": "f65b5d312b7f92c9ecc83aa52dc2d992", "score": "0.7540915", "text": "def create\n @work_hour = WorkHour.new(work_hour_params)\n\n if @work_hour.save\n respond_with(@work_hour, location: work_hours_url, notice: 'Work hour was successfully created.')\n else\n respond_with(@work...
0efcbbe15857b01649d6834b52282f92
Is this object a MIDI message?
[ { "docid": "38a36e037edd886034fb79e0a8ba850c", "score": "0.91035825", "text": "def message?(object)\n object.kind_of?(MIDIMessage)\n end", "title": "" } ]
[ { "docid": "bb1333a9f7c8cdd7431244c36f8b3937", "score": "0.6833307", "text": "def message?\n false\n end", "title": "" }, { "docid": "8ed7b5ef699b479b1c4ffaafd71f7a64", "score": "0.6764224", "text": "def me?\n @msg.me?\n end", "title": "" }, { "docid":...
5f5cbde05b93ba8fe8593920bedfa71e
Returns the Base64encoded version of +bin+. This method complies with RFC 2045. Line feeds are added to every 60 encoded characters. require 'base64' Base64.encode64("Now is the time for all good coders\nto learn Ruby") Generates: Tm93IGlzIHRoZSB0aW1lIGZvciBhbGwgZ29vZCBjb2RlcnMKdG8gbGVhcm4g UnVieQ== source://base64//ba...
[ { "docid": "9a256b1439378911d331418b5df4ebbc", "score": "0.78822505", "text": "def encode64(bin); end", "title": "" } ]
[ { "docid": "8d853c5900a4641889ffc30ca0e5ab74", "score": "0.8233629", "text": "def encode_base64( bin )\n\t[ bin ].pack( \"m\" ).gsub( /\\s/, \"\" )\nend", "title": "" }, { "docid": "c10d087e640e6c238ba8030c8d5e2ce1", "score": "0.8103266", "text": "def encode_binary(bin)\n Base...
a24ce4d6dc296a08354be3414fb3c6e6
Splits an email address domain into tokens. Returns an array of tokens that were found in the Authors unique_affiliation_combos
[ { "docid": "4d6018afc6ee770290b1aafef4621b8d", "score": "0.6119007", "text": "def email_affiliation_match(user, author)\n minimal_token_size = 3\n \n return [] unless user && author\n email_affiliation_match = user.email.sub(/^.+@/, '').split(/[^0-9^a-z^A-Z]/).\n ...
[ { "docid": "542d1d6ca6d00972eb441d2f7bfa3668", "score": "0.661529", "text": "def split_email u\n u.email && u.email.gsub(/\\s+/m, ' ').strip.split(\" \") || []\n end", "title": "" }, { "docid": "e1e11d8d438733bfb7f9b7619d147b00", "score": "0.6611546", "text": "def parse\n arra...
a2a8ec87edbd39063e3e8075a1146893
called when request is DELETE and quary defines "id"
[ { "docid": "8f2a9e9787b2e13305b41a0068ac3faf", "score": "0.0", "text": "def delete\n\t\tfalse\n\tend", "title": "" } ]
[ { "docid": "c6798424d46577fa4ffac5eda4ecc0c6", "score": "0.7392463", "text": "def delete\n url = prefix + \"delete\" + id_param\n return response(url)\n end", "title": "" }, { "docid": "689d5a07a403c4b765ba178e4aff08a3", "score": "0.7164659", "text": "def delete\n client....
84e7610d5570b33f0a2eb0ffb089a1d7
Retrieve a record from the AWS Route53 service
[ { "docid": "fc0dfc3ff15994f7f04f41bdd25d2ade", "score": "0.6805864", "text": "def get_record(fqdn)\n\n url = \"https://dnsapi.cn/Record.List\"\n\n h = HTTPClient.new()\n\n default_params = {\n :login_email => \"\"\n }\n params = {\n\n }.merge(default_params)\n\n ...
[ { "docid": "d02b121681d1430748efafa67ece2a53", "score": "0.7331747", "text": "def get_record(hosted_zone, record_name, record_type='A')\n\n #record_type = options.fetch(\"record_type\", 'A')\n records = AwsPocketknife::Route53.get_record(hosted_zone_name: hosted_zone,\n ...
fffae8983ee83464165c0016b6a5d8c6
Custom ActionView::Baserender wrapper which silences all the log printings. Helps to keep the Rails logs clean during errors. source://webconsole//lib/web_console/view.rb41
[ { "docid": "a1f90837e73f00f6f6216933960e1a30", "score": "0.0", "text": "def render(*_arg0); end", "title": "" } ]
[ { "docid": "3f68fdd1b009d4d8fe602e973ab4837a", "score": "0.6296925", "text": "def colorize_logging; end", "title": "" }, { "docid": "16030e45a38232d1b9eefe13dd0d8bf8", "score": "0.6149509", "text": "def noisy_logger\n logger.info 'some very noisy logging'\n end", "title":...
8cf6bb133874553981634d5d85ef5517
GET /servers/1 GET /servers/1.json
[ { "docid": "5d95bfbe4e74ab1938a9a2d0b9549818", "score": "0.65454656", "text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @server }\n end\n end", "title": "" } ]
[ { "docid": "5470e53212426fc808d7cf3d24680747", "score": "0.7759568", "text": "def servers\n response = get \"server\"\n data = JSON.parse response.body\n data[\"servers\"][\"server\"]\n end", "title": "" }, { "docid": "9169d5bb8ca2efc7681814498e1c0242", "score": "...
8c9fe055f73c0e4db588a86b1483aedb
Trim the input parameters to the attributes so we don't get an error in a mass assignment statement NOTE this has a bug because it doesn't recognize ruby attributes assigned via attr_accessor
[ { "docid": "5f37f46ca885096f782f0c65eac63af2", "score": "0.67917866", "text": "def trim_params(params)\n Hash[*(params.select { |k,v| new.attributes.keys.include? k.to_s}.flatten)] \n end", "title": "" } ]
[ { "docid": "ae374c2f9082665ddfe1005f6328a444", "score": "0.7029378", "text": "def sanitize_attributes\n self.name = \"#{self.name}\".strip\n end", "title": "" }, { "docid": "53d40a8102efa32fb0490622fc4e1b8f", "score": "0.7002345", "text": "def model_attributes(params)\n clea...
1d143f2941bc73fb0e425dea6c36041b
GET /templates GET /templates.json
[ { "docid": "8577769d9662b9eb0f332471e963ed34", "score": "0.67261654", "text": "def index\n @templates = Template.all\n end", "title": "" } ]
[ { "docid": "02d40ffd34632b276b3a900afa1cebd8", "score": "0.81084657", "text": "def templates\n response = get \"storage/template\"\n data = JSON.parse response.body\n data\n end", "title": "" }, { "docid": "88c544c265ccbafeced4b371a73363e4", "score": "0.8019614", "text": "d...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "c185ed47a60d985c65611053ee48e075", "score": "0.0", "text": "def update!(**args)\n end", "title": "" } ]
[ { "docid": "184b1b1ed771473d3eb9f338c0734c38", "score": "0.73066413", "text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end", "title": "" }, { "docid": "5076c5a88404ae72986f958710f5687a", "score": "0.72631145", "text": "def update...
aff394f1a012028ec8cd6e468f288b75
POST /fish or /fish.json
[ { "docid": "d75280d9f3cb967749c3ac9853abb33d", "score": "0.7165734", "text": "def create\n @fish = Fish.new(fish_params)\n\n respond_to do |format|\n if @fish.save\n format.html { redirect_to @fish, notice: \"Fish was successfully created.\" }\n format.json { render :show, statu...
[ { "docid": "f5976a24f2a139f0c2a0931ff0b92a24", "score": "0.7155967", "text": "def create\n @fish = Fish.new(fish_params)\n\n respond_to do |format|\n if @fish.save\n format.html { redirect_to @fish, notice: 'Fish was successfully created.' }\n format.json { render :show, status:...
25c9ffb7da06eee1917981de43ee182f
returns formatted text for an activity item
[ { "docid": "e582d41995911f68b6474f4df7b6606e", "score": "0.65484285", "text": "def formatted_text\n\t\tcase self.text\n\t\t\twhen \"space_created\"\n\t\t\t\treturn \"Space created, \\'#{self.reference.name}\\'\"\n\t\t\twhen \"discussion_created\"\n\t\t\t\treturn \"Discussion added, \\'#{self.reference.s...
[ { "docid": "ee9f9bd3f2c6bc06b86d084dab2226a5", "score": "0.64408165", "text": "def format\n f = @item_attributes.first.format\n f.to_s unless f.nil?\n end", "title": "" }, { "docid": "9ae0117ea9e5e3d3984bce37dffd89d9", "score": "0.629578", "text": "def format\n @ite...
ac2c20b04db3e3ffe4bc7184edfeb6b4
replace $INJECT_DATA with json settings String[]= is used here intentional cause `sub` has different behaviour for example `sub` deletes escaped chars like `\\e602`
[ { "docid": "6cffeb657c68aa880ae68559f1b16f0f", "score": "0.5707952", "text": "def inject_data(template)\n template['$INJECT_DATA'] = model.to_json\n template\n end", "title": "" } ]
[ { "docid": "d75c0707f391a3803b8c635e0343eaa7", "score": "0.57273924", "text": "def prepare_data(data)\n data.gsub(/Do some fancy data manipulation here/, '')\n end", "title": "" }, { "docid": "5d380558a2b6d24c2234b6a596cbeab5", "score": "0.55720514", "text": "def transform(ke...
5afc13214d5166d6397a72fad68daab8
POST /users POST /users.xml
[ { "docid": "9cfbe8a7827b7cda0943d4348df000a1", "score": "0.5750517", "text": "def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to(@user, :notice => 'User was successfully created.') }\n format.xml { render :xml => ...
[ { "docid": "4794c3e6e2db462f4d8769453efddedd", "score": "0.71678036", "text": "def post_users(users)\n self.class.post('https://api.yesgraph.com/v0/users', {\n :body => users.to_json,\n :headers => @options,\n })\n end", "title": "" }, { "docid": "df2e8c709ee6535536069a3...
9991aa7cd5535aba3a50d9b87d6fe386
Problem 1: Multiples of 3 and 5
[ { "docid": "2d81cf59a089c571605f34f7d869a634", "score": "0.68581843", "text": "def sum_of_multiples(number)\n sum_three = 0\n sum_five = 0\n sum_total = 0\n count_three = 3\n count_five = 5\n\n if number < 5\n sum_five\n else\n while count_five < number\n sum_five += count_five\n ...
[ { "docid": "cdbb5b76f976a14af514e61be202eb3e", "score": "0.79322284", "text": "def multiples_3_5_v2\n\tsum = 0\n\n\t1.upto(999) do |i|\n\t\tif i % 3 == 0 || i % 5 == 0\n\t\t\tsum = sum + i\n\t\tend\n\tend\n\n\treturn sum\nend", "title": "" }, { "docid": "2fe7f7b53a925a0423d1938c6a8391f8", ...
14bbd3c6cc1d1dd940d45f51ed50ead0
Soluition from the end to the begin First call run on all nodes with children, when an edge (goal) is found visit it, then mark all linked nodes as visited, an so on if root node has no marked neighbours there is no solution
[ { "docid": "dcdb896f6d75053744c13b0aace7b164", "score": "0.0", "text": "def initialize(cell, visited_cells = [])\n visited_cells = visited_cells\n cell.open_neighbours.each { |n| Solver.new(n, visited_cells) }\n if cell.edge? || cell.visited_neighbours.any?\n cell.visit!\n # build_vis...
[ { "docid": "61b6aef6fc1572a1f54864ba469a9f17", "score": "0.7179883", "text": "def solve\n #walk through vertices, using modified A* algorithm to find the most direct route to finish node\n consider_set = Containers::PriorityQueue.new {|v1, v2| (v1 <=> v2) == -1} #MinHeap. Lowest priority/total-co...
e043b6716554aacf9fc089ea80df98d6
Add one or more members to a set.
[ { "docid": "024aa620c9eda4d2dc24f055aa540213", "score": "0.6128643", "text": "def sadd(key, *members)\n members.flatten!(1)\n send_command([:sadd, key].concat(members))\n end", "title": "" } ]
[ { "docid": "68989b2d535b1817789cc2d422fcf500", "score": "0.68984723", "text": "def add_members(*name)\n @members << name\n end", "title": "" }, { "docid": "ff5e6abf223a86d4335f6b07308cc695", "score": "0.6784741", "text": "def members(*names)\n names.each { |name| add(name)...
c6e4a385dc620e2c1bd0407db649550f
Displays all the zoos.
[ { "docid": "7d8b32a4446f9d1c89039c9d2706036b", "score": "0.64058656", "text": "def list_zoos\n puts\n Zoo.all.each do |zoo|\n puts zoo\n end\n puts\nend", "title": "" } ]
[ { "docid": "171f802c107b535ac5165c163440c5f0", "score": "0.7212957", "text": "def index\n @ozs = Oz.all\n end", "title": "" }, { "docid": "5bed67bb8d368d09d8b5326773b0c2be", "score": "0.7127141", "text": "def index\n @zetsufudaichos = Zetsufudaicho.all\n end", "title": ""...
2771ad97e4bf98924188d7498bd5cf65
Gets the contentType property value. The contentType property
[ { "docid": "934a2b77d2bcaa47b40862dd31941811", "score": "0.76415795", "text": "def content_type\n return @content_type\n end", "title": "" } ]
[ { "docid": "8a32ff0e5d96e8d560ed915e645803b0", "score": "0.7662862", "text": "def content_type\n instance_read(:content_type)\n end", "title": "" }, { "docid": "66eac599211dc503887c23dcfd78fe95", "score": "0.7645803", "text": "def content_type\n return @content_typ...
183028ad0314b5a68c35248abd553e6a
) Tells the object to move
[ { "docid": "b68e8bc2ba2096729bb058f11fb16d37", "score": "0.0", "text": "def goto(x,y,duration = Graphics.frame_rate,jump = 0.0)\n @move_obj.move_to(x,y,jump,duration)\n end", "title": "" } ]
[ { "docid": "40d1a785b3f22bf6236087535568e0b5", "score": "0.81916106", "text": "def move\n\n end", "title": "" }, { "docid": "144325f73246b9e44d0eb338a7b62719", "score": "0.81836754", "text": "def move\n \n end", "title": "" }, { "docid": "ea0b7232f59f3d4bd2a9723cfd56...