query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
a2099a77c85e91272ae2f9e35b937953 | Only allow a trusted parameter "white list" through. | [
{
"docid": "da17812c9dbd8b0ef600c3dafcb279ad",
"score": "0.0",
"text": "def movie_params\n params.require(:movie).permit(:imd_code, :title, :title_english, :title_long, :movie_type, :year, :runtime, :summary, :description, :yt_trailer_code, :status, :soft_delete,:type, movieGenres: [:genre_id, :mov... | [
{
"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"... |
c78e9feebe12876ffafef27d649e9fda | this helps to use the model name in the url instead of id | [
{
"docid": "c523ea9b8101807fbcb9acdc153c06f7",
"score": "0.0",
"text": "def to_param\n normalized_name = username.gsub(/[^a-zA-Z0-9\\_\\-\\.]/, '')\n \"#{normalized_name}\"\n end",
"title": ""
}
] | [
{
"docid": "53b598324c82413721bc9cf1f8f76cd3",
"score": "0.7132568",
"text": "def path\n \"#command=show¶meters=id%3D#{self.id}%26model%3D#{self.class.name.capitalize}\"\n end",
"title": ""
},
{
"docid": "6dd03acd1849661310006713c23625c9",
"score": "0.7098382",
"text": "def c... |
d39cfc90ed0e9e2d4ac4c36f8a118176 | Returns the value of attribute content_type. source://multipartpost2.2.3/lib/multipart/post/upload_io.rb:27 | [
{
"docid": "458bd17fca238d4b08f17d8b9e32eea1",
"score": "0.0",
"text": "def content_type; end",
"title": ""
}
] | [
{
"docid": "77f4a80f0ce83ff94dc09cfc44a2e11b",
"score": "0.8442769",
"text": "def content_type\n instance_read(:content_type)\n end",
"title": ""
},
{
"docid": "b44e17eddc48f56a0e5eb72ab0424d77",
"score": "0.83546656",
"text": "def content_type\n data[:content_type]\n ... |
b249f7d9872a36db28e6f050b6d2d2b9 | Receive messages in a separate thread when they arrive Allows messages to be received in a separate thread. I.e. Asynchronously This method will return to the caller before messages are processed. It is then the callers responsibility to keep the program active so that messages can then be processed. Parameters: :stati... | [
{
"docid": "721752bf7213712065de6d7bc8ddced5",
"score": "0.0",
"text": "def on_message(params={}, &proc)\n raise \"Consumer::on_message requires a code block to be executed for each message received\" unless proc\n\n @listener = HornetQ::Client::MessageHandler.new(params, &proc)\n setMessageHan... | [
{
"docid": "706d79d57b70e071645e6af824f80a2e",
"score": "0.6365587",
"text": "def receive\n raise \"No subscriptions to receive messages from.\" if (@subscriptions.nil? || @subscriptions.empty?)\n start = @current_subscription\n while true\n # puts \"calling receive... |
34dfc3601d986339ba3ff6536e5627ac | Declare a new fsm. The arguments can be any of (but in this order): +name+:: name. +clk+:: clock. +event+:: clock event. +rst+:: reset. (must be declared AFTER clock or clock event). If provided, +ruby_block+ the fsm is directly instantiated with it. | [
{
"docid": "3f0f7128a453804f028374cc3a4d67e6",
"score": "0.746433",
"text": "def fsm(*args, &ruby_block)\n # Sets the name if any\n unless args[0].respond_to?(:to_event) then\n name = args.shift.to_sym\n else\n name = :\"\"\n end\n # Get the optio... | [
{
"docid": "ba6e073b0098deea3ff1acd00d0c226e",
"score": "0.63064176",
"text": "def initialize(name,*options)\n # Check and set the name\n @name = name.to_sym\n # Check and set the type of fsm depending of the options.\n @dual = false\n @type = :sync... |
5a6cdf4effe34f6b7ec9255eb0bdd1ef | :callseq: decode_time(string) > Time Decodes +string+ as an IMAP4 formatted "datetime". Same as +decode_datetime+, but returning a Time instead. source://netimap//lib/net/imap/data_encoding.rb115 | [
{
"docid": "47dc0ba406a4ec20d3838949c23351ea",
"score": "0.69686705",
"text": "def parse_time(string); end",
"title": ""
}
] | [
{
"docid": "23fca43c6d345c61c8bcc585c5714055",
"score": "0.84174883",
"text": "def decode_time(string); end",
"title": ""
},
{
"docid": "fed8a96bce56e0321f025ab6afd6bd2d",
"score": "0.74582136",
"text": "def decode_datetime(string); end",
"title": ""
},
{
"docid": "8055b6... |
380033c7c3bcf9578f50ad0ff6463fe4 | I could use a hash of procs for this, but folks will probably think it's way more weird than a case statement rubocop:disable Metrics/CyclomaticComplexity | [
{
"docid": "aecf37fdc4c989a02388d482871d599c",
"score": "0.0",
"text": "def should_run?\n return if paper.manually_similarity_checked\n case setting_value\n when 'off'\n false\n when 'at_first_full_submission'\n submitted_after_first_full_submission?\n when 'after_any_first_revi... | [
{
"docid": "fb9eb72ee02dc739a0897bcdd24ea326",
"score": "0.6035939",
"text": "def casecmp(p0) end",
"title": ""
},
{
"docid": "5a48ef45e3e122c910c45ef2bec5af82",
"score": "0.58855224",
"text": "def fizzbuzz(x)\n\n fizzbuzz = FizzBuzz.new(x)\n case\n when fizzbuzz.three && fizzbuzz... |
dfd29e209aa3a48dc7e0172d65422e1a | Check wether specified purpose is allowed | [
{
"docid": "2d820b930fb88d60a720053de2464a44",
"score": "0.8003822",
"text": "def isPurposeAllowed(purpose)\n raise NotImplementedError\n end",
"title": ""
}
] | [
{
"docid": "0e757d0df3a64e9e53edcc2ec32e976f",
"score": "0.727514",
"text": "def allowed?(*_)\n true\n end",
"title": ""
},
{
"docid": "ed744a6b5c669fa6384f3cb9f1a9c94a",
"score": "0.7120964",
"text": "def allowed?; true end",
"title": ""
},
{
"docid": "9c6f38... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "b6622a2f0db84fb990a941f155e299fd",
"score": "0.0",
"text": "def set_param_vars\n # set survey question id that answers are a part of (should always be\n # present in the url path)\n @survey_question_id = params[:survey_question_id]\n\n # set survey answer\n @survey_a... | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60320485",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6013371",
"text": "de... |
712ed82da12453ff5adfbbd47a8de162 | sends a MIDI messages comprised of Numeric bytes | [
{
"docid": "ecebf820541f6c5ea54b27be05c9ff57",
"score": "0.69196534",
"text": "def puts_bytes(*data)\r\n\r\n format = \"C\" * data.size\r\n bytes = FFI::MemoryPointer.new(data.size).put_bytes(0, data.pack(format))\r\n\r\n Map.snd_rawmidi_write(@handle, bytes.to_i, data.size)\r\n Map.... | [
{
"docid": "334916f93a8e22f49ebe1725f5109e81",
"score": "0.6878674",
"text": "def send_message(byte1, byte2, byte3=0)\n Interface::midiout_send_message(@midiout, byte1, byte2, byte3)\n end",
"title": ""
},
{
"docid": "12d9238bc94c70e215a521ba7273cd24",
"score": "0.6587151",
"... |
7753203703e361d8333465c6ac71c469 | GET /hospede/1 GET /hospede/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "75c750de8496bd21cb197bc885e6ef45",
"score": "0.64784294",
"text": "def show\n @hoik = Hoik.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @hoik }\n end\n end",
"title": ""
},
{
"docid": "37113fc6c561fed9... |
6b617c9990aaeccedc1f83f44ab58b6c | Returns a concise string representation of Arguments instance | [
{
"docid": "736b6075e7b7ab57e313c566bc0b507b",
"score": "0.6665116",
"text": "def inspect\n \"#<#{self.class.inspect} @args=#{args.inspect}\"\n end",
"title": ""
}
] | [
{
"docid": "a7093255c6e595255e36eff0ae9f2646",
"score": "0.76885134",
"text": "def argument_string(args)\n args.inject([]) do |opts, opt|\n opts << (opt =~ /^-/ ? opt : opt.inspect)\n end.join(' ')\n end",
"title": ""
},
{
"docid": "54e34d02729c3f30204bf43c74729fb3",
... |
3e77c2c75f884e6df00cfcefe780eb27 | DELETE /result_units/1 DELETE /result_units/1.json | [
{
"docid": "9527dedaa537a6b04d8e8b02eacfce35",
"score": "0.712767",
"text": "def destroy\n @result_unit.destroy\n respond_to do |format|\n msg = \"#{t(:result_unit)} #{t(:was_successfully_deleted)}\"\n format.html { redirect_to result_units_url, notice: msg }\n end\n end",
"title... | [
{
"docid": "88f07ee17cc708c36386afca3b06aebe",
"score": "0.7378776",
"text": "def destroy\n url = 'https://casa-core.herokuapp.com/api/units/' + params[:id]\n response = HTTParty.delete(url, :headers => { \"Authorization\" => AUTH, \"Host\" => HOST})\n redirect_to units_url, notice: 'Unit was s... |
654ad57fc7f06c54ce5eb61d7b3a455b | POST /employee_emails POST /employee_emails.json | [
{
"docid": "f0da906a830bc60261177d6df5e40261",
"score": "0.6885065",
"text": "def create\n @employee_email = EmployeeEmail.new(employee_email_params)\n\n respond_to do |format|\n if @employee_email.save\n format.html { redirect_to @employee_email, notice: 'Employee email was successful... | [
{
"docid": "9329f3c6df1d157df1442cca9a64a32b",
"score": "0.65092945",
"text": "def create\n @email = @user.emails.new(email_params)\n\n respond_to do |format|\n if @email.save\n format.html { redirect_to @email, notice: 'Email was successfully created.' }\n format.json { render ... |
25c58526af680ea765ddd8644b91cc05 | % "+" : (!FIXME) > !FIXME | [
{
"docid": "accfd5f3e66a922898abfe21c0e9011b",
"score": "0.0",
"text": "def +(p0) end",
"title": ""
}
] | [
{
"docid": "a54176864b85671ccbdf61a4815771f4",
"score": "0.7654349",
"text": "def +\n end",
"title": ""
},
{
"docid": "e8342a7203e9615908c4f8f2719047cf",
"score": "0.7550533",
"text": "def +\n\nend",
"title": ""
},
{
"docid": "01845506ccf350b5b24216e283568b17",
"scor... |
5716a79fbcabade99dbc894cc695b840 | resource scope (generally a Mongoid::Criteria) page_params param.permit(pagination_params) | [
{
"docid": "735915471032c290b7ef19cc3611a3b6",
"score": "0.0",
"text": "def initialize(resource, request_env)\n @object = resource\n @request_env = request_env\n end",
"title": ""
}
] | [
{
"docid": "7363f0c2673caa77bc0eddf2e1b44d60",
"score": "0.7681221",
"text": "def resource_filter_permitted_params\n %i[page per_page]\n end",
"title": ""
},
{
"docid": "154248ebca99696df102ccf5d47c04fe",
"score": "0.7481756",
"text": "def page_params\n params.permit(:... |
2cb1692d2557f23cc06b2f9cbbfafbf3 | Method that asks user what menu option they want to select (ask_menu_option) | [
{
"docid": "0ca9bb61a0065ac58c784f4e6644b505",
"score": "0.7509328",
"text": "def ask_menu_option\n puts 'What would you like to do?'\n puts ''\n puts '1. Start New Game'\n puts '2. Load Game From Save File'\n puts ''\n correct_input = 0\n until correct_input == 1\n print 'Ente... | [
{
"docid": "dc063e0cb9bd527b5697aa114ea04a98",
"score": "0.8114038",
"text": "def select_option\n print_menu\n @choice = gets.chomp\n perform_selection\n end",
"title": ""
},
{
"docid": "c1e3caf064a62a81c3c23eb4a645215f",
"score": "0.7726102",
"text": "def interface... |
4c1d1150aa40cd28e8974fba29bf5e61 | method to get the current URL | [
{
"docid": "18b0e88d9a9a208c46f1a2dbeafdfe3a",
"score": "0.7678335",
"text": "def return_current_url()\r\n\t\t\treturn @driver.current_url\t\r\n\t\tend",
"title": ""
}
] | [
{
"docid": "0cff1138b5b01c39893e9022d95dba06",
"score": "0.8593981",
"text": "def current_url\n url = \"\"\n url.concat request.protocol\n url.concat request.env['SERVER_NAME']\n url.concat request.request_uri\n url\n end",
"title": ""
},
{
"docid": "bd53c3540d754412e20433bc8... |
3773c5d6b871bfe7a2a2a4efe5dd1a1b | Returns vendor with highest revenue overall or for a given date. | [
{
"docid": "632d61fd83c73edc812040e8d0bacc52",
"score": "0.64363116",
"text": "def preferred_vendor(year = nil, month = nil, day = nil)\n if year.nil? && month.nil? && day.nil?\n preferred_vendor_comparison(vendors)\n else\n date = DateTime.new(year, month, day)\n date = d... | [
{
"docid": "efa3d72ca5dc47af579f297045828728",
"score": "0.86011493",
"text": "def preferred_vendor(date = nil)\n vendors.max_by { |vendor| vendor.revenue(date) }\n end",
"title": ""
},
{
"docid": "c97097cba4ecb9919dfe9e1984baae08",
"score": "0.8361712",
"text": "def worst_vendor... |
d4972ad77aab0fd6e6ed1e2c0defca1c | Run the route matching the request. Returns 404 if no match is found. | [
{
"docid": "cefb9d852020ac575fd290030f03762d",
"score": "0.7214778",
"text": "def run(req, res, options = {})\n route = match(req)\n if route\n route.run(req, res, options)\n else\n res.status = 404\n res.write(\"page #{req.path} not found\")\n res.finish\n end\n end",
... | [
{
"docid": "52054ce5293834014a24e478d217e63e",
"score": "0.81994677",
"text": "def run(req, res)\n parse_http_methods!(req)\n matching_route = match(req)\n if matching_route\n matching_route.run(req, res)\n else\n res.status = 404\n res.write \"404 route not found\"\n end\n... |
5a150eaa8c7adc93a832eee8e02ceb44 | Returns a new Array of String from _arg_. | [
{
"docid": "0bc6b60a746a494961111c4efc89f6b8",
"score": "0.6023487",
"text": "def arrayify_and_stringify_elements(arg)\n return false if arg == false\n \n case\n when arg.blank? then []\n when arg.is_a?(Array) then arg\n else arg.to_s.strip.split(/\\s/)\n end.map(&:to_s)\n end",
... | [
{
"docid": "e6221cb2d2a37ff85cb9600719f46200",
"score": "0.686687",
"text": "def rake_array_arg(arg, delim = \" \")\n return arg.split(delim) if arg.is_a? String\n return arg\nend",
"title": ""
},
{
"docid": "8def7dfd830c7e1e87023dbd58e1c390",
"score": "0.68416107",
"text": "def ge... |
886dae6e16cfe3c8a32e08bc2302766d | Set the status of a device This method should be replaced in child classes, as appropriate | [
{
"docid": "2f35d052d5c5e574b7344fe64c11974b",
"score": "0.8587565",
"text": "def set_device_status(status)\n @device_status = status\n end",
"title": ""
}
] | [
{
"docid": "dc9b2948e2f850baa34813d5a1bdbcbb",
"score": "0.71936136",
"text": "def device_state=(value)\n @device_state = value\n end",
"title": ""
},
{
"docid": "43c68ff80ecfdf1233da70b3d3c826e0",
"score": "0.71225435",
"text": "def ensure_device_status\n ... |
ec6ad314374b36a6e5101ad67832c664 | initialize w/ no params. | [
{
"docid": "8e10117902ff3282a42ea5b72dde9df5",
"score": "0.0",
"text": "def initialize\n end",
"title": ""
}
] | [
{
"docid": "30db4e5d165a6098d1aeb8f8dd7b66e8",
"score": "0.82143295",
"text": "def initialize() end",
"title": ""
},
{
"docid": "8e3629bb42b471c640e3e1bd665bf3b2",
"score": "0.8174844",
"text": "def initialize(*) end",
"title": ""
},
{
"docid": "8e3629bb42b471c640e3e1bd66... |
f42a780487faf2b936c439c30f95f251 | Add the mdr fields to an output hash if this is an MDR | [
{
"docid": "ec1b81bd5d648c5c186c70544cdb95e9",
"score": "0.7578416",
"text": "def add_mdr_fields(output)\n return output unless md_relief?\n\n output['ins0:MdrNumberDwellings'] = @mdr_number_dwellings\n output['ins0:MdrTotalConsideration'] = @mdr_total_consideration\n output[... | [
{
"docid": "4cdb64bc4dfc6e046926d5826fcdd388",
"score": "0.68763745",
"text": "def add_mdr_fields_calc(output)\n return output unless md_relief?\n\n output['ins1:MdrNumberDwellings'] = @mdr_number_dwellings\n output['ins1:MdrTotalConsideration'] = @mdr_total_consideration\n o... |
762bec467c836ce517c48f89d2f5a65c | Changes the name of a coaster for a user | [
{
"docid": "f607b3dad4c8bd6e8468387f4f2656b6",
"score": "0.63059133",
"text": "def modify_coaster(db, coaster_to_modify)\r\n\tprint \"Please type in the new name of the rollercoaster: \"\r\n\told_name=coaster_to_modify\r\n\tnew_name=gets.chomp\r\n\tdb.execute(\"UPDATE rollercoasters SET coaster_name='#{... | [
{
"docid": "88b4f193aa6be7d2793f39bc5544fda5",
"score": "0.69191223",
"text": "def set_coach_name(new_name)\n @coach = new_name\nend",
"title": ""
},
{
"docid": "679ca3a2a158335881d62ff80023f2a6",
"score": "0.6858904",
"text": "def change_info(new_name)\n self.nickname = new_name... |
589e2bc5c3d3ece2a2e52004a4bc9ab0 | Site Asset Removes an asset from a site. The asset will only be deleted if it belongs to no other sites. | [
{
"docid": "6300e20daf49bef6a7f2dd5114afab1c",
"score": "0.66344595",
"text": "def remove_asset_from_site(id, asset_id, opts = {})\n data, _status_code, _headers = remove_asset_from_site_with_http_info(id, asset_id, opts)\n return data\n end",
"title": ""
}
] | [
{
"docid": "365f2510f87deca97f877dde84546bcb",
"score": "0.67071074",
"text": "def remove_asset_from_site(id, asset_id, opts = {})\n data, _status_code, _headers = remove_asset_from_site_with_http_info(id, asset_id, opts)\n data\n end",
"title": ""
},
{
"docid": "337a62321bca71f... |
644d758c182c1f0641fc4a4b64dcefde | handle submit from LOG IN page | [
{
"docid": "8b36a34121df48965c5fd25a4f0b3f58",
"score": "0.0",
"text": "def create\n user = User.find_by :email => params[:email]\n\n # if a user, with that email, is in the DB\n # then apply the authenticate method\n # if successful authentication...\n if user.present? && user.authentica... | [
{
"docid": "aa77e62755fe3509f4c4d08d1dd7f19b",
"score": "0.76365507",
"text": "def login_form\n end",
"title": ""
},
{
"docid": "fe69b92eaffb3c22d002adc3ca69175a",
"score": "0.7440056",
"text": "def loginform\n\tend",
"title": ""
},
{
"docid": "36c33d8be94955439227397881... |
664ff6ef05918c954fe408fb86cc2ca2 | Computes whether the room is occupied or not, based on sensor values. | [
{
"docid": "6c644c4e76108a298bd609fe20e958ef",
"score": "0.7842666",
"text": "def occupied_from_sensors\n sensors = sensors_at Time.current\n return true if sensors[:pirxl] && sensors[:pirxl] > 0\n return true if sensors[:motion] && sensors[:motion] > 0\n return true if sensors[:micpower] &&... | [
{
"docid": "a2b3b5fc731e5209adcd49da86e6e86a",
"score": "0.6946107",
"text": "def occupied?\n not @unit.nil?\n end",
"title": ""
},
{
"docid": "59b89e80a58590534eabfc436f9aadc4",
"score": "0.6774085",
"text": "def occupied?(x, y)\n return true if $game_map.get_unit(x,y, ni... |
e29496e25b8500d7caf89c2dcbc274a6 | Determines if a car is available during a reservation time | [
{
"docid": "29649f6438f14d50d037aa4a8fdb34d4",
"score": "0.8012567",
"text": "def car_available?(car, start, finish)\n\t\tcar.reservations.each do |reservation|\n\t\t\tif overlap?(reservation, start, finish)\n\t\t\t\treturn false\n\t\t\tend\n\t\tend\n\t\treturn true\n\tend",
"title": ""
}
] | [
{
"docid": "8855370ccdd6df1ce274c28382e85e19",
"score": "0.76107615",
"text": "def is_available?(start_time, people)\n # find out how many people have already made a reservation by adding up all the people from all the reservations in that time slot\n reserved = reservations.where(start_time: star... |
5d8775be9e32a2b3c8868fe9323f5810 | add_comment Description: This method updates the database with the comment for the design review. Parameters from params [:design_review][:id] Used to identify the design review. [:post_comment] The posting comment Return value: None Additional information: | [
{
"docid": "a4b2899843d042c4c4350f98a1b6e7b4",
"score": "0.7212472",
"text": "def add_comment\n\n user_comment = params[:post_comment][:comment]\n if user_comment != \"\"\n \n design_review = DesignReview.find(params[:design_review][:id])\n comment = DesignReviewComment.new(:commen... | [
{
"docid": "b1dd833e2fdb29990180429c905c1913",
"score": "0.65263534",
"text": "def set_comment\n post = Post.find(params[:post_id])\n @comment = post.comments.find(params[:id])\n end",
"title": ""
},
{
"docid": "c66af9ad58f3793178def15a491c8b0b",
"score": "0.64866865",... |
9625d7691b5d1698893047c73a219b32 | The function mixed into this instance | [
{
"docid": "324e29fb8774e94a79b6fe834a582898",
"score": "0.0",
"text": "def function\n config[:function]\n end",
"title": ""
}
] | [
{
"docid": "792be6eadacebdee265be975baeda2c7",
"score": "0.72477615",
"text": "def function; end",
"title": ""
},
{
"docid": "42aa976c7a88cb904ad7aeb141ec66ca",
"score": "0.7235663",
"text": "def closure\n\n\t\tend",
"title": ""
},
{
"docid": "a18186567d58d46fbcb43c48faf2... |
78bafbc6329deea8f93b2292f56e757a | Defines a new message handler, dependent on the given states. | [
{
"docid": "461d53973068d577023d7918cd2ef7f8",
"score": "0.5666212",
"text": "def handle(pattern, which_states = all, &block)\n handler = Handler.new(Regexp.new(pattern), block)\n [*which_states].each do |s|\n unless valid_state?(s)\n raise Cartan::Exception::InvalidState,\n ... | [
{
"docid": "66d54f34d267a13ba1ed76513bec1cf0",
"score": "0.6740598",
"text": "def define_message_handler(message_name, handler)\n\t\t@message_handlers[message_name.to_s] = handler\n\tend",
"title": ""
},
{
"docid": "66d54f34d267a13ba1ed76513bec1cf0",
"score": "0.6740598",
"text": "de... |
7c6cdc2ab2f2ac76e5346a8d4a7e5797 | yields the string word by word. Line separators in the string will also be yielded as words. | [
{
"docid": "94de9da9e0cae00cbbe06ff7ad816398",
"score": "0.7552353",
"text": "def each_word\n self.gsub(/\\n/,\" \\n \").split(/ /).each { |w| yield w }\n end",
"title": ""
}
] | [
{
"docid": "2294b5058bfdefeacf00f79eb23ee655",
"score": "0.74924076",
"text": "def each\n\t\tstring.split(\" \").each do |word|\n\t\t\tyield word\n\t\tend\n\tend",
"title": ""
},
{
"docid": "2294b5058bfdefeacf00f79eb23ee655",
"score": "0.74924076",
"text": "def each\n\t\tstring.split... |
313e6dacf37001a634208b607cb3cfe6 | GET /calendar_entries/1 GET /calendar_entries/1.json | [
{
"docid": "e21b72f39cf02fc2d882363755a4095f",
"score": "0.7368004",
"text": "def show\n @calendar_entry = CalendarEntry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @calendar_entry }\n end\n end",
"title": ""
}
] | [
{
"docid": "8c48d57094cd8780cfcee0195b4ea267",
"score": "0.7217576",
"text": "def fetch_entries\n response = @connection.send(\"/users/me/calendarList\", :get)\n\n return nil if response.status != 200 || response.body.empty?\n\n CalendarListEntry.build_from_google_feed(JSON.parse(response... |
18a27f4b1e54386ce27a00b751df684d | DELETE /learning_results/1 DELETE /learning_results/1.json | [
{
"docid": "93a2744f068c87c1cfea303fc08f431b",
"score": "0.72853947",
"text": "def destroy\n @learning_result.destroy\n respond_to do |format|\n format.html { redirect_to learning_results_url, notice: 'Learning result was successfully destroyed.' }\n format.json { head :no_content }\n ... | [
{
"docid": "16ec03c60a2b1457e063fc779fd4524a",
"score": "0.72317976",
"text": "def destroy\n @learning_outcome = LearningOutcome.find(params[:id])\n @learning_outcome.destroy\n\n respond_to do |format|\n format.html { redirect_to learning_outcomes_url }\n format.json { head :no_conten... |
de115b2bedf207694c53adb841b5d98b | Formats the signature of method +meth+. | [
{
"docid": "173e32fbfa0417ee344670dd7362ef5a",
"score": "0.7184793",
"text": "def signature(meth, link = T.unsafe(nil), show_extras = T.unsafe(nil), full_attr_name = T.unsafe(nil)); end",
"title": ""
}
] | [
{
"docid": "19c7df16e5b2bd6a2c78a8cca1d5e189",
"score": "0.68216145",
"text": "def method_signature(method)\n help = method_help(method)\n params = []\n ret = nil\n help.each_line do |l|\n case l \n when /@param[\\s\\w]+\\[(\\w+).*\\]/\n params <<... |
39b1ac04e3aa6b933431869977aaa9e1 | Returns true if execution is about to be resumed | [
{
"docid": "79c512494dc2bf5ec204ab79f2d13831",
"score": "0.0",
"text": "def done?\n @done\n end",
"title": ""
}
] | [
{
"docid": "7de2cebcdd674c7f5feadbd5b0697466",
"score": "0.8079816",
"text": "def resume?\n false\n end",
"title": ""
},
{
"docid": "9a95017b947068dd273877cc7d854128",
"score": "0.74877274",
"text": "def resume\n if @isPaused == true\n @status_details =\"Resumed a... |
c1a6f2fa21bf356a36553086eba254eb | GET /v2/pessoas or /v2/pessoas.json | [
{
"docid": "3de9dcaf4d491fd65b86fe86f44ee1db",
"score": "0.71214193",
"text": "def index\n @v2_pessoas = V2::Pessoa.all\n end",
"title": ""
}
] | [
{
"docid": "a48a033a788fdebb2a77104f36901d8c",
"score": "0.69311315",
"text": "def index\n @pessoas = Pessoa.all\n render json: @pessoas\n end",
"title": ""
},
{
"docid": "7430b7f88f1616958d8522654dbe1814",
"score": "0.6813282",
"text": "def index\n @pessoas = Pessoa.where(... |
4af95fe88ef951e3516ed145fc5d5e98 | POST /race_timing_ind_evnts POST /race_timing_ind_evnts.json | [
{
"docid": "99bf441c7aa50e25a0ead0321aacb92e",
"score": "0.6186652",
"text": "def create\n #@race_timing_ind_evnt = RaceTimingIndEvnt.new(params[:race_timing_ind_evnt])\n\n params[:member_id].zip(params[:mem]).each do |mid,tm|\n @race_timing_ind_evnt = RaceTimingIndEvnt.new(params[:race_tim... | [
{
"docid": "2661f6a70d8da96a61c533e3b4dc576a",
"score": "0.6542929",
"text": "def index\n @race_timing_ind_evnts = RaceTimingIndEvnt.all\n \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @race_timing_ind_evnts }\n end\n end",
"title": ""... |
ea95a1c6f14da8814bf52dc65352dba7 | PATCH/PUT /skin_colors/1 PATCH/PUT /skin_colors/1.json | [
{
"docid": "8d238a7eb3d0eef572213d1b9f566894",
"score": "0.71444803",
"text": "def update\n respond_to do |format|\n if @skin_color.update(skin_color_params)\n format.html { redirect_to @skin_color, notice: 'El Color de Piel ha sido actualizado exitosamente.' }\n format.json { rend... | [
{
"docid": "a7f97600632bf2ae98138f6bb5f82186",
"score": "0.6746391",
"text": "def update\n respond_to do |format|\n if @skin.update(skin_params)\n format.html { redirect_to @skin, notice: 'Skin was successfully updated.' }\n format.json { head :no_content }\n else\n for... |
bc79128fb433c4889b19205191e957ef | Remove any objects which are prunable | [
{
"docid": "4810b2c8150e98dcde63e5f69ea12167",
"score": "0.825905",
"text": "def delete_pruneable_objects\n live_objects(pruneable_only: true).each do |object|\n object = object[:live]\n delete(object.kind, object.name)\n end\n end",
"title": ""
}
] | [
{
"docid": "3ad2bd77898da1d181e5dd79702ff216",
"score": "0.7988076",
"text": "def prune\n end",
"title": ""
},
{
"docid": "b4599a5a09fff860f9412f883657ac9d",
"score": "0.7936711",
"text": "def prune; end",
"title": ""
},
{
"docid": "1b2365a5b6ae42937fb432599de30a1c",
... |
a7b132f44b0144391c73dc57be680cf2 | Automatically grades multiple choices and fillins. | [
{
"docid": "7dfcf774335a52a3268d2e417e74871c",
"score": "0.0",
"text": "def score_answers(answers)\n correct = []\n wrong = []\n score = 0\n answers.each do |key, value|\n unless @grid[key]\n puts \"Warning: Missing answer key for #{key}; ignoring\"\n next\n end\n ... | [
{
"docid": "c067bf3f8eac865b4e723b1d9d091167",
"score": "0.6056204",
"text": "def make_insurance_choice\n self.student_choice = :insurance_choice\n save!\n CourseSelection.decline_all(self.application)\n end",
"title": ""
},
{
"docid": "f4c5efde30cbb6666ae3d0642abc3fc6",
"score... |
af8c378a2be2f9aa91b023b8e4884e48 | Starts the game with player x's turn and creates an array (to_a) for space combinations. Calls methods necessary for the game to run properly. | [
{
"docid": "d25fde4ea71bbface2e70f05abdf494a",
"score": "0.0",
"text": "def tick\n init_new_game\n render_board\n input_board\n end",
"title": ""
}
] | [
{
"docid": "0f048215d7c33e46fd1b65e57f766ecf",
"score": "0.66269225",
"text": "def start\n\t\tputs \"#{@players[0].name} is 'X'\\t\\t#{@players[1].name} is 'O'\\n\\n\"\n\t\tp1turn = true # Used to check which player's turn it is. true = P1, false = P2 or AI\n\t\twhile(1) # game loop, can only be broken ... |
ab023937a52dd44e3059299d78e9e6cb | Update a &39;appliance.BackupPolicy&39; resource. | [
{
"docid": "80d40f227b02ef07352d6b5d8449b788",
"score": "0.5914259",
"text": "def update_appliance_backup_policy_with_http_info(moid, appliance_backup_policy, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ApplianceApi.update_appliance_backup_pol... | [
{
"docid": "967a04dcd653297c8b70843b20627a1e",
"score": "0.6755032",
"text": "def update_appliance_backup_policy(moid, appliance_backup_policy, opts = {})\n data, _status_code, _headers = update_appliance_backup_policy_with_http_info(moid, appliance_backup_policy, opts)\n data\n end",
"... |
46a27b3e22b25db77cab18a198192101 | Changes workflow state of the resource by sending an event to it. Then redirects to the further URL (e.g. list of these resources). | [
{
"docid": "d1ab410abe7838030f372da330d5720e",
"score": "0.7115511",
"text": "def execute_workflow_event(resource, event)\n resource.public_send(\"#{event}!\")\n url = successful_workflow_event_url(event)\n redirect_to url, notice: successful_workflow_event_message\n rescue Workflow::NoTransit... | [
{
"docid": "12ffa756c5a80317d41ef0b65181cf03",
"score": "0.74335444",
"text": "def execute_workflow_event(resource, event)\n redirect_state = resource.workflow_state\n resource.send(\"#{event}!\")\n redirect_to url_for([:admin, resource.class, workflow_state: redirect_state]), notice: I18... |
b4204d06ff39968b8b86c651bd55dc08 | POST /applications POST /applications.json | [
{
"docid": "5b5bad4847ec3af5ce1beecb788350bb",
"score": "0.63705754",
"text": "def create\n @application = Application.new(application_params)\n\n respond_to do |format|\n if @application.save\n format.js\n format.html { redirect_to @application, notice: 'Application was success... | [
{
"docid": "4b022def7f0b35cf315b274c640e3f35",
"score": "0.7520933",
"text": "def create_application(application_id, request)\n start.uri('/api/application')\n .url_segment(application_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .post()\n ... |
227f3cb8ad9512b3536cee9c15e72b12 | PUT /topics/1 PUT /topics/1.json | [
{
"docid": "1fb0ba043eeb8a1734b5e2dee17da4b0",
"score": "0.68559384",
"text": "def update\n params[:topic].delete :messages_attributes\n @topic = Topic.find(params[:id])\n\n respond_to do |format|\n if @topic.update_attributes(params[:topic])\n format.html { redirect_to topic_url(@t... | [
{
"docid": "be4f50ebab911871aa191a0c6abdb589",
"score": "0.7648418",
"text": "def UpdateTopic id,params = {}\n \n APICall(path: \"topics/#{id}.json\",method: 'PUT',payload: params.to_json)\n \n end",
"title": ""
},
{
"docid": "592e11e49677a44501d1be45bca25176",
... |
2893756c0bdf5ed5e20f7059be5c4d45 | overriden default behaviour in super class for retreival of stage aggregates, since all aggregates of this type should be retreived in addition to the current one. | [
{
"docid": "1800496c52d767e566ddf81ffae4ac1e",
"score": "0.0",
"text": "def get(aggregate_root_id)\n @aggregate = new_aggregate(aggregate_root_id)\n KnockoutStageResolver.new(@user, @contest).predicted_stages(@aggregate)\n end",
"title": ""
}
] | [
{
"docid": "dc352681b65af80bf219f2beb34b58de",
"score": "0.6342533",
"text": "def stage; end",
"title": ""
},
{
"docid": "fe52d04e2ffeb0a2b9c77b537ebe8e99",
"score": "0.60037154",
"text": "def build_stage_collection(job, org)\n # Create a JobStage for each ad-hoc stage defin... |
7be22e53830e83dc11fd371cd090f592 | input = "\ .. .. ... " | [
{
"docid": "b224ca1da8c3df5f484e0133880ecf19",
"score": "0.0",
"text": "def init_grid(input)\n\t# use set to store infected nodes\n\tinfected = Set.new()\n\n\tinit_x, init_y = 0, 0\n\tinput.split(\"\\n\").each.with_index { |line, y|\n\t\tline.chars.each.with_index { |status, x|\n\t\t\tinfected.add([x, y... | [
{
"docid": "5a5a2e93b1fc1d4efd925ca39bb88151",
"score": "0.74367833",
"text": "def get_input\n gets.upcase.gsub!(\"\\n\",\"\")\n end",
"title": ""
},
{
"docid": "35898531486efa53322521ce5880d6b4",
"score": "0.7239961",
"text": "def input_char(iseq); end",
"title": ""
},
{... |
ead8c1408387356cd8b43af819456f0e | prints board on command line interface | [
{
"docid": "8f84848ae6c2a2a854424d19e1a2bd29",
"score": "0.0",
"text": "def print_board\n @board.reverse.each_with_index do |rank, ri|\n rank_num = rank.length - ri\n print \"#{rank_num} \"\n rank.each_with_index do |file, fi|\n print \"\\u2502\" #vertical line\n if file.... | [
{
"docid": "beaad574b2978bf15a23244efee77890",
"score": "0.75980633",
"text": "def show_board\n puts \" \" + board_spaces[1] + \" | \" + board_spaces[2] + \" | \" + board_spaces[3] + \" \"\n puts \"-----------\"\n puts \" \" + board_spaces[4] + \" | \" + board_spaces[5] + \" | \" + board_spaces... |
c2c3ff279ac81df33ac57a0fe0f5cfb0 | Defines the current player | [
{
"docid": "ba927dd7b22a03115fff2ba98b6286a1",
"score": "0.0",
"text": "def current_player(board)\n x_plays = 0\n o_plays = 0\n\n board.each do |spot_on_board|\n x_plays += 1 if spot_on_board == \"X\"\n o_plays += 1 if spot_on_board == \"O\"\n end\n\n next_player = x_plays % 2 == o_plays % 2 ... | [
{
"docid": "528bf12f7a8dd9ac2c0f2163889169db",
"score": "0.8028351",
"text": "def current_player\r\n\t\tif @current_player == \"player\"\r\n\t\t\t@current_player = @player \r\n\t\telse\r\n\t\t\t@current_player = \"Computer\"\r\n\t\tend\r\n\tend",
"title": ""
},
{
"docid": "49f5736d6eedc851b6... |
8095a3edc9d3109ad28c5dd7ef208e3e | PATCH/PUT /hosts/1 PATCH/PUT /hosts/1.json | [
{
"docid": "af41c413712a8a1fe89c8299b9221382",
"score": "0.6170911",
"text": "def update\n respond_to do |format|\n if @host.update(host_params)\n format.html { redirect_to @host, notice: 'Host was successfully updated.' }\n format.json { render :show, status: :ok, location: @host ... | [
{
"docid": "2ca95b504f381d2492d11b318d074420",
"score": "0.6439658",
"text": "def update\n @host = Host.find_by_host(params[:id])\n\n respond_to do |format|\n if @host.update_attributes(params[:host])\n format.html { redirect_to @host, notice: 'Host was successfully updated.' }\n ... |
6803afa65e8c264850f9950d546d5ab1 | Auxiliary method to create a new Soap4rResponseHandler, of the type we want to use for AdWords logging | [
{
"docid": "13cfa588f6e8bbe530e965cdcd1bc812",
"score": "0.74999493",
"text": "def create_callback_handler\n AdwordsApi::Soap4rResponseHandler.new(self)\n end",
"title": ""
}
] | [
{
"docid": "583ace9db9ae086eaa34b9d265829c65",
"score": "0.67422384",
"text": "def new_response_handler\n ResponseHandler.new\n end",
"title": ""
},
{
"docid": "a13ddc596d8146379aed34880114738c",
"score": "0.62393725",
"text": "def response_handler_class\n @response_hand... |
a74586b9b4480450bd522adc06c97ca3 | Determine if the buffer is active. | [
{
"docid": "1490e10d18f7e5ab03b65e06a91eb8a0",
"score": "0.77272785",
"text": "def active?\n @session.request(:nvim_get_current_buf) == self\n end",
"title": ""
}
] | [
{
"docid": "363ff32b7505ee1121291340c5e609dc",
"score": "0.87460303",
"text": "def active?\n\t\t!@buffer.nil?\n\tend",
"title": ""
},
{
"docid": "5269022e96449ac0de70446c6fe808fe",
"score": "0.79005384",
"text": "def active?\n @session.request(:vim_get_current_buffer) == self\n ... |
5c7875fe696f4003a564af5dff88889b | DELETE /alumnos/1 DELETE /alumnos/1.json | [
{
"docid": "c755ffd25b616d27e99478e71a1f02f1",
"score": "0.7197423",
"text": "def destroy\n @alumno = Alumno.find(params[:id])\n @alumno.destroy\n\n respond_to do |format|\n format.html { redirect_to alumnos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
... | [
{
"docid": "9b117111b8c70954c9957522eaf1a069",
"score": "0.71922445",
"text": "def destroy\n @alumn = Alumn.find(params[:id])\n @alumn.destroy\n\n respond_to do |format|\n format.html { redirect_to alumns_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
... |
dcb9122055cc831472c7ecc03a284565 | Simple encoding has a resolution of 62 different values. Allowing five pixels per data point, this is sufficient for line and bar charts up to about 300 pixels. Simple encoding is suitable for all other types of chart regardless of size. | [
{
"docid": "3e637b0570188dfdfafd00ec116865e2",
"score": "0.66515183",
"text": "def simple_encoding(dataset=[])\n dataset = prepare_dataset(dataset)\n @max_value = dataset.map{|ds| ds.max}.max if @max_value == 'auto'\n \n if @max_value == false || @max_value == 'false' || @max_value == :false... | [
{
"docid": "90cc7783cb8c1f6f561e08d1f74dbffa",
"score": "0.60533607",
"text": "def decode_png_resample_8bit_value(value); end",
"title": ""
},
{
"docid": "c6ed61a9d9604baad3c59abf54183a80",
"score": "0.59998226",
"text": "def decode_png_resample_1bit_value(value); end",
"title": ... |
68060de4cc67606bc0c9fd91daffc9e2 | POST /uip_centers POST /uip_centers.json | [
{
"docid": "da82b7a22abd83e8073fbbaf95fde592",
"score": "0.72686845",
"text": "def create\n @uip_center = UipCenter.new(params[:uip_center])\n\n if @uip_center.save\n render json: @uip_center, status: :created, location: @uip_center\n else\n render json: @uip_center.errors, status: :u... | [
{
"docid": "d446b0fc20f50d9d390b9e4fe69c14f2",
"score": "0.6795171",
"text": "def create\n @breadcrumb = 'create'\n @center = Center.new(params[:center])\n @center.created_by = current_user.id if !current_user.nil?\n\n respond_to do |format|\n if @center.save\n format... |
4727c0c49cb396bb17a5849fbc050520 | Compare version of local +package+ with the one on the AUR. | [
{
"docid": "6c7dc4b391e6e7d27b60732830547ab9",
"score": "0.71282464",
"text": "def upgradable?(package, version)\n package = URI.escape(package.to_s)\n local_version = Version.new(version)\n remote_version = nil\n\n parse_json Aurb::SearchPath[:info, package] do |json|\n ... | [
{
"docid": "5cad30e008fda35fa25a89e6baa020d6",
"score": "0.70405716",
"text": "def import_package(package)\n result = Package.from_other_unit(package).has_greater_version(package).where(:package_branch_id => package.package_branch_id, :shared => true).order(\"version desc\").first\n if result.pres... |
6bfb25085ad3b5a1bad567e5b6812fa6 | returns a map of nfl team id to team | [
{
"docid": "6de12db7261806c172fecc6893ebedd6",
"score": "0.7860995",
"text": "def build_id_to_team_map(teams)\n id_to_team_map = {}\n teams.each { |team|\n id_to_team_map[team.id] = team\n }\n return id_to_team_map\n end",
"title": ""
}
] | [
{
"docid": "f2f01d778d9a6248d7b35b7332720e94",
"score": "0.85783845",
"text": "def build_team_map\n team_map = {}\n NflTeam.all.each { |team|\n team_map[team.id] = team\n }\n return team_map\n end",
"title": ""
},
{
"docid": "f2f01d778d9a6248d7b35b7332720e94",
"score": ... |
09c0520eb2d38b3c56fd4eba1b77ef23 | Gets the managedAppPolicies property value. Managed app policies. | [
{
"docid": "c8065298726c91cab672c00176454f9d",
"score": "0.85625696",
"text": "def managed_app_policies\n return @managed_app_policies\n end",
"title": ""
}
] | [
{
"docid": "249e3dbf444bb14033e7a528fc946411",
"score": "0.80798686",
"text": "def managed_app_policies=(value)\n @managed_app_policies = value\n end",
"title": ""
},
{
"docid": "f84b1f7b3887c5bca64816b2b5115d63",
"score": "0.7644023",
"text": "def app_manag... |
e512bdd2139e93806f5f5795664f1e93 | Close a file in the library. Closing a file will make it unavailable for checkout although it may still exist in the workspace. | [
{
"docid": "d73686c4809b927ef39c634c2266ffee",
"score": "0.62985116",
"text": "def close filename\n mutex.synchronize do\n @synchronized = false\n @current = nil if @current && @current.filename == filename\n catalog\n end\n end",
"title": ""
}
] | [
{
"docid": "90a656a9bf119605891c68379b509d2f",
"score": "0.70853484",
"text": "def close\n if(@t_file_p)\n begin\n ti_close(@t_file_p)\n @t_file_p = nil\n rescue\n puts \"Error closing file\"\n end\n end\n end",
"title": ... |
a28e478681ac9d29c5dd796aa824781d | PATCH/PUT /users/1 PATCH/PUT /users/1.json | [
{
"docid": "f20d919b6f5e929cb7db38e72eeb1b23",
"score": "0.0",
"text": "def update\n respond_to do |format|\n if @user.update(user_params)\n format.html { redirect_to :users, notice: '修改用户成功!' }\n format.json { render :users, status: :ok, location: @user }\n else\n form... | [
{
"docid": "f0686f191a0def3b6c3ad6edfbcf2f03",
"score": "0.7243395",
"text": "def update_user(email)\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/users/2.json'\n ).to_s\n\n puts RestClient.patch(\n url,\n { user: { email: email } }\n ... |
b084cd6ede66a1b984ded5c1de82aea1 | Removes the highest priority element that has longest been in the queue. If the queue is empty, block until a new element is added. | [
{
"docid": "18e6c8761a036e03ac9fe05f5ce6f64f",
"score": "0.6570019",
"text": "def pop\n @mutex.synchronize do\n if size==0\n @waiting_threads << Thread.current\n @queue_wait.wait(@mutex)\n end\n @waiting_threads.delete Thread.current\n @queue.shift\n ... | [
{
"docid": "e2c476ba196df676d444f596f87cb269",
"score": "0.73239094",
"text": "def pop\n queue.sort!\n queue.delete_at(queue.size - 1)\n end",
"title": ""
},
{
"docid": "ab7b7f6d56fe29e918c1463fff55b356",
"score": "0.7114483",
"text": "def poll\n raise 'Cannot dequeue eleme... |
d3a88d22dc253e9ebafabebee3fd8b5e | User leaves the company | [
{
"docid": "e67ec1823b444a49935198c351c01da1",
"score": "0.8180345",
"text": "def leave\n if current_user.company == @company\n current_user.update_attribute(:company_id, nil)\n current_user.update_attribute(:company_admin, false)\n redirect_to projects_path and return\n end\n end"... | [
{
"docid": "7a045244f8b881798002be7c165f4c5c",
"score": "0.6650434",
"text": "def leave(user_id)\n \n end",
"title": ""
},
{
"docid": "d0d9c1187eb57cb3e40b2cd1d3260683",
"score": "0.6618288",
"text": "def leave\n riak_admin 'leave'\n end",
"title": ""
},
{
... |
3b826b26e95f6641981684ee5ff65358 | Provide a user friendly representation | [
{
"docid": "3ab3bb40f62b633f13d1ab20b7f7a7f5",
"score": "0.0",
"text": "def to_s\n '<Twilio.FlexApi.V1.InsightsConversationsPage>'\n end",
"title": ""
}
] | [
{
"docid": "8813d23ea53482a215f5e5b971468e2d",
"score": "0.75752455",
"text": "def representation; end",
"title": ""
},
{
"docid": "dad7e7041772f906c35bc43f5390a274",
"score": "0.70985687",
"text": "def to_human\n super\n end",
"title": ""
},
{
"docid": "1e72b... |
747320c24196dece230e82021f8aabb6 | POST /lab_ad_sizes POST /lab_ad_sizes.json | [
{
"docid": "10ea21bf1e4c73dfc7719cdaf9d763b5",
"score": "0.6884268",
"text": "def create\n @lab_ad_size = LabAdSize.new(lab_ad_size_params)\n\n respond_to do |format|\n if @lab_ad_size.save\n format.html { redirect_to @lab_ad_size, notice: 'Lab ad size was successfully created.' }\n ... | [
{
"docid": "09f2e66da617bbb8f01e05caac2119de",
"score": "0.6824502",
"text": "def lab_ad_size_params\n params.require(:lab_ad_size).permit(:is_active, :size_name, :sort_order, :mediaTypeID)\n end",
"title": ""
},
{
"docid": "fe5a5130b4d18c7437cabe2cb1946fde",
"score": "0.66839886... |
4ac43d53bc5e9c4a39a6710b977d8655 | list or watch objects of kind Secret | [
{
"docid": "f99287ac8f72af2476b14de9b7f0a127",
"score": "0.0",
"text": "def list_secret_for_all_namespaces(opts = {})\n data, _status_code, _headers = list_secret_for_all_namespaces_with_http_info(opts)\n return data\n end",
"title": ""
}
] | [
{
"docid": "fa56f7960881e2b2f98a17a96acaf9c8",
"score": "0.66657877",
"text": "def index\n @secrets = Secret.all\n end",
"title": ""
},
{
"docid": "3d4c2aa055a8c4d28df15c22f046d72a",
"score": "0.6407919",
"text": "def list\n #only admin can use Get request to see other's info\... |
3ee88c07effcc171085def310f187130 | login from http auth unused admin area password stuff | [
{
"docid": "1cce6cb690641bf15d7044c94222aff1",
"score": "0.0",
"text": "def get_auth_data \n auth_data = nil\n [\n 'REDIRECT_REDIRECT_X_HTTP_AUTHORIZATION',\n 'REDIRECT_X_HTTP_AUTHORIZATION',\n 'X-HTTP_AUTHORIZATION', \n 'HTTP_AUTHORIZATION'\n ].each do |key|\n if reque... | [
{
"docid": "76784183ae3bcc30c25811cd644ee3c7",
"score": "0.7604212",
"text": "def http_login\n user = APP_CONFIG['admin_username']\n pwd = APP_CONFIG['admin_pwd']\n page.driver.browser.authorize(user, pwd)\n end",
"title": ""
},
{
"docid": "75f2d1f8259b0fab724b7f5bbe899a49",
"s... |
001c44a0552628f3606fbe53874a8111 | ["$GNRMC", "061414.000", "A", "6046.6769", "N", "04619.2771", "E", "0.08", "201.75", "050118", nil, nil, "D74"] | [
{
"docid": "e44fdee5986e91ce4b8ffca85535806c",
"score": "0.0",
"text": "def read\n prev_hash = nil\n\n CSV.open(nmea_file, 'r').each do |row|\n timestamp = Time.strptime(\"#{row[9]} #{row[1]}\", '%d%m%y %H%M%S.%L')\n next if timestamp.year < 1990\n\n speed = (row[7].to_f *... | [
{
"docid": "5fd88a2514c0bd0eb0339068d8b311cd",
"score": "0.55527115",
"text": "def km_get_reacid(data)\n return data.map{|d| d.scan(/(?<r>R\\d{5})/)}.flatten.sort\nend",
"title": ""
},
{
"docid": "8f0111bf913f28b4678879f2090d2c9b",
"score": "0.54854476",
"text": "def to_a str\n str... |
92cc62a785a42ce8b9982cb36d2c6e72 | Returns the calculated IMC of an Anthropometric | [
{
"docid": "465ed27d811b389e9b013b1ed4a7e950",
"score": "0.6120474",
"text": "def imc\n\t\treturn (@weight/@height**2).round(2)\n\tend",
"title": ""
}
] | [
{
"docid": "cfae9a1957fde20877bc1d6025fc9b02",
"score": "0.7927386",
"text": "def IMC()\n\t\treturn @masa / (@altura * @altura) \n\tend",
"title": ""
},
{
"docid": "840732cf74117fe923e5a2ff8ac09c29",
"score": "0.7800028",
"text": "def imc\n\t\tpeso/(talla*talla)\n end",
"t... |
2b0321cd50e05b9c81090b355a448972 | For an absolute quantity, colleague is the corresponding relative quantity. Viceversa, for a relative quantity, colleague is its absolute quantity. | [
{
"docid": "5bb5584a34059c712a66c2633f84733c",
"score": "0.4981541",
"text": "def colleague\n @colleague ||= construct_colleague\n end",
"title": ""
}
] | [
{
"docid": "1c5588dc8805c0e84f103fcec9c04a17",
"score": "0.6398176",
"text": "def set_colleague q2\n raise SY::DimensionError, \"Mismatch: #{self}, #{q2}!\" unless\n same_dimension? q2\n raise SY::QuantityError, \"#{self} an #{q2} are both \" +\n \"{relative? ? 'relative' : 'absolute'}!\... |
97448d5bf8fe5d8909563e75bcbd31ec | Converts 1 of 15 game strings into 9x9 arrays for one game. | [
{
"docid": "d7d320a367934a32377140349d428126",
"score": "0.5695612",
"text": "def row_formatter(game)\n els = game.chars\n rows = els.each_slice(9).to_a\n rows\nend",
"title": ""
}
] | [
{
"docid": "a3c06802dfda124c77eedfbfd15f200c",
"score": "0.737401",
"text": "def convert(board_string)\n board = []\n board_array = board_string.chars\n 9.times do\n board << board_array.slice!(0..8)\n end\n board\nend",
"title": ""
},
{
"docid": "62ab33a2fb3608e527ae3ba7896ab838",
... |
5ca4be6a363e10fd9d3b03005fe4736c | enters data into a text field | [
{
"docid": "b0e6228ec979c59fd2a8769e5f687ed9",
"score": "0.635643",
"text": "def text_field_enter(value)\n control = @field.all(:css, 'input[type=\"text\"]').first\n control.set \"#{value}\"\n end",
"title": ""
}
] | [
{
"docid": "39293ecaab181c801dd60c30f30242b2",
"score": "0.6970831",
"text": "def text_edit_text; end",
"title": ""
},
{
"docid": "8d4ca7bcf3ce92afbd413dc37f121af3",
"score": "0.6919285",
"text": "def text= txt\n \n end",
"title": ""
},
{
"docid": "8d4ca7bcf3ce9... |
cd7aa7a66fcdbb7ea0cc127e5a66bc57 | first and second may not be nil. | [
{
"docid": "7d1fda8a0aa622f9945ce9e92c40dda2",
"score": "0.5656496",
"text": "def initialize first, second, *others\n raise ArgumentError if first.nil?\n raise ArgumentError if second.nil?\n @components = [first, second] + others\n update_hash\n end",
"title": ""
}
] | [
{
"docid": "84a47633fd17f4031189fa8a00ed7efe",
"score": "0.6777927",
"text": "def all_or_none_specified(first, second)\n first_specified = (first.nil? or first == '') ? false : true\n second_specified = (second.nil? or second == '') ? false : true\n return !(first_specified ^ second_specified)\nend"... |
708abac6d6b4369a4a32b8b173d78a37 | Setup common hash and array elements | [
{
"docid": "2444d02a95c30783cb4e15256c86b6b1",
"score": "0.0",
"text": "def complex_type_start(key)\n case @complex_type.last\n when :hash\n @key_components.push(key)\n when :array\n @key_components.push(@array_positions.last)\n @array_positions[-1] += 1\n... | [
{
"docid": "72e1f5fbd3e915b1dd119ebb5819832c",
"score": "0.6445198",
"text": "def assume_unordered_arrays=(_arg0); end",
"title": ""
},
{
"docid": "c09a6cb976ff8e82243e96da37f14ab3",
"score": "0.6299247",
"text": "def fill_driver_hash(data_array, hash_container)\n data_array[1].each... |
bcdca0342ebe66ac313639fd2918988a | GET /audit_logs/1 GET /audit_logs/1.xml | [
{
"docid": "bc3ec9c9202b5698cb5e160e9cbcb0fc",
"score": "0.7229155",
"text": "def show\n @audit_log = AuditLog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @audit_log }\n end\n end",
"title": ""
}
] | [
{
"docid": "ab0ac5fcf406bc8ba37efd28ea3645da",
"score": "0.72624826",
"text": "def retrieve_audit_log(audit_log_id)\n start.uri('/api/system/audit-log')\n .url_segment(audit_log_id)\n .get()\n .go()\n end",
"title": ""
},
{
"docid": "bf86ba21969a507a3a4a... |
23dc615459b847d5d3a165834ba4a3f9 | check to see if the user has created more than the max number of contacts | [
{
"docid": "63651c7a5ea841d2ead5fa0e720af69d",
"score": "0.8286008",
"text": "def max_contacts\n return if self.user.nil? || self.user.email.nil?\n users = UserDefaultEmail.where user_id: self.user_id\n if users.count > MAX_CONTACTS\n errors.add(:base,'A maximum of 10 co... | [
{
"docid": "cdae526368b1314d0d9570e9056425de",
"score": "0.6885406",
"text": "def check_the_team_limit_per_user\n errors.add(:teams, \"Cannot create more than #{TEAM_LIMIT_PER_USER} per user\") if user && user.teams.count >= TEAM_LIMIT_PER_USER\n end",
"title": ""
},
{
"docid": "b58ff1ff... |
1197454aa8e8ac1f1e3aea70780ab331 | funcao que converte de hexadecimal para binario | [
{
"docid": "e7a25db34e57d3bac453ad009cd18b53",
"score": "0.7940974",
"text": "def converteHexToBin(x)\n\t\tsaida=\"\"\n\t\tfor i in 0..(x.size-1)\n\t\t\tsaida+=x[i].hex.to_s(2).rjust(x[i].size*4, '0')\n\t\tend\n\t\tputs saida\n\t\treturn saida\n\tend",
"title": ""
}
] | [
{
"docid": "7ee8bd214dcaa71aad70924d8eb64d5f",
"score": "0.8073681",
"text": "def converteBinToHex(x)\n\t\tsaida=\"\"\n j = 0\n while j < x.size-1\n #Aqui pegamos 4 bits e os convertemos para hex\n saida+=x[j..j+3].to_i(2).to_s(16)\n j+=4\n end\n\t\treturn saida\n\tend",
"tit... |
479e2db263c2b2d2b940679c4a4904de | Accessor to allow safe access to a potentially uninitialized type catalog | [
{
"docid": "f48d89e360a5254ad4bb452713648f8e",
"score": "0.776921",
"text": "def type_catalog\n if @type_catalog\n @type_catalog\n else\n raise \"Type catalog must be set before use\"\n end\n end",
"title": ""
}
] | [
{
"docid": "64393c3349e6dc873c61999bbdf7396d",
"score": "0.6640795",
"text": "def type_catalog=(tc)\n @type_catalog = tc\n end",
"title": ""
},
{
"docid": "b42100ccff608abc992f3223a4d3f0aa",
"score": "0.6050856",
"text": "def type; @type ||= registry.get(typename) end",
"titl... |
d646a8d0c44e5d033f39c274a2796cee | Helper defs This method is to run a given test or set of tests that have a dependency on a fixture being loaded Inputs: (String) testDirPath = path to a directory of tests or a single feature file (starting in acceptancetests directory) Inputs: (String) collectionName = name of mongo collection to load fixture data to ... | [
{
"docid": "ed33fbe5bd7af110046f5780de7a4760",
"score": "0.8042345",
"text": "def runFixtureAndTests(testDirPath, collectionName, fixtureFileName)\n setFixture(collectionName,fixtureFileName) {runTests(testDirPath)}\nend",
"title": ""
}
] | [
{
"docid": "5b5ff5d847506ccbc65e9f595502c90f",
"score": "0.62628454",
"text": "def run\n test_files.each do |file|\n eval File.read(file)\n end\n\n results = []\n @tests.each_pair do |name, test|\n results << test.call(@config)\n end\n ... |
225f6b36d610171b5276e9fcad34c39e | Public: Write a value to a digital pin. pin The Integer pin to write to. value The value to write (HIGH or LOW). Returns nothing. | [
{
"docid": "f6f95310739d470db474ecbbe5cd622b",
"score": "0.8131952",
"text": "def digital_write(pin, value)\n port = (pin / 8).floor\n port_value = 0\n\n @pins[pin].value = value\n\n 8.times do |i|\n port_value |= (1 << i) unless @pins[8 * port + i].value.zero?\n end\n\n ... | [
{
"docid": "3185ccb3ba419163b09f5ff550f5d686",
"score": "0.80974424",
"text": "def write pin, value\n if value == 0\n set_int_at(GPCLR0 + PI_BANK(pin), PI_BIT(pin))\n else\n set_int_at(GPSET0 + PI_BANK(pin), PI_BIT(pin))\n end\n end",
"title": ""
},
{
"docid": "4866446857... |
1cbd192fbf71cf4d070466d21472a325 | GET /rates/new GET /rates/new.json | [
{
"docid": "4f51a41483730ccce0243eb1ad2961de",
"score": "0.81329334",
"text": "def new\n @rate = Rate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @rate }\n end\n end",
"title": ""
}
] | [
{
"docid": "9fa5988c9fee9fb8a44990e9f784e912",
"score": "0.8100157",
"text": "def new\n @rate = @shop.rates.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @rate }\n end\n end",
"title": ""
},
{
"docid": "0260b561cb76b6762d8c14f745... |
8b09ea016aa86913f8415a6b16c6677e | DELETE /stamps/1 DELETE /stamps/1.json | [
{
"docid": "c3d2559079d031dda3aad92c3b0f7a80",
"score": "0.7367961",
"text": "def destroy\n @stamp.destroy\n respond_to do |format|\n format.html { redirect_to stamps_url, notice: 'Stamp was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
... | [
{
"docid": "7068731c460956e3600015429397e757",
"score": "0.7187104",
"text": "def destroy\n @stamp = current_user.stamps.find(params[:id])\n @stamp.destroy\n\n respond_to do |format|\n format.html { redirect_to(stamps_url) }\n format.xml { head :ok }\n end\n end",
"title": ""... |
0949eb828632f9014cfc01d42ad6fa0a | ! /usr/bin/env ruby Checks if a character is a digit | [
{
"docid": "1e165df795b22cb78490cd3676f9b1ff",
"score": "0.7688716",
"text": "def is_digit(char)\n char.match?(/[0-9]/)\nend",
"title": ""
}
] | [
{
"docid": "6150f2f50ebd666fdd2fa9cd0e481b58",
"score": "0.8027789",
"text": "def digit?(char)\n ('0'..'9') === char\n end",
"title": ""
},
{
"docid": "ca78180612496dcfab0e76db25bdf253",
"score": "0.7884131",
"text": "def digit?(character)\n character =~ /[[:digit:]]/\n e... |
1ba567210c2ecf3a81476e1b5eadbbe8 | Example usage: Sidekiq::Client.remove_all_delayed(MyWorker, 'foo', 1, :bat => 'bar') Returns the number of jobs removed This method can be very expensive since it needs to scan through the delayed queues of all timestamps | [
{
"docid": "787329c5579a3be46eacc0d4cfc31c2e",
"score": "0.6857033",
"text": "def remove_all_delayed(klass, *args)\n remove_all_delayed_from_queue(nil, klass, *args)\n end",
"title": ""
}
] | [
{
"docid": "c359ac4558733d9169d56cc8d30b5dbf",
"score": "0.75909656",
"text": "def remove_all_delayed_from_queue(queue, klass, *args)\n count = 0\n item = {'class' => klass.to_s, 'args' => args}\n item['queue'] = queue.to_s if queue\n search = MultiJson.encode(item)\n Array(Side... |
94be6b9e078b707ea8bb02651dcdc268 | puts add_item(grocery_list, 'pear', 2) Method to remove an item from the list input: list, item name steps: define remove_food_item method take in list (updated) remove desired item (key) | [
{
"docid": "0cbb0038c77427982ba18a7508678da5",
"score": "0.825841",
"text": "def remove_item(grocery_list, item)\r\n\tgrocery_list.delete(item)\r\n\tgrocery_list\r\nend",
"title": ""
}
] | [
{
"docid": "40eb6997c6f51cf200d9f76ab8f28bd4",
"score": "0.8298956",
"text": "def remove_item(grocery_list, item)\n grocery_list.delete(item)\n grocery_list\nend",
"title": ""
},
{
"docid": "40eb6997c6f51cf200d9f76ab8f28bd4",
"score": "0.8298956",
"text": "def remove_item(grocery_l... |
d5fbd2e623d35c31ca1e0c93327731a9 | To avoid tampering we turn the origin body into a hash and copy some of the protocol keys like :ttl and :msg_time into the hash before hashing it. This function compares and updates the unhashed ones based on the hashed ones. By default it enforces matching and presense by raising exceptions, if ssl.enforce_ttl is set ... | [
{
"docid": "80c1143cd2b8283920a6ea6175b76219",
"score": "0.4493655",
"text": "def update_secure_property(msg, secure_property, property, description)\n req = request_description(msg)\n\n unless @config.pluginconf[\"ssl.enforce_ttl\"] == \"0\"\n raise \"Request #{req} does not have... | [
{
"docid": "b7ac124343787884c038f79e9b3c4b2a",
"score": "0.544703",
"text": "def validate_update(body, headers)\n unless @secret\n raise AppSecretNotDefinedError, \"You must init RealtimeUpdates with your app secret in order to validate updates\"\n end\n\n request_signature... |
6f4a9148ba467fc55b23244ce1c928da | remotely issues the command to mount the given volume | [
{
"docid": "31a29e52f129d3968d6675075228e17d",
"score": "0.8202266",
"text": "def mount! volume\n return :mounted if successful_remote_command?(\"mount #{volume.device} #{volume.mount_point}\")\n end",
"title": ""
}
] | [
{
"docid": "d41382c23dae263d030722d4bcbde6f3",
"score": "0.74547",
"text": "def mount(mount_name, params)\n dupe_check!(mount_name, params)\n local = mkmountpoint(params[:local])\n volname = params[:volname] || mount_name\n cmd = \"#{sshfs_cmd} \" \\\n \"#{Shellwords.escape(params[:... |
96bee3fc367f3691d3a952d0b6553e82 | TODO eventually merge with Waiter.parse_serie | [
{
"docid": "be8325a7b8af711fd972028d375565b9",
"score": "0.0",
"text": "def message_match?(msg_s, ountil)\n\n return false unless ountil\n\n ms = msg_s; ms = [ ms ] if ms.is_a?(Hash)\n\n nid, point = ountil.split(' ')\n\n ms.find { |m| m['nid'] == nid && m['point'] == point }\n en... | [
{
"docid": "b325e94947a9a4ee8640ba9ebe1c36d1",
"score": "0.5519467",
"text": "def parse_send_job(j)\n kind = j.at_xpath(\"KindOfJob/JobType\").text.downcase\n date = parse_date j.at_xpath('JobTime/CreateTime')\n failed = j.at_xpath('JobResult/Result').text != 'End'\n\n {\n job_id: ... |
6a968af60f3e5eb1b477e973c8810462 | GET /digital_objects/1 GET /digital_objects/1.xml | [
{
"docid": "2fcf41dc090929a896f6dff777956728",
"score": "0.74680376",
"text": "def show\n @digital_object = DigitalObject.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @digital_object }\n end\n end",
"title": ""
}
] | [
{
"docid": "ab78e1e430014eb3b1b2898d82df8cc0",
"score": "0.6718625",
"text": "def index\n puts params.inspect\n @digital_objects = JSON[access_token.get(\"/api/v1/digital_objects/my\").body]\n @tags_obj = JSON[access_token.get(\"/api/v1/tags\").body]\n @contacts = JSON[access_token.get(\"/ap... |
3f62f36cd4cf21a2ca88b26fd7fbcd3f | Removes this region items from this region definitions. | [
{
"docid": "1e8ec659f77f4c5a3b21a8c4061ae307",
"score": "0.597843",
"text": "def remove_region_item(opts)\n opts = check_params(opts,[:items])\n super(opts)\n end",
"title": ""
}
] | [
{
"docid": "698685e110a1e6df90acebd5287579d2",
"score": "0.74078846",
"text": "def remove_all_region_items\n super\n end",
"title": ""
},
{
"docid": "e35fae16670a634fe23358b2d7a6a73b",
"score": "0.70259595",
"text": "def delete_all_region_definitions\n super\n end",
... |
c41c7b257b8113a7268f73ac777dda61 | DELETE /tasks/1 or /tasks/1.json | [
{
"docid": "3e861b634d0c00e9b1f8242e169c269b",
"score": "0.7418238",
"text": "def destroy\n @task = Task.find(params[:id])\n if @task\n @task.destroy\n render json: { message: 'Task successfully deleted.' }, status: 200\n else\n render json: { error: 'Unable to delete Task' }, st... | [
{
"docid": "8379665eb11157da423e4d478103f0b0",
"score": "0.76153606",
"text": "def delete_task\n Task.find(params['task_id']).destroy\n render json: {success: true}\n end",
"title": ""
},
{
"docid": "9d5e7fb54fb48465ffe5dcad22720803",
"score": "0.7556524",
"text": "def delete_... |
9e25d4440ab1999386d911d16791a823 | The deserialization information for the current model | [
{
"docid": "1a4fda9405f24be12ec8f5444ab82a9f",
"score": "0.62130165",
"text": "def get_field_deserializers()\n return {\n \"cameraMake\" => lambda {|n| @camera_make = n.get_string_value() },\n \"cameraModel\" => lambda {|n| @camera_model = n.get_strin... | [
{
"docid": "613f62eeb3655523fae5d548dc6e7875",
"score": "0.6580273",
"text": "def get_field_deserializers()\n return {\n \"downloadUrl\" => lambda {|n| @download_url = n.get_string_value() },\n \"fileName\" => lambda {|n| @file_name = n.get_string_val... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "86cfc8f8e870eb417fee9c3b1a1dc79c",
"score": "0.0",
"text": "def ingredient_params\n params.require(:ingredient).permit(:name, :amount, :recipe_id)\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.69802505",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6781974",
"text": "def strong_params\n params.requ... |
c5f060efec2566694336c780a56865a1 | string Account company name | [
{
"docid": "7433303d70f3b3d43a85e9439d979bdf",
"score": "0.73020875",
"text": "def company_name\n @attributes[:company_name]\n end",
"title": ""
}
] | [
{
"docid": "513d7b74198a1bfe50e3cce614ff8e68",
"score": "0.78338504",
"text": "def company_name\n return @company_name\n end",
"title": ""
},
{
"docid": "513d7b74198a1bfe50e3cce614ff8e68",
"score": "0.78338504",
"text": "def company_name\n ret... |
d357c935caa20096c6f09b45ef190d46 | loop over each module of a certain type | [
{
"docid": "6937ba021755a0d5389d535fb8df0e13",
"score": "0.71080047",
"text": "def each_module_of_type(type, &block)\n abort(\"undefined type #{type}\") unless [:git, :archive].include?(type)\n ((@repos || {})[type] || {}).values.each do |repo|\n yield repo\n end\n end... | [
{
"docid": "605c8f17bb72985634c970054d3d5121",
"score": "0.7318855",
"text": "def each_module &blk\n (@@each_module ||= find_modules(::Object)).each(&blk)\n end",
"title": ""
},
{
"docid": "c938fd1b16fdc9ec8ada65772e062a9c",
"score": "0.7111208",
"text": "def all(type=nil)\n ... |
959004368e84471d3d9a355509d3d3d6 | Starts a new benchmark clock and returns the index of the new clock. If .start! is called again before .end! then the time returned will be the elapsed time from the next call to start!, and calling .end! again will return the time from this call to start! (that is, the clocks are LIFO) | [
{
"docid": "083792c138bee1902c63b0f094fd5efe",
"score": "0.7174932",
"text": "def start!\n (@benchmarks ||= []) << Time.now\n @current = @benchmarks.size - 1\n end",
"title": ""
}
] | [
{
"docid": "397e71b72eb0dac078b32859f45c4fe9",
"score": "0.7087354",
"text": "def start!\n (@benchmarks ||= []) << Time.now\n @current = @benchmarks.size - 1\n end",
"title": ""
},
{
"docid": "67c81cb909bea917cfecebc9566b23a3",
"score": "0.706405",
"text": "d... |
c494851d4727024775da05131d9d4fd7 | content elements that are empty are preserved by xmlsimple and will result in the structures being considered different even if functionality the same strip any empty ones to avoid. | [
{
"docid": "55789e3de254ae10016f7f4c68107b68",
"score": "0.60187644",
"text": "def compact_content(node)\n if node.is_a?(Array)\n node.map! do |element|\n compact_content(element)\n end\n elsif node.is_a?(Hash)\n if node['content'] and node... | [
{
"docid": "0bdf2c861a7c60024fa9d34cd569f1f7",
"score": "0.658839",
"text": "def empty_content?(element); end",
"title": ""
},
{
"docid": "de1f429446831442dce922d965af4d7e",
"score": "0.6337479",
"text": "def clear_empty_text_nodes(xml_doc)\n xml_doc.root.children.each { |t| t.con... |
408f2267cb98c36773977cb170be995e | Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.mailer.invitation.subject | [
{
"docid": "142062b3b5d8cd7b4d6280cfffc38158",
"score": "0.0",
"text": "def invitation(invitation, signup_url)\n @invitation = invitation\n @signup_url = signup_url\n\n attachments.inline['logo.jpg'] = File.read(\"#{Rails.root}/app/assets/images/emails/logo.jpg\")\n attachments.inline['accep... | [
{
"docid": "ea740e704e8f1173fb87b45dfcaaf989",
"score": "0.7686354",
"text": "def subject_for(key)\n I18n.t(:subject, scope: [:mailer, key])\n end",
"title": ""
},
{
"docid": "8928fe4f050d7ebd3e9aa992b07e320a",
"score": "0.75028914",
"text": "def subject_for\n ActiveSuppor... |
b724ca343c6b7c4c4a8206661d6dab70 | GET /posts GET /posts.json | [
{
"docid": "c14aa93925d30743bdc4040395cab79a",
"score": "0.0",
"text": "def index\n if PostSetting.all.count > 0\n @posts = Post.order(\"created_at desc\").paginate(:page => params[:page], :per_page => PostSetting.last.posts_per_page)\n else\n @posts = Post.order(\"created_at desc\").pag... | [
{
"docid": "915c0178f9e4347098d8a463c2cbe6b0",
"score": "0.7865315",
"text": "def show\n @posts = Post.find(params[:id])\n render json: @posts\n end",
"title": ""
},
{
"docid": "9e4bfaa87507d05255fbaeadc1ecb1d6",
"score": "0.7494904",
"text": "def index\n @posts = Post.all\... |