query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
7983b0f46ce1ed2b059a08913f03cd9d
Get right 16 bit from raw48
[ { "docid": "96899f80895228f120c5d08fd364e59c", "score": "0.6967049", "text": "def right16bit(value)\n value & 0xffff\n end", "title": "" } ]
[ { "docid": "79cd18f597eb3a5bb2f0774f6a12a74a", "score": "0.74149215", "text": "def read_uint48\n a, b, c = reader.read(6).unpack(\"vvv\")\n a + (b << 16) + (c << 32)\n end", "title": "" }, { "docid": "34d194b7924e13b10ddd41ee251a73a2", "score": "0.70185477", "text": "def...
da5917774bbd0954a78a14294ca820f9
initialization and opening of a spreadsheet file values for packed: :zip optional cell_max (int) parameter for early aborting attempts to parse enormous documents.
[ { "docid": "4904bd4215045757203239e9b3197b47", "score": "0.66400814", "text": "def initialize(filename_or_stream, options = {})\n packed = options[:packed]\n file_warning = options.fetch(:file_warning, :error)\n cell_max = options.delete(:cell_max)\n sheet_options = {}\n sheet_o...
[ { "docid": "0f69498317cea0c800aaf08cd80bf166", "score": "0.6592678", "text": "def initialize(filename, packed = nil, file_warning = :error)\n super()\n @file_warning = file_warning\n @tmpdir = \"oo_\"+$$.to_s\n @tmpdir = File.join(ENV['ROO_TMP'], @tmpdir) if ENV['ROO_TMP'] \n unless File....
438d59c8c5c1e5c75c31981db95f40dd
GET /caronas GET /caronas.json
[ { "docid": "f14cc8c51451811fbdc93198cd859a83", "score": "0.7433467", "text": "def index\n @caronas = Carona.all \n \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @caronas }\n end\n end", "title": "" } ]
[ { "docid": "e3dbbe9ee66a9778bd1a65dfcea6db02", "score": "0.7016374", "text": "def index\n \n @cars = Car.all\n \n render json: @cars\n \n end", "title": "" }, { "docid": "faf84e32344104731b31c07be81cfa7c", "score": "0.6964974", "text": "def show\n @carro = Carro.find(par...
90ae7abd71393b273e7782ba1f1ce3ac
Create secondary index. This asynchronous server call will return before command is complete. The user can optionally wait for command completion by using the returned IndexTask instance. This method is only supported by Aerospike 3 servers. index_type should be :string, :numeric or :geo2dsphere (requires server versio...
[ { "docid": "6a353671a3e0a04e46c1b8a19e9b1a0d", "score": "0.7218832", "text": "def create_index(namespace, set_name, index_name, bin_name, index_type, collection_type = nil, options = nil, ctx: nil)\n if options.nil? && collection_type.is_a?(Hash)\n options, collection_type = collection_type,...
[ { "docid": "7c862c9e9d31fe139f053f180425864d", "score": "0.594799", "text": "def create_index(index)\n\n parsed = @http.put(\"http://#{@host}:#{@port}/#{index}\")\n ok = parsed[\"ok\"]\n @logger.error(\"parsed???\", :parsed => parsed)\n\n @logger.error(\"create_index ok\", :ok => ok, :index ...
39601c4cc0301b6e88c878fa71781886
Distance spanned by one degree of longitude at the given latitude. This ranges from around 69 miles at the equator to zero at the poles.
[ { "docid": "c1e6322dfe5c518c94be5095df298970", "score": "0.65748143", "text": "def longitude_degree_distance(latitude)\n (latitude_degree_distance * Math.cos(latitude * (Math::PI / 180))).abs\n end", "title": "" } ]
[ { "docid": "55c9499575694dc431b2d59a5007eed2", "score": "0.7123929", "text": "def distance_to(lat = 0.0, long = 0.0)\n spherical_distance(lat, long, @latitude, @longitude)\n end", "title": "" }, { "docid": "c16eb4d196fb393ccfc0fb281c3c8a6a", "score": "0.68797505", "text": "de...
4c3a9488d77598cdfefe79e8acec2bb3
to get each sub content
[ { "docid": "23a3c20e056f5219b4ffa45c6f1773bb", "score": "0.61535674", "text": "def parse_sub_content(content)\n sub_content_list = content.split(\"<br>\")\n sub_content_list.map { |row| row.strip }\nend", "title": "" } ]
[ { "docid": "9b9779b6ac501a32bfab62772c00fb74", "score": "0.6554606", "text": "def sub_elements()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "78467daaced1e981909815fff6d08c01", "score": "0.65491825", "text": "def index\n @subcon...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "3b0cc6466f4cc92c2277436d0d973693", "score": "0.0", "text": "def usuario_tipo_params\n params.require(:usuario_tipo).permit(:usuario)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7498391", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6958937", "text": "def strong_params\n params.require(:request).permit(param_white...
db026e36347adee761909499fefc8837
returns array elements similar to this element
[ { "docid": "e157fd37f722a7f7b489bb9e7a83f543", "score": "0.6753485", "text": "def collect_similar()\n \tcount = self.count_similar()\n \tels = Array.new(count)\n \tfor i in (0..count-1)\n \t\tcopy = Array.new(@identifiers)\n \t\tcopy[0] = \"#{copy[0]}[#{i}]\"\n \t\tels[i] = ElementStub...
[ { "docid": "1e912a3ab1b3f46734a15a228fda4765", "score": "0.6276056", "text": "def elements\r\n [self]\r\n end", "title": "" }, { "docid": "68f6b1d5a0550f975a23e67e82e23231", "score": "0.6242504", "text": "def elements()\n #This is a stub, used for indexing\...
3f83be6eefec6caac055a06e334507bb
Changes the default value of a table column.
[ { "docid": "a8eee95be1fb370611109e241a0c2249", "score": "0.7633983", "text": "def change_column_default(table_name, column_name, default_or_changes) # :nodoc:\n execute \"ALTER TABLE #{quote_table_name(table_name)} #{change_column_default_for_alter(table_name, column_name, default_or_changes)}\...
[ { "docid": "ef70fc2a720a91cce8b19c314af451a0", "score": "0.8321701", "text": "def change_column_default(table_name, column_name, default_or_changes); end", "title": "" }, { "docid": "b2448ad7fe3e54b6f0d4a1406b96daf6", "score": "0.82445854", "text": "def change_column_default(table_na...
b31858f18e8e1270b3dd432dbcc29bc1
Test that the passed entry is open.
[ { "docid": "00655fc94a4d2c9e95283b706a684533", "score": "0.62340415", "text": "def entry_should_be_closed(entry)\n expect(page).to have_css \"div#entry-#{entry.id} div#entry-#{entry.id}-summary\", visible: false\n expect(page).to have_no_css \"div#entry-#{entry.id} div#entry-#{entry.id}-summary.entry_...
[ { "docid": "841557db9533e3426a90f9ce4e50167c", "score": "0.7274376", "text": "def open_entry(entry)\n expect(page).to have_css \"#feed-entries #entry-#{entry.id}\"\n\n # Open entry only if it is closed\n if !page.has_css? \"#feed-entries #entry-#{entry.id}-summary.entry_open\"\n find(\"#feed-entri...
42c63c3b529c04b1cffdfbf9ea195814
Reset an environment's mobile key. The optional expiry for the old key is deprecated for this endpoint, so the old key will always expire immediately.
[ { "docid": "fc28c95d79ed4d325535230f40e4a964", "score": "0.7380433", "text": "def reset_environment_mobile_key(project_key, environment_key, opts = {})\n data, _status_code, _headers = reset_environment_mobile_key_with_http_info(project_key, environment_key, opts)\n data\n end", "title"...
[ { "docid": "82413dabf781815474f6d1c2242ef01c", "score": "0.6519452", "text": "def reset_environment_mobile_key_with_http_info(project_key, environment_key, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: EnvironmentsApi.reset_environment_mobile_ke...
80e353d72215c1f0c3836b5555e84604
GET /course_sections/1 GET /course_sections/1.json
[ { "docid": "ba9981d8a5e46e804a7ddc21b27257b3", "score": "0.6906632", "text": "def show\n @course = @course_section.course\n end", "title": "" } ]
[ { "docid": "a32c92f83bdcf9313b64fd1525bca601", "score": "0.7986577", "text": "def index\n course = Course.find(params[:course_id])\n sections = course.sections.all\n render json: sections.order(:id)\n end", "title": "" }, { "docid": "e31eb06a73d580d0c816865731861de2", "score": ...
4e1f5ce0d68d67cc2be6e1dd4d96d0b4
Generates a hex receipt for the message
[ { "docid": "c2c32fc9e3da4b235541d7f24fb0b30b", "score": "0.77391106", "text": "def generate_receipt\n SecureRandom.hex(16)\n end", "title": "" } ]
[ { "docid": "dc013778dea2bd27a3e196dcadf7367f", "score": "0.660162", "text": "def receipt\n end", "title": "" }, { "docid": "dc013778dea2bd27a3e196dcadf7367f", "score": "0.660162", "text": "def receipt\n end", "title": "" }, { "docid": "ff397b18a3c91b02df44ce67390caca2",...
d0a29399b6d76d1e6e2e043708673762
POST /applies POST /applies.json
[ { "docid": "f26cefcd893e103be2a01b1e22fb42c0", "score": "0.0", "text": "def create\n @job = Job.find(params[:job_id])\n current_user.apply!(@job)\n redirect_to @job\n end", "title": "" } ]
[ { "docid": "de3fa00b3e620009b41bd198c6412dd7", "score": "0.6500814", "text": "def apply!\n response = post '/apply'\n response.success?\n end", "title": "" }, { "docid": "7cc1d50a73455c21087da405821c9551", "score": "0.6156388", "text": "def index\n @applies = Apply.al...
5e366828c18280a34ce82892180205b6
Returns the name of the controller responsible for managing this sobject
[ { "docid": "725ddd6a1c8189f0520046de25c5d0e2", "score": "0.0", "text": "def controller_name\n ( MediaItem::ALLOWED_CLASS_NAMES.include?(self.content_type) ? 'media_item' : self.content_type ).tableize.downcase\n end", "title": "" } ]
[ { "docid": "61825fe8c86a1f172135f1769cf5beae", "score": "0.84032166", "text": "def controller_name\n self.class.controller_name\n end", "title": "" }, { "docid": "61825fe8c86a1f172135f1769cf5beae", "score": "0.84032166", "text": "def controller_name\n self.class.co...
812b8adf7c0b12996b41d8bf806fc2b5
GET /discount_plans/1 GET /discount_plans/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "f2824fdac577bdf81173f29568c22d1c", "score": "0.7566277", "text": "def index\n @discount_plans = DiscountPlan.all\n end", "title": "" }, { "docid": "5b231aaa064e3d8c5863db7eb11b2e61", "score": "0.6882739", "text": "def index\n @plans = Plan.all\n \n render jso...
475a8276f22d531bc4f7c7b07349cc81
helper method for validating move returns true if move is valid
[ { "docid": "a736d606c47678caab0e294ed110f6b7", "score": "0.0", "text": "def valid_move?(board, index)\n if index.between?(0, 8) && position_taken?(board, index) == false\n return true\n else\n return false\n end\nend", "title": "" } ]
[ { "docid": "bc4378b5d41878fc8e13a1d6684f9df8", "score": "0.8546846", "text": "def validate_move(move) \n move_from_file = @data[\"moves\"][move]\n move_from_file ? valid = true : valid = false\n end", "title": "" }, { "docid": "4840da9af0135367afed86edfaa06e28"...
8f406b7a66270d8857fa59f429381893
Silences the logger for the duration of the block.
[ { "docid": "f5cc2352f895ef2c94ad2fd90fd5a3cb", "score": "0.7282442", "text": "def silence\n old_logger_level, logger.level = logger.level, Logger::ERROR if logger\n yield\n ensure\n logger.level = old_logger_level if logger\n end", "title": "" } ]
[ { "docid": "8ddb2dc513f1b12571475c95c20803fc", "score": "0.7993163", "text": "def silence_logger(&block)\n yield if block\n end", "title": "" }, { "docid": "273ca23cb1fd769769cceb2138a6d480", "score": "0.76963884", "text": "def quiet_with_silence(&block)\n ::Rails.logg...
8f01ce6bacb4cee219387b5fb4ba3879
Supports curl. For example:
[ { "docid": "634173b8639899ce5836a98e0f48b2a3", "score": "0.0", "text": "def update\n if params[:push_token]\n @game.package = params[:package].read\n if @game.save\n render :text => \"game updated\\n\"\n else\n render :text => @game.errors.full_messages.join(\"\\n\")+\"\\...
[ { "docid": "6ccb63e49252eb18e9fcdaf628950f25", "score": "0.7151797", "text": "def http(url); end", "title": "" }, { "docid": "1b44b9cf77ce39988a4407a6295d225d", "score": "0.7138069", "text": "def as_curl\n 'curl'.tap do |curl|\n curl << \" -X #{http_request.method}\"\n ...
e47e3f84b3a34e96f3469ee8314ad13c
method to mark the item as done
[ { "docid": "98e1b6bd01d8ec0100c5c87e697ff9d6", "score": "0.7132914", "text": "def done\n @status = true\n end", "title": "" } ]
[ { "docid": "bf0480775ca65a89ddf32ded3a805611", "score": "0.79720217", "text": "def mark_done\n \tself.done = true\n end", "title": "" }, { "docid": "c8386e0e5427cebe134152b759fd4c69", "score": "0.7604722", "text": "def mark_done\n @status = true\n end", "title": "" }, {...
f10f198eb97a3406b2603ea514d68b64
Once you have it, you can also pass your access_token into the constructor.
[ { "docid": "4613859d6e4365bb21c02b7450f86928", "score": "0.0", "text": "def another_action\n @discogs = Discogs::Wrapper.new(\"Test OAuth\", access_token: session[:access_token])\n \n # You can now perform authenticated requests.\n end", "title": "" } ]
[ { "docid": "db304bee84a4c3fef25d978d8bf1ef85", "score": "0.9094902", "text": "def initialize(access_token)\n @access_token = access_token\n end", "title": "" }, { "docid": "db304bee84a4c3fef25d978d8bf1ef85", "score": "0.9094902", "text": "def initialize(access_token)\n @access...
f0f55ac96df66a3b566eab7f2751a4da
Same as describe_stdout for stderr
[ { "docid": "2799677dd35b2b9e64063c84558f2322", "score": "0.71477735", "text": "def describe_stderr(&block)\n describe \"it's stderr\" do\n let(:_watch_stream) { $_process_stderr.dup }\n extend Stream\n\n subject { $_process_stderr }\n\n class_eval &block\n end\n ...
[ { "docid": "11bc1847fd60c117105bf4c6a6eff15f", "score": "0.71529824", "text": "def to_stderr; end", "title": "" }, { "docid": "a76109b2f3979c5d9abce6fcc49b4eae", "score": "0.6919946", "text": "def capture_stdout_stderr\n out = StringIO.new\n err = StringIO.new\n $stdout = ou...
02890ca20b07ba03ffc445d2afde3921
Param:: positive integer n positive integer bound <= DEFAULT_SIEVE_SIZE positive integer m (2 <= m < n) Return:: a factor f (1 < f < n) if found else nil
[ { "docid": "aed92b2b4c99a35cb7d76bfc7f0dd97f", "score": "0.0", "text": "def p_minus_1(n, bound = 10_000, m = 2)\r\n\t\tplist = precomputed_primes\r\n\r\n\t\tp = nil\r\n\t\told_m = m\r\n\t\told_i = i = -1\r\n\r\n\t\tloop do\r\n\t\t\ti += 1\r\n\t\t\tp = plist[i]\r\n\t\t\tbreak if nil == p or bound < p\r\n...
[ { "docid": "36492b55a0dad21f2ae4474f73cda0b0", "score": "0.6528145", "text": "def least_factor(n) \n return 0 if (n == 0) \n return 1 if (n % 1 > 0 || n * n <2)\n return 2 if (n % 2 == 0) \n return 3 if (n % 3 == 0) \n return 5 if (n % 5 == 0) \n m = Math.sqrt(n)\n i = 7\n while i <= m do \n retu...
1c2142213c27f08b52fd6f8a8a63e9fd
decision fork based on url content
[ { "docid": "60c6f63467291767fcd083f9873aa273", "score": "0.56034166", "text": "def decide(content)\n if is_a_link(content)\n link = @strippedlink\n case link.to_s\n when /https?:\\/\\/[a-z]+.wikipedia.org\\/wiki\\/[\\S]+/\n wiki_get(link.to_s)\n when /https?:\\/\\/[a-z]*?.?...
[ { "docid": "f0ca82be8a907501cee7de0722bc35e1", "score": "0.6205272", "text": "def find_fork_source(url)\n # because this is a screen scrapping, it can change\n fork_source = @agent.get(url).search(\".text a\").text\n self.class.get(\"/repos/show/#{fork_source}\")[\"repository\"]\n end", "t...
b28062566d40fcb459d0f5d0dda2931f
return results of 'typeof' operator.
[ { "docid": "de2733b37dbcd824313c6c5a3346cbff", "score": "0.0", "text": "def ecma262_typeof\n :number\n end", "title": "" } ]
[ { "docid": "716bc8ed01447047e6a94e4ca99f00d2", "score": "0.7296878", "text": "def typeof\n function(:typeof)\n end", "title": "" }, { "docid": "da83fd95e6a8656c459341e6caf59cb6", "score": "0.7126199", "text": "def typeof(value)\n `typeof #{value}`\n end", "title":...
3f52973818698070d105a2c20fdb77a5
Serializes information the current object
[ { "docid": "69ea969b3edb5ca5aeb0d13661fc73f6", "score": "0.0", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"capability\", @capability)\n writer.write_string_v...
[ { "docid": "0795eac2a3b746fc7fea6373714e1986", "score": "0.7951372", "text": "def serialize\n end", "title": "" }, { "docid": "762bca0e2db3ff19d91cc4521bb1e1d9", "score": "0.7645999", "text": "def serialize(object) end", "title": "" }, { "docid": "a126e681346630c4ec3...
95268391ef2022359812a99ceacbb0bf
reverse "Spin me right round"
[ { "docid": "bc5a87a165f023c38a00b4dfcb2af0cb", "score": "0.0", "text": "def space_remover(string)\n puts string.strip\nend", "title": "" } ]
[ { "docid": "7df079c99c9cb937b21e46ce155c9a29", "score": "0.7458301", "text": "def spin_right\n @current = case @current\n when NORTH then EAST\n when EAST then SOUTH\n when SOUTH then WEST\n when WEST then NORTH\n end\n self\n ...
f659719fc6ad8359ac69e34d14a05340
Tries to add a hangar. If there's already a hangar, this method has no effect
[ { "docid": "76d704c62fc576d2f3f49f1744430e03", "score": "0.62324494", "text": "def receiveHangar(h)\n\t\tif @hangar.nil?\n\t\t\t@hangar = h\n\t\tend\n\tend", "title": "" } ]
[ { "docid": "6f09e1045cbb16aff89a96c27b317877", "score": "0.69746745", "text": "def hangar\n\t\t@hangar ||= []\n\tend", "title": "" }, { "docid": "452ca3c5a03cfdcec286aebd5cd8e096", "score": "0.63369757", "text": "def receiveHangar(h)\n if @hangar == nil\n @hangar = h\n ...
558ab64fdb56d01ed466214879fa8d88
GET /orders GET /orders.json
[ { "docid": "2935c7e0986d0dc8ba72d6e50dd30665", "score": "0.0", "text": "def index\n @orders = Order.all.order(\"created_at DESC\")\n end", "title": "" } ]
[ { "docid": "0018a9a547b20cd7a770a6e2cd109f33", "score": "0.8453559", "text": "def orders\n get(\"orders\")\n end", "title": "" }, { "docid": "8fe2d6ec8a1d47ca8c318cf923eb35b7", "score": "0.84051836", "text": "def orders\n client.get \"orders\"\n end", "title": "" }, {...
480e490603f523be78fc15e12979df85
Add a file to the list of files.
[ { "docid": "0e7e66b40ac1e8e4933e62a21020a329", "score": "0.7671873", "text": "def add_file path\n if File.exist? path\n @files << path\n else\n raise Errno::ENOENT, \"File '#{path}' doesn't exist\"\n end\n end", "title": "" } ]
[ { "docid": "45464b3a7533b24fa7065b1e86a1c2a3", "score": "0.8709575", "text": "def add_file(file)\n @files << file\n end", "title": "" }, { "docid": "9c5ba26659f72775a6332f6345de37ca", "score": "0.8677869", "text": "def addFile(file)\r\n @files << file\r\n end", "tit...
d783d8d382abb939c85ead494ebb096f
GET /people/search GET /people/search.xml
[ { "docid": "b0732bdcb02663fec932f25b38dae7e1", "score": "0.0", "text": "def search()\n\n @countries = Country.partners.order('name').all()\n if params.has_key?('country') && !params[:country].empty?\n if params[:query].empty?\n @results = Person.find(:all,\n :selec...
[ { "docid": "ddf49850b803c823c7274f4027409bb0", "score": "0.70963144", "text": "def search\n @contacts = Contact.search(params[:q])\n \n respond_to do |format|\n format.html { render :action => \"index\" }\n format.xml { render :xml => @contacts.to_xml(:dasherize => false, :methods =>...
7cdba91997f776ccc999add74418a784
Called before every test method runs. Can be used to set up fixture information.
[ { "docid": "48ac9949331db4e72ca3dc8c5bfa23cc", "score": "0.0", "text": "def setup\n json = YAML.load_file(FILES[Fixtures::SEMEME_DEFINITION])\n @rest_sememe_comp = Sememe.new(uuid: TEST_UUID_SEMEME_DEF, params: nil, body_params: {}, action: ACTION_SEMEME_DEFINITION, action_constants: ACTION_CONSTA...
[ { "docid": "4f2c7903d7d80789a8ecd5dfe5aa1186", "score": "0.7795597", "text": "def testFixtureSetup()\n end", "title": "" }, { "docid": "4f2c7903d7d80789a8ecd5dfe5aa1186", "score": "0.7795597", "text": "def testFixtureSetup()\n end", "title": "" }, { "docid": "5387b01f3d...
e7658fee0d305dbce002d72d4b44e2ad
GET /trailers/1 GET /trailers/1.xml
[ { "docid": "5e5b8aa3f5b4b0993ab68ccea89200c2", "score": "0.55364466", "text": "def show\n @trailer = Trailer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @trailer }\n end\n end", "title": "" } ]
[ { "docid": "6d08556f37c700e118844e9297cf2856", "score": "0.61447996", "text": "def show\n @trail = Trail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trail }\n end\n end", "title": "" }, { "docid": "6d08556f37c70...
a6a2a8094efc310b8334b7d605c83f7f
Post message to server. include Net::IRC::Constants post prefix, PRIVMSG, "channel", "foobar"
[ { "docid": "7b903c9c04d35a011bfec3d684c7972a", "score": "0.7052538", "text": "def post(prefix, command, *params)\n\t\t\tm = Message.new(prefix, command, params.map {|s|\n\t\t\t\t#s.gsub(/\\r\\n|[\\r\\n]/, \" \")\n\t\t\t\ts.tr(\"\\r\\n\", \" \")\n\t\t\t})\n\t\t\t@log.debug \"SEND: #{m.to_s.chomp}\"\n\t\t...
[ { "docid": "74a4524c3a8e6c8036056dacfdefc8f1", "score": "0.74787974", "text": "def send_message(msg) \n @irc_server.puts \"PRIVMSG #{@channel} :#{msg}\"\nend", "title": "" }, { "docid": "e923308eb0ac2aae1d24d359bbcf1ec9", "score": "0.6944939", "text": "def message(msg)\n puts(\"P...
a5bcd91b9581c661c183b5069679bea5
Return HDP 2.2 version, including revision, used for building HDP 2.2+ ondisk paths
[ { "docid": "bf7896dce92b3b146a8ec59c58c70c35", "score": "0.6001826", "text": "def hdp_version\n case node['hadoop']['distribution_version']\n when '2.2.0.0'\n '2.2.0.0-2041'\n when '2.2.1.0'\n '2.2.1.0-2340'\n when '2.2.4.2'\n '2.2.4.2-2'\n when '2.2.4.4'\n ...
[ { "docid": "0bd8d47f6bd08a88cfc1e719230d42fe", "score": "0.6504274", "text": "def full_version\n return nil unless exact\n\n \"~> \".concat(version)\n end", "title": "" }, { "docid": "69f8b08b9dcbe61e95f6c309708f24ba", "score": "0.6483623", "text": "def version\n @version |...
66e21a458b23cce0f48c359b9d8b7d7d
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
[ { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.0", "text": "def context; end", "title": "" } ]
[ { "docid": "d1758edd04b6374162470ca44c3f1250", "score": "0.6871894", "text": "def context\n unless @instance_context\n @instance_context = AuthTokenPromotionContext.new(@version )\n end\n @instance_context\n ...
b0282fb11290c560558b4e9bfba6a16b
Finds a unique name for the current folder among its siblings.
[ { "docid": "955193468a186c214abe1f8f77015ccf", "score": "0.6213896", "text": "def next_valid_name\n parent.next_uniq_child_name(self)\n end", "title": "" } ]
[ { "docid": "4d80a258d2fb7cd098549c5a9feb1d86", "score": "0.65733296", "text": "def next_uniq_child_name(item)\n taken_names = contents_names(item).map(&:downcase)\n name_generator = FileName.new(item.name, path: :relative, add: :always,\n format: '(%d)',...
02835ceb7e7f1626fec354375932a795
GET /areas/1 GET /areas/1.json
[ { "docid": "950d572d4d3a37293fc3c9d5c756ad4e", "score": "0.7247254", "text": "def show\n @area = Area.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @area }\n end\n end", "title": "" } ]
[ { "docid": "e6e626e1559b85a3039a0fb80aca96e7", "score": "0.7696245", "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", "score...
7f5a689f4dc198b27fab889a0b66335f
POST /organizations POST /organizations.json
[ { "docid": "26132f299228cc9bc730987c4c44e6bb", "score": "0.640478", "text": "def create\n if params[\"organization\"][\"org_type\"] == \"Other\"\n params[\"organization\"][\"org_type\"] = params[\"org_type_text\"]\n end\n @organization = Organization.new(organization_params)\n\n if pa...
[ { "docid": "4a75897f5755e5ca1f3989798e5b355c", "score": "0.7546241", "text": "def CreateOrganization params = {}\n \n APICall(path: 'organizations.json',method: 'POST',payload: params.to_json)\n \n end", "title": "" }, { "docid": "abf6c23654167535f3ba886f613bb95f", ...
0ef5cdb983ef0a54f61c990275db7084
NOTE: This doesn't work with more than one environment. My guess is that each process triggers STDIN to flush its buffer causing it to act very strange. A possible solution is to have a master process (or the current rake process) to control the flow of input data via an IO pipe.
[ { "docid": "01fea6ea0ff128d43e46ea25389a8942", "score": "0.0", "text": "def console\n require 'rendezvous'\n\n each_heroku_app do |_, remote_name|\n _console(remote_name)\n end\n end", "title": "" } ]
[ { "docid": "accf3df9d1d9b896de036f00d1f8eba7", "score": "0.69585866", "text": "def write_to_child_stdin; end", "title": "" }, { "docid": "c8499d5f529fc2e8faaffb32a0fd57de", "score": "0.69298744", "text": "def stdin_pipe; end", "title": "" }, { "docid": "1131ff6a6c99dfb2b7...
8209cc05fa5b31d156a14f9423b24dbf
prettyprint car number to xxyy...yyyyzz
[ { "docid": "e59758ac03190ec11d01bacfd5ad53d2", "score": "0.6443742", "text": "def pp_car( number )\n if ( number.length < 6 )\n return number;\n end\n last_idx = number.length; \n res = number[0..1] + \"-\" + number[2..last_idx-3] + \"-\" + number[(last_idx-2)..(...
[ { "docid": "0e46b94078a92b8ca5b7279196ea4d2c", "score": "0.6541664", "text": "def pretty\n cnpj = numeric.to_s.rjust(14, \"0\")\n \"%s.%s.%s/%s-%s\" % [cnpj[0,2], cnpj[2,3], cnpj[5,3], cnpj[8,4], cnpj[12,2]]\n end", "title": "" }, { "docid": "7a007663b9b478ea1bf276dbfdf8d5...
9f443df24f23df4473b4ffc39e3f5f5b
GET /routes/1 GET /routes/1.json
[ { "docid": "62fbe488e9d3ed900ddaa9ef22697d6c", "score": "0.0", "text": "def show\r\n @route = Route.find(params[:id])\r\n @line_item = LineItem.new #empty framework for lineitem ####################!!!!!~~~~~~~~~~~~~~~\r\n @line_item.route_id = @route.id\r\n #@route=route_details.find(para...
[ { "docid": "b63a0dbb9ef2d1e5f743a4caed61c187", "score": "0.69958645", "text": "def index\n routes = Route.all\n\n if routes\n render json: routes, status: 200, root: false\n else\n render json: { errors: routes.errors }, status: 404\n end\n end", "title": "" }, { "doci...
f3fa74256d5cd8164d17b9b31ae2bbf6
Process::Status for dead forks, nil for live forks
[ { "docid": "939d9c597c917dec1e4525681344b096", "score": "0.5900453", "text": "def process_status(blocking=true)\n @process_status || begin\n _wait(blocking)\n @process_status\n end\n end", "title": "" } ]
[ { "docid": "937a5eaaba4af744e6ef754b2a59ccf4", "score": "0.7057303", "text": "def get_status\n unless @status\n begin\n @status = Status.new(@pid, Process.waitpid2(@pid)[1])\n rescue Process::Error\n # process is gone, which means we have no recourse to retrieve the\...
f729b795207f9e1427d4a2a628f85cfe
Registers a message type for sending & creates accessors. Message.register_message_type :telepathy, TelepathyMessage message = Message.new do telepathy do thought 'Hello world.' end end message.telepathy.thought => 'Hello world.' Upon deliver the audience object will be checked for the registered message type. message....
[ { "docid": "fa91410a093d6f784ecd67fbbac68974", "score": "0.69943935", "text": "def register_message_type(name, message_type)\n message_types[name.to_sym] = message_type\n define_message_type_reader(name, message_type)\n define_message_type_writer(name)\n define_default_messag...
[ { "docid": "ad565d8531acfab09c5a2ff87971b081", "score": "0.6402836", "text": "def register(message_type, message_subtype = nil, &listener)\n _register(message_type, message_subtype, listener)\n end", "title": "" }, { "docid": "af90ca033206a738b5b5db2d09c935c0", "score": "0.61236835",...
0305135fae82c127d3911acdeaec9431
POST /warehouse_stocks POST /warehouse_stocks.json
[ { "docid": "ac82d0729661b75ab654521ed0dba151", "score": "0.75609106", "text": "def create\n @warehouse_stock = WarehouseStock.new(warehouse_stock_params)\n\n respond_to do |format|\n if @warehouse_stock.save\n format.html { redirect_to @warehouse_stock, notice: 'Warehouse stock was suc...
[ { "docid": "deace7b843e59720c98471d220e99621", "score": "0.75273275", "text": "def create\n @stock = Stock.new(stock_params)\n\n if @stock.save\n render json: @stock, status: :created, location: @stock\n else\n render json: @stock.errors, status: :unprocessable_entity\n end\n end"...
3a269e516f509f7f9e0c02b27ef4bd72
work around by defining a class method instead of using scope to avoid problems with abstract base classes.
[ { "docid": "dec9ac0a1905886b6b048328deb11720", "score": "0.0", "text": "def add_paging_to_class(kls)\n kls.send(:include, Kaminari::ConfigurationMethods)\n kls.class.send(:define_method, Kaminari.config.page_method_name) do |num=0|\n result = limit(default_per_page).offset(d...
[ { "docid": "7369c2a84a491d6f6c330f612694dbf1", "score": "0.73558617", "text": "def apply_standard_scope\n raise \"override in subclass\"\n end", "title": "" }, { "docid": "c1e560f7e67880590beee4cf988f137b", "score": "0.70846766", "text": "def apply_custom_scope\n r...
5eb8afa30de93c00652c90bc1c2b5db9
Humanreadable I18n name for the current status of the batch
[ { "docid": "a83fc3554586e1fc028958062d674563", "score": "0.6970559", "text": "def status_name\n Order::Status.name(status)\n end", "title": "" } ]
[ { "docid": "31b5e2bc0c4066955e7c089382f514cf", "score": "0.7854213", "text": "def status_name\n return STATUS_NAME[self.status]\n end", "title": "" }, { "docid": "77ef8e5d1fae2b93b6358466cbcf8b71", "score": "0.77862954", "text": "def status_name\n status.name if status\n ...
804d8ffeedd9e5f34df36a444dd72a49
Returns the value of attribute size. source://maxminddb//lib/maxmind/db/memory_reader.rb18
[ { "docid": "8875286b9b34dac9293b332299d8e321", "score": "0.0", "text": "def size; end", "title": "" } ]
[ { "docid": "8e1101f176e92525ed69bc5825b56dcf", "score": "0.77563727", "text": "def length\n attributes['totalSize']\n end", "title": "" }, { "docid": "4f228f90721a391449cbfd18153bcb39", "score": "0.7565998", "text": "def size\n (attributes['size'] =~ /^\\d+$/) ? at...
36a7614e4389858ed008c7ca02959723
GET /automatic_data_link_infos GET /automatic_data_link_infos.json
[ { "docid": "aae25f4ec601ab43a0e75adea5fce704", "score": "0.7455027", "text": "def index\n prepFormVariables\n @automatic_data_link_infos = AutomaticDataLinkInfo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @automati...
[ { "docid": "2c6da33f265b0eea41a9dc40bed2a7bf", "score": "0.7520745", "text": "def show\n prepFormVariables\n @automatic_data_link_info = AutomaticDataLinkInfo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json...
06ac031bdd15ce58720613a4c7d1596d
Sets the property value
[ { "docid": "8fd2e8c87aa8b77c649523ce414ec109", "score": "0.0", "text": "def value=(new_value)\n validate(BigDecimal(new_value.to_s))\n @value = new_value.to_s\n end", "title": "" } ]
[ { "docid": "db32b18d8c08a8c5724fcb10b6c1c25f", "score": "0.80231595", "text": "def set_Property(value)\n set_input(\"Property\", value)\n end", "title": "" }, { "docid": "f43615e4b6818fcfe76dd9330966273b", "score": "0.78439176", "text": "def set(property, value)\n se...
ac11223cd3fb5b5a158e1972c087dbc4
a palindrome, false otherwise. This time, however, your method should be caseinsensitive, and it should ignore all nonalphanumeric characters. If you wish, you may simplify things by calling the palindrome? method you wrote in the previous exercise. input: string output: boolean if string is palindrome rules: ignore ca...
[ { "docid": "44a5d95c822847666bab898017a161df", "score": "0.83668786", "text": "def real_palindrome?(str)\n stripped_str = str.gsub(/\\W/, '')\n stripped_str.downcase == stripped_str.downcase.reverse\nend", "title": "" } ]
[ { "docid": "49936b8c40ca305d65e9d74f1811f9a7", "score": "0.8830858", "text": "def real_palindrome?(string)\n filtered = string.gsub(/[^a-zA-Z0-9]/, '')\n palindrome?(filtered.downcase)\nend", "title": "" }, { "docid": "b8281f7535e90ba05ce3fbce42e324f8", "score": "0.87479615", "text...
433bfdfc6d01354611f575be5a326590
It groups by nation the array of countries and returns it
[ { "docid": "7282b1e50b3bd8679a14677fd7544713", "score": "0.84995294", "text": "def grouped_by_nation\n data.group_by do |country|\n country.nation\n end\n end", "title": "" } ]
[ { "docid": "e90aa3e95ce87ac328cd10884ff1b8f8", "score": "0.6828955", "text": "def regions_and_countries_from(countries = [])\n country_items = []\n region_items = []\n potential_regions = {}\n\n # First try to sort countries into potential regions.\n countries.each do |country|\n reg...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "42228d4cfef3700f4f801571d2d64d2c", "score": "0.0", "text": "def update_params\n allow = [:musician_status_id, musician_knowledges_attributes: [:id, :instrument_id, :level_id, :_destroy]]\n\n params.require(:musician).permit(allow)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whit...
5767cc30bbeba67d67e0561059a2c807
Iterate over JSON objects in the streamed response.
[ { "docid": "04c74cc4edbeba1ad9fbd8ef258c1dc3", "score": "0.7501695", "text": "def each\n return enum_for :each unless block_given?\n\n loop do\n while @ready_objs.empty?\n begin\n chunk = @json_enumerator.next\n next unless chunk\n ...
[ { "docid": "dac3c64de5df685231b50b7da20ecc5d", "score": "0.6804059", "text": "def each\n data = Net::HTTP.start(@server_url.host, @server_url.port) do |http|\n response, data = http.get \"/uri/#{cap}?t=json\"\n data\n end\n data = JSON.parse(data)\n data[1][\"children\"...
7a949db969ca9a74529e14a33962b886
Sets the attribute with
[ { "docid": "1a208d22c05b6e39134791595514f2e7", "score": "0.0", "text": "def with=(_arg0); end", "title": "" } ]
[ { "docid": "d309dffd28fdac85d4496f776991c611", "score": "0.84971863", "text": "def attribute=(attr_name, value); end", "title": "" }, { "docid": "f027203ea4dcb8fccd294ef0ecf5abaf", "score": "0.81883144", "text": "def attribute=(attr, value)\n @attributes[attr] = value\n end", ...
a457e452a66aeda56701c647d9858dfd
a resource instance path
[ { "docid": "607e2fe8e3d95a68bbeb0cdadda01a0d", "score": "0.0", "text": "def model_path(model, options = {})\n if model.is_a? Link\n dynamic_link_path(model, options)\n elsif model.is_a?(String) && is_admin?\n \"/admin/#{@model}\"\n else\n eval \"#{model_name(model)}_path(model, o...
[ { "docid": "7a1e9cc51942c4d5f543cd29ecbf1b9e", "score": "0.72869587", "text": "def instance_url\n \"#{parsed_resource_url}/#{self.id}\"\n end", "title": "" }, { "docid": "716f9f48b8f224221cd43c08dab94e7d", "score": "0.72774607", "text": "def resource_path(*args)\n reso...
115fcf154c9377ba56349d374e4f1a86
Rho The change in the value of an option for a change in the prevailing interest rate that matches the duration of the option, all else held equal. Generally rho is not a big driver of price changes for options, as interest rates tend to be relatively stable.
[ { "docid": "8697caa27ddf822c0ae398ff383602cf", "score": "0.6789117", "text": "def rho\n @rho ||= GreekCalculations.rho(\n :option_type => option_type, \n :option_expires_pct_year => option_expires_pct_year, \n :strike_vs_fed_vs_expires => strike_vs_fed_vs_...
[ { "docid": "301783117d3b87f7b427271b28e09d65", "score": "0.5738612", "text": "def correct_3d_options(options)\n\t\t\traise \"Please specify options[:rho_star] or options[:n0]\" unless options[:rho_star] or options[:n0]\n\t\t\tcase @equilibrium_option\n\t\t\twhen \"s-alpha\"\n\t\t\t\tqinp = epsl / (pk||2...
5f9b383a4111c123f62fb302c107929b
helper method returns a OmniResource whether obj is a String or some other kind of object
[ { "docid": "18a67a510908dfe3f7d61c360c063882", "score": "0.66099405", "text": "def omni_find(obj)\n if obj.is_a?(String)\n o = find_sitemap_webpage_by_path(obj)\n else\n o = OmniResource(obj)\n end\nend", "title": "" } ]
[ { "docid": "226eb9120219c1707fbffeab7a6b92d1", "score": "0.6814308", "text": "def find_resource(obj)\n resources.detect do |r|\n r.resource_name.to_s == obj.to_s\n end || resources.detect do |r|\n r.resource_class.to_s == obj.to_s\n end ||\n if obj.respond_to? :base_cla...
4a7b03ab23ad425e6341821e6797494b
GET /teleport_incenses GET /teleport_incenses.json
[ { "docid": "919cce1c28f7c796e82e053eb69d4bb6", "score": "0.76512367", "text": "def index\n @teleport_incenses = TeleportIncense.all\n end", "title": "" } ]
[ { "docid": "53443f935b09596410e1303b237c84d7", "score": "0.6689073", "text": "def set_teleport_incense\n @teleport_incense = TeleportIncense.find(params[:id])\n end", "title": "" }, { "docid": "c46aea5ab2911e30ebc398717ee31f24", "score": "0.65495837", "text": "def teleport_in...
cb06c18ece00c809b9ce99fda2838aae
Check if user is signed in, if not direct to sign_in page and store location for redirect_back
[ { "docid": "63406f28a52d3dad498c9ab54deab4d4", "score": "0.80450565", "text": "def signed_in_user\n\t\tunless signed_in?\n\t\t\tstore_location\n\t\t\tredirect_to signin_url \n\t\t\tflash[:success] = \"Please sign in.\"\n\t\tend\n\tend", "title": "" } ]
[ { "docid": "d275fdc1a5f6d48fa4bdfdd1e39c4957", "score": "0.8528889", "text": "def signed_in_user\n unless signed_in?\n store_location #record url of intended page before redirect\n redirect_to signin_url, notice: \"Please sign in.\"\n end\n end", "title": "" }, { "docid": "b...
f433cf6cfea37e7a00f314e9dcab5ee8
get all available stops
[ { "docid": "89dbeb4e1f7844055233972865568699", "score": "0.6504239", "text": "def available_stops(elevator)\n self.direction == 'up' ? elevator.stops.select { |s| s > self.floor_request } : elevator.stops.select { |s| s < self.floor_request }\n end", "title": "" } ]
[ { "docid": "35423210d71dd6cdffdf2269f7d1cfd9", "score": "0.7326239", "text": "def list\n get_request('/map/v2/stops').map{ |stop| Stop.new(stop) }.each(&on_stop)\n end", "title": "" }, { "docid": "4ad21c822631801909669c93f22e3856", "score": "0.70159256", "text": "def get_stop...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "81c22ce3fefea56d21b713916877991a", "score": "0.0", "text": "def set_station_priority\n @station_priority = StationPriority.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "d...
87f4b7668d25bacf2bb2b8f348c91f3e
Deal one card to specified player
[ { "docid": "30f54b26f5a57f56e23a192da95dfade", "score": "0.8225609", "text": "def deal_card(player)\n player.give_card(@deck.draw)\n end", "title": "" } ]
[ { "docid": "230f19494762fc0e86ed3d8b9d77fe00", "score": "0.76970565", "text": "def deal_to(player)\n card = @cards.first\n raise Exceptions::DeckEmpty if card.nil?\n player.hand << card\n @cards.delete(card)\n end", "title": "" }, { "docid": "7e91f129ad5ae389c642a6c478...
f3c604fe5ba928396ce282a5cd1e6e68
Forgets a user, allowing them to logout
[ { "docid": "dbdd9ccfaa55bc5dc7587627d979b267", "score": "0.0", "text": "def forget\n \tupdate_attribute(:remember_digest, nil)\n end", "title": "" } ]
[ { "docid": "ed88505b29ac0431f4f7b192aa1f42dc", "score": "0.7918005", "text": "def abandon!\n @user = nil\n session.clear\n end", "title": "" }, { "docid": "815fddadca5119b56f9fd194849aa760", "score": "0.78360593", "text": "def abandon!\n @user = nil\n session.d...
f7f762fdd4eadbecc94eec3b4e964359
GET /artist_people/new GET /artist_people/new.json
[ { "docid": "ea1afb98bd5fe02b17592f348f220077", "score": "0.8212172", "text": "def new\n @artist_person = ArtistPerson.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @artist_person }\n end\n end", "title": "" } ]
[ { "docid": "91f93d2956a3f9c3a30664d23aee3688", "score": "0.7906968", "text": "def new\n # @artist = Artist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: { artist: @artist } }\n end\n end", "title": "" }, { "docid": "ff4ff0cf5118c...
875de7b250740a24d81eda20aee71ece
Load api info from xml file
[ { "docid": "2478b3824e5e410d4ada8f26c5853687", "score": "0.0", "text": "def twitter_init\n file = File.read(\"twitter_key.xml\")\n xml = Nokogiri::XML(file)\n config = {\n consumer_key: xml.xpath(\"//key\").text,\n consumer_secret: xml.xpath(\"//secret\").text,\n }\n\n ...
[ { "docid": "fca4d4969a54b345ba090ec1d7e1d784", "score": "0.6514716", "text": "def get_xml\n response = @api.request(:get, @location, type: 'xml')\n response.body if response.status == 200\n end", "title": "" }, { "docid": "ca97148fffce4c1b17740947744e4ac9", "score": "0...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "c08f253c8aada316ef5e51a866df3148", "score": "0.0", "text": "def order_invoice_params\n params.fetch(:order_invoice, {})\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...
de59c033536df93517004bdb461cdd3e
List all objects assigned with matching scope and tag values Paginated list of all objects assigned with matching scope and tag values. Objects are represented in form of resource reference. Sort option is available only on target_type and target_display_name properties.
[ { "docid": "99d75cf3dccdc74eea982dd9d1ee67a5", "score": "0.0", "text": "def list_tagged_objects_0(opts = {})\n data, _status_code, _headers = list_tagged_objects_0_with_http_info(opts)\n data\n end", "title": "" } ]
[ { "docid": "a7d2e3c60d44637175532e758c673e03", "score": "0.5546571", "text": "def list\n @objects = @object_class.page params[:page]\n end", "title": "" }, { "docid": "633572da0c05ee5856eebb94db9276a3", "score": "0.54575336", "text": "def list\n @objects = @model.paginate :per...
1fe45203958b9e305189942d7caa7ad4
GET /excursions/new GET /excursions/new.xml
[ { "docid": "fd01c325b90be63cf7a23338d0e2c498", "score": "0.68148845", "text": "def new\n @excursion = Excursion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @excursion }\n end\n end", "title": "" } ]
[ { "docid": "8aa98cf7be0531cecf380a2d852ae248", "score": "0.7050891", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cursus }\n end\n end", "title": "" }, { "docid": "568e424df9717de8283a346bcee59ad7", "score": "0.68...
126ff3ba18bd9232911a4d3264788a31
Will checkout a rev/branch/tag using the locally cached versions. Does not handle upstream branch changes
[ { "docid": "f13b2640d5cfc4a3d0a9894f3c06decb", "score": "0.6834595", "text": "def checkout(revision = @resource.value(:revision))\n keep_local_changes = @resource.value(:keep_local_changes)\n stash if keep_local_changes == :true\n if !local_branch_revision?(revision) && remote_branch_revision?(...
[ { "docid": "c35f86792e8187353298af43b6019c84", "score": "0.699955", "text": "def checkout_version(version_hash)\n git 'checkout', version_hash || 'HEAD'\n end", "title": "" }, { "docid": "63b041f9e50a11b3437a41dd96061e54", "score": "0.69958574", "text": "def install\n ...
dafa639df42c06848e869e59a1f6897a
Internal: Calculates the primary demand factor of the given edge. edge The edge whose primary demand factor is to be calculated. stop_condition A method to be called on self to determine if the edge has any primary energy demand to be included in the calculation. Returns a numeric.
[ { "docid": "0076cf0f5d4439a00d5876c4068d0d35", "score": "0.66458786", "text": "def factor_for_primary_demand(stop_condition = :primary_energy_demand?)\n # If the stop condition is satisfied, return the output share of the node minus loss. Losses\n # should not be included in the share from the pri...
[ { "docid": "42e0c3ecf932e1b108d2e6f2482e796e", "score": "0.6414115", "text": "def calculate(edge)\n calculated = super\n\n max_demand = edge.max_demand\n max_demand && max_demand < calculated ? max_demand : calculated\n end", "title": "" }, { "docid": "108c5b87e036f...
65119a5bb222f67e10e8866ea7604e1d
Updates the database according to the dbschema.
[ { "docid": "792d16f91be2433606d6daf11ec980db", "score": "0.7715175", "text": "def update_db\n require \"#{File.dirname(__FILE__)}/../conf/db_schema.rb\"\n Knj::Db::Revision.new.init_db(\"debug\" => false, \"db\" => @db, \"schema\" => Openall_time_applet::DB_SCHEMA)\n end", "title": "" } ]
[ { "docid": "6d0c18bb24511ea431d39300bbe2521c", "score": "0.70956767", "text": "def update_db\n ## Sequel\n drop_table\n create_table\n db.transaction do\n table.delete_sql\n install_manual\n install_updates\n end\n ## AR\n # self.transaction do\n # self.delete_al...
d6e7e819e8f18e106a3ba7c0ba4fde76
Converting name to upcase and removing accent
[ { "docid": "5004e879a9ab48fc6f8aede33a9d7811", "score": "0.77061105", "text": "def convert_name\n self.name = I18n.transliterate(self.name).upcase\n end", "title": "" } ]
[ { "docid": "aef682a233a2da3e6c6982b697b9aece", "score": "0.75715965", "text": "def accent_buster\n self.tr(ACCENT_DOWNCASE + ACCENT_UPCASE, NO_ACCENT_DOWNCASE + NO_ACCENT_UPCASE)\n end", "title": "" }, { "docid": "d3cccf044737a7acc6ba0ba14877a956", "score": "0.75529987", "tex...
88b686ca748ac0662143f20e4f8173c7
Returns the value of attribute reify. source://regexp_parser//lib/regexp_parser/expression/methods/match_length.rb71
[ { "docid": "8e4afcf1b9b3ac54032a89ffc596e797", "score": "0.0", "text": "def reify; end", "title": "" } ]
[ { "docid": "7b4b399bf6ade141a782ad639da353b7", "score": "0.6234926", "text": "def url_match_attribute\n value = self.class.url_match_attribute\n return if value.nil?\n\n value = Regexp.new(value) unless value.is_a?(Regexp)\n value\n end", "title": "" }, { "docid": "7e0...
07ae01ee9ba01d4169018c1d827bd255
Author: Mohamed Saeed Team : 1 Paramters: none GET /wishlines/1/edit
[ { "docid": "14e723b5956fd7b7f6cadb2943c5232d", "score": "0.8440646", "text": "def edit\n @wishline = Wishline.find(params[:id])\n end", "title": "" } ]
[ { "docid": "276f2f98cf8cb790d30010ec97ea410f", "score": "0.7488858", "text": "def update\n @wishline = Wishline.find(params[:id])\n\n respond_to do |format|\n if @wishline.update_attributes(params[:wishline])\n format.html { redirect_to @wishline, notice: 'Wishline was successfully upd...
8eae2a65a6fd585e3b4b75e01bb641dc
Service_yaml with the `apis` and the `httprules` section
[ { "docid": "cec86edb3098bd8c51fef33fb3ec53c5", "score": "0.6484688", "text": "def test_parse_service_yaml_with_api_http\n api1_name = \"test_api1\"\n method1_name = \"test_method1\"\n method1_verb = \"get\"\n method1_binding = \"/v1alpha1/{name=projects/*}/locations\"\n\n method2_name = \...
[ { "docid": "5529a60d62e850c0917381396bd604f6", "score": "0.6762657", "text": "def build_service_yml\n\t\t\tputs \"==> Generating yaml configuration for #{@template[\"name\"]}-service\"\n\t\t\treverse_proxy = {\"hosts\" => [{\"host\" => \"#{@template[\"name\"]}.default.ciohcld.innovate.ibm.com\", \"port\...
7eb1773abbe0605cfa4a273cbed5be2c
POST /slips POST /slips.json
[ { "docid": "a863c8e5afdd9a213f04bde4c72d8685", "score": "0.6081642", "text": "def create\n @slip = Slip.new(slip_params)\n if @slip.save\n redirect_to pier_path(@slip.pier), notice: 'Slip was successfully created.'\n else\n render :new\n end\n end", "title": "" ...
[ { "docid": "491587522a631f474377e9c650a6dafd", "score": "0.6437541", "text": "def create\n @slip = Slip.new(params[:slip])\n\n respond_to do |format|\n if @slip.save\n flash[:notice] = 'Slip was successfully created.'\n format.html { redirect_to(@slip) }\n format.xml { r...
cc0f9da3c42cba0f4b53dee3a494a2fe
Set or retrieve the note attributes from the cookie then set the note with default attributes. Check if the user submitted any input then put the note attributes in a cookie.
[ { "docid": "50981663df88407019448fc34cec831c", "score": "0.76852334", "text": "def set_note\n set_cookie_defaults unless cookies[:demo_note].present?\n params[:note] ||= JSON.parse(cookies[:demo_note])\n title = params[:note].try(:[], \"title\") ? html_clean(params[:note][:title]) : t(\"note.sa...
[ { "docid": "780c711e97bbe9c50e549442e634c1aa", "score": "0.62678057", "text": "def set_remember_note\n @remember_note = RememberNote.find(params[:id])\n end", "title": "" }, { "docid": "43678163696c59285f2a985b2842fd17", "score": "0.5793049", "text": "def remember_note_params...
5f517a0db5207af19ee7a96748b39920
Calcuates the mediafragment_uri based on either the internal fragment value or start and end times
[ { "docid": "30e698fd3dac2588526af415242eb007", "score": "0.80641544", "text": "def mediafragment_uri\n \"#{master_file&.rdf_uri}?#{internal.fragment_value.object}\"\n rescue\n \"#{master_file&.rdf_uri}?t=#{start_time},#{end_time}\"\n end", "title": "" } ]
[ { "docid": "6281740c4e831f64da3cd34ab49e3883", "score": "0.604389", "text": "def full_uri_for(fragment)\n case fragment\n when /^http:\\/\\//\n # The fragment is a complete URI\n fragment\n when /^\\//\n # The fragment is relative to the root of this host\n host_uri + fragme...
455e2e6e0113c390cdff3081d05f842e
should return an array sorted in ascending order (FAILED 1)
[ { "docid": "eae192fb7a087767acc239fb6fb562d7", "score": "0.74476814", "text": "def sort_array_asc(array)\n array.sort\n\nend", "title": "" } ]
[ { "docid": "df8ebbc1c591323cd85c50328186462e", "score": "0.870869", "text": "def sort_array", "title": "" }, { "docid": "ac82e0d37617949047314557ad688eb9", "score": "0.8331411", "text": "def get_sorted_array\n end", "title": "" }, { "docid": "ac82e0d37617949047314557ad68...
a09f39f1fc2b2193ffe7182dff178109
The "archetype" is a clever name for the declaration of the original method that the IPC mechanism is a wrapper for.
[ { "docid": "3326088c9c39d62d683133229925e727", "score": "0.0", "text": "def archetype\n tok = []\n tok << 'extern int ' + name\n tok << '(' + \"\\n\"\n tok << [\n @returns.map { |ent| \"#{ent.type} #{ent.name}\" },\n @accepts.map { |ent| \"#{ent.type} #{ent.name}\" },\n...
[ { "docid": "6520100382a9c31c0c16dd5511aeb76d", "score": "0.6320781", "text": "def archetype\n\t\tsuper ? super.archetype : self\n\tend", "title": "" }, { "docid": "c86a3ff09fba79757cd7a91bc705fc47", "score": "0.5720694", "text": "def command(type)\n end", "title": "" }, { ...
81ada22dba010a5a8fddf93b9e27a537
=> true 2 all caps string
[ { "docid": "849148701fae1e562f7d428ea95a131e", "score": "0.6719282", "text": "def all_caps(word)\r\n length = word.length\r\n if length > 10\r\n word.upcase\r\n else\r\n word\r\n end\r\nend", "title": "" } ]
[ { "docid": "0ee9a700ae9dec7ae2f3fbca63b111e5", "score": "0.7546411", "text": "def uppercase?(str)\nend", "title": "" }, { "docid": "487d15db58b042e20d216810ab36ef94", "score": "0.75421387", "text": "def all_caps_two(string1)\n\n\tstring1.length > 10 ? string1.upcase : string1\n\nend"...
c1e198bb9aa9c23720f5a762a5f0ba9f
Run the LR parsing algorithm over a set of tokens
[ { "docid": "928a32c37f8330320027da648758f51c", "score": "0.6375962", "text": "def parse(tokens)\n @tokens = tokens\n @input = @tokens.next\n @stack = [ 0 ]\n @symbols = [@input]\n success = true\n @line = 1\n while true\n begin\n s = @stack[-1]\n ...
[ { "docid": "796a26b8f0c38b1e8666c57a2abbb65a", "score": "0.67862195", "text": "def tokens!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 59 )\n\n type = TOKENS\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - ...
64533b96c2b53ad72f2146035eecfd1b
PUT /tasks/1 PUT /tasks/1.xml
[ { "docid": "570c33d590e033b7a007e0d0a44d0cbc", "score": "0.6317618", "text": "def update\n @task = Task.find(params[:id])\n params[:task][:name].strip!\n params[:task][:name].downcase!\n\n respond_to do |format|\n if @task.update_attributes(params[:task])\n expire_all_fragments\n...
[ { "docid": "23b8fd20c4f863cc9fd1d0f2eeefb2e5", "score": "0.76518345", "text": "def update_task\n @user = User.find_by_username(session['user'])\n @access_token = OAuth::AccessToken.new(UsersController.consumer, @user.token, @user.secret)\n @response = UsersController.consumer.request(:put, \"/a...
fed97746a6630bc790b9dcf3308e0bf3
GET /children or /provider/id/children GET /children.json
[ { "docid": "3256782cb06bcd9662ab60921d70963b", "score": "0.63800144", "text": "def index\n if params[:provider_id] != nil\n # for specific provider view\n @provider = Provider.find(params[:provider_id])\n @children = @provider.children.order('lName')\n @new_path = new_provider_...
[ { "docid": "8b9bd57d3f61741554401c7645932af7", "score": "0.7531355", "text": "def children\n @pages = @page.children\n \n respond_to do |format|\n format.json { render :json => @pages }\n format.xml { render :xml => @pages }\n end\n end", "title": "" }, { "docid": "6b5...
d5f969a16770f0d04b2b1bd2d5e1048b
Returns the value of attribute pos. source://crass//lib/crass/tokenscanner.rb7
[ { "docid": "a3c677de4120a6b1a1688fb1c77520ce", "score": "0.6285739", "text": "def pos; end", "title": "" } ]
[ { "docid": "072f2294469717eb8ddf55aef860ce15", "score": "0.72618175", "text": "def pos\n @pos ||= node.attr('pos')\n end", "title": "" }, { "docid": "92d955e0637303e320798a850d3cf098", "score": "0.67795354", "text": "def pos\n @pos\n end", "title": "" }, {...
4af9e6704e901eb6a89a0049482d96f1
Performs an HTTP PUT operation
[ { "docid": "a6b98570c1a927e2d56708937339837c", "score": "0.0", "text": "def put(path, params)\n request(:put, path, params)\n end", "title": "" } ]
[ { "docid": "fbd7c46b15ae2792fd842ba0d764b7d0", "score": "0.8352073", "text": "def put uri, args = {}; Request.new(PUT, uri, args).execute; end", "title": "" }, { "docid": "8e18db431964c254de53caa41795b702", "score": "0.8154798", "text": "def put *args\n make_request :put, *args\n ...
665df4869e4a54b6822e4c8b2eef9b6b
PUT /itinerarios/1 PUT /itinerarios/1.xml
[ { "docid": "0e872f999e2b3a543968d235cfc8259a", "score": "0.67243886", "text": "def update\n @itinerario = Itinerario.find(params[:id])\n\n respond_to do |format|\n if @itinerario.update_attributes(params[:itinerario])\n flash[:notice] = 'ITINERÁRIO SALVO COM SUCESSO.'\n format.h...
[ { "docid": "b44fcca808470030b0d4a8ca0e32b4b7", "score": "0.6748132", "text": "def update\n @estagiarios = Estagiario.find(params[:id])\n\n respond_to do |format|\n if @estagiarios.update_attributes(params[:estagiario])\n flash[:notice] = 'ESTAGIÁRIO SALVO COM SUCESSO.'\n format....
f693f66985a5c796a618d397171da33d
Sets the selected item to be the same value as the current item.
[ { "docid": "e6b6adc4e99e290b076eb943d2eb9525", "score": "0.7124543", "text": "def select_item\n @selected = @current\n\n items\n end", "title": "" } ]
[ { "docid": "ed1f54b83cea5222a58a6f3f0a143c91", "score": "0.7288562", "text": "def setSelectedItem(item)\n @selected_item = item\n end", "title": "" }, { "docid": "9180b8e138796934d5cd7029577b5743", "score": "0.68708885", "text": "def setCurrentItem(item)\n self.setPositi...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "dc24c1f445615857ca2d985f50bd6728", "score": "0.0", "text": "def set_person\n @person = Person.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "d...
67907c4a3d5b37fed698a9bb40dc043a
PATCH/PUT /medical_histories/1 PATCH/PUT /medical_histories/1.json
[ { "docid": "763eeb3f3b148a3ef1da949ee14adc78", "score": "0.6924642", "text": "def update\n respond_to do |format|\n if @medical_history.update(medical_history_params)\n format.html { redirect_to @medical_history, notice: 'Medical history was successfully updated.' }\n format.json {...
[ { "docid": "27aca8e0c3961d4067d4e506c1368bd9", "score": "0.6871015", "text": "def update\r\n respond_to do |format|\r\n if @medical_history.update(medical_history_params)\r\n format.html { redirect_to @medical_history, notice: 'Historial medico actualizado con exito.' }\r\n format....
f30944ea2faec8ec4fbb1b483104e581
DELETE /foo8s/1 or /foo8s/1.json
[ { "docid": "201450abaf9ac20677d028c47dfe8cc3", "score": "0.66445535", "text": "def destroy\n @foo8.destroy\n respond_to do |format|\n format.html { redirect_to foo8s_url, notice: \"Foo8 was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" ...
[ { "docid": "179ff0053e8f4f967cb3d92206094cf0", "score": "0.7145617", "text": "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "title": "" }, { "docid": "d2f2b7e27bbbe134661361074c399275", "score": "0.65190303", "text": "def cmd_d...
4f0d1d5bd5f3e7ade2d05d5c58ec580f
Check if message is already acknowledged.
[ { "docid": "ae32817c4a5b303f4dd84a6cb8db8666", "score": "0.7116359", "text": "def acked?\n @acked ? true : false\n end", "title": "" } ]
[ { "docid": "faf2b11a5f60eccb457bf478fdd9eea9", "score": "0.75033695", "text": "def acknowledged?\n acknowledged\n end", "title": "" }, { "docid": "1e4568b538616b8e8b12204ba54a2a32", "score": "0.7386691", "text": "def acknowledged?\n !acknowledged_at.nil?\n end", "titl...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "c330e9e9adc790360e58ee7c011d621e", "score": "0.0", "text": "def parser_params\n params.fetch(:parser, {})\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whit...
f711222c683b27c5b29102b34ebadd11
METHODE 2 : calcul du nombre de calories pour un MENU (WELSH + FRITES + BIERES).......................................................................
[ { "docid": "3ed993355d49ce0b3bbd146e701fab2a", "score": "0.0", "text": "def meal_weight_watchers(hash)\n calories_count = 0\n hash.each do |k, v|\n v.each do |key, value|\n calories_count = value * CALORIES[key] + calories_count\n end\n end\n return calories_count\nend", "title": "" ...
[ { "docid": "edd78786050f75c99b99e7284773e4fb", "score": "0.6345707", "text": "def calories_burned(calories, menu)\n puts calories\n puts menu\nend", "title": "" }, { "docid": "b4e488c61f97ff9d658f3e72b75262c5", "score": "0.6282105", "text": "def get_num_staff_needed\n time_loc =...
28c6e3f6aa0a5aa6387f33929aa8f89d
shortcut method to get curve first point
[ { "docid": "622183bd61f3a0f23193e732accdf5a5", "score": "0.77428675", "text": "def firstpoint\n return self.pointlist()[0]\n end", "title": "" } ]
[ { "docid": "7b200bcb5bf371dcf22f29390f9303c7", "score": "0.7492239", "text": "def getStartPoint()\n shape().firstPoint() ;\n end", "title": "" }, { "docid": "e317a4c3a892dae8b83164003b08659a", "score": "0.7490913", "text": "def first_point\n self.points.first rescue ni...
ca4e32ec35bb9f00bf1b0bb05d07fc44
Return the default window parameters (x, y, width, height)
[ { "docid": "2ea9f26163c4ff4558a12b2009b464f3", "score": "0.69415843", "text": "def window_parameters\n [2, 2, 316, 64]\n end", "title": "" } ]
[ { "docid": "0b6818a9cf698dad60e0eec6e7f57034", "score": "0.7114207", "text": "def defaults()\n\t\t@height ||= 200\n\t\t@width ||= 350\n\t\t@title ||= \"Savable Settings Demo\"\n\t\t@text ||= \"Try changing the window size, title and text in this window. You will see that it saves its state \" +\n\t\t\t...
6a2acd63250e4142899d099070e82310
def method_missing Methods that start with `_' and don't end with `_'
[ { "docid": "9d6eaf6e0169b86dcf59d6a39802f254", "score": "0.0", "text": "def callable_methods\n methods.grep(/^_\\w+[^_]$/)\n end", "title": "" } ]
[ { "docid": "b5920e9860a9733b562b4b74380acfb1", "score": "0.7896498", "text": "def method_missing(methName) end", "title": "" }, { "docid": "b5920e9860a9733b562b4b74380acfb1", "score": "0.7896498", "text": "def method_missing(methName) end", "title": "" }, { "docid": "eebb...
7fdd6d03ffc64c5f25a90f8a05f58a03
Hashwith_indifferent_access was changing output objects
[ { "docid": "49fd1362593a096ab12776c7e903f93e", "score": "0.0", "text": "def test_outputs_are_not_mutated\n out = { \"foo\" => \"bar\" }\n op = ::SignupOp.new\n op.send :output, :perform_called, out\n value = op.perform_called\n assert_equal out, value\n assert_equal Hash, v...
[ { "docid": "b557c290643ff97115cd6db0da67c9cc", "score": "0.7892252", "text": "def awesome_hash_with_indifferent_access(object); end", "title": "" }, { "docid": "b557c290643ff97115cd6db0da67c9cc", "score": "0.78918254", "text": "def awesome_hash_with_indifferent_access(object); end", ...
8da3803090e232a6d9f8f9f6570aff7a
Write a program that solicits 6 numbers from the user, then prints a message that describes whether or not the 6th number appears amongs the first 5 numbers.
[ { "docid": "3bd34bdbc7315dc15c1d960ae45b409b", "score": "0.0", "text": "def prompt(string)\n puts \">> #{string}\"\nend", "title": "" } ]
[ { "docid": "bb3db933b2b899e2e4c402e8a37ac375", "score": "0.75505227", "text": "def solicit_5\n arr = []\n num_endings = ['1st', '2nd', '3rd', '4th', '5th', 'last']\n 6.times do |n|\n puts \"Enter the #{num_endings[n]} number:\"\n arr << gets.chomp.to_i\n end\n last = arr.pop\n if arr.include...