query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "b33a13ae2a7a339eb6ca59e5004e19a0", "score": "0.0", "text": "def image_params\n params.require(:image).permit(:file, :caption)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7496729", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6958585", "text": "def strong_params\n params.require(:request).permit(param_white...
d0892439444eba43f77bf0144f7873a0
check to see if a recipe has been saved to the database yet
[ { "docid": "609cb1bc51fd1dd568d3f8e28363dc5c", "score": "0.0", "text": "def new?\n id.nil?\n end", "title": "" } ]
[ { "docid": "1428fbf34a78017815627878cce8133b", "score": "0.7306149", "text": "def persisted?\n @recipe.persisted?\n end", "title": "" }, { "docid": "7c2f710ed8bc3d561fdde60fb765c528", "score": "0.6974785", "text": "def exist?\n ensure_state == :saved\n end", "title": ...
18bec613b4647467fc9c5b5861cf68c0
REQUIRED summary: Category for which the device or application directory item provides data. This should be a codablevalue and have a recommended vocabulary. returns: a HealthVault::WCData::Types::Codedvalue Array
[ { "docid": "411c0d057c0e8079b225dae4d9747d8c", "score": "0.0", "text": "def data_provider_category\n return @children['data-provider-category'][:value]\n end", "title": "" } ]
[ { "docid": "96970c69ad3c4a1f6a216ce16997f756", "score": "0.665787", "text": "def categories_as_array\n return Array.new if @result.nil?\n @result[\"items\"][0][\"volumeInfo\"][\"categories\"]\n end", "title": "" }, { "docid": "f399307275cfb1025f3e136f62cce291", "score": "0.6...
c80caf28906b0e5b58c0fba92744e57b
Return the object as a Hash
[ { "docid": "bfb19c8ec5417acdd8f6ab1327be72c3", "score": "0.0", "text": "def as_json\n attributes.merge({\n author_screenname: author.screenname\n })\n end", "title": "" } ]
[ { "docid": "027facb8b195665ceeb78f2c171e2881", "score": "0.88311946", "text": "def to_hash\n object\n end", "title": "" }, { "docid": "a32a2b1c4ea5806d332e94d82b50b930", "score": "0.8298723", "text": "def hash\n to_h.hash\n end", "title": "" }, { "docid": ...
22e5554f0d5248ecfc12bcce709ea80a
Make the current user object available to controllers and associated views
[ { "docid": "2469d71277daac8a397432936690ecc9", "score": "0.78612316", "text": "def get_user\n @current_user = current_user\n end", "title": "" } ]
[ { "docid": "8b25aa2d31192df7ec147e640c9d5ae6", "score": "0.82991165", "text": "def main\n @user = current_user\n end", "title": "" }, { "docid": "5e2877b9d4079da263f67646ff68099d", "score": "0.8042965", "text": "def set_user\r\n @user = current_user\r\n end", "title": "" ...
70a4f1eda4fc1b926282e09e9e57ca50
=begin Header line specification from: The header line gives information about the FIGfont. Here is an example showing the names of all parameters: flf2a$ 6 5 20 15 3 0 143 229 NOTE: The first five characters in | | | | | | | | | | the entire file must be "flf2a". / / | | | | | | | \ Signature / / | | | | | \ Codetag_C...
[ { "docid": "97a4557a750de023357b76c34d34adc0", "score": "0.0", "text": "def parse_header_line(header_line)\n header_line_params = header_line.split\n\n @hardblank = header_line_params[0][-1]\n @height = header_line_params[1].to_i\n @comment_line_count = header_line_params[5].to_i\n end", ...
[ { "docid": "e5765b3c7c1c84c9be5f73cfe695dfb3", "score": "0.623906", "text": "def header_line; end", "title": "" }, { "docid": "74099bb1b2e387b5b4cb0d04ab26c44f", "score": "0.6225269", "text": "def pos_fil_header\n 0\n end", "title": "" }, { "docid": "95c4022814d8d8242...
f613c71de55e2669adac1e24e2f9ee9c
Returns the value of attribute header_signature. source://rubyzip//lib/zip/entry.rb9
[ { "docid": "75397bcf1d312042e4de15118af1d8e0", "score": "0.77543855", "text": "def header_signature; end", "title": "" } ]
[ { "docid": "12f59e14399a6cf3d9a9b2843315f1d9", "score": "0.7251843", "text": "def header_signature=(_arg0); end", "title": "" }, { "docid": "70e4fb4d86aeac662f817c6bb6f4abc1", "score": "0.6506912", "text": "def pp_signature headers\n headers['Autorizacion']\n end", "title...
895ab6bd5e6969034bd2e64a8f57c082
PATCH/PUT /caches/1 PATCH/PUT /caches/1.json
[ { "docid": "c2804529cce3ce915c2b8967fde239cd", "score": "0.0", "text": "def update\n respond_to do |format|\n if @cach.update(cach_params)\n format.html { redirect_to @cach, notice: 'Cach was successfully updated.' }\n format.json { head :no_content }\n else\n format.ht...
[ { "docid": "2f3ef4fe4c57a2b93762f96ff705b3b0", "score": "0.67014116", "text": "def update\n respond_to do |format|\n if @cache.update(cache_params)\n format.html { redirect_to @cache, notice: 'Cache was successfully updated.' }\n format.json { render :show, status: :ok, location: @...
5983727d7a8be536107a0fba06329024
paren_balanced with regex note this only works with () Arraygsub(pattern, replacement)
[ { "docid": "f9df110968c0b1a19495a07ef6aefbfe", "score": "0.6051613", "text": "def paren_balanced?\n valid = true\n self.gsub(/[^\\(\\)]/, '').split('').inject(0) do |counter, parenthesis|\n counter += (parenthesis == '(' ? 1 : -1)\n valid = false if counter < 0\n ...
[ { "docid": "b49c9d7ca2b45fdbbd56e3bff3f11f8e", "score": "0.6325156", "text": "def replace_parens\n new = self\n new = new.gsub(PARENS_REGEXP) do |pattern|\n yield pattern.delete('()')\n end while PARENS_REGEXP.match(new)\n new\n end", "title": "" }, { "docid": "c05fa887ec7e...
f9d3a8d2bb4254665be103ea970c5d51
Assumes schema_format == ruby
[ { "docid": "1222ce7b3e83a6498c4c43b124879a49", "score": "0.0", "text": "def load_schema(env)\n ActiveRecord::Schema.verbose = false\n DatabaseTasks.load_schema_for config_for(env), :ruby, ENV['SCHEMA']\n end", "title": "" } ]
[ { "docid": "dea3addc7c936eb50af95afb81d8a118", "score": "0.7323983", "text": "def schema_data; end", "title": "" }, { "docid": "74cadc2ad6867b3d86379f4419693064", "score": "0.7240098", "text": "def schema; end", "title": "" }, { "docid": "74cadc2ad6867b3d86379f4419693064"...
b911153c41cdb1cc6078c8f634e6b93f
get the trailer of movie
[ { "docid": "6667ba373c1cb272983b14a4e7049776", "score": "0.7746173", "text": "def get_trailer(id)\n id = id.to_s\n movie = JSON.parse(open(\"https://api.themoviedb.org/3/movie/\"+ id +\"?api_key=\" + ENV['MOVIE_API'] + \"&append_to_response=videos\"){ |x| x.read })\n if movie['video...
[ { "docid": "ae3a6a554b864ea9fba4239f290dc061", "score": "0.77769464", "text": "def get_trailer(id)\n movie = JSON.parse(open(\"https://api.themoviedb.org/3/movie/\"+ id +\"?api_key= \" + ENV['MOVIE_API'] + \"&append_to_response=videos\"){ |x| x.read })\n link = movie['videos']['result'][0]...
12cfbec96dabda91f3abe38b45f95681
Eelbobber asserter deckswabber tab phenozygous canaliculate Inobvious ultra pookaun common outcricket psychopannychism
[ { "docid": "4146898cd304e69ba495665835f4cd25", "score": "0.0", "text": "def suicidalism_nonmarine(julian)\n premake(peltogaster, embound_turnkey)\n end", "title": "" } ]
[ { "docid": "28e6c567b9b6b4338024f41f34c2140f", "score": "0.6413962", "text": "def traditious_grammatical_unblemishedness()\n paediatry_subarmor(echeneidoid_blazonry, precirculate_luminometer)\n end", "title": "" }, { "docid": "b37290a50751816117e54322a6548bdd", "score": "0.624259...
22131a390927042e641d45ee0728001d
Scramble the inner characters of words leaving the text still readable (research at Cambridge University, code by KurtDresner). For example, the above text may result in: Srblamce the iennr cchrteaars of wodrs lvenaig the txet stlil rbeaadle (rreceash at Cbamigdre Uverintisy, cdoe by KrneruestDr?)
[ { "docid": "962eaf433bfedb71019977526a8e66e9", "score": "0.0", "text": "def dresner(string)\n string.gsub(/\\B\\w+\\B/){$&.split(//).sort_by{rand}}\n end", "title": "" } ]
[ { "docid": "2e23c9fd47e9f4e1645bde2497c2b15a", "score": "0.7570373", "text": "def scramble!\n self_arr = self.chars.to_a\n ''.tap do |word|\n self_arr.each_with_index do |letter,i|\n case %w{repeating vowels capitalize}[rand(3)]\n when \"repeating\"\n word << letter*(ra...
3191584a20f15108b262beb64ae00c82
Define ask user where to buy method
[ { "docid": "49023edf00f2bf7241941e6feba7b311", "score": "0.0", "text": "def choose_store(stores)\n i=0\n puts \"Where do you want to buy?\"\n stores.each do |store|\n puts \"#{i+1}. #{store.store_name}\"\n i+=1\n end\n puts \"0. Exit\"\n pu...
[ { "docid": "4990e2d69423e08d4473832e029431cf", "score": "0.6703825", "text": "def set_buy\n end", "title": "" }, { "docid": "31510f81ba3d036d313a2d7e6d3a7360", "score": "0.6659602", "text": "def buy\n end", "title": "" }, { "docid": "b68f3bb23b97fdf9f2b46e95371952e6", ...
d8dfb0c76089707d05859a0cd8456d77
Matches configured formated form against File glob strings given.
[ { "docid": "aab3f1cb18da4c2d7bb073ca5d9ce870", "score": "0.0", "text": "def matches?(*rules)\n rules.flatten.each do |r|\n if r =~ /(.+)@\\z/\n return r if File.fnmatch?($1, self.local)\n end\n end\n false\n end", "title": "" } ]
[ { "docid": "6892abb3121a87862228306a45c5b79a", "score": "0.69440323", "text": "def glob_match (filenames, pattern)\n\t# Escape the '*', '?', and '.' characters\n\tpattern.gsub!(/[\\*\\?\\.]/, '*' => '.*', '?' => '.', '.' => '\\.') \t\n\tregex = Regexp.new(pattern)\n\t#select returns a new array\n\tfilen...
0ab11f981bb1aa85cfdea34d241d19f1
Rent part of the lease part of the calc request
[ { "docid": "b2300040c28502d196c4da00ba983711", "score": "0.65840733", "text": "def request_calc_lease_rent(lbtt)\n # Pass annual rent if all the rent values are declared to be the same, else pass the individual years' data\n if lbtt.rent_for_all_years == 'Y'\n { 'ins1:AnnualRent':...
[ { "docid": "de56857d724bee23bf016e90aac27b39", "score": "0.6312256", "text": "def lease; end", "title": "" }, { "docid": "5df5c7746b8b9495d07d0a20881cfd86", "score": "0.6217591", "text": "def request_calc_lease(output, lbtt, calc_type)\n Rails.logger.info(\"Sending lease type ...
46607927aa644b2276353a4f8fcf4876
Here we want to calculate thumbs down using this method
[ { "docid": "131edec341688a2ceb96dca27fd473a5", "score": "0.691475", "text": "def thumbs_down_total\n self.likes.where(like: false).size\n end", "title": "" } ]
[ { "docid": "3e804eec7cfeba03ea418b8d1ce932e3", "score": "0.68273175", "text": "def thumbs_up\n @rank += (1 * @wow_factor)\n end", "title": "" }, { "docid": "f00977679566605e4c3ee2384ba5ffe5", "score": "0.6467742", "text": "def thumb_width\n width * thumb_height / height\n ...
090e2a5d382c05f6b9f6dc13e62db259
method to create a new timesheet object for the edit setup
[ { "docid": "80074779c4c4ff8fca56dbcb2834338f", "score": "0.63988525", "text": "def edit\n\t\t@timesheet = Timesheet.find(params[:id])\n\tend", "title": "" } ]
[ { "docid": "445284cff39b37eba8e897fb4f993bfd", "score": "0.75676584", "text": "def create\n @time_sheet = TimeSheet.new(params[:time_sheet])\n\n respond_to do |format|\n if @time_sheet.save\n format.html { redirect_to edit_admin_time_sheet_path(@time_sheet), notice: 'Re...
88560f685115ef84e7bec34bfa0c353c
GET /posts/1 GET /posts/1.xml
[ { "docid": "48cdd242c2fab7fab8c322ca2a80392f", "score": "0.0", "text": "def show\n @posts = Post.find_all_by_kiez(get_kiez, :order => 'updated_at DESC')\n @post = Post.find_by_kiez_and_id(get_kiez, params[:id])\n\n respond_to do |format|\n format.html { render :template => \"posts/show\" }...
[ { "docid": "3f07ca52f1cff324dc15bb3d68551cc2", "score": "0.72219604", "text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @post }\n format.xml { render xml: @posts }\n end\n end", "title": "" }, { "docid": "7227a2d41...
5bd7d522e173ad9d3166c64fe96872d6
Test that encoding a negative integer works.
[ { "docid": "c56bb2d424b864a1899f36a72cec038f", "score": "0.8183806", "text": "def test_encode_negative_integer()\n input = -69\n expected = [131, 98, 255, 255, 255, 187]\n\n stream = Erlang::StreamEmulator.new()\n Erlang::encode(input, stream)\n actual = stream.data.bytes().entries()\n\n ...
[ { "docid": "4a1ff6b69a97a7b3672a10d65065eb66", "score": "0.7014367", "text": "def test_can_negate_integer\n assert_eq interpret('-2'), -2\n end", "title": "" }, { "docid": "0045c4f6b02af42c49968c4e197c9c58", "score": "0.68409556", "text": "def test_0_equals_zero\n expected = \...
e33ce27ecf5174df1314ed5e670dff5d
Shows all of a Trainer's Kudomon
[ { "docid": "21ea8a21c0925189c8c268a7364b265b", "score": "0.0", "text": "def show_squad\n if collection.any?\n message('Your Kudomon Squad:')\n collection.each do |k|\n puts \"- #{k.species.upcase} (#{k.type}) HP: #{k.hp} // CP: #{k.cp}\"\n end\n else\n message(\"You have...
[ { "docid": "43b648812032415c05b261a9de733c0c", "score": "0.7501205", "text": "def show\n @trainers = Trainer.all\n end", "title": "" }, { "docid": "33e4d3cf375b7567f6e267b6e60d53b9", "score": "0.6966768", "text": "def index\n @konsulters = Konsulter.all\n end", "title": "...
d745e87660ec6f2149cbdc862c0d64ff
escapes the input in the default database
[ { "docid": "863ed629df5fee5b8cb0ea4e8bbdf5ea", "score": "0.7917796", "text": "def escape(input, db_name = @default_db_name)\n if @dbs.has_key?(db_name)\n return @dbs[db_name].escape(input)\n else\n puts \"The database #{db_name} does not exist in the database manager\"\n return inpu...
[ { "docid": "c246a5fe86649a083494a2c66a4da631", "score": "0.7921617", "text": "def escape(input)\n return @mysql.escape(input)\n end", "title": "" }, { "docid": "93cb97056ee5266848eb58d6479e7624", "score": "0.7207957", "text": "def escape( s )\n Amalgalite::SQLite3.escape( s ...
bebece3e8919ddfbdf10dd042aa34e0f
4. sentence_maker pseudocode make sure all pseudocode is commented out! Input: ["i", "want", "to", "go", "to", "the", "movies"] Output: "I want to go to the movies." Steps to solve the problem. go trough each word in array add words to each othe using space 5. sentence_maker initial solution
[ { "docid": "d96f69ffd683cf80a53ded32c4125e39", "score": "0.0", "text": "def sentence_maker(array)\narray.join(' ').capitalize << \".\"\nend", "title": "" } ]
[ { "docid": "b224429cc278123046185f5825f2a632", "score": "0.7579021", "text": "def sentence_maker(array)\n sentence = ''\n array.each do |word|\n if word == array[-1]\n sentence += word\n else\n sentence += word.to_s + \" \"\n end\n end\n sentence.capitalize + \".\"\nend", "ti...
8f97c1f4d00a18b1a40825b691059a8e
The sketch_plane method returns a plane representing the ground plane of the axes.
[ { "docid": "b94e71b4cb86f666bbcac481d010ef46", "score": "0.669135", "text": "def sketch_plane\n end", "title": "" } ]
[ { "docid": "fb1c7325b0068d95e494c0e8d3f77d77", "score": "0.6515326", "text": "def get_plane\n Plane.construct_with_three_points(point_a, point_b, point_c)\n end", "title": "" }, { "docid": "d359831575690fa081bbdc282519e03f", "score": "0.64845383", "text": "def get_plane\n end", ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "66cc0b0995b99ede165d30ee4fe46cb5", "score": "0.0", "text": "def set_tax_information\n @tax_information = TaxInformation.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.61642385", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.60448", "text": "def action_hook; ...
b99dbd829f24b44635ea6d1acb6581e7
method to find batchid(now this class is used only for quadax)
[ { "docid": "ae49991e43fa0bf544331f51090f8ab0", "score": "0.68861085", "text": "def find_batchid\n if @facility.name.upcase == \"ATLANTICAR CLINICAL LAB\"\n @zip_file_name[0...-4]\n else\n @zip_file_name.split(/_/).last[0...-4] # batch id is the last s...
[ { "docid": "98f0c26710a8094e7c28b0f9af16a09a", "score": "0.76246923", "text": "def find_batchid\n parse(conf['BATCH']['batchid']).strip\n end", "title": "" }, { "docid": "e71857f963af323965ad75d48096423a", "score": "0.7161196", "text": "def batch_id\n worker&.job_id\n ...
b51de4e4504753a0477eea12e6faea91
Validate, that the length of string lies in a certain range
[ { "docid": "53d4365af735da78764633ec7554d141", "score": "0.7004473", "text": "def length(**args)\n validator(Validators::LengthInRangeValidator.new(args[:in]))\n end", "title": "" } ]
[ { "docid": "15e54273530f11e0679c8de4978f7cf7", "score": "0.7725007", "text": "def validate_length(str, field_name, lgth, max_lgth = 1.0/0.0)\n\t\tif str && str.length >= lgth && str.length <= max_lgth\n\t\t\treturn true\n\t\telse\n\t\t\tif max_lgth < 1.0/0.0\n\t\t\t\tshow_error(\"The #{field_name} must ...
9ffa98120592bcff6356182464ffe778
def after_sign_out_path_for(resource) if resource == :member public_root_path elsif resource == :admin new_admin_session_path else root_path end end
[ { "docid": "3cbf54bd6a6b28b3033fa5a8b98bcfc7", "score": "0.0", "text": "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:sign_up, keys: [:last_name,:first_name,:last_name_kana,:first_name_kana])\n end", "title": "" } ]
[ { "docid": "6f0169de498b5fef64efaae89482af38", "score": "0.8919616", "text": "def after_sign_out_path_for(resource)\n if resource.to_sym == :admin\n new_admin_session_path\n else\n super\n end\n end", "title": "" }, { "docid": "6f0169de498b5fef64efaae89482af38", "scor...
d6b4f7f725a3eee243db0634066c9f5f
GET /orders/index GET /orders/index.xml
[ { "docid": "975398be261a8610956a09851752194f", "score": "0.7468796", "text": "def index\n @orders = Order.all_open.reverse\n @action = params[:action]\n\n respond_to do |format|\n format.html { render :action => :index }\n format.xml { render :xml => @orders }\n end\n end", "...
[ { "docid": "f773c17b42284037dd690d535e08ac02", "score": "0.8127908", "text": "def index\n @orders = Order.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @orders }\n end\n end", "title": "" }, { "docid": "c03bbfd4455f660d52...
e8e0d6d37c11dc9f69b28e980d376bc7
Removes blank lines from beginning and end of source lines returns starting offset for source (number of lines deleted from beginning)
[ { "docid": "2e47bfe186020088a57316cced60d61a", "score": "0.76395184", "text": "def postprocess_source(source_lines)\n starting_offset = 0\n while source_lines.size > 0 && source_lines[0] =~ /^\\s*$/\n starting_offset += 1\n source_lines.delete_at(0)\n end\n\n while sour...
[ { "docid": "6be88a534506e3a7841ee5da9fcfa237", "score": "0.6835237", "text": "def strip_blank_lines\n\t\t# algorithm: keep only the non-blank lines\n\t\t\n\t\t\n\t\t# work inwards from the outside until you fine lines that are not empty\n\t\tmin_i = self.index{ |line| line != \"\" }\n\t\tmax_i = self.ri...
4d9f71daefbc5f7c4817a67b655dae98
Sets the keepUserData property value. The keepUserData property
[ { "docid": "fe348a9057164583b43f6d5fc32d6a2b", "score": "0.82135624", "text": "def keep_user_data=(value)\n @keep_user_data = value\n end", "title": "" } ]
[ { "docid": "1019100c525ed4ec9c5f9e1c9d0b9c8a", "score": "0.6933574", "text": "def keep_user_data\n return @keep_user_data\n end", "title": "" }, { "docid": "2b9fdd686a8e51eeed126b7ad2591e71", "score": "0.6039252", "text": "def keep=(b...
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "c0a17a12c6f53ca44fadc10afb50b4d8", "score": "0.0", "text": "def player_params\n params.require(:player).permit(:name, :image, :nationality, :appearances, :goals, :market_value, :jersey_number, :age, :team_id)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74768823", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.71700543", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist...
2c85d8b4d6b3f89e1fb8b03fde53690e
DELETE /relassociates/1 DELETE /relassociates/1.json
[ { "docid": "224ff0b87766a5bd836c92977f5303da", "score": "0.71401453", "text": "def destroy\n @relassociate.destroy\n respond_to do |format|\n format.html { redirect_to relassociates_url, notice: 'Relassociate was successfully destroyed.' }\n format.json { head :no_content }\n end\n e...
[ { "docid": "689d5a07a403c4b765ba178e4aff08a3", "score": "0.6795951", "text": "def delete\n client.delete(\"/#{id}\")\n end", "title": "" }, { "docid": "628cc739011e7ac0e64d8e6d148c8e2a", "score": "0.6786297", "text": "def destroy\n @relogio = Relogio.find(params[:id])\n ...
a6f2975a1bb58ea907cc4fafac415d92
Get the max size for the connection pool.
[ { "docid": "e24d5531254895c1705712c7596ded17", "score": "0.85524094", "text": "def max_size\n @max_size ||= (options[:pool_size] || POOL_SIZE)\n end", "title": "" } ]
[ { "docid": "bfe61695ae0aaedef24eae13bc939d87", "score": "0.8878334", "text": "def max_size\n @pool.limit\n end", "title": "" }, { "docid": "6496827084f53149a9e118466696027d", "score": "0.84836894", "text": "def max_size\n @max_size ||= options[:max_pool_size] || MAX_...
67291297ce730ab13d8072e2af940ec8
member profile GET /members/1
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "b0000fce3458caddbe29b79aeff714c8", "score": "0.7681614", "text": "def members\n @profile = current_user.profiles.find(params[:id], :include => :trusts)\n end", "title": "" }, { "docid": "4a8fe4523c5fefdf2bb400b5b7b06b67", "score": "0.7630061", "text": "def profile\n\t...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "6721ee8c8fc7c68d7db5fd0ca8a5f826", "score": "0.0", "text": "def set_product\n @product = Product.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60310596", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6014974", "text": "de...
afd56f2dbf4755b9bf8ab9eede2d591e
Validation functions Check the associations all belong to the same account / project
[ { "docid": "2f134220a24b3835ff08a75b727e93c8", "score": "0.7850069", "text": "def check_associated\n if self.quote_id.present?\n errors.add(:quote_id, \"must belong to the same project\") if self.project_id != self.parent_quote.project_id\n end\n \n if self.user_id.present?\n error...
[ { "docid": "bfc127e7c72ea784187e356504199a1a", "score": "0.80968094", "text": "def check_associated\n if self.account_id.present?\n if self.project_id.present?\n self.errors.add(:project_id, 'must belong to the same account as the invoice') if self.account_id != self.project.account_id\n ...
79d03a8d30b0bcb943f739b19207155b
Collects all `Occi::Core::Action` instances specified in `actions` in one or more other mixins/kinds in this model. These instances may not appear in the model itself if it has not been successfully validated yet.
[ { "docid": "5889ee434293e5d8ec3bd554f8c7e00d", "score": "0.8026474", "text": "def associated_actions\n associated = kinds + mixins\n associated.collect!(&:actions)\n associated.flatten!\n associated.reject!(&:nil?)\n associated\n end", "title": "" } ]
[ { "docid": "aa93cbd478b220bea0a38954fe274d61", "score": "0.6756661", "text": "def actions\n return @actions if @actions\n @actions = {}\n (default_actions + installed_actions + custom_actions).each do |path|\n load_action_from(path)\n end\n @actions\n rescue NameError ...
80a86875f459b8342346b13286606f9e
PATCH/PUT /notes/1 PATCH/PUT /notes/1.json
[ { "docid": "554b824d8253a51a0952661ab56fbb1a", "score": "0.65044326", "text": "def update\n respond_to do |format|\n if @note.update(note_params)\n format.html { redirect_to @note, notice: 'Note was successfully updated.' }\n format.json { render :show, status: :ok, location: @note...
[ { "docid": "279a83b6c0f8fa69f6b648c2ab240164", "score": "0.73235285", "text": "def update\n\t\tnote.update_attributes(notes_params)\n\n\t\trespond_with( note ) do |format| \n\t\t\tformat.json { render json: note }\n\t\tend\n\tend", "title": "" }, { "docid": "6fdf82e5b018bdeb650acda190e3be99"...
9c4949a73702d8a5aa42f1796d65b268
GET /app_instances GET /app_instances.json
[ { "docid": "2ffd26b5f5fd669a5e4846ec0fc4d690", "score": "0.7422071", "text": "def index\n @app_instances = AppInstance.all\n end", "title": "" } ]
[ { "docid": "223c1b532fa422700db399b3023ec983", "score": "0.7665137", "text": "def instances\n instances = []\n JSON.parse(resource['/instances'].get)[\"instances\"].each do |i|\n instances << Instance.new(i)\n end\n return instances\n end", "title": "" }, { "docid": "e4e53c...
9bec5e3e237c9398885c5c755a31466b
DELETE /lovedins/1 DELETE /lovedins/1.json
[ { "docid": "afb3db7cdc13479186f2f52d4cd31a59", "score": "0.6966965", "text": "def destroy\n @lovedin.destroy\n respond_to do |format|\n format.html { redirect_to lovedins_url, notice: 'Lovedin was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title"...
[ { "docid": "0b24cbc6495df3923ea7679acbcd8deb", "score": "0.69407684", "text": "def delete_floor_plan(args = {}) \n delete(\"/files.json/floorplan/images\", args)\nend", "title": "" }, { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.6880078", "text": "def delete(path)\n ...
5f5181d552d087dbcdd942a0728e50ea
POST /listings POST /listings.json
[ { "docid": "311f6a44c69101d73afff018296f4365", "score": "0.6834559", "text": "def create\n #debugger\n #TODO: DELETE ALL\n @listing = Listing.new(listing_params)\n\n respond_to do |format|\n if @listing.save\n format.html { redirect_to @listing, notice: 'Listing was successfully ...
[ { "docid": "45577597aa281ffae006f29857594282", "score": "0.7446066", "text": "def create\n\n @listing = Listing.new(listing_params)\n\n @listing.save\n\n render json: @listing\n redirect_to listings_path # redirect to home page\n end", "title": "" }, { "docid": "fdade8...
4b715a856e42c47cde695ae33ffa6222
prefix the file name, leaving the path intact.
[ { "docid": "7a9c301c5e789c383c21f8ac9f306be1", "score": "0.75230765", "text": "def prefixed(prefix = '_')\n dirname + \"#{prefix}#{basename}\"\n end", "title": "" } ]
[ { "docid": "010b3a2b7d42dacd45f5908bd9f99f8e", "score": "0.7791683", "text": "def prefix(filename)\n return filename unless @config.prefix_filename\n \"#{config.prefix_filename}/#{filename}\"\n end", "title": "" }, { "docid": "e812b0cac666c9a5c60c2c905bf8c4b8", "score"...
905acc642cddb181d0cedc03c6477c61
Return the client application configured bottom horizontal cell character, or the default if not set.
[ { "docid": "8e184df976501ddd72961661692ed36e", "score": "0.6125783", "text": "def bottom_horizontal\n @bottom_horizontal ||= Vedeu::Cells::BottomHorizontal\n .new(cell_attributes)\n end", "title": "" } ]
[ { "docid": "68e5bdc600129ec047e5dd6faa9c1408", "score": "0.60166174", "text": "def bottom_line_chars(width)\n return '' if bottom == :none\n bl = bottom_left_char.empty? ? (left == :none ? '' : ' ') : bottom_left_char\n br = bottom_right_char.empty? ? (right == :none ? '' : ' ') : b...
d1b7e057c2ed6fc63d1f6e4ea464bd6e
what already is queued or started
[ { "docid": "6a4ad039da6091286124e61af2353b06", "score": "0.5977587", "text": "def running(queue = nil)\n scope = where(state: [:queued, :received, :started]).order('jobs.id')\n scope = scope.where(queue: queue) if queue\n scope\n end", "title": "" } ]
[ { "docid": "6ca01bb37ea134577b4ad5589bc9db0c", "score": "0.7387582", "text": "def queued\n @queued\n end", "title": "" }, { "docid": "459b2e0f8cf3b84d041195c6d0ab5888", "score": "0.68592775", "text": "def queued\n hydra.queued_requests\n end", "title": "" },...
52d612d8636e3a1393ee30f7b1cdc2c4
Get back an array of timecodes for a period
[ { "docid": "b32a5a1280969ce36f6fc2a20949ee87", "score": "0.75483024", "text": "def get_timecodes(at, drift_behind, drift_ahead)\n now = timeint(at)\n timecode_start = timecode(now - drift_behind)\n timecode_end = timecode(now + drift_ahead)\n (timecode_start..timecode_end).step(1).to...
[ { "docid": "3e695bef33811d9b3f98d54c4b4fbacf", "score": "0.8219405", "text": "def timecodes\n return [] if start_time.nil?\n start_hour = start_time.strftime(\"%H\")\n start_min = start_time.strftime(\"%M\").to_i < 30 ? \"00\" : \"30\"\n curr_time = Time.parse(\"#{start_hour}:#{start_min}\")...
b8416ecc8675bd136c6dde4597e05188
GET /desktops GET /desktops.json
[ { "docid": "3ada23b5fedf9bc83b0c90cf72f47dc7", "score": "0.5733904", "text": "def index\n if !params[:orgao_id].blank? && current_user.admin\n @desktops = Desktop.where(orgao_id: params[:orgao_id])\n elsif current_user.admin\n @desktops = Desktop.all\n else\n @desktops = Desktop....
[ { "docid": "3e9d35d8b8b0a6f0cd8f87a4b74af6a5", "score": "0.73593885", "text": "def get_desktop\n request = Packet.create_request( COMMAND_ID_STDAPI_UI_DESKTOP_GET )\n response = client.send_request( request )\n desktop = {}\n if( response.result == 0 )\n desktop = {\n 'sessio...
e44c4aac1f57105bef3e056a3dc98829
Edit and update new password
[ { "docid": "1a29406627bbe54ab19a2adde040d278", "score": "0.0", "text": "def edit_password\n\t\t# Do da def correct_user nen co the bo @user=User.find(paramas[:id])\n\t\t#could be same content as edit\n\t\t#@user = User.find(params[:id])\n\tend", "title": "" } ]
[ { "docid": "e49e81d7a5a569d3196e30708142225b", "score": "0.8428935", "text": "def edit_password; end", "title": "" }, { "docid": "ec7df7ec54176c4c398a5c3a3807c8b5", "score": "0.8241987", "text": "def update_with_password(params, *options); end", "title": "" }, { "docid": ...
5cf420365f576ee9f21d3909171a2478
The active method is a helper function that returns "active" or empty string. It is used to set a CSS class to active for highlighting the active menu item.
[ { "docid": "1ea6b4887d8166ae4d31f5b8a545121b", "score": "0.63203776", "text": "def active(path)\n if (path == home_index_path && request.fullpath == '/') ||\n (path == '/settings' && (request.fullpath =~ /^\\/organization/).present?) ||\n (path == '/settings' && (request.fullpath =~ /^\\/...
[ { "docid": "05e023e70f14d0e1c45cbb425596f7c4", "score": "0.8000999", "text": "def active_class\n self.selected ? \"active\" : \"\"\n end", "title": "" }, { "docid": "e18408fc79e117267788bf2ac75bbc83", "score": "0.7368699", "text": "def nav_active(path)\n (current_page....
681bf44a814b35d77695f62e43a91fee
We probably don't want to auto assign icf_master_ids as it would add icf_master_ids to the old data. Perhaps, after the old data is imported, but that will definitely break a bunch of existing tests.
[ { "docid": "020715d88535d5ca23523c2c390bfcb2", "score": "0.6982841", "text": "def assign_icf_master_id\n\t\tif icf_master_id.blank?\n\t\t\tnext_icf_master_id = IcfMasterId.next_unused.first\n\t\t\tif next_icf_master_id\n\t\t\t\tself.update_column(:icf_master_id, next_icf_master_id.to_s)\n\t\t\t\tself.up...
[ { "docid": "ea46881a7b910a64d7c377756ef1499e", "score": "0.66907656", "text": "def assign_icf_master_id\n\t\tif icf_master_id.blank?\n\t\t\tnext_icf_master_id = IcfMasterId.next_unused.first\n\t\t\tif next_icf_master_id\n\t\t\t\tself.update_column(:icf_master_id, next_icf_master_id.to_s)\n\t\t\t\tnext_i...
c887590f4317729e98bbd2b84ad5e4d4
Changes the database in use by issuing a USE statement.
[ { "docid": "8f6d95fafc23926b5f9c465b0ad30197", "score": "0.74181443", "text": "def use(db_name)\n disconnect\n @opts[:database] = db_name if self << \"USE #{db_name}\"\n self\n end", "title": "" } ]
[ { "docid": "4ac8374620206feb3bfddd5a1aab7453", "score": "0.7495704", "text": "def use(db_name)\n disconnect\n @opts[:database] = db_name if self << \"USE #{db_name}\"\n @schemas = nil\n self\n end", "title": "" }, { "docid": "16f118bf361c9feb0a26a02c2a0a17d5"...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "9e962b094fbb3e673a9fb930ab57c4dd", "score": "0.0", "text": "def pai_params\n params.require(:pai).permit(:nombre, :idioma_id, :moneda_id)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69792545", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781151", "text": "def strong_params\n params.requ...
2b506d6e433599ca2b2c7e3055010450
GET /areas GET /areas.json
[ { "docid": "c1b4ef9e977a22efa2dfca7825193e8f", "score": "0.78172773", "text": "def index\n @areas = Area.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json\n end\n end", "title": "" } ]
[ { "docid": "e6e626e1559b85a3039a0fb80aca96e7", "score": "0.79603565", "text": "def index\n @areas = Area.all\n respond_to do |format|\n format.html\n\n format.json{ render json: @areas }\n end\n end", "title": "" }, { "docid": "aecc34f1f1e43262aba94cfd1eaf70a6", "scor...
e820822d115ffb66eec21e1132def654
Determine if multizone vav optimization is required.
[ { "docid": "52ae6b8d0c32c795421255d5dfd6918c", "score": "0.7303363", "text": "def is_multizone_vav_optimization_required(template, climate_zone)\n\n multizone_opt_required = false\n \n case template\n when 'DOE Ref Pre-1980', 'DOE Ref 1980-2004', '90.1-2004', '90.1-2007'\n \n # Not r...
[ { "docid": "78c08d354f94bda6ea6992556ccd6d5b", "score": "0.7401743", "text": "def enable_multizone_vav_optimization\n \n # Enable multizone vav optimization\n # at each timestep.\n if self.airLoopHVACOutdoorAirSystem.is_initialized\n oa_system = self.airLoopHVACOutdoorAirSystem.get\n ...
690affc16ab7e473b8302b3b9636701b
GET /monthlines/new GET /monthlines/new.json
[ { "docid": "63d4f145b295b29edace1ecce154b69b", "score": "0.8230053", "text": "def new\n @monthline = Monthline.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @monthline }\n end\n end", "title": "" } ]
[ { "docid": "62b069762b9c94585f400b84b28273cb", "score": "0.71727765", "text": "def new\n @monthly = Monthly.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @monthly }\n end\n end", "title": "" }, { "docid": "3c8331dc68297a662b2f502...
60da614b1bb711d5a410415a8363169e
======================================================================== Funding Instruments ========================================================================
[ { "docid": "d27a0582764a232696d3da8dc7ad1cb2", "score": "0.5121568", "text": "def funding_instruments(account_id, options = {})\n get(\"/accounts/#{account_id}/funding_instruments\", options)\n end", "title": "" } ]
[ { "docid": "480d8f62089be455c21fb22ed24c6577", "score": "0.6160123", "text": "def instrument; end", "title": "" }, { "docid": "17ee0abd0fa6851293bed0679d2ca62f", "score": "0.5946167", "text": "def instrumenter; end", "title": "" }, { "docid": "3cf6a8f78ec8b70c7a88083eaafc...
700a1dd723a4965cdd1631cfa57ee2ae
Removes the passed employee from the company employee list
[ { "docid": "6cd71e511444cf3e4863df2164a39e31", "score": "0.7073252", "text": "def fire_employee(employee)\n @employees.reject! {|employ| employ.employee_id == employee.employee_id}\n\n end", "title": "" } ]
[ { "docid": "7fbb34d9d19d2437928c526c51074b95", "score": "0.737837", "text": "def remove_staff(employee)\n employee = Employee.find(employee.id)\n employee.delete!\n end", "title": "" }, { "docid": "27a4cecbebe7dd26689c0510e60cf180", "score": "0.6771567", "text": "def destroy\n...
72d2f512f6ceb01912c8b8977ec9245c
Sets the CPU time used by a transaction, delegates to the builder
[ { "docid": "0ac258b2935580b431616f6eeda5fcd3", "score": "0.7407155", "text": "def notice_transaction_cpu_time(cpu_time)\n builder.set_transaction_cpu_time(cpu_time) if builder\n end", "title": "" } ]
[ { "docid": "359b50b3409de673e3ca4b83003cf36c", "score": "0.59122646", "text": "def set_start_time\n @start_time = Time.now.to_f\n end", "title": "" }, { "docid": "359b50b3409de673e3ca4b83003cf36c", "score": "0.59122646", "text": "def set_start_time\n @start_time = Time.now.to_...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "fb39a3198dcb4d0367af191c8c0c9bbb", "score": "0.0", "text": "def answer_params\n params.require(:answer).permit(:user_uid, :question_uuid, :letter)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.6978086", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6780264", "text": "def strong_params\n params.requi...
2a2da430dab4b801c4332efcbd8671d8
GET /clients GET /clients.json
[ { "docid": "7157904d8c743c345261c61d26e38df6", "score": "0.0", "text": "def step_1\n respond_to do |format|\n format.html\n end\n end", "title": "" } ]
[ { "docid": "11367d36e4c90c8a0de89176b3b870a4", "score": "0.8153739", "text": "def index\n @clients = current_user.clients\n render json: @clients\n end", "title": "" }, { "docid": "c0ffa931d98d5ce1e2041a93d545d9ea", "score": "0.80325127", "text": "def index\n @clients = Cli...
27cc9183ea364197ec6ac4d1d9b243e7
Internal: Given a path, returns the key of the document. Returns a Symbol.
[ { "docid": "93df4c822ee66fb264125ac8ec86cb54", "score": "0.7501988", "text": "def key_from_path(path)\n path.basename.to_s.split('.', 2).first.to_sym\n end", "title": "" } ]
[ { "docid": "66874eaba89ff21e4aa3d1da53df2fec", "score": "0.66825527", "text": "def key\n model.extract_key(path)\n end", "title": "" }, { "docid": "3660b732874c9981d794e38989f5bd5c", "score": "0.66370493", "text": "def key \n path\n end", "title": "" }, { ...
13668e3f06207f1cef4a2ce8a02c58a6
Mock JSON contents of the hidden links field on Org pages
[ { "docid": "c416b0ed2d5dd6c748bd3e3d005a5523", "score": "0.69722784", "text": "def org_links_field\n { org: { link: Faker::Internet.url, text: Faker::Lorem.word } }.to_json\n end", "title": "" } ]
[ { "docid": "584f5d34d545f109f9677c416e9f6d0d", "score": "0.62567115", "text": "def links\n data['links']\n end", "title": "" }, { "docid": "584f5d34d545f109f9677c416e9f6d0d", "score": "0.62567115", "text": "def links\n data['links']\n end", "title": "" }, { ...
0be1604848b728a4203f52dad05c2c7b
Lock rows whose lfts and rgts are to be updated
[ { "docid": "a48bac391174193938684170a8bbc5d4", "score": "0.5727643", "text": "def lock_check(cond=nil)\n nested_set_scope.select(primary_key_column_name).where(cond).lock\n end", "title": "" } ]
[ { "docid": "7ae4012e52e7ecf047ae731b30df2047", "score": "0.6606737", "text": "def update_locked_state() end", "title": "" }, { "docid": "530f6da154c233200474d56c77dfbadf", "score": "0.63786775", "text": "def test_select_all_for_update\n @row1_id = Entry.create!(:title => \"row1\")...
666be9c144b27fa04e305c011a11c611
Upload a file to Kaltura, that can be used to create an entry.
[ { "docid": "6c764230cb8910a1667afa3bf6b5b673", "score": "0.71539706", "text": "def upload(file_data)\n\t\t\tkparams = {}\n\t\t\t# The file data\n\t\t\tclient.add_param(kparams, 'fileData', file_data);\n\t\t\tclient.queue_service_action_call('baseentry', 'upload', kparams);\n\t\t\tif (client.is_multirequ...
[ { "docid": "a272d0bdfece9636a1900918ac3dcaeb", "score": "0.74679315", "text": "def upload_file\n #TODO\n end", "title": "" }, { "docid": "75975dbc44071941f4efd93dd9531bef", "score": "0.7376287", "text": "def upload(file)\n Item.create(:upload, :file => file)\n end", ...
e138dd9c3fc7634c259a9a93838aa058
Within the form's block you can get good buttons with: You can have save, cancel, edit and delete buttons. Each one takes an optional label. For example: 'Update' %> See the documentation for the +button+ method for the options you can use. You could call the button method directly, e.g. , but then your button would no...
[ { "docid": "b79af3f7b387ebdb06136995104427b9", "score": "0.62955505", "text": "def buttons(&block)\n content = @template.capture(self, &block)\n @template.concat '<div class=\"buttons\">'\n @template.concat content\n @template.concat '</div>'\n end", "title": "" } ...
[ { "docid": "5b8dbe516d15fa701c6c48213d30ac48", "score": "0.7864208", "text": "def submit_button(label = 'submit', options = {})\n @template.content_tag 'div',\n @template.submit_tag(label.to_s.humanize),\n :class => 'form_buttons'\n end", "title": "" }, { "docid": "4cfe...
87ce15875a9d2ff235626ec639428680
GET /images/new GET /images/new.json
[ { "docid": "782421bf8e62fcf94dd796ed376c99a7", "score": "0.7812744", "text": "def new\n @image = @current_account.images.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @image }\n end\n end", "title": "" } ]
[ { "docid": "8e266abdb61999eee221d0acde517341", "score": "0.79771715", "text": "def new\n @title = t('view.images.new_title')\n @image = Image.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @image }\n end\n end", "title": "" }, { ...
e6afbf3a294014fde15acfb9050edbc7
The description of the option.
[ { "docid": "0af4a9d260e57874561950c6eadfe567", "score": "0.0", "text": "def description\n data.description\n end", "title": "" } ]
[ { "docid": "b6d11ae18fbc04209cd3f5daa2b57ee8", "score": "0.8843041", "text": "def description\n options[:description]\n end", "title": "" }, { "docid": "3bb19d5042856607427130afcfcfbb60", "score": "0.8055544", "text": "def description\n @options[:description] ||= fetch(:...
e56ab7b4c1d791940042d31352a95713
Queue final file processing
[ { "docid": "d68340a9c9a3e99015e06e26f9cf877a", "score": "0.5727976", "text": "def queue_finalize_and_cleanup\n Photo.delay.finalize_and_cleanup(id)\n end", "title": "" } ]
[ { "docid": "330fcb3a8c0d1726e0a805d4446e9d5a", "score": "0.7143104", "text": "def queue_processing\n end", "title": "" }, { "docid": "72638082f9fbb8ea20dea24629a89d93", "score": "0.69203544", "text": "def deliver_next\n\t\t\t@delivery_pending = true\n\t\t\tfile = queue.next\n\t\t\...
e4cade66c88c559c678ce199311d0449
Sonar Query Search Executes a Sonar query to discover assets with the given search criteria.
[ { "docid": "26513e4b4f7402e2376b2354501bdb15", "score": "0.59754246", "text": "def sonar_query_search(opts = {})\n data, _status_code, _headers = sonar_query_search_with_http_info(opts)\n data\n end", "title": "" } ]
[ { "docid": "4f3d12caf94e0850365a317b5c779fa9", "score": "0.6570046", "text": "def execute_search\n variables = @search_stack.map { |el| el[0] }\n searches = @search_stack.map { |el| el[1] }\n @hits = Algolia.multiple_queries(searches)['results']\n variables.each_with_index do...
ce573f6959a9a888f7a1b4e15cdbe57f
Blend to a color amt % towards another color value, eg red.blend(blue, 0.5) will be purple, white.blend(black, 0.5) will be gray, etc.
[ { "docid": "0717a553a7314a818863433a9faa6e65", "score": "0.795199", "text": "def blend(other, amt)\n other = Color.parse(other)\n return Color.new(self) if amt <= 0 || other.nil?\n return Color.new(other) if amt >= 1.0\n val = Color.new(self)\n val.r += ((other.r - val.r)*amt).to_i\n v...
[ { "docid": "f5f90d8209e4f8fe49a5d4137f586887", "score": "0.75990516", "text": "def blend color\n Color.new(((r + color.r) / 2), ((g + color.g) / 2),\n ((b + color.b) / 2), ((a + color.a) / 2))\n end", "title": "" }, { "docid": "19e3d8a8c3b013ebc86d398c03565ee4", "s...
bc05d776142ac79c8b2f38bd1fb2df8e
Unify the fields into a hash
[ { "docid": "69f57a8e1d551131c6d377beb35a84e3", "score": "0.0", "text": "def to_hash\n\t\tres = { \n\t\t\t\t\"service\" => service,\n\t\t\t\t\"title\" => title,\n\t\t\t\t\"thumbnail\" => thumbnail,\n\t\t\t\t\"href\" => href\n\t\t\t }\n\t\tres\n\tend", "title": "" } ]
[ { "docid": "7041edc414c4c1843db6b7539753cb3e", "score": "0.743419", "text": "def rubyize_fields(fields)\n hsh = Hash.new\n fields.each do |key,val|\n hsh.store(rubyize(key.to_s).to_sym, val)\n end\n hsh\n end", "title": "" }, { "docid": "0f53bc480e6b...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "360631e00ffdd77d42286da20223e3ce", "score": "0.0", "text": "def set_store_book\n @store_book = StoreBook.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6164095", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6046031", "text": "def action_hook;...
2c0d81a3df8a0dd25e138e0423f63799
Attempts to retrieve a reference to the object represented by this resource. If the resource is unloaded, nil is returned.
[ { "docid": "5e51ec3fdb36a576695fdadcc76c38dd", "score": "0.63968104", "text": "def reference\n return Object if root?\n return nil unless @parent && @parent.reference\n @reference ||= @parent.reference.const_get(@base_symbol)\n end", "title": "" } ]
[ { "docid": "e90ff6869b30075f12350abdd75bd5a7", "score": "0.73273563", "text": "def get\n begin\n if RUBY_ENGINE == \"jruby\"\n raise Wref::Recycled if !@weakref\n obj = @weakref.get\n \n if obj == nil\n raise Wref::Recycled\n else\n return obj...
b1b7fca7bf9b224da58af04e5ed1ad77
Each service that is a data source provider is associated with its own data source class. data_source_class returns that class.
[ { "docid": "a2025d16718663b8ef8c2ea6402440b3", "score": "0.7904712", "text": "def data_source_class\n provides! :data_source\n name = 'DataSources::' + self.name.demodulize\n raise ArgumentError unless DataSource.type_class_names.include? name\n name.constantize\n end", "title...
[ { "docid": "d69e7cb9acc36e6f7ff92e23983ec150", "score": "0.5932215", "text": "def data_service\n DataServicesApi::Service.new(url: api_service_url)\n end", "title": "" }, { "docid": "a651b335e12c9ef5aa36a2ffde318e6c", "score": "0.58341753", "text": "def data_destination_class\n ...
b9a4383ae57cfeecc0b36c3190f8ef4d
==================== FEED FORWARD ==================== FEED_FORWARD Input: Array of values between 0 and 1 (inclusive). => Array must be same length as first layer of nodes
[ { "docid": "abc9e3f31a0ba3b65f4b03b3e4c557a7", "score": "0.63548696", "text": "def feed_forward(input)\n reset_all_nodes\n\n # Check for wrong number of inputs\n unless input.length == first_layer_nodes.length\n return \"ERROR - wrong number of inputs.\"\n end\n\n puts \"LAYER 1 INPU...
[ { "docid": "b7bae127f10e99d59f9f5c196eed2a70", "score": "0.6290868", "text": "def feedforward(input_values)\n input_values.each_index do |input_index|\n @activation_nodes.first[input_index] = input_values[input_index]\n end\n @weights.each_index do |n|\n @structure...
dd08fa5c6c142dd631df87bb775a4eb2
a lame wrapper to resize_to_fit method
[ { "docid": "296fdcdcb16fec42840228233f609b8a", "score": "0.76472884", "text": "def dynamic_resize_to_fit(size)\n resize_to_fit *(model.class::IMAGE_CONFIG[size])\n end", "title": "" } ]
[ { "docid": "279873903cdfa7b8f3e42f16588124b6", "score": "0.83050257", "text": "def resize_to_fit width, height\n process :resize_to_fit => [width, height]\n end", "title": "" }, { "docid": "4ff797cf23ccce3f5541567e3890893b", "score": "0.79599965", "text": "def resize_to(w...
e2b836521a2f946baada4ae86368d74e
Verify that the keyfile argument is a file.
[ { "docid": "dfdfc1205498369c5640ccae9e802b60", "score": "0.77298504", "text": "def verify_keyfile_exists! keyfile\n exists = ::File.file? keyfile\n raise \"The keyfile '#{keyfile}' is not a valid file.\" unless exists\n end", "title": "" } ]
[ { "docid": "33701e453f148e9c7dbccf50f7f44add", "score": "0.761839", "text": "def verify_keyfile_provided! keyfile\n raise \"You must provide a keyfile to connect with.\" if keyfile.nil?\n end", "title": "" }, { "docid": "4cc024e29458e5383a282ecd6cdc7c82", "score": "0.7320482"...
d4e35c1cd6b16bf7c95abfe71f7eadb3
Attempted to used named urls, but stopped. Function currently not in use:
[ { "docid": "9708285e9331c5889bfd2f0fe17ef85f", "score": "0.0", "text": "def snake_name\n @mountain.name.gsub(/./,'').gsub(/ /,'_').downcase\n end", "title": "" } ]
[ { "docid": "04221d95c31ba5b864c365d1a88b8286", "score": "0.6427101", "text": "def url=(_arg0); end", "title": "" }, { "docid": "04221d95c31ba5b864c365d1a88b8286", "score": "0.6427101", "text": "def url=(_arg0); end", "title": "" }, { "docid": "04221d95c31ba5b864c365d1a88b...
962a9ee464099ab377e338cac593a5b1
GET /feeds/:feed_id/submissions/1 GET /feeds/:feed_id/submissions/1.js
[ { "docid": "7d79e4bdb030d99acaba41cd607f3f53", "score": "0.7059387", "text": "def show\n @submission = Submission.find(params[:id])\n \n # IMPORTANT: .all must be at the end of the collection to eager load and prevent the actual object from being deleted!\n @other_submissions = @submission.c...
[ { "docid": "37d67f8d078f70f27c2a3ac42894699e", "score": "0.712278", "text": "def show\n @submission = Submission.find(params[:id])\n auth!\n \n # IMPORTANT: .load must be at the end of the collection to eager load and prevent the actual object from being deleted!\n @other_submissions = @s...
2a57744ac930052b490c715ec63369b7
datetime API Key expiration date
[ { "docid": "63e89863f2d2dc236a985fcf29c0bad7", "score": "0.6338909", "text": "def expires_at\n @attributes[:expires_at]\n end", "title": "" } ]
[ { "docid": "152ef102708c58e783a5edaec9b521cb", "score": "0.77667844", "text": "def expiration_date\n hash[\"ExpirationDate\"]\n end", "title": "" }, { "docid": "67964558ece1651877638e63f238bd3f", "score": "0.7455426", "text": "def expiration_date\n end", "t...
98b19f7c7e50ce19798c9e61da2180e9
Returns the value of attribute number. source://syntax_tree//lib/syntax_tree/yarv/instructions.rb5373
[ { "docid": "66d3b6a4971262dd57e42a0a5ce2961c", "score": "0.0", "text": "def number; end", "title": "" } ]
[ { "docid": "d2fd5915863023b81bbc7af10ae853e3", "score": "0.6795191", "text": "def get_int(attr); end", "title": "" }, { "docid": "8a42317adff8dc170e472d327be60d17", "score": "0.6609372", "text": "def number\n read_attribute(:value)\n end", "title": "" }, { "docid": "5...
84263e0a5ec2ab65893aa87ae53709a5
The MAC associated with this reminder. Only format version 1 reminders have a MAC.
[ { "docid": "4a8cef5ebcb4b8536b57d1edc095dc0a", "score": "0.7094595", "text": "def mac\n options[:mac]\n end", "title": "" } ]
[ { "docid": "13e0d5ce36707b950fc2d897642820c2", "score": "0.82074606", "text": "def mac\n @attributes.fetch('mac', nil)\n end", "title": "" }, { "docid": "390b5cab25ca610ac7736fadb11f474d", "score": "0.7812805", "text": "def mac_address\n @mac_address ||= raw_da...
b7e48841d5703ffcc9b7e09e50fa7263
create an ID3v2 frame from a raw binary string
[ { "docid": "ef69fe417918d288a337458ad45d17fb", "score": "0.5844343", "text": "def decode_tag(name, value)\n ID3V24::Frame.create_frame_from_string(name, value)\n end", "title": "" } ]
[ { "docid": "25eaefaae2066abde7bbd9e7bcbbc41e", "score": "0.61405516", "text": "def from_blob(str); end", "title": "" }, { "docid": "fad3fd5d9d2bc423265908744db6e880", "score": "0.6119995", "text": "def from_record(bytes)\n bytes.unpack('QQQQQ')\n end", "title": "" }, ...
cac0144fed851f5cf9e9f333a16f4000
returns true/false based on if given date is within the current month
[ { "docid": "6c085001732ce67ff4529599c2acc6ed", "score": "0.85245687", "text": "def is_current_month(date)\n currentMonth = Time.now.month\n dateMonth = date.month\n dateMonth.between?(currentMonth, currentMonth)\n end", "title": "" } ]
[ { "docid": "ac0324ea4d1853e47099c5ddda856b57", "score": "0.768663", "text": "def contains?(date)\n year == date.year && month == date.month\n end", "title": "" }, { "docid": "9c9505c1e31cb94bf2b96c8120712512", "score": "0.74908787", "text": "def current_month?\n self.mon...
a87e779010903e839f12b110958dc6af
Returns the length of the queue.
[ { "docid": "b6a83ff09ad9ab09b757fbb537be3e77", "score": "0.7925102", "text": "def length\n @que.length\n end", "title": "" } ]
[ { "docid": "f65b9292cc01a5fa37c8ef8686450ee5", "score": "0.9149399", "text": "def length\n @queue.length\n end", "title": "" }, { "docid": "bde3a54fd6a4ebf3449edc568c154e62", "score": "0.9058203", "text": "def length\n @queue.length\n end", "title": "" }, { "d...
b00c62651012189d84c6cb28b057ff96
A convenience wrapper for find(:last, args). You can pass in all the same arguments to this method as you can to find(:last).
[ { "docid": "7c14e4412706f0dd9f89242e4f7d800d", "score": "0.8726994", "text": "def last(*args)\n find(:last, *args)\n end", "title": "" } ]
[ { "docid": "581760674638d52ff0c07fbaad94ef09", "score": "0.8638956", "text": "def last(*args)\n find_last\n end", "title": "" }, { "docid": "b190f8028cb55c6f0f726fb1fb2eb447", "score": "0.84141755", "text": "def last(*args, &block)\n find(:last, *args, &block)\n end...
f26253c3e0d57a6514d2393045083437
Returns employee and service provider objects.
[ { "docid": "9b40558ed56b80e817d3211fb910348a", "score": "0.0", "text": "def get_receiver_and_provider\n\t\tcur_usr=current_user\n\t\tcur_ser_sess=current_service_session\n\t\tunless cur_ser_sess.nil?\n\t\t\t@receiver = cur_ser_sess.assignment.nil? ? cur_ser_sess.user : cur_ser_sess.assignment.user\n\t\t...
[ { "docid": "e56d0bda2035066f48d8d8888634ea48", "score": "0.6924989", "text": "def employees\n @employees ||= Services::Employee.new(@api_key) \n end", "title": "" }, { "docid": "55523dcdb862d6bb0cc21939ca5219f7", "score": "0.6640402", "text": "def employees\n @employee...
034acb42ea559c2d6c44a1cc1e0c139b
GET /admin_text_effects/new GET /admin_text_effects/new.xml
[ { "docid": "27ad244754b6bfb96c7df723add4544d", "score": "0.7913737", "text": "def new\n @text_effect = TextEffect.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @text_effect }\n end\n end", "title": "" } ]
[ { "docid": "91ded542db6e69df3678e160f009f8dc", "score": "0.7521941", "text": "def create\n @text_effect = TextEffect.new(params[:text_effect])\n\n respond_to do |format|\n if @text_effect.save\n flash[:notice] = 'Admin::TextEffect was successfully created.'\n format.html { redir...
7c385eea71ac9d18a12ebddd61770d38
user has disconnected from the socket
[ { "docid": "7fe8df6af1536845eadc60d473fd404e", "score": "0.0", "text": "def disconnect\n guid = request.params[:guid]\n token = request.params[:token]\n activation_token(guid, token, false)\n end", "title": "" } ]
[ { "docid": "8ca595653a753049bfc99e82eeabdc35", "score": "0.8171102", "text": "def on_socket_disconnect\n end", "title": "" }, { "docid": "e68d779a51c226044233d11359f8d155", "score": "0.78394574", "text": "def on_disconnect(socket)\n end", "title": "" }, { "docid": "...
80cbb29551684d5a7267d50763d28283
GET /bookings/1 GET /bookings/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "ac8355d07e1353ac36659b08db8f2002", "score": "0.7793375", "text": "def index\n @bookings = Booking.all\n\n render json: @bookings\n end", "title": "" }, { "docid": "d65ce9f0532219b10f9792ac07754e3b", "score": "0.76496434", "text": "def index\n @bookings = Booking...
58166d27931ed247c48f54b450d267fc
metodo para descargar evidencia
[ { "docid": "e7c6e96aae54ad24470e28a8bbdf6a18", "score": "0.5462588", "text": "def download\n @queja = Queja.find(params[:id])\n send_file(@queja.evidencia.path)\n end", "title": "" } ]
[ { "docid": "ce8ea4abe02d3c86bb0726a72d78ab3e", "score": "0.56702524", "text": "def show\n @video = Video.find(params[:id])\n @profesor = @video.profesor\n @observador = @video.observador\n delete_key = @video.attach_file_name\n end", "title": "" }, { "docid": "c808168349b62cdb80...
0251a675b3be137e6220d97511d7c9a7
Return's this object's OS family name
[ { "docid": "174c8a8a43df6c4fcab0d414a3d0f119", "score": "0.82585746", "text": "def os_family\n os_parser.family.os\n end", "title": "" } ]
[ { "docid": "a34ad4df8df8addda3f881a0ea872a10", "score": "0.800045", "text": "def os_family\n case os_type(:nice)\n when /Linux|Solaris|OSX/i then 'Generic'\n when /Windows/i then 'Windows'\n else 'Unknown'\n end\n end", "title": "" }, { "do...
9dda6e03010495a81994c3aeee4e18a8
icon_source_type id marquee_enabled marquee_parser_id
[ { "docid": "189da253725a1636d12cf9f1bca7a4ca", "score": "0.58510816", "text": "def marquee_props\n { parser_id: marquee_parser_id, text_markup: marquee_text_markup }\n end", "title": "" } ]
[ { "docid": "2587fc41d5a15afc7fbb0aba549026b0", "score": "0.44550446", "text": "def id_key\n 'animation_2_instructions'\n end", "title": "" }, { "docid": "2587fc41d5a15afc7fbb0aba549026b0", "score": "0.44550446", "text": "def id_key\n 'animation_2_instructions'\n end", "ti...
bcc35c102244d355f4b997404b1986de
Appending to this object will append raw String values or the result of :to_html calls if available, builder will be adjusted to respect the current indentation level.
[ { "docid": "1ff086a7e7f5d9a02ccc53bd7d2050dd", "score": "0.6405331", "text": "def concat(obj, indent = false)\n if obj.respond_to?(:to_html)\n obj.builder.level = builder.level if obj.respond_to?(:builder)\n builder << obj.to_html\n else\n builder << (indent ? indent(obj.t...
[ { "docid": "a99d769c8d0048481ff991a4f74c2a7c", "score": "0.64566576", "text": "def append(markup)\n super(markup).html_safe\n end", "title": "" }, { "docid": "9dae5bd53fc54d99103169d814fd23e2", "score": "0.62447345", "text": "def builder\n @raw.builder\n end",...
e484f1df033c48000b797964385154a4
Placeholder for class inheritance
[ { "docid": "c3285b979f713395f60cf13edce8a310", "score": "0.0", "text": "def methodmissing; end", "title": "" } ]
[ { "docid": "65131bff089b93da35d73f4450476d3f", "score": "0.75146383", "text": "def inherited(klass); end", "title": "" }, { "docid": "65131bff089b93da35d73f4450476d3f", "score": "0.75146383", "text": "def inherited(klass); end", "title": "" }, { "docid": "65131bff089b93da...
af876e2bc676fd6986826356a525eff3
DELETE /player_records/1 DELETE /player_records/1.json
[ { "docid": "21cb9c01d3eb14fd5a429d7545d28fea", "score": "0.7721786", "text": "def destroy\n @player_record = PlayerRecord.find(params[:id])\n @player_record.destroy\n\n respond_to do |format|\n format.html { redirect_to player_records_url }\n format.json { head :no_content }\n end\...
[ { "docid": "012c5c06dedd1a324be2e218dda48b81", "score": "0.7711905", "text": "def destroy\n @player_record.destroy\n respond_to do |format|\n format.html { redirect_to player_records_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b8a96da...
e12594d3892f0e4f6a356f20db763ffc
Wraps +call+ in a proc. Suitable for use in +map+ and friends.
[ { "docid": "ee77e9090970cfee6e39c8dbf1f56e56", "score": "0.659676", "text": "def to_proc\n -> x { call(x) }\n end", "title": "" } ]
[ { "docid": "f8c92349f2e6cc07f3d3270dce777064", "score": "0.7373829", "text": "def call_proc(&prc) #must have a ampersand (to_proc) method\n prc.call\nend", "title": "" }, { "docid": "78ee7f403315c574e3f87d6d3715f5d4", "score": "0.73378485", "text": "def call_proc(prc)\n prc.call(...
1776d9aed7705f9f47e9e53c0ea409ed
transformscale : Scale selected objects by scale factor.
[ { "docid": "14c51728ea7cbb33826afee5a917a4ed", "score": "0.7708248", "text": "def transform_scale(scale)\n # TODO: check if scale is a double\n execute(\"transform-scale:#{scale}\")\n end", "title": "" } ]
[ { "docid": "4ae5b24aeb743541487af25d55493946", "score": "0.74541825", "text": "def scale_by( scale_factor )\n\t\t\tpoints.each{ |p| p.scale_by!( scale_factor ) }\n\t\tend", "title": "" }, { "docid": "f41be32810d717c1d4369346d88b72b6", "score": "0.7160065", "text": "def scale_by!( sca...
bf00a73b0db74aae3a6bfc59f887f6aa
Get upgrade units Get upgrade units
[ { "docid": "8f1aeb83f9b2929702b6940976c6e3e1", "score": "0.6800362", "text": "def get_upgrade_units_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UpgradeApi.get_upgrade_units ...\"\n end\n if @api_client.config.client_s...
[ { "docid": "afb0d187ffcbcda7eaa60bece4ac60a7", "score": "0.8273811", "text": "def get_upgrade_units(opts = {})\n data, _status_code, _headers = get_upgrade_units_with_http_info(opts)\n return data\n end", "title": "" }, { "docid": "2b9e9626567d096dfbb7b4889c3b4547", "score":...
e248b3953bbe643ec50690ad4e9f37f6
Sets up this extension and registers its runtime options.
[ { "docid": "db9e41d072de8264ae879da6e280cd67", "score": "0.0", "text": "def initialize ()\n options = {\n :method => {\n :definition => \"Specify html, text, pdf, or any combination of the three to define output method\",\n :default => \"text\",\n :short_flag => \"...
[ { "docid": "58da2c443d09289fe30e96c75a58396a", "score": "0.7094694", "text": "def add_runtime_options!\n class_option :force, :type => :boolean, :aliases => \"-f\", :group => :runtime,\n :desc => \"Overwrite files that already exist\"\n\n class_option :pretend, ...