query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
6e821e0aa363a70805beab082540f171 | number not found in row, column, or square then return that number to add into possibilities array | [
{
"docid": "1d564db2797f301dc3d5392b2c6674fa",
"score": "0.63881224",
"text": "def addPoss (aSoduku, aColumn, aSquare, row, col, sq, i)\n if !(aSoduku[row].include?(i)) & !(aColumn[col].include?(i)) & !(aSquare[sq].include?(i))\n return i\n end\n end",
"title": ""
}
] | [
{
"docid": "0d861d1073ab572dbd9944d50e80b467",
"score": "0.7280613",
"text": "def find_possible_cell_numbers(row, col, sodoku)\n possible_nums = [1, 2, 3, 4, 5, 6, 7, 8, 9]\n\n used_nums = []\n used_nums << find_row_numbers(row, sodoku)\n used_nums << find_col_numbers(col, sodoku)\n used_nums << fi... |
b40498ed19dc91b63946e90ce715644c | Draws the grid by adding in vertical and horizontal separators. | [
{
"docid": "e591a7e8b41762d451957f1b4f49bbf5",
"score": "0.755545",
"text": "def draw_grid x, y, h, w, lines_h, lines_v\n\n # The grid starts off empty.\n grid = []\n\n # Calculates the placement and adds horizontal lines or separators into the grid.\n curr_y = y # start at the bottom of the... | [
{
"docid": "ed37286161c4e4814320f39f55d802f4",
"score": "0.76322603",
"text": "def draw_grid x, y, h, w, lines_h, lines_v\n\n # The grid starts off empty.\n grid = []\n\n # Calculates the placement and adds horizontal lines or separators into the grid.\n curr_y = y # start at the bottom of t... |
693a7399287e8aec0aa08229ac9da1a4 | Public: Returns a mapping of queue name to ARN | [
{
"docid": "aae775c88dfa8ae62e8722b5bd7410bd",
"score": "0.8146318",
"text": "def queue_arns\n @queue_arns ||= Hash[queue_attributes.map { |name, attrs| [name, attrs[\"QueueArn\"]] }]\n end",
"title": ""
}
] | [
{
"docid": "67cda4cb02594b286679dcdb5e98ff23",
"score": "0.77276915",
"text": "def get_arn(queue_name)\n queue_arns.fetch(queue_name)\n rescue KeyError\n puts Colors.red(\"No SQS queue named #{queue_name}\")\n exit 1\n end",
"title": ""
},
{
"docid": "1e98ebb6b... |
6589834c23083c68c176442d71997d3d | Subscribe to notifications for the current user. | [
{
"docid": "009b28bd80da3b18e7a72d050353aa42",
"score": "0.0",
"text": "def subscribe(mirror, collection, user_token, verify_token, callback_url, operation)\n subscription = mirror.subscriptions.insert.request_schema.new({\n ... | [
{
"docid": "bcd60ee5368f7712a31d401b1f7a2e9d",
"score": "0.67746085",
"text": "def subscribed\n super\n increase_current_users\n stream_from channel\n end",
"title": ""
},
{
"docid": "f742c74e0a0cac68e8bc9d83ec3635c7",
"score": "0.66797674",
"text": "def subscribe_notificat... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "016d76c693d7c2355f523c2237d7761c",
"score": "0.0",
"text": "def set_coin\n @coin = Coin.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... |
0629a55b4a2273afe728e019ef6da83b | p fibs_rec(6) => 0, 1, 1, 2, 3, 5, 8 | [
{
"docid": "5f2d02fee5e38fc0bc2da746b774bb3e",
"score": "0.7972104",
"text": "def fibs_rec2(n, result = [0,1]) # returns all numbers up to the nth, all in one function \n return [0] if n == 0\n return [0,1] if n == 1\n result << (result[-2] + result[-1])\n fibs_rec2(n-1, result)\n result\nend",
... | [
{
"docid": "cd149adc8f670b307b76d1ab909a3928",
"score": "0.86245245",
"text": "def fibs_rec(n)\nend",
"title": ""
},
{
"docid": "c81d00f1f4a4151333d4af19e26ad5f6",
"score": "0.82580733",
"text": "def fibs_rec number\n return [0,1] if number < 3\n sequence = fibs_rec (number - 1)\n ... |
a79011e10223105730dbe9dee1950b8b | Changes the animals' mood to nervous when the owner goes to sell them. | [
{
"docid": "fa8a14640cc15fe830112d72ce3454b8",
"score": "0.6043225",
"text": "def sell_pets\n @pets.each do |type, pet|\n pet.each do |pet|\n pet.mood = \"nervous\"\n end\n end\n @pets.clear\n end",
"title": ""
}
] | [
{
"docid": "712e7c02ccc2f7fdab2eb115e9bcc6f5",
"score": "0.6596335",
"text": "def mood=(mood)\n @mood = mood\n end",
"title": ""
},
{
"docid": "712e7c02ccc2f7fdab2eb115e9bcc6f5",
"score": "0.6596335",
"text": "def mood=(mood)\n @mood = mood\n end",
"title": ""
},
{
... |
e22c6339d77318bdf146e083628cf054 | Die when hitpoint drop to zero | [
{
"docid": "43b37645bedaae8285b5baa044aa6f51",
"score": "0.0",
"text": "def kill\n process_actor_death\n super\n end",
"title": ""
}
] | [
{
"docid": "ea659d6873031ff766e32e5da79d1f21",
"score": "0.7196807",
"text": "def receive_damage\n @hit_points -= 10\n end",
"title": ""
},
{
"docid": "832af6d2ed535484a12b509ce188c59b",
"score": "0.7097787",
"text": "def hit! damage = 1\n self.hitpoints -= damage\n hit... |
ec9c9be7444451ea1c586982379df3b4 | it can be the case that extended results are off and collation is on | [
{
"docid": "c55485dd5d77b31f761e16915a7a8c6e",
"score": "0.5131885",
"text": "def mock_response_with_spellcheck_collation\n %|{'responseHeader'=>{'status'=>0,'QTime'=>3,'params'=>{'spellspellcheck.build'=>'true','spellcheck'=>'true','q'=>'hell','spellcheck.q'=>'hell ultrashar','wt'=>'ruby','spellchec... | [
{
"docid": "78763aa935d5e3da5631f7e11476775c",
"score": "0.76451486",
"text": "def collation; end",
"title": ""
},
{
"docid": "78763aa935d5e3da5631f7e11476775c",
"score": "0.76451486",
"text": "def collation; end",
"title": ""
},
{
"docid": "4899de1af06666d0a4dba119ce517d... |
a2099a77c85e91272ae2f9e35b937953 | Only allow a trusted parameter "white list" through. | [
{
"docid": "0eac464ddc245f5727157bca1d995fa7",
"score": "0.0",
"text": "def likestatus_params\n params.require(:likestatus).permit(:user_id, :status_id, :emoticons)\n end",
"title": ""
}
] | [
{
"docid": "c1f317213d917a1e3cfa584197f82e6c",
"score": "0.7121987",
"text": "def allowed_params\n ALLOWED_PARAMS\n end",
"title": ""
},
{
"docid": "b32229655ba2c32ebe754084ef912a1a",
"score": "0.70541996",
"text": "def expected_permitted_parameter_names; end",
"title": "... |
86079262b0e55021d89117725b3be5da | This is removed for now since we only use Geos at the first load for COSA Boundary. And will also wait until the buildpack is fixed, which caused this to fail. def geos_okay? RGeo::Geos.supported? end | [
{
"docid": "b4b989ac8b8463d7f6fb3157edf42286",
"score": "0.0",
"text": "def pdftk_okay?\n begin\n PdfForms.new('pdftk')\n true\n rescue\n false\n end\n end",
"title": ""
}
] | [
{
"docid": "809d38a2d781b31334d3c14302e158cb",
"score": "0.7526628",
"text": "def is_geos?(object)\n CAPI_SUPPORTED && (CAPIFactory === object || CAPIGeometryMethods === object) ||\n FFI_SUPPORTED && (FFIFactory === object || FFIGeometryMethods === object) ||\n ZMFactory === obj... |
72b6189266c93b09970593f78a55683f | Displays a specific tape library. API Key Scope: tape_libraries / show | [
{
"docid": "cbc71a007525293a2e7ffcdf89bac161",
"score": "0.67266136",
"text": "def show_tape_library_with_http_info(tape_library_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeLibrariesApi.show_tape_library ...'\n end\n # verify... | [
{
"docid": "f678a520de2cace9edc8c9454d9a9ece",
"score": "0.7514791",
"text": "def show_tape_library(tape_library_id, opts = {})\n data, _status_code, _headers = show_tape_library_with_http_info(tape_library_id, opts)\n data\n end",
"title": ""
},
{
"docid": "b2d23661ff6d325fb852... |
17005b90b38edda2c2e49f4878f634bb | parse input to output | [
{
"docid": "2029e86e89b60f93cd40395a62ad92b5",
"score": "0.0",
"text": "def scan(input,output,lookahead=[input.getc],fail=true)\n @grammar[input,output,lookahead,fail]\n end",
"title": ""
}
] | [
{
"docid": "8520c1a59d98ed6f95484ff537c4194a",
"score": "0.6924354",
"text": "def parse (input)\n @s = StringScanner.new(input)\n parse_input.value\n end",
"title": ""
},
{
"docid": "53a37e4dd6c96ba909f1c4f91d901671",
"score": "0.6887604",
"text": "def parse\n @ff_type = @i... |
90f3cf6df03ec133a94f587a018c176d | Yield every date between this date and given date to the block. The given date should be less than this date. | [
{
"docid": "f50c7ff4c59017a6fe80153bdeb16c1d",
"score": "0.0",
"text": "def downto(d, &block)\n step(d, -1, &block)\n end",
"title": ""
}
] | [
{
"docid": "bf150c4fc30e77bea60246613a3a2097",
"score": "0.7456275",
"text": "def each_date\n @dates.each { |date| yield date }\n end",
"title": ""
},
{
"docid": "88922c29e838313bcfbfb6e8958cd746",
"score": "0.7016996",
"text": "def interval_date start_date, end_date\n whi... |
3af034874fd5046d59cbf2091d2f9d91 | enable_sync only: [:create, :update, :destroy] GET /books GET /books.json | [
{
"docid": "0d88f20b4eb88f5a743a726794863975",
"score": "0.0",
"text": "def index\n #@q = params[:q]\n book_counter = Book.count(:id)\n # @number_book = (book_counter.empty)? 'empty Value': book_counter.to_s\n @number_book = 'Cantidad de resgistros ' +book_counter.to_s\n\n @books = Book.f... | [
{
"docid": "9410250db9520c3f393afb7c0a32890d",
"score": "0.6224842",
"text": "def create\n @book = Book.new(book_params)\n\n respond_to do |format|\n if @book.save\n sync_new @book ,scope: @project\n format.html { redirect_to @book, notice: 'Book was successfully created.' }\n ... |
b1348b4d488f9d92fe19548b7bbf045f | Performs an HTTP request to the given URI and request object. It returns an HTTP response that has been sent from the registry. | [
{
"docid": "7ebc179a0a23f9d68d120897d645671c",
"score": "0.0",
"text": "def get_response_token(uri, req)\n https = uri.scheme == \"https\"\n Net::HTTP.start(uri.hostname, uri.port, use_ssl: https) do |http|\n http.request(req)\n end\n end",
"title": ""
}
] | [
{
"docid": "067eaa90329e080f6a5cffa8b6512925",
"score": "0.67692804",
"text": "def request(uri, request = nil)\n # TODO: Possibly use SAX parsing for large request bodies (?)\n\n request ||= Net::HTTP::Get.new(uri.request_uri)\n\n connection.request(uri, sign(uri, request)) do |response|\n ... |
5ac523722e094f0c6f029260c1e79835 | DELETE /user_resumes/1 DELETE /user_resumes/1.json | [
{
"docid": "15b3e91b5b13746f06ec46d0b1a9c469",
"score": "0.77327603",
"text": "def destroy\n @user_resume.destroy\n respond_to do |format|\n format.html { redirect_to user_resumes_url, notice: 'User resume was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"... | [
{
"docid": "a5fcd0fc707b8d4d71ad8790a710edf2",
"score": "0.79856676",
"text": "def destroy\n @resume = @user.resumes.find(params[:id])\n @resume.destroy\n\n respond_to do |format|\n format.html { redirect_to resumes_url }\n format.json { head :no_content }\n end\n end",
"title... |
69a6f52778d1f82c66dcefa878d19046 | Update the local movie database, by revisiting all tracked directories, and building the database from there. | [
{
"docid": "18f0affa6854555620ae4aff9923807b",
"score": "0.46969345",
"text": "def update_itself\n message = \"Found no movie box in the local database.\\n\"\n message += \"Please, run `movier add` to add some movie boxes, before updating me!\"\n raise message if @boxes.empty?\n @mo... | [
{
"docid": "05d8832b863b8e233377d928f66441c0",
"score": "0.5845237",
"text": "def update_metadata!\n compilation_context.source_file_database.update_metadata(source_path)\n compilation_context.target_file_database.update_metadata(source_path)\n end",
"title": ""
},
{
... |
8cde0dfc4587f5db4e9585704f0e4b48 | reorder shares 1. nonsurviving director cert 2. nonsurviving plain certs 3. surviving plain certs 4. surviving director cert | [
{
"docid": "eb186477b0483f3ab93e145885d57098",
"score": "0.6275039",
"text": "def reorder_shares(shares, corps)\n if corps.one?\n shares.select { |s| s.corporation == corps.first }.sort_by(&:percent)\n else\n shares.select { |s| s.corporation == corps.last }.sort_... | [
{
"docid": "13bb8dff60afb99f5b83971add1d72ab",
"score": "0.60064775",
"text": "def return_half_and_swap(entity)\n #\n # Deal with directors with less than 60% across affected corps\n #\n entity_shares = affected_shares(entity, @merge_data[:corps])\n pres_opti... |
c845a4c7ac2e8fd72a0232d7f8e26e8a | Check each entry in order from array | [
{
"docid": "ad56001f4e05adaaa6d1c2f6df0d10c9",
"score": "0.0",
"text": "def ordered_check(**kwargs)\n entries.each do |entry|\n if entry.match(**kwargs)\n # Check if its an allow or deny acl entry (may not be both)\n return true if entry.is_allow?\n retu... | [
{
"docid": "88f02c693efdf0586fd3a54aad6a6cdf",
"score": "0.70599955",
"text": "def pbCheckItems(array) # Unused\n for i in 0...array.length\n next if !array[i].hasItem?\n for j in i+1...array.length\n return false if array[i].item==array[j].item\n end\n end\n return true... |
cd55f512351b52cd3099e531d1ad96e2 | used to display exact number of rubies found_rubies | [
{
"docid": "15221108249f02ddcc363c3940ff01a4",
"score": "0.7076582",
"text": "def display_rubies(total_rubies, total_fake, rubyist_num, iterations)\r\n raise 'total_rubies must be an integer!' unless total_rubies.is_a? Integer\r\n\r\n raise 'total_fake rubies must be an integer!' unless total_fake... | [
{
"docid": "f21e78f9684278f8456c299406797771",
"score": "0.71551126",
"text": "def rubies_found(num_real_rubies, num_fake_rubies)\n @real_ruby_count += num_real_rubies if num_real_rubies > -1\n @fake_ruby_count += num_fake_rubies if num_fake_rubies > -1\n end",
"title": ""
},
{
"docid... |
bac0ce1fa9d8cf0aa08419dca0a42def | return a proc that defines the columns used by this detective if using this as an example, you probably should copy the first two columns (the id and foreign key) | [
{
"docid": "225e616656a99ff39d6091010c1e7505",
"score": "0.6580401",
"text": "def columns\n Proc.new do\n <<-SQL\n id integer primary key autoincrement,\n sample_id integer, --foreign key to reference the original revision\n \n ... | [
{
"docid": "3d65cad9b1dc7721ee15159ed058836a",
"score": "0.62676054",
"text": "def essential_columns(model_class)\n model_class.reflect_on_all_associations.inject([@primary_key]) do |arr, assoc|\n if assoc.options[:dependent] && assoc.macro == :belongs_to\n arr << assoc.association_... |
6b8b3d2f8dddc3784d33a8ad9a52ac3b | DELETE /selection_sessions/1 DELETE /selection_sessions/1.json | [
{
"docid": "1cef50254141636f8dfc2dc8cf3177e7",
"score": "0.7583715",
"text": "def destroy\n @selection_session = SelectionSession.find(params[:id])\n @selection_session.destroy\n\n respond_to do |format|\n format.html { redirect_to selection_sessions_url }\n format.json { head :no_con... | [
{
"docid": "db4123b54eef63306974799f04f4279c",
"score": "0.70627147",
"text": "def deleteSession\n destroy\n @team = Team.find(session[:team_id])\n sessions = @team.sessions.last(5).reverse\n respond_to do |format|\n format.html { redirect_to sessions_url }\n format.json {render js... |
f12f7fb766e16e30fab709b7f53e9c9e | TODO [OK]predicate methods can not have side effects [OK]hint change to validate_correct_answers [OK]hint make it private | [
{
"docid": "5717eae948149451b73215c9f7827796",
"score": "0.630425",
"text": "def validate_correct_answers\n errors.add(:name, \"No correct answer\") if answers.none? {|x| x.correct?}\n\n #TODO\n #[OK]please consider this:\n #[OK]errors.add(:name, \"no correct answer\") if answers.non... | [
{
"docid": "d53ae775a9906a383a0b1741db477b7d",
"score": "0.6445038",
"text": "def predicate_method?; end",
"title": ""
},
{
"docid": "d53ae775a9906a383a0b1741db477b7d",
"score": "0.6445038",
"text": "def predicate_method?; end",
"title": ""
},
{
"docid": "338556cbc6e3b36d... |
189dc1dd419c7de972aa8b7e436d2b4a | TODO changing logic basiced on new UI changes need review | [
{
"docid": "c619b9fa5364a296487881f3af752a37",
"score": "0.0",
"text": "def suction_calculation\n calculated_values = {}\n \n hydraulic_turbine = HydraulicTurbine.find(params[:hydraulic_turbine_id])\n \n suction_total_dp_max = ''\n pressure_suction_nozzle_max = ''\n max_suction_pres... | [
{
"docid": "3f95c69be7ae91590b16f909dff3bddf",
"score": "0.61755115",
"text": "def ui; end",
"title": ""
},
{
"docid": "738e2ca9c53d6a39e7d7ed15740d6363",
"score": "0.5611835",
"text": "def sync_ui_from_model()\n end",
"title": ""
},
{
"docid": "2dbabd0eeb642c38aad... |
75a9e8d48bbcc4b36ee385d5f268175e | GET /price_tickers/new GET /price_tickers/new.xml | [
{
"docid": "6ec3c7f5e68bd2e7be08d646057eb690",
"score": "0.7430746",
"text": "def new\n @price_ticker = PriceTicker.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @price_ticker }\n end\n end",
"title": ""
}
] | [
{
"docid": "f75ada641715336d080a9d2e9fb6382e",
"score": "0.7239267",
"text": "def new\n @prices = Prices.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @prices }\n end\n end",
"title": ""
},
{
"docid": "6ced98397186953b68d770ef1... |
7785f2e45d4f83da99824bfa832a0549 | this function computes the cache of equality (to avoid compare the same numbers again and again) | [
{
"docid": "472c9a9d36ec8afe6231b9e976101af7",
"score": "0.8161128",
"text": "def compute_cache\n\n\t\t# cache of equality will be stored on @equals\n\t\t# we store if a number if equal to the successor\n\t\t@equals = Array.new( @sequence.size )\n\n\t\t# for every number on the list\n\t\ti = 0\n\t\t@seq... | [
{
"docid": "a947273794be05cd98af367f88066e67",
"score": "0.6516913",
"text": "def cache_intersection2(nums1, nums2)\n outer_cache = {}\n nums1.each do |n|\n next if outer_cache[n]\n outer_cache[n] = true\n end\n array = []\n inner_cache = {}\n nums2.each do |n|\n next if inner_cache[n]\n ... |
1d4fe0d8da471a580174a42a096f858a | Tells if the Event can start | [
{
"docid": "cf453becf0b45b4536485ad585dcd5dd",
"score": "0.0",
"text": "def over_trigger?\n return false if !@character_name.empty? && !@through || @invisible_event\n return false unless $game_map.passable?(@x, @y, 0)\n return true\n end",
"title": ""
}
] | [
{
"docid": "a44890a210da3f44e10044d5ba93ca7e",
"score": "0.79582834",
"text": "def can_start\n @can_start || false\n end",
"title": ""
},
{
"docid": "978351122cc1c5886b87a1f34bea3eda",
"score": "0.78316396",
"text": "def canStart()\n\t\t\t\treturn true\n\t\t\tend",
"title": "... |
4a059b317398b47bb296a88c4c56d8ca | Like status, but in batch | [
{
"docid": "262eeda7e5c4919608d1cea4a4ba6401",
"score": "0.0",
"text": "def statuses\n data = request.raw_post.to_s\n\n hosts = {}\n uuids = {}\n data.split(';').each do |vm_and_status|\n uuid, status, host = vm_and_status.split(',')\n uuids[uuid] = status\n hosts[uuid] = host... | [
{
"docid": "410ec594a0e756db23335aa7a801204d",
"score": "0.76405966",
"text": "def status(*) end",
"title": ""
},
{
"docid": "410ec594a0e756db23335aa7a801204d",
"score": "0.76405966",
"text": "def status(*) end",
"title": ""
},
{
"docid": "e101a3903369f195369a7f56a94a6788... |
4124ab1df22404ec1089198817cf65eb | GET /customer_groups/new GET /customer_groups/new.json | [
{
"docid": "b5f3907c6fc3dfa41023f4a0d738af44",
"score": "0.76955336",
"text": "def new\n @customer_group = CustomerGroup.new\n end",
"title": ""
}
] | [
{
"docid": "19b837a2d03ef09a68a0444c9d96f902",
"score": "0.7572787",
"text": "def new\n @group = scoped_groups.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n end\n end",
"title": ""
},
{
"docid": "45eba1ad13c771bb68289f... |
0e9e35a457f8b48bb35c6453c325fe7d | Testing reallife initial state command line outputs | [
{
"docid": "77324c701b343b1ba3f6f3c9bd3f4bf7",
"score": "0.62389874",
"text": "def test_omakase_command_line_output\n omakase_state = @base_states[:omakase_state]\n\n render_inline(\n Shared::CommandLine::Output::Component.new(\n state_translation: @state_transl... | [
{
"docid": "813c7e23de825d37d4ad726a61065c5f",
"score": "0.6200204",
"text": "def initialize( argv )\n if argv == \"__testmode__\"\n puts \"test mode: initialize process is skipped\"\n @testmode_flag = true\n else\n exit_with_msg( \"input casename\") if argv == nil\n @nc_fn = init_fname( a... |
fe87075b8a4f49c5b4232f9cfd683deb | check if the liable method or statement contains a while statement | [
{
"docid": "86e369c3d5e0dd44f2d91c9d7a1456cc",
"score": "0.7719391",
"text": "def while?()\n return genericCheck(:while, nil)\n end",
"title": ""
}
] | [
{
"docid": "eab48875be4e83cf75ff55b0222ef6a4",
"score": "0.73244214",
"text": "def in_while?\n @scope.in_while?\n end",
"title": ""
},
{
"docid": "eab48875be4e83cf75ff55b0222ef6a4",
"score": "0.73244214",
"text": "def in_while?\n @scope.in_while?\n end",
"title": ... |
bd3a7dfddc30bc69012064ac1ec450c4 | Given a hash with numeric values, return the key for the smallest value | [
{
"docid": "44ac49fad2dab25f3a7570597c013dcf",
"score": "0.0",
"text": "def key_for_min_value(name_hash)\n min_key=nil\n min_value=0\n name_hash.each do |key, value|\n if min_value==0 ||\n value<min_value\n min_value=value \n min_key=key\n end\n end\nmin_key\nend",
"title": ... | [
{
"docid": "187165074e32a7573ee53a9cabb44ed4",
"score": "0.8880233",
"text": "def key_for_min_value(hash)\n lowest_key=nil \n lowest_value= Float::INFINITY\n hash.each do |name,number|\n if number < lowest_value\n lowest_value=number\n lowest_key= name\n end \n end\n lowest_key\nend... |
58716f637fa34906905483986a9dcdec | Extracts the content between quotes (it must not be parsed) argument: string to extract the substring from returns: substring | [
{
"docid": "d95f90e9d18771805e41a699f73fb2f3",
"score": "0.0",
"text": "def extract(expr)\n ext = '\"'\n while expr[@d] != '\"' do\n ext += expr[@d]\n @d += 1\n end\n @d += 1\n return ext + '\"'\n end",
"title": ""
}
] | [
{
"docid": "75d7f1e551d6900d0e45459c7428112a",
"score": "0.6644632",
"text": "def parse_string(ss)\n remove_leading_spaces(ss)\n if ss.scan(/\".*?\"/)\n ss.matched[1..-2]\n else\n raise \"expected string but didn't find one\"\n end\n end",
"title": ""
},
{
... |
27ef8cabffc8acae2022073ccc874ac5 | Output a the header part of the hash for serialization to the cache. | [
{
"docid": "142db4555229482b1f9f63da5584f40c",
"score": "0.0",
"text": "def to_h\n { stompHeaders: @stomp_headers,\n replyTo: @reply_to,\n replyId: @reply_id,\n inReplyTo: @in_reply_to,\n contentType: @content_type }\n\n end",
"title": ""... | [
{
"docid": "7e31bf7ea27c3659447d34f001cb3713",
"score": "0.6429314",
"text": "def write_header\n # Include Header and encryption version indicator\n flags = @cipher.version || 0 # Same as 0b0000_0000_0000_0000\n\n # If the data is to be compressed before being encrypted, set the\n #... |
3689c613887ced7cac63a6da195a356f | build the Geo object from a Hash | [
{
"docid": "0a571d6e86e0ffd4fb04157b50ff8a91",
"score": "0.69230795",
"text": "def build_from_hash(location=nil)\n return nil unless location\n raise ArgumentError unless location.is_a?(Hash)\n \n @query = location[\"name\"]\n placemark = location[\"Placemark\"]\n placemark... | [
{
"docid": "dc8dd8eca9f2ea8e70a9794bb341579b",
"score": "0.7207651",
"text": "def initialize(hash)\n @id = hash[:_id].to_s if !hash[:_id].nil?\n @formatted_address = hash[:formatted_address] if !hash[:formatted_address].nil?\n if !hash[:address_components].nil?\n @address_components = []\n... |
76e9fe684397ee0a9494ae6b0f572fe1 | Generate the accessor block. | [
{
"docid": "0d39d26778fd9ba680f0a73090d3d447",
"score": "0.0",
"text": "def accessors\n decs = \"\"\n @parser.properties.each_pair { |name,property|\n type = property[:type]\n\n decs << @mixer.get(name,type) if property[:gets]\n decs << @mixer.set(name,type) if property[:sets]\n ... | [
{
"docid": "7701df30c201961ce38c6a9df66e5c23",
"score": "0.6422948",
"text": "def accessor; end",
"title": ""
},
{
"docid": "7701df30c201961ce38c6a9df66e5c23",
"score": "0.6422948",
"text": "def accessor; end",
"title": ""
},
{
"docid": "26a12208454e30552e688a9729da3c7d",... |
099e8d420021cf111a26f5e55b3f8644 | Maps logical Rails types to MySQLspecific data types. | [
{
"docid": "b0494b9db7642a9cf9ed9d35af2cbda9",
"score": "0.6295348",
"text": "def type_to_sql(type, limit = nil, precision = nil, scale = nil, unsigned = false)\n # return earlier, only need overwrite method when unsigned option == true\n return super unless unsigned\n\n\n case type... | [
{
"docid": "26389a61865b97b1153dc49b4981e471",
"score": "0.8001559",
"text": "def data_type_mapper(mysql_data_type)\n case \n mysql_data_type\n when /^int\\([0-9]+\\)/ || \"mediumint\"\n \"integer\"\n when /tinyint\\([2-9]+\\)/\n \"smallint\"\n when \"tinyint(1)\... |
c589455f0d1453acd0947a9956e797f8 | Returns the NSUndoManager for the application. In this case, the manager returned is that of the managed object context for the application. | [
{
"docid": "32993eb0537968a0299b0b433fb3410f",
"score": "0.69460213",
"text": "def windowWillReturnUndoManager(window)\n self.managedObjectContext.undoManager\n end",
"title": ""
}
] | [
{
"docid": "aa2598dbfa8ee12f2baf6aa8a661090f",
"score": "0.7301776",
"text": "def windowWillReturnUndoManager(window)\n return self.managedObjectContext.undoManager\n end",
"title": ""
},
{
"docid": "4c9e4bac68d68c31b390db4d9c5b50ac",
"score": "0.712444",
"text": "def windowWillR... |
79093b612684405451ed19c600716c8c | Sets the mode to hours and gets ready to plus or minus. ===Examples datet.time => 20050508 17:46:11 +0200 datet.hours + 5 datet.time => 20050508 22:46:11 +0200 | [
{
"docid": "60ff081f9b55cafde9596b473fe4539e",
"score": "0.7287538",
"text": "def hours\n Thread.current[:datet_mode] = :hours\n return self\n end",
"title": ""
}
] | [
{
"docid": "3044dc364bdce43fea98978608a1bc60",
"score": "0.6770698",
"text": "def add_hours(hours = 1)\n hours = hours.to_i\n cur_hour = @t_hour\n next_hour = cur_hour + hours\n \n if next_hour >= 24\n @t_hour = 0\n self.add_days(1)\n hours_left = (hours - 1) - (24 - cur_ho... |
014e84a031e84a92570c9d0f63b2ab2a | GET /peos/1 GET /peos/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "134145241e73fd4b3f398f8dec2e9f7c",
"score": "0.6910668",
"text": "def index\n @peos = Peo.all\n end",
"title": ""
},
{
"docid": "a48a033a788fdebb2a77104f36901d8c",
"score": "0.66315",
"text": "def index\n @pessoas = Pessoa.all\n render json: @pessoas\n end",
... |
91af9997ec8179e25a567f8b0787178c | Assign changes to an instance variable | [
{
"docid": "71f6233bc6a5de76dcc2d624aa82295e",
"score": "0.0",
"text": "def initialize(changes)\n @changes = changes\n end",
"title": ""
}
] | [
{
"docid": "d30efd2ddd0b0b4fbf3b7cdf5b46be44",
"score": "0.7137296",
"text": "def instance=(instance); end",
"title": ""
},
{
"docid": "98a1f620f4bbdf6b5e8fefdde0a0d165",
"score": "0.66098905",
"text": "def instance_variable_set(p0, p1) end",
"title": ""
},
{
"docid": "47... |
345fd8ee8b24f78cbba4bf55feaedfbf | BitRate ==== DESCRIPTION The bit rate of the track (in kbps). ==== RETURNS I4(Fixnum) | [
{
"docid": "35f78f8ca7ba33461b6f1151fc79e10c",
"score": "0.7485043",
"text": "def bit_rate\n @ole.BitRate\n end",
"title": ""
}
] | [
{
"docid": "ee7399feaee469e9fca84630e7dc6ac2",
"score": "0.71422434",
"text": "def bit_rate\n @av_stream.bit_rate\n end",
"title": ""
},
{
"docid": "e8d618888859100aba0e3a39a01d56cd",
"score": "0.69770217",
"text": "def frame_rate\n return (1 / DT).to_i\n end",
"t... |
5210cb611eff9a4106b9671835dcc249 | Unbinds the base object to the inverse of the relation. This occurs when setting a side of the relation to nil. Will delete the object if necessary. | [
{
"docid": "91d5375befa724730899244968623171",
"score": "0.605798",
"text": "def unbind(old_target, options = {})\n binding(old_target).unbind(options)\n base.delete if old_target.persisted? && !base.destroyed?\n end",
"title": ""
}
] | [
{
"docid": "34bfebf174ce40591c50f59364759245",
"score": "0.7993313",
"text": "def unbind\n base.you_must(metadata.foreign_key_setter, nil)\n if metadata.inverse_type\n base.you_must(metadata.inverse_type_setter, nil)\n end\n unless _binding?\n ... |
42dfde477179fb3283b1c37446f5abad | DELETE /quetes/1 DELETE /quetes/1.json | [
{
"docid": "d21a2d8a910f88b6851e3d93e2bdbc9d",
"score": "0.6952377",
"text": "def destroy\n @quete.destroy\n respond_to do |format|\n format.html { redirect_to quetes_url, notice: 'quete was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
... | [
{
"docid": "67a61fc262c9cd9f64b4b33ee15613e0",
"score": "0.72255707",
"text": "def destroy\n @quetion = Quetion.find(params[:id])\n @quetion.destroy\n\n respond_to do |format|\n format.html { redirect_to quetions_url }\n format.json { head :no_content }\n end\n end",
"title": ... |
211911a74074bd4a699c18f2c8aa0a15 | parse a list of items and combine them in a right associated manner returns a lambda | [
{
"docid": "58cd1f61dc60056e08ec8da7474c8606",
"score": "0.0",
"text": "def parse_right_infix(opsym, opcon)\n opupdate = ->(f,e1,e2) { f.call(opcon.call(e1,e2)) }\n sof = ->(x) { x }\n method(:parse_ginfix).curry.call(opsym, opupdate, sof)\n end",
"title": ""
}
] | [
{
"docid": "9a82a14f4fa1c9a2736c14d93ba08b09",
"score": "0.5580508",
"text": "def construct(list)\r\n\treturn lambda{|x| list.map{ |z| z.call(x)}}\r\nend",
"title": ""
},
{
"docid": "86522c3cd4bf3e821f5a3e5141dc80d5",
"score": "0.5559705",
"text": "def _reduce_332(val, _values, resul... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "83c1fe156758c598b1a3a9c1f19592fd",
"score": "0.0",
"text": "def bill_to_params\n params.fetch(:bill_to, {})\n params.require(:bill_to).permit(\n :name,\n :phone_num_1,\n :email_1,\n )\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7495027",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.69566035",
"text": "def strong_params\n params.require(:request).permit(param_whit... |
6e2702bb50d06f15752b9dcd679d1d40 | ==================================================================================== Fee Calculation ==================================================================================== | [
{
"docid": "89943840eeefa84e16fcafbb379b34e3",
"score": "0.67825544",
"text": "def fee( with_coupon=true, with_usat=true )\n\t\tfee_value = race.current_fee( created_at ).to_f\n\n\t\tif with_usat\n\t\t\tfee_value += usat_fee.to_f\n\t\tend\n\n\t\tif with_coupon\n\t\t\tunless coupon.blank?\n\t\t\t\tfee_va... | [
{
"docid": "14719b79895963f43aca0bc134da0899",
"score": "0.82198316",
"text": "def fee\n end",
"title": ""
},
{
"docid": "9cdf5a5a7da8c32d8404df7d271c800e",
"score": "0.8001565",
"text": "def fee\n @fee ||= (payments.length > 0 ? payments.inject(0){|sum, p| sum + p.... |
3693801f9f455f9c4729b0ed2e760615 | the given string with all five or more letter words reversed. Each string will consist of only letters and spaces. Spaces should be included only when more than one word is present. Understand the problem: method takes a string argument of one or more words reverses the letters of words with 5 or more characters return... | [
{
"docid": "099698a616f056d08a167e39a34621fc",
"score": "0.8071835",
"text": "def reverses_words string\n new_str = string.split.map do |word|\n word.reverse! if word.length >= 5\n word\n end\n\n new_str.join(' ')\nend",
"title": ""
}
] | [
{
"docid": "1a8a8caebbf441860ca87449dc975287",
"score": "0.8352331",
"text": "def reverse_words(input_string)\n word_array = input_string.split(' ') # => [\"Professional\"], [\"Walk\", \"around\", \"the\", \"block\"], [\"Launch\", \"School\"]\n reverse_array = word_array.map do |word| # => [\"Pr... |
c0ac95fa657af18328719816422a4d37 | GET /stocks/1 GET /stocks/1.json | [
{
"docid": "e19b27ea16b3a52ab94d93a0f46abbe9",
"score": "0.6492909",
"text": "def show\n drop_breadcrumb(\"股票\")\n drop_breadcrumb(\"#{@stock.name}(#{@stock.market}:#{@stock.code})\")\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stock }\n e... | [
{
"docid": "101460710b669b67f96b513d093ffd0c",
"score": "0.813285",
"text": "def show\n @stock = Stock.find(params[:id])\n\n render json: @stock\n end",
"title": ""
},
{
"docid": "0c3b49e80a15388e4b39723baa4e0c32",
"score": "0.7827617",
"text": "def show\n @stock = Stock.fi... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "6852b1a6cfde455c8be0505b8b6a2835",
"score": "0.0",
"text": "def comment_params\n params[:comment][:user_id] = current_user.id\n params.require(:comment).permit(:comment, :user_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... |
a968bebcc5a53035bd836ff9a22cc178 | ========================== File system ========================== append content to file and add "\n" automatically | [
{
"docid": "f00b7a2d21268ca7038fa11166a80578",
"score": "0.72562695",
"text": "def append_file(fname, content)\n begin\n aFile = File.new(fname,\"a\")\n aFile.puts content\n aFile.close\n rescue Exception=>e\n # logger.error e\n p e.inspect\n end\nend"... | [
{
"docid": "132354e50a96b9b96c84489d94aa2a7b",
"score": "0.79156387",
"text": "def appendLineContentToFile(lineContent, filePath)\n File.open(filePath, 'a') do |file|\n file.puts \"#{lineContent}\"\n end\nend",
"title": ""
},
{
"docid": "8281fec565ae7f0e1d7b5a3be2251e1f",
"score": ... |
c2350108c1b0d888db1f63034445b308 | define what happens when the measure is run | [
{
"docid": "340efd40e60913599ae3f35889319651",
"score": "0.0",
"text": "def run(model, runner, user_arguments)\n super(model, runner, user_arguments)\n\n # use the built-in error checking\n if !runner.validateUserArguments(arguments(model), user_arguments)\n return false\n end\n\n # ... | [
{
"docid": "99ab945a1927e84fe17934e1440b9eb0",
"score": "0.7556993",
"text": "def measure(&block); @measure = block; end",
"title": ""
},
{
"docid": "98be183bacea0b93f865dcb476b3ac9c",
"score": "0.71152234",
"text": "def measure(&block)\n @measure = block\n end",
"title": ""
... |
8b661da33b933460f516a64704b6bfe5 | Extracts misc data from response header. | [
{
"docid": "604d18c96f695b8a095397558673774b",
"score": "0.7226552",
"text": "def extract_header_data(response)\n header_type = get_full_type_signature(:SoapResponseHeader)\n headers = response.header[:response_header].dup\n process_attributes(headers, false)\n headers = normalize_fi... | [
{
"docid": "3a28a0a10d0c0877bfd9291c7b4cc13e",
"score": "0.7850181",
"text": "def extract_data_from(response)\n response.header\n end",
"title": ""
},
{
"docid": "3a28a0a10d0c0877bfd9291c7b4cc13e",
"score": "0.7850181",
"text": "def extract_data_from(response)\n re... |
e5fcabe9636f91364c8757b5f9fd14bf | .zz STUFF A comment | [
{
"docid": "9ee184be2c399d5c63d531e5f3ef7beb",
"score": "0.0",
"text": "def zz_request(*_)\n # Do nothing\n end",
"title": ""
}
] | [
{
"docid": "7c1e2c99d0c85589e7931688ad6c9b83",
"score": "0.78302157",
"text": "def comment(string); end",
"title": ""
},
{
"docid": "7c1e2c99d0c85589e7931688ad6c9b83",
"score": "0.78302157",
"text": "def comment(string); end",
"title": ""
},
{
"docid": "7c1e2c99d0c85589e7... |
2811c26d61e58ed01c2b35b061422a1e | opens an interactive ssh console | [
{
"docid": "7002af8b8d9bb3c841f1f5ad85ea1f2c",
"score": "0.69247633",
"text": "def open_ssh(id=@connection.servers.first)\n command = ssh_cli_string(id)\n exec(command)\n end",
"title": ""
}
] | [
{
"docid": "24c566a6e50770900b75b923f0645a28",
"score": "0.68233794",
"text": "def open_session(iter)\n Msf::Ui::Gtk2::Console::Shell.new(iter)\n end",
"title": ""
},
{
"docid": "e6b851a5678c8b2ade8f63d89b7afde1",
"score": "0.6684498",
"text": "def interactive_ssh(run... |
16fe227b2c8a33e9017deb977533db42 | List SecurityGroups for Vm Returns an array of SecurityGroup objects | [
{
"docid": "d28ca47a6751d87fa7e4cb83c147d153",
"score": "0.0",
"text": "def list_vm_security_groups_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.list_vm_security_groups ...'\n end\n # verify the required ... | [
{
"docid": "b54df658d05276e92170d113645eff8b",
"score": "0.7570991",
"text": "def vpc_security_groups\n vsgs = []\n @cluster.vpc_security_groups.each do |vsg|\n vsgs << vsg.vpc_security_group_id if vsg.status == 'active'\n end\n vsgs\n en... |
c928f88ac8388f49c3dad8da14db6199 | DELETE /movimimiento_venta/1 DELETE /movimimiento_venta/1.json | [
{
"docid": "d8d4e987a17d8ee7b8c78a905ecbc285",
"score": "0.75226843",
"text": "def destroy\n @movimimiento_ventum.destroy\n respond_to do |format|\n format.html { redirect_to movimimiento_venta_url, notice: 'Movimimiento ventum was successfully destroyed.' }\n format.json { head :no_cont... | [
{
"docid": "662d7ca26c9ca96e45abcf67844213ef",
"score": "0.7461177",
"text": "def destroy\n @servico_evento.destroy\n respond_to do |format|\n format.html { redirect_to servico_eventos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1b222... |
11d5adeb2e534ff20ba90d7501aef60d | Expects a hash of values grouped by popularity Yields the most popular values first, and then increasingly less popular values | [
{
"docid": "ceafbf6b13a2987c07b50e1cb186da14",
"score": "0.7108982",
"text": "def enumerate_by_popularity(values_by_popularity)\n popularities = values_by_popularity.keys.sort.reverse\n popularities.length.times do |i|\n at_popularities = popularities.take(i + 1)\n yield ... | [
{
"docid": "8ffcd7e1a109a265efac3264e38d4aa1",
"score": "0.70956826",
"text": "def sort_by_popularity(hash_cnt, hash_res)\n sorted_hash = hash_cnt.sort_by {|key, count| -count}\n res = []\n \n sorted_hash.each do |tuple|\n res << hash_res[tuple[0]]\n end\n res\n end",
"title"... |
76204c7d3b9962130905d58c4a9bb254 | GET /workshop_salaries/1 GET /workshop_salaries/1.json | [
{
"docid": "76e90d3b34050ded0ac36e18b7b564ff",
"score": "0.0",
"text": "def show\r\n end",
"title": ""
}
] | [
{
"docid": "3ab2e6350f0f714a9dc0424b3122be36",
"score": "0.68817157",
"text": "def show\n @workshop = Workshop.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @workshop }\n end\n end",
"title": ""
},
{
"docid": "68a1... |
0235982604123112c3f872362b6e5c1f | Observer is observing this Observable's value. Raises if observable has crashed. Returns current value, or nil if not yet ready. Subscribes observer for updates if persistent, or if not yet ready (returning nil). The observer will be dropped once no longer alive?. | [
{
"docid": "dc1e2f5cbdb029b996adf694038401f5",
"score": "0.5970339",
"text": "def add_observer(observer, persistent: true)\n @mutex.synchronize do\n if !@value\n # subscribe for future udpates, no value to return\n @observers[observer] = persistent\n\n elsif Exceptio... | [
{
"docid": "9651e9af7c50b823ddfec05c482cfcfd",
"score": "0.5909882",
"text": "def ready?\n !!@value\n end",
"title": ""
},
{
"docid": "cb1afdda74b20b91c0976fd63b956341",
"score": "0.5900161",
"text": "def _subscribe(observer)\n raise 'observer cannot be nil' unless obser... |
3c28444ff7b34c11b2d09046aa36562b | this filter creates an extra level of security, alhtough unlikely to be needed Users controller already requires a signedinuser before the follow or unfollow buttons can be successfully used. We also need signed in users for the create and destroy actions below. they would likely catch all unsigned users by themselves,... | [
{
"docid": "6e32652e3bbb54bbba35cf2b861670fd",
"score": "0.0",
"text": "def create\r\n @user = User.find(params[:relationship][:followed_id])\r\n current_user.follow!(@user)\r\n #redirect_to @user \r\n respond_to do |format|\r\n format.html { redirect_to @user }\r\n format.js\r\n ... | [
{
"docid": "21df0291f51fbda9ad773e85a04b47ac",
"score": "0.68501747",
"text": "def authorize_user_only\n unless current_user == @user\n redirect_to user_path(current_user)\n end\n end",
"title": ""
},
{
"docid": "c4c37cd227a4b70c3ebcb58b07021cf4",
"score": "0.6790624"... |
8219df3dc2801d7a6c51112b7b47e9d1 | association methods adjacency matrix based | [
{
"docid": "3af3e53190e31f76f19247b825a7b19e",
"score": "0.0",
"text": "def get_association_by_transference_resources(firstPairLayers, secondPairLayers, lambda_value1 = 0.5, lambda_value2 = 0.5) # DONE\n\t\trelations = []\n\t\tmatrix1 = @adjacency_matrices[firstPairLayers].first\n\t\tmatrix2 = @adjacenc... | [
{
"docid": "131cc64fad400583fd77a376e511fe90",
"score": "0.7210489",
"text": "def adjoint()\n\t\tm = cofactorMatrix\n\t\tm.transpose!\n\tend",
"title": ""
},
{
"docid": "bb8f4bdf499333160570ed4fc5f24027",
"score": "0.70592874",
"text": "def adjancy_matrix\n matrix = GraphViz:... |
7c44b7c79b04e5dfb55791bc1d6697e3 | GET /topics GET /topics.json | [
{
"docid": "f56a6ca6f7bb345ae02ad000bf7dc817",
"score": "0.0",
"text": "def index\n @topics = Topic.all.page params[:page]\n @published_topics = Topic.where(published: true).page params[:page]\n @categories = Category.all\n end",
"title": ""
}
] | [
{
"docid": "b64878a9e43283c9c1e729077a1f3c5c",
"score": "0.84226954",
"text": "def topics\n get 'topics'\n end",
"title": ""
},
{
"docid": "e7f1c7a4d11f981f7846cf4ba6b56a88",
"score": "0.7653341",
"text": "def index\n @topics = Topic.order(:name).all\n \n respond_to do... |
97776221cd91c397f97a23d8343a24d8 | Internal: Determines and configure Capybara to use the correct driver based on the browser. Returns nothing. | [
{
"docid": "f9d45701a9d36a82eb73ef977f694c43",
"score": "0.6687427",
"text": "def register_driver\n options = {\n browser: browser\n }\n\n # Sauce Labs browsers require extra options.\n options = sauce_labs_capabilities(options) if browser.to_s =~ /^sauce/\n\n # TODO: Figure out how ... | [
{
"docid": "d6ca9361a37a44ec384ce66375556030",
"score": "0.76763",
"text": "def setup_web_browser_driver(browser_name)\n puts \"Setting up browser driver ...\".colorize(:cyan)\n require 'capybara'\n require 'capybara/rspec'\n require 'selenium-webdriver'\n\n Capybara.default_driver = :selenium\n C... |
653ea6d08584eb54c1253a3f821f949d | Delete a &39;fabric.EthNetworkControlPolicy&39; resource. | [
{
"docid": "8bd6fc0d2722f20887bdac5698f8e965",
"score": "0.56927115",
"text": "def delete_fabric_eth_network_control_policy_with_http_info(moid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: FabricApi.delete_fabric_eth_network_control_policy ...... | [
{
"docid": "a4ba6a046546dda678cdac5c578a9e17",
"score": "0.697791",
"text": "def delete_fabric_eth_network_control_policy(moid, opts = {})\n delete_fabric_eth_network_control_policy_with_http_info(moid, opts)\n nil\n end",
"title": ""
},
{
"docid": "eda6d77add81e32c0852f2f8cfa57... |
688b86e17245705d0747fd7bc4a3d00e | POST /as POST /as.json | [
{
"docid": "3cb8c5f729fea52b679bcf934848eb70",
"score": "0.0",
"text": "def create\n @a = A.new(a_params)\n\n respond_to do |format|\n if @a.save\n format.html { redirect_to @a, notice: 'A was successfully created.' }\n format.json { render action: 'show', status: :created, loca... | [
{
"docid": "39e9744f376f94ec33eedd17d17b4755",
"score": "0.6196606",
"text": "def post_as(user, url, **opt, &block); end",
"title": ""
},
{
"docid": "5d6dccf78c0e8c6887c78af5e102126f",
"score": "0.6036214",
"text": "def post_as(user, action, params: {}, format: nil, session: {})\n ... |
dfa4f34a463feb331156cfb3998a4914 | DELETE /avoirs/1 DELETE /avoirs/1.xml | [
{
"docid": "12da561ba55a3413f94c774e88d3096d",
"score": "0.0",
"text": "def destroy\n @avoir = Avoir.find(params[:id])\n flash[:notice] = @avoir.destroy ? \"La supression de cette avoir s'est bien déroulé il n'est plus disponible\" : \"La supression de cette avoir n'est pas déroulé correctement il... | [
{
"docid": "4100b1ba27a9a751bb11d54b45e1aeb1",
"score": "0.67357224",
"text": "def delete(path);end",
"title": ""
},
{
"docid": "4100b1ba27a9a751bb11d54b45e1aeb1",
"score": "0.67357224",
"text": "def delete(path);end",
"title": ""
},
{
"docid": "df26116eb86dbadafed7137f9e... |
e45759455861ae57b44420a31d62d4a8 | Org Account or Admin only edit page Org Account is only sent here if they mess up on the popup | [
{
"docid": "9917a73d88fe7fae70cac31671a115af",
"score": "0.0",
"text": "def edit\n @organization_account = OrganizationAccount.find(params[:id])\n respond_with(@organization_account)\n end",
"title": ""
}
] | [
{
"docid": "144a9e9e8c963a8f67627f507a7cac1c",
"score": "0.7343416",
"text": "def restrict_edit_by_account\n redirect_to challenges_path, :alert => 'You do not have access to this page.' unless @challenge.account == current_user.accountid || current_user.sys_admin?\n end",
"title": ""
},
... |
e3b21843cfdb77eda8d7c25dbd702cee | underscore aliases protect core functionality against overrides in extenders | [
{
"docid": "c72a3aa77c68e2e69374adbf316e62e3",
"score": "0.0",
"text": "def classes\r\n @_classes ||= Set.new\r\n end",
"title": ""
}
] | [
{
"docid": "9a3cb344c0099778d69d2973a5883587",
"score": "0.6637799",
"text": "def alias=(_); end",
"title": ""
},
{
"docid": "c815e1780dad303c5bad5f1b41360df8",
"score": "0.661002",
"text": "def underscore!\n replace(underscore)\n end",
"title": ""
},
{
"docid... |
2b8e3e0c10b64d1e84be366d6a448744 | GET /produks/1 GET /produks/1.json | [
{
"docid": "83223d2f6509f148fdee0a0637d0aabc",
"score": "0.0",
"text": "def form\n @tokoid = params[:tokoid]\n @agen = []\n @agen << Toko.find(@tokoid).agen1\n @agen << Toko.find(@tokoid).agen2\n @agen << Toko.find(@tokoid).agen3\n @agen << Toko.find(@tokoid).agen4\n @agen << Toko.f... | [
{
"docid": "a0f4d41a4643e66f4d9d3ab4be2bef76",
"score": "0.6882482",
"text": "def show\n @produkt = Produkt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @produkt }\n end\n end",
"title": ""
},
{
"docid": "7948f3a7... |
a2d70626f7113be370070f7d143bc38f | PATCH/PUT /monster_drop_records/1 PATCH/PUT /monster_drop_records/1.json | [
{
"docid": "6b73050cec4ec86aaef71e31ecd2d66e",
"score": "0.6691182",
"text": "def update\n respond_to do |format|\n if @monster_drop_record.update(monster_drop_record_params)\n format.html { redirect_to @monster_drop_record, notice: 'Monster drop record was successfully updated.' }\n ... | [
{
"docid": "0890776c0cdb9b9fd5b7b7a0fcc1a527",
"score": "0.60316294",
"text": "def update\n @drop = Drop.find(params[:id])\n\n if @drop.update(drop_params)\n head :no_content\n else\n render json: @drop.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
... |
fddc2f3d8ff2eef3088d6604bbb52f26 | GET /ezii_delta_gits/1 GET /ezii_delta_gits/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "b894e250d1877c6e156d505e5996d77a",
"score": "0.66219234",
"text": "def index\n @ezii_delta_gits = EziiDeltaGit.all\n end",
"title": ""
},
{
"docid": "afcf719a1492aedb76725be231a30da8",
"score": "0.5701573",
"text": "def index_by_age\n @age = Age.find(params[:age_id... |
6590ccc3e902ce6907ce43e4aac920bc | Hides methods that, when represented as a call graph, have extremely large in and out degrees and make navigation impossible. | [
{
"docid": "d0d7c3495b2db5ddbd2ea6825b05606c",
"score": "0.5552878",
"text": "def exclude_common_methods!\n ExcludeCommonMethods.apply!(self)\n end",
"title": ""
}
] | [
{
"docid": "e384c7b64c4e84ace46369313a855dce",
"score": "0.66628915",
"text": "def hidden; end",
"title": ""
},
{
"docid": "e384c7b64c4e84ace46369313a855dce",
"score": "0.66628915",
"text": "def hidden; end",
"title": ""
},
{
"docid": "e384c7b64c4e84ace46369313a855dce",
... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "f5f30da5c32604508eab0684d51c434f",
"score": "0.0",
"text": "def set_utility_charge\n @utility_charge = UtilityCharge.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... |
45f36717da67e229a3f31e4280577d86 | Gone. Scheduling has moved under business units | [
{
"docid": "4601e51165c9064c7806f82975c3e9fb",
"score": "0.0",
"text": "def patch_workforcemanagement_managementunit_scheduling_run_with_http_info(management_unit_id, run_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: WorkforceManagementApi.... | [
{
"docid": "8354e3975221d792a8e69a721a71d1d5",
"score": "0.71300995",
"text": "def unscheduled?; end",
"title": ""
},
{
"docid": "8354e3975221d792a8e69a721a71d1d5",
"score": "0.71300995",
"text": "def unscheduled?; end",
"title": ""
},
{
"docid": "3f72e3e047346331ceb2564c... |
1fb31befabf261d304d26a23a4854f46 | Easy method for input | [
{
"docid": "f5bafdbe8a1f2a38498cb1f5ec51e269",
"score": "0.0",
"text": "def input\n STDOUT.flush\n @input = $stdin.gets.chomp\n end",
"title": ""
}
] | [
{
"docid": "a438904453beae0cf151826b1f53d33a",
"score": "0.88100845",
"text": "def input() end",
"title": ""
},
{
"docid": "5d771f0f337eb23e7092aaadb1e37999",
"score": "0.8368643",
"text": "def input; end",
"title": ""
},
{
"docid": "5d771f0f337eb23e7092aaadb1e37999",
... |
69159109c8e1844e00b0616a17d433cf | Request a stack migration. | [
{
"docid": "6ff8eddce162e019cacad1fb5cad611a",
"score": "0.5961789",
"text": "def migrate_to_stack(bot_name, stack)\n deprecate # 07/31/2012\n put(\"/bots/#{bot_name}/stack\", stack, :accept => 'text/plain').to_s\n end",
"title": ""
}
] | [
{
"docid": "ea5cc43624af0a022952ae21613fd558",
"score": "0.6762442",
"text": "def migrate\n unless stack = shift_argument\n error(\"Usage: heroku stack:migrate STACK.\\nMust specify target stack.\")\n end\n\n display(api.put_stack(app, stack).body)\n end",
"title": ""
},
... |
59016cedc094c0a38d24ae29d23bbafb | DELETE /group_requests/1 DELETE /group_requests/1.json | [
{
"docid": "3bc0caea08c19a0b6563cac2f6f5fe51",
"score": "0.79751647",
"text": "def destroy\n @group_request.destroy\n respond_to do |format|\n format.html { redirect_to group_requests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] | [
{
"docid": "13999975208337b247358e50faf8ea7f",
"score": "0.77633405",
"text": "def destroy\n @request_group.destroy\n respond_to do |format|\n format.html { redirect_to request_groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c0244a... |
28dacceb3c6ec4e4dc5f05de7a2e0a09 | Returns the value of attribute block_node. | [
{
"docid": "fc7c69e40a66ec8b135ee5c4f7f1ca7d",
"score": "0.5606756",
"text": "def block_node; end",
"title": ""
}
] | [
{
"docid": "df6a8555f8621c2fe09f8c5b4a95703c",
"score": "0.6887777",
"text": "def get_node_value(node)\n node\n end",
"title": ""
},
{
"docid": "2c2337ecee60ece908a39c5065620552",
"score": "0.67356646",
"text": "def value(block_num = nil)\n \tv, _ = value_with_addr(block... |
148f24a3d9d2115766d5a421577d347b | ================ Element Commands ================ soft failure, will not kill test immediately | [
{
"docid": "57bff0054615d03b84aa505ca867e2ee",
"score": "0.0",
"text": "def verify(timeout=nil)\n Log.debug('Verifying new element...')\n timeout = Gridium.config.element_timeout if timeout.nil?\n ElementVerification.new(self, timeout)\n end",
"title": ""
}
] | [
{
"docid": "6485da33ec0e48fc8e3d5c5f4c535618",
"score": "0.65560216",
"text": "def test_cancel_flank_when_done\n\n pdef = Ruote.process_definition do\n sequence do\n sub0 :flank => true\n echo 'over'\n end\n define 'sub0' do\n stall\n end\n end\n\n #@das... |
5dd76c94044e7278929d04ac04a89401 | Configures a HTTP client. | [
{
"docid": "0d3c4d6b1213ecaa90e9b12b2f4d76a2",
"score": "0.62094337",
"text": "def http_client\n # pass any proxy settings.\n proxy = Net::HTTP::Proxy(self.class.proxy_host, self.class.proxy_port,\n self.class.proxy_user, self.class.proxy_pass)\n http... | [
{
"docid": "91b9db616a4b928ac62450685cbdd87c",
"score": "0.70123136",
"text": "def setup_http_client(logger: nil)\n proxy = Clients::ProxyClient.from_env\n Clients::HttpClient.new(proxy: proxy, logger: logger)\n end",
"title": ""
},
{
"docid": "0a5f32c1c7fdf6fd1617ed739bf57c76",... |
47fe04a7e1908c85e58a97879bfb7d37 | pulse_mode() set pulse status when the host is running | [
{
"docid": "93d775268c5dc2a5304644d525add990",
"score": "0.7003297",
"text": "def pulse_awake=( value )\n @status.pulse_awake = value\n set_status( @status )\n end",
"title": ""
}
] | [
{
"docid": "115afa84787a9a0ad9b7a41120849a85",
"score": "0.7398859",
"text": "def pulse\n @@pulse ||= false\n end",
"title": ""
},
{
"docid": "7157caea0b1b21149d4dcc6138e627fb",
"score": "0.71560764",
"text": "def pulse_asleep=( value )\n @status.pulse_asleep = value\n set_... |
84bd13478da38aed85fb6134d786d16a | reduce 708 omitted source://parser3.1.2.1/lib/parser/ruby31.rb:8225 | [
{
"docid": "9f9ce6e498e3a2f2a6241d421473492e",
"score": "0.0",
"text": "def _reduce_709(val, _values, result); end",
"title": ""
}
] | [
{
"docid": "950f3540561ab576d64bc62717f9f4d6",
"score": "0.7613626",
"text": "def _reduce_273(val, _values, result)\n result = lexer.line\n \n result\nend",
"title": ""
},
{
"docid": "3d6c1b4c3f379e324dc4c13c8cedb53b",
"score": "0.7579137",
... |
f2e4e40a4e8f071ff3e9a3c4f5a18cca | Parses the component tests for includes that start with Mock and determines which component headers need to be mocked Returns a list of the component headers that require mocks | [
{
"docid": "399268385da7421621b83cf9b91e87ce",
"score": "0.7715872",
"text": "def headers_to_mock component,system_config\n headers=FileList.new\n test_list=component.test_files.select{|f| is_source?(f)}\n #remove possible remnants from previous generations\n test_list.select!{|f| /Mock*/!~f... | [
{
"docid": "72dce4cd8e9d5ae87143d23b9c6bcae1",
"score": "0.6308477",
"text": "def cmock_sources component,system_config\n cmock_headers(component,system_config).map{|h| h.pathmap(\"%X.c\")}\n end",
"title": ""
},
{
"docid": "2becaacb00668b6769df48fa9540fa1f",
"score": "0.61263806",
... |
d610c11b0fea4bbd84ee5d6d17707991 | Construct a parser instance for `data`. The parser will be passed to the Mediator's `parse!` method. The default implementation returns a new instance of Mediator::Parser. | [
{
"docid": "97e6aae1ef1d674c02420b8d26627371",
"score": "0.8731068",
"text": "def parser data\n Mediator::Parser.new self, data\n end",
"title": ""
}
] | [
{
"docid": "f5766fe7ad843b7f3f1c99a1fba93371",
"score": "0.7283869",
"text": "def parser data\n Between::Parser.new self, data\n end",
"title": ""
},
{
"docid": "7b3ae544db71e55fb31744dfad208455",
"score": "0.7221909",
"text": "def parse data\n parse! parser data\n en... |
33e9ed9063b88160768acce950edf47a | Creates a buttonlike link of item options (optional): action: whether 'activate' or 'deactivate' link_text: text following the icon use_icon: default true class: CSS class to use more_class: additional CSS class to default ones | [
{
"docid": "79411bd4a14884faa1c0cdd2068bb72f",
"score": "0.7451277",
"text": "def item_activation_link(item, options = {})\n attributes = options.clone\n action = attributes.delete(:action) || (item.ended? || item.pending? ? 'activate' : 'deactivate')\n # raise ArgumentError.new(\"Invalid item ... | [
{
"docid": "c91924c9b118584810d95f2339af7086",
"score": "0.7240309",
"text": "def link_options(item)\n link_html(item)\n end",
"title": ""
},
{
"docid": "5b6ebe11b612eeb8c95d9de3a1dc228b",
"score": "0.6830552",
"text": "def action_link(title, link, options = {})\n klas... |
f1409f59de716c28df472c0103df9990 | json::parsed object returned by the 'json' library representing Alert information. Methods such as getActive and getAlertHistory return information about Alerts. This method creates a new object to hold information on an individual Alert. | [
{
"docid": "f7b96cf05dd2f4823ee8dee572194481",
"score": "0.0",
"text": "def initialize(json)\n @type = json[\"type\"]\n @posted = json[\"posted\"]\n @user = UserInfo.new(case @type\n\t when \"friendship_request\"\n\t json[\"from_user\"]\n\t w... | [
{
"docid": "cc1d95e6e6acb241f2771955bc7c1beb",
"score": "0.6799126",
"text": "def alert\n @alert ||= Clients::Alert.new(api_endpoint: api_endpoint, api_key: api_key, api_version: api_version)\n end",
"title": ""
},
{
"docid": "9acac14aaef4a8781dc7b043dac827ec",
"score": "0.677213... |
5013c773ea075fe063cab1afb7bc61e6 | dynamically hide a flash message (for HTTP requests) | [
{
"docid": "e3d56f91e0cff7a22e34436e349c017c",
"score": "0.75773597",
"text": "def hide_flash(key)\n discard_header = response.headers['X-Message-Discard']\n if discard_header.nil?\n response.headers['X-Message-Discard'] = key.to_s\n else\n response.headers['X-Message-Discard'] = \"#{... | [
{
"docid": "3b74930fee5a5bd372355fdab1e91e40",
"score": "0.76346403",
"text": "def hide_flash\n update_page do |page|\n page[:flash].hide\n end\n end",
"title": ""
},
{
"docid": "72e85f7da933291f284bf9929c5a80bc",
"score": "0.7550711",
"text": "def flash_display\n resp... |
4ab8ecba20c9d1b9f7ed96f3dccc1e1b | load file either in browser or download and check for existence | [
{
"docid": "92bc3dfa1d77636b2be9404f28b3bf89",
"score": "0.0",
"text": "def download_file(link, basename)\n link.click\n sleep(3)\n if @driver.current_url.include?('https://storage.googleapis.com/')\n assert @driver.current_url =~ /#{basename}/, \"Downloaded file url incorrect, did not fin... | [
{
"docid": "613c81c4c1440023c8b97aeb404f464f",
"score": "0.68950593",
"text": "def download?\n File.exist?(path) || data.exists? ? false : true\n end",
"title": ""
},
{
"docid": "ef9cdbc7d632f0455d852947450fb761",
"score": "0.6860689",
"text": "def remote_file_exists?(url)\n ... |
fce95e831f73310700523806c7c6d6f1 | Execute the supplied block without interference from any concurrent loads. source://activesupport//lib/active_support/dependencies.rb17 | [
{
"docid": "d212db660ff182c98112cde6dee35ddf",
"score": "0.0",
"text": "def run_interlock(&block); end",
"title": ""
}
] | [
{
"docid": "95ed336d58d56ada62af140aaf587362",
"score": "0.73311996",
"text": "def with_block(*args)\n ActiveSupport::Dependencies.interlock.permit_concurrent_loads do\n super do |dc|\n ActiveSupport::Dependencies.interlock.running do\n yield dc\n end\n end\n end\n... |
1637cea06d4b452a21df3127e92c86f1 | HTML5 Drag n drop | [
{
"docid": "7c1a42e299294dd7009a90dc1aa9f3f7",
"score": "0.5243836",
"text": "def drag_to(target)\n raise Gridium::InvalidTypeError, \"source element selector must be ':css'\" unless self.by == :css\n raise Gridium::InvalidTypeError, \"target element selector must be ':css'\" unless target.by == :... | [
{
"docid": "c1d237a8f0c7d9ae580e98b0e3be4ef0",
"score": "0.77655464",
"text": "def drag_and_drop(source, target, device: T.unsafe(nil)); end",
"title": ""
},
{
"docid": "81ed2504e8f6e2bc79298ea70215f753",
"score": "0.75285643",
"text": "def drag_and_drop(source, sourceinfo, target, t... |
27cd04083a9d45f30ef0efa558fcf16e | Every Method or function in Ruby is has at least one class it belongs to although you won't always see it written inside a class, | [
{
"docid": "027cf2a15746e4f3c5688d7170ff57f3",
"score": "0.0",
"text": "def simple\n\tputs \"no parents\"\nend",
"title": ""
}
] | [
{
"docid": "f554d366ad5e5a844204527a197e92b5",
"score": "0.70880187",
"text": "def class?; end",
"title": ""
},
{
"docid": "f554d366ad5e5a844204527a197e92b5",
"score": "0.70880187",
"text": "def class?; end",
"title": ""
},
{
"docid": "ae32f4a266db6d6dc2cc1873f83c6407",
... |
02a4e5952a8d87481410c0dc18122f40 | Determine if the command should run by checking the conditional command. | [
{
"docid": "0f17b575e6093f6bfcc43938e40411b4",
"score": "0.7072767",
"text": "def should_run?\n return true if not_if.nil?\n\n shell = not_if_shell_command\n shell.execute\n\n if shell.success?\n log << log.colorize(\"SKIPPED (not_if exited with zero status)\", :cyan... | [
{
"docid": "0b7f159028c769e4e875f6b7f04522e0",
"score": "0.77757466",
"text": "def run_command?\n @run_with == :command\n end",
"title": ""
},
{
"docid": "b74ab7383d897ea3b61291088e3e2ffe",
"score": "0.7385401",
"text": "def command?\n !@command.nil?\n end... |
4c9588caa503aecf804f033148e2d22b | can't use scope because of habtm relationship :( should be entirely unnecessary now ben FIXME: only role of user admin permission can belong to more than one department. should user_admin role and loc_group roles be separated? def must_belong_to_department errors.add("Role must belong to a department.", "") if self.dep... | [
{
"docid": "8ae3622cd04d2f72998538ede3dbd1d9",
"score": "0.724526",
"text": "def must_have_unique_name_in_dept\n #get a list of roles in the same department as this role, excluding this role\n# associated_roles = self.departments.collect{|dept| dept.roles}.flatten - [self]\n associated_roles = ... | [
{
"docid": "1aa8b4251d22d4b91a627f3344ff5962",
"score": "0.87558377",
"text": "def must_belong_to_department\n errors.add(\"Role must belong to at least one department.\", \"\") if self.departments.empty?\n end",
"title": ""
},
{
"docid": "92654f220657ebbbb97df12444515a11",
"score": ... |
c950d04cfd846d90fcd896ee98b2b934 | GET /user_organizations GET /user_organizations.json | [
{
"docid": "2e9a300f805991c44e70d964c2ab9b5a",
"score": "0.7653725",
"text": "def index\n @user_organizations = UserOrganization.all\n\n render json: @user_organizations\n end",
"title": ""
}
] | [
{
"docid": "cd3da91bb5866bed9ad963533be6f184",
"score": "0.8416056",
"text": "def get_orgs_for_user\n user_id = params[:user_id]\n @user_orgs = UserOrg.organizations(user_id)\n render json: @user_orgs\n end",
"title": ""
},
{
"docid": "c698fc9e41eb95e50da8ab6b6d8b1fe8",
"score"... |
898b9d2761f8221f1d53c2a25b6de9e3 | This is where all of the magic happens. This is where we hook in and add all of the OpenID sweetness. I had to take this approach because when authenticating with OpenID nonces and what not are stored in database tables. That being said, the whole save process for ActiveRecord is wrapped in a transaction. Trying to aut... | [
{
"docid": "574c94603d56efedb6df62674ef3bddf",
"score": "0.600753",
"text": "def save(perform_validation = true, &block)\n if !perform_validation || !authenticate_with_openid? || (authenticate_with_openid? && authenticate_with_openid)\n result = super\n yield(result) if block_gi... | [
{
"docid": "ad042fb10b3667f06b56edaa4468d41c",
"score": "0.6676391",
"text": "def save(&block)\n block = nil if !openid_identifier.blank?\n super(&block)\n end",
"title": ""
},
{
"docid": "5400133b087157f1c948ab57367e1aa2",
"score": "0.6590089",
"text": "def create... |
c7d5f62e68cd6e89c2e4ad79821969f3 | returns the rating that user u gave movie m in the training set, and 0 if user u did not rate movie m | [
{
"docid": "f7be8713fcc8b0d32cfd03e259a245f6",
"score": "0.8054107",
"text": "def rating(user, movie)\n user_table = @user_movie_rate[user]\n if user_table.has_key?(movie)\n return user_table[movie]\n else\n return 0\n end\n end",
"title": ""
}
... | [
{
"docid": "4946e90e694e338620cb078f8ca148b5",
"score": "0.8707249",
"text": "def rating(u,m)\n ratings = @training_hash[:users_ratings]\n movie_idx = movies(u).index(m)\n m_rating = ratings[u-1][movie_idx] unless movie_idx.nil? {\n m_rating = 0\n }\n return... |
5561283eccf59ae1bafa8a23c109e1c1 | PATCH/PUT /endroits/1 PATCH/PUT /endroits/1.json | [
{
"docid": "132b28de6ab9117c59ee7b99c34c2274",
"score": "0.6533783",
"text": "def update\n respond_to do |format|\n if @endroit.update(endroit_params)\n format.html { redirect_to @endroit, notice: 'Endroit was successfully updated.' }\n format.json { head :no_content }\n else\... | [
{
"docid": "6ecb27bb9553f03b496fc88ef1d5f7bc",
"score": "0.6458432",
"text": "def update\n @endroit = Endroit.find(params[:id])\n\n respond_to do |format|\n if @endroit.update_attributes(params[:endroit])\n format.html { redirect_to @endroit, notice: 'Endroit was successfully updated.'... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "b05ff690917a5e76af015c9a2f831dbf",
"score": "0.0",
"text": "def program_params\n _params = params.require(:program).permit(:notify_error, :notify_success, events_attributes: [:id, :name, :start_at, :end_at])\n end_at = set_program.start_at\n before_event = nil \n\n _... | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7495027",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.69566035",
"text": "def strong_params\n params.require(:request).permit(param_whit... |