query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
55aec1244da290ad3061d81fc156e074 | Find inventory items filtered by a given city ID Example: `curl v H "Contenttype: application/json" ' | [
{
"docid": "ec83cc32f8acc20057dd2b844ee4c3ab",
"score": "0.66767955",
"text": "def in_city\n return json_response([]) if (city_items = InventoryItem.where(params.slice(:city_id))).blank?\n newest_item = city_items.sort_by(&:updated_at).last\n Rails.logger.info \"newest_item is #{newest_item.ins... | [
{
"docid": "308fac653be77c1c5336e04cad81fd84",
"score": "0.6626335",
"text": "def near_city\n nearby_city_ids = RemoteCity.find_nearby_city_id(params[:city_id], params.fetch(:within, 15)).map(&:id)\n nearby_city_ids << params[:city_id].to_i if params[:city_id].to_i\n Rails.logger.info \"nearby ... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "bfc56d9b95ee79c153cc841ccf85f2f6",
"score": "0.0",
"text": "def set_ideology\n @ideology = Ideology.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.6163821",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.6045432",
"text": "def action_hook;... |
a0da0d25052b592da0567b46fb55cd47 | Returns string indicating which file (and line) contains the transliteration value for the character | [
{
"docid": "e38e6da3f2e26e937ac0cb7938d74c86",
"score": "0.5474096",
"text": "def in_yaml_file(character)\n unpacked = character.unpack(\"U\")[0]\n \"#{code_group(unpacked)}.yml (line #{grouped_point(unpacked) + 2})\"\n end",
"title": ""
}
] | [
{
"docid": "49c7ca4d63a04342bf2fc32b4700fd74",
"score": "0.61978257",
"text": "def getCharImgLoc(char)\n \"#{font_path}/cm_#{char}.png\"\n\t\tend",
"title": ""
},
{
"docid": "c47fe01c7865ec03b06dc21a5dd3a5b3",
"score": "0.5960669",
"text": "def untitled_file_name()\n retu... |
0f3cd947015bb21739c93429902a0894 | Responsible for deploying a compiled site to a production server. | [
{
"docid": "1fcffe62bf8fef200bf1c95f88be2fc7",
"score": "0.0",
"text": "def deploy\n Tipsy::Runners::Deployer.new\n end",
"title": ""
}
] | [
{
"docid": "d8cee0304e2f69f52da10306f7e3d0ee",
"score": "0.7402906",
"text": "def deploy\n\t# This task is typiclly run after the site is updated but before the server is restarted.\nend",
"title": ""
},
{
"docid": "d8cee0304e2f69f52da10306f7e3d0ee",
"score": "0.7402906",
"text": "de... |
cfb8db8c2c40c70e9e5eabaca048ef98 | add tag(s) to last pic | [
{
"docid": "885eefaf614f66fdce4006142115fe34",
"score": "0.61753",
"text": "def cmd_tag_last(message, command)\n chat_id = message.chat.id\n return unless (last_pic_id=last_pic(chat_id))\n set_cooldown(chat_id, TAG_COOLDOWN)\n tags = command.split[1..-1] # /cmd tag1 tag2 ...\n tag_pic(las... | [
{
"docid": "84a776f1f86b06d464509228d4057f86",
"score": "0.64369446",
"text": "def tag_end(name)\r\n\t\r\n\t\t@tags.pop\r\n\t\r\n\tend",
"title": ""
},
{
"docid": "d48826919dfcb04368e3dc6d456af03e",
"score": "0.62673414",
"text": "def image_tag # Could be called 'construct_image_tag'... |
d6fea44af261a61405e94322d0bc6cde | determines the underdog of the game | [
{
"docid": "43d36486fa2541c30dc26f90e423e017",
"score": "0.710438",
"text": "def underdog\n\t if home_team != favorite\n\t home_team\n\t else\n\t visitor_team\n\t end\n\tend",
"title": ""
}
] | [
{
"docid": "4eac9a888f8255945c5eda4662a4117a",
"score": "0.63779134",
"text": "def silly_adjective\n fetch('creature.bird.silly_adjectives')\n end",
"title": ""
},
{
"docid": "8c17674ed467b89ea08094a66e08f777",
"score": "0.62167895",
"text": "def pika_attack(enemy_hp)... |
cc3ce3a804b74a9f7dd06945d8dfb080 | PUT /configurations/1 PUT /configurations/1.xml | [
{
"docid": "f81f8756a0e49f6babcc6126b4857186",
"score": "0.63921577",
"text": "def update\n @configuration = Configuration.find_by_id(params[:id])\n\n respond_to do |format|\n if @configuration.update_attributes(params[:configuration])\n flash[:notice] = t('configuration.updated')\n ... | [
{
"docid": "dfb3ec56f82323f887ee5ca50f8460cd",
"score": "0.68589556",
"text": "def update_configuration(xml, options = {})\n client = extract_client!(options)\n\n # The Artifactory api requires a content type of 'application/xml'.\n # See http://bit.ly/1l2IvZY\n headers = { \... |
c22691d5624d3f3809e803cc3964de7d | PUT /admin/users/1 PUT /admin/users/1.json | [
{
"docid": "cd2440fc892bd82633207f4998e37d2b",
"score": "0.6833383",
"text": "def update\n @admin_user = Admin::User.find(params[:id])\n\n respond_to do |format|\n if @admin_user.update_attributes(params[:admin_user])\n format.html { redirect_to @admin_user, :notice => 'Usuário alterad... | [
{
"docid": "d287c257b900a2f4ae9bff3acdb3b320",
"score": "0.730399",
"text": "def update\n if @current_user.admin?\n @v1_admin_user = V1::Admin::User.find(params[:id])\n # TODO strip :company_id and maybe :encrypted_password out of params here\n if @v1_admin_user.update(user_params)\n ... |
5c2efa9bad0cb7cad69288eb490002f3 | sets instance variables based on options, not limited to attr_accesor values | [
{
"docid": "c3a4e0b54b0a0dd5d80a07c3223a9d64",
"score": "0.631515",
"text": "def initialize(options = {})\n options.keys.each do |key|\n self.instance_variable_set(\"@#{key.to_s}\",options[key])\n end\n end",
"title": ""
}
] | [
{
"docid": "019d0ccbd51d3c97e927025f7d35b997",
"score": "0.80710375",
"text": "def set_attributes\n ATTRIBUTES.each do |attr|\n opts_value = @options[attr]\n fail \"Attribute #{attr} is nil\" if opts_value.nil?\n instance_variable_set attr.to_instance, opts_value\n end\n end",
... |
87f296b33933c8b658890790775056a2 | Returns the nick this stem is using. | [
{
"docid": "d517017083a7bcdd56485538c68028a8",
"score": "0.79916155",
"text": "def nickname\n @nick\n end",
"title": ""
}
] | [
{
"docid": "b9ebd6ed134771eb6c5bad56da104e41",
"score": "0.8265171",
"text": "def nick\r\n return for_context(nil, false) { |c| c.nick }\r\n end",
"title": ""
},
{
"docid": "6bfac2f9d5935c6a7ab46d7eb0d97a57",
"score": "0.7958614",
"text": "def nick\n @bot.nick\n e... |
651ba022524d1e67fd10081a4a6f2b17 | patch to supply CSRF token on all ajax requests if it is not present | [
{
"docid": "e8dd9c0a0b94fd68f6add80755de3468",
"score": "0.7507509",
"text": "def set_csrf_headers\n if request.xhr?\n cookies['XSRF-TOKEN'] = form_authenticity_token if cookies['XSRF-TOKEN'].blank?\n end\n end",
"title": ""
}
] | [
{
"docid": "d5e20dd65286d83cab031055d16960d6",
"score": "0.7434715",
"text": "def csrf_token\n response.headers['X-CSRF-Token'] = form_authenticity_token\n render json: nil\n end",
"title": ""
},
{
"docid": "af6790b59095a73e9bc0d511fc57d4e8",
"score": "0.7419263",
"text": "def... |
2152dcfefe969dff03179b5a628814f6 | Concatenates two arrays. [A] [B] => [A B] | [
{
"docid": "a3fb28092e5f3c8bfcba400352bfc6b1",
"score": "0.0",
"text": "def cat\n\t\t\tarray1 = pop\n\t\t\tarray2 = pop\n\t\t\traise ArgumentError, \"CAT: first element is not an Array.\" unless array1.is_a? Array\n\t\t\traise ArgumentError, \"CAT: first element is not an Array.\" unless array2.is_a? Ar... | [
{
"docid": "e649a808374ea04f8a5bf12e846fa0ff",
"score": "0.83556974",
"text": "def array_concat(array_1, array_2)\n\treturn (array_1 << array_2).flatten\nend",
"title": ""
},
{
"docid": "b3e38f0989bfb5bab121290346511d35",
"score": "0.8295344",
"text": "def join_arrays(arr1,arr2)\n a... |
a623241419bf803f0cc5bff3e0f73006 | Process a watcher notice and potentially raise an exception. | [
{
"docid": "a2ad4e010768b00a1b82e5c012d4faa8",
"score": "0.61755043",
"text": "def process_namespace_watcher_notices(watcher)\n watcher.each do |notice|\n case notice[:type]\n when 'MODIFIED'\n reset_namespace_watch_retry_stats\n cache_key = notice[:object][:metadata... | [
{
"docid": "49ed2db2c849c2435b5a9e963ec4c095",
"score": "0.58461124",
"text": "def notify(notice = {})\n Sender.new.catch_exception(notice)\n end",
"title": ""
},
{
"docid": "aa891badf6a855787380cd659a1d9c77",
"score": "0.5584762",
"text": "def process_event(e)\n retur... |
fae82e5438edc3cc6c6b1a87ef690762 | 4. Refactored Solution I don't see how to refactor it further 1. DRIVER TESTS GO BELOW THIS LINE | [
{
"docid": "b10c004604cb33c390201add587998a5",
"score": "0.0",
"text": "def assert(statement = \"Assertion failed!\")\n raise statement unless yield\nend",
"title": ""
}
] | [
{
"docid": "8f30017d276b5452bcea06ff2233286c",
"score": "0.60001177",
"text": "def driver; end",
"title": ""
},
{
"docid": "8f1c94592f39e6f7649463118849a3c2",
"score": "0.5862025",
"text": "def test_cases; end",
"title": ""
},
{
"docid": "072514f3348fe62556dcdfd4b06e3d08"... |
6e3a3533cb674005b3431963550c5e11 | PUT /post97s/1 PUT /post97s/1.xml | [
{
"docid": "56911e668620ed292dfa89cd907ead24",
"score": "0.58872044",
"text": "def update\n @post97 = Post97.find(params[:id])\n\n respond_to do |format|\n if @post97.update_attributes(params[:post97])\n format.html { redirect_to(@post97, :notice => 'Post97 was successfully updated.') ... | [
{
"docid": "38979984bdedacd95706689e25f09f9e",
"score": "0.68516326",
"text": "def put(document, method='')\n @resource[method].put(document.to_s, :content_type => 'text/xml')\n end",
"title": ""
},
{
"docid": "23b5f5e4dacfb330cb1e0ffd4590ef63",
"score": "0.6479281",
"text": ... |
ef55f167f928b06e6e98d5c0355f08fc | Rehash the password. If you | [
{
"docid": "430a5e07371bbdd6519c428695843686",
"score": "0.81410664",
"text": "def rehash\n # Do the salting\n salted = generate_salted( password, salt )\n \n # Do the hashing\n @hash = generate_hash( salted, digest )\n end",
"title": ""
}
] | [
{
"docid": "8fce8db48776ab3f3e9adce7e70a89b8",
"score": "0.7422886",
"text": "def update_hash!(password)\n self.password = password\n hash_password\n save\n end",
"title": ""
},
{
"docid": "ddeffe7f1efc523ff941bb627e8be3df",
"score": "0.7374603",
"text": "def hash_p... |
6b85c10c0c2d38da7f16d3d9c8c6fdfb | The user creation page loads | [
{
"docid": "5121d15c586437f7b4e7ae8a0a7f2f9c",
"score": "0.0",
"text": "def test_new_view\n get :new\n assert_response :redirect\n assert_redirected_to user_new_path(:cookie_test => \"true\")\n\n get :new, :params => { :cookie_test => \"true\" }, :session => { :cookie_test => true }\n ass... | [
{
"docid": "073bc65ea5d74097b2dbea5b027474e8",
"score": "0.72542113",
"text": "def create\n @title = t('admin.users.new.title')\n @user = User.new(params[:user])\n\n if @user.save\n js_notify message: t('admin.users.create.success'), type: 'alert-success', time: 2500\n render partial:... |
54a6eabe16e0d673ee0e91b99e521c61 | DELETE /instrument_contents/1 DELETE /instrument_contents/1.xml | [
{
"docid": "2a0ce8215f90a5a7625d199dc3ef34cf",
"score": "0.7112879",
"text": "def destroy_rest\n @instrument_content = InstrumentContent.find(params[:id])\n @instrument_content.destroy\n\n respond_to do |format|\n format.html { redirect_to(instrument_contents_url) }\n format.xml { he... | [
{
"docid": "4a5fc57096d22157105707144167bcfb",
"score": "0.66446805",
"text": "def destroy_rest\n @instrument = Instrument.find(params[:id])\n @instrument.destroy\n\n respond_to do |format|\n format.html { redirect_to(instruments_url) }\n format.xml { head :ok }\n end\n end",
... |
f28bfbeaa5c731282ae489644165b117 | Return an array of all tracker URLS in the magnet link. | [
{
"docid": "04f36446e3d9ac3a302cae7d84d58852",
"score": "0.0",
"text": "def trackers\n tr = @params['tr']\n if tr\n tr\n else\n []\n end\n end",
"title": ""
}
] | [
{
"docid": "427894d4910157128b0112d55d75a75d",
"score": "0.65386015",
"text": "def links\n links = []\n result = self.perform\n links = result.ft_links\n end",
"title": ""
},
{
"docid": "3507ebe13ee391e5ee8d1e5c48d243d8",
"score": "0.64034605",
"text": "def links\n\... |
7c0bb8448066d03f3cbf948836a3334e | Returns true if the user is logged in, false otherwise. | [
{
"docid": "be70d9e2f2572b85d49bb87417a80770",
"score": "0.0",
"text": "def logged_in?\n !current_user.nil?\n end",
"title": ""
}
] | [
{
"docid": "31fb4132def094f5ed9925db932d58eb",
"score": "0.8996273",
"text": "def user_is_logged_in\n if session[:current_user] != nil\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "5e8797ab67adadcb571fb446716121fe",
"score": "0.89009136"... |
3a13f18f64938dd6ba236a1b55e65654 | passed the index of the subject returns a humanreadable version from the index | [
{
"docid": "7cb7c9714ed4357a9f55fc2f1df87ad4",
"score": "0.7309882",
"text": "def subject_title_by_index(index)\n\t\tcase index\n\t\t\twhen 0\n\t\t\t\treturn \"Math\"\n\t\t\twhen 1\n\t\t\t\treturn \"Science\"\n\t\t\twhen 2\n\t\t\t\treturn \"Social Studies\"\n\t\t\twhen 3\n\t\t\t\treturn \"English / Lang... | [
{
"docid": "b9ddeb518c0d18e582eae78eb5c9f8e0",
"score": "0.7384334",
"text": "def subject_string_by_index(index)\n\t\tcase index\n\t\t\twhen 0\n\t\t\t\treturn \"ma\"\n\t\t\twhen 1\n\t\t\t\treturn \"sc\"\n\t\t\twhen 2\n\t\t\t\treturn \"ss\"\n\t\t\twhen 3\n\t\t\t\treturn \"la\"\n\t\t\twhen 4\n\t\t\t\tretu... |
593bf8cf3a9eb04dd4b5afb50a4c72df | this is just to enable use of `text` from the TextHelpers::Translation module | [
{
"docid": "3e5b18b4b7fe7864fa6af92df11b933a",
"score": "0.0",
"text": "def translation_scope\n \"order_details.notices\"\n end",
"title": ""
}
] | [
{
"docid": "1f29f45d2b468f44cc073b57378ac8b4",
"score": "0.78279066",
"text": "def translate_text(text)\n I18n.t(\"backend.texts.#{text.to_s.downcase.gsub(/\\s/, \"_\")}\", :default => text.to_s.humanize)\n end",
"title": ""
},
{
"docid": "f5d0537a87c35ff4affb3a0dd5661a0a",
... |
7e5162211773e51666f7baedccfe3a4a | The spotify id is | V this part V | | [
{
"docid": "41f573074e621988046214f556407cf9",
"score": "0.0",
"text": "def get_playlist_tracks(spotify_id, limit=100)\n\n # Queries the Spotify API\n response = query(\"playlists/#{spotify_id}/tracks\", {limit: limit})\n # Stores the next page url\n next_page = response[\"next\"]\n ... | [
{
"docid": "93d3a42832be914c3c40b50ad0fe6260",
"score": "0.690163",
"text": "def to_param\n spotify_id\n end",
"title": ""
},
{
"docid": "6a93d4ef7a56798b058662d568ea09ae",
"score": "0.6714834",
"text": "def vodspot_video_id\n 99\n end",
"title": ""
},
{
"docid": ... |
ff4f07287024cb65270d6a003da28e7d | All model classes that have corresponding tables (i.e., STI subclasses are not included). | [
{
"docid": "eb173766d67c6d709a8c7d84cd7b0b90",
"score": "0.63689274",
"text": "def model_classes\n require 'wink/models'\n @model_classes ||= [ Entry, Comment, Tag, Tagging ].freeze\n end",
"title": ""
}
] | [
{
"docid": "f9ad9600bc853ac4d34e889ead3e47d7",
"score": "0.81023675",
"text": "def table_model_classes\n load_rails_models\n ActiveRecord::Base.send(:subclasses).where.descends_from_active_record?.reject {|c| c.name.starts_with?(\"CGI::\") }\n end",
"title": ""
},
{
"docid": "80... |
3cd3bcadd908a222d0aa5e0eae3c2cce | Update a &39;capability.SiocModuleCapabilityDef&39; resource. | [
{
"docid": "ab765395bd9ce087cf99b248be70fe2e",
"score": "0.66771924",
"text": "def update_capability_sioc_module_capability_def_with_http_info(moid, capability_sioc_module_capability_def, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityA... | [
{
"docid": "3eddd53d35c77d7eebd90ab8f7368557",
"score": "0.7147115",
"text": "def update_capability_sioc_module_capability_def(moid, capability_sioc_module_capability_def, opts = {})\n data, _status_code, _headers = update_capability_sioc_module_capability_def_with_http_info(moid, capability_sioc_m... |
1c84390d2a400055ab70977217256997 | PATCH/PUT /people/1 PATCH/PUT /people/1.json | [
{
"docid": "8d33c25986024a41b486608aacf105f2",
"score": "0.6414966",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to root_path, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, locati... | [
{
"docid": "fe34f93da0751ad55cc5052cfdd2366c",
"score": "0.7237428",
"text": "def update\n render json: Person.update(params[\"id\"], params[\"person\"])\n end",
"title": ""
},
{
"docid": "6ae6b17460ba8c07daf1a237b1b63696",
"score": "0.69481254",
"text": "def update\n \n ... |
ac37b81c995d2f22f4f1efae1f6bd8f0 | Attempts to open a file as a Puppet::Util::FileType, parse it into an XML document object using REXML, and cache both the results. If the file does not exist, it will be created. | [
{
"docid": "b99d9e4f6fb96538ca4f488069819e0c",
"score": "0.5427636",
"text": "def fetch_document(document)\n if !fetched_document? document then\n file = Puppet::Util::FileType.filetype(:flat).new(document)\n\n begin\n xml_doc = REXML::Document.new file.read\n rescue P... | [
{
"docid": "dbe5f14444470a9030a8feb9fa971ff6",
"score": "0.66002214",
"text": "def parse_file\n tempfile = gpx.queued_for_write[:original]\n doc = Nokogiri::XML(tempfile)\n parse_xml(doc)\n end",
"title": ""
},
{
"docid": "6610dbb7b3e57942d0df4a8d2ccd06e1",
"score": "0.64329743... |
0f92a72700c6fbe9babaf3ecd917fb0a | If string is specified, then it will be passed to the window manager for use as the title for window (the window manager should display this string in window's title bar). In this case the command returns an empty string. If string is not specified then the command returns the current title for the window. The title fo... | [
{
"docid": "7fe6148b60bc45798ab3a340d5eea37b",
"score": "0.77408755",
"text": "def title(window, string = None)\n if string == None\n Tk.execute(:wm, :title, window)\n else\n Tk.execute_only(:wm, :title, window, string)\n end\n end",
"title": ""
}
] | [
{
"docid": "99e4c5a4360acf8da7d2b3e66718b833",
"score": "0.6351212",
"text": "def title\n string_command \"getTitle\"\n end",
"title": ""
},
{
"docid": "f148d649018e286a12636bdc2fd796ca",
"score": "0.631201",
"text": "def title\n Functions.window_title(hwnd)\n ... |
5434baa22bd8f899aee7ba5d01833762 | TODO gets a map of skill>[talents] for a given nature | [
{
"docid": "9660df893725a5b9d55e28dc149bb59b",
"score": "0.68137383",
"text": "def get_talents\n\n # skills = [ self.skill_mandatory1, self.skill_mandatory2, self.skill_mandatory3,\n # self.skill_elective1, self.skill_elective2, self.skill_elective3 ]\n\n talents = {}\n\n # ... | [
{
"docid": "a04ed6356bb8f908962c74703731c9b3",
"score": "0.6245736",
"text": "def nature\n return GameData::Natures[@nature]\n end",
"title": ""
},
{
"docid": "ebab72088ce7ff04accf24b46d49b1ae",
"score": "0.61101407",
"text": "def categorized_specific_skill\n return \"#{sk... |
e627abc05d6339ae85206b6dc9ab5a69 | GET /administration/projects/new GET /administration/projects/new.json | [
{
"docid": "f629671e57b974632f128852300585df",
"score": "0.7904584",
"text": "def new\n @project = Project.new\n @services = Service.find(:all)\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end",
"title": ""
}
] | [
{
"docid": "5e2dd02c7ad5833a1133dd8c78a7438c",
"score": "0.82298756",
"text": "def new\n @project = current_user.projects.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end",
"title": ""
},
{
"docid": "eb8756e37... |
ef23a74913c450f401890519cfd33a70 | Serialize the column to either marshal or yaml format | [
{
"docid": "dac168f26d9b5d44dea87db159d5220d",
"score": "0.75357765",
"text": "def serialize_value(column, v)\n return v if v.nil?\n case model.serialization_map[column] \n when :marshal\n [Marshal.dump(v)].pack('m')\n when :yaml\n v.to_yaml\n ... | [
{
"docid": "44054992bade0e2d5c5c74bacdcff0e6",
"score": "0.73319453",
"text": "def serialize_column(data)\n activerecord_json_column? ? data : super\n end",
"title": ""
},
{
"docid": "5f2715b729897a152149ada65d0604fd",
"score": "0.62950325",
"text": "def serialized_co... |
cec01c7133a2ae6c4d3ff50940443594 | Gets the certificateSerialNumber property value. Certificate serial number. This property is readonly. | [
{
"docid": "7aacc1c0891c9f6438beea2411868a70",
"score": "0.8358974",
"text": "def certificate_serial_number\n return @certificate_serial_number\n end",
"title": ""
}
] | [
{
"docid": "bfe0fa27341330839affc4a5d22c5534",
"score": "0.79510915",
"text": "def serial_number\n @certificate.serial\n end",
"title": ""
},
{
"docid": "bebb3f463fdc317809e76a5471ddc73e",
"score": "0.7288044",
"text": "def certificate_serial_number=(value)\n @... |
e3335451c05f2db3fa8dfb82a3eaa090 | PATCH/PUT /template_ones/1 PATCH/PUT /template_ones/1.json | [
{
"docid": "0be3971d755405bf5d0941a35a29727d",
"score": "0.64733493",
"text": "def update\n respond_to do |format|\n if @template_one.update(template_one_params)\n format.html { redirect_back fallback_location: root_path, notice: 'Template one was successfully updated.' }\n format.... | [
{
"docid": "94288d3b549af3f1cf07710c026bd70e",
"score": "0.70634675",
"text": "def update\n @one_table_template =\n @one_table.\n one_table_templates.\n by_user(current_user).\n find(params[:id])\n\n respond_to do |format|\n if @one_table_template.updat... |
bd3a7dfddc30bc69012064ac1ec450c4 | Given a hash with numeric values, return the key for the smallest value | [
{
"docid": "f4922dfd1dcdac07ea9fe2add209fd6b",
"score": "0.0",
"text": "def key_for_min_value(name_hash)\n min_so_far = nil\n key_so_far = nil\n name_hash.each do |name, value|\n if min_so_far == nil\n min_so_far = value\n key_so_far = name\n elsif min_so_far > value\n min_so_far... | [
{
"docid": "187165074e32a7573ee53a9cabb44ed4",
"score": "0.88810027",
"text": "def key_for_min_value(hash)\n lowest_key=nil \n lowest_value= Float::INFINITY\n hash.each do |name,number|\n if number < lowest_value\n lowest_value=number\n lowest_key= name\n end \n end\n lowest_key\nen... |
043db2e3a73a13cbeaa9db0147f6bfd8 | Send a HTTP Delete ==== Parameters [optional, String] resource path URI [optional, Hash] Query parameters ==== Return JSON decoded object | [
{
"docid": "8d515d00923548a60af84a0d8f816fff",
"score": "0.7684217",
"text": "def delete(resource = \"\", params = {})\n uri = \"#{base_uri}#{resource}\"\n params.empty? or uri = uri.concat('?').concat(params.collect { |k, v| \"#{k}=#{v.to_s}\" }.join(\"&\"))\n request(Net::HTTP::Delete.new(uri... | [
{
"docid": "b530d57fd1601db5fe49d269dfac029f",
"score": "0.8124497",
"text": "def delete_rest_call(path, params = nil)\n uri = URI.parse('#{@base_url}#{path}')\n req_path = uri.path\n if params\n uri.query = URI.encode_www_form(params)\n req_path = '#{uri.path}?#{uri.query}'\n end\... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "f002a583c015b3bf1ecca47e340f1028",
"score": "0.0",
"text": "def set_purchase_record\n @purchase_record = PurchaseRecord.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.6032574",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6015663",
"text": "def... |
d1c7c24abadf6910a10962f7ebf14e4c | Cancel this action if not already effected. | [
{
"docid": "248353691b39c9e52f3de0f8e66eb48b",
"score": "0.740553",
"text": "def cancel!\n raise :not_cancellable unless cancellable?\n\n # Update our status.\n change_status Action::Status::CANCELLED\n end",
"title": ""
}
] | [
{
"docid": "c97c39903fd9724a1a28c59dfdac64f4",
"score": "0.7480088",
"text": "def cancel\n @canceled = true\n end",
"title": ""
},
{
"docid": "8a2c68459949fef42b842592e3477595",
"score": "0.74686986",
"text": "def cancel?\n self.action == :cancel\n end",
"title": ... |
b13112e7013850d0c72a65b2cc007b37 | Configure periodic flushing of the message buffer. Periodic flushing is used to flush the contents of the logging buffer at some regular interval. Periodic flushing is disabled by default. When enabling periodic flushing the flush period should be set using one of the following formats: "HH:MM:SS" or seconds as an nume... | [
{
"docid": "1d129d725218e3604708b3397e2a7fb4",
"score": "0.67798746",
"text": "def flush_period=( period )\n @flush_period =\n case period\n when Integer, Float, nil; period\n when String\n num = _parse_hours_minutes_seconds(period) || _parse_numeric(period)\n ... | [
{
"docid": "4649102a35bbdc59afa0b397fd5d8ec1",
"score": "0.7457275",
"text": "def auto_flushing=(period)\n @auto_flushing[Thread.current] =\n case period\n when true; 1\n when false, nil, 0; MAX_BUFFER_SIZE\n when Integer; period\n else raise ... |
6a0145da49e1b5fd61aac4e50171e6af | Resize an image Resize an image to a specific width and specific height. Resize is EXIFaware. | [
{
"docid": "282004acc0b102adecd4e76850f88ed5",
"score": "0.58472085",
"text": "def resize_resize_simple_with_http_info(width, height, image_file, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ResizeApi.resize_resize_simple ...'\n end\n ... | [
{
"docid": "3d78fcd5850609cf401bd3e891f545e3",
"score": "0.763289",
"text": "def resizeImage(width,height)\n if @image != nil\n @image.resize(width,height)\n @image.applyOn(@imageBox)\n end\n end",
"title": ""
},
{
"docid": "3b6feae482bd4d57f69244bc56bd7c57",
"score": "0... |
37a2235175a75b959bde940ace823f50 | Colorize the given +string+ with the specified +attributes+ and return it, handling lineendings, color reset, etc. | [
{
"docid": "bbed0a1f06f49d50df11effc2fb109a7",
"score": "0.55052876",
"text": "def colorize( *args )\n\tstring = ''\n\t\n\tif block_given?\n\t\tstring = yield\n\telse\n\t\tstring = args.shift\n\tend\n\t\n\tending = string[/(\\s)$/] || ''\n\tstring = string.rstrip\n\n\treturn ansi_code( args.flatten ) + ... | [
{
"docid": "f33fc7bf3948bfabd3dd07537982da4b",
"score": "0.7888094",
"text": "def colorize( string, *attributes )\n\t\tending = string[/(\\s)$/] || ''\n\t\tstring = string.rstrip\n\t\treturn ansi_code( attributes.flatten ) + string + ansi_code( 'reset' ) + ending\n\tend",
"title": ""
},
{
"d... |
f1d9a50815fcd89c711d3e00f40d3ec4 | Output a separator line made up of length of the specified char. | [
{
"docid": "e849c98bb5c2511a5491caa3e35d186a",
"score": "0.72353214",
"text": "def writeLine( length=75, char=\"-\" )\n\t\t$stderr.puts \"\\r\" + (char * length )\n\tend",
"title": ""
}
] | [
{
"docid": "5547e695784090c392077b919a02e019",
"score": "0.7189508",
"text": "def writeLine( length=75, char=\"-\" )\n\t\t\t$stderr.puts \"\\r\" + (char * length )\n\t\tend",
"title": ""
},
{
"docid": "2568ad31600a6dbad14f2a101177297a",
"score": "0.70162815",
"text": "def print_separ... |
02094c86c27cd5d6cd6b098751fa5af1 | An implementation of Curve for 2 months: Behaves as a freshness boost for newer documents with a public_timestamp and search_format_types announcement | [
{
"docid": "94416764d5a5836bee5389c314447934",
"score": "0.5926193",
"text": "def time_boost\n {\n filter: { term: { search_format_types: \"announcement\" } },\n script_score: {\n script: \"((0.05 / ((3.16*pow(10,-11)) * abs(now - doc['public_timestamp'].date.getMillis()) + 0... | [
{
"docid": "84e117fe8362fbaca902c6b0eac12eff",
"score": "0.58975387",
"text": "def time_boost\n {\n filter: { term: { search_format_types: \"announcement\" } },\n script_score: {\n script: {\n lang: \"painless\",\n source: \"((0.05 / ((3.16*Math.pow(10,-... |
ed2283ed0f0bd60038baa4d85c132dff | Author:: Nicolas Couturier Version:: 1 Last Update:: 20130201 11:56:46 UTC Status:: In Progress | [
{
"docid": "5a4efacd027535c515da735c717476b1",
"score": "0.0",
"text": "def delete_po\r\n\r\n FileUtils.rm_rf \"#{Rails.root}/po/#{params[:locale]}\"\r\n redirect_to locales_path\r\n end",
"title": ""
}
] | [
{
"docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1",
"score": "0.67079794",
"text": "def private; end",
"title": ""
},
{
"docid": "13289d4d24c54cff8b70fcaefc85384e",
"score": "0.64126456",
"text": "def verdi; end",
"title": ""
},
{
"docid": "0b8b7b9666e4ed32bfd448198778e4e9",
... |
f333ed31e39b7806484b0c050a4762aa | If the presentation currently being handled is multi_index, this will return true | [
{
"docid": "bbebedabed127d4a68d3646865e63db1",
"score": "0.8180794",
"text": "def use_multi_index?\n @_use_multi_index\n end",
"title": ""
}
] | [
{
"docid": "f835b9a25d57520912a7c6bc89459568",
"score": "0.809892",
"text": "def any_multi_index?\n @_any_multi_index \n end",
"title": ""
},
{
"docid": "3c21c225a92392f4c434ac4b2b277ced",
"score": "0.6935758",
"text": "def has_index?\n replication_field.in? table_indexes\... |
c9189746f9aa61b71ec856e7ca96d698 | Returns an `RDF::Term` representation of `self`. | [
{
"docid": "2f141ac908078af4369c38ba162a054b",
"score": "0.6932306",
"text": "def to_term\n raise NotImplementedError, \"#{self.class}#read_triple\" # override in subclasses\n end",
"title": ""
}
] | [
{
"docid": "8e1d6dc1d7a120b562ae3c917ac86e60",
"score": "0.72375405",
"text": "def to_term\n return @to_term\n end",
"title": ""
},
{
"docid": "fca4307840046dfe04040dc93a49f6e0",
"score": "0.70340556",
"text": "def term\n return @term\n ... |
507d53d4ce9b5ea5b58c5e8b7464318f | I feel like this could be so much simpler... | [
{
"docid": "670c9989c3d3b750a1b07dfa4df8521b",
"score": "0.0",
"text": "def replace_urls(body)\n unless body.blank?\n urls = URI.extract(body, [\"http\", \"https\"])\n unless urls.empty?\n split_body = body.split(\"\\n\")\n split_body.each_with_index do |line, i| # Map didn't ... | [
{
"docid": "b6b2bcc0062aeb115edab7b10cbe6930",
"score": "0.63313246",
"text": "def desired; end",
"title": ""
},
{
"docid": "bc658f9936671408e02baa884ac86390",
"score": "0.5953438",
"text": "def anchored; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",... |
eaa07202d830ddb67a9ee824af094eb7 | DELETE /user_insurances/1 DELETE /user_insurances/1.json | [
{
"docid": "1e9243b9d2de4cc46416488fdf0933ad",
"score": "0.7303419",
"text": "def destroy\n @user_insurance.destroy\n respond_to do |format|\n format.html { redirect_to user_insurances_url, notice: 'User insurance was successfully destroyed.' }\n format.json { head :no_content }\n end... | [
{
"docid": "a7f5d572d6152be9ad044b318fa876fb",
"score": "0.703469",
"text": "def destroy\n @user_interest = UserInterest.find(params[:id])\n @user_interest.destroy\n\n respond_to do |format|\n format.html { redirect_to user_interests_url }\n format.json { head :no_content }\n end\n... |
678f322893a8c0cfcb544bde83a366d9 | Builds a single 152x152 appletouchiconprecomposed from the given source file. | [
{
"docid": "adc14a6528484f3a9b47890b60b86871",
"score": "0.7666016",
"text": "def build_single(source, destination)\n build_size(source, '152x152', \"#{destination}/apple-touch-icon-precomposed.png\")\n end",
"title": ""
}
] | [
{
"docid": "6f9860d467ca17f51bb0c3c0705c14a9",
"score": "0.73157996",
"text": "def build_single(source, destination)\n build_size(source, '180x180', \"#{destination}/apple-touch-icon.png\")\n build_size(source, '180x180', \"#{destination}/apple-touch-icon-precomposed.png\")\n ... |
f4e35b402f88d09bb01b8d7895ef596b | Send serialized buffer. Direct call of the method requires knowledge about internals of FBE models serialization. Use it with care! | [
{
"docid": "692f9b6115a8fe6484336f16f4a926c9",
"score": "0.68599796",
"text": "def send_serialized(serialized)\n if serialized <= 0\n return 0\n end\n\n # Shift the send buffer\n @_buffer.shift(serialized)\n\n # Send the value\n sent = on_send(@_buffer.buffer, 0, @_b... | [
{
"docid": "045da98b38065a8fc7d7c9e0b759106f",
"score": "0.68979794",
"text": "def serialize(buffer = \"\")\n raise NotImplementedError, \"This method is generated after calling #finalize on a message class\"\n end",
"title": ""
},
{
"docid": "68fbb578ec5e70c7030d4c12794ef319",
... |
a9ff437111efbee3d5f0a9fc65568216 | GET /viruses/new GET /viruses/new.json | [
{
"docid": "64ee129f396608056cd1f6f9dce1ed22",
"score": "0.8109096",
"text": "def new\n @virus = Virus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @virus }\n end\n end",
"title": ""
}
] | [
{
"docid": "17d7da60333d97967bcd96628c11fd45",
"score": "0.6973489",
"text": "def new\n json_404\n end",
"title": ""
},
{
"docid": "692978a675e47c377846ac169c4e5639",
"score": "0.6761377",
"text": "def new\n @probe = Probe.new\n\n respond_to do |format|\n format.html #... |
bb96bd9f968f57d78c109602c16009a3 | Whether counter examples must be ran or not. | [
{
"docid": "be7e27b8ac5ec06c0325469573fcd353",
"score": "0.72996557",
"text": "def run_examples?\n @run_examples\n end",
"title": ""
}
] | [
{
"docid": "9d6c0a2ea991e76c8d6534b1f1bf54fe",
"score": "0.8375822",
"text": "def run_counterexamples?\n @run_counterexamples\n end",
"title": ""
},
{
"docid": "f55dc458102ab44889b82a3af678d499",
"score": "0.8029394",
"text": "def run_generated_counterexamples?\n @run_ge... |
99b5d62cb88ffad278eab85ccf3147e8 | pragma mark View Controller | [
{
"docid": "80e5948688900d09f82e385c86cf4462",
"score": "0.0",
"text": "def viewDidLoad\n super\n\n self.title = 'PickerTitle'.localized\n\n self.view.backgroundColor = UIColor.lightGrayColor\n \n @toolbar = UIToolbar.alloc.init\n frame = self.view.frame\n frame.size.height = 44.0\n... | [
{
"docid": "b69a071a6dd10a8c7c69fbbc5721b533",
"score": "0.64671",
"text": "def controller\n end",
"title": ""
},
{
"docid": "b69a071a6dd10a8c7c69fbbc5721b533",
"score": "0.64671",
"text": "def controller\n end",
"title": ""
},
{
"docid": "40f7f9a8053cda5781e8cf... |
8d10a5d2eddf94f61b137938503d048d | GET /changes GET /changes.json | [
{
"docid": "8b002e71c931f5939b43f284c849d1c9",
"score": "0.0",
"text": "def index\n # @changes = Change.all\n @changes = Change.order(sort_column + ' ' + sort_direction).paginate(:per_page => 10, :page => params[:page]) \n end",
"title": ""
}
] | [
{
"docid": "540e98c8825a532e9c676d37decd7e1c",
"score": "0.7278796",
"text": "def changes(params = {}, payload = {}, &block)\n view(\"_changes\", params, payload, &block)\n end",
"title": ""
},
{
"docid": "42d95e14a07399062870f79cf1ea8d79",
"score": "0.72091997",
"text": "def... |
59b6f5cfa55856ab4dd38b5edcde8ce0 | Define a method sum_to_n?(array, n) that takes an array of integers and an additional integer, n, as arguments and returns true if any two elements in the array of integers sum to n. sum_to_n?([], n) should return false for any value of n, by definition. | [
{
"docid": "3c55a1cb7cf2b07b42d9bca1ce554935",
"score": "0.82658315",
"text": "def sum_to_n?(array, n)\n return false if array.empty?\n match = array.combination(2).detect do |a, b|\n a + b == n\n end\n !match.nil?\nend",
"title": ""
}
] | [
{
"docid": "f519901354c6b7a5cab1e00d539e02d1",
"score": "0.868005",
"text": "def sum_to_n? (array, n)\n\treturn false if array.empty? or array.size == 1\n\treturn array.combination(2).any? {|a,b| a + b == n}\nend",
"title": ""
},
{
"docid": "241941fe2712141dca7eb1b9dc7a9bea",
"score": "0... |
20b7a3bcf92b4bf7558016aa45ab1eec | PUT /sms/1 PUT /sms/1.json | [
{
"docid": "86916a47f3247309234b675c9ec582a1",
"score": "0.7446895",
"text": "def update\n @sms = Sms.find(params[:id])\n\n respond_to do |format|\n if @sms.update_attributes(params[:sms])\n format.html { redirect_to @sms, notice: 'Sms was successfully updated.' }\n format.json ... | [
{
"docid": "78477580f857e49aa8d546bc1955e53b",
"score": "0.7031381",
"text": "def update\n @sms = Sm.find(params[:id])\n\n respond_to do |format|\n if @sms.update_attributes(params[:sm])\n format.html { redirect_to @sms, notice: 'Sm was successfully updated.' }\n format.json { h... |
cd23d60745bed76d1e73fb9a8f9fa76c | detail sur les partenaires | [
{
"docid": "a66af04ee3c25582702179aef21b4bdd",
"score": "0.0",
"text": "def partner_detail\n if params[:jeton] == 'grvpc'\n @query = Grvpc.find_by(id: params[:id])\n elsif params[:jeton] == 'metropolis'\n @query = Metropoli.find_by(id: params[:id])\n elsif params[:jeton] == 'member'\n... | [
{
"docid": "523dc66328cadda48cafa104b54a7ad0",
"score": "0.67483294",
"text": "def show\n #@parts = Part.find_by(id: @technique.part_id)\n @parts = Part.find(@technique.part_id)\n end",
"title": ""
},
{
"docid": "222a1fd18023c96c36ff98a90a514586",
"score": "0.6653642",
"text":... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "fef1d457d292486e572a26e0ce0d3053",
"score": "0.0",
"text": "def set_purchase_order\n @purchase_order = PurchaseOrder.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... |
3e14da729a8c0fe3c6ffe2c38eaa5dcc | Returns tag name of the element. | [
{
"docid": "65280566ea260b6b1b2c06f6e4d05934",
"score": "0.8388872",
"text": "def tag_name\r\n assert_exists\r\n @element.node_name.downcase\r\n end",
"title": ""
}
] | [
{
"docid": "afa7a51d5eaf65e071841eea5240c022",
"score": "0.90476555",
"text": "def tag_name\n @element.tag_name\n end",
"title": ""
},
{
"docid": "8c44b4b0e9d2147e4ae42aa08e0aa404",
"score": "0.8626305",
"text": "def tag_name\n bridge.element_tag_name @id\n ... |
7c0b89febf86a6139b1bdec02581481d | Returns a hash with only the nonnil elements present | [
{
"docid": "1fa43ea8f5cc7f9c14572ab9b7df8062",
"score": "0.0",
"text": "def to_hash\n result = {}\n [[:tn, :tn], [:epg, :epg], [:cnam, :cnam], [:refId, :ref_id]].each do |garbage, pretty|\n # Make sure that this thing ain't nil\n if self.send(pretty)\n result[g... | [
{
"docid": "4b6eee20172652d6fe94f5c7226f4f93",
"score": "0.7007486",
"text": "def convert_nils_to_empty_hashes(hash); end",
"title": ""
},
{
"docid": "df4d146a330de138d5091f406e7c2705",
"score": "0.69300073",
"text": "def compact\n reject{|key,val| val.nil? }\n end",
"title":... |
5f00183326bb1922e67f25547683a2c9 | _EllipseElement CreateEllipseElement1 _Element arg0 Template [IN] Point3d arg1 PerimeterPoint1 [IN/OUT] Point3d arg2 PerimeterPoint2 [IN/OUT] Point3d arg3 PerimeterPoint3 [IN/OUT] MsdFillMode arg4 FillMode [IN] ( = 1) | [
{
"docid": "9dd8716495d6a29adcbfa1e66ab5b7f5",
"score": "0.78608084",
"text": "def CreateEllipseElement1(arg0, arg1, arg2, arg3, arg4 = nil)\n ret = _invoke(1610743979, [arg0, arg1, arg2, arg3, arg4], [VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH, VT_... | [
{
"docid": "c202d565a6e90fea30d2522ed9ddf5dd",
"score": "0.7793515",
"text": "def CreateEllipseElement2(arg0, arg1, arg2, arg3, arg4, arg5 = nil)\n ret = _invoke(1610743980, [arg0, arg1, arg2, arg3, arg4, arg5], [VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH, VT_R8, VT_R8, VT_BYREF | VT_DISPATCH, VT... |
9eaf8f7057dab650ced8db8805911275 | You are going to be given an array of integers. Your job is to take that array and find an index N where the sum of the integers to the left of N is equal to the sum of the integers to the right of N. If there is no index that would make this happen, return 1. | [
{
"docid": "0136c4ce70ac4a759a177a9899e70c33",
"score": "0.77823246",
"text": "def find_even_index(arr)\n left_sum = 0\n right_sum = arr.sum\n arr.each_with_index do |e, ind|\n right_sum -= e\n\n return ind if left_sum == right_sum\n\n left_sum += e\n end\n\n -1\nend",
"title": ""
}
... | [
{
"docid": "bad8c0f418df218dfb5433929c7edf28",
"score": "0.79963744",
"text": "def solution(a)\n left = 0\n right = a.sum\n a.each_with_index do |element, index|\n right -= element\n return index if left == right\n left += element\n end\n -1\nend",
"title": ""
},
{
"docid": "ec... |
ac7c8677f9874bb43e21369665478500 | Get the textual contents of the document. returns: depends on type of document text: text as a string link: url as a string embedded_youtube: url for (embedded) youtube video as a string | [
{
"docid": "78775e465d8af4c32d33d71857a15d54",
"score": "0.7224006",
"text": "def get_document_text\n self.game.document_content\n end",
"title": ""
}
] | [
{
"docid": "03eecb385e476e9c75e50acb68fbfe06",
"score": "0.6966496",
"text": "def text page\n (get_wikitext page).body\n end",
"title": ""
},
{
"docid": "b3505163beacf650ef37fc716b585ea2",
"score": "0.67695874",
"text": "def document_content\n self.document.content\n end",
... |
91faeb25f07e0ae0deff450a4ff4f8ec | Sort tours, applying any extra relational algebra | [
{
"docid": "4aa38032bfce2ff0e549d9b9102783c8",
"score": "0.7093252",
"text": "def sort_tours(params, alg)\n @filters = Tour::FILTERS\n if params[:sort] && @filters.collect{|f| f[:scope]}.include?(params[:sort])\n @tours = Tour.unscoped{ Tour.where(alg).send(params[:sort]) }\n else\n @... | [
{
"docid": "df8ebbc1c591323cd85c50328186462e",
"score": "0.64964026",
"text": "def sort_array",
"title": ""
},
{
"docid": "2363161df98d01a39ea8d448d0d94311",
"score": "0.64837384",
"text": "def sort!\n # define sorting heuristics in a subclass\n end",
"title": ""
},
{... |
f2dfd8842c04ee973394cbf5077a1db7 | Tell if the tree is ready to battle | [
{
"docid": "3e5d7c282f65e6b77f1a7054a2abcb86",
"score": "0.0",
"text": "def can_battle?(id)\n has_pokemon?(id) && (Graphics.current_time - get(id)[:slather_time]) > WAIT_TO_BATTLE\n end",
"title": ""
}
] | [
{
"docid": "897c8ffca6f0e3e37736f37215889e71",
"score": "0.6678347",
"text": "def ready?\n state == RUNNABLE_STATE\n end",
"title": ""
},
{
"docid": "1678a67d131091f7bb573f42fdd299f9",
"score": "0.6674196",
"text": "def ready?\n self.state == :ready\n ... |
09a1606cf58aaaf253886732ac9b497e | Textilemarkedup name with id to make it unique, never nil. | [
{
"docid": "634815f89f09088064133705df65d2ae",
"score": "0.643186",
"text": "def unique_format_name\n string_with_id(name.observation_name)\n rescue StandardError\n \"\"\n end",
"title": ""
}
] | [
{
"docid": "31a78abcaabbe3c5f0b1d63b15ec4fc1",
"score": "0.74921477",
"text": "def unique_text_name\n real_text_name + \" (#{id || \"?\"})\"\n end",
"title": ""
},
{
"docid": "342589b97c635f8fc68965970972d04d",
"score": "0.7418108",
"text": "def unique_text_name\n text_name + ... |
5aeffec002430480d2476beaaa1037f6 | GET /resource/sign_in def new super end POST /resource/sign_in def create super end DELETE /resource/sign_out def destroy super end protected If you have extra params to permit, append them to the sanitizer. def configure_sign_in_params devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute]) end | [
{
"docid": "c614f6f9420d402ac8330b33f725579d",
"score": "0.0",
"text": "def after_sign_in_path_for(_resource)\n user_path(current_user.id)\n end",
"title": ""
}
] | [
{
"docid": "953e5adea2be5a7d43a6eedaf8651bfb",
"score": "0.807105",
"text": "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end",
"title": ""
},
{
"docid": "2be6e5bcf0ca580f98780259f32ed454",
"score": "0.8060394",
"text": "def c... |
d02d0fc8639d1a6a32bb61dee4b28cbf | Nokogiri document for this movie | [
{
"docid": "7a94d63dd54a9ceac91903188936ff95",
"score": "0.62127316",
"text": "def doc\n @doc ||= Nokogiri::HTML(open(@url))\n rescue OpenURI::HTTPError => e\n if e.io.status.first == '404'\n raise MovieNotFound.new(@url)\n end\n raise\n end",
"title": ""
}
] | [
{
"docid": "30168c2fcb409b9926fd7a3c7b3c94e4",
"score": "0.82110506",
"text": "def doc\n @doc = Nokogiri::HTML(open(self.movie_info))\n end",
"title": ""
},
{
"docid": "28541a892429c4570a73672baf399f4f",
"score": "0.7655581",
"text": "def document\n @document ||= Nokogiri::H... |
13710afec025a3fe77bb57eaa50601f9 | p pascals_triangle(5) p pascals_triangle(7) | [
{
"docid": "7158c360a44f3c7f87b3d859d5a70d27",
"score": "0.0",
"text": "def prime?(num) \n return false if num < 2\n (2...num).none? { |factor| num % factor == 0}\nend",
"title": ""
}
] | [
{
"docid": "50198c6bea47063fe3d247928b9963a8",
"score": "0.7543202",
"text": "def pascals_triangle(num)\r\n triangle = [[1]]\r\n\r\n\r\n\r\nend",
"title": ""
},
{
"docid": "5215d2a4d8bca7ac58acf1b1872b6258",
"score": "0.7517126",
"text": "def pascals_triangle(num)\n triangle = [[... |
35336ceaa093a54f865e6b65c0a585e0 | Call this method in your view helper to specify a property you want added to the javascript declaration. This methos take the same options as var. Note that normally the type of value returned here will be marshalled into the proper type for JavaScript. If you provide a block to compute the property, however, the value... | [
{
"docid": "c36114dfd510788d48bfb2b90f2d59b7",
"score": "0.5527245",
"text": "def property(option_key, default_value=:__UNDEFINED__, opts={}, &block)\n ret = _pair(option_key, default_value, opts, &block)\n key = ret[0].camelize(:lower)\n\n unless ret[2] # ignore\n value = ... | [
{
"docid": "925041020f7625e0952979717859c230",
"score": "0.6462108",
"text": "def content_as_js_var(varname,value=nil,&block)\r\n return \"<script>#{varname}='#{escape_javascript(value)}';</script>\" unless block_given?\r\n concat(\"<script>#{varname}='#{escape_javascript(capture(&block))}';</scri... |
39cf011f23aede1102fedba1ffeb72dd | Test Q14 d) > a c | [
{
"docid": "1a475f65acea9c959ecf6f8c392305b4",
"score": "0.5410462",
"text": "def test_q14_d_ac\n test_agreement = create_test_agreement\n params = HashWithIndifferentAccess.new\n params[:q14] = 'd'\n params[:q14_d_a] = \"true\"\n params[:q14_d_c] = \"true\"\n\n form_processor = Manusc... | [
{
"docid": "453fff157ce8b88abee60d5ce7e9ba2e",
"score": "0.66211194",
"text": "def test_qm(tree)\n print \"Quine Mc Cluskey algorithm on expression=[#{tree}]...\\n\"\n simple = tree.simplify()\n print \"result: [#{tree}]\\n\"\n cover = tree.to_cover\n check0 = (cover +... |
0d9a06ad6a27e9a613a4c3c92598be9d | GET /statics GET /statics.json | [
{
"docid": "9dda3085f7c27c2795ca30f09682b0d7",
"score": "0.0",
"text": "def index\n \tif user_signed_in? \n \t\t@user = current_user\n \t\t@application_cases = current_user.application_cases.active_status('Active')\n \tend\n end",
"title": ""
}
] | [
{
"docid": "d7a8069bd49fef40719ddf6888de8273",
"score": "0.7952599",
"text": "def index\n @statics = Static.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @statics }\n end\n end",
"title": ""
},
{
"docid": "3c83499333465b90cb9bf... |
e561e11bcf379ef5dc139c210017366b | Only allow a list of trusted parameters through. | [
{
"docid": "63c7079f900a9f0302391f69e679d636",
"score": "0.0",
"text": "def purchase_params\n params.require(:purchase).permit(:user_id, :product_id, :status)\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... |
702b041ccc8ed52f976777636d7c2bc7 | GET /tiny_resources/new GET /tiny_resources/new.xml | [
{
"docid": "38683dfd9fe51995c0ecd8cc0c712ac3",
"score": "0.78231126",
"text": "def new\n @tiny_resource = TinyResource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tiny_resource }\n end\n end",
"title": ""
}
] | [
{
"docid": "99c4a03dd2409938ed8f27a1c90d636b",
"score": "0.72280717",
"text": "def new\n @resource = Resource.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\n end",
"title": ""
},
{
"docid": "0186de454da1bb... |
ea7d8806cf1990ead3c8821e04f39a83 | GET /messages/new GET /messages/new.xml | [
{
"docid": "60eb997ca1ce85cd6b4b8a182004ad6b",
"score": "0.0",
"text": "def new\n @message = Message.new\n if params[:id]\n @user = User.find params[:id]\n if not @user\n flash[:error] = 'Cannot find that user'\n return redirect_to :back\n end\n end\n @message.re... | [
{
"docid": "b19e336db15694ce0e9f6fd7a27251b3",
"score": "0.7768176",
"text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @message }\n end\n end",
"title": ""
},
{
"docid": "b19e336db15694ce0e9f6f... |
ffb7063eef54c93c05877fa1339f664d | Sends a SysEx msg. :arg sysex_cmd: A sysex command byteggg :arg data: A list of data values | [
{
"docid": "9441664c5d582eb6b2f0339c30525414",
"score": "0.87350965",
"text": "def send_sysex(sysex_cmd, data=[])\n write_command Rufirmata::START_SYSEX\n write_command sysex_cmd\n data.each do |b|\n begin\n byte = b.chr\n rescue\n byte = (b >> 7).chr\n ... | [
{
"docid": "c022694169f61a3c968f31b1b5d82ec5",
"score": "0.7430032",
"text": "def handle_sysex(msg)\n\t@raw_data = msg.dup()\n\tsysex(msg)\n end",
"title": ""
},
{
"docid": "1cf26cc8f31117196a1c96dd4d208085",
"score": "0.7400858",
"text": "def sysex_message(data, options = {})\n... |
e8330ab9bc419665cefe6616b0829a93 | Confirms a loggedin agent. | [
{
"docid": "496b30e5d7ae221a92b53b4be696705c",
"score": "0.63059026",
"text": "def logged_in_agent\n unless logged_in?\n store_location\n flash[:danger] = \"Por favor Inicie Sesión.\"\n redirect_to agents_login_url\n end\n end",
"title": ""
}
] | [
{
"docid": "d46b189987cc1d9abfd196bae5e3b70f",
"score": "0.5688818",
"text": "def authorize_agent\r\n unless session[:user_id] and\r\n User.find(session[:user_id]).level >= 1\r\n session[:original_uri] = request.request_uri\r\n flash[:notice] = Resource.get(\"agent_not_authorized_... |
639098c70477c7f7aaa0fdd8f6696eb7 | FIXME : centralize http access (to make it easier to support proxy) | [
{
"docid": "cf9b3dee4a8ee677b8e6f949e5f321a1",
"score": "0.0",
"text": "def fetch_attr\n return if @attr_loaded\n response = nil\n Net::HTTP.start(\"www.amazon.co.jp\") do |http|\n response = http.get(\"/gp/aw/d.html?a=#{@asin}\")\n end\n page = Nokogiri::HTML.parse(response.body, ni... | [
{
"docid": "1d313b5278e4ace5284ab82f00a1001f",
"score": "0.772293",
"text": "def http; end",
"title": ""
},
{
"docid": "add75b142126165a65c6bceadddc57fa",
"score": "0.767842",
"text": "def http_proxy; end",
"title": ""
},
{
"docid": "1e851104aec28c1d2e16fc40f91ee52b",
... |
9a4a2ff44d30e2005372fb0df2c1e507 | The connection contains the transport. | [
{
"docid": "4b4495930a2dac03c9269afcd0370e8a",
"score": "0.0",
"text": "def initialize(transport)\n @transport = transport\n @error = nil\n end",
"title": ""
}
] | [
{
"docid": "d1c5ff86d84c719b970cd9d62447de21",
"score": "0.82758904",
"text": "def connection\n @connection ||= @transport.connection\n end",
"title": ""
},
{
"docid": "be1fc1edf72568299a018614442cae92",
"score": "0.8134655",
"text": "def transport\n self.connection.transpor... |
b6ad3d00ab18a50cf64bf3c44d78bd27 | POST /users POST /users.json | [
{
"docid": "062bd74faf5e2edd0b9442bfe58dc9c5",
"score": "0.0",
"text": "def create\n @user = User.new(user_params)\n @user.image.attach(params[:user][:image])\n @user.image = \"default.png\"\n respond_to do |format|\n if @user.save\n format.html { redirect_to @user, notice: 'User... | [
{
"docid": "24c5e44d772da89269600975eeebdfda",
"score": "0.71918935",
"text": "def create\n @user = User.new(user_params)\n @user.save\n json_response(@user, :created)\n end",
"title": ""
},
{
"docid": "6e1490da4a56756e02c8de2a503a156e",
"score": "0.7185745",
"text": "def c... |
4a6b7d6af23fb509ede9772ecdaa97bb | After update we want to return to the index page but show reservations for the date of the glider schedule we updated. Modify schedules_url to include arugemnt for the specific day to be used for the index action above | [
{
"docid": "9b3eaee44d18bb7e95cb3ca0f5dbd51c",
"score": "0.62640584",
"text": "def schedule_url_for(schedule)\n #{}\"#{schedules_url}?utf8=✓&q=#{schedule.day.to_s}\"\n \"#{schedules_url}?q=#{schedule.day.to_s}\"\n end",
"title": ""
}
] | [
{
"docid": "312644c092767bb62a44360453b8bb48",
"score": "0.63982266",
"text": "def index\n\tredirect_to new_availability_calendar_path\n end",
"title": ""
},
{
"docid": "f70bb17be3b64e948c1644a215e56cfd",
"score": "0.63014793",
"text": "def update\n respond_to do |format|\n ... |
e7c55332f92b148ba9707f877b1ec278 | POST /purchases POST /purchases.json | [
{
"docid": "6b3cc47ee108864d30a8614133e30c19",
"score": "0.0",
"text": "def create\n @feature_request = FeatureRequest.new(feature_request_params)\n\n respond_to do |format|\n if @feature_request.save\n format.html { redirect_to 'help', notice: 'Feature request was successfully created... | [
{
"docid": "1a2357bc0ae5e6c36628154794808afd",
"score": "0.7179486",
"text": "def create\n @purchase = @current_user.purchases.new(purchase_params)\n\n if @purchase.save\n render :show\n else\n render json: @purchase.errors, status: :unprocessable_entity\n end\n end",
"title":... |
0e0df32124b9f4734b93ebd009f47cc0 | DELETE /posts/1 DELETE /posts/1.json | [
{
"docid": "e5201d57ecb7640097044f97fadc907d",
"score": "0.0",
"text": "def destroy\n @post.update(status: \"hidden\")\n respond_to do |format|\n format.html { redirect_to posts_url, notice: 'Post ha sido borrado.' }\n format.json { head :no_content }\n end\n end",
"title": ""
... | [
{
"docid": "d2938d0d96fc4adb30b185ea6e647cdf",
"score": "0.80469173",
"text": "def delete\n render json: Post.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "f027d5be71066122f716d1cbeb3b697e",
"score": "0.7690333",
"text": "def destroy\n @post.destroy\n respond_to... |
c028110316f20375090ad18d1759db75 | =begin Examples p no_dupes?([1, 1, 2, 1, 3, 2, 4]) => [3, 4] p no_dupes?(['x', 'x', 'y', 'z', 'z']) => ['y'] p no_dupes?([true, true, true]) => [] =end | [
{
"docid": "f5d5bc81dfc2dc27519a0f1420a106c2",
"score": "0.0",
"text": "def no_consecutive_repeats?(array)\n (0...array.length-1).each {|index| return false if array[index] === array[index+1]}\n true\nend",
"title": ""
}
] | [
{
"docid": "5afb38aaed80ff5e96dc10c787ccc2e6",
"score": "0.8317104",
"text": "def no_dupes?(arr)\n uniques = []\n \n arr.each { |el| uniques << el if !uniques.include?(el) && arr.count(el) == 1 }\n\n return uniques\nend",
"title": ""
},
{
"docid": "a7ea71aad9608720bc77cf9874531c4... |
09132ed880ab39b8fad62ca12fbaa27c | PATCH/PUT /flashlight_galleries/1 PATCH/PUT /flashlight_galleries/1.json | [
{
"docid": "a0a8b253775c473e159699468671b607",
"score": "0.7577383",
"text": "def update\n respond_to do |format|\n if @flashlight_gallery.update(flashlight_gallery_params)\n format.html { redirect_to @flashlight_gallery, notice: 'Flashlight gallery was successfully updated.' }\n f... | [
{
"docid": "df1d1868d4d91593f1c23aa4990225f0",
"score": "0.72058266",
"text": "def update\n @gallery = Gallery.find(params[:id])\n\n if @gallery.update(gallery_params)\n head :no_content\n else\n render json: @gallery.errors, status: :unprocessable_entity\n end\n end",
"title"... |
14dcbf23b12bf0327d00167298b366f0 | Convenience method for types which do not need separate type casting behavior for user and database inputs. Called by Valuecast for values except +nil+. | [
{
"docid": "c208d4183050264474646300f82a9fca",
"score": "0.6522019",
"text": "def cast_value(value) # :doc:\n value\n end",
"title": ""
}
] | [
{
"docid": "d749569c088721d2adc0df6707b7d196",
"score": "0.78331035",
"text": "def value_before_type_cast; end",
"title": ""
},
{
"docid": "d749569c088721d2adc0df6707b7d196",
"score": "0.78331035",
"text": "def value_before_type_cast; end",
"title": ""
},
{
"docid": "d749... |
41d236f9b802c093a988d57b6b92c2ea | Returns the directory where original is stored. | [
{
"docid": "bfff2f05cb4e03f85b05babde404920e",
"score": "0.8595898",
"text": "def original_dir\n File.dirname original\n end",
"title": ""
}
] | [
{
"docid": "4cbd050185bca84aec6520e8efbdfc39",
"score": "0.8183909",
"text": "def original_dir\n application.original_dir\n end",
"title": ""
},
{
"docid": "4cbd050185bca84aec6520e8efbdfc39",
"score": "0.8183909",
"text": "def original_dir\n application.original_dir\n ... |
a2099a77c85e91272ae2f9e35b937953 | Only allow a trusted parameter "white list" through. | [
{
"docid": "8c3a792281298db57e00d42c12b1a248",
"score": "0.0",
"text": "def comment_params\n params.require(:comment).permit(:post_id, :body, :user_id)\n end",
"title": ""
}
] | [
{
"docid": "c1f317213d917a1e3cfa584197f82e6c",
"score": "0.7121987",
"text": "def allowed_params\n ALLOWED_PARAMS\n end",
"title": ""
},
{
"docid": "b32229655ba2c32ebe754084ef912a1a",
"score": "0.70541996",
"text": "def expected_permitted_parameter_names; end",
"title": "... |
938ac857b4534ff055738d77426b7998 | TODO move this elsewhere | [
{
"docid": "32888eaefa667f550271b6de711b600c",
"score": "0.0",
"text": "def get_price_intersections history\n close_prices = history[\"historicals\"].map{|h| h[\"close_price\"].to_f}\n period_one = 50\n period_two = 200\n periods = [period_one, period_two].sort!\n shorter_sma = simple_mov... | [
{
"docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1",
"score": "0.7564463",
"text": "def private; end",
"title": ""
},
{
"docid": "0b8b7b9666e4ed32bfd448198778e4e9",
"score": "0.6487012",
"text": "def probers; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "5500d5a3fc5d18265ecd7f9d94573e28",
"score": "0.0",
"text": "def history_log_params\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.69792545",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6781151",
"text": "def strong_params\n params.requ... |
443ba705f8b380717dc42db70a55959e | Choose the first available endpoint | [
{
"docid": "bfb0bdcd3cd0a581da75310f017f82fb",
"score": "0.5471523",
"text": "def resolve_endpoints(endpoints)\n Array(endpoints).map(&:to_sym).each do |sym|\n if ep = @endpoints[sym]\n return sym, ep\n end\n end\n\n raise(Frenchy::ConfigurationError, \"... | [
{
"docid": "11fc6facc6ab140a481c3329af6dc2a0",
"score": "0.75749964",
"text": "def endpoint\n endpoints.first\n end",
"title": ""
},
{
"docid": "12cb260447633e47e35a55bff9a73554",
"score": "0.65626186",
"text": "def endpoint\n @endpoint or raise MissingEndpoint\n end",
"t... |
e97ce8a9cccf74d5eecc237568998a50 | the string. You may assume that the string contains only letters and spaces. | [
{
"docid": "1a372db87b0aa2061eb1e7fef4db167b",
"score": "0.0",
"text": "def longest_word(sentence)\n words = sentence.split(\" \")\n\n longest_word = nil\n\n word_idx = 0\n while word_idx < words.length\n current_word = words[word_idx]\n\n if longest_word == nil\n longest_word = current_w... | [
{
"docid": "325ffadb3e3b7a5846f3c5804435e216",
"score": "0.74901503",
"text": "def string(str); end",
"title": ""
},
{
"docid": "325ffadb3e3b7a5846f3c5804435e216",
"score": "0.74901503",
"text": "def string(str); end",
"title": ""
},
{
"docid": "325ffadb3e3b7a5846f3c58044... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "0cda35156721efb8c0a394ae3a194031",
"score": "0.0",
"text": "def project_interest_point_params\n params.require(:project_interest_point).permit(:content, :project_id)\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.69792545",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6781151",
"text": "def strong_params\n params.requ... |
c150111102a321738dfdf787fd7f0247 | List repo hooks Requires authenticated client. | [
{
"docid": "aff045528061eed8777089c3f9aa77d0",
"score": "0.73785484",
"text": "def hooks(repo, options = {})\n paginate \"#{Repository.path repo}/hooks\", options\n end",
"title": ""
}
] | [
{
"docid": "bfe0075334389a85650b87ad119a9cdb",
"score": "0.7673314",
"text": "def list(user, repo_name)\n\n path = \"/repos/#{user}/#{repo_name}/hooks\"\n\n @connection.get(path).map do |hook_data|\n GitHubV3API::Hook.new(self, hook_data)\n end\n end",
"title": ""
},
{
... |
5b3e56468067c8e57ab877e2c2c3ca02 | GET /brands/new GET /brands/new.json | [
{
"docid": "90f7340f01f14e6d85137224e2fea156",
"score": "0.7917945",
"text": "def new\n @brand = Brand.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @brand }\n end\n end",
"title": ""
}
] | [
{
"docid": "2433a7bcf12bc3301765aa21647972d0",
"score": "0.7865956",
"text": "def new\r\n @brand = Brand.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @brand }\r\n end\r\n end",
"title": ""
},
{
"docid": "6d59ba98ddbb6945... |
6da32ff5a6fadb9899df09fcf04e98b9 | Returns the name of the migrations directory for this database. This is either the directory given in the :migrations_dir option or the default directory of the lotaris.yml resource found under /svn/lme/migrations/default_dir. | [
{
"docid": "8817c90052104f492a6a050fd9d671c5",
"score": "0.79200155",
"text": "def migrations_dir options\n options[:migrations_dir] || @conf.default_dir\n end",
"title": ""
}
] | [
{
"docid": "02010c11f05ad0de96384708ad9f8a51",
"score": "0.7559398",
"text": "def migration_directory\n File.join(self.directory, 'db', 'migrate')\n end",
"title": ""
},
{
"docid": "892e57671abb421e265efa2c92e07621",
"score": "0.72984457",
"text": "def migration_directory\n ... |
d0f5061034f1d81f77b050974be8dcca | Returns a Symbol. Possible results: :added (subset of :included) :removed :untracked :included (aka :modified) :normal If you call localrepostatus from this method... well... I DARE YOU! | [
{
"docid": "d787a5ab249ecb92538ad2574902576f",
"score": "0.5462658",
"text": "def file_status(filename, opts={})\n parse_status! opts\n inverted = @status.inject({}) do |h, (k, v)|\n v.each {|v_| h[v_] = k }\n h\n end\n \n ... | [
{
"docid": "886515bbc5a8e4c3aa323855c669386f",
"score": "0.6362979",
"text": "def untracked; end",
"title": ""
},
{
"docid": "886515bbc5a8e4c3aa323855c669386f",
"score": "0.6362979",
"text": "def untracked; end",
"title": ""
},
{
"docid": "91cbb2dd50a524dd3b63de473e86bcee... |
09976d4138ef28f9065db925bf0b5596 | True if this is a remote kernel flaw. | [
{
"docid": "c1943adeee0a58af369f4f927b3cadda",
"score": "0.8185846",
"text": "def is_remote_kernel_flaw\r\n is_remote_flaw and is_kernel_flaw\r\n end",
"title": ""
}
] | [
{
"docid": "59d547247d320eb4ecd773679b85cccd",
"score": "0.68751955",
"text": "def is_remote_user_flaw\r\n is_remote_flaw and is_user_flaw\r\n end",
"title": ""
},
{
"docid": "976c84468bb036f1fd7e36723a92c83c",
"score": "0.67571837",
"text": "def is_remote_flaw\r\n if target.f... |
670d63a50faddb3ee5a53147f080e131 | version must be of format n.nn or n.nn.nn | [
{
"docid": "93e27e1bd170782e73a38ce7417b695d",
"score": "0.0",
"text": "def initialize( src )\n @match_data = src.match( FORMAT_VALIDATOR )\n raise ArgumentError.new( \"Not a valid version format for a VersionString.\" ) if @match_data.nil?\n\n @major = (@match_data[:major] || 0).to... | [
{
"docid": "4f31b32751b1d2b54a6b12343378a947",
"score": "0.6596169",
"text": "def normalize(version)\n if version.match?(/^\\d+\\.\\d+\\.0$/)\n version.chomp(\".0\")\n else\n version\n end\n end",
"title": ""
},
{
"docid": "6b1007136695e497102d5ec8cb638841",
"score": ... |
3768fa87f6bec304340fbc4fa59e3fff | GET /alimentos/new GET /alimentos/new.xml | [
{
"docid": "fcd8fddc9fd76e42ff3ab728e66672e9",
"score": "0.0",
"text": "def new\n @alimento = Alimento.new\n componentes = Componente.where(\"ativo=?\",true).order(\"ordem ASC\")\n componentes.each do |c|\n @alimento.componente_alimentos.build({:componente => c})\n #ca = ComponenteAli... | [
{
"docid": "4c1ebbaf071800019ec1edffa1d50b33",
"score": "0.72526646",
"text": "def new\n @aluno = Aluno.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @aluno }\n end\n end",
"title": ""
},
{
"docid": "bf7ad6f1e3ee14e7ac4ab49f94b... |
d719cb0331e390c7a2236120702c6d30 | => true Further exploration Write a method for rotating strings and then integers. Can use rotate array method. | [
{
"docid": "84468cff7f5bbc72fb8af93ec2b87a5e",
"score": "0.6892532",
"text": "def rotate_string(string)\n rotate_array(string.chars).join\nend",
"title": ""
}
] | [
{
"docid": "7d14d30cc1a417aada6d090ae827b936",
"score": "0.7655597",
"text": "def rotate1(input_array)\n # TODO\nend",
"title": ""
},
{
"docid": "cf20eaaa25f8296bb19d40200a4e05c8",
"score": "0.75116813",
"text": "def rotate2(input_array)\n # TODO\nend",
"title": ""
},
{... |