query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "9679f074d7e6be735da73e32f9bba4e3", "score": "0.0", "text": "def asset_params\n params.require(:asset).permit(:user_id, :uploaded_file, :folder_id, :parent_id, :shared_email, :shared_user_id, :message)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7496024", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69581187", "text": "def strong_params\n params.require(:request).permit(param_whit...
a367730024533dcac0a7beced22fcedb
given an order argument, returns an array of pairs, with each pair containing the attribute, and :asc or :desc
[ { "docid": "b56541a7e36c65a97db110fb67967225", "score": "0.6775327", "text": "def normalize_order(order)\n order = Array(order)\n\n if order.length == 2 && !order[0].is_a?(Array) && [:asc, :desc].include?(order[1])\n order = [order]\n else\n order = order.map {|pair| pair.is...
[ { "docid": "8b1c4b0b91fc84a47fa9a008eda6e1e0", "score": "0.7775444", "text": "def attrs_to_orderings(order)\n order.map do |o|\n Arel::Attribute === o ? o.asc : o\n end\n end", "title": "" }, { "docid": "cdbc6a42bb100357ee01f94cdeb3168d", "score": "0.6...
aeea05ed6d42a496f78ba7e9101dc5e0
assigns a numeric cost to each step given a previous cost a from_state and an action action in order to reacha to_state returns previous cost + step_cost
[ { "docid": "68e80e37bb84b2226780f85f8d9f07fd", "score": "0.8178973", "text": "def path_cost(cost:, from_state:, action:, to_state:)\n cost + step_cost(from_state: from_state, action: action, to_state: to_state)\n end", "title": "" } ]
[ { "docid": "7d73d3e2c3050f4457fbe95c56c6a764", "score": "0.84995276", "text": "def step_cost(from_state:, action:, to_state:)\n raise NotImplementedError\n end", "title": "" }, { "docid": "ca5c4ebbb5723a93fceb68a3844c9030", "score": "0.78610295", "text": "def step_cos...
d03f2f95a817d9d9e1016da2e05b8f0d
another function to calculate....
[ { "docid": "2c9b3f76026a0fb505ffc42949f0cb42", "score": "0.0", "text": "def calculate_global_efficiency my_array\n @@global_efficiency = my_array.get_num_radiator * 20.0\n + my_array.get_num_ground * 180.0\n end", "title": "" } ]
[ { "docid": "50f3733b42b7b058f267c783cd6c6dd0", "score": "0.80782914", "text": "def calculated; end", "title": "" }, { "docid": "3b1962cf22cc05aa1f568f6aeaa3544f", "score": "0.8072249", "text": "def calculation\n end", "title": "" }, { "docid": "f5d3acd0ca12860719589a9974...
af53d5c7370cae29fb3d303059384af6
If 'options[:id]' has any values, this method returns SQL query text to find all Products with ID values in the array returned by the 'ids' method.
[ { "docid": "6ea1cd6f491bc4d7a0929a960da578ad", "score": "0.64157814", "text": "def ids_in\n \"p.id IN :ids\" if options[:id].present?\n end", "title": "" } ]
[ { "docid": "226fbdd0b17f2898a36988c09fd3a08f", "score": "0.5909829", "text": "def products\n if params[:ids]\n arraycheck = JSON.parse(params[:ids])\n if arraycheck.length > 0\n @products = SupplierRecord.where(contractnumber: arraycheck).joins(:product).select([\"products.id\" , \"...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "f6cd0337aece65bc0abe4fd0bcb4bf15", "score": "0.0", "text": "def short_link_params\n params.require(:short_link).permit(:base_url, :short_url, :no_of_clicks)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7496205", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6957069", "text": "def strong_params\n params.require(:request).permit(param_white...
6ddf088bea2441a6fb61b92ae82b433f
GET /searches/1 GET /searches/1.json
[ { "docid": "1b8aaa3cc348c843bd143558563f2765", "score": "0.0", "text": "def show\n if @search.industry_id.nil?\n @results = Supplier.near(@search.location)\n else\n @results = Supplier.where(\"industry_id = ?\", @search.industry_id).near(@search.location)\n end\n ids = []\n @res...
[ { "docid": "eaa758c6da9d72fdb223fbcc4e1ee752", "score": "0.7589629", "text": "def index\n @searches = @website.searches.all\n\n respond_to do |format|\n format.html #index.html.erb\n format.json { render json: @searches }\n end\n end", "title": "" }, { "docid": "6f5e1487e...
f430e27be16bf6f1e6b5306ecfb53f7f
Use ODBC format, not Microsoft format, as the ODBC layer does some translation.
[ { "docid": "db4a7a1f045aefdab1fc0ba3dbd48fdc", "score": "0.0", "text": "def literal_date(v)\n v.strftime(\"{d '%Y-%m-%d'}\")\n end", "title": "" } ]
[ { "docid": "e990702b5ee828b6c4256ae40cbd6340", "score": "0.6067609", "text": "def dbms_type_cast(columns, rows)\n # Cast the values to the correct type\n columns.each_with_index do |column, col_index|\n #puts \" #{column.name} type #{column.type} length #{column.length} nullable #...
470fe657d51538dd19e70795e650ef31
GET /schedule_rules/1 GET /schedule_rules/1.xml
[ { "docid": "b19c3bba4d83bed9c1eb8d9bb7650d83", "score": "0.6174425", "text": "def show\n @schedule_rule = @section.schedule_rules.find(params[:id])\n format_days\n \n room = find(Room, {:essid => @schedule_rule.room})\n if (room.nil?)\n @room_name = \"\"\n @building_name = \"\"\...
[ { "docid": "796140ee1215d76a3765656386f79a34", "score": "0.7282055", "text": "def live_schedule\n get('sports/en/schedules/live/schedule.xml')\n end", "title": "" }, { "docid": "7e66ce9e86062111165b222c91cfc557", "score": "0.7009574", "text": "def index\n\n sync_schedule_r...
1706f58c29e8fa5d36c4b3c2adb5cf17
rubocop:enable Metrics/CyclomaticComplexity Initialize a new source type from the provided symbol
[ { "docid": "d6effad701b6b839c3cd2383bd23f0fc", "score": "0.0", "text": "def get_type_class type\n \"Sourcerer::SourceType::#{type.to_s.classify}\".constantize\n end", "title": "" } ]
[ { "docid": "a4b1a0d1f8e93d67663f2b2f48af3ffe", "score": "0.7024537", "text": "def from(sym_source_name, &config_block)\n src = Source.new(sym_source_name, &config_block)\n add :source, src\n end", "title": "" }, { "docid": "48af586301225a13db0d0d779f31904d", "score": "0.6741...
912ee1efe8f3f60fbadb6010c23db9c3
DELETE /image_queries/1 or /image_queries/1.json
[ { "docid": "fd543bcb1c22b189b429822d9d9e34f7", "score": "0.7587463", "text": "def destroy\n @image_query.destroy\n respond_to do |format|\n format.html { redirect_to image_queries_url, notice: \"Image query was successfully destroyed.\" }\n format.json { head :no_content }\n end\n en...
[ { "docid": "c67e9be583588e7cba02427d81a65691", "score": "0.6653118", "text": "def destroy\n @image.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cacd7d6670ca40c66a97af8bd1bf447b", "score": "0.66283226", "...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "873a579ba14df133b38098f01b575c36", "score": "0.0", "text": "def info_customer_params\n params.require(:info_customer).permit(:cid, :shortName, :name, :contact, :email, :tel, :mobile_tel, :fax, :address, :zip, :bank, :bankAccountNum, :bankAccountName, :deposit, :alarmMoney, :payType, :reba...
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whit...
801bde2402c5195beb14be3b598f8e8e
TODO: this does not update when being forwarded, prolly need to access last response object directly
[ { "docid": "0eecce395fd1639d158619e494ea089c", "score": "0.0", "text": "def current_url\n @session.url\n end", "title": "" } ]
[ { "docid": "bad03e4290aac038eae292a11e9fb930", "score": "0.6534544", "text": "def process_response(response)\n return response\n end", "title": "" }, { "docid": "ecb7817284b0e436926aaf1d85deb87e", "score": "0.650599", "text": "def process_response(request, response)\n\t\t\t\t...
95fef706273bb8bacc5d9207a3a4af4a
Another way to use matcher is: Matcher.by :exact, a, b
[ { "docid": "e39ea4e85f74680066e85c922c293b5d", "score": "0.0", "text": "def by(method, a, b)\n raise \"Method must be defined\" unless method\n new(a, b).send(method)\n end", "title": "" } ]
[ { "docid": "41b834f24321a85ac16f674f2cf4804e", "score": "0.7076402", "text": "def test_and_matcher\n assert !Q?{s(:a) & s(:b)}.satisfy?(s(:a)), \"s(:a) is not both s(:a) and s(:b)\"\n assert Q?{s(:a) & s(atom)}.satisfy?(s(:a)), \"s(:a) matches both criteria\"\n end", "title": "" }, { ...
455bfb0a49c020a17c0fd0e6ca37ec5c
Action buttons.. should these be a seperate object?
[ { "docid": "549e751102b52245c9f74ab36ca80124", "score": "0.0", "text": "def action_button_groups\n @action_button_groups ||= []\n end", "title": "" } ]
[ { "docid": "0d7f03ec2daf45302a38ee77895050af", "score": "0.7066491", "text": "def on_button(button, action, mods)\n end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.69720167", "text": "def actions; end", "title": "" }, { "docid": "801bc99...
42e6eca205ce1b13b590e3195238258c
Provides summary information for a merchant&39;s online store orders. Provides summary information for a merchant&39;s online store orders.
[ { "docid": "70d94bbbc89ef47bc3fcd7aadf059fa0", "score": "0.0", "text": "def list_orders_with_http_info(location_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: V1TransactionsApi.list_orders ...\"\n end\n # verify the required parame...
[ { "docid": "d64a1cde402c599fc1b089e35a65f514", "score": "0.63393784", "text": "def show\n semantic_breadcrumb @store.name, store_path(@store)\n set_meta_tags title: @store.name\n @orders_count = @store.orders.count\n @users_count = @store.users_count\n end", "title": "" }, { "do...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "0e90773126c11894403f0f2db669aef6", "score": "0.0", "text": "def set_card\n @card = Card.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;...
eff17c3fc0a683b6d6a3ca2e7ff3ba54
CREDIT: The next three methods are almost identitical to those within Rails' ActiveRecord FixtureSet::File
[ { "docid": "cb1dd55b5e478d3cb191f52b5be7e0c9", "score": "0.0", "text": "def read_file\n begin\n data = ::YAML.load(render)\n rescue ::ArgumentError, ::Psych::SyntaxError => error\n raise FormattingError, \"a YAML error ocurred parsing #{@file}.\\nThe error was:\\n #{error.class}:...
[ { "docid": "06de56d5a62728fc2dd350d9dd97c2f3", "score": "0.6823231", "text": "def fixtures; end", "title": "" }, { "docid": "3562bea688d5c76bc8b2e9d70e0734c2", "score": "0.6715104", "text": "def fixture; end", "title": "" }, { "docid": "f9a843944d9f16d358666348cbe98301", ...
b903f2ce833641b9a6f7f5297ff4d022
POST /module/performer_manage/tender_comments POST /module/performer_manage/tender_comments.json
[ { "docid": "6170f54526a0f4b747736e62774c5b80", "score": "0.7850636", "text": "def create\n @tender_comment = Module::PerformerManage::TenderComment.new(module_performer_manage_tender_comment_params)\n\n respond_to do |format|\n if @tender_comment.save\n format.html { redirect_to @tende...
[ { "docid": "ab5011c40699e1574c79fe986a6d18e8", "score": "0.6987184", "text": "def module_performer_manage_tender_comment_params\n params.fetch(:tender_comment, {})\n end", "title": "" }, { "docid": "c03ee9412fc339422a429b92260aa577", "score": "0.6860947", "text": "def set_mod...
2886e31f95e8ea1b3bef751c1a9154bf
DELETE /fav_quotes/1 DELETE /fav_quotes/1.json
[ { "docid": "8388e832063ccbf2309bbfa846087a15", "score": "0.76681674", "text": "def destroy\n @fav_quote.destroy\n respond_to do |format|\n format.html { redirect_to fav_quotes_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "b0dfc5011300da6ed4b4f7dd646020d5", "score": "0.7511053", "text": "def destroy\n @favorite_quote.destroy\n respond_to do |format|\n format.html { redirect_to favorite_quotes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d87d7...
a9f7edd510b8753608f48716f9f5a61a
Sets the targetResources property value. Indicates information on which resource was changed due to the activity. Target Resource Type can be User, Device, Directory, App, Role, Group, Policy or Other. Supports $filter (eq) for id and displayName; and $filter (startswith) for displayName.
[ { "docid": "47030c3b4820c3f05201016599f0c3d0", "score": "0.7972633", "text": "def target_resources=(value)\n @target_resources = value\n end", "title": "" } ]
[ { "docid": "18a35ea365c4bdff2696192ca0cdc99b", "score": "0.70470554", "text": "def target_resource_id=(value)\n @target_resource_id = value\n end", "title": "" }, { "docid": "c5c5660f520190a0a74cd3bcb3f23194", "score": "0.63575566", "text": "def resources=(v...
a9b739f619d3ec2001272ddb34794fa1
PATCH/PUT /transcripts/1 PATCH/PUT /transcripts/1.json
[ { "docid": "ce1a959ab674dedfa9926ed79147b32d", "score": "0.61781013", "text": "def update\n respond_to do |format|\n if @transcript.update(transcript_params)\n format.html { redirect_to @transcript, notice: 'Transcript was successfully updated.' }\n format.json { render :show, stat...
[ { "docid": "c8b4944d42b3a770f4b2816ec6caa9ff", "score": "0.62948805", "text": "def update\n @transcript = Transcript.find(params[:id])\n\n respond_to do |format|\n if @transcript.update_attributes(params[:transcript])\n format.html { redirect_to(@transcript, :notice => 'Transcript was ...
50f9f185a7e0a4b735aeced6110bd841
Calculates hash code according to all attributes.
[ { "docid": "109292095a240470164a72cc96b22a92", "score": "0.0", "text": "def hash\n [va_id, transaction_date, value_date, va_branch_code, va_branch_name_kana, va_account_number, va_account_name_kana, deposit_amount, remitter_name_kana, payment_bank_name, payment_branch_name, partner_name, remarks, i...
[ { "docid": "08105588814074a5aed46dbb236c8d02", "score": "0.7915788", "text": "def hash_code; Digest::SHA256.hexdigest(@attributes.values.join); end", "title": "" }, { "docid": "706cbdb4c78e6b67e29589df0a4b1b5c", "score": "0.7312245", "text": "def attr_hash\n md5 = Digest::MD5.ne...
8fe900446ac6946fcb5fc3431cbf2d44
Returns an Array of explicitely defined slots document.slotnames => ["__version__","name","language","authors"]
[ { "docid": "b287b17c93c7e73da0e0b0c55b0e9982", "score": "0.62934417", "text": "def slotnames\n @slots.keys\n end", "title": "" } ]
[ { "docid": "02b139c5d06287611e87804189d47241", "score": "0.6735969", "text": "def slotList()\n return slot\n end", "title": "" }, { "docid": "f0033f894618a0e94c2b6749cb4685d7", "score": "0.6022283", "text": "def _required_slot_names\n @_required_slot_names ||= []\n ...
9665b0936439000d8fd83496fb5d1e7d
Like a moron I used full urls in some posts. Pull those out and use relative ones.
[ { "docid": "6a2622324bd31dc6e7fd684172e99b22", "score": "0.61888796", "text": "def change_self_ref_urls\n replace_with = '/words'\n re = /http:\\/\\/blog\\.swilliams\\.me\\/words/\n @content.gsub! re, replace_with\n end", "title": "" } ]
[ { "docid": "cbe0ee0fd8cde89c384440f595f6c8ca", "score": "0.67432296", "text": "def make_urls_absolute(page)\n # find things using 'src' and 'href' parameters\n tags = {\n 'img' => 'src',\n 'script' => 'src',\n 'a' => 'href'\n }\n begin\n page.search(tags.keys.join(',')).each do |...
73e4fe5f40cf428bd548824256c85a7b
GET /post208s/1 GET /post208s/1.xml
[ { "docid": "3b2d2ea04d15d60187aa83be18c2c292", "score": "0.6523031", "text": "def show\n @post208 = Post208.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post208 }\n end\n end", "title": "" } ]
[ { "docid": "e03022c24befb2baf85983257aafa262", "score": "0.6368339", "text": "def show\n @post80 = Post80.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post80 }\n end\n end", "title": "" }, { "docid": "6ced72449...
a8d1e39f35cf0cab89da480e5fef2dc9
Note: if there are preexisting instances of the parent element, when the child is deleted the parent needs to be reloaded for the parent object instance to reflect the modified database state
[ { "docid": "2fdd8e9291ed0bf1847fce62db438997", "score": "0.0", "text": "def delete!\n if parent\n parent.remove_child(id)\n @parent = nil\n end\n collection.remove(_id: id)\n self.id = nil\n true\n end", "title": "" } ]
[ { "docid": "bed67f23b70cca4b9b1cdc8094bf838a", "score": "0.7007375", "text": "def update_collection_parent\n old_parent = @collection.parent\n old_parent.delete_member_by_id(@collection.id)\n old_parent.save\n\n new_parent = find_new_parent\n new_parent.member_ids = [@collection...
e930062eec94c1846434248ecfec1d5c
DELETE /utilites/1 DELETE /utilites/1.json
[ { "docid": "3c5e4a7dc288c70a4412056c05199058", "score": "0.69633496", "text": "def destroy\n @utilite.destroy\n respond_to do |format|\n format.html { redirect_to utilites_url, notice: 'Utilite was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title...
[ { "docid": "34264605c47edda6ffe32df87c7a7266", "score": "0.6726772", "text": "def delete\n delete_from_server single_url\n end", "title": "" }, { "docid": "689d5a07a403c4b765ba178e4aff08a3", "score": "0.6719245", "text": "def delete\n client.delete(\"/#{id}\")\n end",...
8130848ab49ef747bd1f6b711dd27399
Remembers a issuer in the database for use in persistent sessions.
[ { "docid": "8a65cfa28ccc7562a0de63637854296d", "score": "0.51531905", "text": "def remember\n self.remember_token = Issuer.new_token\n # IMPORTANT! this method bypasses the validations\n update_attribute(:remember_digest, Issuer.digest(remember_token))\n end", "title": "" } ]
[ { "docid": "ca05b5de60022186b72db23d5ef7b010", "score": "0.62471366", "text": "def issuer=(value)\n @issuer = value\n end", "title": "" }, { "docid": "ca05b5de60022186b72db23d5ef7b010", "score": "0.62471366", "text": "def issuer=(value)\n @iss...
dfc66414023bcff6de8a2fe9800b85ea
Return the HTTP seperator and body string
[ { "docid": "930baf3309a071868dc40ca16bbb6c73", "score": "0.0", "text": "def set_body(bdata)\n return \"\\r\\n\" + bdata if opts['chunked_size'] == 0\n str = bdata.dup\n chunked = ''\n while str.size > 0\n chunk = str.slice!(0,rand(opts['chunked_size']) + 1)\n chunked << sprintf(\"%...
[ { "docid": "44cab242c297e0f4ea886b3c32880591", "score": "0.6844336", "text": "def raw\n headers = http_headers.map { |k, v| \"#{k}: #{v}\\r\\n\" }.join\n format \"%s %s %s\\r\\n%s\\r\\n%s\", request_method.upcase, fullpath, env[\"SERVER_PROTOCOL\"], headers, body_string\n end", "title":...
b00a474b5ea10c44321cdccc39af4a36
POST /matkas POST /matkas.json
[ { "docid": "7283f7291592432add6d0366a2f811c1", "score": "0.5997728", "text": "def create\n## @matka = Matka.new(matka_params)\n\t@matka = current_user.matkas.build(matka_params)\n\n\n respond_to do |format|\n if @matka.save\n## format.html { redirect_to @matka, notice: 'Matka was succe...
[ { "docid": "d4271e5e89be277b9a76c94f1218ca88", "score": "0.6602916", "text": "def create\n @kuldevi_matum = KuldeviMatum.new(params[:kuldevi_matum])\n\n respond_to do |format|\n if @kuldevi_matum.save\n format.html { redirect_to @kuldevi_matum, notice: 'Kuldevi matum was successfully c...
dabf71c8aadf83ed11467b721e286038
GET /statuspagamentoes/new GET /statuspagamentoes/new.json
[ { "docid": "0529ff122f67fdbd4e73bdd09754e652", "score": "0.8144334", "text": "def new\n @statuspagamento = Statuspagamentoe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @statuspagamento }\n end\n end", "title": "" } ]
[ { "docid": "6c738079260611f58e1c4eb64eed5b50", "score": "0.7538284", "text": "def new\n @stat = Stat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stat }\n end\n end", "title": "" }, { "docid": "0225ef713c146e595ae152fc02937826"...
457212fc1075828841fe3a700b1ce06a
GET /user_reviews/1 GET /user_reviews/1.json
[ { "docid": "4587165258a02ab88649bd3ade5c5d08", "score": "0.68257856", "text": "def show\n add_breadcrumb \"Review\", user_review_path\n\n @user_review = UserReview.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_review }\n ...
[ { "docid": "4b98c835d6599e16256a52da44201613", "score": "0.8040949", "text": "def getUserReviews()\n r = User.find_by(id: params[:user_id]).reviews\n if(r == nil)\n render json: {status: false, data: \"\", reason: \"User not found\"}\n return\n end\n ret = []\n r.find_each do |r...
35048b36fb55b805b03c86c43f9cc82b
Allow a user to change their password.
[ { "docid": "e187a7ab79ba4e4af459f74a587ecfa9", "score": "0.0", "text": "def change_password\n @user = nil\n\n # Reset flash messages.\n flash[:error] = false\n \n if params['user']\n params['user']['password'] = Digest::MD5.hexdigest(\"#{self.salt}#{params['user']['password']}\")\n ...
[ { "docid": "a728522a1f46b28ea62b679ad1cb6883", "score": "0.8522148", "text": "def change_user_password\n end", "title": "" }, { "docid": "c1beecade175aa17a6877b537ead5bdf", "score": "0.8468902", "text": "def change_password(user_name, user_password)\n # TODO\n end", "title":...
0ec89afa5ef06cb70fec1fc00934d523
Compute how much money has been gained or lost on this position.
[ { "docid": "9875e442e9f136868d5662b168b593fc", "score": "0.0", "text": "def current_yield\n sum = 0\n stock_positions.each do |p|\n sum += p.current_yield\n end\n sum\n end", "title": "" } ]
[ { "docid": "c155fca5eadb8130b6dcaad7f964bab4", "score": "0.75289637", "text": "def amount_remaining\n @desired_amount - @bought_amount\n end", "title": "" }, { "docid": "086fae5fe066dc048ae6427fb083218c", "score": "0.7198871", "text": "def get_usd_profit\n open_positions.sum...
93346a27916494a100296e8a4708be07
Gets the lastSignInRequestId property value. Request identifier of the last interactive signin performed by this user.
[ { "docid": "8852b555bc8a8ab953d52df3b6e07a46", "score": "0.7859983", "text": "def last_sign_in_request_id\n return @last_sign_in_request_id\n end", "title": "" } ]
[ { "docid": "1337dc806bbec7a931644f9aab940e8f", "score": "0.77113456", "text": "def last_non_interactive_sign_in_request_id\n return @last_non_interactive_sign_in_request_id\n end", "title": "" }, { "docid": "3e4160bd0da73621f69a4958ab0b9739", "score": "0.7254354...
9083d8eb3d03a8e51b523ce08fa55690
method to determine excess money to move to cache
[ { "docid": "e53ffd0d42cf672aef7dcf85a75a1f3d", "score": "0.6367296", "text": "def extra_cash(db, user_name)\r\n\t# determine extra monies (conditional on + amount)\r\n\tdifference = (current_income(db, user_name) - current_expenses(db, user_name))\r\n\tcache_bonus = difference if difference > 0 || 0\r\n...
[ { "docid": "1ccb50be06be1276cd86bf77041f5f6a", "score": "0.6523663", "text": "def needed_amount_less_savings\n recommended_min_portfolio - portfolio_after_growth\n end", "title": "" }, { "docid": "1a60db2e7c8d2567de0b47eaaf7dab12", "score": "0.6488117", "text": "def cache_account...
522bee70c803c065a4f55e24908da303
=begin Add a node of value val before the indexth node in the linked list. If index equals to the length of linked list, the node will be appended to the end of linked list. If index is greater than the length, the node will not be inserted. :type index: Integer :type val: Integer :rtype: Void =end
[ { "docid": "dbce80338a5f015f4377f6036b95cbe9", "score": "0.8067355", "text": "def add_at_index(index, val)\n\n node = ListNode.new(val)\n\n case index\n when 0\n then\n node.next = @head\n @head = node\n else\n i = 0\n head = @head\n while i<index-1\n retur...
[ { "docid": "9e9948b3c6dbbc27f542b4bcdaefb3cc", "score": "0.8418321", "text": "def add_at_index(index, val)\n if index <= 0\n add_at_head(val)\n return\n end\n prev_node = get_node(index-1)\n return if prev_node.nil?\n new_node = Node.new(val)\n ...
3c55733c432002ac6d94e0a428e87681
GET /hacks/1 GET /hacks/1.json
[ { "docid": "fd5d1488c6c92f932ed191746d652680", "score": "0.74438834", "text": "def show\n @hack = Hack.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @hack }\n end\n end", "title": "" } ]
[ { "docid": "85e43a1218b0d70694b013d8c7dc1d6d", "score": "0.702082", "text": "def index\n @hacks = Hack.all\n end", "title": "" }, { "docid": "2387ee84a2ea6dd149789ed9fb19eb55", "score": "0.685115", "text": "def index\n @hacks = Hack.all\n end", "title": "" }, { ...
999124a5367a5cb48b7df9e37023cf8e
substitutes the given character for any characters in the path that are invalid in operating system representation
[ { "docid": "075ee4d82307cf2faf3bac01cd691eca", "score": "0.0", "text": "def sub_invalid(replacement_str = '_')\n ret = self.clone\n ret.sub_invalid!(replacement_str)\n ret\n end", "title": "" } ]
[ { "docid": "617c0762f9628f3e29a1e8d00dacbaee", "score": "0.6982758", "text": "def safe_chars(name)\n newname = name[0] == \"/\" ? name[1..-1] : name\n newname.gsub(\"/\", \"-\")\n end", "title": "" }, { "docid": "9244639d8ef5f962855057b0a6485d1b", "score": "0.69671786"...
a00c6f91ef1d235a4918fd9d855b3945
Tests than an exception is raised when an attempt is made to add a character to a full party.
[ { "docid": "9667ff69254fd72822f856d25571e737", "score": "0.7069683", "text": "def test_exception_if_party_full\n characters = []\n (Party::MAX_SIZE).times { characters << Character.new(BLANK_RACE) }\n party = Party.new(characters)\n\n assert_raises PartyFull do\n party << Character.new(...
[ { "docid": "8b32f82296366ee20c4dcc1541f50c9d", "score": "0.7287402", "text": "def test_exception_if_character_already_in_party_when_added\n character = Character.new(BLANK_RACE)\n Party.new([character, Character.new(BLANK_RACE)])\n party2 = Party.new([Character.new(BLANK_RACE), Character.new(BL...
86f588cf08414425c27060bd1b505cdc
Creates a trade based on stock and portfolio information POST trade_params
[ { "docid": "453f682f9a14e3718a114e112940288e", "score": "0.7547343", "text": "def create\n #Assigns user if there is no current user\n if current_user\n @portfolio = current_user.portfolios.find_by(name: params[:portfolio])\n @stock = @portfolio.stocks.find_by(symbol:...
[ { "docid": "81dfdbeb75798ca208c89231e3a4b4a9", "score": "0.7638635", "text": "def create\n @portfolio = Portfolio.find(params[:portfolio_id])\n @trade = @portfolio.trades.new(params[:trade])\n @stock2 = StockQuote::Stock.quote(\"#{params[:trade][:stock]}\")\n @trade.buy_price = @stock2.last\...
222bdd4bb8161246c87f586241f0867d
(true) if the board has been won, is a draw, or is full
[ { "docid": "935b6c6bcfcebcf60121f610f010a8ef", "score": "0.0", "text": "def winner(board)\nif winning_combination = won?(board)\nboard[winning_combination[0]]\nend\nend", "title": "" } ]
[ { "docid": "40868cb9f0e33f296d08319e107def7d", "score": "0.89566696", "text": "def draw?\n @board.full? && !won?\n end", "title": "" }, { "docid": "c6519ec764d861e30c38888c0c94f923", "score": "0.8949231", "text": "def draw?\n !won? && board.full?\n end", "title": "" }...
8a352ab89465eaf558ad743248017e59
GPO will occassionally include multiple footnotes in a single node we need to break them out in order to link them properly.
[ { "docid": "a0b79cbabd1f3c7aaacd361f632fd551", "score": "0.73037577", "text": "def footnotes(nodes, page_number)\n footnotes = nodes.first\n # sometimes XML will have FTRF that follow blank nodes so just return\n return blank_document.children unless footnotes\n\n footnotes = footnotes.conte...
[ { "docid": "e38bbe69b505911d7856291243c3e5af", "score": "0.69911665", "text": "def parse_footnote_definition; end", "title": "" }, { "docid": "9edaf8f224236930c130b84a38b53774", "score": "0.6978593", "text": "def get_footnotes\n @doc.elements.each(\"ROOT/footnotes/footnote\") do |...
a4f7ae3283936e83e41920ee8a49db1b
Checks equality by comparing each attribute.
[ { "docid": "01f6184745935bd781f64cf073140ca0", "score": "0.0", "text": "def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n args == o.args &&\n command == o.command &&\n env == o.env &&\n env_from == o.env_from &&\n image == o.ima...
[ { "docid": "153b45ee9e17f104e42417688976c51c", "score": "0.768239", "text": "def compare_attributes(attrs)\n\t\t\t\tattrs.each do |name, value|\n\t\t\t\t\tnext true if compare_attribute(name, value)\n\t\t\t\t\tbreak false\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "6c59827132384193c...
be470d1d0519c064de8853379bfc8556
List TLS activations List all TLS activations.
[ { "docid": "aea1c57e73e0b1888d18d0a33f93c745", "score": "0.8339308", "text": "def list_tls_activations(opts = {})\n data, _status_code, _headers = list_tls_activations_with_http_info(opts)\n data\n end", "title": "" } ]
[ { "docid": "5fcd3ef76a3db3a5cd37832161a63bcd", "score": "0.632096", "text": "def list_tls_activations_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TlsActivationsApi.list_tls_activations ...'\n end\n # unbox the paramete...
08256a8010a01a084e22f448494f823a
GET /lookup_sets/1 GET /lookup_sets/1.xml
[ { "docid": "fa186ce89af9ca65b73f5e30779761ba", "score": "0.73360187", "text": "def show\n @lookup_set = LookupSet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @lookup_set }\n end\n end", "title": "" } ]
[ { "docid": "1c22902a55efcbf78f300e8c1913aeb2", "score": "0.7492149", "text": "def index\n @lookup_sets = LookupSet.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @lookup_sets }\n end\n end", "title": "" }, { "docid": "e2847208...
c5df1f16c44681befd5dd123cdeeca01
must explicitly 0 the inject for parameter [] to not return nil
[ { "docid": "bdb65315ec67be9f02aab091a3e3ebe5", "score": "0.0", "text": "def sum(addends)\n addends.inject(0, :+)\n end", "title": "" } ]
[ { "docid": "524fb3a9fd395516dc5bdd749d694602", "score": "0.6359833", "text": "def inject_sum(arr)\n sum = arr.inject(0){|init,arr| init + arr} \n puts \"la suma con inject es #{sum}\" \nend", "title": "" }, { "docid": "4265a062afbc0c00fb981bd6d71ef9c1", "score": "0.63164455",...
a6db7e809d8fd00bbad6bd67c7c5f101
PUT /beehives/1 PUT /beehives/1.json
[ { "docid": "6923a4e291e227c101cdfd669d488947", "score": "0.6700031", "text": "def update\n @beehive = Beehive.find(params[:id])\n params[:beehive][:apiary_id] = params[:beehive][:apiary][:apiary_id].to_i\n params[:beehive][:beehive_id] = params[:beehive][:beehive][:beehive_id].to_i\n\n respo...
[ { "docid": "26f21c7d38b2d4d9cffd83f9854372d8", "score": "0.6660269", "text": "def update\n beer = Beer.find(params[:id])\n beer.update(beer_params)\n render json: beer\n end", "title": "" }, { "docid": "9fe12c4f0184ba4b2e0683b49382bc89", "score": "0.63104", "text": "def upd...
ece971d96b4ec1895f1fe893bcbdadd8
B110 number of document
[ { "docid": "5c8f9941a99f7f0213da7d55edd540b6", "score": "0.7597349", "text": "def doc_num\n node = @doc.at_xpath(\"//b110\")\n extract_inner_text(node)\n end", "title": "" } ]
[ { "docid": "3f830227271e64772530e6d3a9ff9654", "score": "0.73687965", "text": "def doc_number\n 9999999\n end", "title": "" }, { "docid": "af0e9b63a9d58ec52f277f988355c533", "score": "0.7346002", "text": "def n\n document[:n]\n end", "title": "" }, { ...
4c06da9ba6f54210ce33a64845963867
override of method in Blacklight::Catalog Note: Penn seems to have disabled the links to send a SMS
[ { "docid": "9063e8b027a6240db53fd21402a7c5d5", "score": "0.0", "text": "def sms_action(documents)\n super(documents) if documents_and_user_set\n end", "title": "" } ]
[ { "docid": "30818167a935a8a3a4aaca4bc52dc3db", "score": "0.70931584", "text": "def sms_send\n end", "title": "" }, { "docid": "fd1518a0abaf5979001fe84572293087", "score": "0.68016523", "text": "def sends_sms?\n false\n end", "title": "" }, { "docid": "3e7597fa6df491f...
ca2e7ad30166aad85f17abf5c2edc7ee
suppress codeclimate duplication warning
[ { "docid": "9648caa399a3d5be914d19e3a40cd66f", "score": "0.0", "text": "def fail_q(model, format, next_action)\n format.html { render action: next_action }\n format.json { render json: model.errors, status: :unprocessable_entity }\n end", "title": "" } ]
[ { "docid": "ab5e411af13eafb0e7482e8e6c6915c4", "score": "0.6544923", "text": "def duplicate()\n bug( \"you must override duplicate()\" )\n end", "title": "" }, { "docid": "277e0ccc9333875ba91f359948ae4778", "score": "0.6166726", "text": "def duplicated_name; end", "t...
2d8448a73096d1e5e7c127b816050fca
PUT /galerie/1 PUT /galerie/1.xml
[ { "docid": "6faa0e076aaae6aced88eb9400d09276", "score": "0.6202845", "text": "def update\n @galeria = Galeria.find(params[:id])\n\n respond_to do |format|\n if @galeria.update_attributes(params[:galeria])\n flash[:notice] = 'Galeria została zapisana.'\n format.html { redirect_to...
[ { "docid": "c2c0b673628fdc28b181d18c0afd2d5b", "score": "0.6592621", "text": "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end", "title": "" }, { "docid": "5a5ccfc7a473083c9b8d90d56382714c", "score": "0.643...
4bf9bfd8b24f7941992ff25ab5ac40fe
TODO for fetch and get all user's commit
[ { "docid": "90c4ab84274aaf63c039814674eb8077", "score": "0.75814325", "text": "def get_commit\n @users = [\"mouse-lin\", \"williamherry\", \"biorainy\", \"RyanZhu1024\"].map do |user|\n @client.user user\n end\n\n @repos_list = @users.map do |user|\n repos = JSON.parse(...
[ { "docid": "6c7da0db9c5c523318a5630f73e1bbfc", "score": "0.7268819", "text": "def committers\n @committers ||= Changeset.connection.select_rows(\n \"SELECT DISTINCT committer, user_id FROM #{Changeset.table_name} WHERE repository_id = #{id}\")\n end", "title": "" }, { "docid": "2...
be9ec93ea0d2758de26c84513632de41
The Add method should throw an exception when called with an input starting with a separator or containing multiple separators following each other.
[ { "docid": "06de3429db95251d7065cd7b7a97d95e", "score": "0.0", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNext3\n # Arrange.\n @inputValue = '\\n1\\n2'\n @errorMessage = \"Number expected but '\\\\n' found at position 0.\"\n\n #...
[ { "docid": "a4c7a94250afc931f5286d90fbd61f6d", "score": "0.76042473", "text": "def test_Add_Should_ThrowException_When_CalledWithInputContainsTwoOrMoreSeparatorsNextWithCustomSeparatorDeclaration108\n # Arrange.\n @inputValue = '//[sep1][sep2][sep3]\\nsep21sep32'\n @errorMessage = \...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "418179837b09fdf74f37f90f131b177f", "score": "0.0", "text": "def agenda_params\n params.require(:agenda).permit(:agenda_name, :agenda_description, :agenda_date)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.6979893", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781746", "text": "def strong_params\n params.requi...
e13b095007571436766033a0ab1d1c3b
DELETE /noms/1 DELETE /noms/1.xml
[ { "docid": "13d4f2af54046d148177536369ebdab5", "score": "0.7216642", "text": "def destroy\n @nom = Nom.find(params[:id])\n @nom.destroy\n\n respond_to do |format|\n format.html { redirect_to(noms_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
[ { "docid": "c1592c9a7c989d01a99d8c2f4e789eab", "score": "0.68095696", "text": "def netdev_resxml_delete( xml )\n top = netdev_resxml_top( xml )\n par = top.instance_variable_get(:@parent)\n par['delete'] = 'delete'\n end", "title": "" }, { "docid": "e1d6f603cb5ea1e475ea71422432aeae...
08956bec1a3ee52eef53c563179a1c4c
The current user represented by this session.
[ { "docid": "dc14dcc2497f2cd74fdddb1467e873f4", "score": "0.0", "text": "def current_user\n if remember_token.present?\n @current_user ||= user_from_remember_token(remember_token)\n end\n\n @current_user\n end", "title": "" } ]
[ { "docid": "a61ca9cfcd18221cd220048442cd430d", "score": "0.8536417", "text": "def current_user\n return nil unless logged_in?\n\n auth_session.session.user\n end", "title": "" }, { "docid": "44ad9ea14abcc5a7bda5f5ef89706e43", "score": "0.84597963", "text": "def current_u...
da3765a21519a9556eb33a1752463ec6
Runs additional initialization hooks. By default, this is a noop.
[ { "docid": "f630169fc864e11a4224e896295bd2a2", "score": "0.0", "text": "def after_initialize\n end", "title": "" } ]
[ { "docid": "13eb92a02b16bdbbeb1076f1762b63ed", "score": "0.7658397", "text": "def initialize\n # get the hooks, if they exist let them all do their after initialization work.\n hooks = self.class.instance_variable_get(:@_rucola_initialize_hooks)\n hooks.each { |hook| self.instance_eval(&h...
5475d1a6cad3b057c0f14ddbba35c958
POST /bugzillaproducts POST /bugzillaproducts.json
[ { "docid": "2b32fd9df9261b3e2af58258ff7a4862", "score": "0.73767734", "text": "def create\n @bugzillaproduct = Bugzillaproduct.new(bugzillaproduct_params)\n\n respond_to do |format|\n if @bugzillaproduct.save\n format.html { redirect_to @bugzillaproduct, notice: 'Bugzillaproduct was su...
[ { "docid": "a1004353542c53652b75807de2b9be90", "score": "0.6499776", "text": "def bugzillaproduct_params\n params.require(:bugzillaproduct).permit(:code, :product, :description, :openforbugentry, :enableunconfirmedstatus, :maxvotesperperson, :maxvotespersonperbug, :confirmbugsvotes, :version, :crea...
9333f2a19fa72d0ff328e906e990dd27
Parameters: tweet_attrs from a Tweet object, topic that is caught in the Twitter stream.
[ { "docid": "c7ad24bff8f1996fd773f5ab545cdf5d", "score": "0.7567205", "text": "def initialize(tweet_attrs, topic)\n @text = tweet_attrs[\"text\"]\n @created_at = tweet_attrs[\"created_at\"]\n @user_id = tweet_attrs[\"user\"][\"id\"]\n @user_name = tweet_attrs[\"user\"][\"name\"]\n @user_ha...
[ { "docid": "d27b6913363df4f7d3ed6d92b7cc4370", "score": "0.57935923", "text": "def link_attributes_for_tweet(tweet)\n if tweet.uris.present?\n {\n url: tweet.uris.first.expanded_url,\n note: tweet.text,\n source: Link::SOURCES[:twitter],\n source_id: tweet.id,\n ...
6323a37481eaf571e92dcad5ad0c770f
PATCH/PUT /apertura_cajas/1 PATCH/PUT /apertura_cajas/1.json
[ { "docid": "a81d8e73baecb718a8bbbdcca631bda2", "score": "0.6766479", "text": "def update\r\n respond_to do |format|\r\n if @apertura_caja.update(apertura_caja_params)\r\n format.html { redirect_to apertura_cajas_url, success: 'Editaste una caja correctamente.' }\r\n format.json { r...
[ { "docid": "f70dfd0cde1de599af772526516f3b9b", "score": "0.6750386", "text": "def update\n respond_to do |format|\n if @apertura_caja.update(apertura_caja_params)\n format.html { redirect_to movimientos_de_cajas_url(apertura_id: @apertura_caja.id) }\n format.json { render :show, st...
16f4b93386f2e673725a529b5a417794
rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Lint/UnexpectedBlockArity
[ { "docid": "d84f36517671c1ae5c7e2ef6859d1bf8", "score": "0.0", "text": "def upcoming_payments(start_date, end_date, season_id)\n entries = PaymentScheduleEntry\n .for_season(season_id)\n .includes(payment_schedule: { user: :payments })\n .where(pay_date:...
[ { "docid": "3abcf397d44d426cd1a1c04f580f817c", "score": "0.65788114", "text": "def block; end", "title": "" }, { "docid": "3abcf397d44d426cd1a1c04f580f817c", "score": "0.65788114", "text": "def block; end", "title": "" }, { "docid": "3abcf397d44d426cd1a1c04f580f817c", ...
669b4080b6db84c895577491c7de6600
Default method, subclasses must override this
[ { "docid": "1deebaac1fc19ec6e99de93a6e52961e", "score": "0.0", "text": "def run\n super\n require_enrichment\n end", "title": "" } ]
[ { "docid": "e6431ff47476c9014fb64198d5853e1e", "score": "0.7415348", "text": "def overrides; end", "title": "" }, { "docid": "a02f7382c73eef08b14f38d122f7bdb9", "score": "0.73554313", "text": "def custom; end", "title": "" }, { "docid": "a02f7382c73eef08b14f38d122f7bdb9",...
dbc65c3cd0029f5d6d7cbd9bd28a5918
DELETE /stan_rowerus/1 DELETE /stan_rowerus/1.json
[ { "docid": "a58da1bb5b362b84f3c67ceb438ae153", "score": "0.70602036", "text": "def destroy\n @stan_roweru.destroy\n respond_to do |format|\n format.html { redirect_to stan_rowerus_url, notice: 'Stan roweru was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"...
[ { "docid": "e1180d8cef575a5228d556ff6a52fe6f", "score": "0.68969756", "text": "def destroy\n @row = Row.find(params[:id])\n @row.destroy\n\n respond_to do |format|\n format.html { redirect_to rows_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { ...
d30cf75ce4888bcbeb6f568c109d9fd5
PUT /users/1 PUT /users/1.xml
[ { "docid": "114185069f5cd988093dbd98ede2cf03", "score": "0.0", "text": "def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n if session[:user].id == @user.id\n session[:user].reload\n end\n flash[:no...
[ { "docid": "03a397113daf14c04f75d28237539686", "score": "0.6635185", "text": "def update\n @user = V1::User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = 'V1::User was successfully updated.'\n format.html { redirect_t...
f7c02f10c416677714ee1111156f52af
default behavior, can by overwritten
[ { "docid": "7187219c6b4fdf531a2c0987fe44a145", "score": "0.0", "text": "def create_widget\n widget_class.new(widget_assigns)\n end", "title": "" } ]
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.7348326", "text": "def private; end", "title": "" }, { "docid": "a02f7382c73eef08b14f38d122f7bdb9", "score": "0.7229365", "text": "def custom; end", "title": "" }, { "docid": "a02f7382c73eef08b14f38d122f7bdb9", ...
6d520a0231ef922213dc8235b93ea0ff
GET /busgroups/new GET /busgroups/new.json
[ { "docid": "58230f37b33abee3a03e33b19a0ecfe3", "score": "0.7999637", "text": "def new\n @busgroup = Busgroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @busgroup }\n end\n end", "title": "" } ]
[ { "docid": "8e4be7b7769d1595017edb6fa5da8725", "score": "0.74629956", "text": "def new\n @groupaddrobj = Groupaddrobj.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @groupaddrobj }\n end\n end", "title": "" }, { "docid": "f87f0fcf...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "00ca118c820126f1f59302d8cf20e845", "score": "0.0", "text": "def admin_user_params\n params.require(:admin_user).permit(:name, :password, :password_confirmation, :email, :contact, :address, :company, :status, :role)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.6980244", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6782812", "text": "def strong_params\n params.requi...
694fc3ef738b9684626950313aec6328
Method: stack Author: Alex Konetchy Returns the stack
[ { "docid": "8845a7c9038ecc836185f94d19a29e92", "score": "0.85915464", "text": "def stack\n @stack\n end", "title": "" } ]
[ { "docid": "7b0c83a4d6a320271517b44bfe0ab629", "score": "0.8465396", "text": "def stack; end", "title": "" }, { "docid": "7b0c83a4d6a320271517b44bfe0ab629", "score": "0.8465396", "text": "def stack; end", "title": "" }, { "docid": "d92e81e63a46d874d5ba7476a90b3572", "...
3cfad68e6a26dd4348f0f38ba9e8ae4d
PATCH/PUT /tastings/1 or /tastings/1.json
[ { "docid": "58a51973f3270ac2a5559685c32d014b", "score": "0.6778311", "text": "def update\n respond_to do |format|\n if @tasting.update(tasting_params)\n format.html { redirect_to @tasting, notice: \"Tasting was successfully updated.\" }\n format.json { render :show, status: :ok, lo...
[ { "docid": "6b4434de1661a9d306ed29baef54ed76", "score": "0.6894759", "text": "def update\n @tasting = Tasting.find(params[:id])\n\n respond_to do |format|\n if @tasting.update_attributes(params[:tasting])\n format.html { redirect_to @tasting, :notice => 'Tasting was successfully update...
a16733772ec5725cbbd068c496733a94
Checks to see if their is a current user logged_in This method calls the current_user method
[ { "docid": "5f65214d3075938b84ee9a632078e3ef", "score": "0.7691297", "text": "def logged_in_user?\n\t\t!current_user.nil?\n\tend", "title": "" } ]
[ { "docid": "5c0957de2e754de404d54a0cf4917c2f", "score": "0.7966678", "text": "def logged_in?\n current_user\n end", "title": "" }, { "docid": "5c0957de2e754de404d54a0cf4917c2f", "score": "0.7966678", "text": "def logged_in?\n current_user\n end", "title": "" }, ...
0048ef0e2ec194c64904a37595bb8dd3
loads the source and runs make uninstall
[ { "docid": "c9e96c920e7d2b2419bfb53571a91a97", "score": "0.7712118", "text": "def make_uninstall(source, ext_name, flags)\n remove_source(ext_name)\n source.load(host, system_user, load_destination(ext_name))\n run(make_uninstall_cmd(ext_name, flags))\n remove_source(ext_name)\n ...
[ { "docid": "0ea9ad9880d97fd988e40776ff18faa7", "score": "0.6670187", "text": "def manual_uninstall\n run_if_has_permissions do\n puts \"Uninstalling libraries ...\"\n rm_r File.join(install_dir, \"lib/rango\")\n rm File.join(install_dir, \"lib/rango.rb\")\n puts \"Installing stu...
646fb2eb21026b493eff3e7470f27aeb
def setup_directory empty_directory "app/admin" template 'dashboards.rb', 'app/admin/dashboards.rb' end
[ { "docid": "f56cc406c1afd6792174b2748b613a3c", "score": "0.0", "text": "def setup_routes\n route \"mount BlogBasic::Engine => \\\"/blog\\\"\"\n route \"match '/signin' => redirect('/auth/google')\"\n route \"match '/auth/:provider/callback', to: 'blog_basic/sessions#create'\"\n ...
[ { "docid": "2c34357ba5e418872529da7d885f01c5", "score": "0.7475018", "text": "def setup_user_dashboard_views\n remove_dir('app/views/admin')\n directory('app/views/admin/views', 'app/views/admin')\n template('app/views/admin/templates/navigation.erb.tt', 'app/views/admin/application/_navi...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "3b6c48abe3ab5f23773412c7768b7313", "score": "0.0", "text": "def committee_params\n params.require(:committee).permit(:name, :overdue_state_id, :positive_finish_state_id,\n :negative_finish_state_id, :min_trial_tasks_count,\n ...
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whit...
9fe6820f3a596338f290107140931a7b
POST /l_tweets POST /l_tweets.json
[ { "docid": "60d0988fc901dcaf870f8f8fbed6e2dc", "score": "0.7099638", "text": "def create\n @l_tweet = LTweet.new(params[:l_tweet])\n\n respond_to do |format|\n if @l_tweet.save\n format.html { redirect_to @l_tweet, :notice => 'L tweet was successfully created.' }\n format.json {...
[ { "docid": "7babd598e03cbdeb59c3c06682cb70b0", "score": "0.738432", "text": "def post(tweet=nil)\n @res = access_token.post(\n 'http://twitter.com/statuses/update.json',\n 'status'=> tweet\n )\n end", "title": "" }, { "docid": "d08db55bab71b827603442ea70ab63ba", "score":...
43096c520caf3dcf61d458841cd5b3e5
Simulates a user pressing the mouse button (without releasing it yet) on the specified element.
[ { "docid": "d4c46b1cd2d89d3af46b676f57db7867", "score": "0.0", "text": "def mouse_up_at locator, coord_string\r\n command 'mouseUpAt', locator, coord_string\r\n end", "title": "" } ]
[ { "docid": "dc5e219597e7a4392f7d745a9a3a5d1f", "score": "0.7458295", "text": "def press element\n element.perform :press\n end", "title": "" }, { "docid": "47df2470fdfcdb9ff2f89920e2f1f0a7", "score": "0.71502155", "text": "def click_and_hold(element = T.unsafe(nil), button: T.uns...
816c6cafe2bb9967473d3fd2549bea26
pell words to values
[ { "docid": "1aa1dee8d99a214f88b1142528cdc0dc", "score": "0.66557616", "text": "def pell_words(text)\n values = []\n \n clear_unalphabetics(text.downcase!).split.each do |word|\n if word && word.size > 1\n values << self.solve_word(word)\n end\n end\n \n value...
[ { "docid": "e2b6fdcd180d21429f5199904f585e23", "score": "0.7186316", "text": "def WordsBeg(value); end", "title": "" }, { "docid": "a98394f00d7c5226473829fd2bcbfe9c", "score": "0.69400615", "text": "def word_substituter(tweet)\n new_array = []\n long_words = dictionary.keys\n \n ...
ea24645a305245d6d80fc67ec34f932e
GET /productos/1 GET /productos/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "a7bff1fdfa8f12c8958df1e1e90db365", "score": "0.72869223", "text": "def show\n @productonegocio = Productonegocio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @productonegocio }\n end\n end", "title": "" }, ...
6aab0cd0e9e652b513b8879781708431
merge: Inputs: => leftArray: A sorted array that was originally on the left for the array in mergeSort => rightArray: A sorted array that was originally on the right for the array in mergeSort Outputs: => A merged array which is a sorted combination of the two inputs Description: => merge takes two sorted arrays and co...
[ { "docid": "e5b5aac3e87fd4a349219588405515e8", "score": "0.82102495", "text": "def merge(leftArray, rightArray)\n # A\n if leftArray == nil\n leftArray = []\n end\n # A\n if rightArray == nil\n rightArray = []\n end\n #pre\n assert leftArray.is_a? Array\n assert righ...
[ { "docid": "416267d84ff632c3384e9a765a95a4f7", "score": "0.81288093", "text": "def merge(left_array, right_array, sort_condition)\n left_counter = 0\n right_counter = 0\n @merged_result = []\n #The while loop depending on the counters here is a stroke of genius. The key point to remember here is tha...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "f6048cb6e1c4175bf86b869d96aaa9c9", "score": "0.0", "text": "def update!(**args)\n @phone_number = args[:phone_number] if args.key?(:phone_number)\n end", "title": "" } ]
[ { "docid": "184b1b1ed771473d3eb9f338c0734c38", "score": "0.73066413", "text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end", "title": "" }, { "docid": "5076c5a88404ae72986f958710f5687a", "score": "0.72631145", "text": "def update...
28f1ae5c1ee200aedcf27b733f2ef39b
X TODO: Change to search hash X TODO: Store search hash in session X TODO: Populate search form with prior search TODO: Add search link to menu X TODO: Show droplist with styles TODO: search by user with autocomplete X TODO: Search by value ranges TODO: Search by date range X TODO: Clear search X TODO: Search all field...
[ { "docid": "12c7d2b014ba20614c06bda1b0cf649d", "score": "0.0", "text": "def initialize(scope, hash)\n @scope = scope\n @hash = hash\n Rails.logger.debug { \"FilterRecipes: #{@hash.inspect}\" }\n end", "title": "" } ]
[ { "docid": "1105a2feae212fb2b2aa23ca2212a6e5", "score": "0.74796474", "text": "def setup_search_options\n params[:search] ||= \"\"\n params.keys.each do |param|\n if param =~ /(\\w+)_id$/\n unless params[param].blank?\n query = \" #{$1} = #{params[param]}\"\n ...
3dd0d0bc7c0874633e024002491ee9e8
GET /trouble_codes/1 GET /trouble_codes/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "63683f831f60d084a31217f4684ce51f", "score": "0.6838449", "text": "def show\n @code_problem = CodeProblem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @code_problem }\n end\n end", "title": "" }, { "doc...
1ee74c7f4b198f94569465d5627f3b59
renames nodes and creates an alias file, returning aliased tree and hash
[ { "docid": "39c832b1ac0ed731c236514456c8f4ef", "score": "0.6719601", "text": "def alias(aliasFile = nil, longAlias = false)\n ali = Hash.new\n aliF = File.new(aliasFile, \"w\") if (!aliasFile.nil?)\n if (longAlias)\n taxon = \"SEQ\" + \"0\"* taxa.sort {|x,y| x.length <=> y.length}.last.len...
[ { "docid": "d7bcee777de00b3e575744c88ad96756", "score": "0.6840415", "text": "def reAlias(aliasNames)\n @root.descendants.each do |node|\n aliasNames.keys.each do |key|\n node.name = key if (aliasNames[key] == node.name)\n end\n end\n return self\n end", "title": "" }, ...
3db2a518a8e4187384265253dc60bc14
Return true if the service is running
[ { "docid": "c6c668c1bbe057a920313ac2c198018f", "score": "0.0", "text": "def running?\n state_str == 'RUNNING'\n end", "title": "" } ]
[ { "docid": "71f95be64389b9fae6d5388f51a3bc62", "score": "0.8663375", "text": "def service_running?\n raise \"service name not set for #{self}\" unless service_name\n\n host_sudo \"service #{Shellwords.escape service_name} \" +\n \"status >/dev/null 2>&1\", :fail_on_error => false\n end", ...
4e7bade1848bc288fd7acd8d74c13165
Just an alias to Configurationlogger
[ { "docid": "194ba936b4f7a2f9a4574331810a496e", "score": "0.0", "text": "def logger\n configuration.logger\n end", "title": "" } ]
[ { "docid": "54edf1a1af2bd09bb078075c4da39a02", "score": "0.81283206", "text": "def log_configuration_settings; end", "title": "" }, { "docid": "a5d99e55601dfa8908eb4bb0697e4928", "score": "0.77365994", "text": "def configure_log\n\n end", "title": "" }, { "docid": "04d...
500fabd133d3f0daa87c96a99ba76f3b
PATCH/PUT /objectives/1 PATCH/PUT /objectives/1.json
[ { "docid": "645428b211bda1f5e79f3fe9af38a7bf", "score": "0.6232713", "text": "def update\n respond_to do |format|\n if @objective.update(objective_params)\n format.html { redirect_to @objective, notice: 'Objective was successfully updated.' }\n format.json { respond_with_bip(@objec...
[ { "docid": "3b96fff625d278f3de0432ef5785d7c3", "score": "0.640721", "text": "def update(*args)\n respond_to do |format|\n if @object.update_attributes(params[@model_path.gsub('-', '_')]) #NOTE may be use just write on id without find before?\n format.html { redirect_to ooorest.index...
3dfb026617d47e2fbd07634c03267e7a
DELETE /archive_jobs/1 DELETE /archive_jobs/1.json
[ { "docid": "62277fd5fe2135bcacca12ae04abd816", "score": "0.7346522", "text": "def destroy\n authorize! :manage, Archive\n\n @archive_job.destroy\n respond_to do |format|\n format.html { redirect_to archive_jobs_url, notice: 'Archive job was successfully destroyed.' }\n format.json { h...
[ { "docid": "66db0ef98d50e458b6aaead27c514ac5", "score": "0.746126", "text": "def delete(args)\n options = { body: args, basic_auth: { username: @api_key } }\n Try { self.class.post(\"/api/jobs/delete.json\", options) }.to_either >-> response {\n if response.code == 200\n Right(...
d22e5002271843723a630b753689bc14
:records array of ActiveRecord instances :association_tree list of symbols or hashes representing a tree of preloadable associations
[ { "docid": "b4b21efb9a08e2b9689cd6135a156b57", "score": "0.6459069", "text": "def initialize(records:, association_tree:)\n @records = records.compact\n @association_tree = association_tree\n\n @records.each { |record| record.lazy_preload_context = self }\n end", "title": "" } ]
[ { "docid": "3f9b5e475760b5c6bd655cdf05259c63", "score": "0.68006915", "text": "def run_array_for_has_many\n # Add reverse to belongs_to_many\n records = Hash.new { |h, k| h[k] = [] }\n load_records.each do |ids, record|\n ids.each { |id| records[id]....
40783e0c11e0ea4fc40050efa8d6f5be
generate the code for a procedure. activation record is as follows, starting from the frame pointer: 0 : return address 1 : saved frame pointer 2 : return variable
[ { "docid": "f702b6d8d0aa05ca9c0948b40767b093", "score": "0.73341113", "text": "def gen_proc(node)\n node.proc.mem_address = @line\n @out.write \" * BEGIN procedure \" + node.name + \"\\n\"\n\n node.proc.activation_rec_size = 1 # return address\n node.proc.activation_rec_size += 1 ...
[ { "docid": "f01351c9b3fb25575678753287b2a9db", "score": "0.6309388", "text": "def returnf\n @@current_function = \"\"\n asm = \"\"\n \n # FRAME = LCL\n asm += \"@LCL\\n\"\n asm += \"D=M\\n\"\n # RET = *(FRAME-5)\n asm += \"@5\\n\"\n asm += \"A=D-A\\n\"\n asm += \"D=M\\n\"\n...
73082fd1bb112df06942c544ca4c1fde
Return the image_url for the brand. For some brands, there is no image_url. You can set :local_images in your Tangocard initializer to provide a local image for a specified brand. See the README for details. Example: >> amazon_brand.image_url => " Arguments: none
[ { "docid": "d5a408039311df823610952f45802d10", "score": "0.7004488", "text": "def image_url\n Tangocard.configuration.local_images[description] || @image_url\n end", "title": "" } ]
[ { "docid": "8c0d87311688566311a70dfc2bc685ba", "score": "0.65681595", "text": "def image_url # criando um metodo para o image_url\n rails_blob_url(object.image) # pegar a imagem da categoria e converte para a url\n end", "title": "" }, { "docid": "3ffcdfc58bbda8fe20297a5a182a0f2e", "...
f2c8eb9a4c0bb3ef73c0d64f2cc2147c
Internal: Creates and merges two arrays into a sorted array array Array of interger elements for now first start index of array mid middle index of array last end index of array (array_length1) TODO: Update the code to handle any kind of datatype Make it a more sleek Examples merge([5, 3, 8, 7, 9, 6, 2, 4, 1], 0, 4, 8)...
[ { "docid": "d7cdacf98198668e6450b6a5c779c65b", "score": "0.0", "text": "def merge(arr, first, mid, last)\n\tl1 = []\n\tl2 = []\n\n\t(first..mid).each { |i| l1 << arr[i] }\n\tl1 << Float::INFINITY\n\n\t(mid+1..last).each { |i| l2 << arr[i] }\n\tl2 << Float::INFINITY\n\n\tl1_index = 0\n\tl2_index = 0\n\n\...
[ { "docid": "16a2fb9fab77cbae3528bcbbe9923a64", "score": "0.79321826", "text": "def merge_arrays(array1, array2)\n \n merged_array = array1 + array2\n \n if array1.empty? \n merged_array = array2\n elsif array2.empty?\n merged_array = array1 \n else\n starting_index = [array1[0], array2[0...
3d81f3e4db3ec2ef003e2871e5412133
Sets env for the block.
[ { "docid": "c935fea3dc0dcf508f363e683e0389e5", "score": "0.6653602", "text": "def with_env(env)\n begin\n current = set_env(env)\n yield\n ensure\n set_env(current)\n end\n end", "title": "" } ]
[ { "docid": "2c41d02939b8e93971a598895140fab1", "score": "0.7014273", "text": "def env=(environment); end", "title": "" }, { "docid": "2c41d02939b8e93971a598895140fab1", "score": "0.7014273", "text": "def env=(environment); end", "title": "" }, { "docid": "9fea05537793ac50...
9b6325698da4a11587219952afcb5f2c
This function allows the user to dump the information from the scrolling window to a file.
[ { "docid": "bb7772b813ab40771b0a5888ee551124", "score": "0.6750502", "text": "def saveInformation\n # Create the entry field to get the filename.\n entry = CDK::ENTRY.new(@screen, CDK::CENTER, CDK::CENTER,\n '<C></B/5>Enter the filename of the save file.',\n 'Filename: ', Ncu...
[ { "docid": "d3b35d578c11636074e2767a14d4c26e", "score": "0.58602124", "text": "def loadInformation\n # Create the file selector to choose the file.\n fselect = CDK::FSELECT.new(@screen, CDK::CENTER, CDK::CENTER, 20, 55,\n '<C>Load Which File', 'FIlename', Ncurses::A_NORMAL, '.',\n ...
244f79cf3564f843897e2e97827e3933
Deliver notification to receivers by all configured methods
[ { "docid": "39a5787202803bd0a7317ba3cf5f5fd6", "score": "0.0", "text": "def deliver(notification)\n return nil if notification.nil?\n\n # Load balancing\n unless Tolliver.load_balance.blank?\n notifications_sent_in_protected_time_window = Tolliver.notification_model\n ...
[ { "docid": "b285fb157f57403fa1943af0019ece2a", "score": "0.70885247", "text": "def notify_all\n @subscribers.each &:handle_notification\n end", "title": "" }, { "docid": "1d850dd7d58e5f3e22019c3b747d252d", "score": "0.6784785", "text": "def broadcast!(method, *args)\n @users.e...
f5d0b49bfb15b87367c513f7a807be5e
DELETE /allcourses/1 DELETE /allcourses/1.xml
[ { "docid": "0c61e6167dc29ac94a380a90ec41e6cf", "score": "0.74208736", "text": "def destroy\n @allcourse = Allcourse.find(params[:id])\n @allcourse.destroy\n\n respond_to do |format|\n format.html { redirect_to(allcourses_url) }\n format.xml { head :ok }\n end\n end", "title":...
[ { "docid": "3932a75c1b52d6aaf748b2379549fbc0", "score": "0.70910084", "text": "def delete_course_by_id(org_unit_id)\n path = \"/d2l/api/lp/#{$lp_ver}/courses/#{org_unit_id}\" # setup user path\n # ap path\n _delete(path)\n puts '[+] Course data deleted successfully'.green\nend", "title":...
eac4270d3b304ed25617dacd50a45c3c
List all Application Get details for all Application.
[ { "docid": "0c37ccc5978e47cf270d24b599e1e2c8", "score": "0.0", "text": "def get_application_all_using_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: UtilsApi.get_application_all_using_get ...'\n end\n # resource path\...
[ { "docid": "577f3e7e098b0f1d572897563503246c", "score": "0.7617431", "text": "def retrieve_applications()\n start.uri('/api/application')\n .get()\n .go()\n end", "title": "" }, { "docid": "5a84323b6a10783ae3429e02b03320d2", "score": "0.760546", "text": "def...
2ea7387e12da3845179fb6b3ea7ebd7a
Returns true if the wizard is already finished.
[ { "docid": "1cc388082b4f0131b1eac178a5978364", "score": "0.73208743", "text": "def finished_wizard?\n !empty? && !informations? && !parameters? && !parameters_details? && !upload? && !review?\n end", "title": "" } ]
[ { "docid": "d8ac34f818a923bf41f44b1f0f7c44d4", "score": "0.8190047", "text": "def finished?\n @step == @total_steps + 1\n end", "title": "" }, { "docid": "1ff96d2aea20b00cc95c061b94870b02", "score": "0.7807758", "text": "def completed?\n @step == @total_steps\n ...
4f21aae2bb1730fc7e48e15883d7d6a9
Overwriting the sign_out redirect path method
[ { "docid": "5eddbb64b647c208851400abd964941e", "score": "0.0", "text": "def after_sign_out_path_for(_resource_or_scope)\n params[:return_url] || root_path\n end", "title": "" } ]
[ { "docid": "73ded18af6ce65346a9bab3485a41a59", "score": "0.8102037", "text": "def after_sign_out_path_for(resource_or_scope)\n '/signed_out'\n end", "title": "" }, { "docid": "5247573edc4002edb6704dabdc62c346", "score": "0.8007481", "text": "def after_sign_out_path_for(_resource_...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "e566a588612481931d4d77640b1664ab", "score": "0.0", "text": "def boilerplate_params\n params.fetch(:boilerplate, {}).permit(:name)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7496024", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69581187", "text": "def strong_params\n params.require(:request).permit(param_whit...