query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
f3aa070d1da46c97138a3fcc8fd412c6 | Force a fetch of availability information. | [
{
"docid": "0cdcd2e3f0d150a9066cf0ecbd00c781",
"score": "0.769841",
"text": "def refresh_availability\n @availability = fetch_availability\n end",
"title": ""
}
] | [
{
"docid": "71ad985915331aecde510c9f6aed83fc",
"score": "0.74917245",
"text": "def fetch_availability\n return unless supports_availability?\n index_availability || availability_service.get_availability(self)\n end",
"title": ""
},
{
"docid": "ba03ca2d0c516cb8f45d7c9df4fc46d3",
... |
f8763b8f44b63fa633c6e7810785b00e | == 73 LS Solution: | [
{
"docid": "6b7aeafacc867dd6a552b86ce81a96bd",
"score": "0.0",
"text": "def find_dup(array)\n array.find {|el| array.count(el) == 2 }\nend",
"title": ""
}
] | [
{
"docid": "273e3dd5d0367c8fde5a9652b24d6922",
"score": "0.6303356",
"text": "def sa_is_induce(s, ls, sum_l, sum_s, lms)\n n = s.size\n sa = [-1]*n\n\n buf = sum_s.dup\n lms.each{ |lms|\n if lms != n then\n sa[buf[s[lms]]] = lms\n buf[s[lms]] += 1\n end\n }\n\n buf = sum_l.dup\n s... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "2b0a79bd4b38233cd9dca334efec7e7e",
"score": "0.0",
"text": "def set_challenge\n @challenge = Challenge.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.6163163",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.6045976",
"text": "def action_hook;... |
54b3e47ec3e29b9515f83b8be6d2aa18 | Validate parameters for create npm package Validate parameters for create npm package | [
{
"docid": "40a73aa0fa96153093bc3a5bc170545a",
"score": "0.5600458",
"text": "def packages_validate_upload_npm(owner, repo, opts = {})\n packages_validate_upload_npm_with_http_info(owner, repo, opts)\n return nil\n end",
"title": ""
}
] | [
{
"docid": "5410367ba018cbdaa1284484112829b3",
"score": "0.6482336",
"text": "def create\n Packages.create_package( cookies[ :user_id ], params[ :requireddestination ], params[ :requireddescription ],\n params[ :requiredreceiverAddress ],params[ :requiredorigin ],params[ :requiredreceiverMobNumbe... |
0cfc872d03761c285051c7beb74dc0ab | find any previous searches if you are looking at your own profile | [
{
"docid": "faef1497c2eec3d1ef5421d55a3cff10",
"score": "0.6795128",
"text": "def find_previous_searches\n search=[]\n if logged_in? && current_user.id == Person.find(params[:id]).user.id\n search = UserSearch.all(:order => \"created_at DESC\", :conditions => { :user_id => current_user.id})\n... | [
{
"docid": "5b1d0236c141b4f49a0d7d6ee217af4d",
"score": "0.62895364",
"text": "def searches_from_history\n []\n end",
"title": ""
},
{
"docid": "24753a2723b5ed66bf9f34c44b478202",
"score": "0.5973057",
"text": "def search_through_names\r\n\t\tprofile_list = Array.new\r\n\t\ti... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "e71ae5aed83c596f85ccf2fa4fc7ff56",
"score": "0.0",
"text": "def set_moment\n @moment = Moment.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60339177",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.60135007",
"text": "d... |
4c3fd5240ad478dab930a84f20eba799 | List of sources for task. | [
{
"docid": "715bdfb482391d2d6c2eb663197bd01e",
"score": "0.7554658",
"text": "def sources\n @sources ||= []\n end",
"title": ""
}
] | [
{
"docid": "c293250739e0ff1b8941c1f7f237eb8b",
"score": "0.76872855",
"text": "def task_sources\n result = Set.new\n for ev in sources\n gen = ev.generator\n if gen.respond_to?(:task) && gen.task == task\n result << ev\n ... |
e9badba62fa4b1cf7cd6c6a98aa6cd54 | POST /current_situation_countries POST /current_situation_countries.json | [
{
"docid": "c038d349d441b8f866e617a5a0cdfa56",
"score": "0.6945557",
"text": "def create\n @current_situation_country = CurrentSituationCountry.new(current_situation_country_params)\n\n respond_to do |format|\n if @current_situation_country.save\n format.html { redirect_to @current_sit... | [
{
"docid": "0cafd5df77b1d93b8a4378eec10c56bc",
"score": "0.6772775",
"text": "def create\r\n begin\r\n country = Country.create_identity!(map_countries_params,map_countries_effective_from,map_countries_effective_to)\r\n\r\n render :json => country\r\n rescue Exception => e\r\n rende... |
a37ff114af7788ea21f570921ad819cd | returns array of student objects | [
{
"docid": "f96ca747098a825992a06401247f2588",
"score": "0.0",
"text": "def import\n raw_grade_data = File.read(@file_name)\n student_grades_array = CSV.parse(raw_grade_data)\n\n students = []\n student_grades_array.each_with_index do |student, index|\n next if index == 0\n student... | [
{
"docid": "3087a0ef59a024e9d68dc61b1751d8f9",
"score": "0.78566635",
"text": "def students\n object.group.students.map do |student|\n Student.serialize(student)\n end\n end",
"title": ""
},
{
"docid": "58fc774bce2a69ec75cfdc01de0287f7",
"score": "0.77294916",
"text": "de... |
27ea1cfa343d9a73b1986e267d656082 | TODO: More test cases for deleting other keys, and deleting multiple keys | [
{
"docid": "2852f977f5ba3f351ba5875323839fb4",
"score": "0.0",
"text": "def should_deep_clone(o1, o2)\n expect(o1).to eq(o2)\n expect(o1).not_to equal(o2)\n\n # TODO: Add test cases that show that all sub-elements are cloned properly\n end",
"title": ""
}
] | [
{
"docid": "2c5de3f651e373808629f278a0f5a9f6",
"score": "0.7900607",
"text": "def delete(_key) end",
"title": ""
},
{
"docid": "86220d3b1d84d8c58682b9bdca45d381",
"score": "0.77245086",
"text": "def delete(key); end",
"title": ""
},
{
"docid": "86220d3b1d84d8c58682b9bdca4... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "52e2e7204623c468af6df99606a66448",
"score": "0.0",
"text": "def set_post\n @post = Post.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60339177",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.60135007",
"text": "d... |
bc688cf075ffd70ce5f10383402da397 | Returns an array with the constant paths that would be unloaded on reload. This predicate returns an empty array if reloading is disabled. | [
{
"docid": "a19dd92b7d673079c01ccaae7debf6ef",
"score": "0.737368",
"text": "def unloadable_cpaths\n to_unload.keys.freeze\n end",
"title": ""
}
] | [
{
"docid": "bb8918c6ad64d403a25beb98516e9c23",
"score": "0.7018042",
"text": "def paths(reload = false)\n thread_local_store.keys(reload).map(&:to_s)\n end",
"title": ""
},
{
"docid": "9c77ee9c7b27a877891826c279ddeb3c",
"score": "0.6981975",
"text": "def all_loaded_consta... |
fe1a27e96e7a3edef74dbb7889917051 | Allow reading and writing cell values by their accessor name. | [
{
"docid": "ec4fbacc3f4593d373ef9e5317e1b21a",
"score": "0.57944185",
"text": "def method_missing(name, *args, &block)\n return super unless @table.accessors?\n\n name =~ /^(\\w+)(=)?$/\n name_mod, assign = $1, $2\n index = @table.index_for_accessor(name_mod... | [
{
"docid": "5b43a61319339522ca9462d3257b4d30",
"score": "0.6919787",
"text": "def at_accessor(name)\n index = @table.index_for_accessor(name)\n raise InvalidColumnAccessor, \"No column named #{name}\" unless index\n\n @data[index]\n end",
"title": ""
},
{
"docid": "cdc83fd1... |
b36e4b716dabe2cc31aa8bbe80dc2abe | Do we still need to remember the login token, or has it expired? | [
{
"docid": "94e8532f4dab809c0e7016edaf78dc9c",
"score": "0.7931684",
"text": "def remember_token?\n remember_token_expires_at && Time.now.utc < remember_token_expires_at\n end",
"title": ""
}
] | [
{
"docid": "e416c5485b3e4cabc35f74524ad5f426",
"score": "0.79719174",
"text": "def token_is_not_expired\n ((Time.now-self.login_link_sent) /60) < 2\n end",
"title": ""
},
{
"docid": "b1c9618915aa42f98d0be5cf0af882ef",
"score": "0.79580384",
"text": "def remember_token?\n remem... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "dcb516bfa249012d05431156e3fad6a3",
"score": "0.0",
"text": "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\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... |
17eb9495f0a1d993ec463d678f047460 | POST /blogcounts POST /blogcounts.json | [
{
"docid": "c9d33670253253778d147f04a543c4e0",
"score": "0.6912742",
"text": "def create\n @blogcount = Blogcount.new(blogcount_params)\n\n respond_to do |format|\n if @blogcount.save\n format.html { redirect_to @blogcount, notice: 'Blogcount was successfully created.' }\n forma... | [
{
"docid": "6e2b9b0aae7c6be9f347b72ad81b6f09",
"score": "0.68196434",
"text": "def index\n @blogcounts = Blogcount.all\n end",
"title": ""
},
{
"docid": "4e20c8b9328388a2497b0c3e4fbefe9c",
"score": "0.66357446",
"text": "def blogcount_params\n params.require(:blogcount).perm... |
be664cb3394a49e3332eba71bfe877d6 | Assign a default response block so that the request works automatically. | [
{
"docid": "4552700e446c757455c7b9b2aa4d32af",
"score": "0.69242096",
"text": "def assign_default_response(action_name, has_format=false)\n end",
"title": ""
}
] | [
{
"docid": "37166b137e9c0276f4c6f9fb4b3da925",
"score": "0.75362265",
"text": "def respond(&block)\n @response_block = block\n end",
"title": ""
},
{
"docid": "7de276823f8f70522d6d51d6065dea07",
"score": "0.72216773",
"text": "def response(&block)\n @response ||=... |
504142549cd3c5177525e55f8961e797 | GET /settings GET /settings.json | [
{
"docid": "9fe0b8564ccbb06ec3a9534fb706c82e",
"score": "0.0",
"text": "def index\n @settings = Setting.all\n @users = User.all\n @new_user = User.new\n end",
"title": ""
}
] | [
{
"docid": "8f49ceab271a71065a239f49b097ccc6",
"score": "0.8220326",
"text": "def get_settings\n get_uri = @data['uri'] + '/settings'\n response = @client.rest_get(get_uri, @api_version)\n @client.response_handler(response)\n end",
"title": ""
},
{
"docid": "b4dc549f2658a08... |
1d665670e7a43b2717313aac2d903369 | GET /contexts/1 GET /contexts/1.xml | [
{
"docid": "e75427ee433ec4ab0dc2e510a22132ae",
"score": "0.53697926",
"text": "def show\n @context = Context.where(:user_id => current_user.id).find_by_slug(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @context }\n end\n end",
... | [
{
"docid": "189d6ce5aece6a4a47fc82e59de4e01a",
"score": "0.6803532",
"text": "def get_context\n synchronize do\n # The URL to get the context list from sesame\n dir = \"#{@options[\"host\"]}:#{@options[\"port\"]}/openrdf-sesame/repositories/#{@options[\"repo\"]}/contexts\"\n\n ... |
8a10b4970554933aeab91c3da7565f41 | Displays dashboard with map | [
{
"docid": "bf91befa2b55fabb9933919fc2aa6e0e",
"score": "0.0",
"text": "def dashboard\n puts request.remote_ip\n end",
"title": ""
}
] | [
{
"docid": "65a377c811927048e465a3bc05a04893",
"score": "0.76615113",
"text": "def map\n # expires_in 1.year, public: true\n set_metadata({ 'title' => translate('classes.map_title') })\n render layout: 'minimal'\n end",
"title": ""
},
{
"docid": "e41d73c86977d05a24f63b71770a55a9",
... |
8065d26e16e76aeb3c41844b16b79858 | GET /api/v1/charities GET /api/v1/charities.json | [
{
"docid": "f3c7b9be54958d5d4a937da0a1921feb",
"score": "0.66424936",
"text": "def index\n # TODO(chandler37): kaminari pagination support\n\n if params[:search].present?\n @charities = if Charity.respond_to?(:search) && ENV[\"ALGOLIA_APPLICATION_ID\"].present?\n ... | [
{
"docid": "3c06488cb71c708712f13a7c79c0414f",
"score": "0.75164515",
"text": "def index\n @charities = Charity.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @charities }\n end\n end",
"title": ""
},
{
"docid": "9582ddeda6cb870... |
82d3b04ec275073b80df965cd7af758f | code your input_to_index and move method here! | [
{
"docid": "6c9d3e71f58b60005bd3119d3a07c072",
"score": "0.0",
"text": "def input_to_index(input)\n input.to_i - 1\n end",
"title": ""
}
] | [
{
"docid": "cbc59d25a99ba9f0daab01f5c0e0e6cf",
"score": "0.7807381",
"text": "def input_to_index(move)\n index = move.to_i - 1\nend",
"title": ""
},
{
"docid": "2f317f684d596164f64a913b1d1827e5",
"score": "0.76495695",
"text": "def input_to_index(move)\n move.to_i - 1\nend",
"t... |
66f04e19ee6df4c1f8406b27eeb97f92 | GET /selection_flute_sizes GET /selection_flute_sizes.json | [
{
"docid": "2c97ce0b6c1fdcb9ab9b05c2abbbb9b6",
"score": "0.73134583",
"text": "def index\n @selection_flute_sizes = SelectionFluteSize.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @selection_flute_sizes }\n end\n end",
"title": ""
}... | [
{
"docid": "2b013a4f910b80ce6ce4e6b2524bf9eb",
"score": "0.7424034",
"text": "def sizes\n select_sizes(@list)\n end",
"title": ""
},
{
"docid": "ed2aa2cb9573982ce72299a65f714904",
"score": "0.70622563",
"text": "def show\n @selection_flute_size = SelectionFluteSize.find(pa... |
e9462366e47ee49e0d82a020d414c928 | This method is used to split a hand. It sets the is_split attribute (important for determining BlackJack hands) and returns the new hand. | [
{
"docid": "6c26cfca0f801347297607d1293354d1",
"score": "0.7999659",
"text": "def split\n @is_split = 1\n @is_ace_split = 1 if has_aces\n hand = Hand.new\n hand.is_split = 1\n hand.is_ace_split = 1 if has_aces\n hand.hit(@cards.slice!(1))\n return hand\n end",
"title": ""
}
] | [
{
"docid": "7eae8a59eafdd593e5ef084773a6c7ff",
"score": "0.80820084",
"text": "def split_hand(hand)\n if self.can_split_hand(hand)\n @num_hands += 1\n @@total_hands += 1\n i = @hands.length\n @hands[i] = hand.split\n self.place_bet(@hands[i])\n return @hands[i]\n else... |
c83389513563057f6e97391ebce34298 | Halt processing and return a 404 Not Found. | [
{
"docid": "cecfb3bc77dce2348e8f04b4b83f6eb6",
"score": "0.0",
"text": "def not_found(body = nil)\n error 404, body\n end",
"title": ""
}
] | [
{
"docid": "4f2b6809f006dbdb87b9358783b00fe9",
"score": "0.8612811",
"text": "def not_found\n halt 404\n end",
"title": ""
},
{
"docid": "35e765f736186001334f7e9290477bbd",
"score": "0.83274025",
"text": "def not_found!\n res.status = 404\n render \"public/shared/404\"\... |
5c7fa2b8dc4f7b16fb350a9f07354359 | Copy all memeber from parent category | [
{
"docid": "6ec02fe71b157ab481b008fe66b00efe",
"score": "0.0",
"text": "def copy_from_category(category_id)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'categoryId', category_id);\n\t\t\tclient.queue_service_action_call('categoryuser', 'copyFromCategory', kparams);\n\t\t\tif (client.is_multireq... | [
{
"docid": "6a46e1fd29a8e5811e7bedd76edf3701",
"score": "0.5963111",
"text": "def clone\n copy = super\n transaction do\n copy.save!\n\n %w[\n registration_information support information_source advance_directive\n ].each do |assoc|\n copy.send(\"#{assoc}\\=\", send(as... |
714981c8dc8035b4881d90d19ef73f46 | Create a new list INPUT: list name (string) OUTPUT: empty hash DEF method create_list Initialize a new, empty hash END | [
{
"docid": "430b92d1765becaa0c70ff83f1021b19",
"score": "0.68790203",
"text": "def new_list\n Hash.new\nend",
"title": ""
}
] | [
{
"docid": "af899fb1d27c18bf9b051216090b4999",
"score": "0.84327215",
"text": "def new_list(list_name)\n\t$list_name = Hash.new(0)\nend",
"title": ""
},
{
"docid": "489693e4ff209af9033d2e298a18b6b0",
"score": "0.800952",
"text": "def create_list\n puts \"----------------------... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "a1fbec22ef15dcf1fa5f7b24a858fca1",
"score": "0.0",
"text": "def set_orden\n @orden = Orden.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60339177",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.60135007",
"text": "d... |
01809760467b6cc5f0a68eb13db8836e | Makes it possible to use backbone's builtin save method. Backbone by default sends data in the request body whereas our server expects typical form data. If the request is a POST or PUT, we merge the request body into the params to be sent to the server. | [
{
"docid": "de7f58dfcb41ee07328e86a85a8e737f",
"score": "0.0",
"text": "def parse_content_body\n if put_or_post? && request.content_type.include?(\"application/json\")\n body_params = request.body.read\n parsed = body_params && body_params.length >= 2 ? JSON.parse(body_params) : nil\n ... | [
{
"docid": "f2117a3d4fb3cf836fc0902f0a45cdba",
"score": "0.64134836",
"text": "def save\n method, path = id ? [:post, :update] : [:put, :create]\n self.attributes = Connection.send(method, create_route(path), attributes_without_blanks).body['data']\n self\n end",
"title": ""
},
... |
93ceb0bcb9d0e5f3ebde54899c253600 | POST /accounting_classifications POST /accounting_classifications.json | [
{
"docid": "28d3b370788cca9ba5dbb04ee8307542",
"score": "0.7149955",
"text": "def create\n @accounting_classification = AccountingClassification.new(accounting_classification_params)\n\n respond_to do |format|\n if @accounting_classification.save\n format.html { redirect_to accounting_... | [
{
"docid": "c0f9229a529c155e47c74bc2776205f5",
"score": "0.64974016",
"text": "def create\n @company_classification = CompanyClassification.new\n @company_classification.company_id = 1 #params[:]\n @company_classification.classification_id = 1 #params[:]\n @company_classification.status = 1\... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "03410b4a75c4a560b7c37c496653e2d6",
"score": "0.0",
"text": "def update!(**args)\n @code = args[:code] if args.key?(:code)\n @details = args[:details] if args.key?(:details)\n @message = args[:message] if args.key?(:message)\n end",
"title": ""
}
] | [
{
"docid": "150fa2bdc1fc43d28ac45e2278a1f797",
"score": "0.7012568",
"text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"t... |
cf5d6744936f718245e198238b86dc1a | namespace reader methods and constants | [
{
"docid": "399dae45a9842af27f931ea6796b25c1",
"score": "0.6497922",
"text": "def namespace=(_arg0); end",
"title": ""
}
] | [
{
"docid": "78719f289c71d50d2a22bc25260fd741",
"score": "0.74999446",
"text": "def namespace; end",
"title": ""
},
{
"docid": "78719f289c71d50d2a22bc25260fd741",
"score": "0.74999446",
"text": "def namespace; end",
"title": ""
},
{
"docid": "78719f289c71d50d2a22bc25260fd7... |
ba7187efb7288b44ab6df769923b5574 | Update a 'storage.SasPort' resource. | [
{
"docid": "0d1c4cb61b3207c7b644e586902b736d",
"score": "0.5768973",
"text": "def patch_storage_sas_port(moid, storage_sas_port, opts = {})\n data, _status_code, _headers = patch_storage_sas_port_with_http_info(moid, storage_sas_port, opts)\n data\n end",
"title": ""
}
] | [
{
"docid": "30978c23d5e2095649acc427325a8af3",
"score": "0.6560721",
"text": "def update_storage_sas_port(moid, storage_sas_port, opts = {})\n data, _status_code, _headers = update_storage_sas_port_with_http_info(moid, storage_sas_port, opts)\n data\n end",
"title": ""
},
{
"doc... |
97726425a96e3af3d3f401125158666f | can't sell any shares bought this round | [
{
"docid": "0cf7d61eada3b76b3692f04943b4282d",
"score": "0.59322053",
"text": "def check_share_timing(entity, bundle)\n corporation = bundle.corporation\n total_shares = corporation.share_holders[entity]\n total_shares - @round.bought_shares[entity][corporation] >= bundl... | [
{
"docid": "9093a70d87f1d599ead79960155a79a1",
"score": "0.7180528",
"text": "def shares_available_for_purchase?\n if Stock.all.find_by(id: trade.stock_id).shares_available < trade.num_shares\n return false\n else\n return true\n end\n end",
"title": ""
},
{
"docid": "d72... |
64533b96c2b53ad72f2146035eecfd1b | PUT /tasks/1 PUT /tasks/1.xml | [
{
"docid": "50ad2a17cbc0aae91fd0b881daea49aa",
"score": "0.0",
"text": "def update\n @task = @feature.tasks.find(params[:id])\n @task.last_updated_by = current_user.id\n \n respond_to do |format|\n if @task.update_attributes(params[:task])\n \n # If saved successfully, att... | [
{
"docid": "23b8fd20c4f863cc9fd1d0f2eeefb2e5",
"score": "0.76518345",
"text": "def update_task\n @user = User.find_by_username(session['user'])\n @access_token = OAuth::AccessToken.new(UsersController.consumer, @user.token, @user.secret)\n @response = UsersController.consumer.request(:put, \"/a... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "8c7a52b1e9de15f93dcabc816f41997b",
"score": "0.0",
"text": "def set_toolbox\n @toolbox = Toolbox.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60326946",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6015941",
"text": "de... |
740e5f0516835b3d51ee62e811baf68b | Deliver the given Sms message object directly. This can be used to deliver a preconstructed message, like: sms = Notifier.create_signup_notification(parameters) Notifier.deliver(sms) | [
{
"docid": "4889453a922e07d0958518108aa449e2",
"score": "0.76870495",
"text": "def deliver(sms)\n new.deliver!(sms)\n end",
"title": ""
}
] | [
{
"docid": "b22f3f975f8c069590cddb0a133e0f54",
"score": "0.7494215",
"text": "def deliver(message, options = {})\n options = options.reverse_merge default_options\n to = recipient.respond_to?(:call) ? recipient.call(message) : recipient\n message.body message.body.encode(options[:charset]... |
00373059469fa312736e437fa9c23e1a | GET /awards GET /awards.json | [
{
"docid": "86de9f64ae176d8f3999b9ff9e33b50b",
"score": "0.0",
"text": "def index\n # FIXME: Refactor these lines (migrate to helper)\n @ranking_awards = calculate_ranking_awards.take(6)\n @already_awarded_user = @ranking_awards.map{ |item| item[:id] }\n @fastac_awards = calculate_fastac_can... | [
{
"docid": "a29d1ef48d943bafe6c456edf06e991f",
"score": "0.7607895",
"text": "def index\n @awards = @student.awards\n # was @awards = Award.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @awards }\n end\n end",
"title": ""
}... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "36a117f7daec9d3d821cbdbde02020f6",
"score": "0.0",
"text": "def mix_params\n params.require(:mix).permit(:name, :length_in_sec, :recorded_at, :description, :source, :music_type, :notes)\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.69792545",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6781151",
"text": "def strong_params\n params.requ... |
df3d2f63a4212d1bb76236ebc983554f | POST /membership_applications POST /membership_applications.json | [
{
"docid": "6a4f093eecf81e2e8d9ffe008c807b42",
"score": "0.62752926",
"text": "def create\n @user = current_user\n @membership_application = @user.build_membership_application(membership_application_params)\n @user.update_attribute(:guest, false)\n @user.update_attribute(:member, true)\n\n ... | [
{
"docid": "fa6dea3324ceeb9722ee50be038e0cd6",
"score": "0.6476251",
"text": "def create\n @application = Application.new(application_params)\n\n if @application.save\n render json: @application, status: :created, location: api_application_path(@application)\n else\n render json: @app... |
fe2d9b017e1ddd5e05d3ef7fe9857a72 | Emails Compassion when a new contractor registers | [
{
"docid": "1d56f189c4b2b5d2435a77efb94eea6d",
"score": "0.8187407",
"text": "def contractor_signup_notification(contractor)\n @contractor = contractor\n mail(to: 'corey@ihaveintegrity.com', bcc: \"wil@wilhelser.com\", subject: \"New Contractor Registration.\")\n end",
"title": ""
}
] | [
{
"docid": "16729789947874f12ed076aeee8762e6",
"score": "0.7333364",
"text": "def create\n @contract = Contract.new(contract_params)\n # @renter_email = current_user.email\n @renter = current_user\n respond_to do |format|\n if @contract.save\n\n UserMailer.notify_email(@contract.... |
a3f2dd4cbefe8a840a285cc455fbb2f1 | Load cookie jar from a file in the format specified. Available formats: :yaml < YAML structure. :cookiestxt < Mozilla's cookies.txt format | [
{
"docid": "24f133a74cdc5ca83dac5ab47cf31f16",
"score": "0.77260315",
"text": "def load(file, format = :yaml)\n @jar = open(file) { |f|\n case format\n when :yaml then\n load_yaml\n\n YAML.load(f)\n when :cookiestxt then\n load_cookiestxt(f)\n else\n ra... | [
{
"docid": "82c7d7d35f300ac4ca6d37084125ff97",
"score": "0.7867217",
"text": "def load(file, format = :yaml)\n File.open(file) { |f|\n case format\n when :yaml then\n require_yaml\n @jar = YAML.load(f)\n when :cookiestxt then\n load_cookiestxt(f)\n else\n ... |
46726136796f2cb4c88147763239d267 | return the antidiagonal (secondary diagonal) that goes / | [
{
"docid": "4afa7f28742306f322b7425f726c39ab",
"score": "0.64963466",
"text": "def secondary_diagonal\n select_with_step(@ncols-1, @ncols-1)\n end",
"title": ""
}
] | [
{
"docid": "f3c3538d62ed167359158c709202948e",
"score": "0.79994875",
"text": "def tridiagonalize; end",
"title": ""
},
{
"docid": "0f7daf5dcf7bb4e4cd99be657203738d",
"score": "0.7329935",
"text": "def diagonalize; end",
"title": ""
},
{
"docid": "a90ad819dd5e3fc2eaf62dc0... |
73ae43600d73fd2813656f8b589146c3 | Get Zoom Rooms Details The Zoom Rooms dashboard metrics lets you know the type of configuration a Zoom room has and details on the meetings held in that room. Use this API to retrieve information on a specific room. Scopes: `dashboard_zr:read:admin` Prerequisites: Business, Education or API Plan with Zoom Rooms set up. | [
{
"docid": "349897a192f967143efcdddf487f8306",
"score": "0.67608225",
"text": "def dashboard_zoom_room(zoomroom_id, from, to, opts = {})\n data, _status_code, _headers = dashboard_zoom_room_with_http_info(zoomroom_id, from, to, opts)\n data\n end",
"title": ""
}
] | [
{
"docid": "e176180decf9876ecd025b3a01d9489c",
"score": "0.76499736",
"text": "def dashboard_zoom_rooms(opts = {})\n data, _status_code, _headers = dashboard_zoom_rooms_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "2f3bdaa33864de62ec6f11c529773212",
"score":... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "9b4df2aa3b9cbe0e3eb6e3ac04ab2ae6",
"score": "0.0",
"text": "def sub_category_params\n params.require(:sub_category).permit(:portfolio_section_id, :title, :description, :pictureable, pictures_attributes:[:id, :title, :image, :_destroy])\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.6979893",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6781746",
"text": "def strong_params\n params.requi... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "bd9316d3ee34086d6d9296810795ea2f",
"score": "0.0",
"text": "def set_internalformfeild\n @internalformfeild = Internalformfeild.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60320485",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6013371",
"text": "de... |
73940cc764de79993dff123dfccfdded | DELETE /medecins/1 DELETE /medecins/1.xml | [
{
"docid": "1d526c00cc1644f443e9f814361bdc83",
"score": "0.6596407",
"text": "def destroy\n @medecin = Medecin.find(params[:id])\n @medecin.destroy\n\n respond_to do |format|\n format.html { redirect_to(medecins_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
}
] | [
{
"docid": "df26116eb86dbadafed7137f9e3c2f9e",
"score": "0.69243866",
"text": "def delete!\r\n return nil unless exists? \r\n xml = xml_at_top\r\n par = xml.instance_variable_get(:@parent) \r\n par['delete'] = 'delete'\r\n xml_on_delete( xml )\r\n rsp = write_xml_config!( xml.doc... |
3d39c6c28f702ec844d53cb35d45e021 | Sets the internal flag to false. | [
{
"docid": "385a4d7bb372c7d535dad9d87b0eef4e",
"score": "0.0",
"text": "def clear\n @mutex.synchronize do\n @signal = false\n end\n end",
"title": ""
}
] | [
{
"docid": "8a3695597664110422c8c50ed4fc8e67",
"score": "0.7575306",
"text": "def off!\n set(:on => false)\n end",
"title": ""
},
{
"docid": "308f769bcf4a7a1c538167b294ae0ee8",
"score": "0.738453",
"text": "def off!\n\t\t\tself.on = false\n\t\tend",
"title": ""
},
{
... |
a559abed970153c01d7f97768c8c179b | Recurses through the expression and returns all indices, contracted or free, that are part of the expression. | [
{
"docid": "24ca1ef94760b45f79ade414c79b322f",
"score": "0.0",
"text": "def all_indices\n raise NotImplementedError, \"#{subclass} needs to override all_indices\"\n end",
"title": ""
}
] | [
{
"docid": "904e1ffdb38a5948de7934ad6d871ae9",
"score": "0.76591337",
"text": "def indices\n all_indices = self.terms.collect{|i| i.indices}.flatten\n free_indices = []\n for index in all_indices\n free_indices << index unless all_indices.include?(index.contracted_with)\n ... |
8c71e6d7d964496bfe5a47bd35790600 | PUT /project_discussions/1 PUT /project_discussions/1.json | [
{
"docid": "ea59c79f8e2cb9d8e706b044c45d3f03",
"score": "0.7465451",
"text": "def update\n @project_discussion = ProjectDiscussion.find(params[:id])\n\n respond_to do |format|\n if @project_discussion.update_attributes(params[:project_discussion])\n format.html { redirect_to @project_d... | [
{
"docid": "9084612efcbe4489fb6776541a7e80c9",
"score": "0.71710426",
"text": "def update\n @discussion = Discussion.find(params[:id])\n\n if @discussion.update(discussion_params)\n head :no_content\n else\n render json: @discussion.errors, status: :unprocessable_entity\n end\n en... |
0c0f9b4470a369c510d4eef5d8484dc5 | Complemento do header (no caso do Banco do Nordeste, sao apenas espacos em branco) | [
{
"docid": "690a91a6afe3f2806d69324143a9aebe",
"score": "0.0",
"text": "def complemento\n ''.rjust(294, ' ')\n end",
"title": ""
}
] | [
{
"docid": "c9612cca1c4ccd60e8c2298785234473",
"score": "0.65949273",
"text": "def getHeader() @header1 end",
"title": ""
},
{
"docid": "b6044e1d3af35097e99c281dd96bf211",
"score": "0.6583516",
"text": "def non_standardized_header(row)\n @header=row.split(/\\s{2}+/).reject{|a|... |
b4ac60ab012703b98d78736a4365956f | Gets an attribute from this schema given a name | [
{
"docid": "9fcd83d0ae582572e54381d0cab1916b",
"score": "0.8353446",
"text": "def get_attribute(name)\n @attributes[name.to_s]\n end",
"title": ""
}
] | [
{
"docid": "af212cbea97473b5804e4fa4c0a8ca59",
"score": "0.82860947",
"text": "def get_attribute(name)\n @attributes[name]\n end",
"title": ""
},
{
"docid": "1307a15219a446b0c14f7a9f2ce2e687",
"score": "0.8029695",
"text": "def attribute(name)\n @attributes[name.to_s... |
dee0b4ade1638c5921c6d5f8aa673fb8 | Indicate whether the record schema includes any of the given columns. | [
{
"docid": "f08d28abe7db0130ad73f8aae3ccd9f8",
"score": "0.75415957",
"text": "def has_column?(*columns, any: true, **)\n end",
"title": ""
}
] | [
{
"docid": "33999f7c8e9ffca6114d41832b44bac0",
"score": "0.75624806",
"text": "def columns_includes?(field, columns)\n Hash[*(columns.flatten)].keys.include?(field) \n end",
"title": ""
},
{
"docid": "e0a0d0e28afeb704e3de489831325513",
"score": "0.72118396",
"text": "def has_... |
b62771a82196df16152c604ec04d5a9c | Record user_id, e.g., so it can be recorded in logs | [
{
"docid": "28caf11a5e9590b3f367553fc913f6ca",
"score": "0.0",
"text": "def append_info_to_payload(payload)\n super\n payload[:uid] = current_user.id if logged_in?\n end",
"title": ""
}
] | [
{
"docid": "aa4673a2810df94566c0d7362ec3ea16",
"score": "0.79634434",
"text": "def store_user_id(user)\n\t\t@id = user\n\tend",
"title": ""
},
{
"docid": "2cc74a88ae2b38555bc0b84d41c4494a",
"score": "0.747738",
"text": "def user_id=(value)\n @user_id = value\n ... |
d62bba28c4c4aee5ff6ac38a2920a624 | Refresh spec select options in index page to query versions | [
{
"docid": "98007d1911b53712fc4bdf1820dfc3c5",
"score": "0.5940241",
"text": "def specs\n @project_category = params[:category]\n @project_name = params[:name]\n @select_specs = $db.slave { Spec.version_search(@project_category, @project_name) }\n\n respond_to do |format|\n format.js\n ... | [
{
"docid": "697254c171f27820803dd8b6d863cab2",
"score": "0.63029736",
"text": "def update_version_select \n versions = Version.where(:product_id => params[:id]).order(:version) unless params[:id].blank?\n \n # Since they can only see their own reports this isn't absolutely required, but ... |
04611f2e3be68544ba491ec38779e270 | GET /post_ingredients/1 or /post_ingredients/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "079a46e457f8a4ecf53a6c2baff2b658",
"score": "0.7281011",
"text": "def ingredients_by_recipe\n recipe = Recipe.find(params[:id])\n render json: recipe.ingredients\n end",
"title": ""
},
{
"docid": "e8f896014b373ca98fd9abb15856ad75",
"score": "0.72377056",
"text": "d... |
3f5b1b11b964126d4c9c411bd0e3770f | The parent (last from parents) which is used for copying non mergeable configuration | [
{
"docid": "cf1760cfc41d70d16ecf86269076c7a2",
"score": "0.7630146",
"text": "def parent\n @parent ||= parents.last\n end",
"title": ""
}
] | [
{
"docid": "5730125d2bfab707a898923fea5dc3ff",
"score": "0.7452036",
"text": "def parent\n self[:parent]\n end",
"title": ""
},
{
"docid": "9a7aba5d565172064fb025d0d8f2caf2",
"score": "0.7412751",
"text": "def parent_inst\n @parent\n end",
"title": ""
},... |
164c8f5ddf6a68aad4a452aec34aacb6 | Input a wrong interval. | [
{
"docid": "0f448bc1a4f2c60cf3bd924db436ce45",
"score": "0.0",
"text": "def test_scm_st_034\n printf \"\\n Test 034\"\n open_periodical_analysis_setting_tab\n fill_scm_form(\"SVN\",\n nil,\n nil,\n URL_SVN_RIGHT_KEYWORD,\n LOGIN_RIGHT_KEYWORD,\n PASSWORD_RIGHT_KEYWORD,\... | [
{
"docid": "f34f1927ba3cfe0f231feb287c84ad52",
"score": "0.66532844",
"text": "def failed\n @interval = if @interval\n [@max_interval, @interval * @multiplier].min\n else\n @start_interval\n end\n end... |
1cc19b5630b80c9bdbb30842c0af3a42 | GET /product_verifies GET /product_verifies.json | [
{
"docid": "d5a7ad42759dfdd987a33550acc52395",
"score": "0.0",
"text": "def index\n\n @users_a = self.user_to_ar\n @flag = params[:state]\n\n @iid = params[:id]\n\n @vtm_a = []\n VerifyTypeMain.all.each do |vtm|\n @vtm_a[vtm.id] = vtm.title\n end\n\n # ProductVerify.all.each d... | [
{
"docid": "9049243e6761ecac025542d2289f8522",
"score": "0.6378231",
"text": "def product_verification\n # product verification status\n Product.product_verification(@admin_product,params[:type])\n # render form\n respond_to do |format|\n format.html { redirect_to admin_products... |
da236c96b8e4582a013b167ee9ff2f05 | Setup events relating to menus. This method is called by Vedeu. | [
{
"docid": "09d5c2404ffd48111254c1036d9a01aa",
"score": "0.7238941",
"text": "def setup!\n menu_bottom!\n menu_current!\n menu_deselect!\n menu_items!\n menu_next!\n menu_prev!\n menu_selected!\n menu_select!\n menu_top!\n menu_view!\... | [
{
"docid": "52afe3c78e45c597dbd00009f3d6c279",
"score": "0.69577825",
"text": "def on_room_select_events\n\t\tadd_menu(:events)\n\tend",
"title": ""
},
{
"docid": "12d21f7d4bf0bb02c6e6b5a65999ae3c",
"score": "0.6879563",
"text": "def on_events_select_place\n\t\tadd_menu(:event_place)... |
37c117c5ec778b8a480e43f9492abd24 | Form rows of table by reading the first table found in the org file. The header row must be marked with an hline (i.e, a row that looks like '|+...|') and groups of rows may be marked with hlines to indicate group boundaries. | [
{
"docid": "354972141d035ecd7e348739d606a1a7",
"score": "0.59671324",
"text": "def from_org_io(io, **types)\n table_re = /\\A\\s*\\|/\n hrule_re = /\\A\\s*\\|[-+]+/\n rows = []\n table_found = false\n header_found = false\n io.each do |line|\n unless ta... | [
{
"docid": "743c589b1f77a1d7c81ea629105b01f8",
"score": "0.6612366",
"text": "def read_lines lines, options = {}\n table_apply = TableApply.new(options)\n\n header = table_apply.parse_header(lines[0], options)\n Validator::valid_header?(header, @header) # compare against older header whe... |
98d61997a587347129018989f6a4a28f | Counts the number of messages in a given file. | [
{
"docid": "f1ab13f6dd8df14e94139dd0eab21fd8",
"score": "0.8055011",
"text": "def message_count(file)\n test(?d, file) ? \n Dir.entries(file).delete_if {|x| x =~ /^\\./}.length :\n File.open(file, \"r\").read.scan(/^From /m).length\n end",
"title": ""
}
] | [
{
"docid": "d1029e9285c90fe157ed22e90c7bc8f1",
"score": "0.69600046",
"text": "def word_count_a_file(file_path)\n\ttotal = 0\n\tFile.open(file_path, 'r') do |f|\n\t\tf.each_line do |line|\n\t\t\ttotal += line.split.length\n\t\tend\n\tend\n\ttotal\nend",
"title": ""
},
{
"docid": "d5d81439a62... |
a4945f28bb4a4e69db6142eccf289243 | caar cadr cdar ... | [
{
"docid": "c985ca41ca8c6c61857f892b66cc633c",
"score": "0.5021138",
"text": "def caar()\n return car().car() ;\n end",
"title": ""
}
] | [
{
"docid": "34f444eb856d65bf298a726a5ed2f88a",
"score": "0.57652235",
"text": "def cadr(pair)\n car(cdr(pair))\n end",
"title": ""
},
{
"docid": "92f81a97171cd8b1a375aad22b86c44d",
"score": "0.5571498",
"text": "def example_main opts = { }, &blk\n opts = {\n ... |
a65d62b81a80bcb1b4c0d2337032c7b1 | Description: get lastest comment | [
{
"docid": "46ff1b2d38011db3f46d8521130c13fc",
"score": "0.798268",
"text": "def get_lastest_comments\n Comment.where(object_id: self.id, object_type: object_type, parent_id: nil).order_by(created_at: -1).limit(Comment::COMMENT_PER_PAGE)\n end",
"title": ""
}
] | [
{
"docid": "005e75ead19b892718480f4da1631e05",
"score": "0.8383342",
"text": "def most_recent_comment\n comments.empty? ? nil : comments.last\n end",
"title": ""
},
{
"docid": "37d3ff3bdca49c9f3ac6692a5077fbcc",
"score": "0.8104752",
"text": "def last_comment\n\t\tself.comments.o... |
7f77daaa29912ad6078735c0897db5f5 | GET /tumbons/new GET /tumbons/new.xml | [
{
"docid": "da69bfaef335bf5d3e62389e420bfc30",
"score": "0.77930814",
"text": "def new\n @tumbon = Tumbon.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tumbon }\n end\n end",
"title": ""
}
] | [
{
"docid": "4784e252b96907deaae2ac574e79830e",
"score": "0.7304792",
"text": "def create\n @tumbon = Tumbon.new(params[:tumbon])\n\n respond_to do |format|\n if @tumbon.save\n format.html { redirect_to(@tumbon, :notice => 'Tumbon was successfully created.') }\n format.xml { ren... |
ab46e607b1b7e87795ee88c67110ff9a | % safe_level : !FIXME > !FIXME | [
{
"docid": "b6373b6dc79c687dd40b3dfa5925a9f5",
"score": "0.89962053",
"text": "def safe_level(*) end",
"title": ""
}
] | [
{
"docid": "810092645e376b5d8bc9967377c16989",
"score": "0.8177895",
"text": "def safe_level\n safe? ? 4 : 0\n end",
"title": ""
},
{
"docid": "f097439fb52ef8336d63538b9a633622",
"score": "0.7523108",
"text": "def set_safe_level\n @@safe_level = $SAFE\n end",
"title":... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "337aa52738d2bdcddabe6743f4487c25",
"score": "0.0",
"text": "def set_ref\n @ref = Ref.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.6163163",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.6045976",
"text": "def action_hook;... |
30e24abccdc7c63cb298d2dc1ed23421 | DELETE /engagements/1 DELETE /engagements/1.json | [
{
"docid": "b35db7a8ef4f994b968d54a5ca53fca1",
"score": "0.76150703",
"text": "def destroy\n @engagement = Engagement.find(params[:id])\n @engagement.destroy\n\n respond_to do |format|\n format.html { redirect_to engagements_url }\n format.json { head :no_content }\n end\n end",
... | [
{
"docid": "f362724a34659210cb5dea5890c8aa90",
"score": "0.7483536",
"text": "def destroy\n @engagement = Engagement.find(params[:id])\n @engagement.destroy\n\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end",
"title":... |
706811a71b7f09f1e6e6bb69d223b8df | PUT /reward_rules/1 PUT /reward_rules/1.json | [
{
"docid": "e5df6856022486d3948963779f516a82",
"score": "0.75359184",
"text": "def update\n @reward_rule = RewardRule.find(params[:id])\n\n respond_to do |format|\n if @reward_rule.update_attributes(params[:reward_rule])\n format.html { redirect_to @reward_rule, notice: 'Reward rule wa... | [
{
"docid": "03a23f30904a4138817a26056b20a9ea",
"score": "0.6657025",
"text": "def update\n respond_to do |format|\n if @reward.update(reward_params)\n format.html { redirect_to @reward, notice: 'Reward was successfully updated.' }\n format.json { render :show, status: :ok, location... |
a6b0766b8ff760d5d25409509e822628 | GET /ignites/1 GET /ignites/1.xml | [
{
"docid": "5755f5893ae6a0d924b40feeeef99af9",
"score": "0.6076798",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ignite }\n end\n end",
"title": ""
}
] | [
{
"docid": "393bcf6daf50a719a437d2b48aa9fce4",
"score": "0.72510487",
"text": "def index\n @ignites = Ignite.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ignites }\n end\n end",
"title": ""
},
{
"docid": "b592938580a... |
bfaacbdbd71c9fa7e5c16bcd76132f84 | Given a hash of parameters (converted by the method call on the connection object), send it across the wire to the RushServer listening on the other side. Uses http basic auth, with credentials fetched from the Rush::Config. | [
{
"docid": "a535c09e6b6ad2776f7f3f232856a428",
"score": "0.65738946",
"text": "def transmit(params)\n\t \n\t\tbegin\n\t\t ensure_tunnel\n\t \n client = TCPSocket.open(tunnel.host, tunnel.port)\n handshake = client.puts(\"#{config.credentials_user}:#{config.credentials_password}\")\n ... | [
{
"docid": "bf24d8832a7013bfa2e7e78b2e0ebd6a",
"score": "0.66691905",
"text": "def transmit(params)\n\t\tensure_tunnel\n\n\t\trequire 'net/http'\n\n\t\tpayload = params.delete(:payload)\n\n\t\turi = \"/?\"\n\t\tparams.each do |key, value|\n\t\t\turi += \"#{key}=#{value}&\"\n\t\tend\n\n\t\treq = Net::HTT... |
fd33625bc6d5972b2e1ba370a2ecb69a | POST /matches POST /matches.json | [
{
"docid": "70f57eb8f921c48560cc7670f9c2a6b3",
"score": "0.6930992",
"text": "def create\n @match = Match.new(match_params)\n\n respond_to do |format|\n if @match.save\n format.html { redirect_to @match, notice: 'Match was successfully created.' }\n format.json { render :show, s... | [
{
"docid": "6c1cf702cdf4ac3f7df947f69e3720cf",
"score": "0.7026842",
"text": "def create\n @match = Match.new(params[:match])\n\n respond_to do |format|\n if @match.save\n format.html { redirect_to @match, :notice => 'Match was successfully created.' }\n format.json { render :js... |
43de0dd13dc23953b8d46177d09b4684 | The character names and powerups are always the same and aren't modified so they can be class variables The characters themselves will be modified, so they need to be instance variables | [
{
"docid": "43057bcb25493471dbba532c6156f254",
"score": "0.616264",
"text": "def initialize\n\n\t @default_character_speed = 0.85\n\t @character_names = [\n\t \t\"Mario\", \"Luigi\", \"Toad\", \"Peach\",\n\t \"Bowser\", \"Yoshi\", \"Wario\", \"Dk\"\n\t ]\n\n\t @blue_shell = ShellPowerUp.new(\"Bl... | [
{
"docid": "9a1b3d48d2582b99c695f410e46f91b8",
"score": "0.6754893",
"text": "def make_demo_chars\n @char1 = Char.create(name: \"Dirigible Wispus\", health: 10, user: @user1, notes: \"Big belly. Big brain. Little nubby fingers.\")\n @char2 = Char.create(name: \"Ilashi Dvorak\", health: 15, user: @use... |
5de27252922e4df9eb404ca3d3f8b9d9 | HTTP Put request for updates | [
{
"docid": "21f33a15356bfd8fc134ab59fd8bc45f",
"score": "0.0",
"text": "def put params={}, &block\n exec :put, params, &block\n end",
"title": ""
}
] | [
{
"docid": "6eccf0cb1ebc7404a9ae8d73fad0c91a",
"score": "0.80351377",
"text": "def put(*args)\n request :put, *args\n end",
"title": ""
},
{
"docid": "f40dbaab2cbe350f38ed7a51a0705615",
"score": "0.7990509",
"text": "def update(params)\n with_options(request_method: :p... |
458f04b13aa654647122b837158936c3 | redefine your position_taken? method here, so that you can use it in the valid_move? method above. | [
{
"docid": "a8e5e731ef5dbff550abc4a0eb5468b6",
"score": "0.0",
"text": "def position_taken(board,index)\n if board[index]==\" \"\n false\n else\n true\n end\nend",
"title": ""
}
] | [
{
"docid": "f1b5882b1e94341642347a5613e1d1a2",
"score": "0.8491596",
"text": "def valid_move?(position)\n end",
"title": ""
},
{
"docid": "d2a173acad26f0c45b2c44cf63a2b56e",
"score": "0.80393803",
"text": "def valid_move?(board, index)\n return !position_taken?(board, index)\nend",... |
b764c62120d4d41fa4d366443a5cd9ff | =begin def initialize(id=101,name="Krishanu") puts "Hii initialize overloaded\n"; end =end | [
{
"docid": "17b58f21fac33eb1048c72fe15bddabc",
"score": "0.0",
"text": "def setID=(value)\n\t\t@m_id = value;\n\tend",
"title": ""
}
] | [
{
"docid": "f6f94e9d8964bddca5f5f95c6f196852",
"score": "0.717958",
"text": "def init(name)\n\tend",
"title": ""
},
{
"docid": "8c5617ace425acff7c25d43ad8651722",
"score": "0.7156951",
"text": "def initialize(defname = \"toto\")\n\t\t@name = defname\n\t\t@id = 1\n\tend",
"title":... |
722e17f04e920ad7da60d112a632e703 | Created 6/11/2020 by Caroline Wheeler Allows user to fill our search criteria for osu job search Returns the search form with/without search criteria filled out. | [
{
"docid": "520fa977fbb05b71e20a73eef78bab60",
"score": "0.0",
"text": "def osu_form\n data = []\n # get keywords\n data.push(keywords)\n # gets range of posting\n data.push(posted_within)\n # gets location\n data.push(location)\n data\nend",
"title": ""
}
] | [
{
"docid": "8eff96b7c7499917b4a89e883cb3516f",
"score": "0.68963075",
"text": "def postSearch\n job_title = params[:job_title]\n company = params[:company]\n company = \"*\" if params[:company].blank?\n location = params[:location]\n location = \"*\" if params[:course_number].blank?\n return ... |
c2ae385222168b54f7684f02c6d875ad | Exits if no config.yaml file found. | [
{
"docid": "30fcf03ab8cc8603d65f42490d05ea05",
"score": "0.59808385",
"text": "def load_config_file\n config_file_path = \"#{@proj_dir}/config.yaml\"\n if !File.exists?(config_file_path)\n log_message(\"No 'config.yaml' file found in project directory.\")\n exit\n end\n @config = Y... | [
{
"docid": "5335b2dc05f872e5152f586d25ef7958",
"score": "0.7255743",
"text": "def load_config\n require 'yaml'\n # First local, then defaults\n config_files = [\"config.yaml\", \"default.yaml\"]\n config_files.each do |fn|\n if File.exists? fn\n return YAML.load_file(fn)\n end\n end\n p... |
beee15ec28e810b6b1f791f1988745d1 | Converts email to all lowercase. | [
{
"docid": "4a9f54c314d699abc5fbe466f8c49cfb",
"score": "0.78732336",
"text": "def downcase_email\n\t\tself.email = email.downcase\n\tend",
"title": ""
}
] | [
{
"docid": "2b2c0688ba3acfcff4c2f18ffcd0d792",
"score": "0.8383631",
"text": "def normalize_email\n self.email.downcase!\n end",
"title": ""
},
{
"docid": "61c6f9455ec34c2acd15663a017f23dc",
"score": "0.8339932",
"text": "def downcase_email\n email.downcase!\n e... |
9385cdf3cc8930f6fdd13d6966608db8 | Returns the Systemwide and project specific activities | [
{
"docid": "f1bfee45e5941c38dd71248fbf6ac130",
"score": "0.6433992",
"text": "def activities(include_inactive=false)\n if include_inactive\n return all_activities\n else\n return active_activities\n end\n end",
"title": ""
}
] | [
{
"docid": "6f9b392b7996e55927483c7418b3842e",
"score": "0.71085846",
"text": "def active_activities\n overridden_activity_ids = self.time_entry_activities.collect(&:parent_id)\n\n if overridden_activity_ids.empty?\n return TimeEntryActivity.shared.active\n else\n return system_activi... |
fb8f5cfe5a8493b288609842f2318fc5 | POST /products POST /products.json | [
{
"docid": "6f1984dc42feb8d54cab9b3e1fc4b01d",
"score": "0.0",
"text": "def create\n @page_title = \"Sell your product\"\n @product = Product.new(params[:product])\n @product.user = current_user\n\n if @product.valid?\n @product.force_save\n return product_success\n else\n ... | [
{
"docid": "6e6e22738994035234ed86fee8433fa8",
"score": "0.7675232",
"text": "def create\n @product = Product.new(product_args)\n\n if @product.save\n render json: Product.all, status: :created\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end",
... |
26a75663e15870d9468a4a86b9b25d67 | find minimum value of subtree through iteration | [
{
"docid": "604bdb6e0ff3230309804f5d4b4114c8",
"score": "0.72797745",
"text": "def minimum_value(value)\n minimum_value = value\n until value.left.nil?\n minimum_value = value.left.data\n value = value.left\n end\n minimum_value\n end",
"title": ""
}
] | [
{
"docid": "85ed1759c947b8fff8609cd9c4deb625",
"score": "0.80740917",
"text": "def min\n minNode = self\n\n @children.each do |subtree|\n if subtree.min.value < minNode.value\n minNode = subtree.min\n end\n end\n minNode\n end",
"title": ""
},
{
"docid": "22... |
3fbf79ff8a625a0633aebec91306acc3 | we only want a perfectly symmetrical tree | [
{
"docid": "03060e390fd2207d520d382b699f421d",
"score": "0.0",
"text": "def balanced(n)\n if n.children.first.size == n.children.last.size\n :pass\n else\n :fail\n end\n end",
"title": ""
}
] | [
{
"docid": "cc01fa9762399eb75c984e9c778e3af2",
"score": "0.72671574",
"text": "def isTreeSymmetric(t)\n isMirror?(t, t)\nend",
"title": ""
},
{
"docid": "07e09be3df1268ebe43dc9f9369faeef",
"score": "0.70735645",
"text": "def symmetric_tree(root)\n symmetric_helper(root.left, root... |
1fd552ed75f3c2513904f8d242f6828e | 1 inch of mercury = 25.4 mm of mercury = 33.86 millibars = 33.86 hectoPascals To convert inches of mercury to millibars, multiply the inches value by 33.8637526 To convert millibars to inches of mercury, multiply the millibar value by 0.0295301. 29.79 in / 1008.7 hPa | [
{
"docid": "7adef3ed1c7afe2686c68bc0df99bfc2",
"score": "0.7299384",
"text": "def inches_of_hg_to_mb(inches)\n inches * 33.8637526\n end",
"title": ""
}
] | [
{
"docid": "4414a4802e442665f2ce50311b4ad9ae",
"score": "0.7784607",
"text": "def convert_in_to_cm(inches)\n in_to_cm = 2.54\n inches * in_to_cm\nend",
"title": ""
},
{
"docid": "d91bfe78cce6dc0aaa72b22af5584f9e",
"score": "0.7783543",
"text": "def inches_to_cm(inches)\r\n inches ... |
f690708cf9c06fdc27df82ac118fb1da | end getLocations print Locations table | [
{
"docid": "cf53ff519e7425d6341a231c56031960",
"score": "0.7329603",
"text": "def printLocations\n puts(\"Locations for #{@arguments[@arguments.length - 1]}:\")\n # print each location on its own line\n for i in 0..@locations.length - 1 \n puts(\"\\t#{@locations[i]}\")\n ... | [
{
"docid": "45733ec85ba4e3dc098d41756602dc2b",
"score": "0.7875192",
"text": "def getAllLocations()\n coll = self.coll_locations\n puts coll.find()\n coll.find.each { |row| puts row.inspect }\n end",
"title": ""
},
{
"docid": "ae06b2cf3f88249b1a78fb50cd74fde6",
"score": "0.7616... |
bb7095de49754a0b427570a41ee60eca | Hold after each iteration. | [
{
"docid": "65c1028796a8e300443ddfa60bbdea30",
"score": "0.0",
"text": "def hold!(held_path)\n @held_path = held_path\n @run_single = true\n end",
"title": ""
}
] | [
{
"docid": "bd4c08cd93328a2c2cd09d064baa9f0b",
"score": "0.65029824",
"text": "def hold; end",
"title": ""
},
{
"docid": "810f6c9296e575865f9397f512230fa7",
"score": "0.61167806",
"text": "def hold?; end",
"title": ""
},
{
"docid": "499d17b87f23ece0570d37417e9e90b1",
... |
21ee1c638c7586ddf29599b597327f4a | Encapsulate characters to make Markdown look as expected. | [
{
"docid": "2e59ab74ae7dfb6b5d6672105f80063a",
"score": "0.0",
"text": "def encapsulate_string(string)\n string = string.gsub('\\\\', '\\\\\\\\')\n\n ENCAPSULATED_CHARACTERS.each do |char|\n string = string.gsub(char, \"\\\\#{char}\")\n end\n\n string\n end",
"title": "... | [
{
"docid": "17de2ed7d641716e738e38b62ab81600",
"score": "0.6244087",
"text": "def escape_special_chars( str )\r\n\t\t@log.debug \" Escaping special characters\"\r\n\t\ttext = ''\r\n\r\n\t\t# The original Markdown source has something called '$tags_to_skip'\r\n\t\t# declared here, but it's never used, s... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "0c9bf3c81066c80f59f700ff05fd5080",
"score": "0.0",
"text": "def news_params\n params.require(:news).permit(:title, :content, :post_date, :user_id, :published, :news_id)\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.6980244",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6782812",
"text": "def strong_params\n params.requi... |
f260b0743e3635ff851ba1fb8f391b00 | GET /users/1 GET /users/1.json | [
{
"docid": "e1d59f4de78c588282a6fda17f28a99b",
"score": "0.0",
"text": "def show\n @user = User.find(params[:id])\n @weight = @user.weights.build\n @meal_record = @user.meal_records.build\n @food = Food.all\n @food_recording = @meal_record.food_recordings.build\n end",
"title": ""
... | [
{
"docid": "9f7c735ace683c5c2b12c914cc9ad8a8",
"score": "0.771752",
"text": "def get\n users = User.all.as_json\n render(json: users.as_json, status: :ok)\n end",
"title": ""
},
{
"docid": "a95dfe28d6b386aafc5fb53749e84258",
"score": "0.75107867",
"text": "def user\n... |
e588094a31bf9fa4bc5a278d64d5b44f | Get DataSet encapsulating a column family in this keyspace | [
{
"docid": "6c25f229bf95572c1496b32780dbf80e",
"score": "0.77912605",
"text": "def [](column_family_name)\n DataSet.new(column_family_name.to_sym, self)\n end",
"title": ""
}
] | [
{
"docid": "3ce03bca98f4d86e2873bf481b6fceaf",
"score": "0.6204138",
"text": "def column_families\n return false if Cassandra.VERSION.to_f < 0.7\n\n schema.cf_defs.inject(Hash.new){|memo, cf_def| memo[cf_def.name] = cf_def; memo;}\n end",
"title": ""
},
{
"docid": "d99ef9c4fffdd349877... |
c70fffdf12d341bcf1b29d000c3702df | GET /events/1 GET /events/1.json | [
{
"docid": "ac29017aac79c2489a3fa8b1be2ce724",
"score": "0.0",
"text": "def show\n @comment = Comment.new\n @followers = Array.new\n \n EventFollows.all.each do |temp_follow|\n if temp_follow.event_id == params[:id].to_i\n @followers.push(temp_follow.user)\n end\n end\n ... | [
{
"docid": "2d5580b43c7c18bcd8a06713fa4be0f1",
"score": "0.75926495",
"text": "def show\n\t\tevent_id = params[:id]\n\t\tif event_id.present?\n\t\t\t@event = Com::Nbos::Events::Event.active_events.where(:id => event_id)\n\t\t\trender :json => @event\n\t\telse\n\t\t\trender :json => {status: 400, message... |
bfbcddcc918ef40f76e5014276919dbc | Preview this email at | [
{
"docid": "53763d2f5db5db4764d685fe7cc4b71d",
"score": "0.0",
"text": "def unlock_instructions\n \tCustomMailer.unlock_instructions\n end",
"title": ""
}
] | [
{
"docid": "947d18f31928dcf9761bdcbda7f18565",
"score": "0.71475905",
"text": "def preview\n @email = Email.find(params[:id])\n render :text => @email.body\n end",
"title": ""
},
{
"docid": "f9cb02c07e98bbf5e69bcea1540cfe24",
"score": "0.71186084",
"text": "def preview\n @e... |
3d441a64fcefb6e786c37d9c8c51398a | used within ruby code like in attribute_row.rb | [
{
"docid": "a1382e7c7b692a4d5704533100d8d16f",
"score": "0.0",
"text": "def method_missing(method, *args)\n method = method.to_sym\n #sometimes @attr is nil, *shrug*\n if @source.respond_to? method\n return @source.send(method)\n else\n super\n end\n end",
"title": ""
}
] | [
{
"docid": "23ec52bcf885366f12e833fc292cead8",
"score": "0.6950151",
"text": "def attribute_value(row,attribute)\n row\n end",
"title": ""
},
{
"docid": "59196ab315ce11c39154a078417b4400",
"score": "0.6652014",
"text": "def attrtable() @records.get_data(GRT_ATTRTABLE); end",
... |
666b273015db91fb2fd7c583dc734939 | Hole 5: Caesar Cipher (32 characters) | [
{
"docid": "655db657461926da2420665c2f48c7b1",
"score": "0.0",
"text": "def caesar_cipher\n a = %w[a b c d e f g h]\n c = []\n c << a.rotate(3)\n puts c\nend",
"title": ""
}
] | [
{
"docid": "e72b01012da409a098a8d997ed67a415",
"score": "0.8002895",
"text": "def CaesarCipher(str, num)\nend",
"title": ""
},
{
"docid": "cb51a4badccaa0a6f126660087af7712",
"score": "0.7979038",
"text": "def ceasar_cipher(txt)\n\tshift = rand (1..10_000)\n\tencrypted_string = String... |
54cf6c20418423c5b755a5e3a9cc7d58 | Method will remove the top card from deck. | [
{
"docid": "79fdc6988b1cf15d6b2a8fc44fc02518",
"score": "0.74461883",
"text": "def remove_card\n @cards.shift\n end",
"title": ""
}
] | [
{
"docid": "e4b9e4c0d07fdead61ddfefed536becf",
"score": "0.8426911",
"text": "def removeTopCard()\n return @deck.shift\n end",
"title": ""
},
{
"docid": "7639ba7b8e58ff76c031aed864b9899e",
"score": "0.8358792",
"text": "def removeCard\n card = @deck[@top_of_deck]\n ... |
d5561de96491eadf6e1170117c74c0e7 | decrypt take passed string and calculate length of string staring with the first letter, add the previous letter in the alphabet to our output string variable until we get to the last letter | [
{
"docid": "6820d9543dca8c00e75aea3d67c55438",
"score": "0.0",
"text": "def decrypt(word)\n \n position = 0\n newstring = \"\"\n alpha = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ !\"\n while position < word.length\n current = alpha.index(word[position])\n crypt = alpha[c... | [
{
"docid": "624bfc1018b892ec853466c0b6d75531",
"score": "0.8374231",
"text": "def decrypt(str)\n alphabet = \"abcdefghijklmnopqrstuvwxyz\" #Alphabet\n num_letters = str.length #Sets length of string to variable\n decrypted_string = \"\" #... |
67c3b6cf32e0b176515f7574ee07eaec | Invitation destroy DELETE /api/1/invitations/:id | [
{
"docid": "603cad1c7f6d0b6fb3bc405a8b102ea1",
"score": "0.8093665",
"text": "def delete_invitation(id, query={})\n perform_delete(\"/api/1/invitations/#{id}\", :query => query)\n end",
"title": ""
}
] | [
{
"docid": "6fe84c95cac48d8d2d49206107d42ecc",
"score": "0.8731767",
"text": "def destroy\n invitation = invitable.find(params[:id])\n invitation.destroy if invitation\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "00ca1... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "68602ce26540538781dd5876c2941a0c",
"score": "0.0",
"text": "def monkey_params\n params.permit(:name, :type, :size, :socialOrder, :image, :species)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.74954116",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6956924",
"text": "def strong_params\n params.require(:request).permit(param_whit... |
1c009b3a009606df1fdd571c033e93e7 | Find max value in array of numbers | [
{
"docid": "4b4a2a6cde9bd50ee997586de264d872",
"score": "0.0",
"text": "def find_max(some_array)\n\treference = some_array[0]\n\tsome_array.each do |items|\n\t\tif items > reference\n\t\t\treference = items\n\t\tend\n\tend\n\treturn reference\nend",
"title": ""
}
] | [
{
"docid": "b56ceaad0fecbf6fac4cf01c06608dff",
"score": "0.85777915",
"text": "def find_max_value(array)\n array.max\nend",
"title": ""
},
{
"docid": "f380f759bf8f12ddcedf914e3d613300",
"score": "0.85670036",
"text": "def find_max_value(array)\n return array.max\nend",
"title":... |
b5cbdbc6ed218ee2b3e0d9dde9b30e6d | PATCH/PUT /chinese_posts/1 PATCH/PUT /chinese_posts/1.json | [
{
"docid": "6b26e0369b4f9b2577e07d04b845c829",
"score": "0.67772025",
"text": "def update\n respond_to do |format|\n if @chinese_post.update(chinese_post_params)\n format.html { redirect_to @chinese_post, notice: 'Chinese post was successfully updated.' }\n format.json { render :sh... | [
{
"docid": "7599b6acda033b21082c7a67a2516d88",
"score": "0.63828665",
"text": "def update\n json_update_and_sanitize(post,post_params, Post)\n end",
"title": ""
},
{
"docid": "26c7bedca4c8532576acde249915e4e5",
"score": "0.62022966",
"text": "def update\n @post = BlogService... |