query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
6853e3dc4d44bd59d33a9b971aecb315
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below two million.
[ { "docid": "4fcb042de6af6b76dc383090247fc115", "score": "0.0", "text": "def solve( n = 2_000_000 )\n n.prime_sieve.inject( :+ )\n end", "title": "" } ]
[ { "docid": "65de5972ceb26b215dca4198ca6889eb", "score": "0.858714", "text": "def problem10\n sum(primesUpto(2000000))\nend", "title": "" }, { "docid": "8673d356658c7abefcfabf090340ef44", "score": "0.8418341", "text": "def sum_primes\n num = 3\n sum = 2 # first prime is 2\n whil...
76223b5571a6c03a049e6fc9d72de284
Sets the read procedure to be +ruby_block+.
[ { "docid": "0c6d9e5d7852f55cdb070908ed7a85a3", "score": "0.8215192", "text": "def reader(&ruby_block)\n @reader_proc = ruby_block\n end", "title": "" } ]
[ { "docid": "660975cf11cce8061fda5172d38a623a", "score": "0.7328948", "text": "def set_read_file(&block)\n @read_proc = block\n end", "title": "" }, { "docid": "b71ed7ee6da6d77227fe3cf6a768a464", "score": "0.7203317", "text": "def read(&block)\n @read = block\n end", ...
0a2db12ac681d9d4919e4467c4ffd251
Creamos el muro asociado al usuario
[ { "docid": "a7f13cd2e55df14403e5b3d1fcb895e2", "score": "0.0", "text": "def create_wall_asociated\n self.wall = Wall.create\n end", "title": "" } ]
[ { "docid": "b52ac5e4b13b70f1bc879b571cc853ce", "score": "0.71428853", "text": "def adicionar_usuario\n self.usuario_id = current_user.id\n end", "title": "" }, { "docid": "b52ac5e4b13b70f1bc879b571cc853ce", "score": "0.71428853", "text": "def adicionar_usuario\n self.usuario_i...
59e1f012d9e06103be7c61f461f1c24b
Polls the status of the node should update the node's status and the status of the current task
[ { "docid": "2242404756c8aa2fb97af9919c174568", "score": "0.0", "text": "def poll\n raise Deployment::NotImplemented, 'This method is abstract and should be implemented in a subclass'\n end", "title": "" } ]
[ { "docid": "eaec31a415dcbadf414069ac14732ac2", "score": "0.6626718", "text": "def do_task_work\n @web.add_status( @thing, @statusUpdates )\n end", "title": "" }, { "docid": "8d2a35988bff1e8bb081f977fb779117", "score": "0.641385", "text": "def process_node(node)\n debug \"Pro...
6cb19e270bed0b057f2eda9d0f529faa
DELETE /course_makers/1 DELETE /course_makers/1.json
[ { "docid": "321e19c4f8fd8f00465a7e0ac72cebc8", "score": "0.76463354", "text": "def destroy\n @course=Course.find(params[:course_id])\n @course_maker.destroy\n respond_to do |format|\n format.html { redirect_to course_course_makers_url(@course), notice: 'Course maker was successfully destro...
[ { "docid": "1e497e24625b97ded69565348f176e9a", "score": "0.7087547", "text": "def destroy\n @watercourse.destroy\n respond_to do |format|\n format.html { redirect_to watercourses_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2ef5e284c29...
e254d245f313a4ed7788e0045790c5ef
Terminate all instances in the cloud
[ { "docid": "3ea370017a710261d731243a108d3a1e", "score": "0.0", "text": "def terminate!\n nodes.collect{|n| n.terminate! }\n end", "title": "" } ]
[ { "docid": "45b16b811405352885eec88e94c9f7a8", "score": "0.83632094", "text": "def request_termination_of_all_instances\n list_of_instances.each {|a| terminate_instance!(a[:instance_id])}\n end", "title": "" }, { "docid": "f8541ea7a2a259420c8d8d159386593c", "score": "0.834705", ...
da4efbb8ce94e7702a7d131d3a9ffd1a
Event hook methods for a more Rubyish API :
[ { "docid": "924b6b07a6ba6e4b94fa0d1befe7a2d2", "score": "0.0", "text": "def before_init(event); end", "title": "" } ]
[ { "docid": "ff1cb32628977acc28cd1a7e6b85541e", "score": "0.761368", "text": "def events; end", "title": "" }, { "docid": "ff1cb32628977acc28cd1a7e6b85541e", "score": "0.761368", "text": "def events; end", "title": "" }, { "docid": "ff1cb32628977acc28cd1a7e6b85541e", "...
097bd78358af831c0dd5bc2cde2fdade
Assigns a file to the asset. This method will generate a sanitized filename store the original filename and create a key by SHA hashing the filename with the time.
[ { "docid": "8eb6cd062f68c6b24b5949fdaf650853", "score": "0.6612155", "text": "def file=(file)\n # If we're updating this file, cache the older details so we can use them\n # after a commit\n unless new_record?\n @existing = {:dir => dir, :key => key, :filenames => filenames}\n end\n\n ...
[ { "docid": "3205d9c2a8fc3fdb9eab510a08afbc7a", "score": "0.6598227", "text": "def assign(file_to_attach)\n enqueue_files_for_removal\n model_send(\n :filename=,\n file_to_attach.original_filename.to_s.tr('^a-zA-Z0-9.', '_')\n )\n @file_to_attach = file_to_attach\n en...
1b8b26afb15368261201544958770a23
POST /outlet2s POST /outlet2s.json
[ { "docid": "654dacbd35502d2ae4c3da07b8afcce2", "score": "0.74600303", "text": "def create\n @outlet2 = Outlet2.new(outlet2_params)\n\n respond_to do |format|\n if @outlet2.save\n format.html { redirect_to @outlet2, notice: 'Outlet2 was successfully created.' }\n format.json { re...
[ { "docid": "b8e9bb58138210d424d323fdf777dcf6", "score": "0.67285275", "text": "def set_outlet2\n @outlet2 = Outlet2.find(params[:id])\n end", "title": "" }, { "docid": "21949718e21f6e1e77d85468243ff5d8", "score": "0.67054796", "text": "def create\n @outlet = Outlet.new(out...
f0b2f91d0561eababc8aa1a9d7afe954
GET /patrimonies/1 GET /patrimonies/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "f0d5eff9ad7f75cfe1583f66d1d7ece8", "score": "0.6813289", "text": "def index\n @patrimonies = Patrimony.all\n end", "title": "" }, { "docid": "9bad709d5e0b36881a550c27cc647360", "score": "0.6698243", "text": "def index\n if params[:name].present?\n plants = Pla...
905bf2eb3fb756dadce2a7c84f15fd6e
Returns the block to execute for when a prompt is required
[ { "docid": "6a5aec8533c6b000d914b12cb9056bfd", "score": "0.67491555", "text": "def prompt\n @on_prompt\n end", "title": "" } ]
[ { "docid": "c3970c964e3f0b4655f3430d53d23a05", "score": "0.7166958", "text": "def prompt_proc; end", "title": "" }, { "docid": "c3970c964e3f0b4655f3430d53d23a05", "score": "0.7166958", "text": "def prompt_proc; end", "title": "" }, { "docid": "672351bd750729bfe9f4fbbee32e...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "ebab7da94300596d4807cafe864491d9", "score": "0.0", "text": "def set_trip\n @trip = Trip.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...
73f242f83edf51b4cbc914223b4c2f2d
Generate a sequence of radio button Input elements, as a String. This works the same as checkbox_group(). However, it is not valid to have more than one radiobutton in a group checked. radio_group("name", "foo", "bar", "baz") foo bar baz radio_group("name", ["foo"], ["bar", true], "baz") foo bar baz radio_group("name",...
[ { "docid": "64f744894445c4a9613d5c414cf2a852", "score": "0.77860266", "text": "def radio_group(name = \"\", *values)\n if name.kind_of?(Hash)\n values = name[\"VALUES\"]\n name = name[\"NAME\"]\n end\n values.collect{|value|\n if value.kind_of?(String)\n radi...
[ { "docid": "fc77b25cf988ead7c7b6d972e3f53260", "score": "0.6532655", "text": "def checkbox_group(name = \"\", *values)\n if name.kind_of?(Hash)\n values = name[\"VALUES\"]\n name = name[\"NAME\"]\n end\n values.collect{|value|\n if value.kind_of?(String)\n ch...
f8c3ebeb52af4f6b3083d175ed56730e
Build the app by prepending all middlewares.
[ { "docid": "b563be7aed99bfd33ec07e2c0bb3dd82", "score": "0.7451453", "text": "def build_app(app)\n options[:environment] = ENV['SHELF_ENV'] || options[:environment]\n\n middleware[options[:environment]].reverse.each do |middleware|\n middleware = middleware.call(self) if middleware.resp...
[ { "docid": "0c62f3ec277e2e6269ad2f43c2fedfc5", "score": "0.6815478", "text": "def build_rack_app\n app = base_rack_app_callable(use_new_dispatch_api?)\n\n @middleware.reverse_each do |args, bl|\n mid, *args = args\n app = mid.new(app, *args, &bl)\n app....
e2801841ec5ad71b081d2a613f39c1e9
returns the last day of the month accounting for leap year
[ { "docid": "a0308d595771b96248a9744775d1a683", "score": "0.8002314", "text": "def last_day_of_month(year, month)\n month_days = [nil,31,28,31,30,31,30,31,31,30,31,30,31]\n result = month_days[month]\n if is_leap_year(year) && (month == 2)\n result += 1\n end\n return result\n end", ...
[ { "docid": "231184fde4db528e753218be97a7daab", "score": "0.8473857", "text": "def last_day(month, year)\n case month\n when 1 then 31\n when 2 then leap(year)\n when 3 then 31\n when 4 then 30\n when 5 then 31\n when 6 then 30\n when 7 then 31\n when 8 then 31\n when 9 then...
b5a278c6cb0514040766de35b1f7873c
Set an exception handler that will be called if any of the Deferreds in this Composer fail asynchronously, or if they fail to execute
[ { "docid": "63d4e15f32247262d7a116db1999db1c", "score": "0.50954753", "text": "def exception_handler(proc = nil, &hndlr)\n hndlr = proc if proc\n @j_comp.exceptionHandler(hndlr)\n end", "title": "" } ]
[ { "docid": "ee622a1e05d0cdd0a152c49a52ec2bb9", "score": "0.60885066", "text": "def notify_error_handlers exception\n @ionian_error_handlers.each { |handler| handler.call exception, self }\n end", "title": "" }, { "docid": "5fc2c9b968cd74c52fb9e2adb40a819d", "score": "0.608615...
9e0e6c18a740e5ed24edf5516634ee29
PUT /game_robots/1 PUT /game_robots/1.xml
[ { "docid": "5db4767f725559277c6afa8933b3bc3a", "score": "0.68634045", "text": "def update\n @game_robot = GameRobot.find(params[:id])\n\n respond_to do |format|\n if @game_robot.update_attributes(params[:game_robot])\n flash[:notice] = 'GameRobot was successfully updated.'\n for...
[ { "docid": "fbd7c46b15ae2792fd842ba0d764b7d0", "score": "0.59675837", "text": "def put uri, args = {}; Request.new(PUT, uri, args).execute; end", "title": "" }, { "docid": "7dcf61d28367255f0ec9cea7ade341de", "score": "0.58873034", "text": "def update(id, name=\"Updated Name\", publis...
d26e42606c5c33a2979467bab0d775cb
Recreate rels.csv and set the relationship properties
[ { "docid": "7b5b4d1049d70c2bee6a37f11bc98cda", "score": "0.6682305", "text": "def generate_rel_properties(properties)\n File.open(\"rels.csv\", \"w\") do |file|\n header = [\"start\", \"end\", \"type\"] + properties\n file.puts header.join(\"\\t\")\n end\n end", "title": "" } ]
[ { "docid": "f50e869850bdeb4f00dc9bc1040e3abd", "score": "0.67605346", "text": "def generate_rel_properties(properties)\n File.open(\"rels.csv\", \"w\") do |file|\n header = [\"start\", \"end\", \"type\"] + properties\n file.write(header.join(\"\\t\") + \"\\n\")\n end\n end", "title"...
ad1b8377be72987ead9a14755fe23dc3
limit: 10 result: [ "The quick,", "brown fox", "jumped", "over the", "lazy dog.", "And we", "have a", "superlongword." ] "The quick," "brown" (fox)
[ { "docid": "43f3e551432699b680048ae1fc3b6ff9", "score": "0.64240545", "text": "def wrap_words(s, limit)\n result = []\n words = s.split(\" \")\n\n line = []\n j = 0\n\n while j < words.size\n line << words[j]\n\n # Use join(\" \") to add space to the string\n if line.join(\" \").size > lim...
[ { "docid": "24e1f0c8fb793ec9faf1de7d1dfb7c78", "score": "0.71173066", "text": "def cut_words (words, limit)\n words = words.split(\" \")\n result = \"\"\n result += words.first(limit).join(\" \")\n result += \"...\" if words.length > limit\n raw result\n end", "title": "" }, { "do...
c90014ea772e3c9ba0667aaf204db606
=begin Assert if a value is a truthy value. All assert methods take an optional final parameter that is the message to display to the user.
[ { "docid": "2991b1603b58386418bbda8abadc3fdd", "score": "0.7518107", "text": "def true! value, message = nil\n @assertion_performed = true\n if !value\n message = \"#{value} was not truthy.\\n#{message}\"\n raise \"#{message}\"\n end\n nil\n end", "title": "" }...
[ { "docid": "951a34d5f52482b1f0caa702f7cb58d3", "score": "0.8451632", "text": "def assert(value, msg = nil)\n raise \"#{value} should have been true\" unless value\n end", "title": "" }, { "docid": "fec5f573c6f596f4a90c93b6c993a551", "score": "0.81027627", "text": "def...
dc85f22b5b9ae3f653e5073d1e97445b
List IpAddressBlocks Paginated list of IpAddressBlocks.
[ { "docid": "fd9f246df4a2b31650db82551655ac2e", "score": "0.608964", "text": "def list_ip_address_blocks_0_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementIPAddressPoolsIPBlocksApi.list_ip_address_blocks_0...
[ { "docid": "180fab0a011e19bb71f07f9d00edefbc", "score": "0.79648334", "text": "def list_ip_address_blocks(opts = {})\n data, _status_code, _headers = list_ip_address_blocks_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "74ed9c742964021d177f7b1739a24238", "sco...
59616fbb9196e09ec3079763d212661c
Renders the extra attributes in the (Formtastic) form
[ { "docid": "8c841091c968dbb58f0f43a65c406762", "score": "0.74004465", "text": "def render_extra_attributes(f, name = :extra_attributes)\n f.inputs(:for => name) do |f|\n unless f.object.spec.field_type?\n content_tag :li, f.object.spec.name\n else\n f.input(:spec_id, :as => :h...
[ { "docid": "63b2c3c35962e11841a5a66cce6a93cb", "score": "0.7174444", "text": "def form_attributes\n options.inject([]){|s,(k,v)| s << \"#{k}='#{v}'\" }.join(' ')\n end", "title": "" }, { "docid": "f64bb3b4d2169da0031f964d7b42bbc6", "score": "0.69846255", "text": "def attrs_fo...
ab2516beb46d3d6988d7126182b65fdf
Write the state back to the state file from the run context.
[ { "docid": "f945b8edd39e96132cbb4037681017f6", "score": "0.8329605", "text": "def write_state\n logger.info \"Writing state back to #{configuration.state_file}\" do\n @run_context.write_state!\n end\n end", "title": "" } ]
[ { "docid": "177259e3456a39a6917dad7357becb24", "score": "0.69357353", "text": "def save\n unless @changed\n $log.debug 'Not saving state, nothing changed'\n return\n end\n statefile_filename = state_filename\n $log.debug \"Saving state to #{statefile_filename}\"\n ...
8fd8b1b5955bba0690c7b8228e26feaf
find kases that match the given person's profile
[ { "docid": "f08883b657ae18fae1f6521f62bd8c52", "score": "0.67980003", "text": "def find_matching_kases_for_person(person, options={})\n find(:all, find_options_for_matching_kases_for_person(person, options))\n end", "title": "" } ]
[ { "docid": "8b48b1d638e4eb540c4def96fcc71fa6", "score": "0.6220765", "text": "def find_options_for_matching_kases_for_person(person, options={})\n select = \"DISTINCT kases.*\"\n group = \"#{table_name}.#{primary_key}\"\n\n # kases tags\n joins = \"LEFT OUTER JOIN taggings kases_tagg...
7a326510a349beded631b9198fbcc154
creating a session which contains order id, if the new order is created again
[ { "docid": "b1aa579ed66a4d2c26f95bdc72cc0882", "score": "0.8014144", "text": "def set_order\n @order = Order.find(session[:order_id])\n puts(session[:order_id])\n #if an error occurs (if the session doesn't exist) - creating a new one.\n rescue ActiveRecord::RecordNotFound\n @order = Order.cr...
[ { "docid": "7f2d0bc76f6ac3f1e2a546079b40e31c", "score": "0.79239595", "text": "def manage_session\n # check order status to reassign new order\n order = Order.find_by(id: session[:order_id])\n if order.nil? || order.status == \"paid\"\n @order = Order.create(status:\"pending\")\n orde...
bb1b0e03d232170bc1b074b0ada8160c
DELETE /pmus/1 DELETE /pmus/1.json
[ { "docid": "5dcab812e201da2e88e3d504656413b5", "score": "0.64926034", "text": "def destroy\n @pmu.destroy\n respond_to do |format|\n format.html { redirect_to tenant_pmus_path(@tenant), notice: 'Pmu was successfully destroyed.' }\n end\n end", "title": "" } ]
[ { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.7133211", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": "...
a2c30d734b0ba65c579c83543e5d0401
should return the table, and th part. will return some headers.
[ { "docid": "a6297cde0dcb911821f4bc4452f9e88f", "score": "0.64815354", "text": "def summary_table_headers(args={})\n\t\t'''\n\t\t\t<thead>\n\t <tr>\n\t <th>Name</th>\n\t <th>Total Tests</th>\n\t <th>Total Steps</th>\n\t <th>Total Requirements</...
[ { "docid": "a67c1cdcf86bdc451080ffae031640e3", "score": "0.7680857", "text": "def table_header; end", "title": "" }, { "docid": "f75f60f1f775757dd8016f450fd3c85d", "score": "0.71823215", "text": "def table_headers\n raise NotImplementedError\n end", "title": "" ...
be624cccf35dddcd682fdd70aaedad30
return the encoding of the database
[ { "docid": "3689ec478a8a4749a22268a6e95a5fab", "score": "0.7298451", "text": "def encoding\n @encoding ||= pragma( \"encoding\" ).first['encoding']\n end", "title": "" } ]
[ { "docid": "9f09778c475e56ac84092de308b4dec4", "score": "0.8278907", "text": "def encoding\n query(<<-end_sql)[0][0]\n SELECT pg_encoding_to_char(pg_database.encoding) FROM pg_database\n WHERE pg_database.datname LIKE '#{current_database}'\n end_sql\n end", "titl...
6b038969cb7021d6f1977cf5e3016999
Construct a dict from a table in the db. The key is specified in key. The values will be a dict that contains the rest of the columns in the table.
[ { "docid": "885278df2deae46bf91810e64fcddc94", "score": "0.8480861", "text": "def construct_dict(db, table, key)\n query_str = \"SELECT * FROM #{table}\"\n final_hash = {}\n db.execute(query_str) do |row|\n hash_key = row[key]\n # get all the values\n vals = {}\n row.keys.ea...
[ { "docid": "be7965b17455f2b6bcc87a2dead787ee", "score": "0.76413906", "text": "def loadHash(db, table, key, columns)\n data = Hash.new\n db.query(\"SELECT #{key}, #{columns.join(',')} FROM #{table}\").each do |row|\n data[row.first] = Hash.new\n columns.size.times do |i|\n data[row.first][c...
6e0c7c979acb6be85d999eba53fa8011
TODO Speed up Vagrant SSH connections May need to be disabled for windows (mm_send_fd: UsePrivilegeSeparation=yes not supported)
[ { "docid": "0cea6b030bc1945505b05b2f7005b8c6", "score": "0.54971325", "text": "def to_s\n require 'tempfile'\n config = ::Tempfile.new 'hem_ssh_config'\n config.write @@vm_inspector.ssh_config\n config.close\n\n psuedo_tty = opts[:psuedo_tty] ? '-t' : ''\n\n ...
[ { "docid": "aea7e9b0f82bd67f76329a302198daed", "score": "0.66674954", "text": "def vagrant_stream(cmd)\n exec_stream(\"vagrant ssh -c '#{cmd}'\")\nend", "title": "" }, { "docid": "503d4a323f79b5809ec06e0de51c4acd", "score": "0.6525762", "text": "def sshmaster(machine)\nmachine.vm.pr...
740e3e809433e015b6244910e6721911
Fetches a given item by CN.
[ { "docid": "935e9061ddc36b3edccbde91cdf3fd2b", "score": "0.59196866", "text": "def get_item(cn, location)\n treebase = GLOBAL_CONFIG[:treebase]\n\n filter_string = [\"distinguishedName=CN=#{cn}\"]\n filter_string << location if location\n filter_string << treebase\n filter_string = filter...
[ { "docid": "42eb033635986bbc3ad7b642017f92fe", "score": "0.69066834", "text": "def fetch_item(item_id)\r\n fail \"No such item id: #{item_id}\" unless self.items.member?(item_id.to_i)\r\n self.items.fetch(item_id.to_i)\r\n end", "title": "" }, { "docid": "75cf635f2bb959fd95f2571...
f4f1f29daf23c50b22b59cd9e79622e0
DELETE /calculation_configs/1 DELETE /calculation_configs/1.json
[ { "docid": "fe4bb91827f9980137315a7717a73b31", "score": "0.7868899", "text": "def destroy\n @calculation_config.destroy\n respond_to do |format|\n format.html { redirect_to calculation_configs_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "32cf550efd37392c2406b908a150e0ad", "score": "0.6887", "text": "def destroy\n @config1 = Config1.find(params[:id])\n @config1.destroy\n\n respond_to do |format|\n format.html { redirect_to config1s_url }\n format.json { head :no_content }\n end\n end", "title": "" ...
30baa9502d85172e9a6ac5caf4e649d1
returning a collection of People allows you to reuse its output for different purposes (such as passing it to the list method you defined)
[ { "docid": "4863c7d8676a9bdb19d81325963f0dd1", "score": "0.0", "text": "def search_first_name\n\t\tprint \"First name: \"\n\t\tfirst_name = gets.chomp \n\t\tpeople = Person.where(\"first_name LIKE '%#{first_name}%'\")\n\t\treturn people\n\tend", "title": "" } ]
[ { "docid": "ee0fd0f5c8576d179d2b4f7bf0fb0e0c", "score": "0.78120697", "text": "def get_people\n return @people\n end", "title": "" }, { "docid": "61f1d91b28672919c184bfa2bb58b292", "score": "0.7604162", "text": "def people\n # Cache the results in memory\n @people ||= find_...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "90fa4c15902ca2dc2700ecdfb99b5a9f", "score": "0.0", "text": "def update!(**args)\n @bool_value = args[:bool_value] if args.key?(:bool_value)\n @int_value = args[:int_value] if args.key?(:int_value)\n @key = args[:key] if args.key?(:key)\n @key_value = args[...
[ { "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...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "e683544f53419f939e7ff15e86136e66", "score": "0.0", "text": "def set_adventure\n @adventure = Adventure.find(params[:adventure_id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.61637366", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.60446453", "text": "def action_hoo...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "78ef52721dc2e8aea5a051ec2ae8772f", "score": "0.0", "text": "def update!(**args)\n @request_id = args[:request_id] if args.key?(:request_id)\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...
65e849b4dd21fcd473cb1c843c121a12
adds the duration of the step itself to this requirements time information. also updates the end_time so that it reflects the duration of the step.
[ { "docid": "d005ec8884e2fcba10c448b6fbac4177", "score": "0.82305926", "text": "def add_duration_from_step(step_duration)\n self.time_information[:duration] = step_duration\n self.time_information[:end_time] = self.time_information[:end_time] + self.time_information[:duration]\n end", "t...
[ { "docid": "6510df693706ffd2959db827bebdd95b", "score": "0.7112612", "text": "def add_requirement(req)\n ## take the duration from its time_information and add it to the self duration\n self.time_information[:duration] += req.time_information[:duration]\n end", "title": "" }, { ...
c82bd6683dac41e7f4139447ff79a538
Set a key in the database to be written at some future date. If the data needs to be persisted immediately, call db.set(key, value, true).
[ { "docid": "6ec653e6776d3a89963b6fc1e559e26f", "score": "0.0", "text": "def []=(key, value, sync = false)\n key = key.to_s\n @writer.write(Record.new(key, serialize(value)))\n flush! if sync\n @table[key] = value\n end", "title": "" } ]
[ { "docid": "015003ef8426131b3cf60a76efadfbee", "score": "0.69633967", "text": "def set(key, value, expires_in = 0)\n if expires_in > 0\n expires = Time.now + expires_in\n end\n @store.store(key, {value: value, expires: expires})\n end", "title": "" }, { "docid": "2e23ef9cc5502...
23a205812f9f226ba691295264d799ff
Small internal convenience method to get the parsed version of the current content type header. source://actionpack//lib/action_dispatch/http/response.rb428
[ { "docid": "9f0c800529fb3771b1fc41213f1394e3", "score": "0.8491054", "text": "def parsed_content_type_header; end", "title": "" } ]
[ { "docid": "69bb1859ddde5dfa7172d65ef1586675", "score": "0.850233", "text": "def parsed_content_type_header\n parse_content_type(get_header(CONTENT_TYPE))\n end", "title": "" }, { "docid": "e7edad4c765bd3339e2131d404c30ec7", "score": "0.7951513", "text": "def content_type\n ...
f93488faf29473708ec16510bc3d7e29
DELETE /admin/palestrantes/1 DELETE /admin/palestrantes/1.json
[ { "docid": "bb0c9991cfff687a0978b3257260e18e", "score": "0.7237819", "text": "def destroy\n @palestrante.destroy\n respond_to do |format|\n format.html { redirect_to admin_palestrantes_url, notice: 'Palestrante deletado com sucesso.' }\n format.json { head :no_content }\n end\n end",...
[ { "docid": "16a14e9c315d01e9f83b5e76889149b9", "score": "0.7315646", "text": "def destroy\n @palestrante.destroy\n respond_to do |format|\n format.html { redirect_to palestrantes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b1a17c1ee1a...
43de7faee112eb0cbcc6b2a041af890f
Adds (or updates) the given +PeerConnection+. If a peer of the same UUID is found, the existing record will be updated and given instance PeerConnectionstop'd. This prevents pending outbound data from being accidentally dropped.
[ { "docid": "e48c9b59fb2c5f7bc465563cfd8ae9ef", "score": "0.4119183", "text": "def register_peer(peer)\n putsd \"Registering peer: #{peer.uuid}\"\n peer_registry.register(peer)\n end", "title": "" } ]
[ { "docid": "7b68a35136aa6e0db69e5747222d1a2c", "score": "0.56614256", "text": "def register(peer)\n raise \"Do not try to register a nil peer!\" if peer.nil?\n raise \"You can only add #{PeerConnection} instances to this registry, not #{peer.class}!\" unless peer.class == PeerConnection\n ...
6a8a4e1b1a4df5ee67f33bf5c003d6a6
Terminates the current block with a jump to the target block.
[ { "docid": "8036458809abc09d69894d4ef69dfcf8", "score": "0.5981276", "text": "def uncond_instruct(target, opts = {})\n opts = {jump_instruct: true, flags: RGL::ControlFlowGraph::EDGE_NORMAL}.merge(opts)\n add_instruction(:jump, target.name) if opts[:jump_instruct]\n @graph.add...
[ { "docid": "6a747055f4048b23670d41072fa65d77", "score": "0.64433557", "text": "def exit &block\n @exit_block = block\n end", "title": "" }, { "docid": "f98b7d1bfa9a169b6f64fff7c67f37ea", "score": "0.64145064", "text": "def build_block_with_jump(target = nil, name = nil)\n ...
fee7d80be37656d47a636156409166c6
PUT /votes/1 PUT /votes/1.json
[ { "docid": "dbf3a26b5bff7ee404696ca28b2c6ead", "score": "0.694491", "text": "def update\n @vote = Vote.find(params[:id])\n\n respond_to do |format|\n if @vote.update_attributes(params[:vote])\n format.html { redirect_to @vote, notice: 'Vote was successfully updated.' }\n format....
[ { "docid": "cfe15a9be7082d3279babb1db772605a", "score": "0.70922005", "text": "def update\n @vote = @votable.votes.find(params[:id])\n\n respond_to do |format|\n if @vote.update(vote_params)\n format.html { redirect_to build_path_vote(@vote), notice: 'Vote was successfully updated.' }\...
8be26652c69414a2927a74c9459a2322
publish the message after encrypting it and packing it
[ { "docid": "a636efd0a452cf045e00be358fb9418d", "score": "0.64293295", "text": "def publish(exchange, msg, opts={})\n package = Package.new(opts.delete(:package)) \n package.payload = msg\n \n exchange.publish(package.dump, opts)\n end", "title": "" } ]
[ { "docid": "7bec9d787284f1b70e3db90b6140e35f", "score": "0.6719256", "text": "def encrypt(message)\n \n end", "title": "" }, { "docid": "c04ac1b895eacdd99facc9fc4c04c116", "score": "0.6563331", "text": "def publish\n\t\t\tAggregator.message_publish( self )\n\t\tend", "title":...
a6a7efd0a57f61e796c6db0f996f3b53
DELETE /monitor/servers/1 DELETE /monitor/servers/1.json
[ { "docid": "0a72896999312e173dd18961dc478401", "score": "0.73497784", "text": "def destroy\n @monitor_server.destroy\n respond_to do |format|\n format.html { redirect_to monitor_servers_url, notice: 'Server was successfully destroyed.' }\n format.json { head :no_content }\n end\n end...
[ { "docid": "95a8ad72a1b56a408d5af3231bdb0223", "score": "0.72058994", "text": "def destroy\n @server = compute.get_server(params[:id])\n @server.delete!\n\n respond_to do |format|\n format.html { redirect_to servers_url }\n format.json { head :ok }\n end\n end", "title": "" ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "60e6a700fdbf77f5687012ab2e66ed29", "score": "0.0", "text": "def set_parent\n @parent = Parent.find(session[:parent_id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook;...
4cf54af9f9f8d4a093ef8c5786f2f253
DELETE /fires/1 DELETE /fires/1.json
[ { "docid": "2b9df49651cf970a1baed39b931d5cda", "score": "0.7266735", "text": "def destroy\n @fire.destroy\n respond_to do |format|\n format.html { redirect_to fires_url, notice: 'Fire was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ...
[ { "docid": "6106a96accf8e27a75cd48324d5c830a", "score": "0.76110077", "text": "def destroy\n @fire = Fire.find(params[:id])\n @fire.destroy\n\n respond_to do |format|\n format.html { redirect_to fires_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { ...
483a02cae623d761f8124b6596e4b9ba
Returns a PackageList object that contains key value pairs for every package (installed or not) where the key is the package name and the value is a PackageInfo object
[ { "docid": "30ece293c2b4c0c88f9bae65b19b8951", "score": "0.56901085", "text": "def packages()\n\t\t\t\traise(PackageError, \"A full package list is not implemented on OpenBSD\")\n\t\t\tend", "title": "" } ]
[ { "docid": "b64d53500ded49223f2f0c6882dd3c32", "score": "0.80697984", "text": "def installed_packages()\n\t\t\t\tinstalledpackagelist = `#{@finkbin} list -i`\n\n\t\t\t\tinstalledpackages = PackageList.new()\n\t\t\t\tinstalledpackagelist.each_line() { |line|\n\t\t\t\t\tlinearr = line.split()\n\t\t\t\t\ti...
bc6556f050ef20786c9cf03455d62cbd
Object Initialization x : window X coordinate y : window Y coordinate
[ { "docid": "45aa438c7830920dee1ff14f537f77f1", "score": "0.0", "text": "def initialize(x, y)\n super(x, y, 160, WLH + 32)\n @back_sprite = Sprite.new\n @back_sprite.x = self.x\n @back_sprite.y = self.y\n refresh\n end", "title": "" } ]
[ { "docid": "16abf35decb327848468574f1b31b342", "score": "0.75939715", "text": "def initialize(x, y, w, h)\n @win = newwin(h, w, y, x)\n @width = w\n @height = h\n end", "title": "" }, { "docid": "9c97cbdac1d914fdae9f9da2c4ac6c73", "score": "0.73878616", "text": "def update...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "1141ec4b780fa38334bac8bda74fc2af", "score": "0.0", "text": "def set_comment13\n @comment13 = Comment13.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...
97e674f1214535811cfbafd082c370e4
Return domain value loaded from html
[ { "docid": "05ab83b0db5cf2dc1e507929509106e5", "score": "0.80313355", "text": "def domain_value\n field.domain_value(html_value)\n end", "title": "" } ]
[ { "docid": "cb2d326c00e27ee31b9b5ca854dbf97d", "score": "0.7055093", "text": "def html_value\n field.html_value(domain_value)\n end", "title": "" }, { "docid": "3e63869fb4c5fc2d9bf957749e331ac8", "score": "0.6605943", "text": "def domain\n @attributes[:domain]\n e...
d445021bfffcebc6bff761b646395681
DELETE admin/users/1 DELETE admin/users/1.json
[ { "docid": "f867763fbd308b63bd786844f8717513", "score": "0.748805", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to :admin_users }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "f91700ab385910f110940dda0591012a", "score": "0.77012587", "text": "def destroy\n @admin_user.destroy\n respond_to { |format| format.json { head :no_content } }\n end", "title": "" }, { "docid": "2adfa005104d45aeaf393f776540d52c", "score": "0.76630217", "text": "def...
c4049d2ff2def3312a18c1b82d2f76af
Manually create everything manually in the ActiveX directory
[ { "docid": "ea9108fbde07a6910a03b620b18c39fe", "score": "0.57410306", "text": "def init_activex_files(last_rid)\r\n activex = []\r\n\r\n 0x250.times do |i|\r\n id = (last_rid += 1)\r\n\r\n bin = {\r\n :fname => \"/word/activeX/activeX#{id.to_s}.bin\",\r\n :bin => make_acti...
[ { "docid": "38d4cffdb6765a06631e40b2858e3f4b", "score": "0.6536598", "text": "def create_home\n create_dirs\n copy_files\n create_vimrc\n end", "title": "" }, { "docid": "c3b8c73f20a59e9b2349019d35189f86", "score": "0.6269072", "text": "def create_all\r\n cr...
48c6b7d9eae512e3743129bc16d9454a
DELETE /candidate/:id/experiencess/1 DELETE /candidate/:id/experiencess/1.json
[ { "docid": "ac22de3ea07d5b32b9c9ecf772003cd7", "score": "0.72796947", "text": "def destroy\n @candidate_experience.destroy\n flash[:success] = 'Experience was successfully deleted'\n respond_to do |format|\n format.html { redirect_to edit_candidate_experiences_path}\n format.json { h...
[ { "docid": "80a851e8a43a89c02046e33ebbc6f5fe", "score": "0.77136683", "text": "def destroy\n @candidate = Candidate.find(params[:id])\n @candidate.destroy\n\n respond_to do |format|\n format.html { redirect_to candidates_url }\n format.json { head :no_content }\n end\n end", "...
dcb183d8b776a076c8d38416be68b69a
ask the user for an operation to perform perform the operation on the two numbers output the result
[ { "docid": "a005c8f26cbaf8b3e243d8643f390c8c", "score": "0.0", "text": "def prompt(message)\n puts \"=> #{message}\"\nend", "title": "" } ]
[ { "docid": "a681953fd16254338df4153805c68a9d", "score": "0.79768056", "text": "def arithmetic_ops\n puts \"Enter first number:\"\n num1 = gets.to_i\n puts \"Enter the second number:\"\n num2 = gets.to_i\n\n puts \"#{num1} + #{num2} = #{num1 + num2}\" \n puts \"#{num1} - #{num2} = #{num1 - num2}\"...
06741bb76e0fd1af1f677672371db78a
convert arc seconds to degree
[ { "docid": "370e157f33b22ec370b6fd2c998f6c75", "score": "0.81381273", "text": "def to_deg(arc_secs = 0)\n arc_secs.nil? ? arc_secs = 0 : arc_secs\n arc_secs / ARCSEC\n end", "title": "" } ]
[ { "docid": "a23282fa8ab3658d7e16e096958eab17", "score": "0.71004057", "text": "def radians_to_degrees(); end", "title": "" }, { "docid": "52a66e44366b857474271f276b97bc0b", "score": "0.7023471", "text": "def to_degrees\n degrees = (((@hour * 30) + (@min * 0.5)) - (@min * 6)).abs.t...
44d7c3ac3a8d0b7759de09a2e4e3c264
GET /children/new GET /children/new.xml
[ { "docid": "902c4416c225bf0cab64bc8dc3f8cd56", "score": "0.0", "text": "def new\n unless Klass.exists?\n flash[:notice] = 'Ingen klasse til elev. Opret klasse først.' \n redirect_to(klasses_path)\n return\n end\n @child = Child.new\n @child.klass_id = params[:klass_id]\n re...
[ { "docid": "70363cb90053152b37d10d44444eb9a4", "score": "0.76615983", "text": "def new\n @child = @family.children.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @child }\n end\n end", "title": "" }, { "docid": "b2837223a282e063...
779205c2335a917c86ec8f4d664d673f
DELETE /equity_types/1 DELETE /equity_types/1.json
[ { "docid": "5094689eaf578ed8a186d843fb550a83", "score": "0.77447087", "text": "def destroy\n @equity_type.destroy\n respond_to do |format|\n format.html { redirect_to equity_types_url, notice: 'Equity type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"...
[ { "docid": "d8b40cb8690c31ea462d9fd3f50c8c44", "score": "0.7370941", "text": "def destroy\n @expensetype = Expensetype.find(params[:id])\n @expensetype.destroy\n\n respond_to do |format|\n format.html { redirect_to expensetypes_url }\n format.json { head :no_content }\n end\n end"...
eaa779620c6ab405cce47614b875337b
GET /links/1 GET /links/1.xml
[ { "docid": "3cfee0fe553d17fc5216c860f0c77a6e", "score": "0.6569024", "text": "def show\n @link = Link.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @link }\n end\n end", "title": "" } ]
[ { "docid": "85057a52b8461db9e937869a1b3b2073", "score": "0.6934233", "text": "def index\n @links = Link.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @links }\n end\n end", "title": "" }, { "docid": "5060432d149f4e103dacb07ff...
1ec7c8512f0d396b5a0d993e75b5e248
Imports another source like add_source and also assigns the new source as a part of the current one.
[ { "docid": "573cf6a32209d59fde1f82cbb271fa53", "score": "0.0", "text": "def add_part(sub_element = nil, &block)\n raise(RuntimeError, \"Cannot add child before having an uri to refer to.\") unless(@current.attributes['uri'])\n @current.element.search(\"/#{sub_element}\").each do |sub_e...
[ { "docid": "cc149b7a22751ad5cba00f6aa8ea7ce9", "score": "0.67039293", "text": "def attach source\n mutex.synchronize do\n if @current && (!source || @current.filename != source.filename) && source_map_hash.key?(@current.filename) && !workspace.has_file?(@current.filename)\n source_m...
7396b11d0d5724b42e5bd1cd27eff62d
Depends on Image Pages extraction
[ { "docid": "a29c6e5d2d07017d2d8f10078e63e7ad", "score": "0.0", "text": "def page\n fs.device.pages.newest_for PAGES[:object_table]\n end", "title": "" } ]
[ { "docid": "702e60219580ba0b6ca771890613e014", "score": "0.6941156", "text": "def parse(page)\n return page.images\n end", "title": "" }, { "docid": "2e43d8cc5aa6685bd7c12620a58fad2d", "score": "0.66543114", "text": "def images; end", "title": "" }, { "docid": "2e43d8...
d90f04803315842068b4aaa4150a496d
set name of processor
[ { "docid": "4b3f6a4b0c931070915e77d454da7bcd", "score": "0.0", "text": "def name=(value)\n @name = value\n end", "title": "" } ]
[ { "docid": "d9e58d79b0a8c2c351af6966e57098ac", "score": "0.8290975", "text": "def processor_name(name = nil)\n if name\n @processor_name = name\n else\n (defined?(@processor_name) && @processor_name) || self.name\n end\n end", "title": "" }, ...
56ea2f9d5f9b65b336c096338895bd56
Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.notification.assign.subject
[ { "docid": "b1a8eef570388b9307d6a42cde1d1c35", "score": "0.0", "text": "def assign(task,user)\n @task = task\n @user = user\n mail_ids = @task.users.pluck(:email).join(\",\")\n mail to: \"#{mail_ids}\", cc: \"#{user.email}\", subject: \"task is assigned\"\n end", "title": "" } ]
[ { "docid": "8780eaf874a22b8575f2c8ae110d8df9", "score": "0.7119202", "text": "def message_subject=(value)\n @message_subject = value\n end", "title": "" }, { "docid": "bb64d8e70562844846ba99974c215270", "score": "0.7027837", "text": "def translate(mapping, k...
3fb523102ff317df541b53f7e86a79b0
PATCH/PUT /transakcje_jaskulas/1 PATCH/PUT /transakcje_jaskulas/1.json
[ { "docid": "e2e66af9ed9839d65f787b523e9adf85", "score": "0.67680496", "text": "def update\n respond_to do |format|\n if @transakcje_jaskula.update(transakcje_jaskula_params)\n format.html { redirect_to @transakcje_jaskula, notice: 'Transakcje jaskula was successfully updated.' }\n ...
[ { "docid": "3158512e922121ad0604858961081375", "score": "0.6400142", "text": "def update\n respond_to do |format|\n if @klienci_jaskula.update(klienci_jaskula_params)\n format.html { redirect_to @klienci_jaskula, notice: 'Klienci jaskula was successfully updated.' }\n format.json {...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "4115f8a4106722b80e360172b6b086b6", "score": "0.0", "text": "def documento_params\n params.require(:documento).permit(:user_id, :titulo, :descricao, :status, :data_defesa, :tese, :mestrado, :arquivo, :author)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whit...
6768f5a93f8c342437e9a2f4b5ca75d8
DELETE /vertices/1 DELETE /vertices/1.xml
[ { "docid": "a4c23860c59257fff2f9534841c91112", "score": "0.7536937", "text": "def destroy\n @vertex = Vertex.find(params[:id])\n @vertex.destroy\n\n respond_to do |format|\n format.html { redirect_to(vertices_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
[ { "docid": "a7bec4ea0064f630e7f80b8e4da609a1", "score": "0.67706966", "text": "def remove_vertex(id)\n # YOUR WORK HERE\n end", "title": "" }, { "docid": "97562069e687fe1bedd6a01807e253fe", "score": "0.6710749", "text": "def destroy\n @vertex.destroy\n\n respond_with(@verte...
46e82a89f4870e9e587b150a55df1181
pseduo code: get out of nil go left see if node has a right and left value and if so, print it go right or could print if it is an integer...if woking with integers if its an integer, it wont have any children, only operators will
[ { "docid": "96c56e285684c5bb177f1afbb39c3ea7", "score": "0.8086843", "text": "def operators(node) #only want to print nodes that are operators (have children)\n return if node == nil\n operators(node.left)\n if node.left != nil || node.right != nil\n print node.value + \" \"\n end\n ...
[ { "docid": "e339b53ad8a8d397fbb1aceea0464fb0", "score": "0.79855293", "text": "def operators(node)\n return if node == nil\n operators(node.left)\n if node.left != nil || node.right != nil\n unless node.value.to_i.to_s == node.value\n print node.value + \" \"\n end\n end\n operators(node...
8c1aacd1c6e94c728b38b23a63f6dc05
Updates a tag bundle at Delicious
[ { "docid": "4864b3d29c4b6c0e7780afa7a1504eaa", "score": "0.55419946", "text": "def save\n validate_presence_of :name, :tags\n wrapper.set_bundle(@name, @tags.join(' ')) || raise(OperationFailed)\n end", "title": "" } ]
[ { "docid": "9eab055c42dd46c26d41d4a0ea2e321a", "score": "0.6550924", "text": "def update_tag(tag, vulns)\n digest = nil\n\n ActiveRecord::Base.transaction do\n # If the tag no longer exists, then we need to raise a Rollback\n # exception to leave early and cleanly from th...
0546315c481a6bb41150970e323dc64c
[END add_shopping_product_ad_1] [START add_shopping_product_ad]
[ { "docid": "8065e97b3ebb10d36a2d0f85b5b95e68", "score": "0.6853498", "text": "def add_shopping_product_ad_group_ad(client, customer_id, ad_group_name)\n\n operation = client.operation.create_resource.ad_group_ad do |ad_group_ad|\n ad_group_ad.ad_group = ad_group_name\n ad_group_ad.status = :PAUSE...
[ { "docid": "57e0efcb41f900344e70dc2d8c4fea98", "score": "0.6535014", "text": "def add_shopping_product_ad_group(client, customer_id, campaign_name)\n operation = client.operation.create_resource.ad_group do |ad_group|\n ad_group.name = \"Earth to Mars cruise ##{(Time.new.to_f * 1000).to_i}\"\n ad...
854f8a22fb5ccceeb6ec23f9e0f435f6
Log out of Keybase
[ { "docid": "8b5bcec03f26708c41dca001c8587f4b", "score": "0.0", "text": "def logout\n return Request::Session.kill_all\n end", "title": "" } ]
[ { "docid": "f71613e08aa4efdc48744f185715a7dd", "score": "0.7872218", "text": "def logout\n @key = nil\n end", "title": "" }, { "docid": "7f140c5b3ad90b67c6c167ffda736145", "score": "0.7493905", "text": "def logout\n Blockspring::CLI::Auth.delete_credentials\n puts \"You...
dd2466e56a58a0e37e987c9f2522e142
DELETE /expence_perticulers/1 DELETE /expence_perticulers/1.xml
[ { "docid": "600c5136344908c3a0836c12f0d6a5c2", "score": "0.6878688", "text": "def destroy\n @expence_perticuler = ExpencePerticuler.find(params[:id])\n @expence_perticuler.destroy\n\n respond_to do |format|\n format.html { redirect_to(expence_perticulers_url) }\n format.xml { head :o...
[ { "docid": "df26116eb86dbadafed7137f9e3c2f9e", "score": "0.68633705", "text": "def delete!\r\n return nil unless exists? \r\n xml = xml_at_top\r\n par = xml.instance_variable_get(:@parent) \r\n par['delete'] = 'delete'\r\n xml_on_delete( xml )\r\n rsp = write_xml_config!( xml.doc...
77cd68afc432558bfcc1543135e1c4a1
GET /books GET /books.json
[ { "docid": "062e78f407b781825a74d76815a2717a", "score": "0.0", "text": "def index\n if params[:search]\n @books = Book.search(params[:search])\n else\n @books = Book.all\n end\n end", "title": "" } ]
[ { "docid": "0dcef7df140be07467764e06d44a75c9", "score": "0.7966849", "text": "def index\n @books = get_books()\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @books }\n end\n end", "title": "" }, { "docid": "60973656e5d53c2355cc3aaa79...
76351441d99ad95a6436e06fbc8d378e
Check if this is a negative duration
[ { "docid": "0d6a473fc75aa0b7b68ea714125f766c", "score": "0.70173174", "text": "def negative?\n !!@negative\n end", "title": "" } ]
[ { "docid": "58bcc766b82a38b038feff17b05db85b", "score": "0.72617537", "text": "def negative?\n self < 0\n end", "title": "" }, { "docid": "e2d17ac79d8f9af871e30515bedaf403", "score": "0.72324383", "text": "def negative?\n @negative\n end", "title": "" },...
010b8466dc85ad4bf0d95ff830324292
DELETE /hash_tags/1 DELETE /hash_tags/1.json
[ { "docid": "fb9e2ebb4e0280b2938309bb6cbc3e6e", "score": "0.742031", "text": "def destroy\n @hash_tag.destroy\n respond_to do |format|\n format.html { redirect_to hash_tags_url, notice: 'Hash tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "titl...
[ { "docid": "ced8f84629051eb5681c885f4cda9f75", "score": "0.7553885", "text": "def destroy\n @hash_tag = HashTag.find(params[:id])\n @hash_tag.destroy\n\n respond_to do |format|\n format.html { redirect_to(hash_tags_url) }\n format.xml { head :ok }\n end\n end", "title": "" ...
3404563a4f9052f64e8669615c6a840d
Execute our list of command needed to achieve the desired goal (borrowed from dark operator & unleashed intro)
[ { "docid": "ae70e831afa4056b898d814287f933e7", "score": "0.0", "text": "def list_exec(session, cmdlst) #session is our meter sessions, cmdlst is our array of commands to run on target\n\tr=''\n\tsession.response_timeout=120\n\tcmdlst.each do |cmd|\n\t\tbegin\n\t\t\tprint_status(\"Executing: #{cmd}\")\n\...
[ { "docid": "5d510b0db1979d7edc1c9bb339529cd6", "score": "0.7146117", "text": "def commands; end", "title": "" }, { "docid": "5d510b0db1979d7edc1c9bb339529cd6", "score": "0.7146117", "text": "def commands; end", "title": "" }, { "docid": "5d510b0db1979d7edc1c9bb339529cd6",...
8d1aee6f41bec1d5737d291d03fa99df
arr The Array the gives the output. Examples last_of(1337, 2, 1) => 1 Returns the last element in the array.
[ { "docid": "398a6f5716a230b84eec65ec092cacb1", "score": "0.785929", "text": "def last_of(arr)\n return arr[arr.length-1]\nend", "title": "" } ]
[ { "docid": "5cbd79b4221d79065360b9d3a8cc4701", "score": "0.82161385", "text": "def last_of(arr)\n output = arr[-1]\n return output\nend", "title": "" }, { "docid": "cfad5d5a81075e52946da9fc507126b6", "score": "0.8106383", "text": "def last_of(arr)\n return arr[-1]\nend", ...
0428f85eaf91f42d5b8d2b3c5108345e
get a list of Presentations with their original uploaders for autocomplete fields (authorization is done immediately to save from iterating through the collection again afterwards) Parameters: user user that performs the action; this is required for authorization
[ { "docid": "1ac7e714837838d49df08c6388fba96b", "score": "0.0", "text": "def use_mime_type_for_avatar?\n true\n end", "title": "" } ]
[ { "docid": "d12c3db896c45e6f9bfef12207446bf8", "score": "0.58774686", "text": "def geo_file_set_presenters\n []\n end", "title": "" }, { "docid": "f789cb0c38448723d2a0450132a56ab5", "score": "0.58731097", "text": "def presentations\n current_user.is_admin ? Presentation.all : ...
beb6aaa59c1ea1669e79188603decddc
These values ought to be derived from MVI vs user input, except for inpatient and text_messaging_allowed
[ { "docid": "d725de5a84ac2c91c7ce0f70cd8b50f1", "score": "0.0", "text": "def patient=(values_hash)\n @patient = {\n display_name: \"#{last_name}, #{first_name}\",\n first_name: first_name,\n last_name: last_name,\n date_of_birth: dob,\n patient_identifier: {\n ...
[ { "docid": "93235ba8bcaf859ccb17fa17460b6d4f", "score": "0.5495834", "text": "def what_are_your_values\n %w{Respect Communication Feedback Courage}\n end", "title": "" }, { "docid": "66a0e4e5a43e25b492f9722caf833957", "score": "0.54933053", "text": "def valid?\n \n \n ...
16666813a57b4e4bf950b585e06c5b84
Simple configuration check to ensure we have configs in place
[ { "docid": "5eb460a111bd763eb930dfccea36d956", "score": "0.684325", "text": "def sanity_check_system\n configuration_files = [\n \"#{$intrigue_basedir}/config/config.json\",\n \"#{$intrigue_basedir}/config/database.yml\",\n \"#{$intrigue_basedir}/config/sidekiq.yml\",\n \"#{$intrigue_basedi...
[ { "docid": "06c49dd560d1562d0401e4ed569342f7", "score": "0.8387524", "text": "def config_check; end", "title": "" }, { "docid": "0cb5125224685e3443cd65d6800959e7", "score": "0.8101008", "text": "def check_config config\n end", "title": "" }, { "docid": "1f793c1af5311...
f58fe6c217c0e615fd14acba68854e53
POST /offers POST /offers.json
[ { "docid": "7ec8b2a0d606737893ea76e4c6bc6164", "score": "0.62472075", "text": "def create\n @offer = current_user.offers.build(params[:offer]) do |offer|\n offer.is_parent_offer = true\n end\n\n respond_to do |format|\n if @offer.save\n expire_fragment \"recent_offers\" # TODO:...
[ { "docid": "119bf335b9c2e639e9a72ecb0fd5f6eb", "score": "0.8086226", "text": "def offers body\n post(\"/offers\", body: body.to_json)\n end", "title": "" }, { "docid": "17b9d478fdc175df52c01e291fb84179", "score": "0.7252544", "text": "def create\n @offer = Offer.new(pa...
75bb1c207f2380cbd2f1ee7ede800587
Trigger the success callback function attached to the client event that triggered this action. The object passed to this method will be passed as an argument to the callback function on the client.
[ { "docid": "c6e82db5fb89398138a3c1d27a2af990", "score": "0.6907194", "text": "def trigger_success(data=nil)\n event.success = true\n event.data = data\n event.trigger\n end", "title": "" } ]
[ { "docid": "7946c542009404d91d7808751f009a7e", "score": "0.7723116", "text": "def success &block\n @client.callback &block\n end", "title": "" }, { "docid": "0f93446273efcf565a7310bc4d1bc3e8", "score": "0.7272232", "text": "def on_success( &block )\n @on_success = ...
92a501c5d3773a175181d5d6d37cac75
This method is patched to prefetch the primary key (if necessary) and to ensure that the partitioning attributes are always included (AR will exclude them if the db column's default value is the same as the new record's value).
[ { "docid": "630b26143489cedd25d937d3188f87d5", "score": "0.54164684", "text": "def _create_record(attribute_names = self.attribute_names)\n # ****** BEGIN PARTITIONED PATCH ******\n if self.id.nil? && self.class.respond_to?(:prefetch_primary_key?) && self.class.prefetch_primary_key?\n s...
[ { "docid": "8a677861d7826f796b5ef637feeb7b53", "score": "0.6014228", "text": "def include_replicas_key\n ActiveRecord::VERSION::MAJOR >= 7 ? :include_hidden : :include_replicas\n end", "title": "" }, { "docid": "44e19d395ddcbea9e8157b556904436f", "score": "0.58581656", "text"...
853010c76b325bea6c717cf830d15453
ordena los resultados por el numero de caracteres
[ { "docid": "4fba8cebb339b30bfdf8c2e415a71cc7", "score": "0.53253233", "text": "def sort_by_num_characters( baptisms )\n baptisms.sort! do |x,y|\n if( y.num_characters != x.num_characters )\n y.num_characters <=> x.num_characters\n else\n y.max_chars <=> x.max_chars\n end\...
[ { "docid": "2cc340604027ae28f002bdae6e191224", "score": "0.60424435", "text": "def metadeStrin\n puts \"informe uma palavra obter a sua metade.\"\n var = gets.chomp\n var = var.insert(-1,'*') \n id = var.index('*')\n id = id /2 \n var = var[0,id]\n puts \"informe uma palavra pa...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "a82ba256c2ce1a27c689cb1be960b48a", "score": "0.0", "text": "def update!(**args)\n @aggregation_type = args[:aggregation_type] if args.key?(:aggregation_type)\n @data_state = args[:data_state] if args.key?(:data_state)\n @dimension_filter_groups = args[:dimension_fi...
[ { "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...
daa5705e9ae62e880f96f7c2fbd5bbc8
DELETE /courses/1 DELETE /courses/1.xml
[ { "docid": "4c97163575f19e42b9210196448550c7", "score": "0.68378973", "text": "def destroy\n if has_permissions_or_redirect(:admin, root_path)\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to(courses_url) }\n fo...
[ { "docid": "69806eb0400ceb80ac5053eb970d71ae", "score": "0.7261219", "text": "def destroy\n @course = Course.where(:id=>params[:id]).first()\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_courses_url) }\n format.xml { head :ok }\n end\n end", "...
49acdce43ec0e7633ff7181c4bde14a4
PATCH/PUT /launches/1 PATCH/PUT /launches/1.json
[ { "docid": "06b56c150606012a35f3c9990ec80984", "score": "0.633769", "text": "def update\n respond_to do |format|\n if @launch.update(launch_params)\n format.html { redirect_to [:lti, @lms_instance, @launch], notice: 'Tool launch was successfully updated.' }\n format.json { ...
[ { "docid": "cd7c96bd824997fdf4ccca71f6f2485d", "score": "0.64656526", "text": "def update\n respond_to do |format|\n if @lunch.update(lunch_params)\n format.html { redirect_to @lunch, notice: 'Lunch was successfully updated.' }\n format.json { head :no_content }\n else\n ...
3ea2f612e62d7eaf4fd1304dba48d2c4
Solution O(n) time / O(n) space
[ { "docid": "4202195e56d05b4cfeac36a177feaefb", "score": "0.0", "text": "def sunset_views(buildings, direction)\n candidate_buildings = []\n\n start_idx = direction == \"EAST\" ? 0 : buildings.length - 1\n step = direction ==\"EAST\" ? 1 : -1\n\n idx = start_idx\n\n while idx >= 0 && idx <...
[ { "docid": "75140bd92377e07bd7367ec852f43d4d", "score": "0.68422663", "text": "def solution(arr) end", "title": "" }, { "docid": "56e2f4c229d68e9d667cf5f5fe1d2177", "score": "0.6792505", "text": "def solution(a)\r\n # write your code in Ruby 2.2\r\n #a[0] = 1 [-1..1]\r\n #...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "ae138bfc4320998d19264c9aa9cd5f89", "score": "0.0", "text": "def client_params\n params.require(:client).permit(:ruc, :nombre, :apellido, :direccion, :telefono, :email,\n vehiculos_attributes: [:client_id, :modelo, :color, :matricula, :marca, :km, :chasis, :year_fab])\n end", ...
[ { "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...
04ad7e0d42f5477473844e3e7da716cc
DELETE /recording_users/1 DELETE /recording_users/1.json
[ { "docid": "b303c8dbad79a53e56b18e2cc1ead2c9", "score": "0.7636976", "text": "def destroy\n @recording_user.destroy\n respond_to do |format|\n format.html { redirect_to recording_users_url, notice: 'Recording user was successfully destroyed.' }\n format.json { head :no_content }\n end...
[ { "docid": "31be2fbd2b5aedc5e7088866cdb5f8a3", "score": "0.6984859", "text": "def delete_user_data(user_id)\n # Define a path referencing the user data using the user_id\n path = \"/d2l/api/lp/#{$lp_ver}/users/#{user_id}\" # setup user path\n _delete(path)\n puts '[+] User data deleted succe...
b575eae251a1210ee48d97001c663436
POST /datatypes POST /datatypes.json
[ { "docid": "69ce5e84fccfbd0b0140e37dc295aa94", "score": "0.6789828", "text": "def create # rubocop:disable Metrics/AbcSize, Metrics/MethodLength\n @datatype = Datatype.new(datatype_params)\n\n respond_to do |format|\n if @datatype.save\n format.html do\n redirect_to @datatype....
[ { "docid": "b46b743b95a6e0a4a28452679fd1d3c7", "score": "0.6434561", "text": "def create\n @dtype = Dtype.new(params[:dtype])\n\n respond_to do |format|\n if @dtype.save\n format.html { redirect_to @dtype, notice: 'Dtype was successfully created.' }\n format.json { render json: ...
ed3121b93815e46d983e8bc63f99fb73
Loop through all tags from the dialog and create the categories and tags automatically
[ { "docid": "95a40892ccd52584d066a0e60bcc04e8", "score": "0.58466464", "text": "def process_tags(category, single_value, tag)\n log(:info, \"Processing process_tags...\", true)\n # Convert to lower case and replace all non-word characters with underscores\n category_name = category.to_s.downcase.gsub(...
[ { "docid": "87e88bb0f1bd2ec6ca31d2add002be0d", "score": "0.6670955", "text": "def auto_create_tag\n\t\n\tget_tags.each do |tag|\n\t\t@items << Nanoc3::Item.new(\n\t\t\"<%= render 'tag', :tag => '#{tag}' %>\",\n\t { :title => \"Category: #{tag}\", :is_hidden => true, :tag => \"#{tag}\"}, # do not includ...
be754831dd4a47769fffdeaa72af5715
Method to check for presence of the param :changed_hearing_request_type
[ { "docid": "66bb865f6bc4c94265ff90039837da61", "score": "0.8280428", "text": "def changed_hearing_request_type_present?(params)\n changed_request_type_from_params(params).present?\n end", "title": "" } ]
[ { "docid": "f593d8b7692f7b3f8aded62a53dfdddf", "score": "0.8114698", "text": "def change_hearing_request_type_valid?(params)\n changed_request_type_from_params(params).to_s != appeal.changed_hearing_request_type\n end", "title": "" }, { "docid": "c9403adbac4f3bd11c0e6f50021a422d", "s...
8184157490a53b7bc2f3102d40226dac
GET /even_categories GET /even_categories.json
[ { "docid": "64d9aee6ce6def2b2430ff969aacb311", "score": "0.7408213", "text": "def index\n @even_categories = EvenCategory.all\n end", "title": "" } ]
[ { "docid": "efcb5e10780279c84a4be599091f0268", "score": "0.73438114", "text": "def categories\n call_api('/categories')\n end", "title": "" }, { "docid": "3cba43678b445865af5afd71d9719de9", "score": "0.7314763", "text": "def get_categories()\n response = RestClient.get @ho...
4544b9bb41529c2db3cc9c1db0fbb8c0
Takes a price as a string, and removes any commas.
[ { "docid": "ff10142903a214fb880e3d9d5080fe68", "score": "0.83064526", "text": "def clean_price(price)\n price.sub(/,/, '').to_f\n end", "title": "" } ]
[ { "docid": "b0608a1f325baaba89dd04cd29161179", "score": "0.85211116", "text": "def cleanup_price(price)\n price.delete(',$')\n end", "title": "" }, { "docid": "3ebee4927b8da212ce4f8e4fae1a18e0", "score": "0.74122655", "text": "def fix_currency(amount)\n return amount...
08766bf68e76220702c7e018b1c8a06d
Note: This is public for testing purposes. Creates package in DB according to given metadata
[ { "docid": "f857253f7d89552f374046403015a0db", "score": "0.7120103", "text": "def create_package(logger:, release_model:, fix:, compiled_release:, package_meta:, release_dir:)\n name = package_meta['name']\n version = package_meta['version']\n\n package_attrs = {\n ...
[ { "docid": "2cc299bd9d13cc282980aec43c9e9e2e", "score": "0.6550315", "text": "def create!\n create || raise(\"Errors in the package creation\")\n end", "title": "" }, { "docid": "452598322194c453f965e615b1a64a66", "score": "0.645272", "text": "def before_package_create(packag...
8b16699c37aecf69be254cdacad1421f
Determines if a chunk_size is valid.
[ { "docid": "e4b2060f34c440f5b993948de683d652", "score": "0.7707187", "text": "def verify_chunk_size! chunk_size\n chunk_size = chunk_size.to_i\n chunk_mod = 256 * 1024 # 256KB\n if (chunk_size.to_i % chunk_mod) != 0\n chunk_size = (chunk_size / chunk_mod) * chunk_mod\n ...
[ { "docid": "c86224303e8c186c4d67c03d284d7a0d", "score": "0.7438901", "text": "def valid_file_size?\n return (@io.size % @io.sector_size == 0)\n end", "title": "" }, { "docid": "cfc20b7d116462fea073dade0f5bac1a", "score": "0.73344827", "text": "def valid_size?\n @path.size....
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "5af971e3e279068329c447d4a72051f3", "score": "0.0", "text": "def paper_params\n params.require(:paper).permit(:title, :author1first, :author1mid, :author1last, :author1workplace, :author2first, :author2mid, :author2last, :author2workplace, :author3first, :author3mid, :author3last, :autho...
[ { "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...
2c74235457280920c48610d3e67ec484
Input: All analyze tools are enabled. Call all_analyze_tools_with_metrics function. Output: Return an array of all enabled analyze tools except C++Test
[ { "docid": "e1ac55a163f57ebf20096acd8bec52c7", "score": "0.5585921", "text": "def test_uts_at_m_011\n all = AnalyzeTool.find(:all)\n all.each do |tool|\n tool.in_use = true\n tool.save\n end unless all.blank?\n #\n analyze_tools = AnalyzeTool.all_analyze_tools_with_metrics\n ...
[ { "docid": "a6b145ee0b9c8dd14e90502f6f74551b", "score": "0.5993405", "text": "def dimensions_analyzers\n @dimensions_analyzers ||= DimensionsAnalyzer::SUPPORTED_TOOLS.inject({}) do |hash, tool|\n hash.merge!(tool => DimensionsAnalyzer.new(tool).method(:call))\n end\n ...
4add71ff32dc45341b820b184f368347
Create the object reserved method (i.e. a constructor?)
[ { "docid": "5497555a4ba83806219c12a2c5cb3b40", "score": "0.0", "text": "def initialize(names = \"World\")\n @names = names\n end", "title": "" } ]
[ { "docid": "7190831079e3a2236c6a9319cf37e25e", "score": "0.68740195", "text": "def create(*)\n unavailable_method\n end", "title": "" }, { "docid": "7190831079e3a2236c6a9319cf37e25e", "score": "0.68740195", "text": "def create(*)\n unavailable_method\n end", ...
ad6b51b333872e89bebfe096ec4784b4
Or write reverse method from scratch
[ { "docid": "635b6d0aebbfc0b892a12d9caee7b133", "score": "0.0", "text": "def reverse(an_array)\n\titems = an_array.length\n\treverse_array = Array.new(an_array.length)\n\twhile items > 0 do \n\t\treverse_array[an_array.length - items] = an_array[items - 1]\n\t\titems = items -1\t\t\n\tend\n\treverse_arra...
[ { "docid": "0467971f871b419534b1a9121f3baa7f", "score": "0.81993586", "text": "def reverse; end", "title": "" }, { "docid": "5ee1e9339ff8fa2288ac3c740480c4d7", "score": "0.80204415", "text": "def reverse\n end", "title": "" }, { "docid": "8cb1bcb0a172a89f2f20756bbb581f...