query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "26de054123b28ca924bcb0156dd8a061",
"score": "0.0",
"text": "def update!(**args)\n @end_index = args[:end_index] if args.key?(:end_index)\n @start_index = args[:start_index] if args.key?(:start_index)\n end",
"title": ""
}
] | [
{
"docid": "184b1b1ed771473d3eb9f338c0734c38",
"score": "0.73066413",
"text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end",
"title": ""
},
{
"docid": "5076c5a88404ae72986f958710f5687a",
"score": "0.72631145",
"text": "def update... |
980272d88cd792094d277721ce7bbe38 | body > div.App.full.AppBase.Module > div.appContent > div.mainContainer > div.UserProfilePage.Module > div.UserInfoBar.InfoBarBase.gridWidth.Module.centeredWithinWrapper.v1 > ul.userStats > li:nthchild(3) > a > span.value | [
{
"docid": "6802b69ee17022f11ae356dc7cb5dcfa",
"score": "0.53146964",
"text": "def scrape_data_for_profile_page(html)\n page = Nokogiri::HTML(html)\n return nil if !page.css(\"div[class~=errorMessage]\").empty?\n profile_name = page.css(\"div[class~=aboutBar]\").css(\"div[class~=about]\").... | [
{
"docid": "9f9816659d3e5d934e958e6b590475af",
"score": "0.59232706",
"text": "def getValue page, attribute\n if attribute == 'rating'\n return page.search('.ratingValue').children[1].text\n end\nend",
"title": ""
},
{
"docid": "d1c3a0979cec4e9c4390d64213bc4788",
"score": "0.58059",... |
c578dd64a3fad00f55b007e957302b6a | Uses the stars_rate_field_tag and wraps it with a from tag in order to make an interactive star rating with submit to remote function Options: options are the same as star_rate_field_tag remote_options are the same as with remote_function | [
{
"docid": "4b456b3c293ed6a114d0f7c4b732198d",
"score": "0.8080707",
"text": "def stars_rate_remote_tag(name, value, remote_options={}, options={}, &proc)\n defaults = { :form_id => \"#{name}_form\" }\n options = defaults.merge(options).symbolize_keys\n remote_defaults = { :submit => options[:f... | [
{
"docid": "133c40a478f44b9840a90a004263e47b",
"score": "0.7460402",
"text": "def stars_rate_field_tag(name, value, options = {}, &proc)\n # set default options\n o = {\n :tag => :div,\n :star_img_inactive => 'star_comment.png',\n :star_img_path => '/images/css/',\n :star_img_a... |
8c49d36669f32ce2850656f7cff3ee02 | Public: Constructor. name A String with the name of the queue. description The queue description Hash service The Queue service to perform external calls. | [
{
"docid": "4132d7d1601418324d06f538031abbc9",
"score": "0.0",
"text": "def initialize(body, properties={}, service=Azure::ServiceBus::Queues)\n @body = body\n @properties = properties\n @service = service\n yield self if block_given?\n end",
"title": ""
}
] | [
{
"docid": "368c57d84e474257c78fb170e7ef2505",
"score": "0.78891325",
"text": "def initialize(name, url=Azure::Queues::URI.queue(name), metadata = {}, service=Azure::Queues)\n @name = name\n @url = url\n @metadata = metadata\n @service = service\n end",
"title": ""
... |
3ce739d9d16b62dd1694efa31e212298 | Skip running this command. | [
{
"docid": "d809f476f964353b92137a3c05455687",
"score": "0.75103813",
"text": "def skip!\n @skip = true\n end",
"title": ""
}
] | [
{
"docid": "49931e80264775f50c74badaef07e9f2",
"score": "0.7759313",
"text": "def skip\n GraphQL::Execution::Execute::SKIP\n end",
"title": ""
},
{
"docid": "b7bfce83756cc303c72be025f0d6277c",
"score": "0.77549326",
"text": "def skip!\n @_skip_processing = true\n... |
652e2a4a0a5fe825c399113c82f6af78 | Removes the topmost state from the stack, calling Statedeactivate on it and then Stateactivate on the newlycurrent state. | [
{
"docid": "33e50c53489881af6a919cf8569b81f7",
"score": "0.62296957",
"text": "def pop(deactivate = true, activate = true)\n popped = nil\n if current\n current.deactivate if deactivate\n popped = @stack.pop\n end\n current.activate if current && activate\n return popped\n end"... | [
{
"docid": "e68580a7af03f040f3f80337bf355040",
"score": "0.7479719",
"text": "def pop_state\n @state.pop\n end",
"title": ""
},
{
"docid": "61757eae25fdcf426b75ca9ce057e46d",
"score": "0.7078206",
"text": "def restore_graphics_state\n @stack.pop\n end",
"title": "... |
e96e2bc9daf2897cca06a6c048232b6a | PATCH/PUT /lec_staffs/1 PATCH/PUT /lec_staffs/1.json | [
{
"docid": "f1c36f99605f7a821a30e2a0bfe16e3f",
"score": "0.7166316",
"text": "def update\n respond_to do |format|\n if @lec_staff.update(lec_staff_params)\n format.html { redirect_to @lec_staff, notice: 'Staff actualizado com sucesso.' }\n format.json { render :show, status: :ok, l... | [
{
"docid": "949cfec9b44fb2821b5fd2147e4d7dbe",
"score": "0.7422893",
"text": "def update\n @staff = Staff.find(params[:id])\n\n respond_to do |format|\n if @staff.update_attributes(params[:staff])\n format.html { redirect_to @staff, notice: 'Staff was successfully updated.' }\n ... |
85be732d4fbbe13b83128ce12be75156 | Determine if the current node is redhat enterprise. | [
{
"docid": "dfd866dc527b3c571f8b134decafc9a2",
"score": "0.7916425",
"text": "def redhat_enterprise_linux?(node)\n node['platform'] == 'enterprise'\n end",
"title": ""
}
] | [
{
"docid": "0d987171dfac6d9ca457b0b5411cf371",
"score": "0.772626",
"text": "def redhat_platform?(node = __getnode)\n node[\"platform\"] == \"redhat\"\n end",
"title": ""
},
{
"docid": "27a61dc0b12064c1ffb8582c698b0b26",
"score": "0.74603224",
"text": "def redhat_based?(n... |
643e63fa27bd10faace360b90b17de23 | reduce 7 omitted reduce 8 omitted | [
{
"docid": "85e976fce3a08706a1e5f81f36822436",
"score": "0.0",
"text": "def _reduce_9(val, _values, result)\n if (self.in_def || self.in_single > 0) then\n debug 11\n yyerror \"BEGIN in method\"\n end\n ... | [
{
"docid": "10734647c79a55015e6f477ff3f14980",
"score": "0.6877639",
"text": "def _reduce_7(val, _values); end",
"title": ""
},
{
"docid": "1ab951848648bd3eb287529b9355c435",
"score": "0.6513419",
"text": "def _reduce_607(val, _values, result)\n result = nil\n ... |
8c58522c2ab224ebbb1abb3292ba5be4 | vergleicht die Listen, ob alle Elemente im :vergleich auch in :liste sind | [
{
"docid": "5ca5d574dfce9d2b88271e575de008dc",
"score": "0.0",
"text": "def ueberein_alle?(liste, vergleich)\r\n ergebnis = false\r\n zaehler = 0\r\n liste.each do |el| \r\n vergleich.each do |vg|\r\n zaehler += 1 if el == vg\r\n end\r\n end\r\n if zaehler == vergleich.co... | [
{
"docid": "2a2bf01922f379f8e824c6d1c9004502",
"score": "0.6387447",
"text": "def set_liste\n @liste = Liste.find(params[:liste_id])\n end",
"title": ""
},
{
"docid": "e60dbd14989380f95784feb8ff804614",
"score": "0.6164451",
"text": "def liste()\n puts(\"LISTE DES ORDR... |
3e19e549d5d4d9deda45d91339cf0f24 | Return parts in a hash structure, handy for ActiveRecord. | [
{
"docid": "d397157a3339c7108d67ab8c7df51382",
"score": "0.0",
"text": "def to_h\n {\n sale_price: @amount,\n expires_at: Time.at(Time.now + @expires),\n group: @group,\n encoded_key: @checksum\n }\n end",
"title": ""
}
] | [
{
"docid": "797416e50b34debf1b4dd99677fd536f",
"score": "0.7225341",
"text": "def parts\n @parts ||= Key.extract_obj_id @_parts\n end",
"title": ""
},
{
"docid": "353784ccd2f97a2835add57513dafc15",
"score": "0.6916727",
"text": "def parts\n @parts ||= @_parts.map do |v|\... |
82f109f34796b16a4940654ae6a01198 | Using attr_accessor defined two new methods for us, name to get the value, and name= to set it. Create an object | [
{
"docid": "a20d6afd5d7495987bb645cf6803a0ec",
"score": "0.0",
"text": "def initialize (names= \"World\")\n @names = names\n end",
"title": ""
}
] | [
{
"docid": "ea3fee8283dfdd45b5fa98f85dd631f6",
"score": "0.75886476",
"text": "def attr_accessor(name)\n attr_reader(name)\n attr_writer(name)\n nil\n end",
"title": ""
},
{
"docid": "3ae58cfd8c4bbe2018083069f648dc0e",
"score": "0.73458606",
"text": "def initialize(name, va... |
1c060853597eff935a7cb286a932f721 | The creator of a roll can not leave a roll. To leave a roll a user must delete it. | [
{
"docid": "e32ae59050f26a4403b9c9d2b0d28d8d",
"score": "0.0",
"text": "def leavable_by?(u)\n raise ArgumentError, \"must supply user or user_id\" unless u\n user_id = (u.is_a?(User) ? u.id : u)\n\n return self.creator_id != user_id\n end",
"title": ""
}
] | [
{
"docid": "fdcac05a9155b3af3b65b8be9f51a2b0",
"score": "0.69236004",
"text": "def leave\n StatsManager::StatsD.time(Settings::StatsConstants.api['roll']['leave']) do\n if @roll = Roll.find(params[:roll_id])\n if @roll.leavable_by?(current_user)\n if @roll.remove_follower(current... |
ef0c9589350a9e071d0b331e1eb39a35 | Get the singularized version of the word passed in. This is just a caching front end to the `singularize` method from the ActiveSupport inflector. | [
{
"docid": "d84047968fa95cece7acd8433a7d22b9",
"score": "0.70495266",
"text": "def singularize klass\n @singularizations[klass]\n end",
"title": ""
}
] | [
{
"docid": "c805e7702c73ceb20af09309c4340b60",
"score": "0.89509606",
"text": "def singularize(word)\n Extlib::Inflection.singular(word)\n end",
"title": ""
},
{
"docid": "dc9644a6e2be28e90688189f065e1ec8",
"score": "0.8886464",
"text": "def singularize(word)\n Eng... |
1a51d7a9d2dc8c0094b53d308c90c105 | name for this podling, originally from the resource attribute in podlings.xml. | [
{
"docid": "99590d7cc7bf9d98bd8827e81dba8aa6",
"score": "0.0",
"text": "def name\n @resource\n end",
"title": ""
}
] | [
{
"docid": "80d60f5351f07eabe632377f1d45b4d1",
"score": "0.6757119",
"text": "def name\n @name ? @name : @name = Hpricot.XML(self.xml).at(:list).at(:name)\n end",
"title": ""
},
{
"docid": "616d0a47df20e9cdc78e0ab89d486a95",
"score": "0.66847986",
"text": "def name\n @... |
46dbb99ea09a3ba12881c29a68c7f296 | DELETE /p7_scaffolds/1 DELETE /p7_scaffolds/1.json | [
{
"docid": "d2d3536431b0cbb908ef5c42f605992d",
"score": "0.7824621",
"text": "def destroy\n @p7_scaffold.destroy\n respond_to do |format|\n format.html { redirect_to p7_scaffolds_url, notice: 'P7 scaffold was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",... | [
{
"docid": "3ad33955a52ca6b7e9ce799378923b05",
"score": "0.7642495",
"text": "def destroy\n @scaffold = Scaffold.find(params[:id])\n @scaffold.destroy\n\n respond_to do |format|\n format.html { redirect_to scaffolds_url }\n format.json { head :no_content }\n end\n end",
"title... |
c36ba09961bb7ae273c01f3236133ef3 | and returns the sum of its digits. Examples: puts sum(23) == 5 puts sum(496) == 19 puts sum(123_456_789) == 45 The tests above should print true. For a challenge, try writing this without any basic looping constructs (while, until, loop, and each). PEDAC: Understand the Problem: > Input: one positive integer > Output: ... | [
{
"docid": "2df0a5faa598b2d73bc8c243d23c962e",
"score": "0.745045",
"text": "def sum(integer)\n integer.digits.sum\nend",
"title": ""
}
] | [
{
"docid": "957d31fbed7aecf093fa1273bb878d30",
"score": "0.77173764",
"text": "def sum(integer)\n digits = integer.to_s.chars.map {|x|x.to_i}\n total = digits.reduce(0) {|sum,x| sum += x}\n #integer.to_s.chars.map(&:to_i).reduce(&:+)\nend",
"title": ""
},
{
"docid": "0b83338d748f11286aded... |
0675f08799f29276246bc15bbd3d19cc | POST /product_types POST /product_types.json | [
{
"docid": "8733b61695b3d597c92b218e287db7bb",
"score": "0.6816006",
"text": "def create\n @product_type = ProductType.new(product_type_params)\n\n respond_to do |format|\n if @product_type.save\n if !@categories = params[:product_types].nil?\n @categories = params[:product_ty... | [
{
"docid": "62affa86d6fbf012a8c8f5b3dcbd3040",
"score": "0.7164354",
"text": "def create\n if ! canedit\n redirect_to :action => 'list'\n end\n @product_type = ProductType.new(params[:product_type])\n product = Product.find(params[:product_type][:product_id])\n @product_type.product ... |
17cb5764dd946606afcdb6e19a033bb8 | Only works with RSpec 3.2.0 | [
{
"docid": "ea19628d6a09c13a3a5064600e695c8f",
"score": "0.0",
"text": "def supported?\n TestProf::Utils.verify_gem_version('rspec-core', at_least: '3.2.0')\n end",
"title": ""
}
] | [
{
"docid": "072514f3348fe62556dcdfd4b06e3d08",
"score": "0.79284966",
"text": "def spec; end",
"title": ""
},
{
"docid": "072514f3348fe62556dcdfd4b06e3d08",
"score": "0.79284966",
"text": "def spec; end",
"title": ""
},
{
"docid": "072514f3348fe62556dcdfd4b06e3d08",
"... |
1bb8fb3f5e4ded33c625bfc9b4bc771a | is this method obsolete? can't find where it is being used | [
{
"docid": "131686df2a18e5c1b5e951aeffd72605",
"score": "0.0",
"text": "def compare_forecasts\n @all_tsd_files = JSON.parse(open('http://readtsd.herokuapp.com/listnames/json').read)['file_list']\n end",
"title": ""
}
] | [
{
"docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1",
"score": "0.8176522",
"text": "def private; end",
"title": ""
},
{
"docid": "530e65cba197567f73b8125444ac33cc",
"score": "0.69297254",
"text": "def private_method\n end",
"title": ""
},
{
"docid": "6a6ed5368f43a25fb9264e... |
b129287db91b3acb11a8a15ca7492574 | POST /eventos POST /eventos.json | [
{
"docid": "8be3caf9afaa95687b4c8790121e4ce7",
"score": "0.0",
"text": "def create\n retorno = {erro: \"333\", body:\"\"}\n @evento = Evento.new(@request_hash)\n #verifica se usuario tem privilegio\n if Evento.autentica_usuario(params[:usuario_id])\n if @evento.valid?#valida evento antes ... | [
{
"docid": "8beb709b44028dcb6cde70ea2be23fa3",
"score": "0.68183184",
"text": "def create\n megam_rest.post_events(to_hash)\n end",
"title": ""
},
{
"docid": "806d4b9cd66a3cef7fd8b561200b1b16",
"score": "0.676357",
"text": "def test_should_create_event_via_API_JSON\... |
9d5e1f13a2d70a885fb3cabf9d08b942 | A language id, like `typescript`. | [
{
"docid": "c0b4826923e8bc278de68acb665e37a5",
"score": "0.0",
"text": "def language\n attributes.fetch(:language)\n end",
"title": ""
}
] | [
{
"docid": "6be92fc3fd60ebbd699646b81c8b5674",
"score": "0.73219055",
"text": "def language_id(language_name)\r\n return Language.find_by_english_name(language_name).id\r\n end",
"title": ""
},
{
"docid": "9a8820e3ee1b74f11e3c035a725feb76",
"score": "0.7276225",
"text": "def lang... |
29a6e36ab12911e0da15cf02384573b8 | According to the region, is this number input trying to dial out? | [
{
"docid": "596073f6619665fd167d8f379c72d56a",
"score": "0.62401605",
"text": "def dialing_out?(string, region=nil)\n region ||= PhoneNumber.default_region\n !get_dialout_prefix(string, region).empty?\n end",
"title": ""
}
] | [
{
"docid": "8ac09576f146d0f98dca0674acd96475",
"score": "0.658736",
"text": "def input_number\n puts \"Please enter your phone number. It should not have 1 or 0\"\n number = gets.chomp\n phone_validity(number)\n end",
"title": ""
},
{
"docid": "9ea135887539004f3c921d5b3a72e... |
2bd46407ebce45403f5bf4e37a823f11 | DELETE /admin/stores/1 DELETE /admin/stores/1.json | [
{
"docid": "8211d07e497ea5540708371ac170979a",
"score": "0.7936961",
"text": "def destroy\n @admin_store = Admin::Store.find(params[:id])\n @admin_store.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_stores_url }\n format.json { head :no_content }\n end\n end... | [
{
"docid": "40952bc6a453dfc59cc1c2bd20e61c42",
"score": "0.78560346",
"text": "def destroy\n @store = Store.find(params[:id])\n @store.destroy\n\n respond_to do |format|\n format.html { redirect_to '/stores/admin' }\n format.json { head :no_content }\n end\n end",
"title": ""
... |
7839ddd1863f749a5dba2063d2802a8b | Like each_line, but removes trailing \n | [
{
"docid": "44d562ef1d085c223eeecf50221cd332",
"score": "0.76224846",
"text": "def each_chomped\n each_line { |line| yield line.chomp }\n end",
"title": ""
}
] | [
{
"docid": "3f9cc6e5bc351ab0ed6763c32577fbc8",
"score": "0.7078783",
"text": "def remove_lines(text)\n text.gsub(/\\n/, '')\n end",
"title": ""
},
{
"docid": "6483f7d86f9d0a6e1257af35d489f906",
"score": "0.7034689",
"text": "def clear_lines lines\n lines = lines.map do |line... |
515f2eefb07ecd5a3489453a10e6b735 | ++ setup new VehicleManager. _conf_ :: configulation for VehicleManager. | [
{
"docid": "adb66cb6becc10b4ca9de523d98c7c3b",
"score": "0.8658063",
"text": "def setupVehicleManager(conf = {})\n managerConf = getConf(:vehicleManagerConf).dup.update(conf) ;\n managerConf[:vehicleConf].update(getConf(:vehicleConf)) ;\n managerConf[:traciClient] = @traciClient ;\n ... | [
{
"docid": "693af04f8a9734889c2346b1844aba30",
"score": "0.7665662",
"text": "def initialize(conf = {})\n conf[:vehicleManagerConf] =\n (conf[:vehicleManagerConf].nil? ?\n DefaultVehicleManagerConf :\n DefaultVehicleManagerConf.dup.update(conf[:vehicleManagerConf])) ;\n ... |
5fcf480dec36eaffc830b895385944bb | Return an instance of the "best" available pager class `SystemPager` if possible, `SimplePager` if `SystemPager` isn't available, and `NullPager` if the user has disabled paging. All pagers accept output with `puts`, `print`, `write`, and `<<`. You must call `close` when you're done writing output to a pager, and you m... | [
{
"docid": "54655af64db43346779aa76bcd63cb11",
"score": "0.78147024",
"text": "def best_available\n if !_pry_.config.pager\n NullPager.new(_pry_.output)\n elsif !SystemPager.available? || Helpers::Platform.jruby?\n SimplePager.new(_pry_.output)\n else\n SystemPager.ne... | [
{
"docid": "629baf24bc8e4cf5ac32c10184f1504e",
"score": "0.7826607",
"text": "def best_available\n if !_pry_.config.pager\n NullPager.new(_pry_.output)\n elsif !SystemPager.available? || Pry::Helpers::BaseHelpers.jruby?\n SimplePager.new(_pry_.output)\n else\n SystemPager.new(_pr... |
aac8f38ad725e339fbcd981d64e8b223 | runs verification for container network attachment Params: ++_zone_name++: Name of zone ++networks++: Array of networks names, what to attach ++appgroup_name++: Name of appgroup ++appgroup_entry++: appgroup hash ++target_dir++: project target dir Returns [Bool] true if appgroup setup is ok | [
{
"docid": "ec3d69715f6848b6f41ac740359f3f9d",
"score": "0.62548363",
"text": "def handle_network_attachments(_zone_name, networks, appgroup_name,\n appgroup_entry, target_dir)\n # query container ids of containers running here\n # get path\n controller_e... | [
{
"docid": "7c5c071f437bf88ddfd030c8c10a937e",
"score": "0.5604803",
"text": "def networks_attached_to_zones?\n objects_attached_to_zones? 'networks'\n end",
"title": ""
},
{
"docid": "1ff3947b81c2f963c069138761bc0eb7",
"score": "0.5566177",
"text": "def attach_new_network?(n... |
35f137d0e1cb65078031987a03b8f87f | returns a copy of the game object so animations aren't shared | [
{
"docid": "6d2537031c2667c54e9f580896f78ba0",
"score": "0.82099444",
"text": "def copy\n GameObject.new(@animation.dup, @pos.dup)\n end",
"title": ""
}
] | [
{
"docid": "ea0ff92798f04ea23e45d318b5e9c786",
"score": "0.6454238",
"text": "def make_clone\n sprite = Sprite.new(self.viewport)\n sprite.bitmap = self.bitmap.dup\n sprite.x = self.x\n sprite.y = self.y\n sprite.z = self.z\n sprite.ox = self.ox\n sprite.oy = self.oy\n sprite.opa... |
eb2b4a38397c9b670bccf396527eee2a | Parse the options that we care about in the wrapper | [
{
"docid": "fe7e15302955c219a1c447b38976599e",
"score": "0.71898127",
"text": "def _parse_opts\n # Define the subset of coopr-runner.rb options that we care about here in the wrapper\n op = OptionParser.new do |opts|\n opts.on('-a', '--action ACTION', '\"create\", \"reconfigure[-w... | [
{
"docid": "b5ce49b5a2c9556839d13856f49711d3",
"score": "0.7891553",
"text": "def parse_options(options); end",
"title": ""
},
{
"docid": "64387b49ac4941dcaaa52168e56a52e5",
"score": "0.75744987",
"text": "def _process_options(options); end",
"title": ""
},
{
"docid": "64... |
bdb0c8a0b9ec59f303619b4f81a47924 | Run calculation for all operators, two req types, all zones Options: You can limit operators calculation using op_ids: [2,41] You can limit req_type calculation using req_types: :ene | [
{
"docid": "3abb719259783a77e6b48e73232cc09d",
"score": "0.7494934",
"text": "def calculate(options={})\n options = { op_ids: operator_ids, req_types: REQ_TYPES }.merge(options)\n options[:req_type] = [options[:req_type]] if !options[:req_type].is_a? Array\n\n options[:op_ids].each do |op... | [
{
"docid": "9e5dfc81a1fadf4de233599070037990",
"score": "0.596921",
"text": "def calculate(starting_value, operations)\n sum = starting_value\n operations.each do |ops|\n operator = ops[0]\n operand = ops[1]\n \n case operator\n when '+'\n sum += operand \n when '-'\n ... |
47f9c00a990ca3b3adb9cc4c0db8fe28 | Check if (and by how much) unit knows about target. ==== Description If unit is vehicle, vehicle commander is considered ==== Syntax Number = unit knowsAbout target ==== Parameters +unit+ Object or Group +target+ Object ==== Returns Number (from 0 to 4) ==== Multiplayer Although the command works only properly if unit ... | [
{
"docid": "78383c72791f5c8be4262604c6c37a6e",
"score": "0.0",
"text": "def knowsAbout _obj, _args\n \"_obj knowsAbout _args;\" \n end",
"title": ""
}
] | [
{
"docid": "6383d61be03a1a36ba9bb1d9842b6573",
"score": "0.54360026",
"text": "def target_hk_enabled?(target_name, timeout = 10)\n\n counter = get_tlm_cnt(\"#{target_name.upcase}\", \"#{target_name.upcase + HK_PACKET_SUFFIX}\")\n wait_check_expression(\"get_tlm_cnt(\\\"#{target_name.upcase}\\\", \... |
56413ec350755f7ed7df3cbf28c277be | =============================================================================== Like procs, lambdas are objects With the exception of a bit of syntax and a few behavioral quirks, lambdas are identical to procs =============================================================================== Instruction ==================... | [
{
"docid": "d929ce58acb8f3c23a16a3aafd2a96b6",
"score": "0.7104949",
"text": "def lambda_demo(a_lambda)\n puts \"I'm the method!\"\n a_lambda.call\nend",
"title": ""
}
] | [
{
"docid": "18a3f3d239fc601651080b4b11633511",
"score": "0.7709053",
"text": "def lambda_greeter\n brake = -> { return }\n p 'Hello, #Pivorak Student'\n brake.call\n p 'You will be professional soon'\nend",
"title": ""
},
{
"docid": "0190890ecf2172d2578493635fa8653c",
"score": "0.744... |
94e7e6c9c0641d5e76e054eec2e919ae | New method : Setup Targets flip [:target_flip,] | [
{
"docid": "fbdd137d9f3af90a8de88903caec6a77",
"score": "0.7985909",
"text": "def setup_targets_flip\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n if area_flag\n target_array.each do |target|\n target.flip = @acts[1]\n end\n return\n end\n target.... | [
{
"docid": "b50b68f9efdfae4efbb15e877fc9f9aa",
"score": "0.82437146",
"text": "def setup_targets_flip\n return unless PONY::ERRNO::check_sequence(current_act)\n current_actions_targets.each do |target|\n target.flip = @acts[1]\n end\n end",
"title": ""
},
{
"docid": "2ea768777... |
70c323d2d93f9464e4eded9a2ce92a3e | Get reads one AccountGrant by ID. | [
{
"docid": "c928a9ffcf1027e0a64580ee92ffe208",
"score": "0.7275923",
"text": "def get(\n id,\n deadline: nil\n )\n req = V1::AccountGrantGetRequest.new()\n if not @parent.snapshot_time.nil?\n req.meta = V1::GetRequestMetadata.new()\n req.meta.snapshot_at = @parent.sn... | [
{
"docid": "477ebdc35137fef1852cb8e68682f5a7",
"score": "0.67612106",
"text": "def get(\n id,\n deadline: nil\n )\n return @account_grants.get(\n id,\n deadline: deadline,\n )\n end",
"title": ""
},
{
"docid": "b2362533fd84bc9f5496... |
730b0ca7df5f66da332af82a6a0f23fe | CHECKS TO SEE IF THE HERO IS CURRENTLY TAKING DAMAGE | [
{
"docid": "3cd26f606694b103c37b322ce590fbb3",
"score": "0.60082066",
"text": "def taking_damage?\n if warrior.health < health\n true\n else\n false\n end\n end",
"title": ""
}
] | [
{
"docid": "86b461f4c9c9f93bd26d9f058300e132",
"score": "0.6914907",
"text": "def damaged?\n (status == DAMAGED)\n end",
"title": ""
},
{
"docid": "86b461f4c9c9f93bd26d9f058300e132",
"score": "0.6914907",
"text": "def damaged?\n (status == DAMAGED)\n end",
"title": ""
}... |
2bd90428cea982d88828b458f372864c | Returns the names or positions and their corresponding values as an array of arrays. | [
{
"docid": "9ce6bd3bd5119359bba320265e606f00",
"score": "0.0",
"text": "def pairs\n keys.zip values\n end",
"title": ""
}
] | [
{
"docid": "6448379a2ff99c93f2e10e61e6821160",
"score": "0.6804728",
"text": "def to_ary\n [name, value, line, column]\n end",
"title": ""
},
{
"docid": "8af6130a822fe828f72918d7f19619e0",
"score": "0.67735773",
"text": "def values\n to_a.transpose\n end",
"title": ""... |
0c6077a38e6fab71fe8726d229cff05c | Returns a Rack::Request from rack_env (if rack_env was given). | [
{
"docid": "acfb1c3e5b53ecdd67d4f60463ec19af",
"score": "0.80621696",
"text": "def request\n if rack_env\n @request ||= Rack::Request.new(rack_env)\n end\n end",
"title": ""
}
] | [
{
"docid": "79d168eb305d4b2097f4b6489b569a00",
"score": "0.8812844",
"text": "def parse_env_into_request(rack_env)\n Rack::Request.new(rack_env)\n end",
"title": ""
},
{
"docid": "b58dd5e0074a4a7f851ef611b0d42f8b",
"score": "0.84734094",
"text": "def rack_request\n @rack_req... |
10fd7359dbcbb93e9d2a7e352fd3ea39 | Create new data nop Handles a couple of input modes. | [
{
"docid": "3c10aac209af7722e2ad2120373004c6",
"score": "0.5149291",
"text": "def initialize(data, mod = false, mode = :default)\n @label = false\n @ready = true\n @mod = mod\n case data\n when Symbol\n raise DataError, 'Unimplemented mode' unless [:default, :label].membe... | [
{
"docid": "13c92c5416e846a2a5035b32dc220f7e",
"score": "0.57688165",
"text": "def create(opts)\n opts = check_params(opts,[:modes])\n super(opts)\n end",
"title": ""
},
{
"docid": "962eefd7a58b8f17308d5d3f019bbb39",
"score": "0.5190186",
"text": "def create_empty_data_s... |
930f0e07fd6c0dce6906990819558bc6 | Take a snapshot of the frame before the last Graphics.update | [
{
"docid": "3fe8626298d941721e854521e8c60995",
"score": "0.0",
"text": "def snap_to_bitmap\n end",
"title": ""
}
] | [
{
"docid": "b03f9bec34fdad3a0596af377e4ce673",
"score": "0.6891514",
"text": "def update \n\t\t# determine if we need to go next frame\t\n\t\t\tif Clock.runtime - @last_frame_time > @frame_delay_ms then\n \t\t@current_frame += 1\n \t\t@last_frame_time = Clock.runtime\n\t\tend\n \tif @current_frame >=... |
b07bad1c45d0ed01184c5c3bfd28141c | PATCH/PUT /personal/1 PATCH/PUT /personal/1.json | [
{
"docid": "2cde80c94c423581841a82a1c35188d6",
"score": "0.72018266",
"text": "def update\n respond_to do |format|\n if @personal.update(personal_params)\n format.html { redirect_to @personal, notice: 'Personal was successfully updated.' }\n format.json { head :no_content }\n ... | [
{
"docid": "69806a6e697ccbff479bdd61820cd88f",
"score": "0.7091059",
"text": "def update\n respond_to do |format|\n if @personal.update(personal_params)\n format.html { redirect_to @personal, notice: 'Personal was successfully updated.' }\n format.json { render :show, status: :ok, ... |
753a6c4ad646648313f93ff9777f544d | GET /orders/1 GET /orders/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "23052f52af86f70778b67e0afeeea3d4",
"score": "0.75530136",
"text": "def getorders(args={})\n {\n :method=> \"GetOrders\"\n }.to_json\n end",
"title": ""
},
{
"docid": "45d40d4eb7c605b195ee60f1fcb2b6ab",
"score": "0.74891937",
"text": "def index\n @or... |
12f3a67b4297370d71dcd706be75df75 | Public: Enter a Cell into the Distances list. cell A Cell to be recorded. dist The distance from the root Cell to the current Cell. | [
{
"docid": "a234b8b57c8bff8af8a29e4bd2ec4c12",
"score": "0.68797207",
"text": "def []= cell, dist\n\t\t\t@cells[cell] = dist\n\t\tend",
"title": ""
}
] | [
{
"docid": "07e78fddf15ef64ccab82044d30c3739",
"score": "0.5641862",
"text": "def << (cell)\n cell.associate_to_list(self)\n @cells << cell\n self\n end",
"title": ""
},
{
"docid": "7254ccb13f1bfbee94a8a0a35ece8832",
"score": "0.54759425",
"text": "def addCell(cell)\n @c... |
1b4dc0f5c4571ad7f3176532a1633cad | Returns an escape sequence to position the cursor and set its visibility. When passed a block, will position the cursor, yield and return the original position. | [
{
"docid": "b8d0d33f2a417ba07fd64a0dfbb97f38",
"score": "0.58247787",
"text": "def to_s(&block)\n return escape_sequence.to_s unless block_given?\n\n \"#{position}#{yield}#{escape_sequence}\"\n end",
"title": ""
}
] | [
{
"docid": "006ff16fc526587993260ef0fc37a3ee",
"score": "0.6615412",
"text": "def block_cursor(offset)\n BufferCursor.new(block_data(offset), 0)\n end",
"title": ""
},
{
"docid": "2cfc485ca272c39fdbd2083827dd6232",
"score": "0.6538715",
"text": "def block_cursor(offset)\n Bu... |
b4041db97faba39278037fa847553362 | return the third greatest number in the array. You may assume that the array has at least three numbers in it. Difficulty: medium. | [
{
"docid": "cb3813a22689a6f90eb5d4987b3f7f02",
"score": "0.816278",
"text": "def third_greatest(nums)\n\n\t#first method\n\t\t#sort the numbers highest to lowest\n\t\t#return value in index 2\n\n\t#second method\n\t\t#Iterate array through end\n\t\t#keep track of 3 highest values\n\n\n\n\t#first method.... | [
{
"docid": "8685b3e82c1b30d90599f3edd82a3a71",
"score": "0.87194866",
"text": "def third_greatest(array)\n array.sort[-3]\nend",
"title": ""
},
{
"docid": "caaa5ad02162b3b2f2e1115ed13f06d5",
"score": "0.86920625",
"text": "def third_greatest(nums)\n\t# If can use Array#sort:\n\t# so... |
938e31c6f8c29400d57df900a84687df | The run method takes the name of a binary to run, the arguments to that binary, the values to interpolate and some local options. :cmd > The name of a binary to run. :arguments > The command line arguments to that binary. :interpolation_values > Values to be interpolated into the arguments. :local_options > The options... | [
{
"docid": "0e08d943092be455c8474e16b980adff",
"score": "0.68210685",
"text": "def run(cmd, arguments = \"\", interpolation_values = {}, local_options = {})\n command_path = options[:command_path]\n terrapin_path_array = Terrapin::CommandLine.path.try(:split, Terrapin::OS.path_separator)\n ... | [
{
"docid": "ad478c10696763ccebd247665135c247",
"score": "0.63872635",
"text": "def run\n\t\tparse_options(@args)\n\t\tprocess_command\n end",
"title": ""
},
{
"docid": "a8318f102db59f9b055306264026941f",
"score": "0.63414925",
"text": "def run\n options.parse @args\n end",
... |
2b962749bd6f2e756bcb8c6ae54d167e | Returns true if the record has persisted. | [
{
"docid": "8b14c6ca65edcfe6615094f20e35a62a",
"score": "0.8510969",
"text": "def persisted?\n @persisted\n end",
"title": ""
}
] | [
{
"docid": "fbe27fec752ecc5116079f6e2af5883e",
"score": "0.88099223",
"text": "def persisted?\n records.persisted?(id)\n end",
"title": ""
},
{
"docid": "0528aceb7ebd2226fff4402c6ae24ff9",
"score": "0.87209284",
"text": "def persisted?\n sync_with_transaction_state\n ... |
49df0586cefa29c378b8401e642a464b | POST /committee_types POST /committee_types.json | [
{
"docid": "084ff07d2f1f5c33342e11aaad6dd19b",
"score": "0.6889416",
"text": "def create\n @committee_type = CommitteeType.new(committee_type_params)\n\n respond_to do |format|\n if @committee_type.save\n format.html { redirect_to @committee_type, notice: 'Committee type was successful... | [
{
"docid": "473828e6fd9193d05fd839060cbcd26a",
"score": "0.6727415",
"text": "def committee_type_params\n params.require(:committee_type).permit(:comtype)\n end",
"title": ""
},
{
"docid": "ad00d903691dfe0595fc62b33188479e",
"score": "0.6667146",
"text": "def index\n @comm... |
5d854f8b2d99148aa0c40d53a9f97ac2 | Find List of OrderLineItem Return multiple instances of OrderLineItem by its attributes. | [
{
"docid": "0722504210abf83abc8a8f67f5634224",
"score": "0.60706496",
"text": "def find_all_by(opts = {})\n list_all_order_line_items(opts)\n end",
"title": ""
}
] | [
{
"docid": "023395412e4809664f62130031f065b0",
"score": "0.5904448",
"text": "def get_line_items(order, taxes_included=nil)\n items=[]\n if order.line_items != nil\n order.line_items.each do |line_item|\n new_item=Invoicexpress::Models::Item.new(\n :name => line_item... |
568d568c50ce1a3294ac904da95284f9 | Add text at the beginning of the body of the issue | [
{
"docid": "920c5e8a3fbc2ed896743ac78d320545",
"score": "0.8229114",
"text": "def prepend_to_body(text)\n @issue_body = text + issue_body\n update_issue({ body: @issue_body })\n end",
"title": ""
}
] | [
{
"docid": "6498255b82ef858d674c2da8473f37b6",
"score": "0.6842575",
"text": "def append_to_body(text)\n @issue_body = issue_body + text\n update_issue({ body: @issue_body })\n end",
"title": ""
},
{
"docid": "f3101046d857690e2fa3fbdcdb0bdbf5",
"score": "0.683554",
"text": "de... |
d183168c4b5057487e016da3daae4266 | GET /homes/1 GET /homes/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "4647ae4659387d0b6a5fbab629456ec0",
"score": "0.742536",
"text": "def index\n @homes = Home.all\n render :json => @homes\n \n end",
"title": ""
},
{
"docid": "be6896fee31b87d491c66110f347a804",
"score": "0.73635715",
"text": "def index\n @homes = Home.all\n\n ... |
17c381553d4f53b0fe06a7fb5e456ff3 | Determines if a given URL should be visited. | [
{
"docid": "b3cecf6b27f3bca82457ca870cf4571f",
"score": "0.80452263",
"text": "def visit?(url)\n !visited?(url) &&\n visit_scheme?(url.scheme) &&\n visit_host?(url.host) &&\n visit_port?(url.port) &&\n visit_link?(url.to_s) &&\n visit_url?(url) &&\n visit_ext?(ur... | [
{
"docid": "fcf0af58316c117540ca20d72423e1ee",
"score": "0.82890034",
"text": "def visited?(url)\n ! visited_page(url).nil?\n end",
"title": ""
},
{
"docid": "baa0f0970b701f4f5f6e36abc9008353",
"score": "0.7998916",
"text": "def should_visit?(url)\n if in_scope? url\n ... |
4f7b22c43ccce71fd4c8d83f302e8d92 | PATCH/PUT /bets/1 PATCH/PUT /bets/1.json | [
{
"docid": "f497818453a7251a641120c4d57accb7",
"score": "0.61485255",
"text": "def update\n respond_to do |format|\n if @bet.update(bet_params)\n format.html { redirect_to @bet, notice: 'Bet was successfully updated.' }\n format.json { head :no_content }\n else\n format... | [
{
"docid": "9fe12c4f0184ba4b2e0683b49382bc89",
"score": "0.66403574",
"text": "def update\n @beet = Beet.find(params[:id])\n\n respond_to do |format|\n if @beet.update_attributes(params[:beet])\n format.html { redirect_to @beet, notice: 'Beet was successfully updated.' }\n forma... |
0cf5781311d472d32875af21e92fd755 | GET /spaces GET /spaces.json | [
{
"docid": "0952a447e041ee746e1b8f19dd98b3f8",
"score": "0.0",
"text": "def index\n \t@rss = Space.find(:all, :order => 'created_at DESC')\n @spaces = @rss.paginate(:page => params[:page], :per_page => 9)\n #p = Space.where([\"created_at <= :end_date\", {:end_date => \"2012-05-28 00:00:00 UTC\" }... | [
{
"docid": "57cd3b24dc29f9bfaab076f5b07eddad",
"score": "0.7858216",
"text": "def index\n @spaces = Space.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @spaces }\n end\n end",
"title": ""
},
{
"docid": "57cd3b24dc29f9bfaab076f5... |
bb965d632ed57cd30e6ab1fb874ccc7e | Read a DeploymentZone Read a Deployment Zone. This is a deprecated API. DeploymentZone has been renamed to Site. Use GET /infra/sites/siteid. | [
{
"docid": "12ccfd89c30ecb37ac35c94b1e1a1795",
"score": "0.5711509",
"text": "def read_deployment_zone_infra_0(deployment_zone_id, opts = {})\n data, _status_code, _headers = read_deployment_zone_infra_0_with_http_info(deployment_zone_id, opts)\n data\n end",
"title": ""
}
] | [
{
"docid": "8c6ae87168ac744bf5224d9797000830",
"score": "0.6207084",
"text": "def get_zone(zone_id)\n request(\n :expects => 200,\n :method => 'GET',\n :parser => Fog::Parsers::DNS::Bluebox::GetZone.new,\n :path => \"/api/domains/#{zone_id}.x... |
e83b67ec9d9006af60410da01c5e9e4b | return all possible win combinations in the board | [
{
"docid": "d705362642755242e731408dad6c6c2d",
"score": "0.7810151",
"text": "def win_combinations\r\n split_into_rows\r\n .concat(split_into_columns)\r\n .concat(split_diagonals)\r\n end",
"title": ""
}
] | [
{
"docid": "1b08e56c794d628f97ced0b37f78b220",
"score": "0.8333351",
"text": "def get_winning_combos(board)\n combos = WIN_COMBINATIONS.collect do |combo|\n if combo.count {|p| board.taken?(p) == true} == 2\n tokens = combo.collect {|p| board.position(p) if board.taken?(p)}\n ... |
e19f55d1a08822b08dc43075b83e777d | List system user binding Hidden as Tags is deprecated Adds or removes a system binding for a user. This endpoint is only used for users still using JumpCloud Tags. If you are using JumpCloud Groups please refer to the documentation found [here]( List system bindings for a specific system user in a system and user bindi... | [
{
"docid": "da1fe42a07f9f4667c55ef81c8d83ff9",
"score": "0.46944103",
"text": "def systemusers_systems_binding_list(id, content_type, accept, opts = {})\n data, _status_code, _headers = systemusers_systems_binding_list_with_http_info(id, content_type, accept, opts)\n return data\n end",
... | [
{
"docid": "10368b43a6f779898125652d941392f3",
"score": "0.5969746",
"text": "def get_user_tags username, password\n do_request 'get_user_tags', username: username, password: password\n end",
"title": ""
},
{
"docid": "91be5267070627b863004cedef7f6d2c",
"score": "0.5616276",
... |
6b57d3abaa50c5859416e5c8c4eedfca | with index N interate over indices of the Array run function to check left side sum run function to check right side sum compare the two, if equal, return the index if not equal, step to the next index if loop finishes, return 1 | [
{
"docid": "c024341dfde38d4376bb1fea5160958e",
"score": "0.0",
"text": "def compute_left_sum(arr, index)\n if index == 0\n return 0\n else arr[0..(index - 1)].sum\n end\nend",
"title": ""
}
] | [
{
"docid": "b36b79ae20858571e546d5aa2bc00daa",
"score": "0.7346401",
"text": "def equal_sides(array)\n array.each_with_index do |i, index| \n left_sum = 0 # have to reassign to 0 for each new siteration\n right_sum = 0\n if index == 0 # i at index 0\n right_sum = array[1..-1].sum\n l... |
5f906cf5b2bed62484d2c6576f44197e | Converts a list of syllables into their L/G weights. | [
{
"docid": "b7274575893a8970e14a9bfba61d236c",
"score": "0.74891895",
"text": "def syllables_weights(syllables, from: nil, contextual: false)\n from ||= Transliterate.detect(syllables.join(\"\")) || Transliterate.default_script\n syllables = syllables.to_ary.map { |syl| Transliterate.translite... | [
{
"docid": "e715214acdd25d0c97d4ae051c21b2b1",
"score": "0.64889556",
"text": "def syllables\n @pronunciations.map { |p| p.first.num_syllables }.inject(:+)\n end",
"title": ""
},
{
"docid": "4245fd98bb08ac57a80ae64567f3edc3",
"score": "0.64044356",
"text": "def adjusted_sylla... |
1999e878b93ecc2ee7e51ec089723584 | Escapes control characters in +data+ | [
{
"docid": "6e43d9d0653fa3bb3e7010e5beb2d5fd",
"score": "0.7964233",
"text": "def escape(data)\n data = data.gsub(/[[:cntrl:]\\\\]+/) {$&.dump[1...-1]}\n data.untaint if RUBY_VERSION < '2.7'\n data\n end",
"title": ""
}
] | [
{
"docid": "ef14545d9d585c4e2be1a9eeaa59f0c5",
"score": "0.71790963",
"text": "def escape_control_chars!(string)\n string.gsub!(CONTROL_CHARACTERS) do |character|\n UTF8Encoding::REPLACEMENT_SCHEME[character]\n end\n string\n end",
"title": ""
},
{
"docid": "7734b04f... |
100e0d678469ba4ed97697f199c070cd | GET /requests GET /requests.json | [
{
"docid": "e62c09076a765119475351ae42ddeab1",
"score": "0.0",
"text": "def index\n @requests = Request.all.paginate(page: params[:page], per_page: 15)\n end",
"title": ""
}
] | [
{
"docid": "ff35d8a60fdbaad33b71eebbd3c9889b",
"score": "0.71195513",
"text": "def index\n @requests = Request.all\n\n render json: @requests\n end",
"title": ""
},
{
"docid": "cc1985fd610ad530de1d9e3afb35c84c",
"score": "0.6854284",
"text": "def index\n @requests = Request... |
ac1c9f4b6caccd0bbba035f0e27d0ca3 | PATCH/PUT /participantes_minuta/1 PATCH/PUT /participantes_minuta/1.json | [
{
"docid": "5f4523ac76cdd4d48644d7e076641d30",
"score": "0.7165455",
"text": "def update\n respond_to do |format|\n if @participantes_minutum.update(participantes_minutum_params)\n format.html { redirect_to @participantes_minutum, notice: 'Participantes minutum was successfully updated.' ... | [
{
"docid": "74387386cdbeeeff16e49f826e65d0f8",
"score": "0.6766289",
"text": "def update\n @participant = Participant.find(params[:id])\n\n respond_to do |format|\n if @participant.update_attributes(params[:participant])\n format.html { redirect_to @participant, notice: 'Participant wa... |
a83abbf977c7334c6b21a04f85897182 | a list of files that we can parse for testing | [
{
"docid": "5f7c41135eb7e18f9525c32dc72f6307",
"score": "0.0",
"text": "def textfiles\n textdir = datadir \"snippets\"\n Dir.entries(textdir).reject { |f|\n f =~ /^\\./ or f =~ /fail/\n }.each { |f|\n yield File.join(textdir, f)\n }\n end",
"title": ""
}
] | [
{
"docid": "2b85ff75e0be7d855bf8114fccc65149",
"score": "0.7455231",
"text": "def parse_files(*files); end",
"title": ""
},
{
"docid": "86860f211d8d52cfcbaeef28e7c5f7e3",
"score": "0.7369954",
"text": "def files\n result = []\n @my_files.each do |f|\n result << f.fname if ... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "a3e7ad6c7f20debab6d3631ce850d83e",
"score": "0.0",
"text": "def set_event_property_map\n @event_property_map = EventPropertyMap.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.6032574",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6015663",
"text": "def... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "89d8e7b7eeca953d62439c10e187d0cc",
"score": "0.0",
"text": "def order_params\n order_hash = params.require(:order).permit(:address_id, :user_id, :cod_money, :shipping_money, :payment_gateway, :admin_user_id, :invoice_id, :note, :coupon_code, deliver_time: [:start_time, :end_time], presc... | [
{
"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... |
90e3ffd3b47cd8add0ae1d3b94a79adc | Submits an order. You will get a validation error if the order has already expired (and a new quote could not be automatically recreated for a lower or same price). This method is idempotent submitting an order a second time has no effect. | [
{
"docid": "2fb0868fe55430e58b666f29c16c1863",
"score": "0.0",
"text": "def put_submissions_by_number(organization, number, order_submission_form, incoming={})\n HttpClient::Preconditions.assert_class('organization', organization, String)\n HttpClient::Preconditions.assert_class('n... | [
{
"docid": "29bfd29071115948846f8c6ff4d210c4",
"score": "0.7290351",
"text": "def order_submit(order)\n execute 'api/submit',\n build_json({\n order: order\n })\n end",
"title": ""
},
{
"docid": "6039e426a7ddb27ef83856f131446dac",
"score": "0.6620714",
... |
78d7c57b56952929fa987d98550075cf | A helper class for printing out ASTs. Prints both the "generic" and "specific" AST of a certain PALISP program. | [
{
"docid": "76d091bd5a1a487595b37e29340d5cd7",
"score": "0.0",
"text": "def with_generic_parser(file)\n file = File.open(file)\n parser = GenericParser.new(Scanner.new(file))\n yield(parser)\n file.close\nend",
"title": ""
}
] | [
{
"docid": "df0afb88196e23f474db92a167db4a28",
"score": "0.67061394",
"text": "def show\n output = []\n header = show2(@ast, '', output)\n output << header\n src, value = @results[ast]\n if src.nil?\n pp = PrettyPrinter.new(Printer.new(2))\n pp.print(... |
b561e39d9d57b4f5c9b76cf08fefc0e5 | POST /kaki_limas POST /kaki_limas.json | [
{
"docid": "57a5a9b8ce3b95a5b37a4ae224934c12",
"score": "0.6645221",
"text": "def create\n @kaki_lima = KakiLima.new(kaki_lima_params)\n\n respond_to do |format|\n if @kaki_lima.save\n format.html { redirect_to @kaki_lima, notice: 'Kaki lima was successfully created.' }\n else\n ... | [
{
"docid": "acdb68ba5d39be387b680e6b3f0c6eeb",
"score": "0.6529312",
"text": "def create\n @limpeza = Limpeza.new(limpeza_params)\n\n respond_to do |format|\n if @limpeza.save\n format.html { redirect_to @limpeza, notice: 'Limpeza was successfully created.' }\n format.json { ren... |
4948c05b2a7a2003f4a8422a3c1eb46b | Public: Mail creation when a person is deleted person The Person object to sent the email deleled_person_name The String the person name just deleted deleted_person_email The String the person email just deleted Examples | [
{
"docid": "40f00b4a6b560faebbabcda47a77a611",
"score": "0.8480914",
"text": "def person_deleted(person, deleled_person_name, deleted_person_email)\n @person = person\n @deleted_person_email = deleted_person_email\n @deleled_person_name = deleled_person_name\n mail(\n to: @person.em... | [
{
"docid": "191837186abb2bd63a5aa49afb2642b1",
"score": "0.81317985",
"text": "def deleted_person(deleted_person,person)\n\t\t@deleted_person = deleted_person\n\t\t@person = person\n\t\tmail(to: @person[\"email\"], subject: 'People App - New person added')\n\tend",
"title": ""
},
{
"docid": ... |
fd1b2877fbb7d4a508db45d224e39862 | Construction de l'instance +win+ La fenetre de l'application | [
{
"docid": "5c0aee52ad58d5f44cc9234c6c3dd581",
"score": "0.670556",
"text": "def initialize(win)\n\n # init des composants\n\n @win = win\n @map = \"../Grilles/grille_chapitre1.txt\"\n @boite = Gtk::Fixed.new()\n container = Gtk::Box.new(:vertical)\n\n @retourMe... | [
{
"docid": "f761ae9d838c7dbb378f317a07d5f269",
"score": "0.67757183",
"text": "def initialize(win)\n @win = win\n\n boite = Gtk::Fixed.new()\n @layoutManager = Gtk::Box.new(:vertical)\n\n fleche = Gtk::Button.new(:label => \"\")\n demarrer = Gtk::Button.new(:label => \... |
14f0db71153a5365bed10fa91ec94e4a | This method collects all products created by the current signed in user Handles : when users click "my product list" under the draw down menu in header Renders : a list view of the products created by the current user+ > if the user has signed in already Redirects : root_url(home page) > if the user has not signed in y... | [
{
"docid": "0d49be46b1483771c068a37bc02104db",
"score": "0.7954162",
"text": "def list_my_products\n if signed_in?\n @products = Product.find(:all, :conditions => { :user_id => current_user.id} )\n @search = Hash.new\n render 'list_my_products'\n else\n redirect_to root_url\n ... | [
{
"docid": "80959099f6163b71b23b0dc326ac329f",
"score": "0.7529616",
"text": "def index\n @products = current_user.products\n end",
"title": ""
},
{
"docid": "80959099f6163b71b23b0dc326ac329f",
"score": "0.7529616",
"text": "def index\n @products = current_user.products\n end... |
4809ead9294a922fe431da5340788572 | Replace a tag on the registry with a dummy tag. This is a hack as the registry doesn't support deleting individual tags. This code effectively pushes a dummy image and assigns the tag to it. This way when the tag is deleted only the dummy image is affected. See for a discussion | [
{
"docid": "6ae30c8fe872c2cf21aaed2b19257684",
"score": "0.4579951",
"text": "def smart_delete(container_repository, tag_names)\n # generates the blobs for the dummy image\n dummy_manifest = container_repository.client.generate_empty_manifest(container_repository.path)\n\n # update ... | [
{
"docid": "8a8b26cbb2a5344b8eaaebb9e82383de",
"score": "0.5834051",
"text": "def replace_using(tag, string)\n Tags[tag][1] = string\n end",
"title": ""
},
{
"docid": "6a985f7b011a6d2219451df2a568afa9",
"score": "0.561457",
"text": "def do_tag(registry)\n docker_connection... |
6bf2294df38b34020cc8912db5ca2ae2 | PATCH/PUT /videoformats/1 PATCH/PUT /videoformats/1.json | [
{
"docid": "d9dda52bf4aebfd943198b5bf2748da7",
"score": "0.7335001",
"text": "def update\n respond_to do |format|\n if @videoformat.update(videoformat_params)\n format.html { redirect_to @videoformat, notice: 'Videoformat was successfully updated.' }\n format.json { render :show, s... | [
{
"docid": "f05fe289ab03dc43f153c88067216394",
"score": "0.7080925",
"text": "def update!(**args)\n @enabled_video_formats = args[:enabled_video_formats] if args.key?(:enabled_video_formats)\n @kind = args[:kind] if args.key?(:kind)\n end",
"title": ""
},
{
"docid": ... |
1ed3a3094357aa3b1637d7057a41eccc | Overwrite this method to define the scope of the list changes | [
{
"docid": "5ca8ac53f0d0540823ff2227a89984b3",
"score": "0.0",
"text": "def scope_condition() \"1\" end",
"title": ""
}
] | [
{
"docid": "73729f9342b7dba035367cceecee4f5e",
"score": "0.6339059",
"text": "def propagate_to_existing_lists=(value)\n @propagate_to_existing_lists = value\n end",
"title": ""
},
{
"docid": "48722a6712bcf6dbf02d8adf67901f0d",... |
4b36e283d1b515f126aba460c3dc5daf | DELETE /vehicle_card_acceptances/1 DELETE /vehicle_card_acceptances/1.json | [
{
"docid": "5121c2d39316e5fa277c6f13bd3abb18",
"score": "0.7472453",
"text": "def destroy\n @vehicle_card_acceptance.destroy\n respond_to do |format|\n format.html { redirect_to vehicle_card_acceptances_url, notice: 'Vehicle card acceptance was successfully destroyed.' }\n format.json { ... | [
{
"docid": "54b3dccb01be59823a90ba63407f2899",
"score": "0.7084463",
"text": "def destroy\n @vehicle.destroy\n render json: { status: true }\n end",
"title": ""
},
{
"docid": "b1a17c1ee1af05c79fe156622df44818",
"score": "0.7064588",
"text": "def delete(path)\n begin\n ... |
3097a105de5458baaf89943e4e504d2d | GET /footballs GET /footballs.json | [
{
"docid": "2551535a7b5abdcbd357207f697d5950",
"score": "0.69345117",
"text": "def index\n @footballs = Football.order('match_starts_at DESC').page(params[:page]).per(10)\n end",
"title": ""
}
] | [
{
"docid": "f473640355e44a5a3c6eb6519c849342",
"score": "0.73985857",
"text": "def index\n @footballs = Football.all\n end",
"title": ""
},
{
"docid": "df65d6629e77e04cd8107be2a0c47c36",
"score": "0.6774351",
"text": "def index\n @football_stats = current_user.football_stats\n... |
aa816d1e4ca95bc58a44b384f545d4d5 | Set some or all options at once. | [
{
"docid": "2e71d3c16cfc1320ec0823919cb22991",
"score": "0.6658885",
"text": "def set(options)\n parse_options options\n end",
"title": ""
}
] | [
{
"docid": "c7bb40c5aa7db8e373d6419f5ddd2c8a",
"score": "0.75443447",
"text": "def set(**options); end",
"title": ""
},
{
"docid": "c54cdb645405cbb8d3ec45f515f731ad",
"score": "0.7397238",
"text": "def set(options); end",
"title": ""
},
{
"docid": "c54cdb645405cbb8d3ec45f... |
eb5b249dcbb71d35d26f1dfcac0a46a2 | Captures $stdout and $stderr to StringIO objects and returns them. Restores $stdout and $stderr when done. Usage: def test_puts out, err = capture do puts 'hi' STDERR.puts 'bye!' end assert_equal "hi\n", out.string assert_equal "bye!\n", err.string end | [
{
"docid": "aa2443ff761b482e46730e8af25d1321",
"score": "0.77293766",
"text": "def util_capture\n require 'stringio'\n orig_stdout = $stdout.dup\n orig_stderr = $stderr.dup\n captured_stdout = StringIO.new\n captured_stderr = StringIO.new\n $stdout = captured_stdout\n ... | [
{
"docid": "87b17d8d8ebe9b7798f3f88415817011",
"score": "0.780249",
"text": "def util_capture\r\n require 'stringio'\r\n orig_stdout = $stdout.dup\r\n orig_stderr = $stderr.dup\r\n captured_stdout = StringIO.new\r\n captured_stderr = StringIO.new\r\n $stdout = captured_stdout\r\n $s... |
bb12544b3d7c609d207e07ac98c412ec | GET /theme1s GET /theme1s.json | [
{
"docid": "2c7b4895953452db4f0914a622fe87c7",
"score": "0.7580189",
"text": "def index\n @theme1s = Theme1.all\n end",
"title": ""
}
] | [
{
"docid": "7bf95c22c9436cf9385212f7a390e5c1",
"score": "0.77085996",
"text": "def index\n @themes = Theme.all\n json_response(@themes)\n end",
"title": ""
},
{
"docid": "f9e929ad7a0098a904d0bb6d55870752",
"score": "0.71080506",
"text": "def show\n @theme = Theme.find(params[... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "5194b22f61207803ce247e37078550a7",
"score": "0.0",
"text": "def set_customer\n @product =Customer.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60310465",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.60152966",
"text": "d... |
6fc5e3c0d93255a145d9748342f3a703 | RestrictedArray can be created using a specified size, or a random size in the range of 120 will be chosen for you. All values are integers in the range of 1221. RestrictedArray cannot be resized. Helper method provided to sort the array in ascending order Implements selection sort Time complexity = O(n^2), where n is ... | [
{
"docid": "f4a37af959030f429c99156492fb5fc1",
"score": "0.0",
"text": "def length(array)\n count = 0\n\n until array[count] == nil\n count += 1\n end\n\n return count\nend",
"title": ""
}
] | [
{
"docid": "61c6ae6daeb381b5fa365be105e72426",
"score": "0.6200231",
"text": "def selection_sort(array)\n # creates a copy of array and assigns it to a variable called sort\n sort = array.dup\n # creates an empty array called sorted\n sorted = []\n # until the length of sorted array equals the leng... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "7ea067c54d274088462fb1dca67d4142",
"score": "0.0",
"text": "def proveedor_params\n procesar_monto\n params.require(:proveedor).permit(:id, :nombre, :direccion, :numero_documento, :telefono, :limite_credito)\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.69792545",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6781151",
"text": "def strong_params\n params.requ... |
2a028a0b7c377dfdb599ddd3d9cea9be | POST /izakayas POST /izakayas.json | [
{
"docid": "ff6258554d170fb6c21ca27435aa1572",
"score": "0.67831355",
"text": "def create\n @izakaya = Izakaya.new(izakaya_params)\n\n respond_to do |format|\n if @izakaya.save\n format.html { redirect_to @izakaya, notice: 'Izakaya was successfully created.' }\n format.json { re... | [
{
"docid": "25c52cc62c2f2c415d295cf96de35a68",
"score": "0.65316904",
"text": "def create\n @zarizeni = Zarizeni.new(params[:zarizeni])\n\n if @zarizeni.save\n render json: @zarizeni, status: :created, location: @zarizeni\n else\n render json: @zarizeni.errors, status: :unprocessable_... |
da3ecd036e1a9325fdcf2bdcc931df8f | POST /employee_position_histories POST /employee_position_histories.json | [
{
"docid": "b4132c0dd23cd0db5edb4eb53ea55061",
"score": "0.72205174",
"text": "def create\n @employee_position_history = EmployeePositionHistory.new(params[:employee_position_history])\n\n respond_to do |format|\n if @employee_position_history.save\n format.html { redirect_to @employee... | [
{
"docid": "2dc997710827c6807f2e46341411d2f1",
"score": "0.7636779",
"text": "def create\n \n @employee_position_hist = EmployeePositionHist.new(params[:employee_position_hist])\n @employee_position_hist.salary = @employee_position_hist.position_number ? @employee_position_hist.position_number.... |
a45bff7cd171e3d7a922dd93116e75fe | Plugin API write squeezed history | [
{
"docid": "c92721cb61aa1b70a2185205e1feddca",
"score": "0.81532574",
"text": "def write_history\n return super if SqueezeHistory.disabled?\n config[:history] = squeezed_history\n super\n end",
"title": ""
}
] | [
{
"docid": "ba93d9bee86d0fe5e3f0db4842cbcfd7",
"score": "0.7253925",
"text": "def write_history\n return super if History.disabled?\n history_text = \"#{history.to_a.last(history_size).join(\"\\n\")}\\n\"\n File.write(history_file_path, history_text)\n end",
"title": ""
},
{
"docid... |
f322ce3d052b2870f063fa237b0f1246 | all the other methods are grouped here. the number of players determines which while loop is run | [
{
"docid": "ecf2ef75da39c00e26239c2a120a0734",
"score": "0.0",
"text": "def runner (state_array)\n # defining my public variables and hashes\n total_score = Hash[\"Player 1\" => 0, \"Player 2\" => 0]\n players = total_score.keys #[\"Player1\", \"Player2\"] \n total_score_one_player = Hash[\"Player 1... | [
{
"docid": "e73d0c70132b69f38a011dee4e66e7ac",
"score": "0.69465226",
"text": "def play_game\n while game_in_progress #while set num is not equal to set counters combined\n\n weapon_for_player_1 #ask for player 1's weapon and spell check\n weapon_for_player_2 #ask for player 2's weapon ... |
458f04b13aa654647122b837158936c3 | redefine your position_taken? method here, so that you can use it in the valid_move? method above. | [
{
"docid": "d849a9456f32e71d7ea07ec5bda74428",
"score": "0.0",
"text": "def position_taken? (board, indx)\n #notice errors with nil and .strip\n if board[indx]==nil\n false\n elsif board[indx].strip== \"\"\n false\n else\n true\n end\nend",
"title": ""
}
] | [
{
"docid": "f1b5882b1e94341642347a5613e1d1a2",
"score": "0.8491558",
"text": "def valid_move?(position)\n end",
"title": ""
},
{
"docid": "d2a173acad26f0c45b2c44cf63a2b56e",
"score": "0.8037836",
"text": "def valid_move?(board, index)\n return !position_taken?(board, index)\nend",
... |
ece252f0beb0fa8ee6b124e258cee860 | Indicates the connection is open | [
{
"docid": "9b7b87640036afcb090d1caef9e49a0d",
"score": "0.74688244",
"text": "def open?\n initialized? && client.open?\n end",
"title": ""
}
] | [
{
"docid": "d0dceeb62639bccd5d0899d47f9bee4b",
"score": "0.8611667",
"text": "def connection_open?\n @connection_open\n end",
"title": ""
},
{
"docid": "c7cc7bfd0f98e1e44039c2d40c0e2f57",
"score": "0.8277517",
"text": "def open?\n @connection.open?\n end",
"ti... |
f84192512002e605290e0f83528b3954 | Absolute path of the currently selected file | [
{
"docid": "0b0cd302652ba3f6336266c9091fd290",
"score": "0.8651547",
"text": "def selected_absolute_path\n selected_file_name = @files[@selected].first\n # This may not be the absolute path (e.g. file_name may be '.')\n selected_full_path = File.join(@current_path, selected_file_name)\n File... | [
{
"docid": "0d845b9ab71dfadcfba7dcbb27524936",
"score": "0.79873854",
"text": "def path_to_current_file\n @path\n end",
"title": ""
},
{
"docid": "261b49824d6f77231bedde28556dc2be",
"score": "0.75781614",
"text": "def file_path\n file.current_path\n end",
"title": ""
... |
7108a281d3ae8f378e34752e63cadc8f | GET /replies GET /replies.xml | [
{
"docid": "75a1d192f0c8a330bbfb6bace3617b56",
"score": "0.73972845",
"text": "def index\n @replies = Reply.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @replies }\n end\n end",
"title": ""
}
] | [
{
"docid": "cacc60ed57a56040f0f09a3fd5d8f28d",
"score": "0.74816704",
"text": "def index\n @replies = Reply.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @replies }\n end\n end",
"title": ""
},
{
"docid": "6a43a1c3669d... |
9fe5206611d03b2ceda42d880624325d | remove(list, "apples") p list | [
{
"docid": "eff5969522bf18af1fcbb58badea295d",
"score": "0.0",
"text": "def update(list, item_name, quantity)\n\tlist[item_name] = quantity\nend",
"title": ""
}
] | [
{
"docid": "e58541de4bfdca76d222b414403b58ec",
"score": "0.80537254",
"text": "def remove_item(list, item_name)\n\t{|list| list.delete(\"mangoes\")}\nend",
"title": ""
},
{
"docid": "d1344b3c1fb2c576e86065dfbdc4954d",
"score": "0.7689151",
"text": "def remove(list, food_item)\n\tlist... |
69c3acd1f10f10756d44375806ea6c3c | Cleans the value. It is expected that the returned value is the cleaned value. The method needs to be implemented in the subclasses. | [
{
"docid": "1ee7ef4700bd214ac460302d1a1ea736",
"score": "0.7461803",
"text": "def clean_value(_old_value, _record = nil)\n raise NotImplementedError, \"Subclasses must implement a clean(value, record=nil) method.\"\n end",
"title": ""
}
] | [
{
"docid": "c74eb6662849df18a06ac621fe603223",
"score": "0.8036414",
"text": "def clean_value; end",
"title": ""
},
{
"docid": "45273e60dadffe0d6890ec7dea0cfd4a",
"score": "0.7488692",
"text": "def cleaned_value\n experiment.clean_value value unless value.nil?\n end",
"title"... |
1c9683bc1b3df9889a40cdf9b15d7272 | PATCH/PUT /car_models/1 PATCH/PUT /car_models/1.json | [
{
"docid": "ebaba6130f8974b388421250cfb2e773",
"score": "0.6074541",
"text": "def update\r\n respond_to do |format|\r\n if @car_model.update(car_model_params)\r\n format.html { redirect_to @car_model, notice: 'Car model was successfully updated.' }\r\n else\r\n format.html { r... | [
{
"docid": "53768a47d51c50a23f298c708576d38b",
"score": "0.68049204",
"text": "def update\n @car_model = CarModel.find(params[:id])\n\n respond_to do |format|\n if @car_model.update_attributes(params[:car_model])\n format.html { redirect_to @car_model, notice: 'Car model was successful... |
105393d773ee14ab425d113a484e1f8f | POST /scheduled_products or /scheduled_products.json | [
{
"docid": "0068da7b0f556dbf0b78a916013ac637",
"score": "0.70738953",
"text": "def create\n @scheduled_product = ScheduledProduct.new(scheduled_product_params)\n\n respond_to do |format|\n if @scheduled_product.save\n format.html { redirect_to list_scheduled_product_url(@scheduled_prod... | [
{
"docid": "8e68aa3d77caf819511cc5042dc716f5",
"score": "0.6427163",
"text": "def scheduled_product_params\n params.require(:scheduled_product).permit(:product_id, :schedule_id)\n end",
"title": ""
},
{
"docid": "6513a8d109f2102de88edee09dcb693c",
"score": "0.63148785",
"text... |
db63561b65746bbd79298d495b99e44f | Sets population and population_cap to their real values. | [
{
"docid": "a7979945c144da25538418112d1e304c",
"score": "0.52598816",
"text": "def recalculate_population\n # Calculate #population.\n unit_counts = without_locking do\n Unit.select(\"type, COUNT(*) as count\").where(player_id: id).\n group(\"type\").c_select_all\n end\n cqe_coun... | [
{
"docid": "ed130d999f644e2c41c84212d43cbf22",
"score": "0.5784542",
"text": "def population_s=(value)\n @population_s = value\n end",
"title": ""
},
{
"docid": "b72b0c2f85b9209e35a06b057f1b9d26",
"score": "0.56856... |
b30f712675fbef49de57e65333e255c7 | Retrieve Celeb general info | [
{
"docid": "274d2fb338365f9eb6b6f85bf657e17c",
"score": "0.0",
"text": "def display_details\n \"#{@rank}. #{@name} - #{@total_films} films\"\n end",
"title": ""
}
] | [
{
"docid": "c63d01cc01f0073cce98ca85347cb7b7",
"score": "0.68146116",
"text": "def info\n CouchRest.get \"#{@uri}/\"\n end",
"title": ""
},
{
"docid": "141c709825ad08579a65f6c323efb24f",
"score": "0.67780805",
"text": "def get_info\n end",
"title": ""
},
{
"docid... |
57f63f9e8e1e69863469e0ac5cfff539 | DELETE /dental_records/1 DELETE /dental_records/1.json | [
{
"docid": "eeefd9d76df69dfdc8db3a85f92d5a76",
"score": "0.7051592",
"text": "def destroy\n @dental_record.destroy\n respond_to do |format|\n format.html { redirect_to dental_records_url, notice: 'Dental record was successfully destroyed.' }\n format.json { head :no_content }\n end\n ... | [
{
"docid": "f42326c808655d15108038e2d41429f8",
"score": "0.6969901",
"text": "def destroy\n @record = AssetCycleFact.find(params[:id])\n @record.trash\n\n respond_to do |format| \n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "feb05fa712cede22... |
0530ef625184cb33196c6b31236df0f7 | DELETE /categories/1 DELETE /categories/1.json | [
{
"docid": "749a88a71c1ff803c9a50afa8990dff3",
"score": "0.0",
"text": "def destroy\n if !@category.preview.nil?\n @category.preview.destroy\n end\n if !@category.banner.nil?\n @category.banner.destroy\n end\n @category_tmp = @category.dup\n @category.destroy\n record_acti... | [
{
"docid": "4142e7c3e1be82e432fdf951ae5785eb",
"score": "0.75582945",
"text": "def destroy\n @data = @category.delete(params[:id])\n render json: @data\n end",
"title": ""
},
{
"docid": "8e82257a38ec7abcdd74a59519238e96",
"score": "0.75370586",
"text": "def destroy\n Catego... |
89fc186d06adf41663cabb5a6d43bd2e | Initializes a Vector3D object | [
{
"docid": "c86b99a0b70f3d756642ac87a627f957",
"score": "0.77313226",
"text": "def initialize(x, y, z)\n raise \"Incorrect x argument for Vector3D, expected Numeric but got #{x.class}\" unless x.is_a?(Numeric)\n raise \"Incorrect y argument for Vector3D, expected Numeric but got #{y.class}\" u... | [
{
"docid": "d8c068bad7146cce3ae8d38e9f14ac0d",
"score": "0.74675465",
"text": "def -@; Vector3D.new(-x, -y, -z) end",
"title": ""
},
{
"docid": "94072af194e906eb067b6e94b7451d38",
"score": "0.7340919",
"text": "def vector_class; Vec3d; end",
"title": ""
},
{
"docid": "eac... |
8ce126452af2ac75c4a9d4281854826e | a different encrypted jar with the same secret can decode the value | [
{
"docid": "be870112d7058d1b0ac29c20a0153f66",
"score": "0.66072065",
"text": "def test_same_cookie_jar\n @encrypted_cookie_jar[:test] = @str\n enc_value = @encrypted_cookie_jar.encrypted_value(:test)\n\n encrypted_cookie_jar_2 = EncryptedCookies::EncryptedCookieJar.new(@cookie_jar, GOOD_SECRET... | [
{
"docid": "7da5cd2f1788f941ba62f66fa5b4656f",
"score": "0.6868948",
"text": "def decrypt(value)\n return nil unless encoded_encrypted = verify_and_decode(value, encrypted_signed_secret)\n cipher = new_cipher\n encrypted, iv = encoded_encrypted.split('--').map{|v| decode v }\n cipher.decrypt... |