query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
ffea299d7cd663c80c8bbc24211edf3a | generic title generation override | [
{
"docid": "4d114414c4083e689d7a5d7924850717",
"score": "0.0",
"text": "def title_from(doc)\n Date.today.strftime(\"%y%m%d\") + (\n doc.at(\"head title\").inner_text || \"Webstrip generic page title\"\n )\n end",
"title": ""
}
] | [
{
"docid": "0117b040f75dd4efb8ad2f14e63ae946",
"score": "0.8162531",
"text": "def generate_title\n\t\tif self.title.blank?\n\t\t\tself.title = /[:word:]-[:word:]-\\d{1}/.gen\n\t\tend\n\tend",
"title": ""
},
{
"docid": "47c579a781d8f8795a2b4712a654660c",
"score": "0.7967892",
"text": ... |
9425a49f932e46a286b6d97cd1692df7 | page for editing perhour rates for instructors and aircraft | [
{
"docid": "d759981f5c630ac53335cf281bb789e9",
"score": "0.7629873",
"text": "def edit_rates\n return unless has_permission :can_do_billing\n @page_title = 'Edit Aircraft and Instructor Hourly Rates'\n @instructors = Group.users_in_group('instructor')\n @aircrafts = Aircraft.find(:all,:conditions=>[... | [
{
"docid": "112d6365f469ab78f6eb4e588b0e61f4",
"score": "0.64375186",
"text": "def update\n \trespond_to do |format|\n \t\tif @recurring_available_hour.update(recurring_available_hour_params)\n \t\t\tformat.html { redirect_to instructor_recurring_available_hours_path(@instructor), notice: 'Non recurr... |
9e7cfae34cbd9587071ac244e6b3fbeb | Remembers a user in the database for use in persistent sessions. | [
{
"docid": "bca35c7993389739562d684900f1cf1b",
"score": "0.0",
"text": "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"title": ""
}
] | [
{
"docid": "2851e427c467049c7639c468daea3c35",
"score": "0.6720419",
"text": "def reload_user\n @user = User.find(session[:user][:id])\n end",
"title": ""
},
{
"docid": "96a75f37098f9b5db8b7c451f485268e",
"score": "0.6603912",
"text": "def check_new_or_reseted_user\n begin\n ... |
65920831a4ead74dff6bfe16905842c3 | Retrieve a list of MyLibrary folders | [
{
"docid": "491463449cba0691a960f2d3074da705",
"score": "0.8048436",
"text": "def get_library_folders(params = {})\n Services::LibraryService.get_library_folders(params)\n end",
"title": ""
}
] | [
{
"docid": "0b54994a4202be9d327f254f95bf8004",
"score": "0.76560104",
"text": "def get_library_folders(params)\n url = Util::Config.get('endpoints.base_url') + Util::Config.get('endpoints.library_folders')\n url = build_url(url, params)\n response = RestClient.get(url, get_hea... |
f854353d6d6ec8765125b9f0e4099ea7 | When options connection_protocol and connection_port are not provided It will set as default | [
{
"docid": "fc6543a5c6f8a969fb98f8076f4a5a51",
"score": "0.0",
"text": "def plugin_setup!\n validate_aws_config!(%i{image aws_access_key_id aws_secret_access_key})\n config[:connection_protocol] ||= connection_protocol_ec2\n config[:connection_port] ||= connection_port\n end",
... | [
{
"docid": "2503d299f7667b394eefa979858c735f",
"score": "0.80863404",
"text": "def default_connection_options=(options); end",
"title": ""
},
{
"docid": "91f39a13ddd9faf474c7b6fb94de6b20",
"score": "0.78387994",
"text": "def default_connection_options=(_arg0); end",
"title": ""
... |
f556e1e979c08a496d4c264717b19db2 | containing the sums of adjacent numbers in the original array. See the examples. | [
{
"docid": "e1f32a756e4c6b62a91dc0d18ed516c0",
"score": "0.8207608",
"text": "def adjacent_sum(arr)\n sumArr = []\n arr.each_with_index do |num, idx|\n if arr[idx + 1]\n sumArr << num + arr[idx+1]\n end\n end\n return sumArr\nend",
"title": ""
}
] | [
{
"docid": "5a1af823dc249e9d7dd99ba0b8a9c37b",
"score": "0.84520906",
"text": "def adjacent_sums(arr)\n sums = []\n (0...arr.length-1).each do |i|\n sums << arr[i] + arr[i + 1]\n end\n sums\nend",
"title": ""
},
{
"docid": "0f349ebaa5753eb749c671536bf9abc8",
"score": "... |
1820212ab49793287adbef9acf7410a2 | PUT /mail_templates/1 PUT /mail_templates/1.json | [
{
"docid": "960cc8fb43cdf1480552558bcf44d6e7",
"score": "0.63604003",
"text": "def update\n @mail_template = MailTemplate.find(params[:id])\n @mail_template.attributes = params[:mail_template]\n set_user_column @mail_template\n\n respond_to do |format|\n begin\n @mail_template.sa... | [
{
"docid": "d84d3c312d52d7daf25260a4ed634508",
"score": "0.6778152",
"text": "def update\n respond_to do |format|\n if @template.update(template_params)\n format.html { redirect_to email_templates_path, notice: 'template was successfully updated.' }\n format.json { render :show, st... |
b29825764693d5660edc2ecacd0ea004 | Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.notifications.reset_password.subject | [
{
"docid": "38831b9c501321337266f1240d2b8a0c",
"score": "0.0",
"text": "def reset_password(user)\n @user = user\n @url = \"http://www.tideinstitute.org/password_resets/#{user.reset_password_token}/edit\"\n mail(:to => user.email,\n :subject => \"Your password has been reset\")\n end",... | [
{
"docid": "8928fe4f050d7ebd3e9aa992b07e320a",
"score": "0.71628356",
"text": "def subject_for\n ActiveSupport::Deprecation.warn \"subject_for\"\n I18n.t(:\"subject\", scope: [:notifications, :mailer],\n default: [:subject])\n end",
"title": ""
},
{
"docid": ... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "b6a4b265d78dae70bfdc7bf3acb095e5",
"score": "0.0",
"text": "def update!(**args)\n @bandwidth = args[:bandwidth] if args.key?(:bandwidth)\n @cidr = args[:cidr] if args.key?(:cidr)\n @id = args[:id] if args.key?(:id)\n @location = args[:location] if args.key... | [
{
"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... |
4864b1c1b7e7c50e10ec35a57016b762 | Creates a new Page object | [
{
"docid": "895df3f87643c0d0fd1956130e8f98f3",
"score": "0.0",
"text": "def initialize(page)\n super()\n @page = page\n @head = []\n @scripts = []\n @fragments = []\n @templates = {}\n @auto_id = 0\n... | [
{
"docid": "f7bc6069ca7cf8b802df35a556838923",
"score": "0.7957492",
"text": "def new\n @page = Page.new\n end",
"title": ""
},
{
"docid": "f7bc6069ca7cf8b802df35a556838923",
"score": "0.7957492",
"text": "def new\n @page = Page.new\n end",
"title": ""
},
{
"docid... |
11ea90730d714e53d85910393d7972d0 | if you change html.hot >>input it will effect input test | [
{
"docid": "d65eaaf83b36df88f1be5d19f25869aa",
"score": "0.5451815",
"text": "def test_basic_syntax_11\r\neasy_test(<<W2TAGS____________,<<EXPECTED__________)\r\n#form-edit\r\n %input:item_id{type=\"text\"}\r\nW2TAGS____________\r\n<div id=\"form-edit\">\r\n <input name=\"item_id\" type=\"text\" />\r\... | [
{
"docid": "ba5d5d53f759edc3b516ee3b67e5a6e2",
"score": "0.68016875",
"text": "def pre_input_hook; end",
"title": ""
},
{
"docid": "ba5d5d53f759edc3b516ee3b67e5a6e2",
"score": "0.68016875",
"text": "def pre_input_hook; end",
"title": ""
},
{
"docid": "ff7785e43ba5b35afdce... |
38ed3cd0f17e2675854931afcd93e8ff | Set OAuth2 Client using OpenID Dynamic Client Registration This endpoint behaves like the administrative counterpart (&x60;setOAuth2Client&x60;) but is capable of facing the public internet directly to be used by third parties. It implements the OpenID Connect Dynamic Client Registration Protocol. This feature is disabled per default. It can be enabled by a system administrator. If you pass &x60;client_secret&x60; the secret is used, otherwise the existing secret is used. If set, the secret is echoed in the response. It is not possible to retrieve it later on. To use this endpoint, you will need to present the client&39;s authentication credentials. If the OAuth2 Client uses the Token Endpoint Authentication Method &x60;client_secret_post&x60;, you need to present the client secret in the URL query. If it uses &x60;client_secret_basic&x60;, present the Client ID and the Client Secret in the Authorization header. OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. | [
{
"docid": "8173f770c02e3e557f7a915ca0ec5d30",
"score": "0.0",
"text": "def set_oidc_dynamic_client_with_http_info(id, o_auth2_client, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: OidcApi.set_oidc_dynamic_client ...'\n end\n # verify ... | [
{
"docid": "2e1eaed09ec3b40787b20671ed8e6961",
"score": "0.66290355",
"text": "def set_ClientSecret(value)\n set_input(\"ClientSecret\", value)\n end",
"title": ""
},
{
"docid": "2e1eaed09ec3b40787b20671ed8e6961",
"score": "0.66290355",
"text": "def set_ClientSecret(v... |
e6f79e84d4dec264362384133a07258b | GET /parlos GET /parlos.json | [
{
"docid": "499bd634d2d158386a7c110e67e698d6",
"score": "0.0",
"text": "def index\n @active_parlos=\"active\"\n @parlos = Parlo.all\n @parlo = Parlo.new\n end",
"title": ""
}
] | [
{
"docid": "52cbe1e521186ee23e7ed12f6e6f58e8",
"score": "0.73092836",
"text": "def index\n @parishes = Parish.all\n\n render json: @parishes\n end",
"title": ""
},
{
"docid": "795367c6b04cee160241f8153ab0e188",
"score": "0.6761514",
"text": "def show\n @partecipante = Parte... |
0ec7bd2068fcfe39a1ee2a140750531b | =begin Elementnormalize [DOM] puts all Text nodes in the full depth of the subtree under this Eelemnt. =end [DOM] | [
{
"docid": "c21f785233860319d80651eae156218e",
"score": "0.7430363",
"text": "def normalize\n return if @children.nil?\n old = nil\n children = @children.to_a.dup\n children.each do |child|\n if !old.nil? && old.nodeType == TEXT_NODE &&\n child.nodeType ... | [
{
"docid": "d4a782eb36897d049aec644d2b5fb81f",
"score": "0.65912986",
"text": "def pre_normalize(text); end",
"title": ""
},
{
"docid": "669643847fb85cfdea8a033218264493",
"score": "0.64477104",
"text": "def normalize!\n data = read\n html = Nokogiri::XML.parse(data)\n ... |
60771f1638765a83e8513be23af1e249 | Updates each given attribute to the current time. Assumes that each column can accept a +Time+ instance, i.e. that they're all +datetime+ columns or similar. The updates are done with update_attribute, and as such they are done with callbacks but without validation. | [
{
"docid": "daa457b0d64776a6c5488f5e8db95764",
"score": "0.7564361",
"text": "def touch *attrs\n now = Time.now\n attrs.each {|attribute|\n update_attribute attribute, now\n }\n end",
"title": ""
}
] | [
{
"docid": "7e98320520e57ad4f30734803b67e4c0",
"score": "0.66582525",
"text": "def set_attributes_with_time(attributes)\n default_attributes.merge(attributes).each do |k,v|\n instance_variable_set \"@#{k.to_s}\", to_time(v)\n end\n end",
"title": ""
},
{
"docid": "0e957bf5420e92e... |
ad7e145af90b8593f621de8d402c9d71 | Predicts the spread the virus based population density. | [
{
"docid": "bcfeedda2dbc7bcfa3c6d18af219f34a",
"score": "0.0",
"text": "def speed_of_spread #in months\n # We are still perfecting our formula here. The speed is also affected\n # by additional factors we haven't added into this functionality.\n speed = 0.0\n\n if population_density >= 200\n... | [
{
"docid": "40a1f2973067735bd83ac416a0107236",
"score": "0.69491976",
"text": "def virus_effects\n\n predicted_deaths(@population_density, @population)\n speed_of_spread(@population_density)\n end",
"title": ""
},
{
"docid": "1d3f7d1eb5758c70cf00a60e2c15b4a2",
"score": "0.68411654... |
b6e3005bded7f51d786a48484193e503 | asks user if ready to begin (y/n) | [
{
"docid": "0c267a2fd8acf4793cb905757ff937f2",
"score": "0.6901629",
"text": "def ready\n\n input = gets.strip.downcase\n\n if input == \"y\"\n puts \"Great! Let's get started.\"\n sleep(2.5)\n puts \"\"\n puts \"\"\n League::Team.team... | [
{
"docid": "1ff3a020413620992c6aa32da3d971a9",
"score": "0.7464157",
"text": "def ask?(question)\n start_task(\"#{question} (y for yes, everything else aborts)\")\n STDIN.gets == \"y\\n\"\n end",
"title": ""
},
{
"docid": "db2644def213e9489f2bc90e826c5838",
"score": "0.73586714",
... |
a3f33fd9ca51ba56f471fc278e9f2c3f | Sorts a given set of versions according to lockfile preferences. | [
{
"docid": "e7b8c89495b29499524245095b10bb44",
"score": "0.7561686",
"text": "def sort(package, versions)\n # Return as is if `package` is in the overrides.\n return versions if overrides.include?(package)\n # Return as is if lockfile does not contain `package`.\n return versions unl... | [
{
"docid": "5b97ea62ebbc909151db2c9725a0f133",
"score": "0.7841271",
"text": "def sort(versions)\n versions.sort(&RELEASE_COMPARE)\n end",
"title": ""
},
{
"docid": "0f079fc4ad8288305232ac5722008ac6",
"score": "0.7413307",
"text": "def sort_versions_by_preferred(package, sorted_v... |
6b09c2a4eceea7fa33091d6114056a4d | Calculates euclidean distance between v1 and v2. | [
{
"docid": "ef0d43f844848fd94132dce2c020ffbd",
"score": "0.72565633",
"text": "def d(v1, v2)\n sum = 0\n for i in 0..783\n sum += ((v2[i] - v1[i]) ** 2)\n end\n Math.sqrt(sum)\nend",
"title": ""
}
] | [
{
"docid": "8e94d1668a1e95b2ba6d84554e1c40df",
"score": "0.88087493",
"text": "def euclidean(v1, v2)\n d = 0.0\n v1.each_with_index do |e, i|\n d += (v1[i] - v2[i]) ** 2\n end\n Math.sqrt(d)\n end",
"title": ""
},
{
"docid": "796f57f6c90f440bf0fb4ae4220d9b6a",
... |
e561e11bcf379ef5dc139c210017366b | Only allow a list of trusted parameters through. | [
{
"docid": "04893ae36a6c60dc9ca5fdd953e5c940",
"score": "0.0",
"text": "def following_params\n params.require(:following).permit(:FollowerId, :FollowedId)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.74768823",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "36956168ba2889cff7bf17d9f1db41b8",
"score": "0.71700543",
"text": "def set_param_whitelist(*param_list)\n self.param_whitelist... |
1fdf1d70ec3d22dc3099a3912aa644e6 | Parse the data disk to determine if these are managed disks or in a storage account for example. The disk index, name and size will be returned params object disk Object containing the details of the disk params integer index Index denoting which disk number this is on the machine return hashtable | [
{
"docid": "2ba5dc362470d7ed2df80c08e7ffee2a",
"score": "0.81692344",
"text": "def parse_datadisk(disk, index)\n # Configure parsed hashtable to hold the information\n # Initialise this with common attributes from the different types of disk\n parsed = {\n disk: index,\n num... | [
{
"docid": "9bb0b98ce376a4ae8b43a61d2c49fa1d",
"score": "0.7918274",
"text": "def parse_data_disk_item(disk, index)\n # determine if using managed disks or a VHD\n if !disk.vhd.nil?\n\n # Parse the uri of the disk so that the storage account can be retrieved\n uri = URI.parse(disk.vhd.ur... |
00406ff6201d14bb1ccb8e6d30765cea | validates_format_of :color, :with => COLOR_REGEXP validates_format_of :text_color, :with => COLOR_REGEXP otherwise AS would use the helper method 'name_column' for other controllers | [
{
"docid": "987751c853e0ac3623ab4e66f4eca439",
"score": "0.0",
"text": "def tag_name\n name\n end",
"title": ""
}
] | [
{
"docid": "34523d17c18c79820268f4d5afec28ad",
"score": "0.6790098",
"text": "def validate_colors\n validate_color(background) \n end",
"title": ""
},
{
"docid": "728277d3f0ab6290b78d1c4707f120fb",
"score": "0.66781425",
"text": "def validate_color(c)\n raise ColorFormat... |
858d68ff96e4f3cf1680e1dcc8ed5b3a | DELETE /manage/users/1 DELETE /manage/users/1.xml | [
{
"docid": "5e7a2f385b93e9b7b46c4cea060b4504",
"score": "0.7135542",
"text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n respond_to do |format|\n format.html { redirect_to(manage_users_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
}
] | [
{
"docid": "d29aa233ddb4837c263e69069aaa2550",
"score": "0.73625094",
"text": "def user_delete(username)\n make_request(:delete,\"#{user_url(username)}.xml\")\n end",
"title": ""
},
{
"docid": "6ee5d5aab85076560526dfff04f332ea",
"score": "0.7287054",
"text": "def destroy\n ... |
591485d4bca4e3443eb6657d6e2423da | Epenthesis unmown collier immanental apogee lizardtail Dodecatoic loricariidae centrifugal cosmozoism adream kinetophone Blusteration frightful dochmiacal braiding plucked skinless Imperilment hemikaryotic renickel tiliaceae whiteblow hallopididae | [
{
"docid": "d8e11db0d14f903a6e89faa1324982f4",
"score": "0.5752603",
"text": "def confessionary_wheretosoever_shrinelet(anthelmintic)\n hypomnesis_polyprene_prosopalgic(countergabble, englishwoman)\n lukas_afternight(somniosus_thyreolingual)\n end",
"title": ""
}
] | [
{
"docid": "5b9b4c430f0e689bb06800c08265e0bc",
"score": "0.69202346",
"text": "def semiordinate_exormia()\n vinylidene_harvardian()\n tripudiation_unsupervised(caudatolenticular_snuffboxer, trichina_untraced, snakeology)\n end",
"title": ""
},
{
"docid": "90394956ca72bbe56180be3... |
9b176b8346279abdccade6f87549572d | looks for a config option, accepts an optional default raises an exception when it cant find a value anywhere | [
{
"docid": "2d939d66009f680289eca3ed06e9f524",
"score": "0.67625976",
"text": "def get_option(opt, default=nil)\n return @config.pluginconf[opt] if @config.pluginconf.include?(opt)\n return default if default\n\n raise(\"No plugin.#{opt} configuration option given\")\n end",
... | [
{
"docid": "42fa2f7176be7be3234a79c73c6c7835",
"score": "0.72180235",
"text": "def conf name, args = {}\n required = args[:required] ||= false\n default = args[:default] ||= nil\n if CONFIG[name]\n CONFIG[name]\n else\n if required && !default\n $stderr.puts \"#{name} not found - exiting\... |
bd378c38fa551e975ef003457fa99b1b | The method apply request for SPARQLQueriesall_predicates_by_object query. | [
{
"docid": "31b29aaa6646795b86fa51ecfe32c5dc",
"score": "0.8032715",
"text": "def get_all_predicates_by_object(object)\n process_query(all_predicates_by_object(object))\n end",
"title": ""
}
] | [
{
"docid": "c07c3421b1c87f52a79036ef96979565",
"score": "0.71046746",
"text": "def get_all_predicates_by_subject_object(subject, object)\n process_query(all_predicates_by_object_and_subject(subject, object))\n end",
"title": ""
},
{
"docid": "aaa4efc6e6c2282421d868748f91d12c",
"s... |
c469baaa4ea0360376e8b96f27cc6f40 | Deletes the currently authenticated account | [
{
"docid": "f26cf609a1446d7a54f16883bc338571",
"score": "0.7717966",
"text": "def delete_account\n\t\t@client.delete(\n\t\t\t@session[\"resources\"][\"account\"][\"url\"],\n\t\t\t:headers => { \n\t\t\t\t\"Accept\" => mediaType(\"account\"),\"Content-Type\" => mediaType(\"account\"),\n\t\t\t\t\"Authoriza... | [
{
"docid": "7b6fda94b25ad60134ef01a1a3c303ea",
"score": "0.82278",
"text": "def destroy\n current_user.delete!\n \n logout_killing_session!\n \n flash[:notice] = \"Your account has been removed.\"\n redirect_back_or_default(root_path)\n end",
"title": ""
},
{
"docid": "7b6... |
75d4cabe1a206d8833fc83e539e98d3d | POST /prod_plan_masters POST /prod_plan_masters.json | [
{
"docid": "5d7e3404b9c1c8d7e07d5f6d58bdd2fe",
"score": "0.7144247",
"text": "def create \n @prod_plan_master = TrnProdPlanMaster.new(plan_master_params) \n respond_to do |format|\n if @prod_plan_master.save\n format.html { redirect_to trn_prod_plan_masters_url, success: 'Plan master w... | [
{
"docid": "09ce84291c651f655228154a5841bc11",
"score": "0.7386095",
"text": "def create_master\n @plan = Plan.new(plan_params)\n @plan.plan_type = 'master'\n\n respond_to do |format|\n if @plan.save\n format.json { render :show, status: :created, location: api_v... |
03662b8ed4e067023fa3472106ebe359 | volumen cae x2 y bought aumenta x2 | [
{
"docid": "d886d7eccf2a240606205e1eb8c557c2",
"score": "0.0",
"text": "def exit_bought(b0, v0, candle)\n vol = v0 > 0 ? (v0 - (v0 * 2)) : v0 * 2\n candle.bought.to_f >= (b0 * 2) && candle.volume <= vol\n end",
"title": ""
}
] | [
{
"docid": "9f7c8740a74ee528d70a5a44beee8a95",
"score": "0.5896817",
"text": "def x2\n\t\t# RETORNANDO CALCULO\n\t\tx2 = (-@b - CMath.sqrt(delta))/(2*@a)\n\tend",
"title": ""
},
{
"docid": "046596c12e0344e64112075f02ced959",
"score": "0.5776387",
"text": "def effVol\n\n end",
"t... |
72ce66c1c9b52dd49acb7c562db13da7 | return an array of clusters that are in maintenance | [
{
"docid": "d6a2920c0f140cfb928d1610c25f156c",
"score": "0.7648932",
"text": "def clusters_in_maint(clusters)\n maint_clusters = []\n\n # fetch the last 2 hours of events for each cluster\n clusters.each do |cluster_name|\n events_record = redshift.describe_events(start_time: (Time.now - 7... | [
{
"docid": "de70d3a7bf6720c7a4ad9d9f4eada57e",
"score": "0.6771997",
"text": "def dropped_clusters\n _dropped_clusters.to_a\n end",
"title": ""
},
{
"docid": "52367bb75cce7738d27d83cac4fc4ce3",
"score": "0.6684673",
"text": "def updated_clusters\n _updated_clusters.to_a\... |
554ebdc779a4fa21af25720a33a7becd | Perform Author: Tejas Date: 09/10/2018 Reviewed By: | [
{
"docid": "2e9360361d01203028ff2e31cd8db5d5",
"score": "0.0",
"text": "def perform\n\n r = validate_and_sanitize\n return r unless r.success?\n\n r = fetch_admin_secret_obj\n return r unless r.success?\n\n r = validate_otp\n return r unless r.success?\n\n r = validate... | [
{
"docid": "80a62870302f2e702d9f678c713e4922",
"score": "0.6178309",
"text": "def author\n 'Department of Veterans Affairs'\n end",
"title": ""
},
{
"docid": "ed8f7b2514a2e125f2802739f2b1f35d",
"score": "0.6076008",
"text": "def atest_ID_25863_reposted_review()\n ... |
ceb5e5676e45e072ca525ab8851be2da | Return the clone url for a repository. Decides between the private and public url based on use_private_clone_url. | [
{
"docid": "eb25f65bc62da8bd3e8d1f5331987585",
"score": "0.8600245",
"text": "def clone_url(repo_name)\n if use_private_clone_url\n private_clone_url(repo_name)\n else\n public_clone_url(repo_name)\n end\n end",
"title": ""
}
] | [
{
"docid": "11aa127d6ead06b3061f3182a70d9b63",
"score": "0.88711184",
"text": "def clone_url(repo)\n if use_private_clone_url\n repo['ssh_url']\n else\n repo['clone_url']\n end\n end",
"title": ""
},
{
"docid": "dc7cee9ab2d4ede60fe0770b24c50538",
"score": "0.8622768",... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "8bf42d5c30fcaa781c8a2b93e8b53a33",
"score": "0.0",
"text": "def set_board\n board = Board.find(params[:id] || params[:board_id])\n if board.network_id == current_user.network_id\n @board = board\n end\n @show_boards_nav = !@board.nil? && !@board.new_record?\n en... | [
{
"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... |
b2e9e811f8e62658b37caaf24f8e0a02 | GET /cust_details_track_logs GET /cust_details_track_logs.json | [
{
"docid": "76716a078c9af9bded10072a34d89b9d",
"score": "0.79243696",
"text": "def index\n @cust_details_track_logs = CustDetailsTrackLog.all\n end",
"title": ""
}
] | [
{
"docid": "12413d364bedf5ff96205835dfe0eeb6",
"score": "0.6776558",
"text": "def set_cust_details_track_log\n @cust_details_track_log = CustDetailsTrackLog.find(params[:id])\n end",
"title": ""
},
{
"docid": "a993e7869ba819b85b4850fb9dd578cf",
"score": "0.6768781",
"text": "... |
6773029ba59400fe3adac22ca2c8941d | initialize creates a new Command object | [
{
"docid": "fcebed67e76204442055180a49f99e45",
"score": "0.0",
"text": "def initialize(connection, text)\n raise ArgumentError.new(\"+connection+ must be a DataObjects::Connection\") unless DataObjects::Connection === connection\n @connection, @text = connection, text\n end",
"title": "... | [
{
"docid": "8d1b8b0213d76397aa6043c0b2104848",
"score": "0.81675726",
"text": "def initialize(command)\n @command = command\n end",
"title": ""
},
{
"docid": "954fbb2d80a1bcf11b7121fe2a78d445",
"score": "0.80369115",
"text": "def initialize command\n @command = command... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "c77a7b6047f61e262c8fad776f11f17c",
"score": "0.0",
"text": "def access_door_params\n params.permit(:id,:name,:company_id)\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... |
37bf541c2bb57c6516f5d1f90bab8237 | Assign a value to the property The value is converted to whatever specified by options[:type] Examples: (boolean) value = 'J' => true (boolean) value = false => false (date) value = '20120101' => Date.new(2012,1,1) (integer) value = '2' => 2 (string) value = 'foo' => 'foo' | [
{
"docid": "1b9bcf472a24933f1dbd316af7c3e1f7",
"score": "0.628029",
"text": "def value=(new_value)\n return nil if readonly?\n @value = send(\"sanitize_#{options[:type]}\", new_value)\n end",
"title": ""
}
] | [
{
"docid": "206d3aa777f60cc152ce19e47b970c30",
"score": "0.71919644",
"text": "def value_type= value_type\n self.type = value_type.gsub(\"-\", \"_\").camelize\n end",
"title": ""
},
{
"docid": "061436cf9fec507465246ff131dcc561",
"score": "0.70910084",
"text": "def value_type=(val... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "093cb38bc394603640ee237ee2aab069",
"score": "0.0",
"text": "def set_song\n @song = Song.find_by( :id => 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... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "f9f8e680b9173a24f8d5b42c27c9cc5f",
"score": "0.0",
"text": "def dc_photo_params\n params.require(:dc_photo).permit(:user_id, :url)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.74959",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6957448",
"text": "def strong_params\n params.require(:request).permit(param_whiteli... |
0d8cfb8a8f7301713cf87664656ab6fb | Returns the list of the application discovery sessions available Returns the list of the application discovery sessions available | [
{
"docid": "e9587f9f228acde36a7adf64071e1133",
"score": "0.68478197",
"text": "def get_app_discovery_sessions(opts = {})\n data, _status_code, _headers = get_app_discovery_sessions_with_http_info(opts)\n data\n end",
"title": ""
}
] | [
{
"docid": "21e0680bb781cecce41561ec9def2415",
"score": "0.7000125",
"text": "def sessions\n ipc_returning(command('list-sessions'), Session)\n end",
"title": ""
},
{
"docid": "6f58a5ddad0f0a1f1ca799a467bf57d1",
"score": "0.6571574",
"text": "def list_sessions\n response... |
f62fe4ae491935265a8a9c0072e93a03 | Return modules for the mapping. | [
{
"docid": "6b454d4bbbee32dccca0b5e7e30ade2b",
"score": "0.5906349",
"text": "def modules\n @modules ||= to.respond_to?(:devise_modules) ? to.devise_modules : []\n end",
"title": ""
}
] | [
{
"docid": "5ad06ce20ecd8326418153c56ff019e3",
"score": "0.766544",
"text": "def modules\n @modules.values\n end",
"title": ""
},
{
"docid": "0974d822d15b4ac3894456a840d4650b",
"score": "0.7436199",
"text": "def modules\n module_names.map(&:constantize)\n end",
... |
358c84c5098c68581bb8a4968a77384a | Conversion from board footage to cubic meters | [
{
"docid": "08772e2ac4f3e01e27f92aecec8b94a5",
"score": "0.66610706",
"text": "def bfToM3(footage)\n return (footage.to_d * (0.002357))\n end",
"title": ""
}
] | [
{
"docid": "eb6c8c278d6c6515459bb80f1315648d",
"score": "0.72082937",
"text": "def meters(inch)\n inch*0.025400\n\nend",
"title": ""
},
{
"docid": "d5bb7818406b64ba80f1f00c1196ad0e",
"score": "0.70769024",
"text": "def ctof(cel)\n\n\t( cel * ( 9.0 / 5.0 )) + 32\n\nend",
"title":... |
e561e11bcf379ef5dc139c210017366b | Only allow a list of trusted parameters through. | [
{
"docid": "e9527365113e48ecbb90f60298f6de6b",
"score": "0.0",
"text": "def post_params\n params.require(:post).permit(:title, :body)\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... |
722bf8758dfdf6e703983d0c591aabb7 | create handles the saving. new : create as edit : update. not saving user as an instance variable because we're not going to be using it over and over, and not going to be using it in a view | [
{
"docid": "b69b0a00cbb186385add1f4d7ee9959c",
"score": "0.0",
"text": "def create \n user = User.find_by(:email => params[:session][:email]) #make sure that they are saved as a user. if not, returns nil. if yes, returns user.\n if user && user.authenticate(params[:session][:password]) #if both ... | [
{
"docid": "791862befe0e191bc416668923653b75",
"score": "0.75697887",
"text": "def create\n fname = \"#{self.class.name}.#{__method__}\"\n super\n user=User.find_by_email(reg_params[:email])\n pars={}\n unless user.nil?\n pars[:name]=params[:user][:name]\n pars[:role]=params[:user... |
8b64ac0f1b9a754c33920f6d704c4ddf | GET /report_types/1 GET /report_types/1.json | [
{
"docid": "1007dd94c1db20114a740d03700bcb7c",
"score": "0.7313895",
"text": "def show\n @report_type = ReportType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @report_type }\n end\n end",
"title": ""
}
] | [
{
"docid": "cbe6c9d8a4437f4f087df892dbd018bf",
"score": "0.752805",
"text": "def get(id:, type: )\n _get(\"/report/#{id}/report/#{type}\") { |json| json }\n end",
"title": ""
},
{
"docid": "a0772bb10be018df77f0fcc036db6e2f",
"score": "0.7438342",
"text": "def index\n @... |
3a7a8e7e4bc640b143deea55a25451c6 | remove all type instances; this is mostly only useful for testing | [
{
"docid": "dd3532cbf244872688154baa8212f55e",
"score": "0.79509896",
"text": "def allclear\n @types.each { |name, type|\n type.clear\n }\n end",
"title": ""
}
] | [
{
"docid": "5018f8e9c343e5ec71d1baf8c4afcf6e",
"score": "0.79843473",
"text": "def clear!\n SDL::Base::Type::Service.clear_instances!\n\n SDL::Base::Type.subtypes_recursive.drop(2).each do |type|\n type.codes.each do |code|\n @all_codes.delete code\n @type_codes.delete code\n ... |
36bc7c297574caba5f3e98eda8651c36 | This is an attempt to create a list/edit/filter widget with two such widgets within Here, the book is the outermost widget, and it contains within it author and publisher widgets Each of the three has a frame and three children: list, detail, and filter draw_list_detail_filter_frame is supposed to create and wire up each of these in a consistent way, which works with the methods in common_cell.rb. After that, some routes of communication need to be established between the outer and inner widgets. The author and publisher frames are children of the book frame, even though they are in some sense properly children of the book's edit panel, in order to avoid having them reset and redrawn whenever the book's edit panel is redrawn. All of the important stuff here is taken care of in embed_frame. | [
{
"docid": "71a2d9c579019fce6adb0aa4a3392bd3",
"score": "0.7004343",
"text": "def draw(root)\n # create the three frame widgets first\n book_frame = draw_list_detail_filter_frame('book')\n author_frame = draw_list_detail_filter_frame('author')\n publisher_frame = draw_list_detail_fil... | [
{
"docid": "fe7ad03d8bb99d892425738604d08670",
"score": "0.7008068",
"text": "def draw_list_detail_filter_frame(resource, opts = {})\n opts[:cell_sym] ||= resource.pluralize.to_sym\n opts[:prefix] ||= ''\n base_name = opts[:prefix] + resource\n frame = cell(opts[:cell_sym], :_frame_start, ba... |
3dfa0a15dcde9a76990b5e0e2071fae2 | the private user_params takes care of privatizing params[:user] in the Create action. | [
{
"docid": "e30c11d11d45cc2c283dc8e44ade89f9",
"score": "0.0",
"text": "def user_params\n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
}
] | [
{
"docid": "91e4c0b6dd4b52014378dfd52b7bfbae",
"score": "0.7526907",
"text": "def user_params\n params.require(:public_user).permit(:name, :user_id)\n end",
"title": ""
},
{
"docid": "afb7c51a5f38ff05466058607957428a",
"score": "0.7052317",
"text": "def user_params\n p... |
f14af5f7ae3b554d26ea6b5a83525da1 | NOTE(caleb): I fixed a bug with Terraform's ensure_rbenv_version here: I'm copypasting the code here for now. TODO(caleb): Remove ensure_rbenv_ruby_fixed after we cut a new Terraform release and update the version in Barkeep. | [
{
"docid": "e3356b9c203817a9fa330c888d4b14aa",
"score": "0.78531355",
"text": "def ensure_rbenv_ruby_fixed(ruby_version)\n ensure_rbenv\n ensure_packages \"curl\", \"build-essential\", \"libxslt1-dev\", \"libxml2-dev\", \"libssl-dev\"\n\n dep \"rbenv ruby: #{ruby_version}\" do\n met? { `bash -lc '... | [
{
"docid": "91595b0f02c56792776dde8577e701c5",
"score": "0.7516418",
"text": "def determine_rbenv_ruby_version_if_not_given\n if node[:rbenv_passenger][:rbenv_ruby].nil?\n ruby_version = node[:rbenv][:global]\n \n node.set[:rbenv_passenger][:rbenv_ruby] = ruby_version\n... |
f9248edce3bde15d3155d81546bb13a0 | Notify owning user of this transaction, based on their preferences. | [
{
"docid": "de51f4ee3d0aa489becd0dddac9116bc",
"score": "0.62550664",
"text": "def notify_user\n return unless user.can_do_twilio? # user has no phone number\n\n case\n when user.notify_by_sms?\n notification = Coin::Notification.new(tx: self, method: :sms)\n when user.notify_... | [
{
"docid": "3225f082a32e415ba84bc0dd8e3d0e8f",
"score": "0.6561892",
"text": "def notify_appropriate_users\n if @assignment.user == @previous_owner\n @assignment.notify :owner, of: :changed_assignment, by: @current_user\n else\n @assignment.notify :owner, of: :new_assignment, by: @curren... |
00b715331380752c4a68341776724102 | We only cache the status for the HEAD commit of a project This status is rendered in project lists | [
{
"docid": "7981fd2353c280622969cd25656d7c1b",
"score": "0.0",
"text": "def store_in_cache_if_needed\n return unless sha\n return delete_from_cache unless commit\n store_in_cache if commit.sha == self.sha\n end",
"title": ""
}
] | [
{
"docid": "3db6173cb4ea8691a296b64fda1c35eb",
"score": "0.7023451",
"text": "def get_head(project)\n get(\"/projects/#{project}/HEAD\")\n end",
"title": ""
},
{
"docid": "a3052fe2e7db6551e0d24e7ac70de0df",
"score": "0.6794466",
"text": "def status_report\n @projects =... |
2bd0287842c5f3b55b9fa1eda850be88 | Transfer Transfer reverse_transfer can reverse a transfer between two accounts | [
{
"docid": "3e3284ac23eb808a745fc4cae1466ad8",
"score": "0.82694",
"text": "def reverse_transfer\n if @status == 'complete' # Transfer Transfer #reverse_transfer it can only reverse executed transfers\n @sender.balance += amount\n @receiver.balance -= amount\n @status = 'reversed'\n ... | [
{
"docid": "8931e93c84201f8ec09ffad2c2b23ea2",
"score": "0.83018184",
"text": "def reverse_transfer\n#can only reverse executed accounts\n if valid? && receiver.balance > amount && self.status == \"complete\"\n receiver.balance -= amount\n sender.balance += amount\n self.status = \"rev... |
ea51cfa22fe0b7a7d10f8a00198a8bb9 | Return the localized url of an entry (page). | [
{
"docid": "7301b83721d9e44f4ecce100f70e76e7",
"score": "0.778108",
"text": "def entry_url(page)\n services.url_builder.url_for(page)\n end",
"title": ""
}
] | [
{
"docid": "6f30e4f8fa6091e98dd743ae40db8d2c",
"score": "0.71238637",
"text": "def url_for(entry)\n build_url(@requested_entry, entry)\n end",
"title": ""
},
{
"docid": "94b1e246c29b1841e36bfecd2b378d5c",
"score": "0.6927511",
"text": "def url_for(entry)\n if entry.top_level... |
b0c4555f6e380f9325eea08ea4cf32e1 | fetch a specific resource | [
{
"docid": "9f57dcf1303a5f997062703d340446ae",
"score": "0.73541135",
"text": "def fetch(resource_type,identifier,params={})\n path = '/api/' + resource_type.to_s + '/' + slugify(identifier)\n hydrate(resource_type, http_get(path,params))\n end",
"title": ""
}
] | [
{
"docid": "4a7d7b4bddb9c59823e703f27a1d3faf",
"score": "0.7782462",
"text": "def fetch(resource,identifier,params={})\n uri = '/api/' + resource.to_s + '/' + identifier\n http_get(uri,params)\n end",
"title": ""
},
{
"docid": "e24b0f7bed4d083c9a6919782973d33a",
"score": "0.... |
232dc6fe71cde1ba9bcac5242bbb1cb1 | POST /mivacunas or /mivacunas.json | [
{
"docid": "32990b0041007582a841371d649ecc1d",
"score": "0.6558671",
"text": "def create\n @mivacuna = Mivacuna.new(mivacuna_params)\n\n respond_to do |format|\n if @mivacuna.save\n format.html { redirect_to @mivacuna, notice: \"Mivacuna was successfully created.\" }\n format.js... | [
{
"docid": "98f041795dbc5114c04b39c142531e27",
"score": "0.61984277",
"text": "def create\n Rails.logger.info(\"*CAMISAS* CAMISAS***********************\")\n Rails.logger.info( params[:musculo][:atividade_ids].inspect)\n Rails.logger.info(\"***************************************\")\n\n @mus... |
ef17b48f8dfd71eb3754ef404ebbbd1c | This function erases the multiple line entry field from the screen. | [
{
"docid": "005bb7f9d1bf3a9701ac8df0eef09108",
"score": "0.53342026",
"text": "def erase\n if self.validCDKObject\n CDK.eraseCursesWindow(@field_win)\n CDK.eraseCursesWindow(@label_win)\n CDK.eraseCursesWindow(@win)\n CDK.eraseCursesWindow(@shadow_win)\n end\n en... | [
{
"docid": "f38d0af407fff58775d2e6d74ebbd675",
"score": "0.67254275",
"text": "def clean\n width = @field_width\n\n @info = ''\n\n # Clean the entry screen field.\n @field_win.mvwhline(0, 0, @filler.ord, width)\n\n # Reset some variables\n @screen_col = 0\n @left_char ... |
b089fb5e9c9be7517448b165d42c0ef5 | OmniAuth provider callback routes | [
{
"docid": "90e2dc86ebabd8599ff7698b1f51ee9e",
"score": "0.0",
"text": "def facebook\n callback\n end",
"title": ""
}
] | [
{
"docid": "bb5d8b0e1716e8db70560270bc40c81b",
"score": "0.7227845",
"text": "def omniauth(provider, *args); end",
"title": ""
},
{
"docid": "61b474b0462309315f92fd2838f60f7c",
"score": "0.6754369",
"text": "def url_to_social_login( provider_key, on_success = nil )\n provider = Aero... |
e1277accb26f5834e44570baa87dec82 | Returns a packed string representing the packet's data | [
{
"docid": "eae35574d126816fc0318af1b64d33e1",
"score": "0.66110283",
"text": "def to_s\n [0xFF, 0xFF, 0xFF, 0xFF, @header_data, @content_data.string].pack('c5a*')\n end",
"title": ""
}
] | [
{
"docid": "6d8975bd77c6a201149c140c7f92f15c",
"score": "0.77897686",
"text": "def to_s\r\n packet = build_packet\r\n @packet_size = packet.length\r\n return [@packet_size].pack(\"V\") + packet\r\n end",
"title": ""
},
{
"docid": "fd89089005dd06effb64d974026a6ca2",
"sco... |
b062db17d6c342e852011efc953d989e | adjusts time display by v1.0 time zone offset when appropriate | [
{
"docid": "5d89a514b5cfb2e6fca319cb21b2a8a6",
"score": "0.0",
"text": "def chk_offset(*tm)\n return Time.now unless tm[0] \n @tm = adjust_time(tm[0], tm[1]) unless @user.blank?\n @tm.blank? ? tm[0].strftime(\"%l:%M %p\") : @tm.strftime(\"%l:%M %p\")\n end",
"title": ""
}
] | [
{
"docid": "e667d7380567d84b84a807c7dee6c9b3",
"score": "0.72456676",
"text": "def time_relative_to_timezone (oldTime, newTimeZone)\r\n oldTimeZone = time.offset \r\n oldTimeZone *= 24\r\n\r\n timeZoneDifference = oldTimeZone - newTimeZone\r\n\r\n time - (timeZoneDifference / 24)\r\nend",... |
f51bb0991e35a25024f015b24dbf8ac7 | Board position takes in user input and returns the value of the board cell | [
{
"docid": "e265c7ca2c9062a9edca07cadee278e5",
"score": "0.7138206",
"text": "def position(input)\n index = input.to_i - 1\n \"#{cells[index]}\"\n end",
"title": ""
}
] | [
{
"docid": "973fc4739fa263ff199713be2bee291f",
"score": "0.8180886",
"text": "def position(input)\n # go through current board (@cells) and return the value represented by index\n self.cells[input.to_i-1]\n end",
"title": ""
},
{
"docid": "b2fc9567903b33bbc12c75fed49cd64c",
"score... |
2bbcb98c10af6a5989a0c5ec0954621e | an action should be a hash, to include variable args: key: the type of action the player chose | [
{
"docid": "4448bc2b18a14f4bb097c1b33661242b",
"score": "0.0",
"text": "def calculate(player1_action, player2_action)\n\n #run phase short circuits all other calculation (as it becomes unecessary)\n if player1_action[:key] == :run\n run!(@p1)\n end\n if player2_action[:key] == :run\n ... | [
{
"docid": "57396313dc5c348b1734141db7e0699d",
"score": "0.72418505",
"text": "def store_player_action(plname, action, *args)\n curr_giocata = @info_match[:giocate].last\n if curr_giocata\n curr_actions = {:pl_name => plname, :type => action, :arg => args}\n curr_giocata[:actions] << cur... |
cde8427671bda6ac0cde65694446d209 | TODO Need to add exclusion if string is already a propoerty of FnSub... | [
{
"docid": "ba34329b6cce0474e6effb856219a643",
"score": "0.6269553",
"text": "def fix_string(val)\n val.include?('${') ? FnSub(val) : val\n end",
"title": ""
}
] | [
{
"docid": "ed4b7b287654b536eedaf2c71e1c352b",
"score": "0.60799366",
"text": "def subs\n puts \"foobar\".sub('bar','foo')\n end",
"title": ""
},
{
"docid": "e5fe6f15875ce67a69709411147566f7",
"score": "0.60051763",
"text": "def sub_ext(ext); end",
"title": ""
},
{
"d... |
920bc4e8cb466d9a7326fbdbaf4f117b | Updates activity in database | [
{
"docid": "10a373e57ee8462936e22792660ff125",
"score": "0.6303432",
"text": "def update\n @activity = Activity.find_by_id(params[:id])\n @activity.update_attributes(activity_params)\n if @activity.save\n flash[:success] = \"Activity Successfully Updated!\"\n redirect_to show_activity... | [
{
"docid": "02e10252cab67b6c26275ce633d3c085",
"score": "0.6968764",
"text": "def update_activity\n self.last_activity = Time.now\n end",
"title": ""
},
{
"docid": "980785faa1eabf3b0593951277c80cf8",
"score": "0.6949728",
"text": "def complete_activity(db, act_id)\n\tdb.execute(\... |
ebc88f9601def165aaa1af431963c47f | GET /default_board_columns GET /default_board_columns.json | [
{
"docid": "b6642e5240a74d7c2c54ad0b64a7b9ad",
"score": "0.8133629",
"text": "def index\n @default_board_columns = DefaultBoardColumn.all\n end",
"title": ""
}
] | [
{
"docid": "b948ecdf8e34e93fdc87512d5b8da6f5",
"score": "0.72436446",
"text": "def index\n @columns = Column.where(board_id: @board.id).order(:column_order)\n json_response(@columns)\n end",
"title": ""
},
{
"docid": "abe21e3a9d2868c9a3afa5570bf13538",
"score": "0.71416837",
"... |
0b9544037fb47709ce9b66a5ff19634d | POST /props POST /props.xml | [
{
"docid": "d9da581ba713efcc7fa66ac9f794ddd3",
"score": "0.63385546",
"text": "def create\n @prop = Prop.new(params[:prop])\n\n respond_to do |format|\n if @prop.save\n format.html { redirect_to(@prop, :notice => 'Prop was successfully created.') }\n format.xml { render :xml =>... | [
{
"docid": "0568790f42ca7fbbbaaf99654846b307",
"score": "0.6160132",
"text": "def create\n @prop = Prop.new(prop_params)\n\n respond_to do |format|\n if @prop.save\n format.html { redirect_to @prop, notice: \"Prop was successfully created.\" }\n format.json { render :show, statu... |
f24b40cceaf86d98f558d4686783b382 | "a = 5, array = [1, 2, 3, 4, 5], class massiva = Array, size = 5" Example 10 Peredacha masiva v funkciyu (ne ponyatno v chem raznitsa) | [
{
"docid": "ef0ebccaaf7ad4b9a3f724d1c270c9fb",
"score": "0.5964777",
"text": "def send_array1 (a, *arr)\n p \"a = #{a}, array = #{arr}, class massiva = #{arr.class}, size = #{arr.size}\"\n p sum = arr.inject{|sum, num| sum += num} # 15\nend",
"title": ""
}
] | [
{
"docid": "fa0b6f292fad17fcaa21941beebd36cf",
"score": "0.6142413",
"text": "def send_array (a, arr)\n p \"a = #{a}, array = #{arr}, class massiva = #{arr.class}, size = #{arr.size}\"\n p sum = arr.inject{|sum, num| sum += num} # 15\nend",
"title": ""
},
{
"docid": "4bd0ad7e6b589a0e865... |
031dd0877d9b9b0285b88da6cd4ce2d8 | POST /subcategories POST /subcategories.xml | [
{
"docid": "8b96fb96d1f023b151d1fb3a5458285b",
"score": "0.6715961",
"text": "def create\n @subcategory = @category.subcategories.build(params[:subcategory])\n\n respond_to do |format|\n if @subcategory.save\n flash[:notice] = '二级分类添加成功.'\n format.html { redirect_to(kadmin_categ... | [
{
"docid": "3f54008ad1b157dbe1b3754917250700",
"score": "0.68109053",
"text": "def get_subcategories\r\n sub_categories = Taxonomy.get_subcategories\r\n render json: sub_categories, root: 'categories', adapter: :json, status: :ok\r\n end",
"title": ""
},
{
"docid": "c93e47db029a98b6ad... |
fa73f27a6804734007332f7be1a3a313 | Returns the Retuser associated with the current application_user's current_retain_id (the id that the user has choosen to use for this session). If current_retain_id is not set but there are Retuser entries for this User, then the first one is choosen. This may return nil if no Retuser has been set up for the application User. Note that Retuser has not been validated. | [
{
"docid": "4e16c08a4128be7fb32a35dc3d775016",
"score": "0.7419447",
"text": "def retain_user\n if application_user.current_retain_id.nil? &&\n (first = application_user.retusers.first)\n application_user.current_retain_id = first\n application_user.save\n end\n @retain_user = ... | [
{
"docid": "14399ac56a0aa0a60569b9a0b568901a",
"score": "0.59669286",
"text": "def curr_user\n return @curr_user if @curr_user\n @curr_user = User.find_by(id: session[:user_id])\n end",
"title": ""
},
{
"docid": "de47bedac92369dee81b179bed3be535",
"score": "0.56717986",
"text"... |
355306a99b769ae8a387e45634a088c9 | load up the number cards | [
{
"docid": "e134ff247293990ad1051736ab422c1b",
"score": "0.6870772",
"text": "def load_number_cards\n counter = 2\n while counter <= 10\n new_card = Card.new counter\n $the_deck << new_card\n counter+=1\n end\nend",
"title": ""
}
] | [
{
"docid": "2c64d12454980084cda023fd8990096a",
"score": "0.6765614",
"text": "def loadCardInfo\n\t\tcardInfoPattern = /<a href=\"\\/movies\\/rent\\/\\d+\">(.*)<\\/a><\\/td>\\n\\s*<td>([0-9]*)<\\/td>\\n\\s*<td>([0-9]*)<\\/td>\\n\\s*<td>([0-9]*)<\\/td>\\n\\s*<td>([0-9]*)<\\/td>/\n\t\tcardInfoHolder = extr... |
7aff22aa28a80009721c743386749288 | Convert from degrees to a normalized vector in that direction. | [
{
"docid": "738c02c4c9a28a5cc2ef8ee7dd81a4a8",
"score": "0.5893298",
"text": "def deg2unit_vect; end",
"title": ""
}
] | [
{
"docid": "59df0a202678d539fb1bc583f9ff78b0",
"score": "0.7643918",
"text": "def normalized\n vec = Vector2.new(@v)\n vec.normalize!\n end",
"title": ""
},
{
"docid": "a6ac2a65f067cb0405914bba09c9c0af",
"score": "0.75175583",
"text": "def normalized\n vec = Vector3.new(@v)... |
e2b95e171b4539c1d3a891975367d9ec | DELETE /refresh_audits/1 DELETE /refresh_audits/1.json | [
{
"docid": "bb31be0d568e78205214dd1084fc1388",
"score": "0.7644929",
"text": "def destroy\n @refresh_audit.destroy\n respond_to do |format|\n format.html { redirect_to refresh_audits_url, notice: 'Refresh audit was successfully destroyed.' }\n format.json { head :no_content }\n end\n ... | [
{
"docid": "d5c9fa3e4f3f558753961ef9ef0e0108",
"score": "0.69570893",
"text": "def destroy\n @audit = Audit.find(params[:id])\n @audit.destroy\n\n respond_to do |format|\n format.html { redirect_to audits_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
... |
c62cfe86a4846ac6fc46364e3a8d4d49 | Generates the Property for this Integer <RDF::Literal::Integer:0x3fc8a104f570("1"^^< | [
{
"docid": "c7ea495c1fcc1ac432779d77b529e261",
"score": "0.56652415",
"text": "def result\n map_value(converted_value: RDF::Literal.new(\n value.value,\n datatype: PermissiveSchema.valkyrie_int\n ))\n end",
"title": ""
}
] | [
{
"docid": "86330b88abd9cd614ea16ee8b80db150",
"score": "0.59470975",
"text": "def integer_property(name)\n val = property(name)\n val ? property_cache[name] = val.to_i : nil\n end",
"title": ""
},
{
"docid": "21c2b7f623f54e5248142da453d6c793",
"score": "0.594229",
"text... |
d948b1c6534363f8f2bf8762dfdadc27 | Helper that generates the breadcrumb link. If the user is navigating the index, | [
{
"docid": "2056ecdcda2ccd6b6044c06e36ee1253",
"score": "0.6586584",
"text": "def to_breadcrumb_link\n case @user.class.name\n when 'NilClass'\n ['People', nil]\n when 'User'\n if @user.new_record?\n ['Sign up', nil]\n else\n ['User', users_path]\n end\n whe... | [
{
"docid": "f9ca73842926c9da9578033fd1621424",
"score": "0.6884399",
"text": "def show\n breadcrumb\n end",
"title": ""
},
{
"docid": "48ea90344698e45639d0e3a1ae2de0e5",
"score": "0.6845452",
"text": "def breadcrumb_name\n title\n end",
"title": ""
},
{
... |
a8a9325a4809910b167e8240393c1a91 | Sends a frame via the underlying TCP stream. | [
{
"docid": "8ec6fb8dca347727fb15467adcde06c1",
"score": "0.73714083",
"text": "def send_frame(frame_data)\n send_bytes FrameProtocol.encode_frame(frame_data)\n end",
"title": ""
}
] | [
{
"docid": "2428264a5bfbaff4021d45ce1ddd2276",
"score": "0.8246314",
"text": "def send(frame)\n @logger.debug \"Send: #{frame.to_s}\" if @logger\n @socket.send frame.to_s, 0\n end",
"title": ""
},
{
"docid": "6e9263dd24187611644f7cd80c2bb776",
"score": "0.7776486",
"text... |
402cf9142421cd188a287ed4d768ac8f | Name symbol for the _add internal association method | [
{
"docid": "9372b462aef864836a9e86426e404568",
"score": "0.77662367",
"text": "def _add_method\n :\"_add_#{singularize(self[:name])}\"\n end",
"title": ""
}
] | [
{
"docid": "490bfd524c5b7d987ebab126782552a6",
"score": "0.73446697",
"text": "def add_method\n :\"add_#{singularize(self[:name])}\"\n end",
"title": ""
},
{
"docid": "fb1717924344d4522b62ec8430f407de",
"score": "0.7333828",
"text": "def add_method\n :\"add_#{sel... |
409cf8b89ede48cce1d511917ac777d3 | === Delete sku. Delete a sku. ==== Parameters id:: (Integer) Sku id. ==== Example | [
{
"docid": "259ec7fe267185ff31be9d92044e9a22",
"score": "0.84907854",
"text": "def delete_sku(id)\n @client.raw('delete', \"/ecommerce/skus/#{id}\")\n end",
"title": ""
}
] | [
{
"docid": "ab285989de939d36b6d3aeea93b5d668",
"score": "0.8522231",
"text": "def delete_sku(id)\n return @client.raw(\"delete\", \"/ecommerce/skus/#{id}\")\n end",
"title": ""
},
{
"docid": "dd3868f770b23dde0a7fed47c1f92ba7",
"score": "0.71392787",
"text": "def destroy\n\t... |
d194496265854513fb1a371118cfd146 | Return available interface classes. | [
{
"docid": "ba2cbcb62bbd0ec0c62490490cd4359b",
"score": "0.0",
"text": "def available\r\n @available\r\n end",
"title": ""
}
] | [
{
"docid": "248c2faccf05cd124cfcb8262b9f2946",
"score": "0.68974626",
"text": "def list_known_classes\n end",
"title": ""
},
{
"docid": "3233d7ff52d9096cbd887dcfc71a0ce7",
"score": "0.6818713",
"text": "def interfaces\n klass = is_a?(Class) ? self : self.class\n klass.included... |
e2bd46c48674c258f979d224e3bd2da3 | reduce 578 omitted reduce 579 omitted | [
{
"docid": "161ac8e233a7a97c9057e47fac07f40a",
"score": "0.0",
"text": "def _reduce_580(val, _values, result)\n # TODO: differs from parse.y - needs tests\n name = val[1].to_sym\n self.assignable name\n result = :\"*#{na... | [
{
"docid": "d6f4be17261b17922757ecbba7500fb0",
"score": "0.7562324",
"text": "def _reduce_594(val, _values, result)\n result = nil\n \n result\nend",
"title": ""
},
{
"docid": "56bd5579a3a2de64f1337e1168c579a4",
"score": "0.7546304",
"text": "de... |
ac7a652529569b1dd13800116c0ff21c | GET /composers/1 GET /composers/1.xml | [
{
"docid": "abde3d7d8aa1170f1bac15ca660d270f",
"score": "0.616655",
"text": "def show\n @composer = Composer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @composer }\n end\n end",
"title": ""
}
] | [
{
"docid": "ec84122e92344f5bd8ccabbf84e2d6c5",
"score": "0.69402784",
"text": "def index\n @composers = Composer.all\n end",
"title": ""
},
{
"docid": "b95f3a7c15770380d05c84ef66448f09",
"score": "0.6248793",
"text": "def index\n @composings = Composing.all\n end",
"title... |
21af792c3afa7c2f3178d90bde0d6d7f | Method that lists the accounts | [
{
"docid": "5da11430f772f9103aa4ba75ec8c0519",
"score": "0.0",
"text": "def list_accounts\n # Get the accounts from the database\n accounts = get_accounts\n\n # Figure out the \"widest\" value in each column\n l = { :user => [6], :name => [4], :uid => [3], :gid => [3], :home => [7], :mail => [8] }\n... | [
{
"docid": "5ffdc18037a27cc0e834220a75d31684",
"score": "0.7920358",
"text": "def index\n\t\t@accounts = current_user.accounts\n\tend",
"title": ""
},
{
"docid": "3aed9bd4448e1b5e8bbd1f35a07962e7",
"score": "0.7900361",
"text": "def list\n if current_user\n accounts = current... |
05dbe910bd9d112a3acb342639b44eb6 | Show other user's profiles and the service they offer | [
{
"docid": "3a65f6214a29b08d9fc0ef00bf9a19ef",
"score": "0.0",
"text": "def show\n @user = User.find_by username: params[:username]\n end",
"title": ""
}
] | [
{
"docid": "74c132bebf6498ff591472937ac43b04",
"score": "0.7097487",
"text": "def show\n @user = current_user\n @profile = @user.profile\n end",
"title": ""
},
{
"docid": "7c7c4b01aad79247d5f46efdc11a104d",
"score": "0.69908065",
"text": "def show\n @user_profile = current_... |
d75236e5954606d88a9f58a90c82980a | DELETE /styles/1 DELETE /styles/1.json | [
{
"docid": "e8b343e587d89d5cd82b35faf73e0fdd",
"score": "0.74598753",
"text": "def destroy\n @style.destroy\n respond_to do |format|\n format.html { redirect_to styles_url, notice: 'Style was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
... | [
{
"docid": "1f0fd7cb16842e677c5add7eed92eab0",
"score": "0.75903547",
"text": "def destroy\n @style = Style.find(params[:id])\n @style.destroy\n\n respond_to do |format|\n format.html { redirect_to styles_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
... |
a58ed5a93f89fd471b1da296cbca6ba5 | Determine if the storage pool is persistent or not. | [
{
"docid": "941a30cc87e32f2a6e95b7f9b036a607",
"score": "0.8661",
"text": "def persistent?\n FFI::Libvirt.virStoragePoolIsPersistent(self) == 1\n end",
"title": ""
}
] | [
{
"docid": "2ac9522b47ec17c47741452da4fd45ef",
"score": "0.78536814",
"text": "def persistent?\n persistent\n end",
"title": ""
},
{
"docid": "3d457ec1d97154a15593cdcb0ebaf846",
"score": "0.7851285",
"text": "def persistent?\n @persistent\n end",
"... |
cc9eedf7479a434c079a41ecdd1fae72 | POST /service_journals POST /service_journals.json | [
{
"docid": "011ca07c371ddad842d766ac82cc6e83",
"score": "0.66099715",
"text": "def create\n @service_journal = ServiceJournal.new(params.require(:service_journal).permit(:date_time, :event_id, :service_visit_id))\n\n respond_to do |format|\n if @service_journal.save\n ... | [
{
"docid": "aefcae82a4958767ea5d2093c895cecc",
"score": "0.6626303",
"text": "def create\n # A user has many journals. A journal belongs to a user\n @journal = current_user.journals.new(journal_params)\n\n respond_to do |format|\n if @journal.save\n format.html { redirect_to journal... |
5a60fcfb41640fd893b3ad269da37c33 | DELETE /restaurants/1 DELETE /restaurants/1.json | [
{
"docid": "5762494ccf3c46e88d1140e9aa325149",
"score": "0.74022",
"text": "def destroy\n @restaurant.destroy\n respond_to do |format|\n format.html { redirect_to restaurants_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] | [
{
"docid": "7d745be93ec2e004bb3c68fc59429e79",
"score": "0.7505612",
"text": "def destroy\n @restaurant = Restaurant.find(params[:id])\n @restaurant.destroy\n\n respond_to do |format|\n format.html { redirect_to restaurants_url }\n format.json { head :no_content }\n end\n end",
... |
0a8da380bfcf2ed660f3556045fdaa49 | applies the difference between the two instances given on initialization to the given +diff+ instance, which should be an instance of either +Roomorama::Diff+ or +Roomorama::Diff::Unit+. The +diff+ is expected to: have the +[]=+ method, allowing attributes to be set using a Hashlike syntax; respond to the +erase+ method, indicating that an attribute should be +nil+ when serialized, causing it to be erased. Returns a boolean indicating whether or not there were any changes applied. | [
{
"docid": "15664b62777dd4f0e79a836761b02940",
"score": "0.7319624",
"text": "def apply_to(diff)\n\n changed = false\n original_serialized = original.to_h\n new_serialized = new.to_h\n\n # 1. find attributes which map to scalar values (i.e., removes Arrays and Hashes).\n or... | [
{
"docid": "1f86fd19e5677e73fb739380d8bf17a8",
"score": "0.6380173",
"text": "def diff?\n !diff.empty?\n end",
"title": ""
},
{
"docid": "ac9ecda1a66b174865be8342271256c6",
"score": "0.62061846",
"text": "def validate_diff\n if diff.present? and !diff.valid?\n ... |
169c3fb99912275d3bcd13123f55099e | The end state name for this path. If a target state was specified for the path, then that will be returned if the path is complete. source://state_machines//lib/state_machines/path.rb52 | [
{
"docid": "1e9a0bc68b582483bd587da9e53e3271",
"score": "0.0",
"text": "def to_name; end",
"title": ""
}
] | [
{
"docid": "e9d6ead79ada4063dfb0eff4c113a445",
"score": "0.6646418",
"text": "def path\n '/' + path_states.map(&:name)[1..-1].join('/')\n end",
"title": ""
},
{
"docid": "305c47788a49ed3606c3498c2eb375db",
"score": "0.6527115",
"text": "def complete_state_name()\n return engin... |
8029a0682b8e687a3a7895efe4e1e8df | depending on the population density, multiply the population by a specific percentage; round down to whole; prints a statement to the console | [
{
"docid": "8427b627696f7164dabb30e29eea4be4",
"score": "0.0",
"text": "def predicted_deaths\n case @population_density\n when (0...50) then (@population * 0.05).floor\n when (50...100) then (@population * 0.1).floor\n when (100...150) then (@population * 0.2).floor\n when (150...... | [
{
"docid": "0759717ba93072219b4804b7697378cb",
"score": "0.7164384",
"text": "def predicted_deaths#(population_density, population, state)\n pct = case\n when @population_density >= 200 \n 0.4\n when @population_density >= 150 \n 0.3\n when @population_density >= ... |
304429e3b8bac452fc7f2f43dfb38d60 | GET /boat_lengths/new GET /boat_lengths/new.xml | [
{
"docid": "c25571c3b1108a3d52165a7f85f9c7bc",
"score": "0.73192555",
"text": "def new\n @boat_length = BoatLength.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @boat_length }\n end\n end",
"title": ""
}
] | [
{
"docid": "4479c02c4011248d78d4e142a05909d6",
"score": "0.66888875",
"text": "def new\n @length = Length.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @length }\n end\n end",
"title": ""
},
{
"docid": "7e426cfb4481aa6c64dd69ec... |
c1a48555f4ebcab0fe33893c2d6f3c92 | def sendCompareEmail Arguments: roid ( Long ) tag ( String ) | [
{
"docid": "e26215c382b9d9bc37d21b0d2975cebf",
"score": "0.0",
"text": "def setRevisionTag( roid, tag )\n\n # parameter TypeCheck\n #BIMserverAPI::TypeCheck::Long( roid )\n #BIMserverAPI::TypeCheck::String( tag )\n\n # BIMserver request\n request( { roid: roid, tag: tag } )\n ... | [
{
"docid": "ce2174cd91f86ba11c0b93197bafca3a",
"score": "0.7301539",
"text": "def sendCompareEmail( sCompareType, mcid, poid, roid1, roid2, address )\n\n # parameter TypeCheck\n #BIMserverAPI::TypeCheck::SCompareType( sCompareType )\n #BIMserverAPI::TypeCheck::Long( mcid )\n #BIMserv... |
f98d342c161ae56929278036edb738d4 | una vez creado actualiza el stock del producto | [
{
"docid": "465f3efe715f81515af19b42400d1a6a",
"score": "0.0",
"text": "def ac_movement\n self.d_movements.each do |child|\n product = Product.find(child.product_id)\n auxTotal = child.cantidad * product.precio_venta\n DMovement.update(child, :precio => product.precio_venta, :total => ... | [
{
"docid": "15e2ea0552b82b7c45cc18dc55e0fea9",
"score": "0.79112935",
"text": "def actualiza_inventario\n if inventariar\n if new_record?\n inventario = com_articulo\n .com_inventario\n .where(emp_locacion: emp_locacion).first\n\n inventario.stock += cantidad\... |
1ecb7017fb9ced190940576e468a8d4e | Time complexity: O(n^2) where n represents the length of my_sentence. Space complexity: O(1), since the string array is reversed in place. | [
{
"docid": "ea4b30a7f4c90fd551ed32660e02045d",
"score": "0.0",
"text": "def reverse_sentence(my_sentence)\n if my_sentence == nil\n return my_sentence\n end\n len = my_sentence.length\n j = 0\n (len / 2).times do\n low = my_sentence[0 + j]\n high = my_sentence[len - 1 - j]\n x = low\n ... | [
{
"docid": "99f55a0a46dcca77321ce6f25824e516",
"score": "0.82368994",
"text": "def reverse_sentence(my_sentence)\r\n #step 1: reverse individual words\r\n reverse_words(my_sentence)\r\n #time complexity: O(n), must go through each character in the string.\r\n\r\n #step 2: reverse the whole string\r\... |
c7d7a2b99a12e809cb91ecf37110bf40 | GET /coupons/1 GET /coupons/1.json | [
{
"docid": "1e4a115ae74d610b68f1631e91cc3519",
"score": "0.7101939",
"text": "def show\n @coupon = Coupon.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @coupon }\n end\n end",
"title": ""
}
] | [
{
"docid": "de4e95549a38a4fdb7333c44c53d1171",
"score": "0.756042",
"text": "def coupons\n headers, params = build_request_data\n urlstr = generate_url('/%s/coupon/%s/show.json?hash=%s', params)\n handle_coupon_results(JSON.parse(RestClient.get(urlstr, headers)))\n end",
"title": "... |
011296ae77d28809a76fb4af5315810f | return a hash whose keys are the resources' controller names and values for each key are the names of the controllers for that resource parents. | [
{
"docid": "32a401855a52257f0d26ab141d7a6983",
"score": "0.642235",
"text": "def resources_parents\n if @@resources_parents.length > 0\n @@resources_parents\n else\n analyze()\n end\n end",
"title": ""
}
] | [
{
"docid": "1c8e40b9d646e98f298a502747baaf72",
"score": "0.7149221",
"text": "def check_parent_resources\n # Key to hash for controller relationships information.\n ar_parents_key= @controller.controller_class_name.intern\n parents= @res_parents[@controller.controller_name]\n\n ... |
ca0906d6f731a902b6fde924caaffa61 | dont touch this holy pally method | [
{
"docid": "d88fd16a5b3018e94d555178f7a9ad0e",
"score": "0.0",
"text": "def resume\n @program = Program.find(params[:prog_id])\n @all_lessons = @program.lessons.all\n @user_statuses = current_user.statuses\n user_associations = Array.new\n\n @user_statuses.each do |s|\n user_associat... | [
{
"docid": "b6b2bcc0062aeb115edab7b10cbe6930",
"score": "0.6849649",
"text": "def desired; end",
"title": ""
},
{
"docid": "bc658f9936671408e02baa884ac86390",
"score": "0.6831331",
"text": "def anchored; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
... |
9aef3d9c7a5e777b4dd05b03fb0291e3 | write code that returns the first three elements of the array | [
{
"docid": "6337a1a51e73af0abdd10578421890bf",
"score": "0.7287352",
"text": "def test_first_three\n array = [1,2,3,4,5]\n array = array.first(3)\n assert_equal [1,2,3], array\n end",
"title": ""
}
] | [
{
"docid": "581500bc7f5878fa9880d5f29d389f4c",
"score": "0.77274317",
"text": "def array_first\n golf_scores=[75,76,78,77,79,74,72] # this is the orignal array\n golf_scores.first(3) #this example return the first 3 scores\n # from... |
552c69fd40e51ce6dfe4b57ba5c2a2ad | Construct a limit for QuerySet | [
{
"docid": "4b4b0a77aedbcb65b27ca1fa2778b8e0",
"score": "0.0",
"text": "def initialize(size, offset = 0)\n @size = size.to_i\n @offset = offset.to_i\n end",
"title": ""
}
] | [
{
"docid": "2078a16b0c1a6cf623a6571ac8574343",
"score": "0.7579952",
"text": "def limit limit\n _with(:limit => limit)\n end",
"title": ""
},
{
"docid": "c852260a26937a91815369767b8f0826",
"score": "0.75356054",
"text": "def limit *args\n return @limit if args.empt... |
b5a25204f97ca0e9670ec79bebb05962 | Returns html to display the due date selector for task | [
{
"docid": "32e583129cd87ff5d676ad550277f792",
"score": "0.70036334",
"text": "def due_date_field(task, permissions)\n task_due_at = task.due_at.nil? ? \"\" : task.due_at.utc.strftime(current_user.date_format)\n milestone_due_at = task.milestone.try(:due_at)\n placeholder = milestone_due_at.nil... | [
{
"docid": "13ebeef6c3b6b0fafd205e52ddb0c645",
"score": "0.73493844",
"text": "def due_date_field(task, permissions)\n date_tooltip = _(\"Enter task due date.<br/>For recurring tasks, try:<br/>every day<br/>every thursday<br/>every last friday<br/>every 14 days<br/>every 3rd monday <em>(of a month)</... |
dc62ee8da78ce5cbee9daabdcdf2232c | An assign is any expression that sets a named value Example: thing = ...; | [
{
"docid": "7cf351cec0cc6d73d02e29b0dfd3025d",
"score": "0.0",
"text": "def is_assign?\n end",
"title": ""
}
] | [
{
"docid": "0c736e77616803e9c091c56e5539358c",
"score": "0.7960015",
"text": "def do_assignment statement\r\n if statement.type == :LET\r\n ident = (expect [:ident]).value\r\n else\r\n ident = statement.value\r\n end\r\n\r\n expect [:assign]\r\n\r\n if @lexer.peek_next.type == :... |
753a6c4ad646648313f93ff9777f544d | GET /orders/1 GET /orders/1.json | [
{
"docid": "87656912fd2cc52204407a702959262a",
"score": "0.0",
"text": "def show\n @user = User.find(@order.user_id)\n end",
"title": ""
}
] | [
{
"docid": "8fe2d6ec8a1d47ca8c318cf923eb35b7",
"score": "0.79998606",
"text": "def orders\n client.get \"orders\"\n end",
"title": ""
},
{
"docid": "0018a9a547b20cd7a770a6e2cd109f33",
"score": "0.79840624",
"text": "def orders\n get(\"orders\")\n end",
"title": ""
},
... |