query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
d7bb22ae11c638e5846a4b0138a75dd3 | Extracts a hash containing the relation between works/books and representations (with their relations to files). Goes through all representations, looks in their RELSEXT datastream to find the id in the 'hasSubset' relation. Uses magic numbers 37 and 45 for finding the start and end of the representation 'PID' within t... | [
{
"docid": "380dc79c0255c3743cea91f7b5e4287e",
"score": "0.617433",
"text": "def extract_work_book_relations_to_reps(book_and_works, rep_relations)\n res = Hash.new\n rep_relations.each do |k, v|\n begin\n rep = ActiveFedora::Base.find(k, :cast=>false)\n search_start = rep.datas... | [
{
"docid": "59b0c6b09f547b5e61d18867e53290c6",
"score": "0.5595726",
"text": "def extract_rep_relations_to_files(reps, files)\n res = Hash.new\n files.each do |f|\n begin\n file = ActiveFedora::Base.find(f, :cast=>false)\n search_start = file.datastreams['RELS-EXT'].content.inde... |
b73dc96a5e7d7c9d915b2a626694ea7f | region The "pdf_to_sign" accessors | [
{
"docid": "e3a52a810da249c530f0ca44ddeea252",
"score": "0.91327167",
"text": "def pdf_to_sign\n _get_pdf_to_sign\n end",
"title": ""
}
] | [
{
"docid": "63c8d5bc2ccbe77162a69993b127418b",
"score": "0.7052988",
"text": "def action\n\n # Get the token for this signature (rendered in a hidden input field, see\n # pades_signature/new.html.erb).\n token = params[:token]\n\n # Get an instance of the PadesSignatureFinisher class, respon... |
fa474476d4438422d75ee0598394b2af | The ID of a multistatement transaction. | [
{
"docid": "bfe27b5797053859ef8d933eeb9b2eb3",
"score": "0.6794426",
"text": "def transaction_id\n @gapi.statistics.transaction_info&.transaction_id\n end",
"title": ""
}
] | [
{
"docid": "858b66615da6f9aefc8947419da4feb8",
"score": "0.7274392",
"text": "def transaction_id\n @data[:transaction_id]\n end",
"title": ""
},
{
"docid": "164e7927ec464d45ec26c9db7adaa1e0",
"score": "0.72699475",
"text": "def transaction_id\n ret = @transaction_id ||= ... |
06b662dcd5709a6d26c8b97e38d9c9ab | Coerce the provided inputs as needed. Looks up and invokes the associated coercion function. | [
{
"docid": "92d1d8d625487f089784793f97bccd7a",
"score": "0.5748831",
"text": "def coerce(lhs, rhs)\n @map[[lhs.class, rhs.class]].call(lhs, rhs)\n end",
"title": ""
}
] | [
{
"docid": "856ab34578f74eba6a7b819ef4830c4d",
"score": "0.76109743",
"text": "def coerce(*args)\n self.class.coerce(*args)\n end",
"title": ""
},
{
"docid": "a588895e11e5ad8c4e69fc510f298db3",
"score": "0.73966104",
"text": "def at_with_coercion(*args, **kwargs); end",
"... |
a1956487b824d4f7aeac4d85e9e8fbc8 | The following additional options are respected: :connection_handling Set how to handle available connections. By default, uses a a stack for performance. Can be set to :queue to use a queue, which reduces the chances of connections becoming stale. Can also be set to :disconnect, which will disconnect after every query ... | [
{
"docid": "93205a0b329050e6c2d78e05e01c9374",
"score": "0.67008245",
"text": "def initialize(opts = {}, &block)\n super\n @max_size = Integer(opts[:max_connections] || DEFAULT_MAX_SIZE)\n raise(Sequel::Error, ':max_connections must be positive') if @max_size < 1\n @connection_handli... | [
{
"docid": "fbfe8b542b1a898fab4ccc514ba67137",
"score": "0.7304972",
"text": "def connection_pool_default_options\n o = super\n uri == 'sqlite3::memory:' ? o.merge(:max_connections=>1) : o\n end",
"title": ""
},
{
"docid": "221baacf6f3748c18531cd582624fa7a",
"sco... |
97fa23ba376fe6fe1e7fcd878689aa6d | POST /works POST /works.json | [
{
"docid": "12b0cacc0afa06b75a235ccadf61e526",
"score": "0.0",
"text": "def create\n authorize! :create, User\n @user = User.new(employee_params)\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to employees_path, notice: 'Employee was successfully created.' }\n ... | [
{
"docid": "7947345a177691295453f11c122c0f19",
"score": "0.72304493",
"text": "def create\n @work = @client.works.build(work_params)\n\n respond_to do |format|\n if @work.save\n format.html { redirect_to client_work_path(@client, @work), notice: 'Work was successfully created.' }\n ... |
42b05999a5630d78568926f07d976703 | Get the name of the test runner source file we will create for the test file. | [
{
"docid": "0c8921b4f188a3541881db468aa3d7e4",
"score": "0.7281743",
"text": "def get_test_runner_source_file_from_test_file test_file\n test_file.pathmap(\"#{RUNNER_DIR}/%{^test/,}X_runnner.c\")\nend",
"title": ""
}
] | [
{
"docid": "55b5b0a2eaa8260a8b4f4e3cd38651f3",
"score": "0.74916846",
"text": "def generated_test_file_path\n \"#{test_suite_identifier}/#{folder_name}/#{file_name}#{suffix}_#{test_suite_identifier}.rb\"\n end",
"title": ""
},
{
"docid": "61113ae66780924cb208e46ac211b838",
"score": "... |
97e8959d848e748ae04903c3e1cf9749 | Define what fields hadoop should use to distribute records to reducers | [
{
"docid": "94b06c7c68a72e4d9ee3a545f09d036d",
"score": "0.58277845",
"text": "def hadoop_partition_args\n unless options[:partition_fields].blank?\n [\n '-partitioner org.apache.hadoop.mapred.lib.KeyFieldBasedPartitioner',\n jobconf(:output_field_separator),\n job... | [
{
"docid": "b17106241aa52abc127d8d71a0651700",
"score": "0.5658261",
"text": "def num_key_fields() 2 end",
"title": ""
},
{
"docid": "7426b121ed40847fc5464a875837d899",
"score": "0.55426365",
"text": "def num_key_fields() 3 end",
"title": ""
},
{
"docid": "8bfaf699122e... |
d1b43e25e5861cfe9c5dee90aa1143f8 | Implement an instance's base resource as a subresource of the class base resource. This prevents modifications to the subresource from persisting in the system. Persisted instances will use the +identify+ subresource, otherwise the base resource is used. | [
{
"docid": "00e041eb7a507ef2892af2c904621b02",
"score": "0.81459725",
"text": "def base_resource\n\t\t\t Subresource.new persisted? ? self.class.identify(self) : self.class.base_resource\n\t\t\tend",
"title": ""
}
] | [
{
"docid": "26e7486f9d6e17c57e1978ec4ec44bb8",
"score": "0.68553984",
"text": "def inherited(resource)\r\n resource.class_eval do\r\n self.versions ||= {}\r\n self.helper_object = Object.new\r\n\r\n begin\r\n plural = name.demodulize.tableize\r\n self.path = l... |
a85fdf57d0c942c3e76fa5850e4e38d7 | Assumes valid code (should be prefiltered by Piece.create) | [
{
"docid": "f53007ee29b62f5392d9f35c2f02cc9f",
"score": "0.0",
"text": "def initialize(input_code)\n @code = input_code\n end",
"title": ""
}
] | [
{
"docid": "c0f35b8d2c81815c7b17c5b14fa97ace",
"score": "0.636677",
"text": "def valid_code?(code)\n\t#if the code isnt 4 letters: invalid\t\n\tif code.length != 4\n\t return false\t \n\telse\n\t code.each do |letter| \n\t #if any letter isnt a color option: invalid\n\t if !@@pieces.include?(... |
fcdada83775de4499ee3d705de7f9112 | Add has_many relationship to the given model | [
{
"docid": "4c157ca4fd6a611d0dab4a9fc2700148",
"score": "0.67828745",
"text": "def has_many(model, opts = {})\n if opts[:through]\n medium = if opts[:through].respond_to?(:belongs_to)\n opts[:through]\n else\n m = @world.resolve_m... | [
{
"docid": "43316c1ef8bb7396161dc8ed3be53d73",
"score": "0.7483889",
"text": "def has_many(name, model)\n relation(name, Collection.new(model))\n end",
"title": ""
},
{
"docid": "088b5475370802d518da6f4c190c82e0",
"score": "0.72347295",
"text": "def has_many(name, options... |
c5ab2173012fccec012c43c980abc3cf | Retrieves payroll calendar by using a unique payroll calendar ID | [
{
"docid": "fdaf122b6b03909a9e6b35121e48f449",
"score": "0.6039236",
"text": "def get_payroll_calendar(xero_tenant_id, payroll_calendar_id, opts = {})\n data, _status_code, _headers = get_payroll_calendar_with_http_info(xero_tenant_id, payroll_calendar_id, opts)\n data\n end",
"title": ... | [
{
"docid": "a9da6fe5bc7aa40e91c505bf6198a3e4",
"score": "0.73369884",
"text": "def get_calendar(calendar_id = 'primary')\n execute(:api_method => service.calendars.get, :parameters => { 'calendarId' => calendar_id }).data\n end",
"title": ""
},
{
"docid": "ca840512e4bf2349ae33ed38b32... |
64ea6f24217bee5636552389684a1a14 | Produces a formation in volleyball. | [
{
"docid": "9af91a05df3d31065abde6037dcfa0ce",
"score": "0.652921",
"text": "def formation\n fetch('volleyball.formation')\n end",
"title": ""
}
] | [
{
"docid": "e3c72fd508ec750c7b5bbc28306bfb96",
"score": "0.59586024",
"text": "def game_format; end",
"title": ""
},
{
"docid": "840e8c85d38f514f38e4b2be6b4fc249",
"score": "0.5924333",
"text": "def geom(num)\n blade0 = @blade0 * num.blade0 +\n @blade1[0] * num.blade1[0] +\n ... |
601ee363e23373c8334e4fea534b340d | DELETE /folders/1 DELETE /folders/1.json | [
{
"docid": "f63a063698ccd7f2bd96b3f58a0dd21e",
"score": "0.7087149",
"text": "def destroy\n @folder.destroy\n respond_to do |format|\n format.html { redirect_to folders_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] | [
{
"docid": "fcf0fa86db2cf222b4b7017c7a2d0a1a",
"score": "0.7593493",
"text": "def folder_delete(path)\n make_request(:delete,\"#{folders_url(path)}.xml\")\n end",
"title": ""
},
{
"docid": "7d672d630a4c5fa4e50c17240e039a2c",
"score": "0.7217126",
"text": "def delete_folder(id... |
25f126e2a4b9bd43e9906e6dc4592816 | Decrypting the message is straightforward if you know what shift was used. However, if you don't know the shift, you have to try all possible shifts until you find the right one. Since you don't know what the message is in advance (if you did, why would you be trying to decrypt it?), the "right" shift is the shift that... | [
{
"docid": "5dd25f5786ab79ac55f635c5938e4afb",
"score": "0.7282071",
"text": "def break_caesar(message)\n #...\n word_arr = message.split(' ').map { |i| i.downcase }\n result_x = nil \n result_text = ''\n\n while result_x == nil do \n x = 0\n temp_text = ''\n word_arr.each do |word|\n ... | [
{
"docid": "968c1e77db17057aa2f3dc1c96506d09",
"score": "0.7069881",
"text": "def DecryptCaesar(words,shift) #Descifrar restando el desplazamiento\n decryptedM = []\n words.each {\n |letter|\n if (letter >= 65) && (letter <= 90) #The letter is Upcase\n if (letter - shift) < 65\n tru... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "623b6ed00da365d91c28151e3f036b35",
"score": "0.0",
"text": "def set_place\n @place = Place.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60326946",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6015941",
"text": "de... |
cb274ff92322c82264959c2eeacb11c0 | :callseq: map.result_value_of( declared_type, value ) > String result_value_of is called during the result processing of column values to convert an SQLite database value into the appropriate Ruby class. +declared_type+ is the string from the original CREATE TABLE statment from which the column value originates. It may... | [
{
"docid": "5baea323552ec871a948b8e4bdfdff8e",
"score": "0.5663308",
"text": "def result_value_of( delcared_type, value )\n raise NotImplementedError, \"result_value_of has not been implemented\"\n end",
"title": ""
}
] | [
{
"docid": "e392d34742138a23b00b2473b49d19df",
"score": "0.69472665",
"text": "def result_value_of( declared_type, value )\n case value\n when Numeric\n return value\n when NilClass\n return value\n when Amalgalite::Blob\n return value\n when String\n ... |
f4e45deb9707366a0c06012b77edb209 | present one suggetion result to cli | [
{
"docid": "6653270cd31afda08a95bba9a4d4354c",
"score": "0.0",
"text": "def present_single_suggestion(list_number = 1)\n suggestion = @instance_data.select{|suggestion| suggestion[:list_number] == list_number}\n hash = suggestion[0]\n category_array = hash[:category_list]\n clean_category_ar... | [
{
"docid": "d4d82551d5a32a4ea9378ec02c7ac861",
"score": "0.7192446",
"text": "def show_result(result); end",
"title": ""
},
{
"docid": "d4d82551d5a32a4ea9378ec02c7ac861",
"score": "0.7192446",
"text": "def show_result(result); end",
"title": ""
},
{
"docid": "0949717513b4... |
1236318e0a0154279798356a3d15d7cd | Terminate the client's session and close this connection. An alias for the exit method. | [
{
"docid": "e6555a53189e6d46845537c494f115d4",
"score": "0.64328104",
"text": "def close\n self.exit\n end",
"title": ""
}
] | [
{
"docid": "0729079fd4de97988ca8d31851cd2e05",
"score": "0.74575436",
"text": "def exit\n @client.logout @creds, @environment\n @transport.close\n end",
"title": ""
},
{
"docid": "b87840bdfd12476ae4a517a3b005c0e2",
"score": "0.74308884",
"text": "def quit... |
4e02fd342f972a4b7dc50bad572060b2 | DELETE /project_actions/1 DELETE /project_actions/1.xml | [
{
"docid": "b80c519ee59eced69d39643f2c96d8aa",
"score": "0.74448407",
"text": "def destroy\n @project_action = ProjectAction.find(params[:id])\n @project_action.destroy\n\n respond_to do |format|\n format.html { redirect_to(project_actions_url) }\n format.xml { head :ok }\n end\n ... | [
{
"docid": "7ca7e8ba9bdfdf617b6cbfda6d8cca1d",
"score": "0.6883529",
"text": "def delete\n ruta = \"/actions/#{id}\"\n client.delete(ruta)\n end",
"title": ""
},
{
"docid": "e953e5d0565ba720e4b8a205b64b3b0a",
"score": "0.6803558",
"text": "def destroy\n #cuando se bor... |
44dbc3a9844fce86000de0a397377a6e | POST /plans POST /plans.json | [
{
"docid": "f063a4e0f986c104350f240499456ab3",
"score": "0.71364665",
"text": "def create\n @plan = Plan.new(plan_params)\n @plan.user_id = current_user.id\n respond_to do |format|\n if @plan.save\n format.html { redirect_to @plan, notice: 'Plan was successfully created.' }\n ... | [
{
"docid": "292c0d6c2071986b05f680c5cd6c2659",
"score": "0.7666621",
"text": "def create\n @plan = Plan.new(params[:plan])\n\n if @plan.save\n render json: @plan, status: :created, location: @plan\n else\n render json: @plan.errors, status: :unprocessable_entity\n end\n end",
... |
751e217fe52f4f01a642a0f0197def31 | Creates a new user session | [
{
"docid": "37c5401674de9f548e8e644205ca7aed",
"score": "0.0",
"text": "def create\n user = User.find_by email: params[:email]\n if user && user.authenticate(params[:password])\n reactivate(user)\n render json: user.session_api_key, status: 201\n else\n ... | [
{
"docid": "87e99099499ea77bb919ac8c092fe3d1",
"score": "0.82859564",
"text": "def create_session\n @user = User.new(nickname: User.temp_user_name)\n @user.save\n session[:user_id] = @user.id\n @user\n end",
"title": ""
},
{
"docid": "fb82fb64e8c7c241918a9f1479f0e58c",
"scor... |
7e27aa0e7730c908998b8668e38d8dce | POST /playlist_songs POST /playlist_songs.json | [
{
"docid": "596bc9570722b73293c7cdc64ad237d3",
"score": "0.80169183",
"text": "def create\n @playlist_song = PlaylistSong.new(playlist_song_params)\n\n if @playlist_song.save\n render json: @playlist_song, status: :created, location: @playlist_song\n else\n render json: @playlist_song... | [
{
"docid": "fd73c276dd8b0551bf87210a5e1787a4",
"score": "0.79760027",
"text": "def create\n @song = @playlist.songs.create(song_params)\n redirect_to playlist_songs_path(@playlist)\n end",
"title": ""
},
{
"docid": "5eb07953af504ef1a79b0cf530a2a712",
"score": "0.7891893",
"tex... |
cd779879c8dcd7d6a7bc31d39ed2c821 | Delivers a mailer message email with the given attributes ==== Examples deliver(:sample, :birthday, "Joey", 21) deliver(:example, :message, "John") | [
{
"docid": "0d6f7ecfc1b1988b5cdb9ff56afb4a5e",
"score": "0.7440214",
"text": "def deliver(mailer_name, message_name, *attributes)\n settings.deliver(mailer_name, message_name, *attributes)\n end",
"title": ""
}
] | [
{
"docid": "6f2e24de6f5fc26b3db8de42b97d050b",
"score": "0.7787176",
"text": "def deliver(mailer_name, message_name, *attributes)\n mailer = registered_mailers[mailer_name] or fail \"mailer '#{mailer_name}' is not registered\"\n message = mailer.messages[message_name] or fail \"mailer ... |
94e93286a8511f4975ee67d1ccd51875 | same as above but include heroku dyno hostname | [
{
"docid": "00ffd8569c11fdee384259014f688232",
"score": "0.0",
"text": "def graphite_dyno_log(metric,count)\n dyno = ENV['DYNO'] || 'unknown-host'\n metric_name = \"#{dyno}.#{metric}\"\n graphite_log metric_name, count\nend",
"title": ""
}
] | [
{
"docid": "0cd87d93d21b014e7201766c46bf73e3",
"score": "0.7488846",
"text": "def site_url\n return 'localhost:9393' unless RACK_ENV == 'production'\n \"#{app_name}.heroku.com\"\nend",
"title": ""
},
{
"docid": "8067e3e251dbcc6496086cdac438d04c",
"score": "0.6987041",
"text": "def ... |
23a9b18bda7882dde74af005b11dc955 | helper method that creates a new question, creates any new choices that the user specified, and updates the link relationships in inclusions | [
{
"docid": "1f9409eadb91bee939ab55f4be30ec09",
"score": "0.65942353",
"text": "def _create_new_question(short_name, text, question_type, domain, current_user_id, choices)\n\t\t@new_question = Question.new(:short_name => short_name, :text => text, :question_type => question_type, :created_by => current_u... | [
{
"docid": "401620c5d50e6d89eca7657f98eb50fa",
"score": "0.65397674",
"text": "def create\n @question = Question.new(question_params)\n @question.answers.build(params[:question][:answer])\n\n # Creating associations for themes and levels\n asked_themes = params[:question][:theme_list].reject... |
66cddd320aab470f0766011cdbe563ed | Method that will perform business logic and on data received from Kafka (it will consume the data) | [
{
"docid": "5af5a3d87b77f13ef896af355e2afde9",
"score": "0.0",
"text": "def consume\n raise NotImplementedError, 'Implement this in a subclass'\n end",
"title": ""
}
] | [
{
"docid": "f4576f7a24a73905481459c3ec5d038d",
"score": "0.68409276",
"text": "def consume\n # We run the consumer client logic...\n consumer.on_consume\n end",
"title": ""
},
{
"docid": "91cbfd07e2c223b938f17a5e7586cfd1",
"score": "0.6840589",
"text": "def consume... |
1d68e5b9c4f4495e9d6735b09b33c5e6 | GET /maa_addresses/1 GET /maa_addresses/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "2ad17968f001a0c41ed98f1f2c0fd1d6",
"score": "0.74067974",
"text": "def index\n @maa_addresses = MaaAddress.all\n end",
"title": ""
},
{
"docid": "1f5b7c6401413b30c2984d547ad75928",
"score": "0.71968275",
"text": "def index\n @api_v1_addresses = Address.all\n ren... |
6df07764e9b34024462bf8ba0e34bdd7 | for testing purposes only | [
{
"docid": "bfc913218cf39027e8a5d01b4695ac5d",
"score": "0.0",
"text": "def render\n @rows.each { |row| puts row.map(&:to_s).join(' ') }\n nil\n end",
"title": ""
}
] | [
{
"docid": "33e1db3c06643dd523dcc31fccf3a005",
"score": "0.6957865",
"text": "def used; end",
"title": ""
},
{
"docid": "33e1db3c06643dd523dcc31fccf3a005",
"score": "0.6957865",
"text": "def used; end",
"title": ""
},
{
"docid": "b6b2bcc0062aeb115edab7b10cbe6930",
"sc... |
ccad4da08b24e6f0d0301a704f84175f | The HTML role of cells within the table. | [
{
"docid": "03aa4740275ab2ea8a0b43e738a977d6",
"score": "0.7331768",
"text": "def table_cell_role(table: table_role?)\n table ? 'cell' : 'gridcell'\n end",
"title": ""
}
] | [
{
"docid": "521cfa3971d43ce6bcfb5cc2f359135c",
"score": "0.6174778",
"text": "def cells\n attributes.fetch(:cells)\n end",
"title": ""
},
{
"docid": "417c38e30c852555c10b6841e82a318f",
"score": "0.6146218",
"text": "def html_cell(entry)\n content_tag(:td, conte... |
15869dfcb56b72bce5f26e931234c02a | this above is O(n!) + O(n) | [
{
"docid": "475db3d08560858ffdc69b5959ffa226",
"score": "0.0",
"text": "def second_anagram?(str1, str2)\n str1.chars.each do |el|\n str2.delete!(str2[str2.chars.find_index(el)]) unless str2.chars.find_index(el).nil?\n end\n\n str2.empty?\nend",
"title": ""
}
] | [
{
"docid": "00ee2a773f8c3653a5307eecd31539c8",
"score": "0.6589243",
"text": "def solution(a)\n check_array = a.group_by{|n| n }\n (1..100001).each do |idx|\n return idx unless check_array[idx]\n end\nend",
"title": ""
},
{
"docid": "239f4a4623ff9a2dc517cbbef43d4f3d",
"score": "0.6... |
a5265d9b169e8a2e02095a51732e68ad | Called for each tracker keyframe, with the Tracksperanto internal coordinates and frame numbers. The calls come after start_tracker_segment and before end_tracker_segment | [
{
"docid": "ea5f63b5cebf2dd67b1d87fba109ff10",
"score": "0.0",
"text": "def export_point(at_frame_i, abs_float_x, abs_float_y, float_residual)\n end",
"title": ""
}
] | [
{
"docid": "e992db297183e840a381c5a3da4533d8",
"score": "0.5190829",
"text": "def send_offsets\n end",
"title": ""
},
{
"docid": "db0207b7c549387f98c8d2eb081745d0",
"score": "0.50915235",
"text": "def get_frames()\n @frames.each_with_index{ |frame, i|\n\n # Creat... |
a200c09d6b3371916cf1751f10465ad8 | The initial connection to Dropbox will provide the user with an authorization url. The user must open this URL and confirm that the authorization successfully took place. If this is the case, then the user hits 'enter' and the session will be properly established. Immediately after establishing the session, the session... | [
{
"docid": "3a228dbf8b8fbb00e72b2df15014135e",
"score": "0.5602463",
"text": "def connection\n return @connection if @connection\n\n if cache_exists?\n begin\n cached_session = ::Dropbox::Session.deserialize(File.read(cached_file))\n if cached_session.authori... | [
{
"docid": "ae155e0061e8e6fb6005e8ce719b8867",
"score": "0.7217272",
"text": "def create_write_and_return_new_session!\n session = ::Dropbox::Session.new(api_key, api_secret)\n session.mode = :dropbox\n Logger.message \"Open the following URL in a browser to authorize a session... |
5ab8f6f5ab663b9df2e5661ba41c298a | PUT /orthodb_best_orthologues/1 PUT /orthodb_best_orthologues/1.json | [
{
"docid": "7f65f34558322c578ea4d6ac0855f41c",
"score": "0.68138885",
"text": "def update\n @orthodb_best_orthologue = OrthodbBestOrthologue.find(params[:id])\n\n respond_to do |format|\n if @orthodb_best_orthologue.update_attributes(params[:orthodb_best_orthologue])\n format.html { re... | [
{
"docid": "02c3f42bb0c2f70c8b7826d4844cfdd9",
"score": "0.5954316",
"text": "def new\n @orthodb_best_orthologue = OrthodbBestOrthologue.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @orthodb_best_orthologue }\n end\n end",
"title": ""
... |
41a3dc689808e69e4087a1157269ebbf | This method demonstrates how to use the ID of a file that was previously uploaded to Sentera's cloud storage with one of the mutations in Sentera's GraphQL API that accepts a file ID as an input. In this example, we'll use the import_feature_set GraphQL mutation to attach the file to a feature set owned by the specifie... | [
{
"docid": "7924c357520b809e1ebdf984bbb33af4",
"score": "0.80722296",
"text": "def import_feature_set(file_id, owner_type, owner_sentera_id)\n puts 'Use file'\n\n gql = <<~GQL\n mutation ImportFeatureSet(\n $geometry_file_key: FileKey\n $name: String!\n $owner_sentera_id: ID!\n ... | [
{
"docid": "12d297c3845609aaf5bbfdd1cc0a8499",
"score": "0.70467055",
"text": "def import_mosaic(owner_sentera_id, parent_sentera_id, file_id)\n puts 'Use file'\n\n gql = <<~GQL\n mutation ImportMosaic(\n $file_keys: [FileKey!]\n $mosaic_sentera_id: ID\n $mosaic_type: MosaicImportTyp... |
79814b6da01c17698a9cec5b3899cb03 | Dispose MP Number Max | [
{
"docid": "aa21105b0b72f0054dcbf4980fbb9931",
"score": "0.84677047",
"text": "def dispose_mp_number_max\r\r\n return if @mp_number2 == nil\r\r\n @mp_number2.bitmap.dispose\r\r\n @mp_number2.dispose\r\r\n end",
"title": ""
}
] | [
{
"docid": "358cbd6efc3e644722a5254918aaebf6",
"score": "0.85417897",
"text": "def dispose_mp_number_max\n return if @mp_number2 == nil\n @mp_number2.bitmap.dispose\n @mp_number2.dispose\n @mp_number2 = nil\n end",
"title": ""
},
{
"docid": "cfd210599166f339f79b93a75c618... |
faa378bc394a366b5c99d1bea9ce9a0b | Compute the Jaro Winkler Distance for the two Strings Return a value between 0 and 1 | [
{
"docid": "94421ca23d1718a65fcdaf87399d563b",
"score": "0.6872243",
"text": "def distance( s1, s2 )\n input = Input.new( s1, s2 )\n return empty_score( input ) if input.empty?\n score = jaro_distance_internal( input )\n\n if score > boost_threshold then\n score += winkler_sco... | [
{
"docid": "9ad2904b47c4190936f1606c651272bc",
"score": "0.7565797",
"text": "def jaro_winkler_distance(s1, s2, long_tolerance = false)\n result = C::jaro_winkler_distance(s1, s2, long_tolerance)\n raise(\"memory allocation error\") if result < 0.0\n result\n end",
"title": ""
},
{
... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "5b0efc9cafe42f0e43ed2747e22cf94f",
"score": "0.0",
"text": "def set_engineer_contact\n @engineer_contact = EngineerContact.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60322535",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6012846",
"text": "de... |
aabae9d1c1dc74ef685196849afcdbdd | DSL method set the application to be used by the Script | [
{
"docid": "0ca74e6614788055bf31c595fa92edc2",
"score": "0.0",
"text": "def run(application)\n # add middleware to a middleware stack\n @app___ = application\n self\n end",
"title": ""
}
] | [
{
"docid": "70a31ca3f2e7fc12b0805df257aec9bf",
"score": "0.7853164",
"text": "def set_application app\n @application = app\n end",
"title": ""
},
{
"docid": "383fed5b8bf4e6f854b9ccaf3cf36292",
"score": "0.7737214",
"text": "def application(app = false)\n @application = a... |
6fdbb74ebc7d6df9f143dd87acca1ed5 | The id of the data criteria or measurement property that the value will be compared against | [
{
"docid": "c9a5b39086da9041c902765a26245fb7",
"score": "0.5395034",
"text": "def target_id\n attr_val('./*/cda:id/@root')\n end",
"title": ""
}
] | [
{
"docid": "58ab00f2d76a38152f8711778a9b8358",
"score": "0.6737994",
"text": "def property\n id\n end",
"title": ""
},
{
"docid": "9d10e0c50bf25649adceef6631df7b81",
"score": "0.6487952",
"text": "def id\n value[0]\n end",
"title": ""
},
{
"docid": "b969a9... |
ea4accd8a591f41340b6eeb5b4e939ad | =begin rdoc Human readable description of the ModelItem object properties =end | [
{
"docid": "28b3d2a9c42ca5e598afb94f497817f6",
"score": "0.6421386",
"text": "def details_properties\n props = @properties || {}\n ['properties:'].concat props.map { |k,v| \"\\t#{k} = #{v.inspect}\" }\n end",
"title": ""
}
] | [
{
"docid": "fe704db3d40ab3204f14f147617fc26f",
"score": "0.68397284",
"text": "def properties; end",
"title": ""
},
{
"docid": "fe704db3d40ab3204f14f147617fc26f",
"score": "0.68397284",
"text": "def properties; end",
"title": ""
},
{
"docid": "fe704db3d40ab3204f14f147617f... |
e150aaf5cb5dba542883e74a22ba36b5 | GET /pos_usr_transpoters/1 GET /pos_usr_transpoters/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "677d5ce1078d2aec164908a1e9f45619",
"score": "0.717926",
"text": "def index\n @pos_usr_transpoters = PosUsrTranspoter.all\n end",
"title": ""
},
{
"docid": "934594821bf9d989172b7b4f9c4902fa",
"score": "0.64348274",
"text": "def set_pos_usr_transpoter\n @pos_usr_tran... |
6c446ef44d50bbdf7c98a777ef7c7a39 | Returns the value of with the specified name. If there are more than one values for the specified name, the first value is returned. | [
{
"docid": "1bfc861e6ab0dff30a5817ab2378ad0a",
"score": "0.0",
"text": "def [](name)\n @j_map.get(name)\n end",
"title": ""
}
] | [
{
"docid": "74ffbbb138b10569ed27db67d3deb76f",
"score": "0.8122973",
"text": "def []( name )\n\t\tresult = self.find_name name\n\n\t\tif result.empty?\n\t\t\tnil\n\t\telsif result.size == 1\n\t\t\tresult.last.value\n\t\telse\n\t\t\tresult\n\t\tend\n\tend",
"title": ""
},
{
"docid": "e11462b8... |
f0c8ebc080c48c2f260ffb43b1834e56 | GET /products/1 GET /products/1.json | [
{
"docid": "e66272adeee13c8390585e08359e0cff",
"score": "0.0",
"text": "def show\n @products = Product.all\n \n end",
"title": ""
}
] | [
{
"docid": "b4b28cd3d622f32a8398a02f689e4baf",
"score": "0.7935314",
"text": "def get_product\n product = Product.find(params[:product_id])\n json_response(product)\n end",
"title": ""
},
{
"docid": "a06eb43eff1d37c3950104b8608b37f8",
"score": "0.7777529",
"text": "def show\n ... |
fd2484851b01054b2beb1c085033c189 | Randomly Determine Target (K.O.) | [
{
"docid": "4c4c29d31f75e39a5909b219d7784843",
"score": "0.67353725",
"text": "def random_dead_target\r\n dead_members.empty? ? nil : dead_members[rand(dead_members.size)]\r\n end",
"title": ""
}
] | [
{
"docid": "afb45143cf724fdd21d047b58968c155",
"score": "0.82395166",
"text": "def random_target(targets)\n targets[rand(targets.length)]\n end",
"title": ""
},
{
"docid": "c527bd6fa198a99e406dcd035083c757",
"score": "0.81275636",
"text": "def random_target\n\t\t# The greatest po... |
a28e478681ac9d29c5dd796aa824781d | PATCH/PUT /users/1 PATCH/PUT /users/1.json | [
{
"docid": "f0d4319f50c9cfb9883143d2e34eb0b9",
"score": "0.0",
"text": "def update\n @user = User.find(params[:id])\n if @user.update(user_params)\n flash[:success] = \"Profile updated\"\n redirect_to @user\n else\n render 'edit'\n end\n end",
"title": ""
}
] | [
{
"docid": "23a904e6ddd4b6b07c4b53353e78cf93",
"score": "0.7225568",
"text": "def update\n render json: User.update(params[\"id\"], params[\"user\"])\n end",
"title": ""
},
{
"docid": "4781fa7337315133553edb54194e6202",
"score": "0.7129473",
"text": "def update\n render json: ... |
4b0605b1d0e95afe2389b010d35fbe71 | POST /positions POST /positions.json | [
{
"docid": "afe821381fcfe669fdba180ad606e14b",
"score": "0.62206423",
"text": "def create\n @position = Position.new(position_params)\n @project = Project.find(params[:project_id])\n @position.project = @project\n\n respond_to do |format|\n if @position.save && current_user.add_role(:ow... | [
{
"docid": "e51e335c34b53efded0cc620628ca260",
"score": "0.7495904",
"text": "def create\n position = Position.new(position_params)\n\n if position.save\n render json: position, status: :created\n else\n render json: position.errors, status: :unprocessable_entry\n end\n\n end",
... |
6c00a88088756d113de0b97806d4a313 | For presentation, return just the subpath within hieradata. e.g., /path/hieradata/subdir/foo.yaml becomes subdir/foo.yaml | [
{
"docid": "ccad5e56e0319aad833da1b98ac69a75",
"score": "0.6054628",
"text": "def subpath(file)\n file.sub(/#{@directory}/, '').sub(/#{File::SEPARATOR}/, '')\n end",
"title": ""
}
] | [
{
"docid": "37b44dfde2f269f2d9ea67d0309db1f1",
"score": "0.6457547",
"text": "def metadata_hierarchy\n split = basedir.split(\"/\")\n last_index = split.map {|i| i == get_type }.rindex(true)\n return split[last_index..-1].join(\"/\")\n end",
"title": ""
},
{
"docid": "50a13ea567de6... |
e40f7728dc41c8e81a8349573b8cb6d6 | Returns asset paths to be included via the Assets helpers for a particular ASSET_TYPE. See add_static_assets (Widgets). | [
{
"docid": "a9506728aa619d5d5c3defd6c543721c",
"score": "0.75904256",
"text": "def asset_paths(type, options)\n return [] if @targeted[type]\n @targeted[type] = true\n \n assets = reject_ignored @assets[type], options\n from, to = to_path type\n \n case type\n whe... | [
{
"docid": "f078569ec8e1a714514774b6f855edaf",
"score": "0.7109105",
"text": "def get_assets(type)\n\n # Parse the ASSETSPATH file for generating the list of EPUB\n # included images, or media assets.\n assets_xml = File.new(ASSETSPATH)\n #parsed_assets = AssetListener.new\n ... |
602ee31060cab1000dfdacd57cfa4097 | Merge the defaults Hash with the parsed options from the given Hash, i.e. only valid option names are considered and their value is run through the parse method. source://kramdown//lib/kramdown/options.rb82 | [
{
"docid": "a835fec22b0aedc67d91dc0e2b540e92",
"score": "0.0",
"text": "def merge(hash); end",
"title": ""
}
] | [
{
"docid": "ab611e534e2c4b59c8ef40d6f69d51e3",
"score": "0.73997694",
"text": "def _parse_options(options)\n defaults = DEFAULTS.dup\n options = options.dup\n\n defaults.keys.each do |key|\n options[key] ||= defaults[key]\n end\n\n options\n end",
"ti... |
a25187348fe109be7ac7a54cd3798334 | Returns required tweet GET api/v1/tweets/:id | [
{
"docid": "36067cb4166ebabb723d73bf48e59f2c",
"score": "0.7279629",
"text": "def show\r\n tweet = Tweet.find(params[:id])\r\n render json: tweet\r\n end",
"title": ""
}
] | [
{
"docid": "5a833910599fc4e328a4600c245d1d46",
"score": "0.83515126",
"text": "def get_tweet(id)\n\n\t\t# tweet = Tweet.where({:tweet_id => id})\n\n\n\tend",
"title": ""
},
{
"docid": "d0985761ba35496a0b6c4b93273526b4",
"score": "0.78054726",
"text": "def get_tweet_by_id(id)\n twe... |
9ccb4a1eb3a0bd95f2555421b0702bdf | Called when a resource fails, but will retry. | [
{
"docid": "7221618a45f4b2937bf51161ee887915",
"score": "0.79699504",
"text": "def resource_failed_retriable(resource, action, retry_count, exception); end",
"title": ""
}
] | [
{
"docid": "c9bcea79876c763e0784e6dd177ffba2",
"score": "0.7676986",
"text": "def resource_failed_retriable(resource, action, retry_count, exception)\n end",
"title": ""
},
{
"docid": "d3885ab67942d1edd856fac8a01634c8",
"score": "0.75103694",
"text": "def resource_failed(resourc... |
11b4c4752f3c90adbfa0d5f1fe38a701 | Copyright (c) KAOD Masanori You can redistribute it and/or modify it under GPL. | [
{
"docid": "5bb54062ef08c48a65068f5afff38bcb",
"score": "0.0",
"text": "def bootstrap_navi(options = {})\n default_options = {\n :navbar_class => 'navbar-inverse',\n :site_name? => true,\n :search_form? => true\n }\n options = default_options.merge(options)\n\n body = \"\"\n body += <<-EOS... | [
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.62420726",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.62420726",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3... |
d4b1047ea45e167e78bc4602d558d9e8 | Pass data in as +rows+. Expects rows to be an Enumerable of Enumerables. Maps rows to Hashlike Tabular::Rows. | [
{
"docid": "4c8b2cd60e7c1bc1afb7430710c55066",
"score": "0.0",
"text": "def initialize(rows = [])\n @columns = nil\n self.rows = rows\n end",
"title": ""
}
] | [
{
"docid": "8ed605225f89626e55b43a4d9c52c85f",
"score": "0.6918906",
"text": "def each_row_hash rows=nil, &block\n if rows\n selected_rows rows, &block\n else\n all_rows &block\n end\n end",
"title": ""
},
{
"docid": "956762f6a457c387ebcb0f299d014710",
"score": "0.687... |
d17753b7f7e609c9156a5a2a41448d0a | Returns the truth value of (x >= y) elementwise. This operation supports broadcasting | [
{
"docid": "937cb5583383dc2edf6ba2f828afc1f7",
"score": "0.0",
"text": "def greater_equal(input_a, input_b, name: nil)\n input_a, input_b = apply_data_type_coercion(input_a, input_b)\n _op(:greater_equal, input_a, input_b, name: name)\n end",
"title": ""
}
] | [
{
"docid": "267d6fe6dc5aed67ed8e181eb9388d90",
"score": "0.5809443",
"text": "def test_inequality_chaining\n #p @s.rucas {1 < x < 2}\n #axes(\"(1 < x) & (x < 10)\") {1 < x < 10} -- ?? maybe\n end",
"title": ""
},
{
"docid": "cf62e3a0ec5de6635a649fb280c88675",
"score": "0.57342494"... |
dfc4b47ba3262c63dc7ec3d4143c5b8d | base hash attributes which remains common to every providers | [
{
"docid": "ebd4af70a454f2a804c5b3b61664d240",
"score": "0.6307433",
"text": "def base_attributes\n\t\t\t\t\t# Base Attributes to be sent for foreman host creation API\n\t\t\t\t\t\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\"name\" \t\t\t\t\t=> self.name,\n \n\t\t\t\t\t\t\... | [
{
"docid": "fea847822b0379d04da16b165222e2fb",
"score": "0.7148033",
"text": "def hash\n [provider_name, host_name, host_port, host_ssl, host_tls, host_no_cert_check, bind_dn, bind_password, search_timeout, admin_pool_max_active, admin_pool_lookup_on_validate, user_pool_max_active, user_pool_lookup... |
8eed6ffb1ec15693f2f8d40c04340f58 | compiles an array of raw HTML pages | [
{
"docid": "4f1c7ef96dc4febbfa9a91aa68637fea",
"score": "0.5461736",
"text": "def fetch_page_nodes\n (1..12).each do |file_name|\n body = File.open(\"#{Rails.root}/lib/wayfair_batch/#{file_name}.html\")\n @page_nodes.push(Nokogiri::HTML(body))\n end\n end",
"title": ""
}
] | [
{
"docid": "fe8c70f5cbe8d59019f4d01e987afa2f",
"score": "0.60634744",
"text": "def run(pages)\n clean\n\n prototype_fetcher.fetch_pages(pages.map {|p| p[:prototype]})\n app_fetcher.fetch_pages\n\n normalised_html_files = pages.map do |i|\n {\n prototype_file: prototyp... |
3ad6738eb05e0a84f66a94392f0876e2 | Generates a prefix for field named +field_name+ | [
{
"docid": "193ee273decb5d425b0b50179b091007",
"score": "0.83685166",
"text": "def add_prefix(field_name)\n @prefix ? :\"#{@prefix}-#{field_name}\" : field_name\n end",
"title": ""
}
] | [
{
"docid": "84125d954b8b367744363ada80eda109",
"score": "0.8341168",
"text": "def add_prefix(field_name)\n @prefix ? \"#{@prefix}-#{field_name}\" : field_name\n end",
"title": ""
},
{
"docid": "41f91a9ef7be2f2d3d4f511e5bcbddf3",
"score": "0.8332063",
"text": "def add_prefix(f... |
803d77028ba688724dc2479998a1bfaa | Start the supervisor process which accepts connections from the bound endpoint and processes JSON formatted messages. | [
{
"docid": "07541e1baf6a36ee8e769abb2d3b95a3",
"score": "0.0",
"text": "def setup(container)\n\t\t\t\tcontainer.run(name: self.name, restart: true, count: 1) do |instance|\n\t\t\t\t\tAsync do\n\t\t\t\t\t\t@bound_endpoint.accept do |peer|\n\t\t\t\t\t\t\tstream = Async::IO::Stream.new(peer)\n\t\t\t\t\t\t\... | [
{
"docid": "94d1b36d9099e20357d15c662523a14e",
"score": "0.73171926",
"text": "def run\n log \"Starting supervisor on port #{@supervisor_settings[\"port\"]}\",\n level: :info,\n timestamp: @clock.now\n\n @endpoint = Async::IO::Endpoint.tcp('0.0.0.0', @supervisor_settings[\"po... |
a04df186fc7dfd42467d7355ee5ab4e2 | Add NSGroup expression Add/remove the expressions passed in the request body to/from the NSGroup | [
{
"docid": "9a01e3f2a112bcc1c0e8aa7147b8be48",
"score": "0.63035125",
"text": "def add_or_remove_ns_group_expression(ns_group_id, ns_group_expression_list, action, opts = {})\n data, _status_code, _headers = add_or_remove_ns_group_expression_with_http_info(ns_group_id, ns_group_expression_list, act... | [
{
"docid": "f37cf534bf247d26dd7166b765c62132",
"score": "0.6657418",
"text": "def add_or_remove_ns_group_expression_with_http_info(ns_group_id, ns_group_expression_list, action, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: GroupingObjectsApi.a... |
fdeb38cc27972ead4ea3875c3d30ba7d | GET /taiciis GET /taiciis.json | [
{
"docid": "ee928598a5c8ee575c62193b62c6bfa9",
"score": "0.61455446",
"text": "def index\n @taiciis = Taicii.paginate(:page => params[:page], :per_page => 11, :order => 'yes desc')\n \n # 台词id列表\n t_ids = []\n topicIds = []\n @taiciis.each do |t|\n t_ids << t.id\n topicIds <<... | [
{
"docid": "24216f9876f89e7ab349e1f2ebbb0cf8",
"score": "0.7278107",
"text": "def index\n @tecnicas = Tecnica.all\n render json: @tecnicas\n end",
"title": ""
},
{
"docid": "d01d44b3f8872dc8a71e26a581e82faf",
"score": "0.72772306",
"text": "def index\n @tacos = Taco.all\n\n... |
4adceac347ac387371b26a264fc3e93f | If the turn count is an even number, the `current_player` method should return `"X"`, otherwise, it should return `"O"`. def current_player(board) turn_counter_2 = turn_count(board) if turn_counter_2 % 2 == 0 current_player = "X" else current_player = "O" end end turn_count method takes in an argument of the board arra... | [
{
"docid": "b9070c4b8f82c5613e44ebb6b866d23e",
"score": "0.0",
"text": "def turn_count(board)\n turn_counter = 0\n board.each do | element |\n if element == \"X\" || element == \"O\"\n turn_counter += 1\n end\n end\n return turn_counter\nend",
"title": ""
}
] | [
{
"docid": "c1d915accaa8531952bed09b363edcba",
"score": "0.8977133",
"text": "def current_player(board)\n turn_number = turn_count(board)\n turn_number.even? ? \"X\" : \"O\"\nend",
"title": ""
},
{
"docid": "0182f00562aa4ca07816654c288d1b1e",
"score": "0.8965552",
"text": "def curr... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "be6f9aa94c928bc035cd0f152d5746a6",
"score": "0.0",
"text": "def update!(**args)\n @achievement_id = args[:achievement_id] if args.key?(:achievement_id)\n @increment_payload = args[:increment_payload] if args.key?(:increment_payload)\n @kind = args[:kind] if args.ke... | [
{
"docid": "184b1b1ed771473d3eb9f338c0734c38",
"score": "0.73066413",
"text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end",
"title": ""
},
{
"docid": "5076c5a88404ae72986f958710f5687a",
"score": "0.72631145",
"text": "def update... |
de7b45d75a0804bef7e5e810066cf409 | Update a public key for the authenticated user | [
{
"docid": "23e95cbe127e4632bb5247c70085882c",
"score": "0.0",
"text": "def update(*args)\n arguments(args, required: [:id]) do\n permit VALID_KEY_PARAM_NAMES\n end\n patch_request(\"/user/keys/#{arguments.id}\", arguments.params)\n end",
"title": ""
}
] | [
{
"docid": "f48cf52fdd227ceb08474525f3b005c0",
"score": "0.73680055",
"text": "def public_key=(k)\n return self.authentication.public_key = k\n end",
"title": ""
},
{
"docid": "f48cf52fdd227ceb08474525f3b005c0",
"score": "0.73680055",
"text": "def public_key=(k)\n re... |
46bce00af66263b9a1b0a8d384dd57b3 | GET /addresses/new GET /addresses/new.json | [
{
"docid": "cdd0d73d6acf888b1550d475d6e9dd8b",
"score": "0.78001076",
"text": "def new\n @address = Address.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @address }\n end\n end",
"title": ""
}
] | [
{
"docid": "0add412f53af133958747f8025d54a5d",
"score": "0.77043927",
"text": "def new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @address }\n end\n end",
"title": ""
},
{
"docid": "7ccce8e2208c7389356358e5ee883343",
"score": "0.... |
334eb392599440369a2aacdcaf087d16 | Creates or retrieves a user. Returns nil. The User instance is yielded, possibly after the call completes. | [
{
"docid": "f60dae2a6ee1c083b892eee2096edbee",
"score": "0.0",
"text": "def user_by_key(join_key, &block)\n if @users[join_key]\n block.call @users[join_key]\n else\n block.call nil\n end\n\n nil\n end",
"title": ""
}
] | [
{
"docid": "3cd345a940e9fd4b09ced84f9ea4250b",
"score": "0.708529",
"text": "def call\n context.user = User.find_by_telegram_id(context.telegram_user.id)\n return if context.user\n\n context.is_new_user = true\n context.user = User.create(\n telegram_id: context.tele... |
43669158efd9b3347b58be3f5e453d80 | Forwards the call to the target. Loads the \target if needed. | [
{
"docid": "9b4906a78d32eeeb7cadf392896cfdbb",
"score": "0.0",
"text": "def inspect\n reload\n @target.inspect\n end",
"title": ""
}
] | [
{
"docid": "804a5f1f0832f2d15cf6b1a6cbba35d3",
"score": "0.6874433",
"text": "def doTarget _obj, _args\n \"_obj doTarget _args;\" \n end",
"title": ""
},
{
"docid": "1cb41b2797ff15ded5648113cab262a2",
"score": "0.6843691",
"text": "def call(target)\n target.public_send(@... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "b6d87b0f9a68592a0bf1b25827aa22f7",
"score": "0.0",
"text": "def set_assignment\n @assignment = Assignment.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... |
f9f7dd7efecaaa8b059aecc1bfbd0679 | Replaces all instances of `$original` with `$replacement` in `$selector` | [
{
"docid": "2b3e3aa1a8bea994675ede859ec3d421",
"score": "0.87906456",
"text": "def selector_replace(selector, original, replacement); end",
"title": ""
}
] | [
{
"docid": "c6c158d771020fd37a02e52fb8907139",
"score": "0.651352",
"text": "def replace_each(selector, collection, &block)\n selected_elements = select(selector)\n ExampleElementTransformer.new(self, selected_elements).replace_each(collection, &block)\n end",
"title": ""
},
{
"... |
01811a1d8715730990607932b4c8d49f | Creates folder and files required for TMDBApi and IDMBScrapper run methods. | [
{
"docid": "3342fa14287edc71ab09cfec48bfb6d5",
"score": "0.63480985",
"text": "def create_data_files\n FileUtils::mkdir_p('data/views')\n %w[data/movies_tmdb_info.yml data/movies_imdb_info.yml].each do |file_path|\n FileUtils.touch(file_path)\n end\n end",
"title": ""
}... | [
{
"docid": "07eef6e2f6bf90eff37944fd5fc1817c",
"score": "0.69875246",
"text": "def setupDir()\n\t\t\t# Create a directory\n\t\t\t`mkdir #{@path}`\n\t\t\t`mkdir #{@path}/docs`\n\t\t\t`mkdir #{@path}/pics`\n\t\t\t`mkdir #{@path}/sql`\n\t\tend",
"title": ""
},
{
"docid": "b77ac83b1ec19fd8fd086f... |
0e20f010043614e5b3c457fd761c3785 | Returns all objects that have no ancestor. Accepts Mongoid criteria to reduce and sort matching set. Criteria API: Examples: Model.roots => All models without ancestor Model.roots.where(:name => "Laura") => Only models named Laura Model.roots.asc(:created_at) => All models, ordered by date of creation | [
{
"docid": "a8d15961a422f6cd3b456c65d1f0e5b1",
"score": "0.6432567",
"text": "def roots\n where(:ancestor_uuid => nil)\n end",
"title": ""
}
] | [
{
"docid": "3b56d2283e1a1e9b7ac0398b42b2ade0",
"score": "0.6928884",
"text": "def objects_without_parents\n @collection.select{|o| o.parent.nil?}\n end",
"title": ""
},
{
"docid": "3f385685577814915090f2a80fc2c62d",
"score": "0.65818113",
"text": "def all_non_children\r\n... |
fa633050fc8134a351d1e30de42f4af9 | Proxy object for handling bacula directives | [
{
"docid": "be62a6a396c1dbdd7b494cbe60d428cc",
"score": "0.5462862",
"text": "def bacula_handler\n BaculaHandler.new(self)\n end",
"title": ""
}
] | [
{
"docid": "afbf7f104cbecfe68f3ba649342cebb7",
"score": "0.7140773",
"text": "def own_directives; end",
"title": ""
},
{
"docid": "b0165d9763074e2e4ea87c82367f4c77",
"score": "0.70250225",
"text": "def own_directives=(_arg0); end",
"title": ""
},
{
"docid": "b0eaaf6f2732e... |
79aa1697db3e4839858dc32638b2f23e | Fetch typically returns IMAP message objects for the specified uids, however in this implementation it returns the contents of the JSON fixture which is made available via the :attr accessor in the IMAPMessage struct. | [
{
"docid": "7f134991ee8ef672b504a20f18a6df92",
"score": "0.782864",
"text": "def fetch(uids, _format)\n uids.map { |uid|\n raw = File.read(File.join(fixture_path, \"#{uid}.json\"))\n hash = JSON.parse(raw)\n IMAPMessage.new(hash)\n }\n end",
"title": ""
}
] | [
{
"docid": "c2efd40e7ef4bbd4458466dfb1febc9d",
"score": "0.6428338",
"text": "def fetch_all\n\t\t\t@gmail.in_label(@mailbox) do |mbox|\n\t\t\t\tGmail.auto_segment(@list.reject { |m| m.loaded? }, 25) do |fetch_uids|\n\t\t\t\t\t@gmail.imap.uid_fetch(fetch_uids, ['ENVELOPE', 'RFC822']).map do |info|\n\t\t\... |
c2b65b3277c85eb2d4c595c198f2fa34 | list all tiles from epgs:5514 WGS84 bounds: 12.09 47.73 22.56 51.0 but I use only CR, e.g.: 12.09 47.73 19 51.0 usage: ruby bin/load_all_tiles.rb ' ruby bin/load_all_tiles.rb ' '14.291153,49.993174,14.659195,50.146546' osekana praha ruby bin/load_all_tiles.rb ' '16.484985,49.132981,16.709175,49.260635' brno ruby bin/lo... | [
{
"docid": "172741893b0c7881d13c10c15e3a2c3f",
"score": "0.0",
"text": "def get_tile_number(lat, lng, zoom)\n n = 2.0 ** zoom\n x = ((lng + 180.0) / 360.0 * n).to_i\n lat_rad = lat/180 * Math::PI\n y = ((1.0 - Math::log(Math::tan(lat_rad) + (1 / Math::cos(lat_rad))) / Math::PI) / 2.0 * n).to_i\n {:... | [
{
"docid": "c0602c08e56f78a65abd1ab9ee7584b9",
"score": "0.6383257",
"text": "def load_tiles!\n tiles = []\n \n open(@url) do |page|\n page.each_line do |line|\n if line.include? TILE_START_LINE\n tiles << Tile.new\n elsif line =~ TILE_COORD_FORMAT\n tile = ... |
798df2aafdd76e429f120c16c48c662c | TODO: Send confirmation email | [
{
"docid": "89836aa883beffb15c4eb570871d7640",
"score": "0.0",
"text": "def register\n \n end",
"title": ""
}
] | [
{
"docid": "875f0d14723650997730286955a2f95e",
"score": "0.80018306",
"text": "def email_confirm\n end",
"title": ""
},
{
"docid": "c5663b4c9490920de513d3ed953fe998",
"score": "0.77378434",
"text": "def send_confirmation_instructions; end",
"title": ""
},
{
"docid": "386... |
03dc7f033ca355840e650128989c1abd | Raise an exception if a tournament is not valid. The _rerank_ option can be set to _true_ to rank the tournament just prior to the test if ranking data is missing or inconsistent. | [
{
"docid": "e6b7536e4c568f8521e02f97989d8b7a",
"score": "0.6145713",
"text": "def validate!(options={})\n begin check_ranks rescue rerank end if options[:rerank]\n check_players\n check_rounds\n check_dates\n check_teams\n check_ranks(:allow_none => true)\n check_type(... | [
{
"docid": "bc030a9705569f95ebe84216e5b912ec",
"score": "0.60307693",
"text": "def rps_tournament_winner(tournament)\n begin\n rps_game_winner tournament\n rescue NoSuchStrategyError\n rps_game_winner( [rps_tournament_winner(tournament[0]), rps_tournament_winner(tournament[1])])\n end\n \nend"... |
ebc33adc03d8603d67db14a179132ba0 | Add a Member in the library | [
{
"docid": "8e871f3485b2d38e67463a9686c7bc7b",
"score": "0.0",
"text": "def addmember\n @@membercount+=1\n puts \"Enter your name\"\n mname = gets.chomp\n puts \"Enter your gender\"\n mgender = gets.chomp\n\n @@memberarray.push(Member.new(@@membercount,mname,mgender))\n end",
"tit... | [
{
"docid": "04c49a516b07995a55b283f0a8a60b2d",
"score": "0.83569056",
"text": "def addmember\n end",
"title": ""
},
{
"docid": "0e014f8c44aa6686c900f4b779ef2249",
"score": "0.80129087",
"text": "def add_member(member)\r\n @members << member\r\n end",
"title": ""
},
{
... |
bc576631721ae4d02d8fcbf966fd73c1 | Check if his/her birth day is a day before the given date. | [
{
"docid": "6425aca29f4c912efebe5f9059cc1763",
"score": "0.7870003",
"text": "def day_before_birthday?\n return false unless @birthday.present?\n @birthday == (Date.today + 1).strftime('%m/%d')\n end",
"title": ""
}
] | [
{
"docid": "e0cac989530e0997809682841d9c6384",
"score": "0.7010531",
"text": "def birthday_days_left(date)\n first_slash_index = date.index('/')\n second_slash_index = date.rindex('/')\n\n dd_length = first_slash_index\n mm_length = second_slash_index - first_slash_index - 1\n\n dd = date... |
ff49baa14ccd120b7fb8f3a68dace791 | GET /contacts GET /contacts.json | [
{
"docid": "83f1ef1f0327f91c0f4f5b4ad0bace23",
"score": "0.0",
"text": "def index\n pageparam = \"a\"\n unless params[:page].nil?\n pageparam = params[:page].to_s.downcase\n end\n\n #@contacts =\n # Contact.order(\"name\").starts_with(aa.chr).page(params[:page]).per(100)\n #@conta... | [
{
"docid": "8eea3a2e86364d38226af95d61abd66e",
"score": "0.84616554",
"text": "def contacts\n get('contacts')\n end",
"title": ""
},
{
"docid": "680464823216e7f4871a0a4894b924aa",
"score": "0.8362617",
"text": "def contacts()\n get('contactsList')\n end",
"title": ""
... |
ac1a324ce3e453543e82d7b231ae836b | Multiply the provided fields by the corresponding values. Values can be positive or negative, and if no value exists for the field it will be set to zero. | [
{
"docid": "0a00ccb711be3abbc5a523d339955010",
"score": "0.6092049",
"text": "def mul(factors)\n prepare_atomic_operation do |ops|\n process_atomic_operations(factors) do |field, value|\n factor = value.__to_inc__\n current = attributes[field]\n new_value... | [
{
"docid": "7129cba7d799d3935a371f25219c8714",
"score": "0.6424561",
"text": "def Multiply(val)\n self.value *= val\n end",
"title": ""
},
{
"docid": "538c7a73f9e43248c98533ea927f3507",
"score": "0.6157622",
"text": "def calculate_fields!\n m_price_extend = qty * price\n at... |
7949a8a319236bdbe0d2852334558780 | Keys for all columns | [
{
"docid": "a1823ef7ba298ffdcde110893abadd76",
"score": "0.0",
"text": "def keys\n hash.keys\n end",
"title": ""
}
] | [
{
"docid": "07d82b5130ae99e6335021a67735ad10",
"score": "0.8258966",
"text": "def keys\n column_data.keys\n end",
"title": ""
},
{
"docid": "3c9c1b8533f7c07d75e5e8a8ec567e53",
"score": "0.82288057",
"text": "def key_columns\n @key_columns ||= [\"#{self.table_name... |
d4db181c57ef2a2d3d2d4bea65faab74 | Override this with your template id from Mandrill. | [
{
"docid": "a372e5ba37f46af37c12ed7882419c4b",
"score": "0.7455047",
"text": "def template\n raise 'You must define a Mandrill template to use'\n end",
"title": ""
}
] | [
{
"docid": "5c387c5dd5ede3eb63b4aac96c81d613",
"score": "0.7014849",
"text": "def template_id=(value)\n @template_id = value\n end",
"title": ""
},
{
"docid": "5c387c5dd5ede3eb63b4aac96c81d613",
"score": "0.7014849",
"text": "def template_id=(value)\n ... |
ebbca40f15ea17fbc0e0f5f707d17454 | GET /attachments/new GET /attachments/new.xml | [
{
"docid": "248e58068bb9bc30157e1d64b4ae1b7b",
"score": "0.77835125",
"text": "def new\n @attachment = Attachment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @attachment }\n end\n end",
"title": ""
}
] | [
{
"docid": "5a3c5f570f7c0a169e29923a06de311f",
"score": "0.7680413",
"text": "def new\n @file_attachment = FileAttachment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @file_attachment }\n end\n end",
"title": ""
},
{
"docid": ... |
b2a77ab3504ea5cbf2eb92b2b057e214 | Process some items with a shift on success and a roll back on failure. | [
{
"docid": "3d7f19f36b3a83ac03086a2513276225",
"score": "0.0",
"text": "def try!(&block)\n shift if (result = try(&block))\n result\n end",
"title": ""
}
] | [
{
"docid": "5eec349c881b20e52e3bb203a91ad3df",
"score": "0.6118229",
"text": "def process(item)\n raise StandardError, 'Cannot process this item' if @exception_item == item.item\n @failed_item != item.item\n end",
"title": ""
},
{
"docid": "67758d3cbf6cd441f57989b0d6... |
5c8ba0fb520cbe28a658008454e97aeb | Get bootstrap label for a method | [
{
"docid": "db44a4d53ad010191c20b4e058e68862",
"score": "0.74433166",
"text": "def get_method_label( method )\n case method\n when 'GET'\n 'label label-info'\n when 'POST'\n 'label label-success'\n when 'PUT'\n 'label label-warning'\n when 'DELETE'\n ... | [
{
"docid": "537782130239713f944fb862d2abb960",
"score": "0.72938955",
"text": "def generate_label(method, options)\n label_text = method.to_s.humanize\n label_text = options[:label] if options[:label]\n label = ''\n if (options[:label] && options[:label] != '') || !options[:label]\n lab... |
c72a483c27813b7248f053b04bcd6f92 | Override value setter to convert numeric representations. | [
{
"docid": "bb67cdea8860f43f07d3bf8b1f1e5de5",
"score": "0.7572052",
"text": "def value=(string)\n self[:value] = string\n numeric = string.gsub(/[^\\d,.-]/, '').sub(',', '.')\n if is_numeric?(string)\n self[:value_i] = numeric.to_i\n self[:value_f] = numeric.to_f\n end\n end",
... | [
{
"docid": "7feb0baccf2f482cdea9fd45a782541b",
"score": "0.75485814",
"text": "def value=(i)\n if i.kind_of? Numeric\n typecast i\n elsif i.respond_to? :to_s\n self[:value] = i\n else\n self[:value] = ''\n end\n end",
"title": ""
},
{
"docid": "146... |
5e1419af4744ee0c16715a39e1505830 | PUT /payouts/1 PUT /payouts/1.json | [
{
"docid": "4923d9a7ba78ce20cd1a0293c692b5cb",
"score": "0.70210564",
"text": "def update\n @payout = Payout.find(params[:id])\n\n respond_to do |format|\n if @payout.update_attributes(params[:payout])\n format.html { redirect_to payouts_url, notice: 'Payout was successfully updated.' ... | [
{
"docid": "cbea2f24530ba24411e57bdf8ff8db61",
"score": "0.68428427",
"text": "def update\n respond_to do |format|\n if @payout.update(payout_params)\n format.html { redirect_to @payout, notice: 'Payout was successfully updated.' }\n format.json { render :show, status: :ok, locatio... |
b11bdc25344c033986a7307845c45d21 | Write to the log anytime an API call fails and we have to retry. See for more information. | [
{
"docid": "3944b16cdd17db5487b530a4f72a8cbe",
"score": "0.6492497",
"text": "def log_retries\n proc do |exception, try, elapsed_time, next_interval|\n logger.debug \"#{exception.class}: '#{exception.message}' - #{try} tries in #{elapsed_time} seconds and #{next_interval} seconds until the n... | [
{
"docid": "4b45e02f33fe91d7dbcd980d86693a6a",
"score": "0.717298",
"text": "def handle_error\n exit_on_max_retry\n @retries += 1\n @error_log.error('There was a problem with the request. Retrying...')\n end",
"title": ""
},
{
"docid": "a91dbcc93a6c681f5fd483bf0ccedffc",
... |
a76ebb6042fa02396bc3cd33f4a85838 | Validate that the driver and the vehicle have free time in the hours of the delivery | [
{
"docid": "679ebfd439bb97d48a13c546c5d73d03",
"score": "0.6855898",
"text": "def validate_times_overlap\n if Routes.exist(driver_id: self.driver_id.to_i) || Routes.exist(vehicle_id: self.vehicle_id.to_i)\n routes_all_driver = Routes.where(driver_id: self.driver_id.to_i)\n routes_all_ve... | [
{
"docid": "9a7691d14c1efde4f5fc40d984d7dd26",
"score": "0.66279143",
"text": "def open_validation(reservation_time)\n if @restaurant.closing_hour < @restaurant.opening_hour\n if reservation_time.hour < @restaurant.opening_hour.hour\n reservation_time.hour < @restaurant.closing_hour... |
537cdbdbe299c67659375e4acc79710e | gets user's first max_num of public playlists | [
{
"docid": "b056daca79b63afc697aa76fdd52eaad",
"score": "0.6436005",
"text": "def get_user_playlists(user_id, max_num_of_playlists)\n uri = URI.parse(@config[\"base_user_endpoint\"] +\n \"#{user_id}/playlists?offset=0&limit=#{max_num_of_playlists}\")\n @logger.info \"Request... | [
{
"docid": "1d8bdf8ea7fadd6171be6d37abe07ec5",
"score": "0.6932847",
"text": "def top_playlists(count=50)\n current_site.top_playlists.all(:limit => count, :order => 'total_requests DESC')\n end",
"title": ""
},
{
"docid": "be3857ae77e5af3af37c40b7f9fe427f",
"score": "0.6407645",
... |
b6cc819ce6771c43eec07880bb38990c | PATCH/PUT /parttypes/1 PATCH/PUT /parttypes/1.json | [
{
"docid": "79750a65c585cee2a77b14e2eb5c76de",
"score": "0.69538224",
"text": "def update\n respond_to do |format|\n if @parttype.update(parttype_params)\n format.html { redirect_to @parttype, notice: 'Parttype was successfully updated.' }\n format.json { render :show, status: :ok,... | [
{
"docid": "c344fae6add79d569030793fe72ad0de",
"score": "0.71769106",
"text": "def update\n @part_type = PartType.find(params[:id])\n\n respond_to do |format|\n if @part_type.update_attributes(params[:part_type])\n format.html { redirect_to @part_type, :notice => 'Part type was success... |
542432833744b1ecf13b9be32210b6a9 | Returns the comments in this address as an array of strings. | [
{
"docid": "5e0d982ac532cef70f88ba11d1b9550a",
"score": "0.6856691",
"text": "def comments\n @comments\n end",
"title": ""
}
] | [
{
"docid": "6dbc193e3a2f4a0ebf008a294a8d1b30",
"score": "0.74023306",
"text": "def comments\n results = []\n return results unless @comments\n\n comment = ''\n @comments.split(\"\\n\").each do |line|\n if line =~ /^\\S/\n results << comment unless comment.empty?\n comment ... |
9b1e92c75c77da74084739c751ec2399 | book /books book /books.json | [
{
"docid": "3b5eb4991ec0096e543fa7256474bb26",
"score": "0.0",
"text": "def create\n @book = Book.new(book_params) \n respond_to do |format|\n if @book.save\n flash[:success] = \"Successfully created book.\"\n redirect_to @book and return\n else \n format.html { rend... | [
{
"docid": "ec8a6a39a665c3c0058cb986dea89ba0",
"score": "0.70714116",
"text": "def index\n render json: user_shelf.books\n end",
"title": ""
},
{
"docid": "60973656e5d53c2355cc3aaa79804fee",
"score": "0.70565504",
"text": "def index\n render json: @books, status: 200\n ... |
0d4f2af0d1daca44ba425ae2a0cf30f6 | Functions find_vmx_files: find files in a datacenter takes datastore and directory path | [
{
"docid": "a7c2ad12e5cd15538668befd971669a1",
"score": "0.842324",
"text": "def find_vmx_files(ds, output_directory) # rubocop:disable Metrics/MethodLength\n datastore_path = \"[#{ds.name}] /#{output_directory}\"\n puts datastore_path\n search_spec = {\n details: { fileOwner: false, fileSize: fal... | [
{
"docid": "f14dd7551b786032216250b1e87b233e",
"score": "0.64099735",
"text": "def find_files(base_dir, flags); end",
"title": ""
},
{
"docid": "6eea7dbe5ad9d7251f45fd6d06982fbd",
"score": "0.6336178",
"text": "def search_in(files, host, options = T.unsafe(nil)); end",
"title": "... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "94fd2f6d3a0d2cfe8a393f1dddd47e5b",
"score": "0.0",
"text": "def set_temperature\n @temperature = Temperature.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60315156",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6018921",
"text": "de... |
d59996508d781e3aac4f8010b1781e8c | still need to implement the view | [
{
"docid": "9d1db1ac00802f18ddffc228191f60c0",
"score": "0.0",
"text": "def double\n new_wager = session[:wager].to_f * 2\n session[:wager] = new_wager.to_s\n render :layout => false\n\tend",
"title": ""
}
] | [
{
"docid": "15fb33b16b474715e54ca66afd7a9089",
"score": "0.7667292",
"text": "def _view; end",
"title": ""
},
{
"docid": "38354c0dd0c314483e4c023b64e49f68",
"score": "0.7639855",
"text": "def view; end",
"title": ""
},
{
"docid": "b370b36a814780cc30165c0067984353",
"s... |
af87405477d8280e73b9579a181900f9 | GET /statuses/1 GET /statuses/1.json | [
{
"docid": "06e5d088e65dc18a9db9d6c96e585007",
"score": "0.0",
"text": "def show\n @status = Status.find(params[:id])\n @comments = @status.comments.all(:order => 'comments.created_at DESC')\n render action: :show\n end",
"title": ""
}
] | [
{
"docid": "d4d6f0a85b0d027980ce7fd7f095c381",
"score": "0.71040684",
"text": "def retweets(id)\n get(\"/statuses/retweets/#{id}.json\")\n end",
"title": ""
},
{
"docid": "79b67dd685669f9224db01a5b714deac",
"score": "0.69599247",
"text": "def get_single_tweet(status_id)\n ... |
87b8a4202c30b15b40ca115b3436d931 | 65 [x] return value: devide calculation result (at this time, float) [x] divide with 0 exception (at this time, false) | [
{
"docid": "017feddfa4bbd561431424aa61e1ade9",
"score": "0.6961114",
"text": "def test_for_divide\n assert_equal @target.divide(1, 2), (1 / 2).to_f\n assert_equal @target.divide(2, 2), (2 / 2).to_f\n assert_equal @target.divide(1, 0.5), (1 / 0.5).to_f\n assert_equal @target.divide(1, 0), fal... | [
{
"docid": "087ba24aff8e98bebbcd8ec34f3c0ae9",
"score": "0.67649126",
"text": "def reverse_process(value)\n value / 3.28\n end",
"title": ""
},
{
"docid": "917d9c70ba71f8df0dfce2532e9249b3",
"score": "0.6492837",
"text": "def dec_remainder_of_two_floats(f_dividend, f_divisor)\n ... |
2d47c3145bbba0cf926b85931b1d42ee | IE over HTTPS will not download if browser caching is off, so allow browser caching when sending files | [
{
"docid": "8b66b72b65c7e0b380c7885c93a286c4",
"score": "0.7056896",
"text": "def send_file(file, opts={})\n response.headers['Cache-Control'] = 'private, proxy-revalidate' # Still prevent proxy caching\n response.headers['Pragma'] = 'cache'\n response.headers['Expires'] = '0'\n super(file, ... | [
{
"docid": "a0c15932c1ec4ede944af9242b65e7d3",
"score": "0.7037141",
"text": "def force_http_cache\n set_http_header('expires' => (Time.now + (100 * 24 * 60 * 60)).to_s, \n 'Last-Modified' => (Time.now - (1 * 24 * 60 * 60)).to_s)\n end",
"title": ""
},
{
"d... |
7f315e5c32e4790fbef863ad02634e4c | Game format how long are data. To implement | [
{
"docid": "e3c72fd508ec750c7b5bbc28306bfb96",
"score": "0.6556679",
"text": "def game_format; end",
"title": ""
}
] | [
{
"docid": "cd1ae0442b1595d57063aa3a6ebe8a50",
"score": "0.6708299",
"text": "def format_data(formatting)\n\t\treq_length = (@data.max { |a, b| a.length <=> b.length }).length\n\t\t\n\t\tfor i in (0...@data.length)\n\t\t\tlength_diff = req_length - @data[i].length\n\t\t\t\n\t\t\tnext if length_diff == 0... |