query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
c69e54d52ceb0215591f5ae2115d25bb | get or construct the daily summary view of a stat | [
{
"docid": "3c68d5a27a78e08fb89cc8ac43fb57de",
"score": "0.6944841",
"text": "def daily(stat_or_name)\n\t\tstat, measurements = get_stat_data(stat_or_name)\n\t\t@daily[stat.id] ||= dayify(stat, measurements)\n\tend",
"title": ""
}
] | [
{
"docid": "850a74b067aad5afdb93237b73328a67",
"score": "0.7283866",
"text": "def daily_values(stat_or_name)\n\t\tstat, measurements = get_stat_data(stat_or_name)\n\t\tdaily_summaries(stat, measurements, range).map {|entry| entry[1][0]}\n\tend",
"title": ""
},
{
"docid": "9426131e6d6750288c6... |
9fae476386bc0d13d6208c3b109f21eb | Purge projection related data | [
{
"docid": "9117d4744858c14c5ed620107ff0c5dc",
"score": "0.0",
"text": "def purge!\n raise \"Not implemented\"\n end",
"title": ""
}
] | [
{
"docid": "6b81548f52dfa10b78aa647d82d0daa2",
"score": "0.7003436",
"text": "def purge\n unless metadata.destructive?\n nullify\n else\n criteria.delete_all\n target.clear do |doc|\n unbind_one(doc)\n doc.destroyed = true\n ... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "4d77df5d297b8c076bcd80e17ec1c169",
"score": "0.0",
"text": "def set_quarterback\n @quarterback = Quarterback.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... |
ad1de860e11eba770f71950784fed410 | Any extra parameters this particular column uses. This is for create/update purposes. | [
{
"docid": "6663cfe54b595ca42f47577f0996760b",
"score": "0.0",
"text": "def params\n return @params || NO_PARAMS if frozen?\n @params ||= NO_PARAMS.dup\n end",
"title": ""
}
] | [
{
"docid": "27bf8eefdd6a857c88d77fc64bd5ced2",
"score": "0.678584",
"text": "def columns\n super + [:extra_column]\n end",
"title": ""
},
{
"docid": "aa5c732286dab8bcd98edbc3e86775c8",
"score": "0.6371625",
"text": "def update!(**args)\n @custom_columns = args[:custom_co... |
a29655c268c43800f69698b2512ee6aa | PATCH/PUT /linkmen/1 PATCH/PUT /linkmen/1.json | [
{
"docid": "83bb9519653b12670dc95c0a526e7a7d",
"score": "0.6795109",
"text": "def update\n respond_to do |format|\n if @linkman.update(linkman_params)\n puts @linkman.comment\n format.html { redirect_to '/linkmen#index', notice: 'Linkman was successfully updated.' }\n format... | [
{
"docid": "36df41f926dc16ea7f67c34031bc37b3",
"score": "0.6947778",
"text": "def update\n @link1 = Link1.find(params[:id])\n\n respond_to do |format|\n if @link1.update_attributes(params[:link1])\n format.html { redirect_to @link1, notice: 'Link1 was successfully updated.' }\n ... |
7f67cdabafc6d3099fcd96d66c65589a | POST /assignment_round POST /assignment_round.json | [
{
"docid": "9d9895fba11d5d7ee126caa1f7556e35",
"score": "0.6982928",
"text": "def assignment_round\n AssignmentQueue.assignment_round\n\n respond_to do |format|\n format.html do\n flash[:notice] = 'New assignment round generated'\n redirect_to action: :index\n end\n fo... | [
{
"docid": "ceb29f81c3fda4d68feb8fa0eebbbb00",
"score": "0.6570125",
"text": "def create\n @grant_round = GrantRound.new(grant_round_params(params[:grant_round]))\n\n if @grant_round.save\n render json: @grant_round, status: :created, location: @grant_round\n else\n render json: @gran... |
d745efba3135f23a854765332718026a | GET /meal_plans/1 GET /meal_plans/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "b8e2e6adc7d2c2bddb97129a33d75c79",
"score": "0.7570632",
"text": "def index\n @meal_plans = MealPlan.all\n end",
"title": ""
},
{
"docid": "4767fd3349996c5cb5028a508fc9477e",
"score": "0.7491697",
"text": "def index\n @mealplans = Mealplan.all\n end",
"title":... |
1b048276ff92d044429f9d15008478b3 | Tries to load the Guard plugin main class. This transforms the supplied Guard plugin name into a class name: `guardname` will become `Guard::Guardname` `dashedguardname` will become `Guard::DashedGuardName` `underscore_guard_name` will become `Guard::UnderscoreGuardName` When no class is found with the strict case sens... | [
{
"docid": "67b8f54a25fdd8c7ec444f040f25fb68",
"score": "0.7071532",
"text": "def get_guard_class(name, fail_gracefully=false)\n name = name.to_s\n try_require = false\n const_name = name.gsub(/\\/(.?)/) { \"::#{ $1.upcase }\" }.gsub(/(?:^|[_-])(.)/) { $1.upcase }\n begin\n ... | [
{
"docid": "04fe7c6f324c2073664e7b396affe503",
"score": "0.72746646",
"text": "def get_guard_class(name)\n name = name.to_s\n try_require = false\n const_name = name.downcase.gsub('-', '')\n begin\n require \"guard/#{ name.downcase }\" if try_require\n self.cons... |
b3654f5a91096d0bfa4b5e4d3ca28e4b | This method is used to create a new user, create a Account for the user using /account call. Upon creating a new account, a session is created for the user and redirect to dash. | [
{
"docid": "a85e0e81ff450d579f8f077440883925",
"score": "0.0",
"text": "def create\n logger.debug '> Users: create.'\n Api::Accounts.new.create(params) do |acct|\n store_credentials acct\n mail_status = UserMailer.welcome(acct).deliver_now\n Nilavu::OTP::Infobip.new.send_confirm(\"#... | [
{
"docid": "1469686440a2e1b1ab056acd2caa19b1",
"score": "0.7749535",
"text": "def create\n @account = Account.new(account_params)\n if @account.valid?\n ActiveRecord::Base.transaction do\n @account = Account.create! account_params\n @user = @account.users.create! email: accou... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "106769dfa0c5e6b998f50cca19ea0d23",
"score": "0.0",
"text": "def update!(**args)\n @generic_metadata = args[:generic_metadata] if args.key?(:generic_metadata)\n end",
"title": ""
}
] | [
{
"docid": "150fa2bdc1fc43d28ac45e2278a1f797",
"score": "0.7012263",
"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... |
4f117d104f752671a56cc518df68f38c | setter method for tag_list | [
{
"docid": "b5cc43a886c8b36d578f200096dc7c3f",
"score": "0.66822606",
"text": "def tag_list=(names)\n\t\tself.tags = names.split(\",\").map do |name|\n\t\t\tTag.where(name: name.strip).first_or_create!\n\t\tend\n\tend",
"title": ""
}
] | [
{
"docid": "13d398df1211d57b9444358cdcd850d1",
"score": "0.812026",
"text": "def tags=(list)\n tag(self.class.name)\n tag(*list)\n end",
"title": ""
},
{
"docid": "35d01a3311394d30231c19a510913f4a",
"score": "0.7999539",
"text": "def tags=(list)\n @tags = makelist(list)\n... |
9ecd12807c7c8a12aa440f377d84f71a | Returns the sharings that +user+ can set the version to | [
{
"docid": "5ccb4cd04d52dfa73c3f1d5c50ebc8ed",
"score": "0.6238792",
"text": "def allowed_sharings(user = User.current)\n CATEGORY_SHARINGS.select do |s|\n if sharing == s\n true\n else\n case s\n when 'system'\n # Only admin users can set a systemwide sharing\... | [
{
"docid": "bc7ead57622c13dd159a94c6c12c6283",
"score": "0.7255493",
"text": "def allowed_sharings(user = User.current)\n VERSION_SHARINGS.select do |s|\n if sharing == s\n true\n else\n case s\n when 'system'\n # Only admin users can set a systemwide sharing\n... |
0278b40ac6e4801f7d3b2b4ccdff3ea3 | GET /permition_roles/1 GET /permition_roles/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "086b3e9e5f76b74bba5021c2f7733e2d",
"score": "0.7522962",
"text": "def index\n @permition_roles = PermitionRole.all\n end",
"title": ""
},
{
"docid": "fd6d98644a771196d9eeee6e36f133d8",
"score": "0.73295355",
"text": "def roles\n render :json => {:roles => User.role... |
941ed955e80dc2d0b007df87aa5bbc1f | GET /review_results/1 GET /review_results/1.json | [
{
"docid": "c51e0d15e1e87e08b514d4790b6ac890",
"score": "0.7621786",
"text": "def show\n @review_result = ReviewResult.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @review_result }\n end\n end",
"title": ""
}
] | [
{
"docid": "70215436e900864f111e8596816582ee",
"score": "0.75765616",
"text": "def show\n @review_result = ReviewResult.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @review_result }\n end\n end",
"title": ""
},
{
... |
dff04d79c14fd46e44c0af9fd5f73752 | DELETE /landio_items/1 DELETE /landio_items/1.json | [
{
"docid": "a965df74aa392e676b270d2cf099ad5c",
"score": "0.74727434",
"text": "def destroy\n @landio_item.destroy\n respond_to do |format|\n format.html { redirect_to landio_items_url, notice: 'Landio item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"... | [
{
"docid": "0b24cbc6495df3923ea7679acbcd8deb",
"score": "0.71077937",
"text": "def delete_floor_plan(args = {}) \n delete(\"/files.json/floorplan/images\", args)\nend",
"title": ""
},
{
"docid": "d496e8714709f1e014ad13f7504c98c9",
"score": "0.7040716",
"text": "def delete(item); end"... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "c741db4e8c342f2a3f2edc67cf020922",
"score": "0.0",
"text": "def set_upload\n @upload = current_user.uploads.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... |
80a3999fe758d9f6ebce30494475cdfd | Return text(s) defined in config and perform substitution if instances given | [
{
"docid": "25fced72e4a3bbeda74b9523b71e87da",
"score": "0.48807034",
"text": "def text target, *words\n\t\t\twords = [words].flatten\n\t\t\ttxt = [@data['text'][target]].flatten.sample\n\t\t\treturn nil if (txt.nil?)\n\t\t\treturn Input.substitute txt, words unless (words.... | [
{
"docid": "74a6dcd574d45741d51faaa796db2185",
"score": "0.60612905",
"text": "def sub_replacements text\n if REPLACEABLE_TEXT_RX.match? text\n # NOTE interpolation is faster than String#dup\n text = text.to_s\n REPLACEMENTS.each do |pattern, replacement, restor... |
066b10a711383c8d31cf81669b6974f9 | Returns an array of ranges that should not be reported. It's the extra spaces between the keys and values in a multiline hash, since those are handled by the Layout/HashAlignment cop. | [
{
"docid": "c5048ceadf131e94b21b876b9d05aed7",
"score": "0.6766366",
"text": "def ignored_ranges(ast)\n return [] unless ast\n\n @ignored_ranges ||= on_node(:pair, ast).map do |pair|\n next if pair.parent.single_line?\n\n key, value = *pair\n key.source... | [
{
"docid": "1ff69b76252d3a050cb96064f71f99be",
"score": "0.6441472",
"text": "def invalid_ranges\n @ranges.reject(&:accepted).map { |range| [@tiers, range.string].flatten.join(TAB) }\n end",
"title": ""
},
{
"docid": "e5c136ee6ec3199db656fd7e3f78938a",
"score": "0.5799957... |
25c6f54e69c45c0ae02b0c920796d627 | GET /item_types/1 GET /item_types/1.json | [
{
"docid": "d5d464b8c726b43d3d1aa0b3c3241af3",
"score": "0.0",
"text": "def show\n \n\n \n # Get items filtered by type (shoes, jeans...)\n @item_type = ItemType.find(params[:id])\n allitems = @item_type.item\n \n # Check what are the items the current_user is following\n @itemsFol... | [
{
"docid": "e4b08ef5f6a2c5b4f67fe6166931e2d1",
"score": "0.7660632",
"text": "def show\n respond_to do |format|\n format.json {render :json => @item_type.to_json }\n end\n end",
"title": ""
},
{
"docid": "5ed5a097e04893ed95eab9c47c8e4683",
"score": "0.7593282"... |
7056d1eb12089a16d7d474146596a68d | need to ahve original request to process the response when it redirects | [
{
"docid": "92f847f0132f63f93d1fde4fe4a89c88",
"score": "0.66285795",
"text": "def process_http_request(res, req = nil, params = nil)\n case res\n when HTTP_SUCCESS\n Log.debug('Http success')\n res\n when HTTP_REDIRECT\n if allow_redirect\n uri = URI(res['lo... | [
{
"docid": "d4232e5f69d746656c5ebd177d887f38",
"score": "0.74089473",
"text": "def on_request( request, response )\n \n \n BetterCap::Logger.info \"Hacking http://#{request.host}\"\n # is it a html page?\n if response.content_type =~ /^text\\/html.*/\n \n if request.host =~ /example... |
d8ead52f26c1a1a7d218e338ba81ba85 | End question 1 Question 2: Merge the odds and evens hashes into a new hash called merged_hash but remove any entries where the values are strings | [
{
"docid": "f329070172de02eabc91928402f6f213",
"score": "0.7590044",
"text": "def question2\n odds = {one: \"1\", three: \"three\", five: 5}\n evens = {two: 2, four: 4}\n ## Write your code below, 3 lines\n odds = odds.delete_if { |key, value| value.class == String }\n merged_hash = odds.merge(even... | [
{
"docid": "8c4c4840f2ad18e9756f41954b10344d",
"score": "0.63397187",
"text": "def merge!(other_hash); end",
"title": ""
},
{
"docid": "f53a45e710e288f0a04fec2b449a900e",
"score": "0.63342756",
"text": "def sanitize_hash\n @hash_of_merged_data.map { |key,values|\n values.... |
db816c81113865f0c50c10d147e4ba9d | When passed a block, yields PublishedTrackInstance records from the API. This operation lazily loads records as efficiently as possible until the limit is reached. source://twilioruby//lib/twilioruby/rest/video/v1/room/room_participant/room_participant_published_track.rb70 | [
{
"docid": "abc7181aaa3fa40e9807e1a6e9021314",
"score": "0.0",
"text": "def each; end",
"title": ""
}
] | [
{
"docid": "306acd92c5de747dee2749a7de4ea789",
"score": "0.5126784",
"text": "def each\t\t\t# :yields: track\n @tracks.each { |track| yield track }\n end",
"title": ""
},
{
"docid": "8f1b53ebb864492fd012ffe2a7c82691",
"score": "0.5072215",
"text": "def stream(date_created_aft... |
c5cffa69c1c194c0adac69073da3727f | Extract file path from location | [
{
"docid": "7d874a714870c2aae4742e094dff9bdb",
"score": "0.7155838",
"text": "def _location_path(location)\n location.match(/^(\\.\\/)?(.*?)(:\\d+)?$/)[2]\n end",
"title": ""
}
] | [
{
"docid": "d5b6bfa2c11bcd167fcccd5270738bc8",
"score": "0.75911415",
"text": "def extract_path(file_path)\n return nil if file_path.nil?\n last_slash = file_path.rindex(\"/\")\n if last_slash\n file_path[0, last_slash]\n end\n end",
"title": ""
},
{
"docid": "7... |
5e2b9d9d2e56733eebd8191ad1d56f14 | display information counter by ID | [
{
"docid": "f727a51534baed914b1b52f23edfa872",
"score": "0.6682389",
"text": "def show\n info=Infocounter.find(params[:id])\n render json:{status: 'SUCCESS', message: 'Details By Info Counter', data:info},status: :ok\n end",
"title": ""
}
] | [
{
"docid": "c9c22e877e86b2f7769a757f449bf563",
"score": "0.6682335",
"text": "def show \n counter=Counter.find(params[:id])\n render json:{status: 'SUCCESS', message: 'Loaded Counter by ID', data:counter},status: :ok\n end",
"title": ""
},
{
"docid": ... |
8353b60fa62aa47359dd1cf7faf1e02b | Public: Is it close enough to the event for registration to be open? Returns a TrueClass or FalseClass. | [
{
"docid": "95a0daca315c4ffa4954b32049979b35",
"score": "0.64405465",
"text": "def registration_date_passed?\n start_time - DaysToOpenRegistrationBeforeEvent.days < Time.now\n end",
"title": ""
}
] | [
{
"docid": "154290b8621ac89743be899f4ae5edf4",
"score": "0.72249764",
"text": "def closed?\n closed_on.present?\n end",
"title": ""
},
{
"docid": "27d7f617f84fc3c1694cf9df9dca943b",
"score": "0.72036266",
"text": "def new_registration_closed?\n new_reg_closed && !authorized_la... |
a8389a751f8ddd2336ffc26c29fcffc9 | Returns a single production company (legacy) | [
{
"docid": "396a563fd8eaff2b5597f2f9997ef755",
"score": "0.863484",
"text": "def company\n production_companies.first\n end",
"title": ""
}
] | [
{
"docid": "2455112d2f74cfcdcde58e98f134d852",
"score": "0.7651287",
"text": "def company\n fetch('silicon_valley.companies')\n end",
"title": ""
},
{
"docid": "4f6c551b8ee67109a9ffa538bbb23071",
"score": "0.7417223",
"text": "def company\n fetch('space.company... |
9f90ff38f8ea92639e40dba937a0eb2f | We save the record after updating, raising any validation errors. | [
{
"docid": "186787b1dfa389716336ff9a19173e85",
"score": "0.0",
"text": "def update(uploaded_file)\n super\n record.save!\n end",
"title": ""
}
] | [
{
"docid": "cde945b852837418a121671c45211364",
"score": "0.82312644",
"text": "def save!\n save or raise InvalidRecord.new(self, errors)\n end",
"title": ""
},
{
"docid": "ee70ae6ee7fa07c486309f30da6c1cdb",
"score": "0.7884125",
"text": "def save!\n returning(save) do\... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "c9dd8b3b64df7a7e3bb6f9a79d472472",
"score": "0.0",
"text": "def update!(**args)\n @audio_source = args[:audio_source] if args.key?(:audio_source)\n @audio_state = args[:audio_state] if args.key?(:audio_state)\n end",
"title": ""
}
] | [
{
"docid": "150fa2bdc1fc43d28ac45e2278a1f797",
"score": "0.7012263",
"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... |
ef0c11553c30f082385fbdfcb21f0875 | CONDITION_WHERE [RULESET_CONDITION_WHERE] c_type, enum c_country, string(20), rule : value in ruleset condition_where_country c_zone, string(20), rule : value in ruleset condition_where_zone c_network, string(20), rule : value in ruleset condition_where_network c_custom, string(20), rule : value in ruleset condition_wh... | [
{
"docid": "e4220f04c5728475baf92fb998281db3",
"score": "0.5619991",
"text": "def data_to_ruleset \n\n\t\ttemp_array = []\n\t\trule_name = self.fctr_code.blank? ? (\"rule_\" + self.id.to_s) : self.fctr_code + \": \"\n\n\t\tif not self.where_country.blank?\n\t\t\ttemp_array << (\"c_where_country = \" + ... | [
{
"docid": "a2cc233d47e641314aba984acecc3acc",
"score": "0.6235719",
"text": "def condition\n condition = item_attribute('yweather:condition')\n translate! do_convertions(condition, [:code, :to_i], [:temp, :to_i], [:date, :to_date], :text)\n end",
"title": ""
},
{
"docid": "cdae... |
9ae88a128eda0dc087f7db1e72986b20 | adds keyword to hash that includes groupname | [
{
"docid": "24aea59282974cbc46802bbcf70336ee",
"score": "0.7446959",
"text": "def add_pheno_keyword(group, keyword)\n if !@pheno_group.has_key?(group)\n @pheno_group[group] = Hash.new\n end\n @pheno_group[group][keyword]=1\n end",
"title": ""
}
] | [
{
"docid": "2a61de9813efdf99a7dfa0499815ce15",
"score": "0.8015612",
"text": "def add_keyword(group, key)\n @names[key] = @eths[group]\n end",
"title": ""
},
{
"docid": "24b7c6cbea56d53bc2148df9bf26477f",
"score": "0.69247603",
"text": "def onKeywordFound(group, keyword, result)\... |
d2235774fe478c95bcf7889084e7ee29 | Returns true if a test agent is logged in. | [
{
"docid": "ebc82d4ff3c541e590a9337a1c0befaf",
"score": "0.80513424",
"text": "def is_logged_in?\n !session[:agent_id].nil?\n end",
"title": ""
}
] | [
{
"docid": "1642f057308e0ed6cf4eeb4cc92ab744",
"score": "0.8271278",
"text": "def logged_in?\n !current_agent.nil?\n end",
"title": ""
},
{
"docid": "1642f057308e0ed6cf4eeb4cc92ab744",
"score": "0.8271278",
"text": "def logged_in?\n !current_agent.nil?\n end",
"title": ""... |
c2c9bc340f20fda07536730bfa8265fe | Returns a new instance of Vedeu::Borders::Refresh. | [
{
"docid": "e6952e8bfefb96d16f7fc581972e08d2",
"score": "0.0",
"text": "def initialize(name = Vedeu.focus)\n @name = present?(name) ? name : Vedeu.focus\n end",
"title": ""
}
] | [
{
"docid": "3ac0bb48f794905b13950ce852f56259",
"score": "0.6287716",
"text": "def border=(border)\r\n @border = border\r\n refresh\r\n end",
"title": ""
},
{
"docid": "2b8910ae749b06c0eb95f12ed449e279",
"score": "0.6041182",
"text": "def border(horizontal=0, vertical=0)\n b... |
75ecfd05fb7eeee8f8d8cd1adc816073 | create_option_types examines the option_types key in application.yml and creates any keys found that are not already in the DB | [
{
"docid": "cf6751c4b2aa2782f211080374c4a1fe",
"score": "0.81312484",
"text": "def create_option_types\n option_types = @@config[:option_types]\n puts \"Creating Option Types for UrbanAuto site, #{option_types.length} options found to check.\\n\"\n created = 0\n option_types.each_key do |ot|... | [
{
"docid": "09e2a4baab884c96369152683ed347fa",
"score": "0.7210549",
"text": "def ensure_option_types_exist_for_values_hash\n return if option_values_hash.nil?\n option_values_hash.keys.map(&:to_i).each do |id|\n self.option_type_ids << id unless option_type_ids.include?(id)\n un... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "454e0087eb061f31e177c416976ce1ec",
"score": "0.0",
"text": "def aneart_params\n params.require(:aneart).permit(:district_number, :analogs_address, :area, :purpose, :value_proposition_usd, :information_source, :value_proposition_usdone)\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.6978086",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6780264",
"text": "def strong_params\n params.requi... |
a2099a77c85e91272ae2f9e35b937953 | Only allow a trusted parameter "white list" through. | [
{
"docid": "423e5acdfd3e05ffb2a2ab3da7615d66",
"score": "0.0",
"text": "def crate_params\n params.require(:crate).permit(:user_id, :crate_name, :song)\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": "... |
36f88ee89cffc7fd05bd267c9064af73 | Maps a path with request methods `DELETE` to a block. | [
{
"docid": "aa2e8b1a123c3f0bccc13aa206f069f6",
"score": "0.72897077",
"text": "def delete(path, options = nil, &block)\n router.delete(path).with_options(options).to(&block)\n end",
"title": ""
}
] | [
{
"docid": "390e8e2ce3ebccf61cd00f177342fb05",
"score": "0.8102569",
"text": "def delete(path, &block) end",
"title": ""
},
{
"docid": "390e8e2ce3ebccf61cd00f177342fb05",
"score": "0.8102569",
"text": "def delete(path, &block) end",
"title": ""
},
{
"docid": "3902e80d4790... |
b427ce3f199e5848a278986e5e1d1d25 | Rules compare using their ids | [
{
"docid": "c2fd9eacbeb1e3fd51e79db933a0d411",
"score": "0.0",
"text": "def <=>(other)\n if id && other.id\n if id == other.id\n id.to_s <=> other.id.to_s\n else\n id.to_f <=> other.id.to_f\n end\n else\n sym.to_s <=> other.sym.to_s\n end\n ... | [
{
"docid": "f9cbae66b481094ca7f8fb4c328ad007",
"score": "0.6767228",
"text": "def rule_by_id; end",
"title": ""
},
{
"docid": "edc19bff4338a2fa7883c32a513b9875",
"score": "0.6586785",
"text": "def by_id(id)\n @rules.select { |rule| rule.id == id }\n end",
"title": ""
},
{... |
6745290884d624627f5e72fee3b2a3e6 | Sets the officeLocation property value. Office location such as building and office number for an organizational contact. | [
{
"docid": "d5d5f7c0eb9193391b57a22d7527e80e",
"score": "0.81939405",
"text": "def office_location=(value)\n @office_location = value\n end",
"title": ""
}
] | [
{
"docid": "9661d2f0dc6b4ed09780193dbfb81761",
"score": "0.6587679",
"text": "def set_office_location\n @office_location = @company.office_locations.find(params[:id])\n end",
"title": ""
},
{
"docid": "76ebf5a132e968195457893b24932cd5",
"score": "0.6067267",
"text": "def offi... |
61fd87cfc39e80a463391014a6caa04c | recursive method to write all resulted files on disk | [
{
"docid": "f4a3f7fcd9acda910df15bd4bae29161",
"score": "0.6262604",
"text": "def write_files_on_disk(block_data)\n @file_manager.create_cache_dir\n block_data.files.each { |file| @file_manager.write_file(file.path, file.content) } \n block_data.child_blocks.each { |block| wr... | [
{
"docid": "bc1ea5939931ee3f88fbd3d438038735",
"score": "0.69058555",
"text": "def finish\n FileUtils.mkdir_p @opts[:dir]\n result.write\n write_resources\n end",
"title": ""
},
{
"docid": "48549c6176e8ab5897080f40b524491f",
"score": "0.65837514",
"text": "def write_files\n... |
7b398a1ed02d5dec2b17636b08855734 | DELETE /anonymous_denounciations/1 DELETE /anonymous_denounciations/1.json | [
{
"docid": "fda794b3fd0067fe3e31f74cf77a4214",
"score": "0.7915874",
"text": "def destroy\n @anonymous_denounciation.destroy\n respond_to do |format|\n format.html { redirect_to anonymous_denounciations_url, notice: 'Anonymous denounciation was successfully destroyed.' }\n format.json { ... | [
{
"docid": "ab2934681e5a4fd41e93b24f41ca182b",
"score": "0.6651388",
"text": "def destroy\n @referral.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "55bd9d2de9d8edc407e87f37f1932f13",
"score": "0.66222644",
... |
928fab8778ebc49eebf818870dc40f74 | Validates that the current user is authorized for the current request. This method is called for every action except the :api action. For the :api action, this method will not be called until the actual requested action is performed. One of four scenarios are possible: 1. If the +require_admin+ method applies to the cu... | [
{
"docid": "4d78b075869223332c2a72c8790b0f24",
"score": "0.7560477",
"text": "def valid_user? #:doc:\n if require_admin_for_request?\n authorize! true\n elsif require_anon_for_request?\n if logged_in?\n flash[:warning] = 'The specified action cannot be performed while lo... | [
{
"docid": "b58c2c6bfd1db889b29729b0e509d2bc",
"score": "0.72031176",
"text": "def authorize_action\n required_permission = \"%s/%s\" % [ params[\"controller\"], params[\"action\"] ]\n logger.debug \"required_perm is #{required_permission}\"\n\n controller = params[\"controller\"]\n... |
4cc402ac53e7150c57aed219016fafd1 | PUT /ccls/1 PUT /ccls/1.xml | [
{
"docid": "d27ac3ccb3ba4fcb2edc098729cdfdad",
"score": "0.62881684",
"text": "def update\n @ccl = Ccl.find(params[:id])\n\n respond_to do |format|\n if @ccl.update_attributes(params[:ccl])\n format.html { redirect_to(@ccl, :notice => 'Ccl was successfully updated.') }\n format.... | [
{
"docid": "ae5fb82effc733bee8eb354853d40308",
"score": "0.59757984",
"text": "def rest_update(uri, method: Net::HTTP::Put)\n request = Net::HTTP::Get.new uri\n request.add_field(\"Accept\",\"application/xml\")\n auth_admin(request)\n \n Net::HTTP.start(uri.host, uri.port) do |http|\n response =... |
716063a72b926034e9e5c496ea1ea8ce | determines the longest of the two strings, and then returns the result of concatenating the shorter string, the longer string, and the shorter string once again | [
{
"docid": "858e60fdeff8145560db461611e96e06",
"score": "0.0",
"text": "def short_long_short( str1, str2 )\n str1.length < str2.length ? (short, long = str1, str2) : (short, long = str2, str1)\n puts (short + long + short)\nend",
"title": ""
}
] | [
{
"docid": "692df0e08f89c5c764d71ec2d9ac1448",
"score": "0.8505486",
"text": "def longest string1, string2\n new_str = string1 << string2\n new_str.split(\"\").uniq.sort.join(\"\")\nend",
"title": ""
},
{
"docid": "5f9f898ab739c70da9a0004ac78f4b7d",
"score": "0.843161",
"text":... |
a7e396ef07530d732a8f57e582bcdd7f | Marks the disk space against the cached utilization data. | [
{
"docid": "ab695c55efb3524e1d5b9a8885fce4b6",
"score": "0.50130314",
"text": "def allocate(space)\n @allocated_after_sync += space\n end",
"title": ""
}
] | [
{
"docid": "6117778d40924fcd5ea2f91bc01a87e1",
"score": "0.6036503",
"text": "def adjust_cache(reserve)\n return if free >= reserve\n\n @data_space.sort_by!(&:count)\n\n while free != reserve\n @data_space.shift.purge(@save_block)\n end\n end",
"title": ""
},
{
"docid": "6c... |
d1561d0d0f4de56f0bd89d5458a7d979 | When a block is given, the command runs before yielding | [
{
"docid": "7b35ae5e368c0bfb469aae4fde0bc274",
"score": "0.0",
"text": "def initialize cmd\n @cmd=cmd\n @cmd_run=cmd+\" 2>&1\" unless cmd=~/2>&1/\n if block_given?\n run\n yield self\n end\n end",
"title": ""
}
] | [
{
"docid": "95886832b7bbdfd7910132f7af22ad50",
"score": "0.72020847",
"text": "def call_block\n puts \"start\"\n yield \"foobar\" if block_given?\n puts \"end\"\nend",
"title": ""
},
{
"docid": "3abcf397d44d426cd1a1c04f580f817c",
"score": "0.70698506",
"text": "def block; end",
... |
9cbcc1c4544eaa872f20ba479f576530 | If the thread is still alive, force an exception in the thread and continue to do the things stop does. | [
{
"docid": "64e6df65ded5ec32005b96e40c287356",
"score": "0.6380631",
"text": "def stop!\n if @zmq_thread.alive?\n STDERR.puts \"force stop! called, issuing Thread.raise\"\n @zmq_thread.raise \"force stop! called\"\n end\n\n stop\n wait 1\n\n @zmq_thread.join if @zm... | [
{
"docid": "df5033d52b166636443fde09b9018a67",
"score": "0.7481486",
"text": "def thread\n Thread.abort_on_exception = true\n end",
"title": ""
},
{
"docid": "27f6d683963f0b6d3b8439afa28d377f",
"score": "0.714372",
"text": "def stop_thread; end",
"title": ""
},
{
... |
41c0b010fb84181d55d1063e931769e6 | Define a method to control game play | [
{
"docid": "f9b6a650844ed61ea4242823723d339b",
"score": "0.67227167",
"text": "def play_game\r\n\r\n Console_Screen.cls #Clear the display area\r\n\r\n #Assign the player and dealer an initial starting card\r\n playerHand = get_new_card\r\n dealerHand = get_new_card\r\n\r\n #Call th... | [
{
"docid": "b9b2d0317c7ce9f1c262dbd37d26609c",
"score": "0.82102346",
"text": "def play\n #calls to all the methods that produce game!\n end",
"title": ""
},
{
"docid": "787a6441fdaa39dd87615f45b3e354eb",
"score": "0.79616076",
"text": "def perform\n\tgame_menu\n\tgameplay\nend",... |
024092dd32ab153a358a96255d673cf1 | Added to actually leave battle. | [
{
"docid": "c0f9655343fa7177e15da7d53c4eb6dc",
"score": "0.5945464",
"text": "def victory_end\n RPG::BGM.fade(500) unless skip?\n 20.times do; Graphics.update; end\n SceneManager.return\n battle_end(0)\n replay_bgm_and_bgs unless skip? || $BTEST\n end",
"title": ""
}
] | [
{
"docid": "f7aac9a60c4bf24539fe665b48b4f3d2",
"score": "0.7359813",
"text": "def leave; end",
"title": ""
},
{
"docid": "5c1046353dc0b31f54d47d3b133d01f8",
"score": "0.7083158",
"text": "def battle_end\n log_info('Exiting battle')\n # TODO : battle_end procedure\n $ga... |
0320c8995d95df1987161c4e99c6214f | Executes SQL and returns result as an array of arrays | [
{
"docid": "867f7c8ea6a66df9b0575009d97dcfe4",
"score": "0.657282",
"text": "def execute(sql)\n pg_result = @pg.exec(sql)\n pg_result.values\n end",
"title": ""
}
] | [
{
"docid": "d17ca9e04f56d81b6a83e1c738c6f6cc",
"score": "0.87343127",
"text": "def execute_as_array(sql)\n return_array = Array.new\n @db.results_as_hash = false\n self.execute(sql).each do |rec|\n return_array << rec[0]\n end\n @db.results_as_hash = true\n ret... |
b1c3d698b2483c4bb3ab91f5caf4cc82 | If this is present in the params, then the client is saying the form is not encrypted | [
{
"docid": "11a2ec8530eb6e7037737838a88f8770",
"score": "0.5751016",
"text": "def enc_active?\n if params.key? ENC_PARAM\n !enc_params().key?(ACTIVE_PARAM)\n else\n true\n end\n end",
"title": ""
}
] | [
{
"docid": "ff341813ecf15b9ac342d189f064749b",
"score": "0.64616364",
"text": "def encrypted_params\n params.require(:encrypted).permit(:message)\n end",
"title": ""
},
{
"docid": "7b447b210d4f320d774e0e19f1025c98",
"score": "0.6436408",
"text": "def encrypted_params\n p... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "58adfc5dec5152faa9d0d368656d88c1",
"score": "0.0",
"text": "def set_contratacione\n @contratacione = Contratacione.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... |
5ecbba87d9f8ba2a2869b8d0ce325bd3 | Baseline implementation for the update_certificate_map REST call | [
{
"docid": "fbcdc286406ce9ed9530fb2bc5f119cc",
"score": "0.7233946",
"text": "def update_certificate_map request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_updat... | [
{
"docid": "8901378b06408b30beae83547c474ac2",
"score": "0.70009696",
"text": "def update_certificate_map_entry request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcod... |
bc03659422f7fe53f680db8d75ac76ec | Pushes the branch to the remote. | [
{
"docid": "e0913b3f144767461ff8bf9ddc4806bf",
"score": "0.8640614",
"text": "def push\n gash.send(:git, 'push', @push_to, @branch + ':refs/heads/' + @branch)\n end",
"title": ""
}
] | [
{
"docid": "c227726311edc06f2be9fb75953143e0",
"score": "0.8352743",
"text": "def push_branch(branch, remote)\n git(\"push #{remote} #{branch}:refs/heads/master --force\")\n end",
"title": ""
},
{
"docid": "d168c73ce03b519898d275195b951e97",
"score": "0.8131888",
"text": "def... |
07a2f4f7dde20328bb9896b36b9ba626 | Setup GET and PUT API calls | [
{
"docid": "58b5182894d1f9fefabc8d33be8b5744",
"score": "0.6310068",
"text": "def api_call(endpoint_url, http_method, options_hash={})\n @req_headers = {\"X-Cisco-Meraki-API-Key\" => @api_key, \"Content-Type\" => \"application/json\"}\n @options = {:headers => @req_headers, :body => options_hash.t... | [
{
"docid": "675a4fc174c7b2b7c29ef8b1c97e488e",
"score": "0.6437904",
"text": "def dummy\n self.GET(\"\", parameters: nil, success: nil, failure: nil)\n self.HEAD(\"\", parameters: nil, success: nil, failure: nil)\n self.POST(\"\", parameters: nil, success: nil, failure: nil)\n self.P... |
af99b59ffbeefca3279cc233e38a3157 | find the composites array | [
{
"docid": "e3de549ef2376fa6499d2c148d264d8d",
"score": "0.51962924",
"text": "def calc_composites(maximum, drbman)\n # when n = 20\n # sqr_primes = [2,3]\n # composites = [[2*2, 2*3, 2*4,...,2*9], [3*2, 3*3, 3*4,...,3*6]]\n sqr_primes = primes(Math.sqrt(maximum).to_i, drbman)\n composite... | [
{
"docid": "8d89420a08cc2a5899c373175c934b86",
"score": "0.6715669",
"text": "def complements\n\t\treturn @complements if defined? @complements\n\t\tif has_complements?\n\t\t\t@complements = []\n\t\t\tunless final_complement_index == 1\n\t\t\t\thead_and_complements[1...final_complement_index].each_with_... |
9586f52e9001c15b1a05a504eb579a9b | List Logical Routers Returns information about all logical routers, including the UUID, internal and external transit network addresses, and the router type (TIER0 or TIER1). You can get information for only TIER0 routers or only the TIER1 routers by including the router_type query parameter. | [
{
"docid": "5058376f25285197954eafac0e5a6971",
"score": "0.6804161",
"text": "def list_logical_routers_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiLogicalRoutingAndServicesLogicalRoutersApi.list_logical_routers... | [
{
"docid": "b6f6315b8ecca683e7142b00a13a6dcf",
"score": "0.7546087",
"text": "def list_logical_routers(opts = {})\n data, _status_code, _headers = list_logical_routers_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "73193c75fbd5aa422b77f6c8ed7f2d02",
"score": ... |
875c7eadfcaa4be6f21860b3287ff13b | DELETE /developer_skills/1 DELETE /developer_skills/1.json | [
{
"docid": "cd40866ea0649b37c74c8d61a3b8d055",
"score": "0.7267029",
"text": "def destroy\n @employee = Employee.find_by_id(params[:employee_id])\n @developer_skill = @employee.developer_skill.find(params[:id])\n @developer_skill.destroy\n\n respond_to do |format|\n format.html { redire... | [
{
"docid": "6f949a89d709bae914afd7422b5dc432",
"score": "0.7523879",
"text": "def destroy\n @request_skill = RequestSkill.find(params[:id])\n @request_skill.destroy\n\n respond_to do |format|\n format.html { redirect_to request_skills_url }\n format.json { head :no_content }\n end\... |
e03aba0ffc85107651b5f39767b2b286 | only attributes in Base.array_attributes will be parsed as arrays otherwise it will take the first value if an array is passed. TODO do away with this convention, as it leads to errors that are hard to diagnose | [
{
"docid": "a9a99aa2641199cd1cd090d8c8e1c1de",
"score": "0.0",
"text": "def initialize(tag_name, markup, tokens)\n self.array_attributes ||= []\n @attributes = Hash.new\n\n markup.scan(E9::Liquid::TagAttributes) do |key, value|\n parsed = value.split('|').delete_if(&:blank?).map(&:... | [
{
"docid": "353a798713161cbb1af421df01fb09ab",
"score": "0.67628086",
"text": "def attr_is_array(attribute)\n # Getter for objects\n define_method attribute.to_s do\n value = read_attribute(attribute).from_yaml\n if value.nil? or value.blank?\n []\n else\n value\n ... |
f5a3fff23cbd4621c083af66af4c81e3 | Boolean as to whether the user passed or not | [
{
"docid": "2c46e0bfa06916059d870f54f48720b3",
"score": "0.0",
"text": "def passed?\n @passed = (@score >= 10 ? true : false)\n end",
"title": ""
}
] | [
{
"docid": "6c3d3ff43e3987ce8e506d9e67a14d2b",
"score": "0.741969",
"text": "def test?\n params['USER2'] == 'true'\n end",
"title": ""
},
{
"docid": "4e118c908e8a526b9c16b9a63c2f9cbe",
"score": "0.70004135",
"text": "def pass?\n false\n end",
"title": ""
... |
234c387c5b41612a89e10df3e41a2a0a | Methods removes POI from the route The cost attribute is used if it is known, otherwise get_insertion_cost is called | [
{
"docid": "f2e9c95138c8585333fc4d9c5e303ab2",
"score": "0.68466276",
"text": "def remove_poi(remove_poi, gain = nil)\n\t\t\t \tgain = get_deletion_gain(remove_poi) if gain.nil?\n\t\t\t\t@pois.delete(remove_poi)\n\t\t\t\t@consumed_budget -= gain\n\t\t\t\t@score -= remove_poi.score\n\t\t\t\tremove_poi.ro... | [
{
"docid": "b505782ffe4e9af55410907c89b87e22",
"score": "0.59947526",
"text": "def replace\n\t\t\t@routes.each do |route|\n\t\t\t\tno_replacement = true\n\t\t\t\tbegin # Repeat until replacement can't be made for this route\n\t\t\t\t\tno_replacement = true\n\t\t\t\t\tsort_by_appropriateness(route).each ... |
7cf52864a3660cbd2e22ea0da985d8c7 | DELETE /admins/1 DELETE /admins/1.json | [
{
"docid": "ac99415705f59e53c71c255703efb2da",
"score": "0.0",
"text": "def destroy\r\n user = User.find_by(id: params[:id])\r\n user.destroy\r\n respond_to do |format|\r\n format.html { redirect_to admins_url, notice: 'Usuario destruido exitosamente' }\r\n format.json { head :no_cont... | [
{
"docid": "a21d11622dc84078d0a45987da833ed6",
"score": "0.76901686",
"text": "def destroy\n admin.destroy\n respond_to do |format|\n format.html { redirect_to admin_admins_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d7f1a818506c0a2d... |
a2099a77c85e91272ae2f9e35b937953 | Only allow a trusted parameter "white list" through. | [
{
"docid": "99382913d794d6173604b43c35c4a800",
"score": "0.0",
"text": "def redirect_item_params\n params.require(:redirect_item).permit(:src_path, :dest_url, :notes, :redirect_type)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.79429054",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "f6060519cb0c56a439976f0c978690db",
"score": "0.69583875",
"text": "def permitted_params\n params.permit!\n end",
"title... |
3e648ce3d59608b976072b0b0e67cf37 | Verifica si es hora de pico y placa | [
{
"docid": "97295019d773eafa549248c0f1658508",
"score": "0.72304",
"text": "def dateTimePicoPlaca(hour, minute)\r\n if (hour.between?(7,9) && minute <=930) || (hour.between?(16,19) && minute <=1930) then\r\n return 1\r\n else\r\n return 0\r\n end\r\nend",
"title": ""
}
] | [
{
"docid": "47c8c9e1739fb3d45454b2e6095e0690",
"score": "0.68442243",
"text": "def validaHora(hora)\r\n\t\thoras = hora[0,2].to_s\r\n\t\tminutos = hora[3,2].to_s\r\n\t\tsigno = hora[2,1].to_s\r\n\t\t\r\n\t\tif ((horas.to_i < 0 )|| (horas.to_i > 24) )\r\n\t\t\t@mensaje= \"Hora incorrecta: Ejemplo 00:23\"... |
764895c9876ce030ffbefb11a7742564 | Schedule order and purchased egiftcards export to Springboard | [
{
"docid": "c34ff354461452b374c67d503613742b",
"score": "0.7879995",
"text": "def schedule_springboard_export\n SpreeSpringboard::ExportOrderJob.perform_later(self)\n line_items.\n select(&:is_e_gift_card?).\n map(&:gift_card).\n each(&:schedule_springboard_export)\n en... | [
{
"docid": "888e9d5b706dc9cc4e80cd67b2ec14de",
"score": "0.72114307",
"text": "def schedule_shipstation_export\n SpreeShipstation::ExportOrderJob.perform_later(self)\n end",
"title": ""
},
{
"docid": "1d869e9eb987eee47c53f17efa2d03ac",
"score": "0.63342917",
"text": "... |
442cb11fe394c37e92360df1c0ca1b5f | GET /noticeboard_role_users/1 GET /noticeboard_role_users/1.fxml | [
{
"docid": "facb22a217997be5b2c927071dd3ac26",
"score": "0.72161627",
"text": "def show\n @noticeboard_role_user = NoticeboardRoleUser.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.fxml { render :fxml => @noticeboard_role_user }\n end\n end",
... | [
{
"docid": "c41f06ad7f39123e99c652c576d348a8",
"score": "0.654093",
"text": "def show\n @noticeboard_role = NoticeboardRole.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.fxml { render :fxml => @noticeboard_role }\n end\n end",
"title": ""
... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "4796eec9630eef90d59f1282d30ecc03",
"score": "0.0",
"text": "def dreamcar_params\n params.require(:dreamcar).permit(:user, :year, :trim, :exterior_color, :interior_color, :engine, :transmisson, :price, :extra_column)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.74959",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6957448",
"text": "def strong_params\n params.require(:request).permit(param_whiteli... |
e18a3be5b3ce88bcc8a1a1f70996644c | Get necessary table and column information so we can define fast insertion methods name Plural name of the model we're associating with options see ActiveRecord docs | [
{
"docid": "49c5a0a202d0b92853a3046a20be878c",
"score": "0.6402453",
"text": "def define_fast_methods_for_model(name, options)\n join_table = options[:join_table]\n join_column_name = name.to_s.downcase.singularize\n define_method \"fast_#{join_column_name}_ids_insert\" do |*args|\n ... | [
{
"docid": "880d070ebbfc1fe6112c0337da51d0b6",
"score": "0.6567152",
"text": "def sql_names\n if is_table_column?\n if self.reflection\n [self.model.table_name + \".\"+ foreign_key, self.reflection.klass.table_name + \".\" + option_text_attribute.to_s]\n else\n [self... |
c220b9aecb743134a143e59ddc916469 | PUT /teams/1 PUT /teams/1.json | [
{
"docid": "b100fc398d501ce6022c4c4be0e1edfa",
"score": "0.0",
"text": "def update\n @team = Team.find(params[:id])\n\n params[:team][:players_names].split(\", \").each do |p|\n @team.players << Player.find_by_username(p.scan(/\\((.*?)\\)/))\n end\n\n respond_to do |format|\n if @t... | [
{
"docid": "555b6bd116d1f3a4d47cec062f720056",
"score": "0.7434564",
"text": "def update\n render json: Team.update(params[\"id\"], params[\"team\"])\n end",
"title": ""
},
{
"docid": "5c80fec0e9632a810ea1b2bdc6d12e42",
"score": "0.72220546",
"text": "def update_team(team)\n ... |
c4e2e065316cb02ae656ad213f3c6ab6 | Returns the active session if the device has connected another instance of Web WhatsApp | [
{
"docid": "99840bd1c726b0cccc2c307a69425881",
"score": "0.0",
"text": "def takeover_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: Class1InstanceApi.takeover ...'\n end\n # resource path\n local_var_path = '/takeove... | [
{
"docid": "ce4ec180bfc57cd7229a222e578c4fa0",
"score": "0.69739765",
"text": "def connected?\n app.speakers.ID(@id).connected.get\n end",
"title": ""
},
{
"docid": "0dc18d6cc58cb9f75a7abdb4bd4c37b5",
"score": "0.66288424",
"text": "def is_connected\n begin\n if sessi... |
8f2756506c8ff8a1d9ffcf95d7fb3150 | 0 [ PaymentReconciliation::ProcessNote ] | [
{
"docid": "b86b3defd0a2072248ed311a11b61e3c",
"score": "0.0",
"text": "def resourceType\n 'PaymentReconciliation'\n end",
"title": ""
}
] | [
{
"docid": "2f3bf3582f7283c6aadc0b2c15639788",
"score": "0.62078345",
"text": "def workflow_note\n self.notes\n end",
"title": ""
},
{
"docid": "19ab80b2b38e385e9a772f22c0f98fd0",
"score": "0.59678495",
"text": "def rn_generate_note\n supplier = params[:supplier]\n orde... |
538288073ce62fe581c954140a9dfe79 | Get list of queues. | [
{
"docid": "f8f7ec361ad0fd36da0f3c299eebf93a",
"score": "0.674398",
"text": "def get_routing_queues(opts = {})\n data, _status_code, _headers = get_routing_queues_with_http_info(opts)\n return data\n end",
"title": ""
}
] | [
{
"docid": "a2c9c97609cba04f77d34077563629ab",
"score": "0.81713533",
"text": "def list_queues(options ={})\r\n content = execute(:get, nil, { :comp => 'list' }.merge!(options), { :x_ms_version => \"2009-09-19\" })\r\n doc = REXML::Document.new(content)\r\n queues = []\r\n \r... |
24da3fe8f0fdeaa6851e79b5a866653e | GET /update_records/new GET /update_records/new.json | [
{
"docid": "99dc6607574aa84a7318b9e8984d7298",
"score": "0.77328545",
"text": "def new\n @update_record = UpdateRecord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @update_record }\n end\n end",
"title": ""
}
] | [
{
"docid": "d46acb1806e436bd5e4387c403fbafb4",
"score": "0.6991684",
"text": "def new\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @update }\n end\n end",
"title": ""
},
{
"docid": "61996a846cdcf3c8b66801e0ce161356",
"score":... |
61aa4a411f555546420a9ed49a346e5c | Set content to file and save | [
{
"docid": "de008e8730377db0319098b31ac278bb",
"score": "0.0",
"text": "def upload!(file, opts={})\n upload(file, opts)\n save\n end",
"title": ""
}
] | [
{
"docid": "c2fe00ab08b66464127c7c1f82ad25e0",
"score": "0.776327",
"text": "def save_content\n File.open(full_path, 'w') do |f|\n f.write(content)\n end\n end",
"title": ""
},
{
"docid": "576a18295a7ec3a4e78aa848f4f8a5f1",
"score": "0.7671078",
"text": "def save\... |
3994753e116e93867aa585c47da6a778 | This method should be used for all actions that require setting correct Merchant details for the Stripe gem | [
{
"docid": "11f853834d46c8529fd8ce43155aff3c",
"score": "0.0",
"text": "def with_stripe_payment_config(community, &block)\n @@mutex.synchronize {\n payment_gateway = payment_gateway_for(community)\n configure_payment_for(payment_gateway)\n\n return_value = block.call(payment_ga... | [
{
"docid": "37c40f9a2010c3ef695d7061968e2b99",
"score": "0.67247665",
"text": "def payment_setup\n error = params[:error]\n if error.present?\n error_description = params[:error_description]\n flash[:error] = error_description\n redirect_to edit_unit_unit_setting_path(@unit, :paymen... |
594db497aa0a106d01d8d0e4e6d9bd0c | executes the formula with a hash of given calculation terms | [
{
"docid": "479ade818202db77f2818ef1637135d0",
"score": "0.54640555",
"text": "def call(input)\n\t\tbegin\n\t\t\tReporter::Formula.calculate(@calculation, input)\n\t\trescue StandardError => e\n\t\t\tRails.logger.error \"Error executing formula: #{Reporter::Formula.calculation_to_s(@calculation, input)}... | [
{
"docid": "53554bc30d49f92f2571943cd479d5cb",
"score": "0.6604777",
"text": "def evalsha(*args); end",
"title": ""
},
{
"docid": "53554bc30d49f92f2571943cd479d5cb",
"score": "0.6604777",
"text": "def evalsha(*args); end",
"title": ""
},
{
"docid": "6517d0431a8848b9593508... |
bd3a7dfddc30bc69012064ac1ec450c4 | Given a hash with numeric values, return the key for the smallest value | [
{
"docid": "4fbe7d226ef8a7a87a1df0f7a5ed86e0",
"score": "0.0",
"text": "def key_for_min_value(name_hash)\n if name_hash.empty?\n nil\nelsif new_array = name_hash.sort_by {|name, value| value}\n new_array[0].shift\nend\n end",
"title": ""
}
] | [
{
"docid": "10348c0f7efbf074c6402f6f47742839",
"score": "0.8821222",
"text": "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = Float::INFINITY\n hash.each do |key, value|\n if value < lowest_value\n lowest_value = value\n lowest_key = key\n end\n end\n lowest_key\nend... |
f1ce952f065d59c85920b6e30f1a4666 | Strip the protocol + following slashes off of a url | [
{
"docid": "20f1b6be5e5a4da0292751b651d1e765",
"score": "0.0",
"text": "def host\n host_url.gsub(/http:\\/\\/|https:\\/\\//, '')\n end",
"title": ""
}
] | [
{
"docid": "0860f68aaa0bcd2fa1bddd1d8db5c7f2",
"score": "0.80265987",
"text": "def strip_url(url)\n if url.match(/\\/\\/[a-zA-Z0-9\\-\\.]+/) != nil\n url.match(/\\/\\/[a-zA-Z0-9\\-\\.]+/)[0].gsub(/\\/\\//, \"\")\n else\n url\n end\nend",
"title": ""
},
{
"docid": "6f52654256e3d4a2c4... |
c445bdb4a51382b2f427c1eb094b23ad | Fundementals methods: intialize, add, remove | [
{
"docid": "57fe18a5832585f01a0e14671b6cc38e",
"score": "0.0",
"text": "def initialize\r\n @persons = []\r\n end",
"title": ""
}
] | [
{
"docid": "8f71659614d193939f8fde552f6b65f4",
"score": "0.6521793",
"text": "def add \n end",
"title": ""
},
{
"docid": "2c799b0dcd5b1905a0a63a66ebc2c5c2",
"score": "0.6429605",
"text": "def add\n end",
"title": ""
},
{
"docid": "2c799b0dcd5b1905a0a63a66ebc2c5c2",
... |
a2099a77c85e91272ae2f9e35b937953 | Only allow a trusted parameter "white list" through. | [
{
"docid": "dbed2c6f7f5875cabdf3bbe91baa375a",
"score": "0.0",
"text": "def comment_params\n params.permit(:entry_id, :author, :comment)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7943618",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "f6060519cb0c56a439976f0c978690db",
"score": "0.69572574",
"text": "def permitted_params\n params.permit!\n end",
"title"... |
891c5525de0422bffb224e6618468f85 | Determines whether this formatter is applied or not. | [
{
"docid": "bf92b8e783fa1d47b25a65a98ba5d186",
"score": "0.0",
"text": "def matches?(value)\n !!(value.to_s =~ MATCHER)\n end",
"title": ""
}
] | [
{
"docid": "e4986708bb52e0fd3aaf8a8d13d0ded5",
"score": "0.69315034",
"text": "def has_formatter?(column_name)\n @formatters.has_key?(column_name)\n end",
"title": ""
},
{
"docid": "8cf66c7a48ef392203b898ab77ee101f",
"score": "0.6859082",
"text": "def enabled?\n re... |
35c3c97fa55945e76e68f7b697452464 | STEP 4 define the bot game | [
{
"docid": "c235010e9184fb730efb43d4a7597ea8",
"score": "0.0",
"text": "def bot_game(current_position)\n @dead = Array(1..15).sample == current_position ? true : false\n if @dead == true\n puts \"You DIE !!\"\n puts \"❌ GAME OVER ❌\"\n puts \"****************\"\n else\n puts \"The bot mis... | [
{
"docid": "478c2bf098145650faf603dac2e804b1",
"score": "0.73206383",
"text": "def initiate_game\n end",
"title": ""
},
{
"docid": "51c353031efe457f643d07acd715e277",
"score": "0.70955175",
"text": "def battle_random_bot\n\n end",
"title": ""
},
{
"docid": "bc524866c9cb... |
02bc4d8c8a44b76e45a53c916a6244ba | Convenience method for accessing the OAuth credentials subhash | [
{
"docid": "b05468a4c8919c8f151c9bacec5e1294",
"score": "0.6587839",
"text": "def credentials\n auth_hash['credentials']\n end",
"title": ""
}
] | [
{
"docid": "e415d46ca77fe5157ce31c2c4ead0a76",
"score": "0.6664676",
"text": "def web_authentication_detail\n { user_credential: { key: key, password: password } }\n end",
"title": ""
},
{
"docid": "efcf540d536e383167513a7170bf46d4",
"score": "0.6473065",
"text": "def access_key\... |
8737c88d185fbc3291fe585118f41691 | Searches for an output port object that matches the type and name specification. +type+ is either a string or a Typelib::Type class, +port_name+ is either a string or a regular expression. This is a helper method used in various places | [
{
"docid": "bc3d6ac5af06fac6d4ed03165754bd9c",
"score": "0.80005807",
"text": "def find_output_port(type, port_name=nil)\n candidates = find_all_output_ports(type, port_name)\n if candidates.size > 1\n type_name = if !type.respond_to?(:to_str)\n ... | [
{
"docid": "ae66ab4efb0b7b07ae198b03455a0c19",
"score": "0.7576819",
"text": "def find_port(type, port_name=nil)\n candidates = find_all_ports(type, port_name)\n if candidates.size > 1\n type_name =\n if !type.respond_to?(:to_str)\n ... |
275e73999df317e52069021b9ea11caa | DELETE /tasks/1 DELETE /tasks/1.json | [
{
"docid": "bd8efc87fe29d390514a7c99d99722fa",
"score": "0.0",
"text": "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to user_list_path(@user, @list) }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] | [
{
"docid": "8379665eb11157da423e4d478103f0b0",
"score": "0.76986516",
"text": "def delete_task\n Task.find(params['task_id']).destroy\n render json: {success: true}\n end",
"title": ""
},
{
"docid": "9d5e7fb54fb48465ffe5dcad22720803",
"score": "0.7661382",
"text": "def delete_... |
3567c1205e2470cda2b1a1f0381bfcee | A player has just registered for the game and has started playing +player+ :: a hash containing a unique id and timestamp for the event, the name, url and pid of the player | [
{
"docid": "d4d45cc0dc9daf1630f14e5495067c4f",
"score": "0.8289367",
"text": "def player_started(player)\n output({\n :event => \"player_started\",\n :id => Events.generate_uuid,\n :timestamp => Events.timestamp,\n :name ... | [
{
"docid": "d29850a23e770067026f0e6c5660e94e",
"score": "0.6580652",
"text": "def onalg_player_has_played(player, card)\n str_cmd = JSON.generate([player.name, card])\n @player_conn.send_data( @player_conn.build_cmd(:onalg_player_has_played, str_cmd) ) \n end",
"title": ""
},
{
"docid... |
2db4d971e1ed8f1e1149de1c242098d9 | Kill Unicorns in multiple ways O_O | [
{
"docid": "3de23c2a7fbf40741821590eb1841feb",
"score": "0.0",
"text": "def kill_unicorn(signal)\n script = <<-END\n if #{unicorn_is_running?}; then\n echo \"Stopping Unicorn...\";\n #{unicorn_send_signal(signal)};\n else\n echo \"Unicorn is not running.\";\... | [
{
"docid": "7645097424ed601123366dcb15a23799",
"score": "0.671197",
"text": "def customkill; end",
"title": ""
},
{
"docid": "183ef7091ef80bb0fb729c03fe402492",
"score": "0.6672276",
"text": "def kill; end",
"title": ""
},
{
"docid": "183ef7091ef80bb0fb729c03fe402492",
... |
2abfc909396136e4273e41853bd9bdc2 | Iterates over the node list. | [
{
"docid": "1886ba3f1fe834a6400b4a7276142ae6",
"score": "0.7410796",
"text": "def each_node(&block)\n @nodes.each &block\n end",
"title": ""
}
] | [
{
"docid": "281aa4f788ed9ab7f64646b2cae809a8",
"score": "0.79400986",
"text": "def each_node\n list_nodes.each do |node|\n yield node\n end\n end",
"title": ""
},
{
"docid": "1048dfeee0bc9853b486b59a7bb62f83",
"score": "0.7396512",
"text": "def iterate\n curren... |
01451d8c1af282ccce03c51db8300d3d | Returns a new array populated with the keys from this hash. See also +LRUMapvalues+. | [
{
"docid": "bb8062d8319ecb2feec0627dc31f637f",
"score": "0.63148236",
"text": "def keys\n @__cache.keys\n end",
"title": ""
}
] | [
{
"docid": "845b7343ee8f97e783e47ab1f522e603",
"score": "0.75746465",
"text": "def keys\n inv = @hash.invert\n map do |val| inv[val] end\n end",
"title": ""
},
{
"docid": "131a0aecca02150a61851dfaa7b08c5d",
"score": "0.7286633",
"text": "def keys\n return [],[]\n e... |
8be1bb0cdd13a2c40f28d74cb53103eb | POST /targeting_vectors.xml POST /targeting_vectors.json | [
{
"docid": "ed84beb76f71108b80efacac0ff7c958",
"score": "0.7356118",
"text": "def create\n @targeting_vector = TargetingVector.new( params[:targeting_vector] )\n \n respond_to do |format|\n if @targeting_vector.save\n format.xml { render :xml => @targeting_vector, :status => :crea... | [
{
"docid": "e8973418922d68b8855d6696518e92cf",
"score": "0.697613",
"text": "def update\n respond_to do |format|\n if @targeting_vector.update_attributes( params[:targeting_vector] )\n format.xml { render :xml => @targeting_vector, :status => :ok, :location => @targeting_vector }\n ... |
ee3bbe876c9edbab6eade0ce2334fc60 | POST /sales POST /sales.json | [
{
"docid": "3923b508626fd665a307c1550b2a203c",
"score": "0.0",
"text": "def create\n #set time zone\n Time.zone = Shop.find_by_name(session[:shop_name]).timezone\n Chronic.time_class = Time.zone\n\n @sale = Sale.new\n @sale.product = params[:product]\n @sale.variant = params[:v... | [
{
"docid": "ae8fb9e734e849addf672f36f2ececce",
"score": "0.7615641",
"text": "def create\n Sale.transaction do \n begin\n @sales = [*Sale.create!(sale_params)]\n render json: { data: @sales }, status: :created\n rescue ActiveRecord::RecordInvalid => invalid\n render jso... |
a964d8821adbc61ae0f219b5297fc030 | update settings on dashboard after admin login | [
{
"docid": "ec9c93ad0cda392218de0d64a063a056",
"score": "0.0",
"text": "def update\n\t\tif @setting.update(setting_params)\n\t\t render json: @setting\n\t\telse\n\t\t render json: @setting.errors, status: :unprocessable_entity\n\t\tend\n\tend",
"title": ""
}
] | [
{
"docid": "2be1e9a8ec4e5fadfb0795ca289d8dd7",
"score": "0.74681425",
"text": "def update_settings\n end",
"title": ""
},
{
"docid": "d22b856ec26f93bfdd47df44ee7d31b3",
"score": "0.69865656",
"text": "def save_settings\n unless current_user.is_signed_in?\n head :unauthorized... |
8749d524b99cd1e0081d3ba5f8fb0895 | A Vigenere Cipher is a Caesar cipher, but instead of a single key, a sequence of keys is used. For example, if we encrypt "bananasinpajamas" with the key sequence 1, 2, 3, then the result would be "ccqbpdtkqqcmbodt": Message: b a n a n a s i n p a j a m a s Keys: 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 Result: c c q b p d t k ... | [
{
"docid": "549c47fa4b5ed2e40fdfd817da930612",
"score": "0.0",
"text": "def vowel_rotate(word)\n vowels = \"aeiouAEIOU\"\n idx = []\n (0...word.length).each do |i|\n idx << i if vowels.include?(word[i])\n end\n last = word[idx[-1]]\n (1...idx.length).reverse_each do |i|\n ... | [
{
"docid": "3ec0b19c0e141f8fc1a63024ea556469",
"score": "0.81161034",
"text": "def vigenere_cipher(message, keys)\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n encrypted_message = \"\"\n\n message.each_char.with_index do |char, index|\n old_index = alphabet.index(char)\n new_index... |
7484c7733c2947cf847e171bac09023f | Navigates to the view page for the specified record. Returns false if unsuccessful. | [
{
"docid": "727c1ae89e42217d1bebb2b0f23df1ef",
"score": "0.0",
"text": "def look_in_search_popup(select_item, rasta)\n default_retries = 5\n default_waittime = 1\n rasta[:retries] = (rasta[:retries] == nil) ? default_retries : rasta[:retries].to_i\n rasta[:waittime] = (rasta[:waittim... | [
{
"docid": "f4738a5ad01660199cd66d5b6b3bf244",
"score": "0.6243849",
"text": "def show\n redirect_to my_records_url\n end",
"title": ""
},
{
"docid": "06c2daf46161462339e8059744e36a9c",
"score": "0.5803963",
"text": "def show?\n Guidance.can_view(@user, @record.id)\n ... |
44d2c9164671e84e4935973449cfb480 | An array of modules that should be mixed in to the singleton class of extension objects | [
{
"docid": "c18968e7a15dadf11b765ff3ebaf3fad",
"score": "0.6942247",
"text": "def singleton_extensions\n singleton_extension_list.dup\n end",
"title": ""
}
] | [
{
"docid": "0974d822d15b4ac3894456a840d4650b",
"score": "0.72330785",
"text": "def modules\n module_names.map(&:constantize)\n end",
"title": ""
},
{
"docid": "0ef2fe4326dffbbd5d4376b3cca4668a",
"score": "0.7154519",
"text": "def instance_modules(*mods)\n @instance... |
414a8392e3a79c8dd521f6fcf470c545 | Creates a new repository using the underlying `store` (e.g. `MemoryEventStore`). namespace optional namespace allowing for multiple applications to share the same Eventstore database without name conflicts | [
{
"docid": "a31a089d94415e7086be44d3cb01a223",
"score": "0.5667646",
"text": "def initialize(store, namespace: nil)\n @store = store\n @subscribers = []\n @namespace = namespace\n end",
"title": ""
}
] | [
{
"docid": "95331b30746d3d426b0073a672714add",
"score": "0.6476249",
"text": "def namespace=(ns) @namespace = @store.namespace = ns; end",
"title": ""
},
{
"docid": "c4d1ea260307dc003f3c61c7e625aebe",
"score": "0.6054565",
"text": "def create(namespace)\n n = global_namespaces[n... |
a2099a77c85e91272ae2f9e35b937953 | Only allow a trusted parameter "white list" through. | [
{
"docid": "42be8da89b686d8257242e1b6196ba73",
"score": "0.0",
"text": "def room_params\n params.require(:room).permit(:name, :descriptions, :minrate, :active)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7943618",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "f6060519cb0c56a439976f0c978690db",
"score": "0.69572574",
"text": "def permitted_params\n params.permit!\n end",
"title"... |
f782e48d4eab06728e624313ea359545 | returns the Nio::Fmt to be used with the number. The returned object can be modified with Nio::Fmt's bang methods | [
{
"docid": "df39e888161bd066bd4c680942e7c774",
"score": "0.63753957",
"text": "def fmt\n unless defined? @fmt\n @fmt = DEFAULT_FMT.dup\n case @value\n when -0.01 ... 0.01 then \n @fmt.mode!(:sci, sig_digits)\n else \n @fmt.mode!(:sig, sig_digits)\n end\n end\... | [
{
"docid": "5982c23dd42fdba11d3a5ee7e3a6e358",
"score": "0.74162614",
"text": "def numFmtId; end",
"title": ""
},
{
"docid": "456233f53f5e72a3dcd1420dd2a5f9b2",
"score": "0.7383123",
"text": "def numFmt; end",
"title": ""
},
{
"docid": "148681993b620588fd982e5030b8bfcb",
... |
4ca1cf32d7ad66c3ae78b3a48931e4f7 | Whether the inserter has been stopped. | [
{
"docid": "67e47b7916213bfed33eacb4cb67de03",
"score": "0.64936846",
"text": "def stopped?\n synchronize { @stopped }\n end",
"title": ""
}
] | [
{
"docid": "daf972192b161972947a8eb70b8d157f",
"score": "0.69698995",
"text": "def stopped?\n !applying?\n end",
"title": ""
},
{
"docid": "fd3283d65f964ed118fbe9e15ee98ffe",
"score": "0.6921983",
"text": "def stopped?\n !!@stop_instant\n end",
"title": ""
... |
8ec5d0b4814e9eb9376a66b6724b46fb | =begin Define a method, boolean_to_binary(arr), that accepts an array of booleans as an argument. Your method should convert the array into a string of 1's (for true values) and 0's (for false values) and return the result. boolean_to_binary([true]) => "1" boolean_to_binary([true, false, true]) => "101" =end | [
{
"docid": "ed1e5bba478448deef48e56caaa67810",
"score": "0.92470163",
"text": "def boolean_to_binary(arr)\r\n\r\n binary = \"\"\r\n\r\n # iteration each method\r\n arr.each {|bool|\r\n if bool == true\r\n\r\n # bool true to binary 1\r\n binary << \"1\"\r\n else\r\n\r\n # bool fal... | [
{
"docid": "985b05a893274a98d93dd493953b0d79",
"score": "0.9328531",
"text": "def old_boolean_to_binary(arr)\n binary = \"\"\n\n arr.each do |boolean|\n if boolean\n binary += \"1\"\n else\n binary += \"0\"\n end\n end\n\n binary\nend",
"title": ""
},
{
"docid": "a12af... |
17c61e5ea9469feb1a0fa7147836d901 | Create a new RPC Client instance | [
{
"docid": "08fe1ac8b4674bf2e6c475b4e48f7d49",
"score": "0.0",
"text": "def initialize(config={})\n\n\t\tself.info = {\n\t\t\t:host => '127.0.0.1',\n\t\t\t:port => 3790,\n\t\t\t:uri => '/api/' + Msf::RPC::API_VERSION,\n\t\t\t:ssl => true,\n\t\t\t:ssl_version => 'TLS1',\n\t\t\t:context => {}\n\t\t}... | [
{
"docid": "ad58af14965a76c74382a66c8b3f5dbd",
"score": "0.745051",
"text": "def new(*args)\n Client.new(*args)\n end",
"title": ""
},
{
"docid": "7d9f0f3b9e3d17bfc6380ffa94857dc5",
"score": "0.743339",
"text": "def create_client\n @networking.create_client\n end",
... |