query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
fbdd563ce8399846bfeda1066437cc88
chute to an attached block.
[ { "docid": "09b1b9db51c437bad923c82223cfe626", "score": "0.0", "text": "def double_open pigs, corn\n open( pigs ) do |f1|\n open( corn ) do |f2|\n yield f1, f2\n end\n end\nend", "title": "" } ]
[ { "docid": "c4bb08029a9b26bf51c4299aece95e3b", "score": "0.6597517", "text": "def block(&_block)\n @_block = _block\n end", "title": "" }, { "docid": "8530df2e7158f0cb06d819cd2286927a", "score": "0.629643", "text": "def promote_block(&block)\n @promote_block = block ...
9b4c82511e98a217c6f5b8761551af2a
Returns +true+ if the RETR command may be applied to the file.
[ { "docid": "63ee28a6c1e468a8526690458e7a10b3", "score": "0.0", "text": "def readable?; end", "title": "" } ]
[ { "docid": "a905e18aae07ca2f39cd251f61ce39fd", "score": "0.6002414", "text": "def rsync?\n result = File.readable? rsync\n error \"No rsync found! (expecting #{rsync})\" unless result\n result\n end", "title": "" }, { "docid": "11001ec06080893daa908958b2cccaaa", "score": "0.58...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "3eb71bf50e68622264af628a2dd3286b", "score": "0.0", "text": "def edetailing_status_params\n params.require(:edetailing_status).permit(:mark, :product, :country, :framework, :state, :note,'last_change', 'last_change(i)', 'last_change(1i)', 'last_change(2i)', 'last_change(3i)', :project_ma...
[ { "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...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "236f6fa849bf9e2b1846e85d3bbafe55", "score": "0.0", "text": "def set_planting\n @planting = Planting.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "d...
2a59e98db751ca3ceda186661fde253d
If the password is expiring soon, return the number of days left Othewise return nil
[ { "docid": "876d9918c613af71f7201e7fc21bf41a", "score": "0.7514517", "text": "def password_expiring_soon?\n set_default_password_expiration\n return unless password_updated_at < (self.class.expire_password_after - self.class.remind_days_before).days.ago\n\n ((password_updated_at - self.class.ex...
[ { "docid": "0e4d3a0b3abd3219cffbddcded73f402", "score": "0.79196316", "text": "def days_to_password_expiry\n return if session[:password_updated]\n\n current_user.days_to_password_expiry\n end", "title": "" }, { "docid": "a060a0564bf11625607c04c2934e42ad", "score": "0.743085", ...
f931afdc7087fc7776db12f40d1de6b3
GET /fornecedores/new GET /fornecedores/new.json
[ { "docid": "eb167a77b5d3246923ebd2c3a2580770", "score": "0.7627889", "text": "def new\n @fornecedor = Fornecedor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fornecedor }\n end\n end", "title": "" } ]
[ { "docid": "f73ccb254910b2837edfc037bae393d9", "score": "0.78605723", "text": "def new\n @resposta = Resposta.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resposta }\n end\n end", "title": "" }, { "docid": "237f64eb79ee0bae83b0...
8ee72932ef69df11e88b53564d853e59
Returns the object in the form of hash
[ { "docid": "2ab87d4cc81b619abf3f82a3a3937c4d", "score": "0.0", "text": "def to_hash\n hash = super\n VnicFcAdapterPolicy.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n if value.nil?\n is_nullable = VnicFcAdapterPolicy.openapi_nullable.include?(attr)...
[ { "docid": "027facb8b195665ceeb78f2c171e2881", "score": "0.8270299", "text": "def to_hash\n object\n end", "title": "" }, { "docid": "d730a9ea60df6695b2c6a153d7d3a8b7", "score": "0.794916", "text": "def hash\n as_hash.hash\n end", "title": "" }, { "docid":...
c08ace58ed6a50709feaaf1283a5957f
Returns the joins (as an array suitable for usage with ActiveRecord)
[ { "docid": "dacee63ef793fc8538e83678e7df38af", "score": "0.74555963", "text": "def joins\n @joins.join(\" \")\n end", "title": "" } ]
[ { "docid": "35a9b7b3d0656a694989e03bcb3c53a5", "score": "0.8216323", "text": "def joins\n @joins ||= (self.columns.reject(&:virtual).map(&:column_source).reject(&:blank?).map(&:to_s) + self.class.joins).uniq\n end", "title": "" }, { "docid": "e3914a44df15790e4f99fa7d059c9495", "score...
a8f6fcb96a118b8191d436ab7812a300
determines if result has already appeared so we don't repeat results
[ { "docid": "ecbf3d31ebdb7f62227486be519a5fcf", "score": "0.7449843", "text": "def is_result_dupe? result\n\n if !@results_dedupe_map\n @results_dedupe_map = []\n end\n\n if result.size > 100\n result = result[0..99]\n end\n\n result.downcase!\n result = result.gsub(/\\s+/, \"...
[ { "docid": "d190d4148c874c11cbfbfff58c8ea8de", "score": "0.6547722", "text": "def not_researched!\n @empty_result = true\n end", "title": "" }, { "docid": "79fa78f61e103a4d61478156cc37bfc2", "score": "0.6520831", "text": "def more_results?()\n #This is a stub, used...
7c9b44e785fabd3ec3e55293d25bdc3b
Get a child of this entry with the given name. This MUST always return a child, even if it is NonexistentFSObject. Overriders should take caution not to do expensive network requests to get the list of children to fulfill this request, unless absolutely necessary here; it is intended as a quick way to traverse a hierar...
[ { "docid": "a5c0d7b3e77702e678f4ae5a053b00e0", "score": "0.8243392", "text": "def child(name)\n if can_have_child?(name, true) || can_have_child?(name, false)\n result = make_child_entry(name)\n end\n result || NonexistentFSObject.new(name, self)\n end", ...
[ { "docid": "bc3ec9825e539f81601f94e6a8aa6df7", "score": "0.80719787", "text": "def child(name)\n possible_child = make_child_entry(name)\n if possible_child.name_valid?\n possible_child\n else\n NonexistentFSObject.new(name, self)\n e...
4f74f96b0f40a3013fde62fb696963e1
end the arguments method define what happens when the measure is run
[ { "docid": "f7cd71b628c07f1c4fd565482e915c8b", "score": "0.0", "text": "def run(model, runner, user_arguments)\n super(model, runner, user_arguments)\n\n #use the built-in error checking\n if not runner.validateUserArguments(arguments(model), user_arguments)\n return false\n end\n\n ...
[ { "docid": "a2dd09cfd832ed391005833a8d9c1c5c", "score": "0.63879776", "text": "def measure(*args)\n raise RuntimeError,\n 'Ruler#measure called, but should be redefined by a real ruler.'\n end", "title": "" }, { "docid": "df1737ac90b4bc30e887a5813a4382f0", "score": "0.6341...
60233590bc8578ab7543fc14143151bb
Callback run immediately before +validate+.
[ { "docid": "bd46924e94cd0c3a9c1e13f2b9df5003", "score": "0.72515", "text": "def before_validate\n end", "title": "" } ]
[ { "docid": "6aead6bb787ca10db7f07a828b3b1877", "score": "0.7813876", "text": "def validate\n execute_callback(:before, :validate)\n super\n execute_callback(:after, :validate)\n end", "title": "" }, { "docid": "929ea740d5884d6078393c69a1ed8e3a", "score": "0.76265335", ...
f299121ffa8d0eb1ae79b2844d54e3ad
GET /buildings/1 GET /buildings/1.json
[ { "docid": "66f7e410d300e8e82e5ddaba4a0cc5bd", "score": "0.0", "text": "def show\n @building = Building.find(params[:id])\n @flat=Flat.find(params[:flat_id])\n @approach_quality=Quality.find(@building.approach_quality_id)\n @interiors_quality=Quality.find(@flat.interiors_quality_id)\n @vi...
[ { "docid": "4b3debf4fe8b4dbfb1f1eb9e545a3ff4", "score": "0.7763158", "text": "def index\n @buildings = Building.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json :@buildings }\n end\n end", "title": "" }, { "docid": "91cc1d0a829bf87...
ff7234712c389c2a70ac32caaa75c728
Passes all `get_heirs` calls to the class that is holding the context, to ensure uniform handling of `get_heirs`.
[ { "docid": "32634affdff8ff8857c7656e27514cd2", "score": "0.7003569", "text": "def get_heirs\n @__context__.get_heirs\n end", "title": "" } ]
[ { "docid": "b16be9b56bc4a80a185ba91bfa768631", "score": "0.6021515", "text": "def get_heirs\n @root_error_handler.get_heirs\n end", "title": "" }, { "docid": "8016f60ef86649a8f68dad23dacc0e26", "score": "0.5190868", "text": "def drive_hi\n each(&:drive_hi)\n ...
2b66940c2ae8ee7b5be3170498aee4dc
Adjusts region values to limit depth of zoom. If either the width or the height is less than the minimum defined tile size, returns a region with the same starting coordinates and a width and height of the defined minimum tile size.
[ { "docid": "bab5380c30914acdb5ead679a1d31a76", "score": "0.6794571", "text": "def low_res_adjusted_region\n return params[\"region\"] unless region_requested_smaller_than_allowed?\n coordinates = params[\"region\"].split(',')\n x = coordinates[0]\n y = coordinates[1]\n \"#{x},#{y},#{IiifC...
[ { "docid": "f4f01a6a380e877485be454956177222", "score": "0.6157545", "text": "def tile_bounds\n tile = tile_number\n zoom = zoom_level\n sw = ::GeoMonitor::LatLngPoint.from_number(tile[:x], tile[:y], zoom).to_3857\n ne = ::GeoMonitor::LatLngPoint.from_number(tile[:x] + 1, tile[:y] - ...
1c95fe987fdd18f454e509efc24cbcbe
mark saved pixis if sold or closed
[ { "docid": "8f7b6b87b8b4c004084f3452b285c47c", "score": "0.64830434", "text": "def sync_saved_pixis\n SavedListing.update_status @listing.pixi_id, @listing.status unless @listing.active?\n end", "title": "" } ]
[ { "docid": "73d264a7936adcff45b49a577d127649", "score": "0.63311666", "text": "def mark_as_sold\n unless @listing.sold?\n @listing.update_attribute(:status, 'sold') if @listing.amt_left == 0\n else\n @listing.errors.add(:base, 'Pixi already marked as sold.')\n false\n end\n end"...
c0719c47ddc3fb377aa77c3d3e18799f
Public: Constructor json a hash representing the JSON configuration, expects to be handed the 'website' node of S3 configuration.
[ { "docid": "bd38c9af094cd32a04d50cf2fde29ada", "score": "0.5486341", "text": "def initialize(json = nil)\n if json\n @redirect = json[\"redirect\"]\n @index = json[\"index\"]\n @error = json[\"error\"]\n end\n end", "title": "" } ]
[ { "docid": "45ffdf1ef2b4e77f35fe4e80f4a0f9cf", "score": "0.7021647", "text": "def initialize(json = nil)\n if !json.nil?\n @id = json[\"id\"]\n @domain_name = json[\"domain-name\"]\n @origin_path = json[\"origin-path\"]\n @s3_access_origin_identity = json[\"s3-...
6840dfa8fc67e411a73139a707757e17
Creates the invitation(s) (is called after the new action is taken)
[ { "docid": "4a12230ecb371d985a3867f2b513d18f", "score": "0.67921454", "text": "def create\n users_params = params[:users] || {}\n emails = []\n users_params.each_value do |attrs|\n user = User.find_by(email: attrs['email'])\n if !user.present?\n user = User.new(email: attrs['em...
[ { "docid": "dd79ad68a77b0bab2c8aeb57ff5be80b", "score": "0.72887677", "text": "def create\n return forbidden('Only the commish can send an invite for a private league.') if !@league.public && !_is_commish_of?(@league)\n return forbidden('You are too late. The league is closed to new teams.') if @l...
c3871d5222723b5d7f73ef24ab11e035
Add more helper methods to be used by all tests here...
[ { "docid": "dffd54cc017b3446962aaa6dba9e17ed", "score": "0.0", "text": "def collection_fixtures(db, collection, *id_attributes)\n db[collection].drop\n Dir.glob(File.join(File.dirname(__FILE__), 'fixtures', collection, '*.json')).each do |json_fixture_file|\n #puts \"Loading #{json_fixture_fi...
[ { "docid": "62158baafece84b452b305badc5dd98c", "score": "0.701972", "text": "def helpers; end", "title": "" }, { "docid": "62158baafece84b452b305badc5dd98c", "score": "0.701972", "text": "def helpers; end", "title": "" }, { "docid": "62158baafece84b452b305badc5dd98c", ...
d4e72e76eb261b716208160a56a69dcf
Get a user favorites
[ { "docid": "767f6c97f7b3911aa901f3690bd845db", "score": "0.7863409", "text": "def get_user_favorites(user_id, limit)\n return fetch_pages_for(limit) do |limit, offset|\n @client.get(\"/users/#{user_id}/favorites\", :limit => limit, :offset => offset).map(&:id)\n end\n end", "titl...
[ { "docid": "a5c17e9aacde4ac71a80fc8d07cdcd49", "score": "0.87586844", "text": "def favorites\n handle_error { sendsecure_connection.get(\"api/v2/enterprises/#{@enterprise_account}/users/#{@user_id}/favorites.json\") }\n end", "title": "" }, { "docid": "a26830cda295014f8795b355040...
b96f7cf155af29543defba0bd75325d1
GET /signers GET /signers.json
[ { "docid": "1ecef46a9e661f01093a7d6838387f57", "score": "0.7603792", "text": "def index\n @signers = Signer.all\n end", "title": "" } ]
[ { "docid": "62d0ec773cce9620c4be7bb8e4be35a3", "score": "0.71301883", "text": "def index\n @signees = Signee.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @signees }\n end\n end", "title": "" }, { "docid": "0f3e2e2eefe9ec042df1...
228f3e6395d76f9a099b3e9a1aed798b
GET /outgoings/1 GET /outgoings/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "26ae1b4bed733a581524b8cd1013e49f", "score": "0.72523904", "text": "def index\n @outgoings = Outgoing.all\n end", "title": "" }, { "docid": "0a4c32f8f7ddc5bac3b3f02e1dcb2fe6", "score": "0.7198362", "text": "def show\n @outing = Outing.find(params[:id])\n\n respon...
03fb4f1ad8fc8fce331608b6baea5cb8
GET /specific_problems/1 GET /specific_problems/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "ab06b08a8983b269477a7f9a95c92d2b", "score": "0.7378856", "text": "def getProblems\n\t\tid = params[:id]\n\t\ttrack = Track.find(id)\n\t\tproblems = track.problems\n\t\trender json: problems\n\tend", "title": "" }, { "docid": "debce8be3427598e6e0de19ffd73c4f3", "score": "0.737...
cf407d1861b6f752f6bc5ebaf8b1edc4
Fetch the version of the Mercurial extensions that're being used as a Hash.
[ { "docid": "efb3cbae6cd861885b2ae1691851c2b9", "score": "0.6619637", "text": "def extension_versions\n\t\text_info = self.versions[ :extensions ]\n\t\treturn ext_info.each_with_object({}) do |ext, hash|\n\t\t\text = ext.dup\n\t\t\thash[ ext.delete(:name).to_sym ] = ext\n\t\tend\n\tend", "title": "" ...
[ { "docid": "eb560bd936250715db88f2df115e5f87", "score": "0.61793196", "text": "def get_extensions hash\n extensions = [ ]\n hash.each_key { |key| extensions << key }\n extensions\nend", "title": "" }, { "docid": "706c20fc08aeaf858f3771b60be42846", "score": "0.6174672", "text": "de...
8b6d32038bb1f393f33ce6bf68aea0b1
Is the successive errors maximum reached?
[ { "docid": "84375f21e2f3dacc0a5e1bb8f827289e", "score": "0.77163875", "text": "def exceeded_successive_errors?\n return false if successive_errors < 3\n\n logger.abort\n true\n end", "title": "" } ]
[ { "docid": "b49d021c72274215fcda8c3a2e20e90c", "score": "0.7735945", "text": "def too_many_errors?\n @error_count >= @error_threshold\n end", "title": "" }, { "docid": "b54180a93a5d941442ec635b112ca3a3", "score": "0.7294939", "text": "def contains_error?\n @error_count.p...
d529725c33bcfb53c25cb799745dd610
is_perm?("cat", "bat") is_perm?("cat", "atc") Crackig Code Interview 1.5
[ { "docid": "4c8e7e383f17c2be483687ab5db3bc8f", "score": "0.0", "text": "def my_compress(str)\n ans = \"\"\n count = 1\n prev = str[0]\n idx = 1\n while idx <= str.length\n if prev == str[idx]\n count += 1\n else\n ans += count.to_s\n ans += prev\n count = 1\n end\n p...
[ { "docid": "7467480702ef4f691e6ea1130d849acf", "score": "0.7550725", "text": "def is_perm(p1, p2)\n p1.to_s.split(\"\").map(&:to_i).sort.join == p2.to_s.split(\"\").map(&:to_i).sort.join\nend", "title": "" }, { "docid": "a79db8e54f6a0f3dac213748522aa609", "score": "0.7469254", "text...
377f19d7865f1822ff922bdd0da7fc39
return a duplicated array with elements deleted
[ { "docid": "755036cb94d3fa49be6a7c865cf5b53e", "score": "0.0", "text": "def delete_attributes(*args)\n @attributes.dup.delete_if { |a| args.include?(a) }\n end", "title": "" } ]
[ { "docid": "3886aefcab850b4b8f87f5ff36e83c1d", "score": "0.7410452", "text": "def array_remove_duplicates(arr)\n arr.uniq\n end", "title": "" }, { "docid": "72665108610b7bcd38c232c7bf6743a8", "score": "0.7381839", "text": "def remove_duplicates(sample_array)\n return sam...
e9f9007fe964a3aa7d6ac6fc85cafdfa
Initialize with a root_path string, e.g. "/", "/api", "/api/v2"... Also accepts an options hash to configure which actions to log: exclude_controllers: Pass an array of controller name strings/substrings. Will not log requests to any of those controllers. exclude_actions: Pass a hash with keys that are controller names...
[ { "docid": "cd63f1676a5c93b1472651466af4110e", "score": "0.7455979", "text": "def initialize(root_path=\"/\", opts={})\n # puts root_path.class == \"Array\" ? root_path.first.class : 'oop'\n if root_path.class == Array && root_path.all?{|str| str.class == String}\n @root_paths = root_path\n ...
[ { "docid": "85be3ca7c417a4e74d80a8d4a8719dd6", "score": "0.5746571", "text": "def initialize app, options = {}\n @app = app\n @except = Array(options[:except]).map { |e| regexpify e }\n @log = options[:log]\n @only = Array(options[:only]).map { |o| regexpify o }\n @path = opti...
a54413b45b6c7176fd34bb393cacc8dc
DELETE /addresses/1 DELETE /addresses/1.json
[ { "docid": "701ca12e969107e60a52e1f12745c7ad", "score": "0.0", "text": "def destroy\n @address.destroy\n\n addresses = Address.where(user_id: current_user.id)\n primupdated = false\n\n addresses.each do |address|\n if !primupdated \n address.update_attribute(:is_primary, true)\n ...
[ { "docid": "144d0aa3e2b0dcaa1a75c72ed04aca11", "score": "0.760413", "text": "def destroy\n @address.destroy\n respond_to do |format|\n #format.html { redirect_to api_v1_addresses_url, notice: 'Address was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", ...
12f8d5a48d57c326b8f6fb76b3a63d11
Returns a unique, deterministically reproducible index into an array We are hashing based on strings, let's use the ascii value of each string as a starting point.
[ { "docid": "9141ba8f6a3d49f2d87063d945377491", "score": "0.5627832", "text": "def index(key, size)\n x = 0\n for i in 0..key.length-1 do\n ascii_code = key[i].ord\n x += ascii_code\n end\n return x % size\n end", "title": "" } ]
[ { "docid": "dec56ba389619bca802a841fd19914b8", "score": "0.6426992", "text": "def make_key(len)\n Array.new(len) { rand(26) }\n end", "title": "" }, { "docid": "9b405c2cf63cd73591a2a92c28204806", "score": "0.6185603", "text": "def rolled_hash_fill(nBitArray, key)\n\n hash = 0\n ...
573416a96f2fc3d740b6ae1b86c0ad4b
Checks to see if the file's final character is a \n. If it is, it just returns the text that was passed in. If it's not, it adds a \n, since the current indentationchecking algorithm only checks indent levels when it parses a newline character (without this, indentation problems on the final line won't ever get caught)...
[ { "docid": "c52dee5a1efb3bc35c21080d3f747027", "score": "0.0", "text": "def file_end_update(trailing_newline_count)\n measure(trailing_newline_count)\n end", "title": "" } ]
[ { "docid": "b61169a14c1b321ab7d49a4f420c7ae1", "score": "0.6964516", "text": "def _Newline\n\n begin # choice\n _tmp = match_string(\"\\n\")\n break if _tmp\n\n _save = self.pos\n begin # sequence\n _tmp = match_string(\"\\r\")\n break unless _tmp\n # optional...
4d9f49068f29469e135e162efc0f7220
Executes a request simulating PUT HTTP method and set/volley the response
[ { "docid": "90d96e4159927f941805ff81c3ddb462", "score": "0.0", "text": "def put(action, parameters = nil, session = nil, flash = nil)\n process_action(action, parameters, session, flash, \"PUT\")\n end", "title": "" } ]
[ { "docid": "ca503f9c245ba12b0ddf82b577c9b306", "score": "0.75344706", "text": "def put!\n request = Net::HTTP::Put.new(uri)\n request.body = @params.to_json\n\n response = get_response(request)\n GunBroker::Response.new(response)\n end", "title": "" }, { "docid": "3401...
b95ce1dd18f804240a1cef52504f1801
Checks email is its domain is valid. Fallbacks to A record if requested.
[ { "docid": "c561edc62989226fbd88b5a24c129307", "score": "0.7911413", "text": "def validates_email_domain(email, options)\n require 'resolv'\n a_fallback = options.is_a?(Hash) ? options[:a_fallback] : false\n domain = email.match(/\\@(.+)/)[1]\n Resolv::DNS.open do |dns|\n @mx = dns.getr...
[ { "docid": "56ee9fb507a251e3195f2221c358d0fb", "score": "0.78231597", "text": "def validate_email_domain(email)\n domain = email.match(/\\@(.+)/)[1]\n Resolv::DNS.open do |dns|\n @mx = dns.getresources(domain, Resolv::DNS::Resource::IN::MX)\n end\n !@mx.size.zero?\n end", ...
86742652282293ecc3b30d6ed55293a1
Given time intervals 'a' and 'b', calculates how much time is common to both intervals
[ { "docid": "fe1cd84fbf73828708299257faa5e7c0", "score": "0.8029423", "text": "def time_intersection(start_a, finish_a, start_b, finish_b)\r\n\t # If one interval finishes before the other starts, intersection is zero.\r\n\t if finish_a < start_b or finish_b < start_a\r\n\t return 0\r\n\...
[ { "docid": "b9cef0d33a44eafa0a322074ac1609cb", "score": "0.718938", "text": "def test_intervals(interval_a, interval_b)\n return 0 if interval_a.max < interval_b.min\n return 0 if interval_b.max < interval_a.min\n\n len_a = interval_b.max - interval_a.min\n len_b = interval_b...
df4bec75e22cca40264df04f6ceb9f7b
refactored method for previously defined get_character_movies_from_api
[ { "docid": "5f3280a0e966578f8f48185ab17e4f69", "score": "0.0", "text": "def get_film_hashes(film_links)\n films_hash_array = []\n film_links.each do |url|\n response = RestClient.get(url)\n films_hash_array << JSON.parse(response)\n end\n films_hash_array\nend", "title": "" } ]
[ { "docid": "41710d0a02502b543d20e2ba14cd228c", "score": "0.87385416", "text": "def get_character_movies_from_api(character)\n\n character_hash = get_json\n film_info = films_array(character_hash, character).flatten!\n movies_for_character(film_info)\nend", "title": "" }, { "docid": "e5d7d...
3f31dbec286045012f50097e94ea35d7
Returns the observed offset from UTC in seconds at the given time. This includes adjustments made for daylight savings time.
[ { "docid": "a677f2442596c032569255f8fdb5b31a", "score": "0.68744123", "text": "def utc_offset(time = T.unsafe(nil)); end", "title": "" } ]
[ { "docid": "51720356475c371f757a61cb1801d361", "score": "0.72866845", "text": "def local_offset(time = Time.now)\n Time.at(time.to_i).to_datetime.offset\n end", "title": "" }, { "docid": "bbb3ef4519c8ed5fa759b20d92929c29", "score": "0.7259203", "text": "def observed_utc_offse...
5a78f525a09fe8956722ff8f5a283089
POST /projects Metodo que crea un proyecto nuevo Parametros de entrada: nombre del proyecto, id del cliente asociado al proyecto, descripcion, fecha de inicio, fecha de fin del proyecto Salida: Se crea el proyecto y se redirige a la pagina show del proyecto creado
[ { "docid": "39b9ae32de23385ff57d63b44aa5e0e6", "score": "0.7069905", "text": "def create\n @project = Project.new(params[:project])\n # Si se crea correctamente, se guarda y se redirige al show con un mensaje de exito,\n # sino, se hace un render al new del proyecto, dando el mensaje de error c...
[ { "docid": "b28b9b90bcde6c892ad2196cee84f6f8", "score": "0.7683839", "text": "def create\n\n #Acá se retorna de la vista New (o de cualquier lugar que llame a create con POST). Le llega el hash project_params con \n # los datos que retornó la vista.\n\n #Crea el nuevo usuario.\n @project = P...
efec2c403a09f7300155ceb929db2310
GET /students/1 GET /students/1.json
[ { "docid": "1c0625b773f9563a6e1e57b9fa87e5bf", "score": "0.0", "text": "def show\n @active_left_aside='students'\n #@student = Student.find(params[:id])\n @presenter=StudentPresenter.new(@student)\n case params[:part]\n when 'achieve'\n achievements(@student)\n when 'friends...
[ { "docid": "57dc193afc87bc1965b9a72bc4169b81", "score": "0.7990593", "text": "def get_student\n @student = Student.find(params[:std_id])\n render json: @student\n end", "title": "" }, { "docid": "4a0f776565d77a0c723185dc0f5c3a92", "score": "0.771512", "text": "def show\n st...
84e69466a456154299eb5c9f4f6e7ca0
DELETE /signspot/projects/1 DELETE /signspot/projects/1.json
[ { "docid": "78d20bafabfae11937dcfb50b84ace8f", "score": "0.80271935", "text": "def destroy\n @signspot_project = Signspot::Project.find(params[:id])\n @signspot_project.destroy\n\n respond_to do |format|\n format.html { redirect_to signspot_projects_url }\n format.json { head :no_cont...
[ { "docid": "2395db8e8b2d56dc1e97347626464cb3", "score": "0.75208664", "text": "def destroy\n @project.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5d7a1cc2cfd84c0e660f50d58157424f", "score": "0.7475516", "...
8fd30490ca607de3915aa5e4a032f962
based on the question, the order here actually matters the first node in the nodes array is also going to be our source node
[ { "docid": "1f49d6409477ae66c808dd9671adef98", "score": "0.0", "text": "def add_edge(nodeA, nodeB)\n nodeA.adjacents << nodeB\n nodeB.adjacents << nodeA\n\n @nodes << nodeA\n @nodes << nodeB\n end", "title": "" } ]
[ { "docid": "bcdf90a4ef970a460150d76bd59efff2", "score": "0.6055482", "text": "def traverseNodes(nodes, nextNode)\n tVec = Array.new\n #puts \"***********************\\ntraverseNodes :#{nextNode} \\n_______________________________\\n#{nodes}\\n***********************************\"\n ...
d6e967d291f77d58251c78c7109d95c1
POST /drivers POST /drivers.json
[ { "docid": "3432bb9eddbdeb56e35565b359bd341a", "score": "0.69735414", "text": "def create\n @driver = Driver.new(driver_params)\n\n respond_to do |format|\n if @driver.save\n format.html { redirect_to new_driver_path, notice: 'Driver was successfully created.' }\n format.json { ...
[ { "docid": "4e16dedcf35ae7f03ab1e6062367b9ed", "score": "0.69544894", "text": "def create\n\t\t@driver = Driver.new(params[:driver])\n\n respond_to do |format|\n if @driver.save\n format.html { redirect_to driver_path(@driver), notice: 'Driver was successfully created.' }\n format....
3cf9819d1d2132bbf785ffc36db6a404
DELETE /landing_sidebars/1 DELETE /landing_sidebars/1.xml
[ { "docid": "a10eb90e4925b86e5ae2073018fba02b", "score": "0.7465615", "text": "def destroy\n @landing_sidebar = LandingSidebar.find(params[:id])\n @landing_sidebar.destroy\n\n respond_to do |format|\n format.html { redirect_to(landing_sidebars_url) }\n format.xml { head :ok }\n end...
[ { "docid": "1ed744d50c5ced7cdc44608458c74901", "score": "0.7182584", "text": "def destroy\n @page_sidebar = PageSidebar.find(params[:id])\n @page_sidebar.destroy\n\n respond_to do |format|\n format.html { redirect_to(page_sidebars_url) }\n format.xml { head :ok }\n end\n end", ...
f131dccb28fe45147125ea2f7cc0df0e
Returns a Mechanize::Page instance which is the being searched on. If the page was once fetched it's reuse. To reload, call with an argument evaluating to true.
[ { "docid": "7de6d25e8a9b75074bebf20737e0a436", "score": "0.72859603", "text": "def page(reload = false)\n return nil if url.nil?\n if reload\n @page = Mechanize.new.get(url)\n else\n @page ||= Mechanize.new.get(url)\n end\n @page\n end", "title": "" } ]
[ { "docid": "2a2b1d2ad018cdf7e1ceb44eee8f0a0a", "score": "0.6743133", "text": "def load_page\n @page ||= @mechanize.get(url)\n end", "title": "" }, { "docid": "5a5be304b7d8c7babbd1a7da6ca5fa64", "score": "0.64254653", "text": "def page\n return @most_recent_page if @most_recent...
ca06d1e0286adf3d679e71e3ef30398c
Canonical Amazon Resource Number for this resource
[ { "docid": "39a62068bfd3fe87ef80139e4fb8751b", "score": "0.0", "text": "def arn\n \"arn:\"+(MU::Cloud::AWS.isGovCloud?(@config[\"region\"]) ? \"aws-us-gov\" : \"aws\")+\":ec2:\"+@config['region']+\":\"+MU::Cloud::AWS.credToAcct(@config['credentials'])+\":security-group/\"+@cloud_id\n end...
[ { "docid": "4a0eec9c92e2ea6c2b415bb9b00c1e2a", "score": "0.66008437", "text": "def resource_identifier\n parts[3]\n end", "title": "" }, { "docid": "c6d8bb68bb1af5fff3c372c243b204eb", "score": "0.6506974", "text": "def canonical_id\n @canonical_id ||= Addressable::UR...
a97a8d5e56b8355a91c5a1c55b1f9955
Studio Displays the current dancers for a dance studio GET /dance_studios/:dance_studio_id/dancers/current_dancers
[ { "docid": "3cbcd87cbae6a003a38b7322272625bd", "score": "0.67432046", "text": "def current_dancers\n @dancers = current_user.dancers.current_dancers.order(:last_name, :first_name)\n end", "title": "" } ]
[ { "docid": "c724330fee1ced264aa9ae05fa32c11e", "score": "0.5896101", "text": "def current_studio_costumes\n current_studio_assignments.find_costumes\n end", "title": "" }, { "docid": "004261c00c09af153784e2c03dfca5f5", "score": "0.5741389", "text": "def current_studio_assignments...
e3e13a0b263e5dd7d5fecd69fc61a524
GET /loans/1 GET /loans/1.json
[ { "docid": "cdc0f6c37dac35faef5ddb6d4f366cde", "score": "0.6163116", "text": "def show\n @loan = Loan.status('all').find(params[:id])\n @pictures = @loan.featured_pictures(5) # for slideshow\n @other_loans = @loan.cooperative.loans.status('all').order(\"SigningDate DESC\") if @loan.cooperative\...
[ { "docid": "a78d66e835b8f13d4f39b1c558977836", "score": "0.7296866", "text": "def index\n #@loans = Loan.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @loans }\n end\n end", "title": "" }, { "docid": "98980591aec5168679b6ea6be7...
1c067153594c062c772087a5ae10616c
Exisiting Clients In Motion
[ { "docid": "999408c60727015fa1f447e9ef06629e", "score": "0.0", "text": "def existing_clients\n @sales.where(new_client: false)\n end", "title": "" } ]
[ { "docid": "f5b4775f751b391ce13dd9d310fc5ebb", "score": "0.59075326", "text": "def event_incoming_clients_control(client, cmd, *args)\nend", "title": "" }, { "docid": "a9d7134c4f2f7a6de8e78c3e67fa3017", "score": "0.58545583", "text": "def connected(client)\n\t\tclient.listen('WHEREAM...
f66e8b9e07d2fbae3d3eeb761b98e215
Get Knockout Text Color
[ { "docid": "84b31fe3279f24cb54b240b266cca6d4", "score": "0.6510659", "text": "def knockout_color\n return Color.new(255, 64, 0)\n end", "title": "" } ]
[ { "docid": "3858826db0c01cd42ba249e7ec5d9555", "score": "0.8140452", "text": "def knockout_color\n return text_color(18)\n end", "title": "" }, { "docid": "f6372e7f33c444bccb50edc632ba7e4b", "score": "0.6810401", "text": "def green text\n colorize 32, text\n end", ...
e120df56f47e54146de22dba9d8a0b47
PUT /registered_downloads/1 PUT /registered_downloads/1.xml
[ { "docid": "c14b1aa5e7b60f13ff10bae7f04fd51a", "score": "0.55566835", "text": "def update\n respond_to do |format|\n if @registered_download.update_attributes(registered_download_params)\n format.html { redirect_to([:admin, @registered_download], notice: 'Registered download was successfu...
[ { "docid": "23b5f5e4dacfb330cb1e0ffd4590ef63", "score": "0.61359483", "text": "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post opts.fetch(:path, update_path), opts\n end", "title": "" }, { "docid": "73f1eb1c419b9de607f526cccf2fc5f...
110b8881b83ef3e8c7a0ad9b70c5f41e
sorts by moving elements into the correct position of a sorted portion of the array
[ { "docid": "37fee9200d40f2da2a0a985d4ffd06b4", "score": "0.0", "text": "def insertion_sort(array)\n\tfor i in 1...array.length\n\t\tj = i\n\t\t# keep going as long as the array isn't sorted\n\t\twhile j > 0 && array[j-1] > array[j]\n\t\t\t# when the previous element is larger, swap positions with it\n\t...
[ { "docid": "df8ebbc1c591323cd85c50328186462e", "score": "0.7848359", "text": "def sort_array", "title": "" }, { "docid": "81b3d88f90233641845f11a7b2173622", "score": "0.73991674", "text": "def sort\n # split entire array\n sort_array(0, @size - 1)\n end", "title": "" }, ...
3d22915ad21463b0121ea6de233609f9
That is, without any form of synchronization, two or more separate computer systems can create new items and label them with a UUID with no significant chance of stepping on each other's toes. It accomplishes this feat through massive randomization. The number of possible UUID values is approximately 3.4 X 10E38. Each ...
[ { "docid": "b67e0ce667721d2f2a37ccfcf3027833", "score": "0.7484442", "text": "def uuid(sequences = [8, 4, 4, 4, 12])\n hexadecimals = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\n uuid = ''\n counter = 0\n\n sequences.each do |sequ...
[ { "docid": "ef8dfb7aab87902606da4e2b01caa2de", "score": "0.8222355", "text": "def generate_UUID_1\n uuid = ''\n hex_index = (0..15)\n hex_values = ('0'..'9').to_a + ('a'..'f').to_a\n\n (0..8).each do |num|\n uuid << hex_values[rand(hex_index)]\n end\n uuid << '-'\n (0..4).each do |num|\n uu...
b9aa9c35104499dd99e14db6179e0326
PATCH/PUT /generic_hepatic_imps/1 PATCH/PUT /generic_hepatic_imps/1.json
[ { "docid": "83a4b26f9a572ff7b95a9e1e1116a892", "score": "0.6858589", "text": "def update\n respond_to do |format|\n if @generic_hepatic_imp.update(generic_hepatic_imp_params)\n format.html { redirect_to @generic_hepatic_imp, notice: 'Combination dose was successfully updated.' }\n ...
[ { "docid": "a314027c140db00241c20ba6ea20a620", "score": "0.63498783", "text": "def update\n @impgen = Impgen.find(params[:id])\n\n respond_to do |format|\n if @impgen.update_attributes(params[:impgen])\n format.html { redirect_to @impgen, notice: 'Impgen was successfully updated.' }\n ...
763252f2016d3a77ea65566ce9414c93
Way to find contacts by their id
[ { "docid": "cf4c83f84de5c1f3415e218469295281", "score": "0.8450123", "text": "def find_contact(id)\n \t@contacts.find {|contact| contact.id == id}\n \tend", "title": "" } ]
[ { "docid": "9d1b30edcef4c8cc5e0a3d61000b696b", "score": "0.82329774", "text": "def find(contact_id)\n @contacts.find{|contact| contact.id == contact_id}\n end", "title": "" }, { "docid": "d81078e4f828ba45d25ce10cae594c2f", "score": "0.81999284", "text": "def contact(id)\n sel...
a495bcdf949aeeeda0ae1579f9e6436d
Set the value of the PageSize input for this Choreo.
[ { "docid": "8673eb77e3d4cc6213ebed61df0e49b6", "score": "0.65975255", "text": "def set_PageSize(value)\n set_input(\"PageSize\", value)\n end", "title": "" } ]
[ { "docid": "8190b9845329126f935146af446c8b57", "score": "0.6945444", "text": "def setPageSize(size)\n unless /(?i)^(A0|A1|A2|A3|A4|A5|A6|Letter)$/.match(size)\n raise Error.new(Pdfcrowd.create_invalid_value_message(size, \"setPageSize\", \"html-to-pdf\", \"Allowed values are A0...
00373059469fa312736e437fa9c23e1a
GET /awards GET /awards.json
[ { "docid": "31b8de585b5930fa5cfb3dda01d6ac14", "score": "0.5929308", "text": "def index\n @awards = Award.where(\"date > :date\", {date: Date.today-2.months}).order(:date)\n end", "title": "" } ]
[ { "docid": "a29d1ef48d943bafe6c456edf06e991f", "score": "0.7607939", "text": "def index\n @awards = @student.awards\n # was @awards = Award.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @awards }\n end\n end", "title": "" }...
a915484a0ad2ada2e79975fafa88fdcf
TODO: make a test for this This method validates if the resource Rails is saving matches with the one in the array in ActiveRecord::Base.descendants.map(&:name)
[ { "docid": "9567c86491b75965bf293627c43356b4", "score": "0.48130953", "text": "def resource_exists\n unless MANAGEABLE_RESOURCES.include?(resource)\n errors.add(:resource, \"invalid. You must select a resource that rails can identify.\")\n end\n end", "title": "" } ]
[ { "docid": "6728a7c4fd7421abdb2036aa1036caa3", "score": "0.58880585", "text": "def resource_saved?\n resource.save unless resource.validation_attempted?\n resource.saved?\n end", "title": "" }, { "docid": "c00c4def0dd4f03b013b01b352f0c0e8", "score": "0.5636408", "t...
18eaa49eaa3e10cd1a4e750fc245fbb6
creates array of hex color value of each pixel in image
[ { "docid": "b0f47e9e57a71cc2e597956c1483e9ce", "score": "0.7030359", "text": "def get_pixels\n @pixels = []\n image[0].each_pixel do |pixel|\n color = pixel.to_color(Magick::SVGCompliance, false, 8, true)\n @pixels.push(color_map.key(color))\n end\n end", "title": "" } ]
[ { "docid": "24335659d980175a7e949c003554f86d", "score": "0.80170506", "text": "def get_hexcolor_array\n a = []\n @polylist.each_value { |poly| a.concat(poly[:color_array]) }\n dst = []\n a.each do |rgb|\n r, g, b = rgb\n dst.push(get_hexcolor(r, g, b, 1.0))\n end\n return dst...
b7305623034a7df7da2f6e6c2e538106
Mark the server as dead and close its socket.
[ { "docid": "5282b72d1f58a3fbd64405a84a040fd0", "score": "0.61452997", "text": "def mark_dead(error)\r\n @sock.close if @sock && !@sock.closed?\r\n @sock = nil\r\n @retry = Time.now + RETRY_DELAY\r\n\r\n reason = \"#{error.class.name}: #{error.message}\"\r\n @status = sprintf ...
[ { "docid": "c5db1f8fed988350dc62c49f0ff8ddde", "score": "0.72269833", "text": "def close\n @keep_alive = false\n socket.close if socket.open?\n @_socket = nil\n end", "title": "" }, { "docid": "63582c8d17f860fa9f8ab2fc7c87e9fe", "score": "0.705059", "text": "def stop\n\t\ti...
e1a9771512f80cb8ef636ba62ebf6990
POST /memes POST /memes.json
[ { "docid": "ba5a4020ac99dbe16df34002fd215735", "score": "0.55770063", "text": "def create\n @meme = Meme.new(meme_params)\n respond_to do |format|\n if @meme.save\n items = @meme.keywords_string.split(\" \")\n items.each do |item| \n attrs = { :key => item }\n ...
[ { "docid": "addbf8d72314f76ff4f1541ac51eb2b5", "score": "0.6529472", "text": "def create\n @notify_me = current_app.notify_mes.new(params[:notify_me])\n if @notify_me.save\n render json: 'ok', status: 201\n else\n render json: {errors: @notify_me.errors }, status: 422\n end\n end"...
9db5dbf2d76cfb66a496b1ef89f278d0
Much safer than permitted_params because it also uses the current policy (Pundit) to filter the parameters. Example: permitted_params_from_policy(current_site, :site)
[ { "docid": "3997da8c72420755084bd6df5ce42858", "score": "0.67273647", "text": "def permitted_params_from_policy(object_or_class, key)\n _params = permitted_params[key]\n _attributes = policy(object_or_class).permitted_attributes\n ::ActionController::Parameters.new(_params...
[ { "docid": "5e4c1e744dd43c7c812337a47b6dab61", "score": "0.71004736", "text": "def permitted_params\n @permitted_params ||= PermittedParams.new(params, current_user)\n end", "title": "" }, { "docid": "e34c00dce8b702cc153ec605f1eb44d2", "score": "0.70090103", "text": "def permitte...
e030fa39a857f533ae6551db5b05277d
similar to a longer running app passing its output thru an enum body example
[ { "docid": "398c0b2d5b5a90531a2eac9690c2503b", "score": "0.0", "text": "def test_streaming_enum_body_2\n str = \"Hello Puma World\"\n loops = 10\n body_len = str.bytesize * loops\n\n server_run do |env|\n hdrs = {}\n hdrs['Content-Type'] = \"text; charset=utf-8\"\n\n body = En...
[ { "docid": "6de910008caaa087c7d1f5cfe3e6d21f", "score": "0.69246495", "text": "def enum(out, name, items)\n # out.puts \"\\ntype #{name.ljust(PAD)} #{type}\"\n out.puts \"\\nconst (\"\n for item in items do\n out.puts item\n end\n out.puts \")\\n\"\nend", "title": "" }, { "docid": "8...
46a0c2746aa529bf6d8452c71c8af56a
Set schema search path to new schema
[ { "docid": "ebe92709c932dc77c665501c8f1f0ed6", "score": "0.6039924", "text": "def connect_to_new(tenant = nil)\n return reset if tenant.nil?\n raise ActiveRecord::StatementInvalid.new(\"Could not find schema #{tenant}\") unless Apartment.connection.schema_exists? tenant\n\n @current...
[ { "docid": "bfd11d60720afe9167af1f9118259ebf", "score": "0.8167948", "text": "def add_schema_to_search_path(sc)\n conn ActiveRecord::Base.connection\n saved_path = conn.execute(\"SHOW search_path\")[0][0] # Save current path\n schema_set = schema.downcase == saved_path.split(',').first.strip.downcase...
b6b9cd199dfaed08c4c534812e0ac109
Check to see if the all the properties in the model are valid
[ { "docid": "2030bb5350436c850ae4a62b80d6f2b8", "score": "0.0", "text": "def valid?\n return false if !@reference_document_type.nil? && @reference_document_type.to_s.length > 3\n return false if !@reference_document_type.nil? && @reference_document_type.to_s.length < 2\n return false if !@...
[ { "docid": "162d0e63d65b0cd6795543bab63498f2", "score": "0.78992486", "text": "def validate_properties\n true\n end", "title": "" }, { "docid": "162d0e63d65b0cd6795543bab63498f2", "score": "0.78992486", "text": "def validate_properties\n true\n end", "title": "" ...
3536fd455854d99b801b3715418fcaf8
Return the default dir_path of the parent's path + this component's name unless segment_path is configured In which case parse segment_path to search the component hierarchy for the specified repository and blueprint
[ { "docid": "13055f7fb505a375e6397740c8528e57", "score": "0.5917042", "text": "def dir_path\n # binding.pry\n if extension.nil?\n node_warn(node: parent, msg: \"Extension '#{extension_name}' not found\")\n elsif extension.segment(extension_path).nil?\n node_warn(node: parent, msg: \"Ex...
[ { "docid": "007e206b358f7b216581ea5fd2354f10", "score": "0.63295317", "text": "def parent_path\n components = path_components\n components.pop\n components.join\n end", "title": "" }, { "docid": "ae03c841f938dbae4506a0a894cffee3", "score": "0.6273443", ...
031e1eee0fa9b9cb8db1c1785ca65244
Name : Generate Info : Generates Poisson distributed value Author : Tibuda using Knuth algorithm Call Info : No Arguments
[ { "docid": "22cd238e27a264c7bf695e09e6542663", "score": "0.5272134", "text": "def generate\r\n k = 0\r\n p = 1.0\r\n while p >= Math.exp(-@lambda)\r\n k += 1\r\n p *= super.to_f / Dist_precision\r\n end\r\n return k - 1\r\n end", "title": "" } ]
[ { "docid": "6a7f9757908a7455db033674343b89f5", "score": "0.6411049", "text": "def demo()\n puts \"***Begin Demo***\"\n w = h = 512\n \n t1 = Time.now\n\n puts \"Generating samples for a #{w} x #{h} grid.\"\n puts \"Points at minimum 15 units from each other.\"\n puts \"30 attempts a...
bc95a6594f695821ce6b56bc300f497f
GET /help_pages/1 GET /help_pages/1.json
[ { "docid": "99d7d0c5b6829bf73ad59b81523e9ab2", "score": "0.6930647", "text": "def show\n @help_page = HelpPage.find(params[:id])\n @new_contact = Contact.new\n @category = @help_page.category\n @otherpages = @category.help_pages\n\n respond_to do |format|\n format.html { render :layo...
[ { "docid": "e36a7e1c555ecbdecf6ed2be74c4adab", "score": "0.7329597", "text": "def new\n @help_page = HelpPage.new\n\t @title = 'Create New Help Page'\n\t\t\n respond_to do |format|\n format.html { } # new.html.erb\n format.json { render :json => @help_page }\n end\n end", "titl...
c6954b868a7157a96e2c090538d5cf8d
Read a 'hyperflex.HxdpVersion' resource.
[ { "docid": "3dfbf8cd43176c1f5fd74c3addc26715", "score": "0.543438", "text": "def get_hyperflex_hxdp_version_by_moid(moid, opts = {})\n data, _status_code, _headers = get_hyperflex_hxdp_version_by_moid_with_http_info(moid, opts)\n data\n end", "title": "" } ]
[ { "docid": "c9684b2d4cce016a4ec7081a21fcbb58", "score": "0.6002007", "text": "def hsrp_version; self[:hsrp_version].to_i; end", "title": "" }, { "docid": "a3564715f5c50153e2a18a6454a50c64", "score": "0.59757656", "text": "def read_version\n IO.read(version_path).strip\n end",...
fff1c0a89abd5a9dbbaad52f308a41b0
Checks whether the `hash` node contains any `pair` or `kwsplat` nodes.
[ { "docid": "4c04911a988a328b6df02093f999afba", "score": "0.0", "text": "def empty?; end", "title": "" } ]
[ { "docid": "a5b4c1fba3143449fa6e3dfe0dd4b8ae", "score": "0.6984015", "text": "def empty_hash?(node)\n s(:hash, nil) == node || s(:bare_assoc_hash, nil) == node\n end", "title": "" }, { "docid": "f8c204ee0493ab90f6ddf848e4bcce2b", "score": "0.69184", "text": "def empty...
ca2210a44c3e3009e1dd3ed6500499d4
Joins this call to another call or a mixer
[ { "docid": "22a71bd99e793e2d1fedb7a6c32d07d4", "score": "0.0", "text": "def join(target, options = {})\n logger.debug \"Joining to #{target}\"\n\n joined_condition = CountDownLatch.new(1)\n on_joined target do\n joined_condition.countdown!\n end\n\n unjoined_condition = C...
[ { "docid": "612db56e8710ed9d9976a3b855573bee", "score": "0.58824164", "text": "def multiplex; end", "title": "" }, { "docid": "3c212a5e3abc7c84eeb5c6e11b53872b", "score": "0.58500093", "text": "def react(_callback=nil,_opts=nil,&_block)\n if _block\n _opts = _callback\n ...
a5d9e35d0775da7e5d4dc8f78b980fce
runs through results and distributes trophies
[ { "docid": "673e2ee9089384f465413f309583ca68", "score": "0.67676693", "text": "def run_results()\n sql = \"SELECT * FROM results\"\n results = run(sql)\n results.each do |result|\n event = Event.find(result['event_id'].to_i)\n knight = filter(result['knight_id'].to_i)\n trophy = ...
[ { "docid": "b95d01bdef736c8dd484b3aba48a0893", "score": "0.7544809", "text": "def pump_results!\n loop do\n distribute_results!\n end\n end", "title": "" }, { "docid": "2e56e14e931435560d83e535fad1ceab", "score": "0.66737527", "text": "def process_results (results...
8d346b439d867c53390c5bb9e933eb16
GET /make_payments/1 GET /make_payments/1.xml
[ { "docid": "759779a45e15ff7cf562077db68c27f9", "score": "0.6191342", "text": "def show\n @menu = 'Expenses'\n @page_name = 'View Payment'\n @make_payment = MakePayment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @make_pa...
[ { "docid": "429259c910d911b8751ea6ebee905f22", "score": "0.6702288", "text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @payments }\n end\n end", "title": "" }, { "docid": "6d3b99a510c0def7b4ff5df9c520d023", "score":...
f73f91d852d89e0d4138e2cf5cd84cd4
End of Startup Biz
[ { "docid": "40aeac06ab541e3f8f0be313df312867", "score": "0.0", "text": "def goodbye(code=0)\n #$Log.debug('[Goodbye]'.ljust(LogPad)) {\"Goodbye.#{EndOfRun}#{EOR}\"} if bool?($opts[:goodbye])\n $Log.close\n\n exit!(code) if $opts[:log] == 'cleandebug' # Just exit as there will be nothing to parse for ...
[ { "docid": "0c0351338cc822b08bfcd5564ae1587d", "score": "0.7550995", "text": "def end\n exit()\n end", "title": "" }, { "docid": "f1d767db4a80836b7ab91dbc9af8b393", "score": "0.73873985", "text": "def shuttingdown?; end", "title": "" }, { "docid": "f1d767db4a80836b7ab...
6b72c68e4a1b00ae0290d2fda6e04d15
Location Search by metro area name === Parameters +metro_area_name+ Metro area or city named 'location_name' string Ex. 'Minneapolis', 'Nashville', or 'London'. +options+ hash of additional options such as page and per_page
[ { "docid": "bc96d80723bfab34b7a36dda80879ee7", "score": "0.87473804", "text": "def location_search_metro_area_name(metro_area_name, options = {})\n location_search(options.merge(query: metro_area_name))\n end", "title": "" } ]
[ { "docid": "e7f0e4ae972361eb1991dd4f9b9d62bc", "score": "0.6266698", "text": "def search\n # Create grouped optrions for administrative_area select tag\n @opt1 = Address.select('distinct country, administrative_area_level_1')\n @opt1_grouped = @opt1.each_with_object({}) do |f, options|\n (...
887301bc70e2076a5cb72aecc6454ab0
Prepares an Ubuntu server with NGINX and Passenger to run Rails applications. Set 'host_name_or_ip' to the DNS name or IP address for the host. Set 'ssh_user' to the user name you want to access the host as. This user must be able to run 'sudo' commands and must not be 'root'. You can provide a port value either append...
[ { "docid": "0a9e0e783a5f234053349c6513255686", "score": "0.6556038", "text": "def run\n # reset the host info.\n @host_info = nil\n\n admin_shell do |admin|\n # test the connection and sudo capabilities.\n admin.sudo_stat_exec 'Testing connection', 'ls -al /root'\n...
[ { "docid": "9d33d6148f1934a9009830efa1a97d14", "score": "0.6767479", "text": "def user_setup\n # creating a user\n say \"Creating master user\", :green\n chroot_run \"useradd -u 111 -s /bin/bash -m master\"\n # install sudo\n install_deb(\"sudo\")\n # add sudo line\n a...
6c4da169120c123e23e521e3e7b280e7
Returns an array of all the attributes that have been made accessible to massassignment.
[ { "docid": "e4d224d28e6d43ecc44f33464d85277a", "score": "0.72528595", "text": "def accessible_attributes # :nodoc:\n read_inheritable_attribute(\"attr_accessible\")\n end", "title": "" } ]
[ { "docid": "dd7020a186cab59651e5401c42dbcaa9", "score": "0.7877589", "text": "def accessible_attributes\n read_inheritable_attribute(:attr_accessible) || []\n end", "title": "" }, { "docid": "71a0fa4ff1d8545a053763a88956b7ad", "score": "0.741941", "text": "def known_a...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "0d93ee0046f14576409120ec8c3fe2be", "score": "0.0", "text": "def client_params\n params.require(:client).permit(:name, :state)\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...
1291edd287a43ccccb0145e683f3a2c6
POST /apply_records POST /apply_records.json
[ { "docid": "ed6617b7c4dfcc4500bf8bdd0dfac241", "score": "0.0", "text": "def create\n @apply_record = ApplyRecord.new(apply_record_params)\n @apply_record.user=current_user.username\n if @apply_record.state==\"\"\n @apply_record.state=\"等待处理\"\n end\n @apply_record.save\n b=@apply_...
[ { "docid": "dd5f0adfcdbaf2bae719e12609890546", "score": "0.6063307", "text": "def post_process(_records)\n end", "title": "" }, { "docid": "289ebf796a7ad44090ce493163c6694d", "score": "0.5983703", "text": "def modify_submission_records!(records, columns = nil)\n columns = sub...
e692726601897e57fadc3795eb68389b
disables usage of the doublewrite buffer.
[ { "docid": "97fb8c03d1b0b3d7b89986b077205485", "score": "0.766123", "text": "def disable_doublewrite()\n PureHailDB.ib_cfg_set(\"doublewrite\", :bool, false)\n end", "title": "" } ]
[ { "docid": "8ea15dc78534bbe0cc34ad75b0a6581d", "score": "0.7218723", "text": "def suppress; @write = false end", "title": "" }, { "docid": "fa3a2e57c19ecf5e6400e6079314509e", "score": "0.6796482", "text": "def no_write!\n @write = false\n end", "title": "" }, { ...
074919f1c5e2355fb86b77a792cf0094
defines the detectCRM method called below
[ { "docid": "79f3bd5eed102f866659c46afe03032b", "score": "0.5962837", "text": "def detectCRM(domain)\n\n@count += 1\n\nbegin\n # defines a variable and set it equal to the domain\nurl = (\"http://\" + domain)\nsafe_url = URI.parse(URI.encode(url))\n\nwebsite_source = open((safe_url), :allow_redirections...
[ { "docid": "47f78f8b010549bcbdd591bbec00c2b6", "score": "0.585379", "text": "def crm_enabled?\n respond_to?(:enable_crm) && enable_crm\n end", "title": "" }, { "docid": "6996471331b00ff5ea1b2c81287caa4a", "score": "0.5614522", "text": "def crm\n self\n end", "title": ...
ec52ce5005987306a4b011d8e5e2c780
Sets the path for a css stylesheet +path_prefix+ a prefix to the path +type+ The stylesheet type Returns the path of the stylesheet
[ { "docid": "42960278b75a59dcbbf4c3a2284e7974", "score": "0.78412485", "text": "def style_path(path_prefix, type)\n @record.name =~ /\\.#{type}$/ ? \"#{path_prefix}Stylesheets/#{@record.name}\" : \"#{path_prefix}Stylesheets/#{@record.name}.#{type}\"\n end", "title": "" } ]
[ { "docid": "2c17dd4fd170f4ceeb70af942140a8a8", "score": "0.6238608", "text": "def stylesheet= val\n @stylesheet = val\n end", "title": "" }, { "docid": "f839a6971d9f8da8c411397570efaa12", "score": "0.6221199", "text": "def path_prefix=(value)\n if value\n value.ch...
d577c456fd3491e3d84b7220bbca7bf4
GET /check_ins GET /check_ins.json
[ { "docid": "e69172badc83ee09203c722e86d96eb0", "score": "0.77194023", "text": "def index\n @check_ins = CheckIn.all\n\n render json: @check_ins\n end", "title": "" } ]
[ { "docid": "e131fe853cb9d6034e09548b4785dcfd", "score": "0.8355216", "text": "def checkins(options={})\n self.class.get(\"/v1/checkins\",:query=>options)\n end", "title": "" }, { "docid": "869e377bbe08c60df1b3b636bda1148b", "score": "0.7866356", "text": "def checkins(checkin_id)\...
1aee4047f164f4a99a536ba2f082876f
DELETE /burial_services/1 DELETE /burial_services/1.json
[ { "docid": "b9759fb56b45e7f03dda0a009349c602", "score": "0.74404657", "text": "def destroy\n @burial_service.destroy\n respond_to do |format|\n format.html { redirect_to burial_services_url, notice: 'Burial service was successfully destroyed.' }\n format.json { head :no_content }\n en...
[ { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.7128954", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": "...
3b325183ed099e71018c72e4b5de8d16
Mark the current time with a label:
[ { "docid": "7c87f99c851bb2e6500f7cc8e01cdb24", "score": "0.682011", "text": "def label(name)\n @labels << Label.new( [now, name, nil, {}] )\n end", "title": "" } ]
[ { "docid": "7502375fa4b037f76fa192e29deab354", "score": "0.74846137", "text": "def time label = nil\n @time = @time || Time.now\n label.to_s + ' (' + ( Time.now - @time ).to_s + ')'\n end", "title": "" }, { "docid": "30cd9ed98afa33a4b3e89cb15bfd5ecb", "score": "0.73079187", "t...
3e4c647cda0c9fb16482f882cb015a60
== set user not allow nil not allow empty === params _user: ssh login user
[ { "docid": "d339b0f79c8a190ba5ce672591be3787", "score": "0.0", "text": "def user(_user)\n raise InvalidUserError.new(\"#{InvalidUserError::INVALID_MESSAGE} nil\") if _user.nil?\n raise InvalidUserError.new(\"#{InvalidUserError::INVALID_MESSAGE} empty\") if _user.empty?\n @_user = _user\n ...
[ { "docid": "cdc28904e4ba1ef1b9ab6db17826a09a", "score": "0.725865", "text": "def ssh_user_and_host\n self[:user].blank? ? self[:hostname] : self[:user] + '@' + self[:hostname]\n end", "title": "" }, { "docid": "3f72e87032ff9c290fd310e910ad772c", "score": "0.72172767", ...
79a1defffff94d5ab697e4435e9cef66
As a quick fix, the committee have decided to place another old roof over the top, if they can find one that fits. This is your job. A 'new' roof (s) will fit if it currently has a hole in it at the location where the old roof has a tile sticking up. Sticking up tiles are represented by either '\' or '/'. Holes in the ...
[ { "docid": "57938939fba856ef06d71e92b8ae4080", "score": "0.0", "text": "def roof_fix(s,x)\n@s_arr = s.split(\"\")\n@x_arr = x.split(\"\") \n@s_arr_0_1 = \"\"\n@x_arr_0_1 = \"\"\n \ndef convert_roof_0_1 \n@s_arr.each.with_index do |a,b|\n if \n a == \" \" \n @s_arr_0_1 << \"#{b},\" \n else\n ...
[ { "docid": "a4502f792b9496a8819d1375d4c71988", "score": "0.6638956", "text": "def mate?\n king_possible_escapes = find_possible_incremental_moves(@destination_coor)\n king_possible_escapes.select! {|pos| surrounding_space_clear?(pos)}\n king_possible_escapes.each do |space|\n ...
cd299c6a5256ee4b1c081d93c263b537
This is an alias for 'run'
[ { "docid": "02b229def08761746e94b2c60c84e71d", "score": "0.0", "text": "def cmd_exploit(*args)\n\t\tcmd_run(*args)\n\tend", "title": "" } ]
[ { "docid": "acb191b5735f7cdc6510a08d77b398ab", "score": "0.79753506", "text": "def raw_run\n run\n end", "title": "" }, { "docid": "6a9441abcc3b6b832c635970d6cc9328", "score": "0.79124707", "text": "def run\n puts _run\n end", "title": "" }, { "docid": "b5...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "4132d9216497fe00af0a1e5ab71baed1", "score": "0.0", "text": "def set_charity\n \n @charity = Charity.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "d...
9cacd068f24cab5359cbc948d5797bae
to compare room schedule with reservation time
[ { "docid": "1c2fed21fc7f750efbc469202a7d7706", "score": "0.0", "text": "def set_schedule_today(date1, date2)\r\n\t\tarr = date1.to_a\r\n\t\tarr2 = date2.to_a\r\n\t\tTime.new(arr[5], arr[4], arr[3], arr2[2], arr2[1], arr2[0], \"+03:00\")\r\n\tend", "title": "" } ]
[ { "docid": "0b002fc7138ac08c8fe49c2fb3437d45", "score": "0.69762266", "text": "def reservation_time_check\n errors[:reservation_time] << _('errors.invalid_reservation_time') unless shift.valid_reservation_time?(reservation_time)\n end", "title": "" }, { "docid": "ce9eeac74a68fc10244a92a9...
dc9e8e1fb5d9e7678c1dde7b39bc4b5f
Queries for hosts with a Windows 98 based Operating System
[ { "docid": "5be2a1861faa2f830bdc59ae3a402fce", "score": "0.6900524", "text": "def os_windows_98\n\t\t\t\t\twhere(\"os LIKE '%Windows 98%'\")\n\t\t\t\tend", "title": "" } ]
[ { "docid": "ea7a7c76a8955a4ae8fc17e0b6825902", "score": "0.70957553", "text": "def os_windows_me\n\t\t\t\t\twhere(\"os LIKE '%Windows 98%'\")\n\t\t\t\tend", "title": "" }, { "docid": "87fb1f2a6d1ce00cc000aa27b26c0f3f", "score": "0.69716775", "text": "def os_windows_2k3\n\t\t\t\t\twhe...
cd4bd668c80161d0f969774bf19edbe6
A user should be able to choose from the menu
[ { "docid": "b696a37d6781ca7022ce98a9085d3cca", "score": "0.0", "text": "def menu\n puts \"Choose a calculator, (a)dvanced or (b)asic or press (q)uit\"\n response = get.chomp\n\n case response\n when \"basic\"\n basic_calc\n when \"advanced\"\n advanced_calc\n when \"q\"\n exit\n else\n puts \...
[ { "docid": "a49bb9bbe50f9b40534d7745a485011f", "score": "0.79630435", "text": "def menu_choice(choice)\n \n end", "title": "" }, { "docid": "a9164d6db9e66ed9da3675a7aadf64b5", "score": "0.7859081", "text": "def menu_choice\n\n user_choice = @prompt.select('Please select one of...
cfba1e00df281cc54e6fed010b7c541e
These methods delegate configuration to the provider.
[ { "docid": "1485e0b5450932636b3fc4d082a69b03", "score": "0.0", "text": "def configureCToolsFileProvider(config_hash)\n logger.debug \"#{self.class.to_s}:#{__method__}: #{__LINE__}: call configure\"\n # Assign or merge hash?\n @ctools_hash = initConfigureCToolsFileProvider(config_hash)\n end", ...
[ { "docid": "72bf8d8e398179ca44b6a3dfda55f5ce", "score": "0.7557084", "text": "def configuration\n provider.configuration\n end", "title": "" }, { "docid": "82b60275a4fc386c4557a64e55bfa6b0", "score": "0.7188331", "text": "def configure\n end", "title": "" }, { ...
60a08c23a4850216a418566a6ef8c749
before_action :set_user, except: [:new, :create]
[ { "docid": "d8fbc012b90decbece8f80ce1e334eb7", "score": "0.0", "text": "def new\n @categories = Category.all\n @comment = @product.comments.build\n set_user\n #@comment.comment_by = current_user.email\n end", "title": "" } ]
[ { "docid": "0b044c7b0b5351466feb2ff0502f713f", "score": "0.798837", "text": "def before_set_user\n end", "title": "" }, { "docid": "9b2fe694752c12fd369c5500cdcfab4a", "score": "0.7938206", "text": "def set_user # filter method called before every action, except #new and #create\n ...
4552fa4865507ae835c811849143bfc4
Provides controller to help display all the apps associated with th current user and a summary of statistics /apps
[ { "docid": "e521128f7c1e05c6f26f8078a984adf7", "score": "0.6935207", "text": "def index\n @applications = App.all\n @accepted_applications = App.active\n @submitted_applications = App.submitted\n @pending_applications = App.pending\n @deleted_applications = App.deleted...
[ { "docid": "51441cdceb7901730a77f08a690529e8", "score": "0.76472044", "text": "def index\n @apps = current_user.apps\n end", "title": "" }, { "docid": "c67f56faac596ac69c29d1bb12830c36", "score": "0.7414653", "text": "def index\n @user_apps = UserApp.all\n end", "title": ...
b2747dcc590204f7439f002782fa63eb
Probability. With H_0 = Sum(s2)=0, probability of getting a value of the test upper or equal to the obtained on the sample
[ { "docid": "172d011dbc3bc3eb02bc35cb3f4420ec", "score": "0.5350678", "text": "def probability\n p_using_cdf(Distribution::F.cdf(f, @d1, @d2), :right)\n end", "title": "" } ]
[ { "docid": "cc837cec2af3e1f296feafcb95fcc78d", "score": "0.6827653", "text": "def probability_exact\n dist = UMannWhitney.u_sampling_distribution_as62(@n1,@n2)\n sum = 0\n (0..@u.to_i).each {|i|\n sum+=dist[i]\n }\n sum\n end", "title": "" }, { ...
4635a6cd17beab3cb6be05bc073ac407
Fairly accurate bearing calculation. Takes a latitude, longitude, and an options hash which must include a :bearing value (:linear or :spherical). For use with a database that supports MOD() and trigonometric functions SIN(), COS(), ASIN(), ATAN2(). Based on:
[ { "docid": "a85445b47bed6a4e8d594ff854c908c2", "score": "0.7698131", "text": "def full_bearing(latitude, longitude, lat_attr, lon_attr, options = {})\n degrees_per_radian = Geocoder::Calculations::DEGREES_PER_RADIAN\n case options[:bearing] || Geocoder.config.distances\n when :linear\n ...
[ { "docid": "f7dda451c1387b9ebdd205aaa1ceeb0a", "score": "0.78155714", "text": "def full_bearing(latitude, longitude, lat_attr, lon_attr, options = {})\n case options[:bearing] || Geocoder.config.distances\n when :linear\n \"MOD(\" +\n \"CAST(\" +\n \"DEGREES(ATAN2( \" +\...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "4ab7cc288d4778f268628ee8ae106e39", "score": "0.0", "text": "def contract_renewal_employee_params\n params.require(:contract_renewal_employee).permit(:email_sent, :form_submitted, :email_sent_at, :form_submitted_at, :contract_renewal_list_id, :employee_id)\n end", "title": "" } ...
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7943618", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.69572574", "text": "def permitted_params\n params.permit!\n end", "title"...
f698ae6291a42dbe9a3f30960972427a
Returns the wcs server url.
[ { "docid": "4d87a813dde1ac308331382e68961a46", "score": "0.6513466", "text": "def wcs_path\n wxs.wcs_path\n end", "title": "" } ]
[ { "docid": "b19154f61b9cf75077617b2c2218174c", "score": "0.736739", "text": "def url\n @layer.host.url + '/wms'\n end", "title": "" }, { "docid": "d8e604e03b97c38e6749e63dc9a5a077", "score": "0.7020817", "text": "def server_url\n port = config[:ports].sample\n \"#{c...
4f2f48c0ef5065affe3669108a16a834
POST /concepto_gastos POST /concepto_gastos.json
[ { "docid": "20e28645007f157f59e63636cdb4aa62", "score": "0.6704961", "text": "def create\n\t\tauthorize! :create, ConceptoGasto\n @concepto_gasto = ConceptoGasto.new(concepto_gasto_params)\n\n respond_to do |format|\n if @concepto_gasto.save\n format.html { redirect_to gestionar_concep...
[ { "docid": "95b5d054a29fdf969b8192f23f6a1f25", "score": "0.69148195", "text": "def create\n @gasto = Gasto.new(gasto_params)\n\n respond_to do |format|\n if @gasto.save\n format.html { redirect_to @gasto, notice: 'Gasto was successfully created.' }\n format.json { render :show, ...
620931acfd1a89a00e1482378541e55f
Outputs nonarray value in the form of hash For object, use to_hash. Otherwise, just return the value
[ { "docid": "25a8636255f6e4c5e0c6eac38d3fe98c", "score": "0.0", "text": "def _to_hash(value)\n if value.is_a?(Array)\n value.compact.map { |v| _to_hash(v) }\n elsif value.is_a?(Hash)\n {}.tap do |hash|\n value.each { |k, v| hash[k] = _to_hash(v) }\n end\n elsi...
[ { "docid": "a34f3dad821ba9744bc8d807b65489ad", "score": "0.672242", "text": "def hash\n [value].hash\n end", "title": "" }, { "docid": "a34f3dad821ba9744bc8d807b65489ad", "score": "0.672242", "text": "def hash\n [value].hash\n end", "title": "" }, { "docid...
ebc53a6c384c9a2e65045add769a93b4
Deletes ticket with provided id
[ { "docid": "1aa25e138a864d2d04b3cab3f06ce5b6", "score": "0.76231533", "text": "def destroy\n begin\n Ticket.find(params[:id]).destroy\n render response: { :message => \"Ticket deleted.\"}\n\trescue\n\t render response: { :message => \"Ticket with specified id not found!\"}\n\tend\n end", ...
[ { "docid": "366e9acff37e03ec6a479de356532187", "score": "0.8692513", "text": "def delete_ticket(form_id, id)\n delete \"forms/#{form_id}/tickets/#{id}\"\n end", "title": "" }, { "docid": "5b3bcf851ccf000aaae59d36df4def60", "score": "0.851346", "text": "def delete_ticket i...