query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
ceaa44c87a43200ca9010a32cad0d0d9 | DELETE /distributor_stock_ledgers/1 DELETE /distributor_stock_ledgers/1.json | [
{
"docid": "2175954ac212b7bc0ba521b34093e283",
"score": "0.69318634",
"text": "def destroy\n @distributor_stock_ledger.destroy\n respond_to do |format|\n format.html { redirect_to corporate_path @distributor_stock_ledger.corporate_id, notice: 'Distributor stock ledger was successfully destroy... | [
{
"docid": "5cdc0dff5a4f14e611ed05d194c609f2",
"score": "0.7008135",
"text": "def destroy\n @distributors.delete(params[:id])\n File.open(Rails.root.join('db', 'distributors.json'), 'w') { |f| f.write(JSON.pretty_generate(@distributors)) }\n redirect_to root_url\n end",
"title": ""
},
... |
d8a2418480732f058d4eaeaf48d163a1 | get the projected pts/gm | [
{
"docid": "fc678da772a26f31c981ff33930f513b",
"score": "0.0",
"text": "def prjct_pts_game\n return 0 if lwl_pts.nil?\n lwl_pts / GAMES_IN_SEASON\n end",
"title": ""
}
] | [
{
"docid": "c3ae6597471cfd32cb4b0a623006419d",
"score": "0.6581016",
"text": "def pts\n ( w * 3 ) + d\n end",
"title": ""
},
{
"docid": "84e0473042351502a04d506dcc2a6406",
"score": "0.655923",
"text": "def perspective_projection coords\n scaleFactor = @focal_length / coords[2]... |
b16ffa0ccfbe08ca40462b81f8bbadb7 | This function will generate the js cache for the form | [
{
"docid": "7ddcb8b71c6ab23084a1c1ea38147122",
"score": "0.71122223",
"text": "def render_view_js_cache\n # TODO: nothing here yet, must revisit when deciding to create master field class for a profile\n # that can render individual fields on the fly in the browser\n end",
"title": ""
}
] | [
{
"docid": "a0bf51f273f35b9c53512d6d61960454",
"score": "0.6319787",
"text": "def rebuild_cache(code) \n return if (!self.code.blank?() and !SmerfFile.modified?(code, self.cache_date)) \n # First clear the current cache\n self.cache = nil ; self.save if (!code.blank?)\n self.cache = ... |
c74ddfd5df1ece0a0c809540a975607d | Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.user_mailer.welcome.subject | [
{
"docid": "f70da6c4a018b7d508da20e9a2256c5e",
"score": "0.0",
"text": "def welcome_email(user)\n @user = user\n @token = create_reset_password_token(@user)\n mail(from: 'enricher@enri-cher.com', to: @user.email, subject: 'Welcome to Enri\\'cher')\n\n # raise\n # from = Email.new(email: '... | [
{
"docid": "f2fecd58a29b9acf94ad3b95a78dc2e7",
"score": "0.79724044",
"text": "def welcome_email_subject\n @attributes[:welcome_email_subject]\n end",
"title": ""
},
{
"docid": "ea740e704e8f1173fb87b45dfcaaf989",
"score": "0.7640795",
"text": "def subject_for(key)\n I18n.t... |
e62dbeeae5c836f9adf1781c7480955f | Author: Karim ElBawab Team: 4 Method: position Parameters: There are 3 parameters that passed to its view : the current member id , the latiude and longitude (both latiude and longitude passed using gon gem to be able to use them into javascript code) Function: this action is used to give the user the ability to set hi... | [
{
"docid": "d9e570e53937ce9afe0d74f9b62137a5",
"score": "0.7223364",
"text": "def position\n @address = Address.find(params[:id])\n\n gon.lat = @address.coordinates[1]\n gon.lng = @address.coordinates[0]\n\n end",
"title": ""
}
] | [
{
"docid": "6f6242ea779ebd19ccad9db493da0f67",
"score": "0.65961766",
"text": "def set_coords\n \n results = Geocoder.search(self.address)\n location = results.first.coordinates # grabbing the first set of lat long\n self.longitude = location[1]\n self.latitude = location[0] # setting for ... |
9ce4917dd2ac00724cb9f340eaaf91c9 | Post to Brightcove using a particular API method, api_method. The parameters hash is where you add all the required parameters appropriate for the API call. | [
{
"docid": "da742c12e6a27e7fbe20977312948808",
"score": "0.7655976",
"text": "def post(api_method, parameters = {})\n parameters.merge!({\"token\" => @token})\n\n body = {}\n body.merge!({:method => api_method})\n body.merge!({:params => parameters})\n\n result self.class.post(@... | [
{
"docid": "3f262cf66efdcb616202091bf7d5bcd9",
"score": "0.7708047",
"text": "def post(api_method, parameters = {})\n parameters.merge!({\"token\" => @token})\n\n body = {}\n body.merge!({:method => api_method})\n body.merge!({:params => parameters})\n\n self.class.post(@write_a... |
6c76ad9a9635887ee4fb483182c24dc9 | Action to download the selected songs as an Excel file | [
{
"docid": "65192479b1effec39ab118e072200a1f",
"score": "0.71040046",
"text": "def excel\n\n excel_songs = get_songs_search_from_params\n excel_songs.select_extra_columns = true\n excel_songs = excel_songs.songs_found.map { |s|\n [ s[SongsSearch::IDX_ARTIST_NAME] , s[SongsSearch::IDX_ALBUM... | [
{
"docid": "3a908791077cddd5017085f26a09360b",
"score": "0.66432965",
"text": "def index\n @items = Item.all\n respond_to do |format|\n format.xlsx {\n response.headers[\n 'Content-Disposition'\n ] = \"attachment; filename='items.xlsx'\"\n }\n format.html { re... |
f6dece899aa9bb0faaf9781f8d366f7e | GET /picked_things/1 GET /picked_things/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "e35bc4b4383a7fa92a6fedaa7cf0b291",
"score": "0.6974707",
"text": "def index\n @picked_things = PickedThing.all\n end",
"title": ""
},
{
"docid": "5ded8a02ac996e0a6320ab690fcf1bfc",
"score": "0.668661",
"text": "def show\n @pick = Pick.find(params[:id])\n\n respo... |
5448684663935b4bfaf4505d64950f83 | POST /payment_types POST /payment_types.json | [
{
"docid": "8bb27fe87851bac80028196ea371eaf3",
"score": "0.6788176",
"text": "def create\r\n @payment_type = PaymentType.new(payment_type_params)\r\n\r\n respond_to do |format|\r\n if @payment_type.save\r\n format.html { redirect_to @payment_type, success: 'Payment type was successfull... | [
{
"docid": "d9ac9e31ce76acb5e43f71244e5875ad",
"score": "0.79133314",
"text": "def payment_types\n url = \"#{@url}reference/payment-types\"\n make_request(url)\n end",
"title": ""
},
{
"docid": "c36b1aac1024d02bc4d2c14d24f7ec64",
"score": "0.73269695",
"text": "def create\n ... |
99682aa582ce3e15a2c1c422b7f87348 | =begin Convert pay date that is saved in system time to user's time, if paydate is nil return it without any conversions Returns +pay_date+ datetime when note was paid in current users timezone =end | [
{
"docid": "6b816b4c05f01d6164cf6f2ab45f0b8c",
"score": "0.7831993",
"text": "def pay_date\n datetime = read_attribute(:pay_date)\n if datetime\n User.current.user_time(datetime)\n end\n end",
"title": ""
}
] | [
{
"docid": "a85cf347026754f4c017f10f8d608202",
"score": "0.6788087",
"text": "def date\n pay_date.nil? ? ex_date : pay_date\n end",
"title": ""
},
{
"docid": "5273bb571fc155c6e325bad38b1d31eb",
"score": "0.67370486",
"text": "def pay_date= datetime\n if datetime\n datetim... |
e59e63c83748e4a11a9c60c506693b10 | Creates a task that will execute the specified framework task. | [
{
"docid": "553d83ab379b1b1758ad1a2590763ce7",
"score": "0.68801284",
"text": "def create_task(task, group, overrides = {})\n defaults = {task_name: task, args: [], depends_on: []}\n overrides = defaults.merge(overrides)\n #\n task_name = overrides[:task_name]\n args = overrides... | [
{
"docid": "ce33d8675a4284ac128feb5f833182c3",
"score": "0.7240482",
"text": "def task(args, &block)\n Rake::Task.define_task(args, &block)\nend",
"title": ""
},
{
"docid": "10c516df1fc47d9c65d8f3bd2763a013",
"score": "0.70371765",
"text": "def task(*args, &block) # :doc:\n Rak... |
77005156a072ad1b8b5f821c91a378cf | Public: Save and raise Mapymo::Persistence::RecordNotSaved if the call fails. See save. | [
{
"docid": "854feb4defef3dc570129042e54c72b7",
"score": "0.72711134",
"text": "def save!(save_options = {})\n begin\n self.class.dynamodb_config.mapper.save(self, save_options)\n rescue Mapymo::Error => e\n raise RecordNotSaved.new(e)\n end\n end",
"title": ""
}
] | [
{
"docid": "03269e87d38e5330f3c17faf8e538787",
"score": "0.80859035",
"text": "def save!\n self.save || raise(ActiveRecord::RecordNotSaved.new(nil, self))\n end",
"title": ""
},
{
"docid": "cde945b852837418a121671c45211364",
"score": "0.8019929",
"text": "def save!\n sav... |
bbfaea90bf413a3f6549cbe7d26e6324 | shift servers to keep alignment with server_names indices. num should always be +/1 | [
{
"docid": "8c9262c537c91d0c66ffc33aa92874ad",
"score": "0.7677929",
"text": "def shift_server_num( server_number, num )\n\t\t@server_names[server_number + 1, @server_names.length - 1 - server_number].each { |server_name| \n\t\t\t@servers[server_name].number += num\n\t\t}\n\tend",
"title": ""
}
] | [
{
"docid": "ccbdeb523c0a0e0b224c1be29534935e",
"score": "0.76399773",
"text": "def shift_server_pos( server_number, num )\n\t\t@server_names[server_number + 1, @server_names.length - 1 - server_number].each { |server_name| \n\t\t\t@servers[server_name].position += num\n\t\t}\n\tend",
"title": ""
}... |
769c3492740fe96d4f8806a2cddfce7a | q | 64bit signed, native endian (int64_t) | [
{
"docid": "d5a1a6d093e6c580d467053cda0cd3e3",
"score": "0.6380218",
"text": "def i64(num)\n @packed << [num].pack(\"q>\")\n end",
"title": ""
}
] | [
{
"docid": "8c40d1ab5cc59f48211fb9345336dfbe",
"score": "0.7128675",
"text": "def q(addr)\n Util::Packing.u64(n(addr, 8))\n end",
"title": ""
},
{
"docid": "74a71728f911c67d9fe5f849f8a452e2",
"score": "0.6874759",
"text": "def integer_to_signed_be_64 value\n return [... |
170d5611b0c9b3be26680ebe6d282aea | Read csv once in order to capture headers, then rewind. | [
{
"docid": "9c58ce0124a6aa069f794e8810f39469",
"score": "0.6357661",
"text": "def log_headers(csv)\n headers = csv.readline.to_h.keys\n csv.rewind\n MotiaTools.logger.info(\n \"\\nCSV opened with #{headers.count} headers:\\n\"\\\n \"#{headers.join(', ')}\")\n end",
"title": ""
... | [
{
"docid": "0b16b6b2c37380308ab40103ee6743c4",
"score": "0.726819",
"text": "def read\n headers\n @csv.read\n end",
"title": ""
},
{
"docid": "ce67c308992c2954ad51be51fb7a0968",
"score": "0.6958336",
"text": "def rewind\n @headers = nil\n @lineno = 0\n\n @io.re... |
63658e2c6cf086d35f08d30b4e581bef | Google appends ' source' at the end of every feed. This removes that. | [
{
"docid": "660c73daa09a137f2e738db09635a1c0",
"score": "0.0",
"text": "def remove_source(string)\n string.split(' - ')[0]\nend",
"title": ""
}
] | [
{
"docid": "07756f3a852f5545ef7a4da9d863a90e",
"score": "0.6107705",
"text": "def source_code_feed=(feed)\n super(feed.gsub(/^feed:/, 'http:'))\n end",
"title": ""
},
{
"docid": "7086e5d5f3f44a818c4d0e32ba79d00b",
"score": "0.6008723",
"text": "def add_source!\n result['sour... |
754346e7fd522716600d52c6e7bd9aa3 | Retrieves the comments for a specific post. | [
{
"docid": "5e6e0aeece28c18157f403c60aa79cfb",
"score": "0.0",
"text": "def comments(options = {})\n urn = options.delete(:urn)\n path = \"/socialActions/#{urn}/comments\"\n get(path, options)\n end",
"title": ""
}
] | [
{
"docid": "71a9333402ac1474fbe9c95999929bf6",
"score": "0.7931493",
"text": "def get_comments(account_id, post_id, v, opts = {})\n data, _status_code, _headers = get_comments_with_http_info(account_id, post_id, v, opts)\n return data\n end",
"title": ""
},
{
"docid": "30a98518f... |
e7274a404f961cd047f24ec694c946b6 | PATCH/PUT /jobs/1 PATCH/PUT /jobs/1.json | [
{
"docid": "10b65d6ef9ec329e2779c302326a8b0e",
"score": "0.0",
"text": "def update\n if user_signed_in? and current_user.id == @job.user_id\n respond_to do |format|\n if @job.update(job_params)\n format.html { redirect_to @job, notice: 'Job was successfully updated.' }\n ... | [
{
"docid": "bb1acb04a7a42a40db9b7b0e4aa3f572",
"score": "0.7266321",
"text": "def update\n @job = Job.find(params[:id])\n\n if @job.update(job_params)\n head :no_content\n else\n render json: @job.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"do... |
81755f6f4f3585fe98378bafce04e52b | Sleep the current thread for a specific number of milliseconds. | [
{
"docid": "7cec570d08b53fea8838001eacc92e91",
"score": "0.8060145",
"text": "def msleep( msec )\n NSThread.sleepForTimeInterval(msec / 1000.0)\n end",
"title": ""
}
] | [
{
"docid": "1850588ea150732940797e8f21163ffc",
"score": "0.7562631",
"text": "def sleep(n)\n Kernel.sleep(n)\n end",
"title": ""
},
{
"docid": "10e45fd8f4368de9d122d28abff8f352",
"score": "0.72913486",
"text": "def sleep(dur=0) end",
"title": ""
},
{
"doci... |
2e3c33998d7fbce2288637018589eef2 | Changes the username of a supergroup or channel, requires creator privileges in the supergroup or channel. | [
{
"docid": "61d1ac5cf1ba15f0d8d5b222cfee35d9",
"score": "0.7151834",
"text": "def set_supergroup_username(supergroup_id, username = \"\")\n broadcast('@type' => 'setSupergroupUsername',\n 'supergroup_id' => supergroup_id,\n 'username' => username)\n end",
"... | [
{
"docid": "a9befc3fc0742a15df62557f243451b5",
"score": "0.61516035",
"text": "def add_user_to_group(username, groupname)\n\t\t\t\t# Check for validity first\n\t\t\t\tsuper(username, groupname)\n\n\n\t\t\t\t`/usr/sbin/pw groupmod #{shellescape(groupname)} -m #{shellescape(username)}`\n\t\t\tend",
"t... |
8d5f015b8426e720f466f11f4879737c | Retrieve the product price with certain `productId`. | [
{
"docid": "c523004bb06b66d4851f1e4bc65808bf",
"score": "0.7610202",
"text": "def retrieve_product_price(productId=nil)\n if productId.class == String && block_given?\n @j_del.java_method(:retrieveProductPrice, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(p... | [
{
"docid": "f88866196b74f4adbacf74dc4acdbcfe",
"score": "0.7610704",
"text": "def getProductById(productId)\n params = {}\n path = \"/products/product/#{productId}\"\n method = 'GET'\n product = call_with_cache(method, params, path)\n product = convert_to_object(product)\n ... |
fcec0f42de319e806dd6a894a9cf9fa2 | url for the plugin | [
{
"docid": "30d5ea528dd81cac3c5c568bf2779760",
"score": "0.7376609",
"text": "def url\n domain = 'https://thingspeak.com'\n domain = 'http://staging.thingspeak.com' if Rails.env.staging?\n domain = 'http://127.0.0.1:3000' if Rails.env.development?\n return \"#{domain}/plugins/#{self.id}\"\n ... | [
{
"docid": "a02f0197462e77a19e4a465b4c33145c",
"score": "0.8101727",
"text": "def plugin_url\n attributes = get('/plugin')\n attributes[\"url\"]\n end",
"title": ""
},
{
"docid": "d746da410f4d66f88d64e1d1863e7844",
"score": "0.7688822",
"text": "def url\n end",
... |
d21dd206bd91fa59d84ad3cebdf8de1a | forces git log to run | [
{
"docid": "619d930b013ad32678919ff26cccc38c",
"score": "0.0",
"text": "def size\n check_log\n @commits.size rescue nil\n end",
"title": ""
}
] | [
{
"docid": "e4ea10697586b3f6ccc9e2943674694b",
"score": "0.7190938",
"text": "def log\n found = false\n arguments = args.map do |arg|\n case arg\n when /^-/, '..', '...'\n arg\n when /^(.*?)(\\.{2,3})(.*)$/\n found = true\n \"#{fetch_release_commit($1)}#$2#{fetc... |
c955cfc6b3c1ffcf278d2d6e0b35212d | POST /clients POST /clients.json | [
{
"docid": "375eff0c982b0da3203a85928b435519",
"score": "0.73098975",
"text": "def create\n @client = Client.new(client_params)\n\n if @client.save\n render json: @client, status: :created\n else\n render json: @client.errors, status: :unprocessable_entity\n end\n end",
"title... | [
{
"docid": "463c7897bc343b5c33ded0eb3d7c38a8",
"score": "0.7867169",
"text": "def create\n http_api.post(\"clients\", self)\n end",
"title": ""
},
{
"docid": "84186d209e6b5dca2e0c8146b546a058",
"score": "0.7761909",
"text": "def create_client(params={})\n post('/clients', ... |
0a9c464490009865c724763b2ac52c16 | Return the tumor sample (used in two sample VCF) | [
{
"docid": "a912546e846e74e39d70918a3dc5f431",
"score": "0.6138207",
"text": "def tumor\n @tumor ||= VcfGenotypeField.new(@fields[10],format,@header,ref,alt)\n end",
"title": ""
}
] | [
{
"docid": "51384a45aacb229db9df31b5454b176c",
"score": "0.6196155",
"text": "def samples; end",
"title": ""
},
{
"docid": "51384a45aacb229db9df31b5454b176c",
"score": "0.6196155",
"text": "def samples; end",
"title": ""
},
{
"docid": "b140118df281fce42a3455b7812431c6",
... |
3986407662280dd37fea20fab9e4f0ed | Does _not_ include any _exact_ results matching `end_string` | [
{
"docid": "ebb0a5a9ee6130ae69a1908a755d029b",
"score": "0.0",
"text": "def generate_regex_before(end_string)\n first_char_match = get_regex_character_match(end_string[0])\n if (end_string.length > 1)\n range_before_next = get_range_before(end_string[1])\n recursive_range = generate_rege... | [
{
"docid": "571485effa1c49f52dada33c21b5e14c",
"score": "0.7086226",
"text": "def exclude(start_string, end_string, &func_if_not_found)\n exclusion_regexp = Regexp.new(\n Regexp.escape(start_string) + \".*?\" + Regexp.escape(end_string),\n Regexp::MULTILINE\n )\n func_if_not_found.(st... |
cafe11bd92e1abf67eb453486df0dcc5 | Query the value of a charvalued variable attribute. | [
{
"docid": "821c88f1efa33dd68e468d80c80a4c6b",
"score": "0.6989393",
"text": "def get_char(attr); end",
"title": ""
}
] | [
{
"docid": "421115ce5f99ae3d91d701e87178ccca",
"score": "0.6222694",
"text": "def set_char(attr, val); end",
"title": ""
},
{
"docid": "66b9eaee7e133f758ce6ef8fd023eb4a",
"score": "0.6036885",
"text": "def get_attribute_value(attribute)\n data[attribute]\n end",
"title": ""
... |
931e6108fa9563da4aa1e9ce9599ba9a | Lower the turtle's pen. If the pen is down, the turtle will draw; i.e., it will lay a track until a pen_up command is given. | [
{
"docid": "07603caddfd420ac8e1cd7ae1c4b14e6",
"score": "0.6800871",
"text": "def pen_down\n if pen_up?\n @segment = [@xy.dup]\n @track << @segment\n end\n end",
"title": ""
}
] | [
{
"docid": "90752bc71026581d4b8cda849ec5edb7",
"score": "0.7937785",
"text": "def pen_up\n @pen = false\n end",
"title": ""
},
{
"docid": "b6bda5aa93d30cb1b93dc077a25c0aab",
"score": "0.78516686",
"text": "def pen_up\n @pen_down = false\n end",
"title": ""
},
{
"d... |
d22dd8f63972a0991422fa779653248b | define the arguments that the user will input | [
{
"docid": "6edc7eb03cec36ab1af270bec60e4881",
"score": "0.0",
"text": "def arguments(model = nil)\r\n args = OpenStudio::Measure::OSArgumentVector.new\r\n\r\n #make an argument for the reporting frequency\r\n reporting_frequency_chs = OpenStudio::StringVector.new\r\n reporting_frequency_chs... | [
{
"docid": "c62750f6e8d591e4a244028ec8cd5a7a",
"score": "0.7418197",
"text": "def arguments\n end",
"title": ""
},
{
"docid": "49665d066ffcf52f2c37b2b1c268e6fd",
"score": "0.73753476",
"text": "def arguments; end",
"title": ""
},
{
"docid": "49665d066ffcf52f2c37b2b1c26... |
13191b4f4a23d841c6f1330e46bd19ed | Used by the reporter to send messages to the output stream. | [
{
"docid": "703df1814bb211ad806d667849368c7d",
"score": "0.0",
"text": "def message(notification); end",
"title": ""
}
] | [
{
"docid": "5f22f1d7c0c7cad85b2ac16273b58b58",
"score": "0.70438355",
"text": "def send_to_output!\n @sous_output.call(run_data: run_data, node_data: node_data, resources_data: @processed)\n rescue => e\n logger.warn(\"Output failed: #{e.message}\")\n end",
"title": ""
},
{
"... |
7d24070dc9f4974dfc88538e1a2d3825 | Update the created_at time on the object | [
{
"docid": "ff638a378deb01de494cd054a7ff5ba9",
"score": "0.76324534",
"text": "def do_set_created_at(context = :default)\n self.created_at = Time.now if self.new?\n end",
"title": ""
}
] | [
{
"docid": "21deb8872d0210aef6413aa72b61d276",
"score": "0.8374721",
"text": "def touch obj\n obj.created_at = Time.now\n end",
"title": ""
},
{
"docid": "9138490f2ff58efa08ef978cdf2d6d43",
"score": "0.8227025",
"text": "def set_created_at_time\n self.created_at = Time.now\n ... |
d5b411d075a8fcc9ff394b09e4627167 | returns the indicated index to " " | [
{
"docid": "fd7dd9ce42c4eaf4f310bf0e5afa15e5",
"score": "0.57295096",
"text": "def undoMove(index)\n @board[index] = \" \"\n end",
"title": ""
}
] | [
{
"docid": "8e25a530ec357197cce18c97f828def8",
"score": "0.67804736",
"text": "def input_to_index(position)\nindex = position.strip.to_i - 1\nreturn index\nend",
"title": ""
},
{
"docid": "0135869c35f60a6724720e158ab13c6b",
"score": "0.6729337",
"text": "def character(index = nil)\n ... |
d97f21c37dd0e1a442c358ccad41f6a2 | PUT /identities/1 PUT /identities/1.xml | [
{
"docid": "eb6c28c2a0719adcbab815e458a86a92",
"score": "0.6023655",
"text": "def update\n @identity = Identity.where(:user_id => current_user.id, :id => params[:id]).first\n\n respond_to do |format|\n if @identity.update_attributes(params[:identity])\n format.html { redirect_to(@ident... | [
{
"docid": "3a0f7246148a1e604311cc6f98c08ea2",
"score": "0.6069292",
"text": "def update\n @identity = Identity.find(params[:id])\n\n respond_to do |format|\n if @identity.update_attributes(params[:identity])\n format.html { redirect_to @identity, notice: 'Identity was successfully upd... |
9ca87272266fdbb3787a6b3054e7b521 | BULK GRADE EXEMPTIONS: REVIEW: Retrieve all the grade objects for a provided user in a provided org unit with exemption status included. RETURNS: BulkGradeObjectExemptionResult JSON block. | [
{
"docid": "9b2f334c6b6b858a8c6d18cb4c67aa59",
"score": "0.70484424",
"text": "def get_user_grade_exemptions(org_unit_id, user_id)\n path = \"/d2l/api/le/#{$le_ver}/#{org_unit_id}/grades/exemptions/#{user_id}\"\n _get(path)\n # RETURNS: BulkGradeObjectExemptionResult JSON block.\nend",
"tit... | [
{
"docid": "83bc3921792866468d133d0bd3a52896",
"score": "0.6566563",
"text": "def bulk_grade_exemption_update(org_unit_id, user_id, bulk_grade_exemption_update_block)\n # Grade.BulkGradeObjectExemptionUpdate JSON data block example:\n # {\"ExemptedIds\" => [0,1,2,3], # D2LIDs\n # \"UnexemptedId... |
410807186ebe358332aabda55fd3a058 | GET Variable Locale API | [
{
"docid": "c93564f78d64b8109f47d912691b23cd",
"score": "0.0",
"text": "def get(*arguments)\n\t\tcase arguments.length\n\t\twhen 1; result = $game_selfVars[@map_id, @id, arguments[0]]\n\t\twhen 2; result = $game_selfVars[@map_id, arguments[0], arguments[1]]\n\t\twhen 3; result = $game_selfVars[arguments... | [
{
"docid": "e5505ced51e441c01ec7624e7931ff63",
"score": "0.74834687",
"text": "def GetLocale id\n\n APICall(path: \"locales/#{id}.json\")\n\n end",
"title": ""
},
{
"docid": "e62512a45ae5c4da0ed282e33e0e852b",
"score": "0.70011216",
"text": "def GetLocales params = {}\n\n... |
64be8017b5917ca44cd41f363a9c08a6 | get page header information | [
{
"docid": "e75f7284a0328a60482cbefb1ec410b4",
"score": "0.0",
"text": "def cells_page_setup_get_header(name, sheet_name, opts = {})\n warn \"Warning: #cells_page_setup_get_header() is deprecated.\"\n data, _status_code, _headers = cells_page_setup_get_header_with_http_info(name, sheet_name, o... | [
{
"docid": "ebf444ea3ce8b7aeee5b8a68f32599aa",
"score": "0.7349706",
"text": "def page_header\n params_to_title( true )\n end",
"title": ""
},
{
"docid": "27652136c39b6e0571c32564b0c1d42c",
"score": "0.72003007",
"text": "def __header(page_num)\n __header_or_footer(@header, pa... |
3bab142dbcec8533a595609ce1e5e65e | POST /job_applications POST /job_applications.json | [
{
"docid": "ab6e8024cac7343bb3f4e21120c7812f",
"score": "0.7298036",
"text": "def create\n \t@job = Job.find(params[:job_id])\n @job_application = JobApplication.new(params[:job_application])\n @job_application.user_id = current_user.id\n @job_application.job_id = @job.id\n respond_to do |f... | [
{
"docid": "d1812458254d8072ea2994b92441cf87",
"score": "0.7515062",
"text": "def create\n @job_app = JobApp.new(job_app_params)\n\n respond_to do |format|\n if @job_app.save\n format.html { redirect_to @job_app, notice: 'Job app was successfully created.' }\n format.json { rend... |
88948e91ebd437725e89182438306855 | == MovieCategories Fetch all assigned Categories for a movie. This method returns all categories, ordered by the number of votes. The categories are not split into the separate CategoryTypes. You can fetch categories by type by using the methods, named after each type of Category. See Category for more infomation about... | [
{
"docid": "6ffa0045a1efd3ac9d432c87b278baf7",
"score": "0.6831332",
"text": "def categories\n Category.categories_for_movie self\n end",
"title": ""
}
] | [
{
"docid": "33df9b7cff48949616dae9d0ec8214df",
"score": "0.6489155",
"text": "def categories_list\n @categories = Category.all.collect { |p| [p.name, p.id] }\n end",
"title": ""
},
{
"docid": "33f9e640cb208d77b78a589cab56b8c9",
"score": "0.6473438",
"text": "def index\n @categ... |
dd0b50fce660b1aa5826180adcb1b042 | Setup the headless test runner, if necessary | [
{
"docid": "9501bb38d3218330270234f7b551f9c1",
"score": "0.81914",
"text": "def setup_headless()\r\n xvfbRunPath = parse([BUILD_PROPERTIES, LOCAL_PROPERTIES])[\"config_xvfbRunPath\"]\r\n if !isWindows and (xvfbRunPath and xvfbRunPath.length > 0)\r\n require 'headless'\r\n puts \"Running te... | [
{
"docid": "17436fe4be3dfe1711d197357c7b2884",
"score": "0.7464781",
"text": "def setup_headless_env\n # although this occasionally fails, it seems to be temporary and refreshing the page can help.\n RoutesInit.connect_to_firefox_with_timeout(20)\n end",
"title": ""
},
{
"docid": "11f... |
6dcc3177b18ac91bc35d280078dbb260 | POST /requirement_types POST /requirement_types.xml | [
{
"docid": "dcd18bb528aa081bf11879ff8c6b8768",
"score": "0.6920949",
"text": "def create\n @requirement_type = RequirementType.new(params[:requirement_type])\n\n respond_to do |format|\n if @requirement_type.save\n flash[:notice] = 'RequirementType was successfully created.'\n f... | [
{
"docid": "1d8a488b1fe7e863d92b69e3af844b52",
"score": "0.6207153",
"text": "def degree_requirement_type_params\n params.require(:degree_requirement_type).permit(:type_of_degree_requirement, :degree_requirement_id)\n end",
"title": ""
},
{
"docid": "86b1688971b479df12de3311940c76e6"... |
730a27afdc8f6bc9cc888f560dc724cc | Function to load an Excel file and convert each sheet into a hash | [
{
"docid": "c8b2776cb4af85d1679cc766f85aaa73",
"score": "0.7243958",
"text": "def load_excel_file(file_path)\n excel = Roo::Spreadsheet.open(file_path)\n \n worksheets = excel.sheets.map do |sheet_name|\n sheet = excel.sheet(sheet_name)\n headers = sheet.row(1)\n data = []\n \n (2..she... | [
{
"docid": "7c884b7ff296bece1b879124b3c40a4e",
"score": "0.7649947",
"text": "def excel_to_hash(excel_file, sheet_name = nil)\n excel = read_excel(excel_file)\n excel = excel.sheet(sheet_name) unless sheet_name.nil?\n keys = excel.row(1)\n output = excel.map {|k| Hash[keys.zip(k.to_a)]}\n output.sh... |
d0848cee9ea416dfbd5b07103b6fd1ec | get every test to pass before coding runner below | [
{
"docid": "7cc29e52ab353e7281056188626f26c0",
"score": "0.0",
"text": "def runner\n welcome\n total = initial_round\n until total > 21 do\n total = hit?(total)\n puts \"Your cards add up to #{total}\"\n end\n end_game(total)\nend",
"title": ""
}
] | [
{
"docid": "4214d9c38556c2b02453744c9abd3771",
"score": "0.7492311",
"text": "def pass(suite, test, test_runner); end",
"title": ""
},
{
"docid": "e820a876acc56d01d07c4fe31f07d454",
"score": "0.74173",
"text": "def run_tests\n count = 0\n puts \"Starting test run...\"\n self... |
1fbbad82e49a24e1ceec71275440c969 | POST /bug_reports POST /bug_reports.json | [
{
"docid": "714a2c553ae2b80e766d77b6e3b8eade",
"score": "0.7341884",
"text": "def create\n @bug_report = BugReport.new(params[:bug_report])\n\n respond_to do |format|\n if @bug_report.save\n format.html { redirect_to @bug_report, notice: 'Bug report was successfully created.' }\n ... | [
{
"docid": "727670220174fcd035a034404a1d2867",
"score": "0.73245156",
"text": "def create\n @bugreport = Bugreport.new(bugreport_params)\n\n respond_to do |format|\n if @bugreport.save\n format.html { redirect_to @bugreport, notice: 'Bugreport was successfully created.' }\n form... |
fe0fea60ced0def3932c6fb1b67731f2 | Show a red error message that is prefixed with ERROR. | [
{
"docid": "e26092dca242199301266ca2cc06a959",
"score": "0.6536366",
"text": "def error(message, options = {})\n _filtered_logger_message(message, :error, :red, options)\n end",
"title": ""
}
] | [
{
"docid": "6676717dc7d8323a05c6cb92309fd414",
"score": "0.82811284",
"text": "def error(message)\n puts prefix + Rainbow(message).red\n end",
"title": ""
},
{
"docid": "d5726911b60c7d957a0df44ee44b2116",
"score": "0.804877",
"text": "def error(msg)\n puts red(bold(\"[!]... |
6201162075ab73f9e8424f0d7c4c492e | DELETE /items/1 DELETE /items/1.json | [
{
"docid": "89d402bf8868b17541d2105af0a73bde",
"score": "0.74881107",
"text": "def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] | [
{
"docid": "86faa8c555419d7144a0c7003f760dff",
"score": "0.7906849",
"text": "def delete\n render json: Item.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "119acbd53f246ab3b80d6d093babf58b",
"score": "0.76885504",
"text": "def delete(items)\n item_ids = items.... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "91896057b1101182263c93d355181944",
"score": "0.0",
"text": "def set_match\n @match = Match.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... |
c245a2daf3ae7733b2ba457b24440449 | GET /stories/new GET /stories/new.xml | [
{
"docid": "d6626cd49921b531f65a81064ad9ef6c",
"score": "0.7618789",
"text": "def new\n @story = Story.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @story }\n end\n end",
"title": ""
}
] | [
{
"docid": "9a3103452984eaf6ed9b68b64334c783",
"score": "0.7301097",
"text": "def new\n @story = Story.new\n @categories = Category.find(:all)\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @story }\n end\n end",
"title": ""
},
{
... |
48ab32770c1dcbf2795d4ddd145e7942 | trans1d ::= (shape1d, point1d) :: Shape1d x Point1d >? Shape1d | [
{
"docid": "7f12c99fd18b95b21c53431890057e11",
"score": "0.88419676",
"text": "def trans1d(shape1d, point1d)\n check_pre((shape1d?(shape1d) and point1d.point1d?))\n if (shape1d.range1d?) then\n Range1d[trans0d(shape1d.first, point1d), trans0d(shape1d.last, point1d)]\n elsif shape1d.union1d? then\n... | [
{
"docid": "c52bc91b64af9c311bda52720d0695cb",
"score": "0.8099305",
"text": "def trans1d(shape, point)\n if range1d?(shape)\n range_int(shape, point)\n elsif shape.union1d? \n Union1d[trans1d(shape.left, point), trans1d(shape.right, point)]\n else check_pre(false)\n end\nend",
"... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "6f8a9d275a9f188e6939c5aa20a9fb59",
"score": "0.0",
"text": "def update!(**args)\n @content_data_ref = args[:content_data_ref] if args.key?(:content_data_ref)\n @content_format = args[:content_format] if args.key?(:content_format)\n @hash_prop = args[:hash_prop] if ... | [
{
"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... |
60fe513ced0a6ea8fa4661671b49ef60 | Part 1: Score valid groups | [
{
"docid": "4363a2183dd70c251a2e95c5565c4c7e",
"score": "0.0",
"text": "def score\n group_stack = 0\n total_score = 0\n is_garbage = false\n is_skip = false\n @phrase.each_char.with_index do |char, ind|\n if is_skip\n is_skip = false\n next\n end\n\n if char =... | [
{
"docid": "d49fa3d34aa6f6e2d269c0d6f6113774",
"score": "0.6810594",
"text": "def valid_group(cards)\n puts validate(cards)\nend",
"title": ""
},
{
"docid": "3983d0ea6b0f9ab6254ed59c12fe282b",
"score": "0.68081576",
"text": "def validateHandinForGroups\n return :valid unless @ass... |
3fff724b6e59f9e315f4b88cda4709fc | Release 1 Start with array of 0, 1 Store the first two indexes in an x and a y variable Add those two and push the result to the array Increment x any y by 1 Continue incrementing until you reach the argument 1 times | [
{
"docid": "d0bfed9c2ca3cc6fe84b1b0722818d30",
"score": "0.0",
"text": "def fib(number_length)\n fib_numbers = [0, 1]\n x = 0\n y = 1\n index = 0\n while index < number_length - 2 \n sum = fib_numbers[x] + fib_numbers[y]\n fib_numbers.push(sum)\n x += 1\n y += 1\n index += 1\n end\n... | [
{
"docid": "82785ef397f59bb366895a90814ca529",
"score": "0.6573599",
"text": "def basic_12 (array_process)\n array_process.shift\n array_process.push(0)\nend",
"title": ""
},
{
"docid": "b16b5b48d20b7967a5ed1c812688467a",
"score": "0.6368175",
"text": "def running_total1(array)\n ... |
867dcc7c4ab4182a8dbaacd3bce4f9e9 | Check that compiling integer arithmetic makes sense. | [
{
"docid": "55fb93b19d12da6d76c84ebd3bcd1250",
"score": "0.7844548",
"text": "def test_integer_arithmetic\n tests = [\n CompilerTestCase.new(\n '1 + 2',\n [1, 2],\n [\n make(Opcode::CONSTANT, [0]),\n make(Opcode::CONSTANT, [1]),\n make(Opcode::ADD,... | [
{
"docid": "8b2e6527f55f0a5f6db6743ed4da80f6",
"score": "0.66029084",
"text": "def test_integer_addition\n output = execute_program('Fixnum#+', <<-RB)\n 10.times{ |i| i + i}\n RB\n assert_sig_and_count(output, 'Fixnum#+', 10)\n end",
"title": ""
},
{
"docid": "4ba45c51c20b738aa3... |
483eec4ccf0cf6c1911fcd1059248eda | GET /tmp_words/new GET /tmp_words/new.json | [
{
"docid": "2b8302468514f5bd8099b72a2768d174",
"score": "0.735028",
"text": "def new\n @tmp_word = TmpWord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tmp_word }\n end\n end",
"title": ""
}
] | [
{
"docid": "47aa238b94a2fa0b50636358e59924be",
"score": "0.6980575",
"text": "def new\n @objective = Objective.find(params[:id])\n @word = @objective.words.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @word }\n end\n end",
"title": "... |
452c8d5e657004176b744ac24dd74237 | DELETE /categories/1 or /categories/1.json | [
{
"docid": "a2db90d4416314449d7d2f4f14368add",
"score": "0.0",
"text": "def destroy\n @category.destroy\n end",
"title": ""
}
] | [
{
"docid": "8e82257a38ec7abcdd74a59519238e96",
"score": "0.75759965",
"text": "def destroy\n Category.find(params[:id]).destroy\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid":... |
63791aea4e3a063c701720065785cbc9 | test if there is a draw | [
{
"docid": "68758f59a80df800d9103d4b9732297b",
"score": "0.0",
"text": "def draw? (board)\n if full?(board) == true\n !won?(board)\n end\nend",
"title": ""
}
] | [
{
"docid": "064fd166838a59558cadffb4cb86caee",
"score": "0.81042916",
"text": "def draw? \n end",
"title": ""
},
{
"docid": "052334493e984d3718ca1f4f97c63d96",
"score": "0.7659652",
"text": "def draw?\n if not won?\n return full?\n else\n return false\n end\n end... |
2daaac09bcc6444315f6189b2eaf6bbc | Every method that is declared below will be automatically executed when the generator is run | [
{
"docid": "472bb8fe4fbd5ac0b8755facb88d34bb",
"score": "0.0",
"text": "def create_migration_file\n migration_file = File.join(File.dirname(__FILE__), 'templates', 'migration.rb')\n migration_template migration_file, 'db/migrate/create_webhooks_table.rb'\n end",
"title": ""
}
] | [
{
"docid": "b1c024d16f0a62dcbc63a2fcc6269dd3",
"score": "0.7830334",
"text": "def generators; end",
"title": ""
},
{
"docid": "b1c024d16f0a62dcbc63a2fcc6269dd3",
"score": "0.7830334",
"text": "def generators; end",
"title": ""
},
{
"docid": "4634b3dbab2d3c1a5cb8f39f34fcf2... |
d1cf82562c7c5f56cd8dbffaa93d44b0 | Reorder names as "last_name, first_name" to make them comparable to\ WorldCat results. | [
{
"docid": "80d5a517394a02502add9f5488efd2e8",
"score": "0.7011128",
"text": "def reverse_names(items)\n items.map do |item|\n if item.include?(',')\n item # TODO: need some use cases...\n else\n name_parts = item.split(' ')\n last_name = name_parts.pop\n first_... | [
{
"docid": "587c6961100882b16a05d253014c3c1a",
"score": "0.77391875",
"text": "def sort_name\n n = \"#{self.last_name}, #{self.first_name}\"\n if self.middle_name.present?\n n += \" #{self.middle_name}\"\n end\n n\n end",
"title": ""
},
{
"docid": "8f1e377d5ad3b4e0907732303... |
4c9b12dbb3e8189323ba53d7adf259f6 | return color profile value, converting blanks to nils | [
{
"docid": "e02cf006e241e9d9f2f44d4f466172eb",
"score": "0.5875711",
"text": "def default_color_profile\n self.default_options[:color_profile].presence\n end",
"title": ""
}
] | [
{
"docid": "54c57e6ef396fa637816450b5daf5ae8",
"score": "0.6106891",
"text": "def actual_color\n ColorCode.where(numeric_code: default_code.split(\"-\")[-2])[0]\n end",
"title": ""
},
{
"docid": "e7c5b0f14fc3b4e5c52e1e108c4b5a35",
"score": "0.5689389",
"text": "def filter_color(c... |
b10035a1a37e55021973405167042406 | GET /feedbacks/1 GET /feedbacks/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "1bf079e32ac92ebca6eefc8b6453b66f",
"score": "0.8084837",
"text": "def show\n @feedbacks = Feedback.find(params[:id])\n render json: @feedbacks\n end",
"title": ""
},
{
"docid": "11e609d060a674d59be2e683d430e530",
"score": "0.7709457",
"text": "def index\n @feedb... |
9e029ab97dd1f4151ece69d53c57f348 | maximum_hops is the max number of redirects. Set to 0 to allow 1 request with no redirects. | [
{
"docid": "e46745fdeddda090c3776bf21628554b",
"score": "0.0",
"text": "def initialize(app, maximum_hops = 3)\n\t\t\t\tsuper(app)\n\t\t\t\t\n\t\t\t\t@maximum_hops = maximum_hops\n\t\t\tend",
"title": ""
}
] | [
{
"docid": "107035915fc555f706fa083cd1f491a3",
"score": "0.7619674",
"text": "def max_redirects\n MAX_REDIRECTS\n end",
"title": ""
},
{
"docid": "97330a6debb7a3c575a400dcfb8da9c0",
"score": "0.7618282",
"text": "def max_redirects\n configuration[:max_redirects] || MAX_REDIREC... |
6b69b38c83c0e2a28f45a5f57ae8c3f6 | Return the ID's of all members of +collection+ | [
{
"docid": "f6f1cdf7fafe19e0ab37fd1b1e0c6c71",
"score": "0.57247424",
"text": "def members(collection)\n files(collection).map { |f| File::basename(f, \".yml\") }\n end",
"title": ""
}
] | [
{
"docid": "7c294feb4dcc9bc46b00c77396404dfc",
"score": "0.7854783",
"text": "def member_object_ids\n return [] unless id\n ActiveFedora::Base.search_with_conditions(\"member_of_collection_ids_ssim:#{id}\", rows: 1000 ).map(&:id)\n end",
"title": ""
},
{
"docid": "999f1d35f8ba47... |
340f2c20310cddf1e8998856586f49f2 | DELETE /orgs/1 DELETE /orgs/1.json | [
{
"docid": "67bb1f3c696fd10f68afb30ab943e4d9",
"score": "0.6751995",
"text": "def destroy\n @org = Org.find(params[:id])\n a = Activity.first\n if a\n puts \"There are activities associated with #{@org.organization} - it cannot be deleted\"\n else\n puts \"The org has no ac... | [
{
"docid": "86ae2c336adf126aaec344f613882767",
"score": "0.73908687",
"text": "def destroy\n @org.destroy\n respond_to do |format|\n format.html { redirect_to orgs_url, notice: 'Org was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
... |
769b936d65a7f725bd037fe9ba03a168 | Returns GitHub url if exist | [
{
"docid": "5ccec2f04322c8c47d6367b3f56a182d",
"score": "0.81453466",
"text": "def github_url\n [homepage, source_code_uri].find do |url|\n GemsBond::Fetchers::Github.valid_url?(url)\n end\n end",
"title": ""
}
] | [
{
"docid": "05572756cdd37d5c75eb99e63298ed14",
"score": "0.79139155",
"text": "def has_github?\n !github_url.blank?\n end",
"title": ""
},
{
"docid": "64c678cf3ea4130e3af87bf98bffdc65",
"score": "0.7604883",
"text": "def github_url\n github_user.blank? ? nil : \"#{GITHUB_URL}#... |
3bf61f9740c21fcef431c652d922f71d | It finds base noun chunks from the category pattern. It assumes that the last word of a BNC is its head. | [
{
"docid": "0024d2d5053dad2db8635642016a9480",
"score": "0.7356509",
"text": "def get_base_noun_chunks tokens\n base_noun_chunks = []\n beg = -1\n head = -1\n tokens.each_with_index do |t, i|\n beg = t[:idx] if beg.negative? && NC_CAT.include?(t[:cat])\n head = t[:idx]... | [
{
"docid": "3a90017a91fe0504b18eb55e826e44af",
"score": "0.72764134",
"text": "def get_base_noun_chunks (tokens)\n base_noun_chunks = []\n beg = -1 ## the index of the begining token of the base noun chunk\n tokens.each do |t|\n beg = t[:idx] if beg < 0 && NOUN_CHUNK_TAGS.include?(t[:ca... |
ecb7cb5a9fcf4d984f20a481bd705cdf | test implementation of descendant_method_missing | [
{
"docid": "dd335b7ce7f72617605d780d373e2007",
"score": "0.6336105",
"text": "def descendant_method_missing(meth, *args, &blk)\n if meth.to_s.eql?('print_this')\n \"#{meth.to_s}_from_instance\"\n else\n get_parent_model.send(meth, *args, &blk)\n end\n end",
"title": ""
... | [
{
"docid": "c9250c4f5ebff94572b80ac1d6990243",
"score": "0.63500637",
"text": "def method_missing(method, *args, &blk); end",
"title": ""
},
{
"docid": "434aa4cd1226e41b9b68a6c17618e1fd",
"score": "0.62266713",
"text": "def method_missing(method, *args, &block); end",
"title": ""... |
aef80ae7ed9e852890b5e23aedd1c4e5 | PATCH/PUT /orders/1 PATCH/PUT /orders/1.json | [
{
"docid": "f0fc78bd0057e91b1ccff1b5c4b7f51a",
"score": "0.0",
"text": "def update\n respond_to do |format|\n if @order.update(order_params)\n format.html { redirect_to @order, notice: 'Order was successfully updated.' }\n format.json { render :show, status: :ok, location: @order }... | [
{
"docid": "5475e478e362598519f05ab929db4ab8",
"score": "0.720929",
"text": "def update\n @order = Order.find(params[:id])\n @order.update_attributes(order_params)\n render :json => @order\n end",
"title": ""
},
{
"docid": "66c979dede895693d89bd15161614588",
"score": "0.7031205... |
d660fed9b46395973c6de5ae5355a281 | power law distribution of company sizes thanks to: | [
{
"docid": "50ce87814f8da5ffd866a5d5fc845193",
"score": "0.0",
"text": "def initialize(hypos, alpha=1.0)\n super\n hypos.each {|hypo| set(hypo, hypo**(-alpha)) }\n normalize\n end",
"title": ""
}
] | [
{
"docid": "6b339ff49577bd0b4ac99026cca85791",
"score": "0.6189866",
"text": "def size\n\n @population_density/50\n\n mod_factor = 0.0\n if @population_density >= 200\n mod_factor = 4.0\n elsif @population_density >= 150\n mod_factor = 3.0\n elsif @population_density >= 100\n ... |
c55c35fa5e4ea9aede63f2dd7d5a1d9e | Returns a list of all comments under this node. | [
{
"docid": "6d5898299cf73f3c214e6b81b1f2ed27",
"score": "0.85217977",
"text": "def comments\r\n return node_list(TYPE_COMMENT, nil)\r\n end",
"title": ""
}
] | [
{
"docid": "7be0f705974a18b6452cbef01917055c",
"score": "0.79623616",
"text": "def list_comments\n list_comments = Comment.where(parent_id: self.id)\n return list_comments\n end",
"title": ""
},
{
"docid": "06a1847c6aa654ec5435a9d5f56256d6",
"score": "0.79141337",
"text": "def... |
0b2a79e4ef07e7261e55efcfe5bc1408 | Return part of debug output. | [
{
"docid": "4929c1b9891b14e8291b508cbeddebb3",
"score": "0.0",
"text": "def dump\r\n super + to_s\r\n end",
"title": ""
}
] | [
{
"docid": "dc7e6f010d8b5bfbee7fbde6afd4002f",
"score": "0.69366837",
"text": "def get_debug_string\n s = \"3D Camera: [ #{@x.round(2)}, #{@y.round(2)}, #{@z.round(2)} ]\\n\"\n s += \" T[ #{@tx.round(2)}, #{@ty.round(2)}, #{@tz.round(2)} ]\\n\"\n s += \"Fov: #{@fov.round(2)} View: #{@near.rou... |
b4c3d2eb79b78b27f25b7dad3caac37c | Set service resource options. | [
{
"docid": "7f7318998eb556be0354a68a6d25759f",
"score": "0.61902994",
"text": "def service_options(resource)\n super\n resource.ruby_command(\"unicorn --port #{new_resource.port} #{configru_path}\")\n end",
"title": ""
}
] | [
{
"docid": "fe9e1ee4a7e6ea180f07ced4e25021f8",
"score": "0.6766076",
"text": "def service_options(resource)\n super\n resource.environment.update(new_resource.parent_python.python_environment) if new_resource.parent_python\n end",
"title": ""
},
{
"docid": "3f0516a7702591a... |
61652055aa0344586394e406dbee72af | when the attribution changes we need to trigger this, but it can recurse without flag | [
{
"docid": "03e7c172cd669af4663daf6f2e1ed4d3",
"score": "0.5535351",
"text": "def redo_watermark\n return true if self.is_reprocessing\n self.is_reprocessing = true\n if attribution_changed?\n if self.image\n self.image.reprocess!\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "2ccc3d092abdb47ed73516eadf0f3906",
"score": "0.59542614",
"text": "def derive_changes!\n @derive=true\n end",
"title": ""
},
{
"docid": "09408331d230eb3239f3b54e06946d4b",
"score": "0.5544692",
"text": "def propagate_changes\n if !(changed_attributes.keys & %w(... |
c591e0b3a4138619013d0989db1f9b7e | Update of Facebook profile, triggered after creation of a picture. | [
{
"docid": "3fb62b04c2599e32621d19d9f2445ecf",
"score": "0.74646723",
"text": "def update_facebook_profile\n \n # Only update profile if the owner of the post this picture is attached to \n # has linked their facebook account \n # Also never publish to Facebook from the development environme... | [
{
"docid": "56010883772d78f94245a889ab5e0a85",
"score": "0.80142",
"text": "def update_profile_picture(omniauth)\n case omniauth['provider']\n when 'facebook'\n fb_user = FbGraph::User.me(omniauth[\"credentials\"][\"token\"]).fetch\n picture = ProfilePicture.new()\n picture.remote_i... |
78249e30a5ae7de7273db66cfa861aff | Set the value of the property to val val may be either: A string which can be parsed as a DateTime A Time instance A Date instance A DateTime instance | [
{
"docid": "cef8661a6dc5a625ff5fd72491028ddc",
"score": "0.7442288",
"text": "def value=(val) # :nodoc:\n case val\n when nil\n @date_time_value = nil\n when String\n self.tzid = 'UTC' if val =~/Z/\n @date_time_value = ::DateTime.parse(val)\n when :... | [
{
"docid": "0cb5045166bb8c4c5525485c41ac4360",
"score": "0.75632024",
"text": "def value=(val)\n case val\n when nil\n @date_time_value = nil\n when String\n @date_time_value = ::DateTime.parse(::DateTime.parse(val).strftime(\"%Y%m%d\"))\n when ::Time, ::Dat... |
6905dc52aed41e38a5b2088448bb88c3 | Responsible for indicating if a resource lock is exclusive. Used in LOCK requests. | [
{
"docid": "42d7cdf72ffebf5baf663f90bc32ee46",
"score": "0.75495005",
"text": "def lock_is_exclusive?\n raise NotImplementedError\n end",
"title": ""
}
] | [
{
"docid": "704d6a51da85bc4f2a4498211a7ce4f2",
"score": "0.73042566",
"text": "def locked?(resource)\n ttl = get_remaining_ttl_for_resource(resource)\n !(ttl.nil? || ttl.zero?)\n end",
"title": ""
},
{
"docid": "8724a50db707c57616b986ac9a61cc00",
"score": "0.72499925",
"... |
b78d4856bd3a863b5993de5a4db6ef73 | Return the permalink with underscores and dashes split to spaces to allow better search. | [
{
"docid": "4269de60ee5a4f96caed936e16a01ac8",
"score": "0.8691374",
"text": "def permalink_with_spaces\n return self.permalink.gsub(/[\"-\"]/, ' ').gsub(/[\"_\"]/, ' ')\n end",
"title": ""
}
] | [
{
"docid": "b35bda792a45f531d5f1c12bfab62ba2",
"score": "0.85165465",
"text": "def permalink_with_spaces\n return self.permalink.gsub(/[\\-_]+/, ' ')\n end",
"title": ""
},
{
"docid": "d8f583afe1daf5b71061c01a69c36d19",
"score": "0.82520556",
"text": "def permalink_name\n name... |
d38a27a4653de476c878f49dd31cfe13 | Convert a letter to an integer Arguments : +c+ > character Returns : ASCII code of the character | [
{
"docid": "7469969892d612fa4b2a4fe232f5b8d7",
"score": "0.86486214",
"text": "def letterToInt (c)\n\t\treturn c.ord() -'A'.ord() + 1\n\tend",
"title": ""
}
] | [
{
"docid": "292894fd60586361d5b6404cbe76cd0d",
"score": "0.76532847",
"text": "def get_char_number(char)\n a = 'a'.ord\n z = 'z'.ord\n val = char.ord\n\n if a <= val && val <= z\n return val - a\n end\n\n -1\nend",
"title": ""
},
{
"docid": "2698d5776f9a85996ce1971691e26e9f",
"s... |
946a6b24ce7b953fb8a179c64c825080 | Check whether a timeout has occured on the task. | [
{
"docid": "90ee471405309311da7eae74c3061f27",
"score": "0.68125904",
"text": "def timeout?(ttl)\n @timestamp.timeout?(ttl)\n end",
"title": ""
}
] | [
{
"docid": "09ac327323ea5fabfb2751b5897858e7",
"score": "0.8031152",
"text": "def task_timeout?(task_ttl)\n @taskbox.task_timeout?(task_ttl)\n end",
"title": ""
},
{
"docid": "85fd052ec496637280844153616de0fd",
"score": "0.7958976",
"text": "def task_timeout?(ttl)\n ... |
dc25f3d41009f5a3fd6f2b4505b6efe5 | Resize the pool with the passed arguments. | [
{
"docid": "bf2d805bf0b75ffbe81b6b80d1baddd2",
"score": "0.55002284",
"text": "def resize (min, max = nil)\n @min = min\n @max = max || min\n\n trim!\n end",
"title": ""
}
] | [
{
"docid": "24df9ae39408edb4be394d890cf7468c",
"score": "0.77450037",
"text": "def resize(*args); end",
"title": ""
},
{
"docid": "5b0bf9cc46bcd1ff598dadb7410b04c4",
"score": "0.67155385",
"text": "def pool(size=1, **options)\n end",
"title": ""
},
{
"docid": "5f808971... |
a56fa1fcf98a422083650904fd4e2f9b | uses and watches the given beanstalk tube | [
{
"docid": "d9ea7bd9cea24b25157334d4a6c0c245",
"score": "0.719561",
"text": "def tube= _tube\n puts \"#{self.class} setting tube to #{_tube}, was #{@tube}\"\n @beanstalk.use _tube\n @beanstalk.watch _tube\n end",
"title": ""
}
] | [
{
"docid": "9644f6a90d4610e842dd0ac5c653a831",
"score": "0.70977473",
"text": "def watch_tube(tubename)\n @queue.watch tubename\n end",
"title": ""
},
{
"docid": "dc856713c3a30061ef0005fc63b0a2ab",
"score": "0.67372185",
"text": "def beanstalk(tube_name, server=nil)\n Cod::Bea... |
85949892b05c6fb7a2c9fd9d75add350 | Get a list of all templates | [
{
"docid": "0408d8c509bf6b1dee8c4947ddaf852d",
"score": "0.0",
"text": "def list_templates_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PDFApi.list_templates ...'\n end\n if @api_client.config.client_side_validation && ... | [
{
"docid": "5d41c59e75aff011d56f88b0bf8a8c4f",
"score": "0.85574394",
"text": "def all_templates\n TEMPLATES\n end",
"title": ""
},
{
"docid": "b9aaf3825be35795a971e6d6a53696ce",
"score": "0.82684785",
"text": "def templates\n fetch(:templates)\n end",
"title": ""... |
dd9b093008c848a316352c7c062edec9 | Return the name of all encrypted columns as an Array of symbols Example: [:encrypted_email, :encrypted_password] | [
{
"docid": "f2d2b9c2f0d7797e34030dee37cc2ee2",
"score": "0.74842405",
"text": "def encrypted_columns\n @encrypted_columns ||= encrypted_attributes.values\n end",
"title": ""
}
] | [
{
"docid": "1daac5aa73d784f721a5a71a8b43d69a",
"score": "0.6942812",
"text": "def column_names\n array = []\n self.attributes.each_key { |k| array << k.to_s }\n array\n end",
"title": ""
},
{
"docid": "4bf0a4ceb59ab31c6e37af4964590c23",
"score": "0.6855318",
"text":... |
cc4451563ece7d282bc09b21d37e0846 | Creates a printable address block from a location record | [
{
"docid": "d1bf5f4f77eeb2a28d8d625ef5a70862",
"score": "0.69601566",
"text": "def address_block_for_location(location, delimiter = \"<br>\")\n a = \"#{location.address_line_1}\"\n a << \"#{delimiter}#{location.address_line_2}\" unless location.address_line_2.blank?\n a << \"#{delimiter}\" unle... | [
{
"docid": "09fdb59e5d32d7acec4d2eb64a1defac",
"score": "0.65009785",
"text": "def build_address(record)\n (record['numvoie'] || '') + ' ' +\n (record['typvoie'] || '') + ' ' +\n (record['libvoie'] || '') + ' ' +\n (record['codpos'] || '') + ' ' +\n (record['libc... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "97f915bde2cd5c7c99213f05b2d93ff4",
"score": "0.0",
"text": "def emergency_contact_params\n params.require(:emergency_contact).permit(:job_id, :first_name, :last_name, :email, :address_id)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.74968386",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6958337",
"text": "def strong_params\n params.require(:request).permit(param_whit... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "b1e1c244f7eb75c0e7c32d51a5125469",
"score": "0.0",
"text": "def media_file_params\n params.require(:media_file).permit(:name, :store_id)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7497917",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.69572496",
"text": "def strong_params\n params.require(:request).permit(param_whit... |
7ab75ab9ccc8a4161f59b25c028cbbb0 | GET /controles/1 GET /controles/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "57e0a7ece8e93e59fb0cfb705b0110c7",
"score": "0.6638986",
"text": "def index\n \n @controles_asistencias = ControlAsistencia.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @controles_asistencias }\n end\n end",
"title"... |
e0760629e7bf176e7dbd6b1da4cf21d8 | Make examples two_digit_sum(34) == 7 ==> 3 + 4 == 7 Draw the process Write the solution in english take two digits, split them? loop through them, then convert to integers. Next, add them. Write it in code | [
{
"docid": "73fbb18a4bfb6e87102ae4b7832cf456",
"score": "0.74794143",
"text": "def two_digit_sum(nums)\n if nums.integer?\n string = nums.to_s.split(//)\n return string[0].to_i + string[1].to_i\n else\n print \"Please pass a valid two-digit argument\"\n end\n return\n\nend",
"title": ""... | [
{
"docid": "8844c145b5a85b4d0581290abeeb7ed3",
"score": "0.73497874",
"text": "def two_to_sum(n)\n result = 2 ** n\n \n result.to_s.split('').map {|x| x.to_i }.reduce(:+)\nend",
"title": ""
},
{
"docid": "11b796818a13aa87f93800d5834fbe47",
"score": "0.73265696",
"text": "def sum(n... |
9bd2786258099961dccd9e04071fd174 | GET /articles GET /articles.json | [
{
"docid": "8e0899ad91e6caea89914fb96706ee24",
"score": "0.7231521",
"text": "def index\n @articles = Article.order('id DESC')\n respond_to do |format|\n format.html\n format.json { render json: @articles }\n end\n end",
"title": ""
}
] | [
{
"docid": "9cb21440d77022ee6f0542d4ebd0003b",
"score": "0.7823242",
"text": "def articles\n @articles = Article.all\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @administration }\n end\n end",
"title": ""
},
{
"docid": "f62c2acde8... |
f13d97526b7e5991b65664fd2220aca3 | keep only the elements that start with an a | [
{
"docid": "a16940c4295925a9ba32afd5f8fe5069",
"score": "0.57895774",
"text": "def select_elements_starting_with_c(arr)\n arr.select { |word| word.start_with?('c') }\nend",
"title": ""
}
] | [
{
"docid": "a60bd8cd8eb85808578417bf9a694d82",
"score": "0.7254866",
"text": "def select_elements_starting_with_a(array)\n array.select { |string| string.starts_with?('a') }\nend",
"title": ""
},
{
"docid": "217d61be075fcb192b9d28f927e6b66a",
"score": "0.68360096",
"text": "def find... |
e4b9768106181485bf492cca8511a195 | put edita un email, dado su id /api/emails/id?telephone= donde id es el identificador para el email | [
{
"docid": "d07269ee91b0099ac05fe91d28b8b16d",
"score": "0.70194995",
"text": "def update\n @email = Email.find(params[:id])\n @email.email = params[:email]\n @email.save\n render json:@email\n\n end",
"title": ""
}
] | [
{
"docid": "14a008d97209bdad4761420a11d06073",
"score": "0.73480034",
"text": "def put_update(options = {})\n options[:id] ||= @email.id\n options[:email] ||= @attributes\n# options[:email][@email.id.to_s] = @attributes\n put :update,options\n end",
"title": ""
},
{
"docid": "cd... |
c10e89c53e991cafcc352dc47f7f2ec7 | GET /fish/1 GET /fish/1.json | [
{
"docid": "d5e8c97e89285bcf4302ae22758160ec",
"score": "0.7788346",
"text": "def show\n @fish = Fish.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fish }\n end\n end",
"title": ""
}
] | [
{
"docid": "27c264530637fd8f23a4376a17057373",
"score": "0.6968524",
"text": "def show\n if @fish\n render json: @fish\n else\n render json: @fish.errors\n end\n end",
"title": ""
},
{
"docid": "fee26d1f575073facd95e48e0c038ca1",
"score": "0.6900966",
"text": "def... |
d8cdfa24ae04c98e35a0bb1d386b9dff | weight limit in ounces or zero (if there is no limit) | [
{
"docid": "a4ad97e573c3827e6f2560e3fb8ba7a5",
"score": "0.6632626",
"text": "def max_weight_for_country(country)\n return WEIGHT_LIMITS[country.iso]\n end",
"title": ""
}
] | [
{
"docid": "7fd60f659865e153b24344e3e0974c24",
"score": "0.7869309",
"text": "def weight\n 0\n end",
"title": ""
},
{
"docid": "57850bbdc3567d11aa915faa48518bb8",
"score": "0.7793805",
"text": "def maxweight(w)\n @weight = w if w>@weight\n end",
"title": ""
},
{
... |
24fb574664f5feb362b389848efc53da | ++ gen Xml Object return:: xml | [
{
"docid": "537a7d675c4c884fca3dba81cddd0077",
"score": "0.0",
"text": "def to_XmlString(withHeader = true)\n xml = to_Xml() ;\n str = '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>' ;\n str << \"\\n\" ;\n ItkXml::ppp(xml, str) ;\n str.gsub!(/\\<tag\\>\\s*([^\\s]*)\\s*\\<\\... | [
{
"docid": "f3942e83e2c33a199b5cb9edf5dbb4ca",
"score": "0.7838164",
"text": "def build_xml\n xml = Builder::XmlMarkup.new\n xml.instruct!\n xml.packet(:version => '1.6.3.5') {\n xml.customer {\n xml.add{\n build_gen_info(xml, @customer)\n }\n }\n }\n retu... |
e561e11bcf379ef5dc139c210017366b | Only allow a list of trusted parameters through. | [
{
"docid": "03cf854aedd808f4b9f9d4f483de9a9b",
"score": "0.0",
"text": "def repository_params\n params.permit(:user, :name, :private, :new_name, :description)\n end",
"title": ""
}
] | [
{
"docid": "c1f317213d917a1e3cfa584197f82e6c",
"score": "0.69497335",
"text": "def allowed_params\n ALLOWED_PARAMS\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6812623",
"text": "def strong_params\n params.require(:listing_member).permi... |
53b0cfd60930c6ddf7544826e5df4e6c | respond to keypresses ship movement, torpedo fire ESC to terminate | [
{
"docid": "0ff9c8ad167ee60b86a3c1d071a8acd9",
"score": "0.7129757",
"text": "def key(k, x, y)\n # as long as the ship is not destroyed, we will accept keypresses\n if not @ship.destroyed\n\t\tcase k\n\t\t when ?j\n\t\t\t@ship.rotate(5.0)\n\t\t when ?k\n\t\t\t@ship.rotate(-5.0)\n\t\t when ?h\n\... | [
{
"docid": "d5c712b422a62eb42c6859fa156b3ea2",
"score": "0.6523313",
"text": "def keyUp(event)\n\t characters = event.characters\n if GameData.game_on? && characters.length == 1\n character = characters.characterAtIndex(0)\n \t\tif character == NSLeftArrowFunctionKey\n PlayerPosition.re... |
85ab57d8b1042fa3bab123243382508b | send text to all players in tile (meesage to send, tile to send to) | [
{
"docid": "4311136b1f4760d18307c0b9a096535a",
"score": "0.67067367",
"text": "def msgwholeroom(msg,sender,type=\"notself\")\n mtile = self\n sender.sendtoplayer2(\"#{msg}\") if type == \"all\"\n mtile.users.each do | l |\n l.sendtoplayer2(\"#{msg}\") if sender != l\n end\n end",
"... | [
{
"docid": "6b472057ce6f2b8d1c8e84fbd8a0fdf3",
"score": "0.6228959",
"text": "def send_each_player(sym)\n\t\t\tplayers.each(&sym)\n\t\tend",
"title": ""
},
{
"docid": "6988eff6072449d4bc7f1fc2550be30e",
"score": "0.60260385",
"text": "def send_each_player(sym)\n\t\t\t\tplayers.each d... |
a2ee15e0174f514fb708919504b1881f | Document Type and Revision Number :: 2D Hash | [
{
"docid": "721b2d281c17d283b6a25ce628f8532b",
"score": "0.0",
"text": "def _docs\n @_docs ||= Hash.new do |h, k|\n h[k] = {}\n end\n end",
"title": ""
}
] | [
{
"docid": "200c0d49cdfee9bcb2027f9f159964cb",
"score": "0.64987665",
"text": "def hash\n [document_type, document_date, entry_numbers, plan_only, filed_under, register_description].hash\n end",
"title": ""
},
{
"docid": "1974d9914e0f1f99ea59170ec6fd99ae",
"score": "0.64922667",
... |
958a728c6e52e2bec47763ecd9d98970 | DELETE /post395s/1 DELETE /post395s/1.xml | [
{
"docid": "9e58292af0d481b59889e6e8b3c0e102",
"score": "0.6943117",
"text": "def destroy\n @post395 = Post395.find(params[:id])\n @post395.destroy\n\n respond_to do |format|\n format.html { redirect_to(post395s_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
}
] | [
{
"docid": "04f582ac100330c7013ff351f945f150",
"score": "0.7257104",
"text": "def destroy\n @post155 = Post155.find(params[:id])\n @post155.destroy\n\n respond_to do |format|\n format.html { redirect_to(post155s_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
... |
049a33760b941fab07f2d63097322343 | PATCH/PUT /instruments/1 PATCH/PUT /instruments/1.json | [
{
"docid": "263556223d5591e5ac7f2d7b0c0223df",
"score": "0.6828377",
"text": "def update\n respond_to do |format|\n if @instrument.update(instrument_params)\n format.html { redirect_to @instrument, notice: 'Instrument was successfully updated.' }\n format.json { render :show, statu... | [
{
"docid": "78d4feb458b72dac95728e0c7c289cb5",
"score": "0.7083911",
"text": "def update_rest\n @instrument = Instrument.find(params[:id])\n\n respond_to do |format|\n if @instrument.update_attributes(params[:instrument])\n flash[:notice] = 'Instrument was successfully updated.'\n ... |
e8bb525d92a9fe21d55bc9a5b1e9f182 | Write a method that takes in 2 numbers as arguments and prints their sum. Then call your method three times with different arguments passed in: YOUR CODE HERE | [
{
"docid": "5401f522444503979e281bec2672493c",
"score": "0.0",
"text": "def add(a, b)\n p \"Finding the sum of #{a} and #{b}\"\n return a + b\nend",
"title": ""
}
] | [
{
"docid": "b8199ed57f81871c2a960f32742017dd",
"score": "0.80704576",
"text": "def numbers(a, b) # YOUR CODE HERE\n puts \"Adding #{a} + #{b} = #{a + b}\"\nend",
"title": ""
},
{
"docid": "b418b8170b4152108a885ba48416577d",
"score": "0.80093884",
"text": "def sum_method(first_number... |
d3ca2b45c49b396959c6913afc88c341 | Assuming using a currency using dollars: Returns the value of the money in dollars, instead of in the fractional unit cents. Synonym of amount | [
{
"docid": "f09a37aae9b13f094d3a86f8bbb78558",
"score": "0.7364773",
"text": "def dollars; end",
"title": ""
}
] | [
{
"docid": "0ed9e2857de85be367b0d93c1b35ce40",
"score": "0.8217564",
"text": "def dollars\n cents.to_f / 100\n end",
"title": ""
},
{
"docid": "0e4879063b9b458141eca9e1c90521b4",
"score": "0.80038863",
"text": "def to_dollar(amount)\n # round_to(@balance)\n format('%.2f', a... |