query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
89b0d45d7490645cb65ca661eefd31c3 | Optional segment with free text info regarding the payment | [
{
"docid": "2e13d457ba52f539bf6e1f34e93d7fa4",
"score": "0.5144215",
"text": "def payment_advice_segment_index(segments, start_pos, end_pos=nil)\n find_index_by_regex(segments, start_pos, end_pos, /^FTX\\+AAG.*/)\n end",
"title": ""
}
] | [
{
"docid": "12c8d558304807674ed40c685716dc39",
"score": "0.6240114",
"text": "def payment_term; end",
"title": ""
},
{
"docid": "cea845d7403cea91ed9a02dd72cef297",
"score": "0.6212834",
"text": "def payment_description\n\t\t\t\t\treturn nil\n\t\t\t\tend",
"title": ""
},
{
... |
9ecc7b64cea343fcd275771329409cdb | Below is the kata answer (a more simple way to write this) | [
{
"docid": "5bfcbc0d927d49201ab4f4e90ea3d63f",
"score": "0.0",
"text": "def dasherize_number(num)\n num_s = num.to_s\n\n result = \"\"\n\n idx = 0\n while idx < num_s.length\n digit = num_s[idx].to_i\n\n if (idx > 0)\n prev_digit = num_s[idx - 1].to_i\n if (prev_digit % 2 == 1) || (d... | [
{
"docid": "b9960478999684c2b536f76e22f6fc63",
"score": "0.6018851",
"text": "def solution4(input)\n end",
"title": ""
},
{
"docid": "bc658f9936671408e02baa884ac86390",
"score": "0.60055554",
"text": "def anchored; end",
"title": ""
},
{
"docid": "f64337f68710b6e55a87e68... |
29258a917c4b3d25597301dfa140f694 | GET /sys/users GET /sys/users.json | [
{
"docid": "afe9369e4e9baf3e9a34120dc3ab0e46",
"score": "0.6967627",
"text": "def index\n @sys_users = Sys::User.all\n end",
"title": ""
}
] | [
{
"docid": "1b36c6d085c50d9b823abd98e9d4a7dd",
"score": "0.79138196",
"text": "def list_users\n self.class.get('/users')\n end",
"title": ""
},
{
"docid": "8a29471646191d84def95f7af1e081bf",
"score": "0.7883905",
"text": "def users(args = {})\n get(\"/users.json\",args)\n ... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "0dd7c4f244a5a4a09d45b2f1a35b75be",
"score": "0.0",
"text": "def paw_params\n params.require(:paw).permit(:avatar,:name, :gender, :breed, :dob)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7496716",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6956598",
"text": "def strong_params\n params.require(:request).permit(param_white... |
9bdd1f8b640abb5b025c940469fd3662 | GET /tratments/1 GET /tratments/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "c6c0a437341948227bcb8efe01fd289f",
"score": "0.70694643",
"text": "def index\n @tratments = Tratment.all\n end",
"title": ""
},
{
"docid": "f5c923dab4affd41cf4331347db049b2",
"score": "0.65685266",
"text": "def index\n @tenures = Tenure.all\n render json: @tenur... |
302ff998b70579713370f9cfc84a615f | DELETE /spiral_galaxies/1 DELETE /spiral_galaxies/1.xml | [
{
"docid": "b1d6202204b2fb3329609883a53f91c8",
"score": "0.6577345",
"text": "def destroy\n @spiral_galaxy = SpiralGalaxy.find(params[:id])\n @spiral_galaxy.destroy\n\n respond_to do |format|\n format.html { redirect_to(galaxies_spiral_galaxies_url) }\n format.xml { head :o... | [
{
"docid": "434726adb4cd9153870336be0095d99e",
"score": "0.6864939",
"text": "def destroy\n @galaxies_spiral_galaxy = Galaxies::SpiralGalaxy.find(params[:id])\n @galaxies_spiral_galaxy.destroy\n\n respond_to do |format|\n format.html { redirect_to(galaxies_spiral_galaxies_url) }\n for... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "93ff860c1da479cd4b5c8c192f72b769",
"score": "0.0",
"text": "def set_comment\n @comment = Comment.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... |
79bb04d7b7f1ba3c2202e1ffaf71cef9 | Get scale factor for Scale. | [
{
"docid": "5a20fbdf77591d8874aa24b131fdc803",
"score": "0.5665266",
"text": "def factor\n @factor if valid?\n end",
"title": ""
}
] | [
{
"docid": "835e126d156d55ee59e1d615d5c191f9",
"score": "0.75032175",
"text": "def scale\n self['scale']\n end",
"title": ""
},
{
"docid": "ac2282db5fb75391b73fc46a0e8e490a",
"score": "0.74671394",
"text": "def scale\n @data['scale']\n end",
"title": ""... |
38d1d85360990e01b556b73d903867d6 | "red", "light red", "light yellow" ] | [
{
"docid": "b0497a62abdf7327663d7415270a03cf",
"score": "0.65986645",
"text": "def add_colors\n rainbow_colors = [\n \"red\",\n \"light red\",\n \"light yellow\"\n]\n\n rainbow_colors << (\"green\")\n rainbow_colors << (\"blue\")\nend",
"title": ""
}
] | [
{
"docid": "c9bddbadab64d2a20ef07337c7624fbb",
"score": "0.7040611",
"text": "def green(text); colorize(text, 32);end",
"title": ""
},
{
"docid": "d549125557baa86f27b3b63b84bbcbb0",
"score": "0.7005069",
"text": "def megazord\n \"#{red} #{yellow} #{pink} #{blue} #{black} #{green}\"\... |
e691dbaf22c38e3106dfe201dffcf9ca | PATCH/PUT /admin/brokers/1 PATCH/PUT /admin/brokers/1.json | [
{
"docid": "e8316837eb9bd8eddf409ac81cbbc435",
"score": "0.0",
"text": "def update\n creat_agentlanguage(@agent)\n respond_to do |format|\n if @agent.update(agent_params)\n format.html { redirect_to admin_agent_path(@agent), notice: 'Agent was successfully updated.' }\n format.j... | [
{
"docid": "9048291e5299fa3ffa501ba57c403e20",
"score": "0.6931203",
"text": "def update\n respond_to do |format|\n if @broker.update(broker_params)\n format.html { redirect_to admin_broker_path(@broker), notice: 'Broker was successfully updated.' }\n format.json { head :no_content... |
f6f26a0171f7f6ae5ff32e7519270d7b | Returns a new hash consisting of hash2 merged to hash1. If keyvalue pairs with identical keys but different values exist in both hash1 and hash2, the former value will be overwritten by the latter. For type qualifiers this mechanism has been modified so the values are merged instead, allowing several type qualifiers to... | [
{
"docid": "fbb4de169159b56cf146e1b25c3acc07",
"score": "0.7709221",
"text": "def merge_hashes(hash1, hash2)\n merged_hash = hash1.clone\n return merged_hash if hash2.nil? || hash2.empty?\n\n if merged_hash.has_key?('.type_qualifier') && hash2.has_key?('.type_qualifier')\n hash2['.type_qualifier']... | [
{
"docid": "1d6808dba7e4d5eb2bde87cf43df008a",
"score": "0.7123223",
"text": "def custom_merge(hash1, hash2)\n output = hash1.dup\n hash2.each { |key, value| output[key] = value }\n output\nend",
"title": ""
},
{
"docid": "6eaf3bba7e9906f0783c7e7e3b34ec9d",
"score": "0.7082154",
"... |
43820420eeea864f9676d003f7885367 | PATCH/PUT /pupils/1 PATCH/PUT /pupils/1.json | [
{
"docid": "4c397f641fda8a8367e63028b1fe21d1",
"score": "0.6435093",
"text": "def update\n @form = Form.find(params[:form_id])\n respond_to do |format|\n if @pupil.update(pupil_params)\n format.html { redirect_to form_pupils_path(@form), notice: 'Данные ученика изменены.' }\n fo... | [
{
"docid": "4e0e59715d19dce2a47fccc2c67326dd",
"score": "0.6870412",
"text": "def patch!\n request! :patch\n end",
"title": ""
},
{
"docid": "ed2403080f09af79d5a9702a8554d0c7",
"score": "0.6824922",
"text": "def update\n authorize! :manage, Pupil\n respond_to do |format|\n ... |
4b99b71b8bdbb8854a8a83d29473562b | The sender email address used for notifications | [
{
"docid": "c0995e4f965e4f27422094f94833b291",
"score": "0.0",
"text": "def kryptonite_config_email_from_address\n \t\t'donotreply@kryptonitecms.com'\n \tend",
"title": ""
}
] | [
{
"docid": "7241e6d6cdfbd592f55e9f1521dd8f46",
"score": "0.87612706",
"text": "def sender_email\n @sender_email ||= message.from && message.from.first\n end",
"title": ""
},
{
"docid": "8c6e9274f29e723116c4d3b49596d113",
"score": "0.85072607",
"text": "def sender_email\n @... |
4fa9ebcfcb7884dff0a30a468aac377b | =begin For the grade display =end | [
{
"docid": "057b7ccc812e9e7832fe9fa1c7be0748",
"score": "0.0",
"text": "def get_colspan( closed_projects )\n length = closed_projects.length\n if length == 0 \n return 1 \n else\n return length \n end\n end",
"title": ""
}
] | [
{
"docid": "2da2061db5384b63d4b25b8fe8d5bde0",
"score": "0.7434467",
"text": "def displayed_grade\n (grade * 4 + 1).to_i\n end",
"title": ""
},
{
"docid": "d96234ad4a9a910f654fa22c83809a34",
"score": "0.71608204",
"text": "def grade_with_label\n \"Grade: #{grade}\"\n end",
... |
18e7f7a122f1bc8c74ca1faaad9fca75 | POST /cart_product_groups POST /cart_product_groups.json | [
{
"docid": "b7b4bbef4f427db403b591bd0aaa27bf",
"score": "0.7467186",
"text": "def create\n @cart_product_group = CartProductGroup.new(cart_product_group_params)\n\n respond_to do |format|\n if @cart_product_group.save\n format.html { redirect_to @cart_product_group, notice: 'Cart produ... | [
{
"docid": "51115498972f4bd5b2cd007db6cd61d9",
"score": "0.71052194",
"text": "def create\n @group = @product.groups.new(params[:group])\n\n if @group.save\n # TODO: add in group specs\n @status = \"good\"\n @message = \"Group was added successfully.\"\n serve_json_response\n ... |
fcc305187108235c833e3597b93b7f71 | GET /project_procurement_management_plans/new GET /project_procurement_management_plans/new.json | [
{
"docid": "38ed896c58740bfcd6ed1814aca0f504",
"score": "0.8478392",
"text": "def new\n @project_procurement_management_plan = current_user.project_procurement_management_plans.build\n 1.times { @project_procurement_management_plan.projects.build }\n respond_to do |format|\n format.html # ... | [
{
"docid": "dfc79ab96ad5e13722cf9c9d02408a81",
"score": "0.75428295",
"text": "def create\n @project_procurement_management_plan = ProjectProcurementManagementPlan.new(params[:project_procurement_management_plan])\n\n respond_to do |format|\n if @project_procurement_management_plan.save\n ... |
509ed807ff9f8596aa2977b1cd69d313 | DELETE /text_sizes/1 DELETE /text_sizes/1.json | [
{
"docid": "6d19e70b4ade3cf74b25f08e39f6340e",
"score": "0.78612447",
"text": "def destroy\n @text_size = TextSize.find(params[:id])\n @text_size.destroy\n\n respond_to do |format|\n format.html { redirect_to text_sizes_url }\n format.json { head :no_content }\n end\n end",
"t... | [
{
"docid": "b301c95d0d6daedd77f75c1167d2a61c",
"score": "0.69679546",
"text": "def destroy\n @size.destroy\n respond_to do |format|\n format.html { redirect_to sizes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fd805211920bc5b4f633f920... |
47545cce698dd802db4e2921ec3b6349 | A Duration can be 'anchored' to a START_TIME This start_time is a Time object | [
{
"docid": "b1b5ef72d0c9f6f98018028e156d3f2d",
"score": "0.72618425",
"text": "def start_time=(value)\n if value.is_a?(Time) || value.is_a?(DateTime)\n @start_time = value.to_time\n else\n raise TypeError, \"A Duration's start_time must be a Time or DateTime object.\"\n end\n end",
... | [
{
"docid": "a9538a0b58cce47655b5e5652c707680",
"score": "0.6803748",
"text": "def move(start)\n self.start_time = start\n new_min = start.min + self.duration.min\n new_hour = start.hour + self.duration.hour\n add_day = 0\n if new_min >= 60\n new_hour += new_... |
7080b0db34b9033cf72ccee9553f2098 | Validate that the provided var is a string that can be used as a name for environment variables. | [
{
"docid": "99efd3360499734e6919d68ad2616684",
"score": "0.8064772",
"text": "def valid_env_var?(var)\n var.kind_of?(String) && Dux.presentish?(var)\n end",
"title": ""
}
] | [
{
"docid": "b0f8d6c6c1810ea840d7abded632a6d4",
"score": "0.7647295",
"text": "def validate var\n if ENV[var].nil?\n abort(var + \" must be set in your environment\")\n end\n ENV[var]\nend",
"title": ""
},
{
"docid": "3e58ebdc493aee5d687b02a8d713c1df",
"score": "0.74282724",
"te... |
56621677597afc37a2388ef376aa9cbf | Advanced: use inject to sum integers in array | [
{
"docid": "d06709210e1282a46d8aba1d908dceb9",
"score": "0.7723988",
"text": "def sum_array(collection)\n collection.inject {|sum, n| sum + n}\nend",
"title": ""
}
] | [
{
"docid": "e60051eb5fba64f6453d67a117d9d167",
"score": "0.8071884",
"text": "def sum_array_inject(array)\n array.inject {|sum, element| sum + element}\nend",
"title": ""
},
{
"docid": "28de6f793257df07c6bf1a985deaa15c",
"score": "0.8000566",
"text": "def sum_array(integers)\n inte... |
a7493a129b37af2efa0336b50911eda7 | Name: delete_events Desc: return requested events from specified key Args: collection, key, event_type | [
{
"docid": "959e00e7f82e27818019c4d7a4e7f490",
"score": "0.7737231",
"text": "def delete_events(args)\n\t\t\tapi_url = \"#{@base_url}/#{args[:collection]}/#{args[:key]}/events/#{args[:event_type]}\"\n\t\t\tdo_the_delete_call( url: api_url )\n\t\tend",
"title": ""
}
] | [
{
"docid": "5d332ba684ea98aeaf66d161b083fc87",
"score": "0.68255013",
"text": "def purge_event(collection, key, event_type, timestamp, ordinal, ref=nil)\n timestamp = API::Helpers.timestamp(timestamp)\n path = [collection, key, 'events', event_type, timestamp, ordinal]\n headers = {}\n ... |
4cfee432c63a8fc145f3d3cd3d46854b | The options passed to an ERB template. Having it global like this is ugly, but it does allow a hash of options to always be available in templates even if the template is being rendered using a custom binding. | [
{
"docid": "b6d1c1b39cdb531274aee16fe4a4d2dd",
"score": "0.0",
"text": "def options\n $_target_options ||\n Origen.generator.compiler.options\n end",
"title": ""
}
] | [
{
"docid": "1d5aae9089bf28c1822a83c8c6bc754a",
"score": "0.7194798",
"text": "def template_options(_templ = nil)\n {}\n end",
"title": ""
},
{
"docid": "52dcdd29a705b601ea727424f2b16287",
"score": "0.67140704",
"text": "def template_options\n @template_options ||= { name... |
d9879fda1ca1c7260fa656edb96d8b3d | allows additional params on devise signup | [
{
"docid": "b8a17baba2f79dbabcf4354057333129",
"score": "0.0",
"text": "def configure_permitted_parameters\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:first_name, :last_name, :profile_name, :email, :password, :password_confirmation, individual_attributes: [:f_name, :l_name, :role]) }\n... | [
{
"docid": "aa624904515467e92f30e00b864823ae",
"score": "0.78421634",
"text": "def sign_up(sign_up_hash) end",
"title": ""
},
{
"docid": "ae19966f45906242876374f0645ac719",
"score": "0.7772353",
"text": "def configure_sign_up_params\n # devise_parameter_sanitizer.for(:sign_up) << ... |
817d25b29b9e77c91183e446e89d7019 | require 'pry' require 'prydebugger' | [
{
"docid": "f487c8c608a0085b5076b2304c73fc90",
"score": "0.0",
"text": "def email_error (msg, dns_response)\n puts msg\n puts dns_response\n puts \"=================\"\nend",
"title": ""
}
] | [
{
"docid": "278ec034f144d3f986cd649f3e1f7a92",
"score": "0.83123225",
"text": "def run_pry\n binding.pry\n end",
"title": ""
},
{
"docid": "c6ea09e60788d1f9a96c53e028610963",
"score": "0.76311535",
"text": "def debug\n binding.pry\n end",
"title": ""
},
{
"docid":... |
0f56302fd50f78592328a0eabb696784 | Creates a link tag for starting an email to the specified email_address, which is also used as the name of the link unless +name+ is specified. Additional HTML options, such as class or id, can be passed in the html_options hash. | [
{
"docid": "d213e5dff9baf7f2994b90ecaeda1c8c",
"score": "0.78786796",
"text": "def mail_to(email_address, name = nil, html_options = {})\n content_tag \"a\", name || email_address, html_options.merge({ \"href\" => \"mailto:#{email_address}\" })\n end",
"title": ""
}
] | [
{
"docid": "b6deff07477cfd58a7a3bfc4f8c599f0",
"score": "0.77745587",
"text": "def mail_to(email_address, name = nil, html_options = {}, &block)\n html_options, name = name, nil if name.is_a?(Hash)\n html_options = (html_options || {}).stringify_keys\n\n extras = %w{ cc bcc body sub... |
cffb59bd8bafa6d915a2d9dac959b92f | Ruby Debug class, to use, uncomment say() and have at it. | [
{
"docid": "63b3b29c13a53a55d22578a438cdf137",
"score": "0.7598454",
"text": "def say(word)\n require 'debug'\n puts word + ' to begin debugging.'\nend",
"title": ""
}
] | [
{
"docid": "c1acc034593b5b8ee33971529abe613f",
"score": "0.73728174",
"text": "def debug(msg)\n #puts msg\n end",
"title": ""
},
{
"docid": "23f826ae7529f7d2bcfe697543f9957f",
"score": "0.72196656",
"text": "def say_debug(message)\n puts yellow(message) if self.debug\n en... |
ca6628fb3bdfac339e0b6a205296f102 | PUT /articles/1 PUT /articles/1.json | [
{
"docid": "127193a9b695d95bf6538bf269cb1be9",
"score": "0.7546864",
"text": "def update\n article = Article.find(params[:id])\n article.update(article_params)\n render json: { article: article }\n end",
"title": ""
}
] | [
{
"docid": "b9fefa1ab0f08e5efdb3775b6bf7e045",
"score": "0.71490186",
"text": "def update\n if @article.update(article_params)\n render json: ArticleSerializer.new(@article), status: :ok\n else\n render json: @article.errors, status: :unprocessable_entity\n end\n end",
"title": "... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "3ccee35dc0a071eefae8eb361fc0c692",
"score": "0.0",
"text": "def set_manager_session\n @manager_session = ManagerSession.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.6163163",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.6045976",
"text": "def action_hook;... |
e054e3813f87f943b15e514271424eae | Enters the specified file into the file field name (assuming it's in the data/sakaicletestapi folder or a subfolder therein) Use this method ONLY for instances where there's a file field on the page with an "upload" id. | [
{
"docid": "5a73eb0eccf682ce80abd3f7c4078d38",
"score": "0.0",
"text": "def upload_local_file(filename, filepath=\"\")\n frm.file_field(:id=>\"upload\").set(filepath + filename)\n if frm.div(:class=>\"alertMessage\").exist?\n sleep 2\n upload_local_file(filename)\n end\n instantiat... | [
{
"docid": "9e8ffdebc697e9882f14f77e9b817aae",
"score": "0.7832131",
"text": "def file_to_upload=(file_name)\n frm.file_field(:id, \"content_#{@@filex}\").set(File.expand_path(File.dirname(__FILE__)) + \"/../../data/sakai-cle-test-api/\" + file_name)\n @@filex+=1\n end",
"title": ""
},
{
... |
59b8bec81dfb51bc480b1e48d31f0aa5 | Get root filesytem type | [
{
"docid": "cdbe8cfc9ccbdd52d86b1ee7798b5843",
"score": "0.6961732",
"text": "def get_root_partition_fs_type()\n post_message(\"Retrieving '/' root partition filesystem type...\")\n @logger.debug \"get root partition filesystem type\"\n # get root device and then its fs type\n root_fs_type =... | [
{
"docid": "eb379083ca38e33adf0f315a46ee54a7",
"score": "0.74104285",
"text": "def file_type\n return \"directory\" if directory?\n result = TYPES.find { |re, t| re.match(to_s) }\n result && result.last\n end",
"title": ""
},
{
"docid": "a0df2e81794075ffc6c243018f99b6d4",
"scor... |
720bebb129d2af14aebf71a06f965372 | Complete the minimumBribes function below. | [
{
"docid": "f990b7fbe686e88b403e6e19cc4428ce",
"score": "0.69131273",
"text": "def minimumBribes(q)\n q.each_with_index.inject(0) do |bribes, (actual, index)|\n return bribes if q[index + 1].nil?\n\n index_diff = actual - index - 1\n maximun_distance = actual - 2\n distance = if index_diff ... | [
{
"docid": "5b2c9ccba0984d6c6d71f5c55393091c",
"score": "0.70696306",
"text": "def min() end",
"title": ""
},
{
"docid": "c9dd118274621477ba7024115f83ba1d",
"score": "0.6585691",
"text": "def min; end",
"title": ""
},
{
"docid": "c9dd118274621477ba7024115f83ba1d",
"sc... |
2dbcff28f2f8e4711e9e692f5fb3b8d0 | Do we ever REALLY have a new action? I think our form partial is enough. def new | [
{
"docid": "172cf759c83ec0066f76f8d2daae2f92",
"score": "0.0",
"text": "def index\n @leagues = current_user.leagues\n end",
"title": ""
}
] | [
{
"docid": "128cdc0adef5ae4ba9146329acac545a",
"score": "0.8180788",
"text": "def new\r\n render :partial => 'new'\r\n end",
"title": ""
},
{
"docid": "759cd7f5661394d17dea7a919f2a23c2",
"score": "0.79221666",
"text": "def new\n render :new # optional; this is the default be... |
ad1b821b78f9775d0abbf5b6cc689833 | Returns the number of Issues associated with the Component [Arguments] :id (required) Component to count | [
{
"docid": "219904d2a79a013d17aade1166c8a969",
"score": "0.67408264",
"text": "def related_issue_counts(id)\n response = fetch({:key => \"#{id}/relatedIssueCounts\"})\n response.parsed_response['id'] = id\n Field.new(response.parsed_response)\n end",
"title": ""
}
] | [
{
"docid": "c705b444077299f43f50a956c9b9fa01",
"score": "0.7186515",
"text": "def related_issue_counts\n self.class.related_issue_counts(component_key).issueCount\n end",
"title": ""
},
{
"docid": "452829d279daea6ea1c4e0683da5f620",
"score": "0.704536",
"text": "def related_i... |
c1f09309b105d11a7995cc6f4c76209e | Get access logs for Application Retrieve the list of API calls sent to the specified Application. | [
{
"docid": "d7d17e3fefcbeb72f7a9e8ada97c6a96",
"score": "0.51827496",
"text": "def get_access_logs_without_total_count_with_http_info(application_id, range_start, range_end, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementApi.get_access_... | [
{
"docid": "51b7f53b9386cd0792046ffb3e0be7a7",
"score": "0.7192349",
"text": "def logs_for(application)\n logs_at_url(get(\"/apps/#{application}/logs?logplex=true\", 2))\n end",
"title": ""
},
{
"docid": "bd7d96d83280bcf2228a53f493cfaa6b",
"score": "0.698131",
"text": "def logs(a... |
c2480fa9247ddf7b8beb3f1b6d3b54f3 | Add file to device session. | [
{
"docid": "87298b9c7cc2f21084d30fbfeff602a6",
"score": "0.0",
"text": "def add_file_using_post_with_http_info(device_session_id, file, name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AdminApi.add_file_using_post ...'\n end\n # ver... | [
{
"docid": "c7d6609b6e5407fa29a12e93f04fc60e",
"score": "0.6741219",
"text": "def add_file(p0) end",
"title": ""
},
{
"docid": "0b9dba138948d705d1e5eafed74b13c9",
"score": "0.661896",
"text": "def add_file(file_path)\n Dropio::Client.instance.add_file(self, file_path)\n end",
... |
bcdab50d438bddce48c093f46b10fdaa | POST /student_marks POST /student_marks.json | [
{
"docid": "112a1606e5f269b2d145204fb03455c2",
"score": "0.7600623",
"text": "def create\n @student_mark = StudentMark.new(student_mark_params)\n\n respond_to do |format|\n if @student_mark.save\n format.html { redirect_to @student_mark, notice: 'Student mark was successfully created.'... | [
{
"docid": "d8e0a36f5265702d7ec3e346804663f0",
"score": "0.7235692",
"text": "def student_mark_params\n params.require(:student_mark).permit(:student_id, :exam_id, :subject_id, :marks, :exam_subject_id)\n end",
"title": ""
},
{
"docid": "65770912ea172ab24697b191595b0e5a",
"score"... |
cffb197df1a774c95ab2774435e26493 | Create a new IVar node. | [
{
"docid": "d3dde1b95db0fa0b09d437e15c0fb171",
"score": "0.7378471",
"text": "def IVar(value)\n IVar.new(value: value, location: Location.default)\n end",
"title": ""
}
] | [
{
"docid": "5b45f5c5a70f7d2137fdef4e72fba1e5",
"score": "0.7153461",
"text": "def new_var(id, domain: nil, assignment: nil)\n vars[id] = Variable.new(id, domain: domain, assignment: assignment)\n end",
"title": ""
},
{
"docid": "b948ece40e4025479f45ca0913f8b850",
"score": "0.70700276... |
689460476fbbf0f0690c962c4457b33b | GET /mostsmallitemeffectinventories/new GET /mostsmallitemeffectinventories/new.json | [
{
"docid": "9a67e44eef519eec56629556b25ccfab",
"score": "0.79474527",
"text": "def new\n @mostsmallitemeffectinventory = Mostsmallitemeffectinventory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mostsmallitemeffectinventory }\n end\n end",... | [
{
"docid": "88be7b7c1f9f9b87ee03f95cad1cc112",
"score": "0.73691094",
"text": "def create\n @mostsmallitemeffectinventory = Mostsmallitemeffectinventory.new(params[:mostsmallitemeffectinventory])\n\n respond_to do |format|\n if @mostsmallitemeffectinventory.save\n format.html { redirec... |
073d762950273d5838d0c8f270d68cf1 | Evaluates a block of code against the RQL DSL | [
{
"docid": "390f457a30170b6820480a3a6d66a007",
"score": "0.0",
"text": "def eval_rql(alias_derived_attr = false, &block)\n Dsl::Base.new(self.unscoped, alias_derived_attr).instance_eval(&block)\n end",
"title": ""
}
] | [
{
"docid": "f520de0f30ce95fdd7634e9384aa077a",
"score": "0.6606506",
"text": "def execute(&block)\n DSLHelper.new(Class => [:&, :|, :not]) do\n Kernel.load(File.join(File.dirname(__FILE__), 'dsl_ruby_extensions.rb'))\n self.instance_eval(&block)\n end\n end... |
cf9480cbb615dff4ad66a6304537a72c | Sets values for an option. | [
{
"docid": "2c94004af4cd6864f10d34e04637b3ee",
"score": "0.58241963",
"text": "def SetXendOption(option_key, option_vals)\n Ops.set(@SETTINGS, option_key, option_vals)\n\n nil\n end",
"title": ""
}
] | [
{
"docid": "e15f20fec7b9702e4530971f5a0ef10c",
"score": "0.7271472",
"text": "def set_options(options = {})\n options.each_pair do | key, value |\n send \"#{key}=\", value\n end\n end",
"title": ""
},
{
"docid": "d620e179fab2f929cc11bf62514ac5b2",
"score": "0.7161437"... |
4c848ec863fdc00463c230ad10dfc9eb | function to find the most common word that comes after the word provided as a parameter | [
{
"docid": "7f2bad94ae8e254a9ea269e4a94a7a8d",
"score": "0.76562166",
"text": "def mcw(word)\n\tbegin\n\t\tmost = 0\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# represents the frequency with which the second word occurs\n\t\tcommon = \"\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# the most common wo... | [
{
"docid": "fcf622297991c6a0c8e43002346e2a66",
"score": "0.8234269",
"text": "def most_frequent_word(my_str)\n my_str = my_str.downcase\n str_to_array = my_str.split(\" \")\n \n word_counter = Hash.new(0)\n\n str_to_array.each do |word| \n word.gsub!(/[^a-z]/,\"\")\n word_counter[word]+= 1\n ... |
c8e8017267bf9c8c37a714400e52b2fc | Once the scheduler has been configured, call run to block the current thread and keep the process alive for the scheduled tasks to run | [
{
"docid": "ad00257e1676edf40e69aca31e19fab3",
"score": "0.71929663",
"text": "def run\n DaemonKit.logger.info \"Starting rufus-scheduler\"\n\n if instance.is_a?( Rufus::Scheduler::PlainScheduler )\n instance.scheduler.join\n else\n Thread.stop\n end\n ... | [
{
"docid": "f465fc429618fd9f13dadd242b874b39",
"score": "0.7883656",
"text": "def run!\n act_scheduler.run!\n end",
"title": ""
},
{
"docid": "0e57fa0ff1abe50c776d3a3920ca4681",
"score": "0.7352265",
"text": "def run_automatic_scheduling\n Thread.new {\n loop do\n... |
ab707b4cb391442d65a6ecca68a940e1 | Populate instance variables from fetched extractions | [
{
"docid": "c3c5c74a9f5c31090520e51e4a14e00d",
"score": "0.6398265",
"text": "def update\n response = @api.request(:get, @location, @req_opts)\n\n unless response.status == 200\n raise Gini::Api::DocumentError.new(\n \"Failed to fetch extractions from #{@location}\",\n ... | [
{
"docid": "78e84c75cdfb10703cea0e3e031b3b4d",
"score": "0.6284542",
"text": "def populate!\n\n # Process artifacts and refine them into Classes\n\t\t\tprocess_artifacts\n refine_classes\n assign_class_generalizations\n end",
"title": ""
},
{
"docid": "704e4da56a17f614859e9... |
3c77bbb546b350c06a8eeb46650707f6 | Shows users' posts if 'individual' is signed in Shows ALL posts if mover is signed in | [
{
"docid": "114e4a876f2e229c3a6e0e1dc3ba8fc6",
"score": "0.7046023",
"text": "def index\n\t\tif current_user.acct_type == 'individual'\n\t\t\t@post = current_user.posts\n\t\telse\n\t\t\t@post = Post.all\n\t\tend\n\tend",
"title": ""
}
] | [
{
"docid": "0af9cb6bee798e9c1f1229c69106c489",
"score": "0.7455648",
"text": "def show\n @posts = User.find(@user.id).posts\n if (logged_in)\n @posts = User.find(@user.id).posts\n else\n return\n end\n end",
"title": ""
},
{
"docid": "cad2d7f565350f315e479b5c3d531868",... |
c050839e26c108c991d74b16c98382dc | DELETE /projects/1 DELETE /projects/1.json | [
{
"docid": "e4eabccf3254c09325b990a2565f4cb9",
"score": "0.0",
"text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: 'Project was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
... | [
{
"docid": "ce10449f9ce0fd62fdc6ce11492b8372",
"score": "0.7899063",
"text": "def destroy\n @root = \"projects\"\n \n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\... |
98e1c995480c2082fee6dfb69d4ae3fa | Helper method to generate the proper url for Mailgun mailbox API calls | [
{
"docid": "3c44868a5c77207438cae30cd9db86a8",
"score": "0.60473657",
"text": "def list_url(address=nil)\n \"#{@mailgun.api_url}/lists#{'/' + address if address}\"\n end",
"title": ""
}
] | [
{
"docid": "aeeb4f967d081aacba7a93c1982df012",
"score": "0.80363005",
"text": "def build_mailgun_uri(mailgun_api_key, mailgun_domain)\n \"https://api:#{ mailgun_api_key }@api.mailgun.net/v2/#{ mailgun_domain }/messages\"\n end",
"title": ""
},
{
"docid": "d9cc6c8770485beacc324c5098aa... |
fa616b39509db8746b78076d058dc652 | checking to see if the square we want is occupied by a piece of the opponent's color | [
{
"docid": "252d89a02ee7990aac826c8be3e38f29",
"score": "0.76649654",
"text": "def space_occupied_by_opponent?(x, y)\n other_piece = game.pieces.where(x_position: x, y_position: y).first\n other_piece && other_piece.is_black != is_black\n end",
"title": ""
}
] | [
{
"docid": "e4acf954d22484f0f838fa7a20a019dd",
"score": "0.83516127",
"text": "def occupied_by_opponent?(board, position, color)\n if color == 'black'\n return true if WHITE_PIECES.include?(board.squares[position])\n elsif color == 'white'\n return true if BLACK_PIECES.include?(board.squares[pos... |
6cf59d68fb639824468fc7782720e1f1 | DELETE /emergency_contacts/1 DELETE /emergency_contacts/1.json | [
{
"docid": "7cb050188daa8803f818dc388aa1a636",
"score": "0.7421157",
"text": "def destroy\n @emergency_contact.destroy\n respond_to do |format|\n format.html { redirect_to emergency_contacts_url, notice: 'Emergency contact was successfully destroyed.' }\n format.json { head :no_content }... | [
{
"docid": "17bbac4c2997ecb6a6d6dceb6947218c",
"score": "0.7422172",
"text": "def destroy\n puts \"delete contact\"\n contact = Contact.find(params[:id])\n contact.destroy\n render json: contact\n end",
"title": ""
},
{
"docid": "bbcdad3b5a7d124e1a5f75023588c45c",
"score": "... |
7571d1261518fad39745e347ec63fd68 | The array of validations that the instances must pass to be considered valid. These must be methods available on the instance | [
{
"docid": "25b230a32f205a5ea24d74da83f6bf74",
"score": "0.783672",
"text": "def validations\n []\n end",
"title": ""
}
] | [
{
"docid": "9c102491e6f321f4a617b06c73a26296",
"score": "0.74870205",
"text": "def validate\n validations = self.class.meta_eval { @validations }\n\n validations.each do |v|\n raise \"#{self.class}.#{v[:name]} #{v[:options][:message]}\" unless\n v[:proc].call(send(v[:name]))\n ... |
1911e3fcfc143e5eebc65c896df5fb3b | Write an db attribute by string | [
{
"docid": "ced580a53f05dbf4f4f358845107f8f9",
"score": "0.0",
"text": "def test_write_access_db_symbol\n source = Source.new('http://localnode.org/something')\n source['uri'] = \"http://somethingelse.com/\"\n assert_equal(source.uri.to_s, \"http://somethingelse.com/\")\n end",
"ti... | [
{
"docid": "685ea82e2f28facd7b21c4c69f713476",
"score": "0.72009414",
"text": "def write_set_attribute(attribute_name, value)\n column_type = ((column_definition = self.class.columns_hash[attribute_name.to_s]) and column_definition.type)\n value = value.to_s(10) if column_type == :string\n ... |
53ee9acba7ad1dc6c702741bd1377346 | Override the directory where uploaded files will be stored. | [
{
"docid": "8d10fdc58da6fc802a5656726074ca32",
"score": "0.0",
"text": "def store_dir\n \"contacts/organizations/#{model.id}\"\n end",
"title": ""
}
] | [
{
"docid": "48ba4e84d748233102af81a1eeea1cc9",
"score": "0.7736816",
"text": "def store_dir\n 'uploads'\n end",
"title": ""
},
{
"docid": "48ba4e84d748233102af81a1eeea1cc9",
"score": "0.7736816",
"text": "def store_dir\n 'uploads'\n end",
"title": ""
},
{
"docid":... |
436a2d00fcf2814fd4eff3d8ddd5cee7 | Initialize a new Request. | [
{
"docid": "a98ab91810382a559d625c9c510834f1",
"score": "0.0",
"text": "def setup_request\n controller.send(:include, ::Rails.application.routes.url_helpers)\n\n ## Setup request\n @request = Request.new(name)\n @request.setup_mocks\n @request.set_controller(controller... | [
{
"docid": "ac789f948f9f229ff8ff0bee16e78dc3",
"score": "0.7756203",
"text": "def initialize(request)\n @request = request\n end",
"title": ""
},
{
"docid": "fbcd9fd6b355bc84e1837069b31dc206",
"score": "0.7740094",
"text": "def initialize( request ); @request = request ; ... |
a2a6206ef957fab91fadacd8588555a4 | this method will return the current user | [
{
"docid": "075e453bc3ed349e2c028d45825a4d50",
"score": "0.8177961",
"text": "def current_user\n \t@current_user || User.find(session[:user_id]) if session[:user_id]\n end",
"title": ""
}
] | [
{
"docid": "2401c0ada550ab6dae685b3824d74b99",
"score": "0.8638211",
"text": "def current_user\n get_from_options_or_controller(:current_user)\n end",
"title": ""
},
{
"docid": "44ad9ea14abcc5a7bda5f5ef89706e43",
"score": "0.8621433",
"text": "def current_user\n\t\t\tUser.fin... |
3f0af1f363663be65edfb2c553da8d66 | url_extention: '', request_body: '', post: false | [
{
"docid": "3563dd5b770f9b80dbe302ff7b1678fa",
"score": "0.0",
"text": "def api(options ={})\n\n (delete = true) if options[:delete]\n (post = true) if options[:post]\n packet_url = \"#{@packet_url}#{options[:url_extention]}\"\n # this next line will make the tests fail\n # p \"full url: ... | [
{
"docid": "5a5aed3d086fb893a1279e36be6cf26f",
"score": "0.7087962",
"text": "def req_post_form\n\n end",
"title": ""
},
{
"docid": "5a5aed3d086fb893a1279e36be6cf26f",
"score": "0.7087962",
"text": "def req_post_form\n\n end",
"title": ""
},
{
"docid": "4541b3e75a0be5c4... |
728b31014f4bc83dda24510b7fdaaaf2 | Test tokenisation of the ( operator | [
{
"docid": "e5f4ed162ac7e96c9c0e342c50a953d6",
"score": "0.67233396",
"text": "def test_right_parenthesis_token\n assert_tokenises_as ')', RightParenthesisToken.instance\n assert_tokenises_as ' )', RightParenthesisToken.instance\n assert_tokenises_as ' ) ', RightParenthesisToken.instance\... | [
{
"docid": "49d1b695545e995192edea5066902a0a",
"score": "0.70757437",
"text": "def open_parenthesis\r\n @scanner.scan(/[(]/)\r\n end",
"title": ""
},
{
"docid": "bb3437a96f53ffb3f9ba1892caae8547",
"score": "0.7032424",
"text": "def test_left_parenthesis_token\n assert_tokeni... |
778d4d33c819fdd74c74c3a82d4d9a21 | Increases or decreases the space between words. For horizontal text, a positive value will increase the space. For veritical text, a positive value will decrease the space. | [
{
"docid": "f7b562d08cf4e0e945efebaf0c71e83f",
"score": "0.6303163",
"text": "def word_spacing(amount = nil)\n return defined?(@word_spacing) && @word_spacing || 0 if amount.nil?\n original_word_spacing = word_spacing\n if original_word_spacing == amount\n yield\n el... | [
{
"docid": "1e49dc93517fd59746ea884afbceae40",
"score": "0.6720057",
"text": "def word_spacing_for_this_line\n if @align == :justify &&\n @line_wrap.space_count > 0 &&\n !@line_wrap.paragraph_finished?\n (@width - @line_wrap.width) / @line_wrap.space_count\n... |
3788448fea1faf1cefbc355f49f5739e | Raise an exception unless the provided data is given as an array. | [
{
"docid": "5433d88ed38d981bf1d807ac22b78adb",
"score": "0.76023763",
"text": "def validate_data_format\n unless data.is_a?(Array)\n raise DataFormatError, \"Data set(s) should be given as an array\"\n end\n end",
"title": ""
}
] | [
{
"docid": "ceb5b2c03cb66307020b26ad6bd6fe25",
"score": "0.703559",
"text": "def check_array(object)\n raise Algolia::AlgoliaError, 'argument must be an array of objects' unless object.is_a?(Array)\n end",
"title": ""
},
{
"docid": "5c788b3d0c575479dcee762420b54f3a",
"score": "0.6670... |
39893d22ec1a06263a937d3d1fb16c5f | Defaults to the boolean'ed result of "call" | [
{
"docid": "0dc3201b9d4ac38110dde62cf5f4ba1d",
"score": "0.0",
"text": "def success?\n raise RuntimeError, \"#success or #error should be called inside #call\" unless @pristine\n raise RuntimeError, \"both #success and #error where called\" if (@success && @error)\n @success && !@error\n ... | [
{
"docid": "d3b3e124ca08dd0adb84f3823e17a193",
"score": "0.693233",
"text": "def single_call?\n true\n end",
"title": ""
},
{
"docid": "46c027b6d82a6989d800a2dccca67905",
"score": "0.6894621",
"text": "def will_call?\n return true\n end",
"title": ""
},
{
"doc... |
424c12f30a584d99e8db3cd6e655a7c3 | GET /personal_data/1 GET /personal_data/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "5e3f7963f7ba40c85098d38dd1f6408b",
"score": "0.6854812",
"text": "def show\n @personal_info = current_user.personal_info\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @personal_info }\n end\n end",
"title": ""
},
{
"... |
760cc929aabf508130b2df26e12c001f | Ensure a fixed number of unitprices show up in the form. | [
{
"docid": "fbb7a154c4d010be518f2655f306dd3b",
"score": "0.6242579",
"text": "def build_unitprices(product)\n i = product.unitprices.count\n while (i < 8) do\n product.unitprices.build(price: '')\n i += 1\n end\n end",
"title": ""
}
] | [
{
"docid": "c6d303c10d8e144d3b005be89e9c3fb4",
"score": "0.5466684",
"text": "def price_in_five_centimes\n if price and price % 0.05 != 0.0\n errors.add(:price, \"Price must be in 0.05 steps.\")\n end\n end",
"title": ""
},
{
"docid": "677a28c6bcf86c992237982cea5aaccf",
"scor... |
029021e3d382891b44a91be9cdcfb773 | POST /exposures POST /exposures.xml | [
{
"docid": "8fc55857dd99610f3dd045facb9c755c",
"score": "0.0",
"text": "def create\n @exposure = Exposure.new(params[:exposure])\n\n respond_to do |format|\n if @exposure.save\n \n if !params[:file_data].nil? #start save image\n @image = Image.new\n @image.file_dat... | [
{
"docid": "0a5a2643407410fdf991fdc4e9c3ba6f",
"score": "0.61958396",
"text": "def index\n @exposures = Exposure.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @exposures }\n end\n end",
"title": ""
},
{
"docid": "8eace452ebdf... |
064a33bf04a41acb7e3a77ac328e41ae | flattens/serializes the cart and saves in cookies | [
{
"docid": "dd9c3bfc3943db4454648c674ed98e10",
"score": "0.71429217",
"text": "def save_cart\n cookies[:cart] = @cart.save\n end",
"title": ""
}
] | [
{
"docid": "44724c1508b199afc9d2110af2a25ad5",
"score": "0.74666524",
"text": "def save_cart\n session[:cart_json] = @cart.to_json\n end",
"title": ""
},
{
"docid": "d859c0f19a593d0be2902af7aef2b5b5",
"score": "0.69144404",
"text": "def save\n @session[\"store_#{@store.id}\"][... |
2ab5e29597a137a30977777b6f57a407 | Board update updates the cells in the board with the player token according to the input | [
{
"docid": "e907cce43a2c99ca2b36a4c1051f6239",
"score": "0.79631644",
"text": "def update(input, player)\n cells[input.to_i-1] = player.token\n end",
"title": ""
}
] | [
{
"docid": "fdefcab7db677214c72bda4d48c0207d",
"score": "0.8180263",
"text": "def update(input, player)\n input = input.to_i\n\t\tif valid_move?(input) # Check for a valid move\n\t\t\t cells[input-1] = player.token # Update the cell of the board with the player's token\n\t\tend\n\tend",
"title": ... |
55500b271036fb783b2443b2cf082785 | Problem 5 Project Euler | [
{
"docid": "9db8632d8222d994d169badd4eb8ecca",
"score": "0.0",
"text": "def gcd(x, y)\n x == 0 ? y : gcd(y % x, x)\nend",
"title": ""
}
] | [
{
"docid": "1305eb834a0f4250ae9efdc86518bd8d",
"score": "0.8304462",
"text": "def euler1\n sum = 0;\n 1..1000.times do |x|\n y = x + 1\n if (x % 3).zero? || (x % 5).zero?\n sum = sum + x\n end\n end\n p sum\nend",
"title": ""
},
{
"docid": "e53e46ecc55dc51b3e4d1f9413d85e07"... |
fe813e984690eadbe1f6dc9e6aa3f703 | Workaround for passthru method not working in original form | [
{
"docid": "365712629a20de0faf9075ff83654594",
"score": "0.0",
"text": "def devise_omniauth_callback(mapping, controllers)\n path, @scope[:path] = @scope[:path], nil\n path_prefix, callback_prefix = Devise.omniauth_path_prefix, \"/#{mapping.path}/auth\".squeeze(\"/\")\n set_omniauth_path_prefix... | [
{
"docid": "af491e959b1173d009ee06b6bd7d03c2",
"score": "0.74534076",
"text": "def passthru\n super\n end",
"title": ""
},
{
"docid": "30612f5c1a290703d57cfab7717516af",
"score": "0.7221251",
"text": "def passthru\n super\n end",
"title": ""
},
{
"docid": "d1b7e... |
ed4b89d33cf1a167071f5bfc71f2aa77 | Check if there are some filters defined | [
{
"docid": "1b45c05853fedc7ffc13dcc2ffe313eb",
"score": "0.80091274",
"text": "def has_filters?\n options[:filter_specs] or options[:filter_facts] or options[:filter_hiera] or options[:filter_examples]\n end",
"title": ""
}
] | [
{
"docid": "f4f2de8172df7d8d85af39fe2139ab03",
"score": "0.8288538",
"text": "def has_filters?\n @filters.nil? ? false : @filters.filters.size > 0\n end",
"title": ""
},
{
"docid": "4b394238781ea859d9f0ec441e14d3d2",
"score": "0.79949933",
"text": "def is_filtered?\r\n fil... |
4e3417046083c7ad1e55ae40624e8db7 | POST /ankens POST /ankens.json | [
{
"docid": "6c70412cd26799da1eec3ca74193cf7d",
"score": "0.6011435",
"text": "def create\n @anken = Anken.new(anken_params)\n\n respond_to do |format|\n if @anken.save\n format.html { redirect_to @anken, notice: 'Anken was successfully created.' }\n format.json { render action: ... | [
{
"docid": "d4f129332c2e5103e12602642a4558af",
"score": "0.66001177",
"text": "def create\n @anketum = Anketum.new(params[:anketum])\n\n respond_to do |format|\n if @anketum.save\n format.html { redirect_to @anketum, notice: 'Anketum was successfully created.' }\n format.json { ... |
554ab3e37a9d52a9404910a905fe6a4e | Retourne la date humaine avec l'heure de +time+ (secondes) | [
{
"docid": "6589ffe898f4cb946fc11029791283d1",
"score": "0.65054035",
"text": "def jouretheure time\n time.as_human_date(true, true, ' ', 'à')\n end",
"title": ""
}
] | [
{
"docid": "2ec4784acebd4f0c03e2ec7334dc8df8",
"score": "0.6940437",
"text": "def hora_geracao\n Time.current.strftime('%H%M%S')\n end",
"title": ""
},
{
"docid": "2ec4784acebd4f0c03e2ec7334dc8df8",
"score": "0.6940437",
"text": "def hora_geracao\n Time.curre... |
8075e08c70961af622def64aaf0022c2 | exclude_all_optimizations: !class/marking/final,!class/merging/vertical,!class/merging/horizontal,!field/removal/writeonly,!field/marking/private,!field/propagation/value,!method/marking/private,!method/marking/static,!method/marking/final,!method/removal/parameter,!method/propagation/parameter,!method/propagation/retu... | [
{
"docid": "19344e896b7b253d5d4a01612c438a03",
"score": "0.0",
"text": "def proguard_invoke(list)\n return [] if (!(File.exists?(\"./local/proguard\")));\n \n loop1 = list.map{ |outjar, entry_class, options|\n proguard_helper(\"complete\", outjar, entry_class, options);\n };\n \n loop2 = list.m... | [
{
"docid": "97a2de505795ad19c1a184ef3c58f4b8",
"score": "0.6401537",
"text": "def should_minify\r\n false\r\n end",
"title": ""
},
{
"docid": "11b5f3b7515a3a0f1772addad2553db0",
"score": "0.6230008",
"text": "def exclusions; end",
"title": ""
},
{
"docid": "11b5f3... |
34eeff47f58eb59971c763b8551931f8 | PUT /music_albums/1 PUT /music_albums/1.xml | [
{
"docid": "de6c8a7d53183d9fda9bc0049b318688",
"score": "0.6444244",
"text": "def update\n @music_album = MusicAlbum.find(params[:id])\n\n respond_to do |format|\n if @music_album.update_attributes(params[:music_album])\n flash[:notice] = 'MusicAlbum was successfully updated.'\n ... | [
{
"docid": "86643bd4bca8c7d89ab162dacda9f330",
"score": "0.65134263",
"text": "def update\n @album.update(album_params)\n respond_with(@album, location: albums_url)\n end",
"title": ""
},
{
"docid": "a64ea2151b8360cea0fe97ce1705b3a4",
"score": "0.64129645",
"text": "def picasa... |
fe1313d3ad41ab31df691a61c152bb0b | Replace this with your real tests. | [
{
"docid": "e657e2ff1f4a5b818b59d0d253548c3f",
"score": "0.0",
"text": "def test_truth\n assert_kind_of IcdCategory, @icdcategory\n assert_equal @myicdcategory.id, @icdcategory.id\n assert_equal @myicdcategory.description, @icdcategory.description\n assert_equal @myicdcategory.level, @icdcat... | [
{
"docid": "16a6d5e8eabd975007f205c109c50890",
"score": "0.7378937",
"text": "def testing; end",
"title": ""
},
{
"docid": "1068832c8229c37488788b46a0871f26",
"score": "0.6994956",
"text": "def testing\n end",
"title": ""
},
{
"docid": "8fbc98d9068bd9c82033a031286f0a1e",... |
0d32eb98f6fda1745a23b5c1e1fbdaab | DELETE /tests/1 DELETE /tests/1.json | [
{
"docid": "0d8b71f9491ccace6c14572bb92ed219",
"score": "0.0",
"text": "def destroy\n #@test.destroy\n test_group = @test.test_group\n @test.test_group = TestGroup.trash\n @test.soft_delete!\n\n respond_to do |format|\n format.html { redirect_to test_group, notice: 'Тест успешно удал... | [
{
"docid": "0ebbbb9cff7cbece892b41de7f4c7a12",
"score": "0.7729814",
"text": "def destroy\n @test.destroy\n respond_to do |format|\n format.html { redirect_to tests_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fec89fa055a43f61d2f98a3c... |
487e66a4975dd7170768aafaa10dddb1 | POST /Users POST /Users.xml | [
{
"docid": "8d84d0988373568152e07db27c23b2ba",
"score": "0.0",
"text": "def create\n @user = User.new(params[:user])\n\n # render :update do |page|\n # if @user.save\n # page.alert('sucess create')\n # else\n # page.alert(@user.errors.full_messages.join(\"\\n\"))\n # e... | [
{
"docid": "a57ccf1a5b27f3e307e4b283d3837c14",
"score": "0.6739103",
"text": "def add_user(name, email)\n post \"/api/users.xml\", {:user => {:name => name, :email => email}}\n end",
"title": ""
},
{
"docid": "81f820aba49ac09ba424a3c44ecb4bf8",
"score": "0.6480226",
"text": "... |
040f40f4d210a5388cfe12d481be9ad1 | all methods that follow will be protected methods | [
{
"docid": "2a5d5b46a63c804a33474e5ed4c393f2",
"score": "0.7883592",
"text": "def protected_method\n\tend",
"title": ""
}
] | [
{
"docid": "df85ac1f005a02e13e7893d1864d79ed",
"score": "0.7705474",
"text": "def protected_method\n end",
"title": ""
},
{
"docid": "44f2a566091b9ea8bffad7d05aac7b7c",
"score": "0.7691868",
"text": "def method2 # will be 'protected'\n #...\n end",
"title": ... |
3e2b7d2f6d3d1fb456c6b9f4cc60672d | Display a list of users you know and their key status. No arguments. | [
{
"docid": "f9e7979e14ed2e4971c3e3b6546e7c5f",
"score": "0.0",
"text": "def local_keys(body)\n disp = \" -- Registered Accounts --\\n\"\n disp << \"Name: RSA Fingerprint: Status:\\n\"\n @var[:user_keys].each do |name,key|\n key_hash = MD5::digest(key)[0,8]\n fingerprint = _fingerpri... | [
{
"docid": "9df7a8c4deaba0620442225f287e8ed4",
"score": "0.6861737",
"text": "def list_users\n tp @users, :real_name, :slack_id, :user_name => {:display_method => :name}\n end",
"title": ""
},
{
"docid": "b13705a7a49e3f4a5b64aede28a4fa68",
"score": "0.6839115",
"text": "def v... |
ec10c389520959a7c97af468971e510d | returns assets, along with some metainformation (FY) | [
{
"docid": "61b9156a2701714f806d043cdba16993",
"score": "0.0",
"text": "def get_data(organization_id_list, params)\n\n Rails.logger.debug \"In CapitalProjectsReport\"\n Rails.logger.debug organization_id_list.inspect\n Rails.logger.debug params.inspect\n\n output = CapitalProjectReportPresen... | [
{
"docid": "bd737a412c952ad7c14ac51c71909257",
"score": "0.5443833",
"text": "def yearly\n if (params[:date] != nil && params[:date][:year] != nil)\n year = params[:date][:year].to_i\n else\n year = Date.today.year\n end\n\n @date = Date.civil(year, 1, 1)\n\n startDay = Date.civ... |
da10a78f6e98f6183ca94a85807b76c2 | Move a target specified with targetName to a new target group specified with newTargetGroupName | [
{
"docid": "08076787696139c04218fb664674f337",
"score": "0.6281193",
"text": "def move_target_to_target_group_post(move_target_to_target_group_param, opts = {})\n data, _status_code, _headers = move_target_to_target_group_post_with_http_info(move_target_to_target_group_param, opts)\n return da... | [
{
"docid": "507675b865f82f79e1562bd54115d674",
"score": "0.6549269",
"text": "def move_target_to_target_group_post_with_http_info(move_target_to_target_group_param, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: SANApi.move_target_to_target_grou... |
dc80137dbe3df1783c389c19cdb6a9bb | GET /ingredientes or /ingredientes.json | [
{
"docid": "b14f2dbe334b034f1bac6ad31ca20f9e",
"score": "0.70175505",
"text": "def index\n @ingredientes = Ingrediente.all\n end",
"title": ""
}
] | [
{
"docid": "17ac0138f84efd9e72293afa14686247",
"score": "0.7361687",
"text": "def by_ingredient\n # redirect_non_users\n \n user = User.find_by(id: params[:user_id])\n \n # If ingredient exists, find recipes that use it\n if Ingredient.exists?(params[:id])\n ingredient = Ingredi... |
6378fb02174a10f6f4b2f23955b84597 | PATCH/PUT /client_contacts/1 PATCH/PUT /client_contacts/1.json | [
{
"docid": "7695ccafed14737f7ba52964b7fd2337",
"score": "0.6261063",
"text": "def update\n respond_to do |format|\n if @client_contact.update(client_contact_params)\n client_contact_hash()\n format.html { redirect_to @client_contact, notice: $gcMsgUpdateRecord }\n format.jso... | [
{
"docid": "855440faaba0a7cfdb81a68c63890c00",
"score": "0.74396396",
"text": "def update\n\n params[:client][:contact_ids] ||= []\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to @client, not... |
7ee1deaf0963b20ad7cdc9e30fdb3691 | Updates the scores of the specified game to the specified home & away scores, and also marks any bets on that game either correct or incorrect, based on the updated score. If a bet is marked incorrect, then the entry is killed if it's already alive. | [
{
"docid": "ee097c64d568e992d83163e7330a19c0",
"score": "0.8202915",
"text": "def update_score_for_game(nfl_game, home_score, away_score)\n if !home_score.nil? && !away_score.nil?\n error_message = nil\n if nfl_game.update_attributes({ home_score: home_score, \n ... | [
{
"docid": "1be22518ea7229ead2f6ca93c4030785",
"score": "0.73492235",
"text": "def update_games\n rev_guesses.each do |rg|\n sum = 0\n sum += 2 if rg.result == result\n sum += 1 if rg.home_goals == home_goals\n sum += 1 if rg.away_goals == away_goals\n sum += 1 if (rg.home_go... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "e9fe2188179b03f34b42666d79623323",
"score": "0.0",
"text": "def set_team_assignment\n @team_assignment = TeamAssignment.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... |
38d858a9a29f95e097b83d1cd5acb9de | Returns a singularized version of self. | [
{
"docid": "4fad567f8565d9a8c8b6064df1969e4c",
"score": "0.77219754",
"text": "def singularize\n self.class.new Inflector.singularize(self)\n end",
"title": ""
}
] | [
{
"docid": "26bb50d76ae24013abf248a4fdfa1025",
"score": "0.797496",
"text": "def singularize\n self[-1] == 's'[0] ? self[0,self.length-1] : self.dup\n end",
"title": ""
},
{
"docid": "8b0c6c434bf8b917f8f24ca32b39905d",
"score": "0.74774796",
"text": "def singulars\n @s... |
4054685147c2644694078a98b41306e3 | kp: todod: remove duplicatino here with some meta programming | [
{
"docid": "99c1e8914ec8a819c474e105dc785772",
"score": "0.0",
"text": "def due\n chain lambda{ | n | n.respond_to?( :due? ) && n.due? }\n end",
"title": ""
}
] | [
{
"docid": "bc658f9936671408e02baa884ac86390",
"score": "0.6146687",
"text": "def anchored; end",
"title": ""
},
{
"docid": "06b284a85c524f4a33b3c8ae0947c53f",
"score": "0.6016756",
"text": "def silly_adjective; end",
"title": ""
},
{
"docid": "7956513912484ac0bf757a8a03f... |
74c81ba87a5ac51455ae9a4fa1c22ce6 | This part may be confusing. | [
{
"docid": "726b37002f947e1189f2ecf6b02219a4",
"score": "0.0",
"text": "def add_methods\n # Gaining access to private method of Class\n method_me = AlgoClient.method(:define_method)\n \n @methods.each do |method_name, options|\n \n # define the method on the class\n method_me.... | [
{
"docid": "b6b2bcc0062aeb115edab7b10cbe6930",
"score": "0.67927915",
"text": "def desired; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.65814424",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3"... |
e0f7b32add8221cb50305fcae2a78e32 | split number into single digits with num.digits.reverse multiply numbers together using inject(:) if new_num.size > 1 then repeat process else return num returns a single digit number | [
{
"docid": "3f0064a82708dac7c57d7c688ea4a168",
"score": "0.6272055",
"text": "def persistence(number)\n counter = 0\n num = number.digits.reverse\n loop do\n break if num.size == 1\n num = num.inject(:*).digits\n counter += 1\n end\n\n counter\nend",
"title": ""
}
] | [
{
"docid": "18b27428f71c7e9961b68505c1c34c85",
"score": "0.6753616",
"text": "def expanded_form(num)\n results = []\n list_of_chars = num.to_s.chars\n \n list_of_chars.each_with_index do |number, index|\n if number == '0'\n next\n else\n times_by = '1' \n list_of_chars.slice(ind... |
bed466f700fc5746e882147773a4f8be | Set xPosition: setter guards against any move that would take the robot off the board | [
{
"docid": "c6768d427da0f402d1a21a00c21859eb",
"score": "0.8081984",
"text": "def xPosition=(x)\n if x < 0 || x > 4 \n \tputs \"Sorry, that command would put the robot off the table. Command Ignored.\"\n else\n @xPosition = x\n ... | [
{
"docid": "d72e2d7da3d8b17be606a1e308860691",
"score": "0.69086534",
"text": "def x=(x)\r\n @x = x\r\n if @game_area\r\n @x = @game_area.x if @x < @game_area.x\r\n @x = @game_area.width-$window.width if @x > @game_area.width-$window.width\r\n end \r\n ... |
ae803f38297acf7ab741062acbc57a5c | save meta value with client | [
{
"docid": "eb68abc2b1a833d0780c19d94ba01991",
"score": "0.66954076",
"text": "def save_meta_value\n company.metadata.active.each do |md|\n case md.field_type\n when 'dropdown'\n meta_value = select_values.where(metadatum_id: md.id).first_or_initialize\n when 'textfield'\n ... | [
{
"docid": "55d4243817af7bfe0eca96d2875613e1",
"score": "0.6404643",
"text": "def set_meta\n puts 'meta'\n end",
"title": ""
},
{
"docid": "5daebd7dfb95052fb9bf15dd4c01cd19",
"score": "0.6377681",
"text": "def save\n self.metadata[:type] = :metagenome if !metad... |
1f8f8d539bece92d042d9356a306503f | Returns a rotated and/or expanded image, without modifying the reciever. | [
{
"docid": "8e4e34af54a6bcd6b11c23978acd3ce2",
"score": "0.0",
"text": "def rotozoom(angle, zoom, smooth=false)\n new_image = self.class.new(@sdl_surface)\n new_image.rotozoom!(angle, zoom, smooth)\n end",
"title": ""
}
] | [
{
"docid": "c7d0fb80f965550af74da625c4a10750",
"score": "0.6859862",
"text": "def rotate\n minimagick! do |img|\n img.auto_orient\n img = yield(img) if block_given?\n img\n end\n end",
"title": ""
},
{
"docid": "3e3383ee7b14b47de403343692fcfa01",... |
a2099a77c85e91272ae2f9e35b937953 | Only allow a trusted parameter "white list" through. | [
{
"docid": "abecfa4494d8fdbdf8439b18563c34cc",
"score": "0.0",
"text": "def user_group_params\r\n params.fetch(:user_group, {}).permit(:name, :description)\r\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7943618",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "f6060519cb0c56a439976f0c978690db",
"score": "0.69572574",
"text": "def permitted_params\n params.permit!\n end",
"title"... |
6a3615d2736b1ca3ec89b06cecdeb572 | PUT /option_groups/1 PUT /option_groups/1.json | [
{
"docid": "8171c074d7d469e319dcb09ca4cb7214",
"score": "0.7484402",
"text": "def update\n respond_to do |format|\n if @option_group.update_attributes(params[:option_group])\n format.html { redirect_to option_groups_path, notice: t('controller.success.update', :thing => t('activerecord.mo... | [
{
"docid": "4d251e3e4ab9baf0511bd31182961095",
"score": "0.7217451",
"text": "def update\n respond_to do |format|\n if @option_group.update(option_group_params)\n format.html { redirect_to @option_group, notice: 'Option group was successfully updated.' }\n format.json { head :no_co... |
d67bd6df8daffb1f6b52314b0451c419 | GET /report_tasks/1 GET /report_tasks/1.xml | [
{
"docid": "83dd785a1239426f944d07d8ea991d60",
"score": "0.7198111",
"text": "def show\n @report_task = ReportTask.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @report_task }\n end\n end",
"title": ""
}
] | [
{
"docid": "3ea88b87f22e27fa9dfbed18bfb0ad4f",
"score": "0.73279244",
"text": "def report_todo\n @tasks = Task.next_week.per_project\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tasks }\n end\n end",
"title": ""
},
{
"docid": "... |
84dc797c6c8cfe59a16e935a20b5a05d | Update the plan on Stripe. It only updates the plan's name on Stripe. | [
{
"docid": "08fc322806a75cd14a037e1f48df514e",
"score": "0.83576596",
"text": "def update_stripe_plan!\n plan = stripe_plan\n plan.name = self.name\n plan.save\n\n plan\n end",
"title": ""
}
] | [
{
"docid": "9978e4cf27528cd285d0b2dbc664936b",
"score": "0.83175033",
"text": "def update\n \n if @plan.update!(plan_params)\n begin\n statement_descriptor = @plan.statement_descriptor == '' ? nil : @plan.statement_descriptor\n \n plan = Stripe::... |
10f3f0a8f7a37512ecf08892eca76ddc | Retrieve the requested pagination params or use defaults only allow 100 per page as the max | [
{
"docid": "dafbbd9b9c06fe74b9fd1b126a1e4ef1",
"score": "0.79139996",
"text": "def pagination_params\n max_per_page = Rails.configuration.x.application.api_max_page_size\n @page = params.fetch('page', 1).to_i\n @per_page = params.fetch('per_page', max_per_page).to_i\n @per_pa... | [
{
"docid": "da20e19431f6503aee44bcc03e464162",
"score": "0.7981356",
"text": "def pagination\n if params[:offset].present?\n @offset = params[:offset].to_i\n end\n if params[:limit].present?\n @limit = params[:limit].to_i\n end\n @offset ||= 0\n @limit ||= 20\n end",
"t... |
bd59cdf907192da1b7b2c3891bb17d33 | Escape a string of SQL with a set of arguments. The first argument is assumed to be the SQL to escape, the remaining arguments (if any) are assumed to be values to escape and interpolate. ==== Examples escape_sql("SELECT FROM zoos") => "SELECT FROM zoos" escape_sql("SELECT FROM zoos WHERE name = ?", "Dallas") => "SELEC... | [
{
"docid": "3dd1df94532b9f1b34cde96251aeab08",
"score": "0.7876167",
"text": "def escape_sql(args)\n return @text if args.empty?\n sql = @text.dup\n vars = args.dup\n\n replacements = 0\n mismatch = false\n\n sql.gsub!(/'[^']*'|\"[^\"]*\"|`[^`]*`|\\?/) do |x|\n n... | [
{
"docid": "b6d578312363f4530762580a15f46328",
"score": "0.6111867",
"text": "def sanitize_sql(*args)\n klass.send(:sanitize_sql, args)\n end",
"title": ""
},
{
"docid": "25a4365af2f38780e4bf9fe4d901fb84",
"score": "0.60867226",
"text": "def escaped_sql\n sql % binds... |
efd6d0a16a34f1f4ff85e2917a2e4f07 | Capitalize Words Given: string Return: new string, copy of old string with first letter if each words capitalized Rules: word = any sequence of nonblank chars, only need to consider first chars think I can split into an array, capitilize each string in the array, then join to new array | [
{
"docid": "7595c281048f7bb42a6e0a5042d91321",
"score": "0.773702",
"text": "def word_cap(string)\n string.split.map(&:capitalize).join(\" \")\nend",
"title": ""
}
] | [
{
"docid": "bcd27935d98fe3e2c34d66135125183d",
"score": "0.8210331",
"text": "def word_cap(str)\n working_array = str.split(' ').each do |word|\n word.capitalize!\n end\n\n working_array.join(' ')\nend",
"title": ""
},
{
"docid": "52c7cfd30c75c5c9bae46178ce21b175",
"score": "0.8175... |
b84ff8a408a645d97270b4e318c30bad | PATCH/PUT /properties/1 PATCH/PUT /properties/1.json | [
{
"docid": "38801baa290bd7aa7de51b7ba430fd05",
"score": "0.0",
"text": "def update\n # respond_to do |format|\n # if @property.update(property_params)\n # format.html { redirect_to @property, notice: 'Property was successfully updated.' }\n # format.json { render :show, sta... | [
{
"docid": "f6c4eafa4f48a0c81157fb03ff350901",
"score": "0.7228539",
"text": "def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"title": ""
},
... |
1b93133612f6054171b7747b762d3fbc | remove array dups concisely | [
{
"docid": "c4e55b49d9d68ba4cdae5a572bd46146",
"score": "0.0",
"text": "def unique(array)\n array.uniq\nend",
"title": ""
}
] | [
{
"docid": "3886aefcab850b4b8f87f5ff36e83c1d",
"score": "0.8324869",
"text": "def array_remove_duplicates(arr)\n arr.uniq\n end",
"title": ""
},
{
"docid": "a08c7aebe9251dc0dd3fed7c1201525e",
"score": "0.8050476",
"text": "def remove_duplicates(arr)\n arr.uniq!\nend",
... |
d1f0a94df5784f9a6e44fd997f90814e | def create_invest(amount, product, user) op = AccountOperation.new(:op_name => "invest", :op_action => "join", :op_amount => amount, :operator => "system",:uinfo_id => user.user_info.id, :op_resouce_name => product.deposit_number, :op_resource_id => product.id) op.execute_transaction end | [
{
"docid": "85f4d35af7ecdfce5a9dbf20cc814481",
"score": "0.9694023",
"text": "def create_invest(amount, product, user)\n op = AccountOperation.new(:op_name => \"invest\", :op_action => \"join\", :op_amount => amount, :operator => \"system\",:uinfo_id => user.user_info.id,\n ... | [
{
"docid": "62322c0a8bf0282f6cad464be5572779",
"score": "0.68153524",
"text": "def create\n @user = User.find(session[:user_id]) if session[:user_id]\n stock_symbol = investment_params[:symbol].upcase\n @stock = Stock.find_by(symbol: stock_symbol)\n value = investment_params[:number_of_share... |
a28e478681ac9d29c5dd796aa824781d | PATCH/PUT /users/1 PATCH/PUT /users/1.json | [
{
"docid": "2c0b5e3dfe96c3aa7c94ece7d5fc955b",
"score": "0.0",
"text": "def update\n respond_to do |format|\n if @user.update(user_params)\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { render :show, status: :ok, location: @user }\n ... | [
{
"docid": "23a904e6ddd4b6b07c4b53353e78cf93",
"score": "0.7225568",
"text": "def update\n render json: User.update(params[\"id\"], params[\"user\"])\n end",
"title": ""
},
{
"docid": "4781fa7337315133553edb54194e6202",
"score": "0.7129473",
"text": "def update\n render json: ... |
d9d4f3c3856fff8216fc0694c407ff44 | Match end notification match_points: array of pairs name>points e.g [["rudy", 21], ["zorro", 5]] | [
{
"docid": "711495828a405fa3e6e65ad13e98e4e8",
"score": "0.6169783",
"text": "def onalg_game_end(match_points)\r\n #p match_points\r\n winner = match_points[0]\r\n loser = match_points[1]\r\n str = \"Vince la partita: #{winner[0]}\\n\" \r\n str += \"#{winner[0]} punti #{winner[1]}\\n\"\r... | [
{
"docid": "1c36ad7207c68857d9583b2d65455bf7",
"score": "0.6347589",
"text": "def match_result \n\t\t[match_x, match_y]\n\tend",
"title": ""
},
{
"docid": "8f59a03001bb0b1b455b992dd513758f",
"score": "0.61143166",
"text": "def receive_match(position_1, position_2); end",
"title":... |