query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
f8b4d15a5a8b112370f4b8760c657317 | Parse the given binary data or hexadecimal string, and return a geometry object. The parse_hex method is a synonym, present for historical reasons but deprecated. Use parse instead. | [
{
"docid": "5ef09cdc8e61a561d5f4f716fa224d9d",
"score": "0.56432325",
"text": "def parse(data)\n data = [data].pack(\"H*\") if data[0, 1] =~ /[0-9a-fA-F]/\n @cur_has_z = nil\n @cur_has_m = nil\n @cur_srid = nil\n @cur_dims = 2\n @cur_factory = nil\n begin... | [
{
"docid": "f494bfcd5624e2372b55c7e88959729c",
"score": "0.6280067",
"text": "def initialize (geometry, data, type=nil)\n if ((type =~ /geos/) || (geometry.kind_of?( Geos::Geometry)))\n @geometry = geometry.clone\n elsif ((type =~ /hex/) || geometry =~ /\\A[0-9a-fA-F]+\\Z/io)\n \... |
8ef91f32c08344aa104df52fa6ebcc61 | Gets the activeChecklistItemCount property value. Number of checklist items with value set to false, representing incomplete items. | [
{
"docid": "16c41eea80ca1e4ded5e9615fbea39b1",
"score": "0.806643",
"text": "def active_checklist_item_count\n return @active_checklist_item_count\n end",
"title": ""
}
] | [
{
"docid": "8ee3abe9cabf7a9ea82e88436fff4eb8",
"score": "0.7728211",
"text": "def checklist_item_count\n return @checklist_item_count\n end",
"title": ""
},
{
"docid": "bcfca81b69d3b4a5255cf0b898e10853",
"score": "0.747712",
"text": "def active_checklist_ite... |
2f2e3976d64a099e3add4ff3ea6988a7 | PATCH/PUT /incidents/1 PATCH/PUT /incidents/1.json | [
{
"docid": "0746ee682d44fa25e5ce8a23aa287cdf",
"score": "0.0",
"text": "def update\n respond_to do |format|\n if update = @incident.add_update(change: incident_params, comment: params[:comment])\n notified_channels.each do |ch|\n ch.notify(update)\n end\n\n format.h... | [
{
"docid": "5b03bae749903fdff3cadad011c6ae96",
"score": "0.65559727",
"text": "def update\n respond_to do |format|\n if @incident.update(incident_params)\n format.json { head :no_content }\n else\n format.json { render json: @incident.errors, status: :unprocessable_entity }\n ... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "33abc2ddacbdda961293d98f4544afe0",
"score": "0.0",
"text": "def set_light_switch\n @light_switch = LightSwitch.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... |
0530ef625184cb33196c6b31236df0f7 | DELETE /categories/1 DELETE /categories/1.json | [
{
"docid": "14362df076250d7473f9cfd96d16d784",
"score": "0.0",
"text": "def destroy\n\t\t@category.destroy\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to categories_url, notice: 'Category was successfully destroyed.' }\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend",
"title": ... | [
{
"docid": "4142e7c3e1be82e432fdf951ae5785eb",
"score": "0.75578415",
"text": "def destroy\n @data = @category.delete(params[:id])\n render json: @data\n end",
"title": ""
},
{
"docid": "8e82257a38ec7abcdd74a59519238e96",
"score": "0.75373495",
"text": "def destroy\n Catego... |
8d45ff3b7e74840cc3942fa4f35cda38 | Construct an XML fragment representing the name | [
{
"docid": "19c808f5bbaf29e27bfcaae1f5ad72e2",
"score": "0.64695716",
"text": "def to_xml(xml=Builder::XmlMarkup.new)\n attributes = {'Format' => format}\n attributes['NameQualifier'] = name_qualifier unless name_qualifier.nil?\n attributes['SPNameQualifier'] = sp_name_qualifier unl... | [
{
"docid": "9b21c0f173d45a5336a4b33620ab3fd2",
"score": "0.6879304",
"text": "def name_string=(name)\n self.name = \"<?xml version='1.0' encoding='UTF-8'?>\"+\\\n '<root available-locales=\"en_US\" default-locale=\"en_US\"><name language-id=\"en_US\">%s</name></root>' % name\n end",
"ti... |
7ea2873ec455c4099ed00fdd92b8759a | Returns a list of all repositories | [
{
"docid": "bb529f8df15de45b675a19e5a95a1deb",
"score": "0.0",
"text": "def get_repositories_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: RepositoryApi.get_repositories ...'\n end\n # resource path\n local_var_path... | [
{
"docid": "88c5d60ceb82231048fce91c34f46f82",
"score": "0.8352182",
"text": "def get_repos\n @api.list_repositories\n end",
"title": ""
},
{
"docid": "c1d8b84cdd953834428828ff653f174b",
"score": "0.8277736",
"text": "def all_repos\n\t\tif GitHosting.multi_repos?\n\t\t rep... |
dca7a727b1fa1344157be088655168ab | Sorts cohort search results by last name | [
{
"docid": "3bf0b60420132adf47f0e04f6f13382d",
"score": "0.7240566",
"text": "def sort_by_last_name\n sort_by 'Last Name'\n end",
"title": ""
}
] | [
{
"docid": "77f4e9f8a29b553faa8f2ff92f3d25e7",
"score": "0.7535422",
"text": "def names_by_cohort\n\tputs \"This is the student database sorted by cohort month\"\n\t@students.sort_by! {|student| student[:cohort]}\n\tprint_student_list\nend",
"title": ""
},
{
"docid": "d791a53cb25e9c5211b604f... |
d5dd7baa0d28c10d0ff6b74ef2f89dbf | This is not a good practice is only for testing propose. Use an autogenerated id (using db features). | [
{
"docid": "76d02a866f1528b78ccbe3be710a4706",
"score": "0.0",
"text": "def last_id\n ADMINS.map {|user| user['id'] }.max + 1\n end",
"title": ""
}
] | [
{
"docid": "d590c21c74c1ac491125a6ce4cbcf96d",
"score": "0.7583028",
"text": "def id\n create unless created?\n @id\n end",
"title": ""
},
{
"docid": "d590c21c74c1ac491125a6ce4cbcf96d",
"score": "0.7583028",
"text": "def id\n create unless created?\n @id\n e... |
5a65cd7f974b061eba7ff83ba208b473 | Get a list of all circuit names If the storage backend does not support listing circuits, this may return an empty array. | [
{
"docid": "e7205f44dee024a44751023bdf1cd15c",
"score": "0.0",
"text": "def list\n raise NotImplementedError\n end",
"title": ""
}
] | [
{
"docid": "1eeb9bef37c29ae1d2c1a442f94cb240",
"score": "0.5543673",
"text": "def carrier_list\n Rails.cache.fetch('reconciliation_carriers') do\n Atlas::EnergyNode.attribute_set.select do |attribute|\n attribute.primitive == Atlas::NodeAttributes::Reconciliation\n en... |
1705fa179c0abb4ff71925e7aecb3fe1 | This can be added to the beginning of a test to verify that the box with the given name is available to a test. This will raise an exception if the box is not found. | [
{
"docid": "f18eda9da160c1ae544d0170583fad70",
"score": "0.83503777",
"text": "def require_box(name)\n if !File.exist?(box_path(name))\n raise ArgumentError, \"The tests should have a '#{name}' box.\"\n end\n end",
"title": ""
}
] | [
{
"docid": "c135746e8d347de5ef19a73a74b9e2c4",
"score": "0.691065",
"text": "def present?(box_name, provider)\n fetch(box_name, provider)\n true\n rescue Box::NotFound\n false\n end",
"title": ""
},
{
"docid": "059fbbf9f6f58825cd54c226faacbea9",
"score": "0... |
4671f87123af562146a46c3957f20d16 | def bearing tank.radar_heading end | [
{
"docid": "13e0cffd97de2c7e9309b4a49c4bb2c3",
"score": "0.0",
"text": "def convert(object)\n if object.respond_to?(:name) && object.name == tank.name\n nil\n elsif object.is_a?(RTanque::Bot::Radar::Reflection)\n Contact.new(object, Detector.new(tank))\n elsif object.is_a?(Contect)\n ... | [
{
"docid": "cb2a5bfa8c80e39ae3bcbbb3ec65f6aa",
"score": "0.741999",
"text": "def smart_radar_heading()\n #check if we're in a corner\n corner = closest_corner(position(now))\n if position(now) == closest_corner(position(now))\n if @point_of_interest.nil?\n ... |
dad3c05a7dbb037c01b495edd28497cf | GET /project_dates GET /project_dates.json | [
{
"docid": "91f236c37c887810feee88673c74a340",
"score": "0.75408447",
"text": "def index\n @project_dates = ProjectDate.all\n end",
"title": ""
}
] | [
{
"docid": "b8074b3c1aa502dc57e9fdfd674148d5",
"score": "0.74663496",
"text": "def date\n in_date = DateTime.strptime(params[:in_date], \"%m-%d-%Y\").beginning_of_day.utc\n out_date = DateTime.strptime(params[:out_date], \"%m-%d-%Y\").end_of_day.utc\n \n @projects = Project.on_dates(in_date,... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "ddd3bb77f5e2c4877b4d339454a09ec6",
"score": "0.0",
"text": "def set_qr\n @qr = Qr.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.6163163",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.6045976",
"text": "def action_hook;... |
eeac5fddf15f9505496fdda16f6bd580 | action to perform custom activity | [
{
"docid": "3d119c1b6957d3ff52e9488036fa0679",
"score": "0.5680079",
"text": "def action_custom_activity(input)\n token = input[:FromUserName]\n text_attrs = input[:Content].split('@')\n activity = WxCustomActivity.find_by_key_and_status(text_attrs[0],1)\n activity_log = WxActivityLog.find_b... | [
{
"docid": "7582386df8dface025c833b3c979eed8",
"score": "0.68476707",
"text": "def activity\n end",
"title": ""
},
{
"docid": "574c5b0b92296964dfeef720e6fa6265",
"score": "0.66164696",
"text": "def doActivity! machine, args\n _behavior! :doActivity, machine, args\n end",
... |
b51cf90166ba4740fbd2618f996c58d8 | given an array of stock prices (0th = day 1, 1st = day 2, etc..) pick the optimal day to buy a stock and then sell it return [buy_date, sell_date] | [
{
"docid": "58912c3c43e090b733cf32cc0a758fcc",
"score": "0.80276495",
"text": "def stock_picker ( stock_prices )\n #manual searching ? or fancy smancy ruby methods...\n best_profit = 0\n buy_date = -1 #my compiler won't run this without buy_date and sell_date being declared locally to the functio... | [
{
"docid": "b77b9d50d3d33a972c68c4226710cbf1",
"score": "0.851259",
"text": "def stock_picker ( prices )\n gains = Array.new( prices.length ) # buy date is index of each array + 1 \n sell_dates = Array.new( prices.length ) # best day to sell\n diffs = Array.new( prices.length )\n\n prices_sub = [Arr... |
286b5f039877cd0c11198135c50d12f6 | Allows to check if a value at the given index exists | [
{
"docid": "0bb74d6a5ed4e2a8007c139cb2d8a5d6",
"score": "0.73423487",
"text": "def exists?(index)\n !encoded[index].nil? && encoded[index].exists\n end",
"title": ""
}
] | [
{
"docid": "d14a12983a95cfa0097809d594c2fd2d",
"score": "0.75547725",
"text": "def exists?(index)\n encoded[index].exists\n end",
"title": ""
},
{
"docid": "f3544ad880ffb78c4750624686bae1d5",
"score": "0.749265",
"text": "def exists?(index)\n @pool.key?(index)\n e... |
5ceabfd0362d4a0b5df8b758a94476e4 | PATCH/PUT /wordpresses/1 PATCH/PUT /wordpresses/1.json | [
{
"docid": "98c92716798d88ecf7f6986369517ea9",
"score": "0.0",
"text": "def update\n respond_to do |format|\n if @wordpress.update(wordpress_params)\n format.html { redirect_to @wordpress, notice: 'Wordpress was successfully updated.' }\n format.json { render :show, status: :ok, lo... | [
{
"docid": "34f570c5b0dca5507fa071fe1e287626",
"score": "0.6608045",
"text": "def update\n\t\t\t\t@word = Word.update(params[:word][:id], params[:word])\n\t\t\t\trender json: @word\n\t\t\tend",
"title": ""
},
{
"docid": "abf9ff08951f0a9be2b2ed67a2cabfa1",
"score": "0.6502153",
"text"... |
0e533cc87a030611ca90ccbfe168d43f | Stringrstrip! str.rstrip! => self or nil Removes trailing whitespace from _str_, returning +nil+ if no change was made. See also +Stringlstrip!+ and +Stringstrip!+. " hello ".rstrip => " hello" "hello".rstrip! => nil | [
{
"docid": "550615ad487959f18f4086d10b23a023",
"score": "0.63254446",
"text": "def rstrip!\n end",
"title": ""
}
] | [
{
"docid": "a6292a24224a1a60ec0883df7798828f",
"score": "0.76688313",
"text": "def rstrip\n str = dup\n str.rstrip! || str\n end",
"title": ""
},
{
"docid": "0c733cee905009cd4c51891fb774b032",
"score": "0.76522774",
"text": "def rstrip(str)\n str.rstrip\nend",
"title": ""... |
ebbc6cde6c93a7e7a0e1372ab1cea97b | Return a valid boolean operator used for the the description, if the boolean operator is not set then default to "all" (i.e., AND) | [
{
"docid": "a6689d0a6facd0e62096b4b4ae6807fe",
"score": "0.6919396",
"text": "def validate_boolean_opr(params = {})\n default_boolean_opr = \"all\"\n \n case params[:boolean_opr]\n when nil?\n boolean_opr = default_boolean_opr\n when \"all\", \"any\", \"... | [
{
"docid": "d576eecaaed92581a9bde046764900a4",
"score": "0.70302516",
"text": "def has_operator? str\n str =~ /(AND|OR|NOT)/\n end",
"title": ""
},
{
"docid": "ed298fae6d688a442f15e4b5f0bb9da4",
"score": "0.7014089",
"text": "def op\n @op.andand.to_sym\n end",... |
e6f05485a55f5021921dd33aa550d8f5 | Sends a notice to the student telling him that he is late returning the equipment. | [
{
"docid": "6960442408c6e0c1a6bbb69cc742a972",
"score": "0.7490994",
"text": "def send_late_notice!\n puts \"Sending late notice to student (Reservation ##{id_s})\" \n send_student_email!(LATE_NOTICE_EMAIL_TEMPLATE)\n end",
"title": ""
}
] | [
{
"docid": "2b33497a6cf03a1adda4258be87d9252",
"score": "0.67892885",
"text": "def system_notice\n flash.now[:alert] = \"The Virtual Microscopy system will be offline for scheduled maintenance on \n Friday, May 9 from approximately 1:00pm-1:45pm CDT.\"\n end",
"title": ""
},
{
"docid"... |
92af4a662d4760f1e9c32e4d62db4988 | DELETE /boards/1 DELETE /boards/1.json | [
{
"docid": "d43939447483069fa97d2bb983350d76",
"score": "0.0",
"text": "def destroy\n @board.destroy\n redirect_to boards_path(@board.id), notice: 'Task was successfully destroyed.' \n end",
"title": ""
}
] | [
{
"docid": "bd783a6a6c1b11a5c105a42c468cedff",
"score": "0.77836585",
"text": "def destroy\n @multi_board = MultiBoard.find(params[:id])\n @multi_board.destroy\n\n respond_to do |format|\n format.html { redirect_to multi_boards_url }\n format.json { head :no_content }\n end\n end"... |
05e8041ca174c3f71c8729948da5d374 | GET /tipo_items/new GET /tipo_items/new.xml | [
{
"docid": "f9b5e073e4485790d66a8d535e732202",
"score": "0.80191076",
"text": "def new\n @tipo_item = TipoItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tipo_item }\n end\n end",
"title": ""
}
] | [
{
"docid": "6468533c2e42c97ae0a61163e1c0d9b1",
"score": "0.7481123",
"text": "def new\n @tipos = Tipo.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tipos }\n end\n end",
"title": ""
},
{
"docid": "1572043787fb1ce6cc13d4a754584bc... |
3bfd51c33d22508947f122fffa1e350a | GET /basket_items GET /basket_items.json | [
{
"docid": "60ba7a92294fd0b247e606fa48c4ae08",
"score": "0.72755927",
"text": "def index\n @basket_items = BasketItem.all\n end",
"title": ""
}
] | [
{
"docid": "1df756e0ac0d01aaad05bf58b676bf0c",
"score": "0.73248523",
"text": "def show\n @basket_item = BasketItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @basket_item }\n end\n end",
"title": ""
},
{
"docid... |
d6ad3285197dd1c258939fa21fd9501c | end of function Sorts our database and puts it in a list. Still needs work. Not finished. | [
{
"docid": "48c92347bd240d3daa218773b96fc336",
"score": "0.56630623",
"text": "def sortDota()\n ordered_list = HeroCountersModel.order(:name)\n puts ordered_list\n end",
"title": ""
}
] | [
{
"docid": "7ca6076ee6789723409405dbca44168a",
"score": "0.6988048",
"text": "def sort_data\n store.sort_data!\n end",
"title": ""
},
{
"docid": "b66eefef3423b43e3a85240c573376d9",
"score": "0.6934541",
"text": "def sort_entries; end",
"title": ""
},
{
"docid": "6... |
bdce9f360693f9a6df044d0580694b7b | ok when valid subcommand given with valid params | [
{
"docid": "6785216f08f5971fa4800705d82bba35",
"score": "0.7132139",
"text": "def test_subcommand_ok\n @p.parse(%w(list --all))\n @p.parse(%w(create --partial --name duck))\n end",
"title": ""
}
] | [
{
"docid": "5f72823085812c258f75ff601896d213",
"score": "0.7671934",
"text": "def test_subcommand_invalid_subopt\n assert_raises_errmatch(OptimistXL::CommandlineError, /unknown argument '--foo' for command 'list'/) do\n @p.parse(%w(list --foo))\n end\n assert_raises_errmatch(OptimistXL::Co... |
ab5ac619ef9fa7bccf160c2dd43d3c76 | GET /id_seqs/1 GET /id_seqs/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "9ecb60f4aade2f6a0aa4ab77c8393552",
"score": "0.6458624",
"text": "def index\n @seqs = Seq.all\n end",
"title": ""
},
{
"docid": "e68f64afb472e9144af70dc214e432c5",
"score": "0.6355407",
"text": "def index\n @sequents = Sequent.all\n\n respond_to do |format|\n ... |
9d57325a665f5713349fac7105056a7a | This is the view for customers to see a developer's profile | [
{
"docid": "a57fbc1238ab1abd7b870e4f4d1be7cd",
"score": "0.0",
"text": "def profile\n @conversation = Conversation.new\n render 'profile'\n end",
"title": ""
}
] | [
{
"docid": "7c7c4b01aad79247d5f46efdc11a104d",
"score": "0.75273687",
"text": "def show\n @user_profile = current_user.user_profile\n end",
"title": ""
},
{
"docid": "74c132bebf6498ff591472937ac43b04",
"score": "0.74578226",
"text": "def show\n @user = current_user\n @profi... |
441a5d139bf613be52d6262d5d11ff3f | Checks to see if the given port is open for TCP connections on the given host. If a gateway is provided in the ssh options, then return true if we can connect to the gateway host. If no gateway config is found then just verify we can connect to the destination host. | [
{
"docid": "a8c168fc4389b4c99e0e7ea073bcd558",
"score": "0.7993667",
"text": "def connector_port_open?(host, options = {})\n options[:ssh] ||= Hash.new\n options[:ssh][:port] ||= HostConnector::SSH::DEFAULT_PORT\n\n if options[:ssh][:gateway]\n gw_host, gw_port, ... | [
{
"docid": "5e458e80f9ee3979a6aa6aba1d403b1a",
"score": "0.72435904",
"text": "def open_port?(host, port, timeout = 5)\n return false if host.to_s.empty?\n true if ::Socket.tcp(host, port, connect_timeout: timeout)\n rescue *RESCUE_EXCEPTIONS_ON_ESTABLISH\n false\n end",
"title"... |
002312a5db4c364c1e6655aa6b0f710f | Remove item from certain category | [
{
"docid": "cbbd567d35ef7c21f836607344c1211e",
"score": "0.68798804",
"text": "def unfollow!(other_category)\n self.cate_item_associations.find_by_category_id(other_category.id).destroy\n end",
"title": ""
}
] | [
{
"docid": "624d5cb4d0bdaaf9f70bdecbeb0d9b14",
"score": "0.7406429",
"text": "def remove_category(category)\r\n OpportunityCategory.find_by(id: opportunity_id, category: category).destroy\r\n end",
"title": ""
},
{
"docid": "61d41ae4d0fbf1a346e33fea106589b7",
"score": "0.72502667",
... |
f4cd3efd46900600a71dd32569b80d7a | Returns comment (if any). | [
{
"docid": "561a819e50b14ba6208caea6c2e593d6",
"score": "0.7437994",
"text": "def comment\n if @data['comment']\n @data['comment']\n else\n @data['comment'] = field_fetch('*')\n end\n end",
"title": ""
}
] | [
{
"docid": "31057b4a94daef907ff3b194a9d70e3b",
"score": "0.8161443",
"text": "def comment\n @comment || \"\"\n end",
"title": ""
},
{
"docid": "134c923f88081746ef5618a6a292c24f",
"score": "0.7897551",
"text": "def comment\n @info[:comment]\n end",
"title":... |
ba8a35ca29641324626a13e8727a8965 | GET /faculties/1 GET /faculties/1.json | [
{
"docid": "55547fc2f372fb70f5a96c87561deab2",
"score": "0.7277277",
"text": "def show\n @faculty = Faculty.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @faculty }\n end\n end",
"title": ""
}
] | [
{
"docid": "a09aaedf005fc1c849cc82dc1b2209f4",
"score": "0.72843945",
"text": "def show\n @facility = Facility.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @facility }\n end\n end",
"title": ""
},
{
"docid": "42f9... |
8fd1674c1e14acc8363ceaed81d513a4 | No real connects I know, duplication, right? just lazy. | [
{
"docid": "b37ddd7fe4f832addcf9ee8d4ea449d2",
"score": "0.0",
"text": "def stub_single_response(object)\n FakeWeb.register_uri(:get, %r|http://test\\.local/dummies/#{object.id}|, :body => { :dummy => object.to_hash }.to_json, :content_type => 'application/json')\n yield\n FakeWeb.clean_registry\nend... | [
{
"docid": "d0c7dcdeb00aef8141fa9894477d5488",
"score": "0.6339652",
"text": "def connections; end",
"title": ""
},
{
"docid": "2a8894f9f87985e52a8e20c730416237",
"score": "0.6332098",
"text": "def connect(*) end",
"title": ""
},
{
"docid": "777df86f0acfa948c445e23b301b1c... |
dc8013346738a979a63497cdf3a72b0f | Precondition: theArray is an array of numbers Output: the average of the values in theArray Begun by: Dr. Adams, for CS 214 at Calvin College. Completed by:: Charles Blum Date: 30 March 2014 sum() sums the values in an array Receive: anArray, an array of numbers Return: the sum of the values in anArray. Define sum() me... | [
{
"docid": "cdc5184763373f532749c9285036021d",
"score": "0.0",
"text": "def sum(someArray)\n total = 0.0\n someArray.each { |a| total += a }\n total\nend",
"title": ""
}
] | [
{
"docid": "4dd3b5d516fc3d45f3814bf438ae55c5",
"score": "0.8065925",
"text": "def average(array)\n\n # How to add not using the reduce/inject methods\n # sum = 0\n # array.each { |el| sum += el }\n # sum\n\n # Here we add up each element of the array using the #reduce method\n #sum = array... |
9410b777ebea03d430884fa25d67b9c5 | Create a new FunctionStruct instance | [
{
"docid": "45ec69816c51b1face53dbf62ed0f29a",
"score": "0.0",
"text": "def initialize(f_name = nil, *args)\n super()\n @_fn_name = f_name.to_s\n @_fn_args = args\n @_fn_args.map! do |l_arg|\n if l_arg.is_a?(_klass)\n l_arg = l_arg._root\n l_arg._parent(self)... | [
{
"docid": "4e438f0779f7d49a5f35b47c2f9bb150",
"score": "0.6730903",
"text": "def new_function(header, parameters = nil, return_type, quad_number) #method\n @functions[header] = ObjectFunction.new(header, parameters, return_type, quad_number)\n end",
"title": ""
},
{
"docid": "8617b4dd01... |
e12db04050b507d2d896e55f8752956b | === Sessionrelated helpers === | [
{
"docid": "35179b0f15012aee0e9f3228fb8ff444",
"score": "0.0",
"text": "def session\n env['rack.session'] ||= {}\n end",
"title": ""
}
] | [
{
"docid": "866c51f6d858fec6004532b66a8a2d55",
"score": "0.82790834",
"text": "def session; end",
"title": ""
},
{
"docid": "866c51f6d858fec6004532b66a8a2d55",
"score": "0.82790834",
"text": "def session; end",
"title": ""
},
{
"docid": "866c51f6d858fec6004532b66a8a2d55",... |
3b4c03b17eea01ffda96dde87911ac52 | 'shorten' method cuts string length. | [
{
"docid": "0520499d16aa75b35dd3f211f8ad95d9",
"score": "0.6191998",
"text": "def shorten( str, length = 120 )\n\tmatched = str.gsub( /\\n/, ' ' ).scan( /^.{0,#{length - 2}}/ )[0]\n\tunless $'.empty?\n\t\tmatched + '..'\n\telse\n\t\tmatched\n\tend\nend",
"title": ""
}
] | [
{
"docid": "fae038b176f2c78d0f846e0380804c97",
"score": "0.6752554",
"text": "def smart_truncate(len = 30, ending = '...')\n len = Math.max(len, 5)\n return self if self.length <= len\n s = self[0...(len-2)].reverse\n bits = s.split(/[\\s\\-,]/,2)\n s = bits.length == 2 ? bits[1] : bits[0... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "b28cd15d25f7345e6a742769e4e58edd",
"score": "0.0",
"text": "def peinture_params\n params.require(:peinture).permit(:photo, :nom, :auteur, :date)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7496729",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6958585",
"text": "def strong_params\n params.require(:request).permit(param_white... |
3ec76858df9779ee22291007dec7905b | depends_on "cmake" => :build | [
{
"docid": "0e402c59dd8fac77d1c064741b8c9326",
"score": "0.0",
"text": "def install\n prefix.install \"testfile.txt\"\n system \"bash\", \"install.sh\"\n system \"make\", \"install\"\n end",
"title": ""
}
] | [
{
"docid": "3ad500f8dff0f174c703d9d5858b59fd",
"score": "0.68379843",
"text": "def cmake_package(name, workspace: Autoproj.workspace)\n package_common(:cmake, name, workspace: workspace) do |pkg|\n pkg.depends_on \"cmake\"\n common_make_based_package_setup(pkg)\n yield(pkg) if bl... |
6d8e0f428ff79878c2efdfdf12dbc149 | say something nice, you goof! something sweet. | [
{
"docid": "c52e57735ec67fa12860b370ccbc938a",
"score": "0.0",
"text": "def index\n redirect_to(:action => 'signup') unless logged_in? or User.count > 0\n end",
"title": ""
}
] | [
{
"docid": "74404060e8bd12121a30d746fb6703a1",
"score": "0.785351",
"text": "def say_that_thing_you_say\n \"#{self.name} always says: #{self.catchphrase}\"\n end",
"title": ""
},
{
"docid": "49c61dd868bc11ff348be94f8ffbde3f",
"score": "0.78429645",
"text": "def say_that_thi... |
54ab9f0de2cae84661314e0ce04e422f | Test 4: Close Flag Media Inline Comment | [
{
"docid": "2916a9a3f527fa0b8cfd8cc47b1a2b2e",
"score": "0.74495596",
"text": "def test04_pre_open_blog_CancelFlagMediaDialog\n\t\tcreate_article_1jpeg_wGroup \"Article post from close flag comment #{random}\"\n\t\tsleep 4\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\t\tsleep 4\n\t\tcommentCloseFl... | [
{
"docid": "1f6070f052ef2dc5e5bd5472eaeb5fc3",
"score": "0.7580088",
"text": "def test04_pre_closed_blog_CancelFlagMediaDialog\n\t\tcreate_article_1jpeg_wGroup \"Article for close flag comment #{random}\"\n\t\tsleep 4\n\t\tcommentPopSubmit \"Blog Note Comment for close flag #{random}\"\n\t\tsleep 4\n\t\... |
18d9decca3950b1977df178a2a2116ea | DELETE /users/1 DELETE /users/1.xml | [
{
"docid": "c09952111ed754a73c29fd13d1c536df",
"score": "0.0",
"text": "def destroy\n @user = User.find(params[:id]) or raise ActiveRecord::RecordNotFound\n auctions = Auction.find_all_by_seller_id(@user)\n purchases = Auction.find_all_by_buyer_id(@user)\n unless auctions.size > 0\n unl... | [
{
"docid": "f2aa64556d41c1306c893cf55febd02e",
"score": "0.7177572",
"text": "def delete\n @user = User.find(params[:id])\n @user.rvsps.delete_all()\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
... |
592946f0ef45914eb70c83a322013894 | _unserialize_data is a private method and should not be called directly. Currently only supports Marshal.load() to unserialize data. | [
{
"docid": "b0c02a8ce6984f105e694e9c9db650d2",
"score": "0.6979123",
"text": "def _unserialize_data(store_tempfile)\n retval = 0\n\n if @serialize_as == \"marshal\"\n begin\n to_obj = String.new()\n\n f = File.new(store_tempfile, \"rb\")\n ... | [
{
"docid": "95dac5a8296c8335621e594db07e3817",
"score": "0.77434313",
"text": "def deserialize data\n Marshal.load data\n end",
"title": ""
},
{
"docid": "5186c190761b02df84e03461f8839662",
"score": "0.7572997",
"text": "def deserialize(data)\n Marshal.load(data)... |
28d8130e0a3c6ed4f50073fa6faa2fae | sum all RGB values in a row | [
{
"docid": "87a46e21782efca5e585ef7d55876498",
"score": "0.0",
"text": "def transpose_rows\n array = self.create_rows\n array.map do |row|\n row.transpose\n end\n end",
"title": ""
}
] | [
{
"docid": "58942ced73f1fc471ba04c058f50639f",
"score": "0.65180546",
"text": "def row_sum_all\n total = 0\n @characters.each { |i| total += row_sum(i) }\n total\n end",
"title": ""
},
{
"docid": "b0f140f0ebcd8113c513cc553792ae8c",
"score": "0.64641696",
"text": "def rowsum... |
b9aa79399f3ad7429bbe5f05f7097a59 | execute out mutation code that is specific to RecipeCreatedMutation | [
{
"docid": "c0b226418d9f4003a63f5036487eaf52",
"score": "0.67261255",
"text": "def execute(*args)\n puts 'running mutation business logic'\n puts \"name = #{name}\"\n puts \"The Recipe is #{recipe&.name}\"\n\n # Do other logic\n\n end",
"title": ""
}
] | [
{
"docid": "3b6c4f310a9d1717cee00697f912daf9",
"score": "0.5466088",
"text": "def action_run\n status = @recipe_helper.run(@new_resource.name, @new_resource.tags, @new_resource.attributes, @new_resource.match_all)\n Chef::Log.info \"Recipe executed '#{new_resource.name}' status:#{status}\"... |
5de97288d1ab32b8bee6cb90ee5141a4 | For some fields we need to sum the under_care numbers with the LTFU numbers to support the "include LTFU" toggle in reports. | [
{
"docid": "9f0597bebbdd959b910f7018d94d2b31",
"score": "0.6725356",
"text": "def under_care_with_ltfu(field)\n Arel.sql(<<-EOL)\n SUM(COALESCE(#{field}_under_care::int, 0) + COALESCE(#{field}_lost_to_follow_up::int, 0)) as sum_#{field}_under_care_with_lost_to_follow_up\n EOL\n end",... | [
{
"docid": "fd26a69cdb881c28604f25d710c5ec86",
"score": "0.5899701",
"text": "def anger_bonus;features_sum(:anger_bonus);end",
"title": ""
},
{
"docid": "359d892d338ab493151b7b31d24105c6",
"score": "0.5768525",
"text": "def calc_total_credit\n if self.plus_percentage > 0\n # ... |
af3d4c9182d7127ef901316a346a5106 | Returns an array containing all wire real/wreal declaration AST nodes, which have been declared as part of a module definition, returning something like this: [ s(:net_declaration, "real", "vdd")), s(:net_declaration, "real", "vddf")), ] | [
{
"docid": "5a49cbbc21979c98a627ce726206d08e",
"score": "0.6539778",
"text": "def wreals\n find_all(:non_port_module_item)\n .map { |item| item.find(:net_declaration) }\n .compact\n .select { |net| net.find(:real) }\n end",
"title": ""
}
] | [
{
"docid": "1ea3b3d541399137236f670d2ef50ebc",
"score": "0.6330121",
"text": "def declarations\n slice(index(:__ds)+1..index(:__de)-1)\n end",
"title": ""
},
{
"docid": "f0e5c7896c8a22ed87b4ff52c9857c14",
"score": "0.6184281",
"text": "def declarations\n declarations = []\... |
6c6cf1c4c0f71040551decb9244f7c08 | ActiveRecord Query for all the admins, condense them into "emails" variable joining them with a comma so the email is sent to all the admins | [
{
"docid": "63cede8618a73e71ab582523a2284f2a",
"score": "0.0",
"text": "def low_funds(coin)\n @coin = coin\n @admins = User.where(admin: :true)\n emails = @admins.collect(&:email).join(\",\")\n mail(to: emails, subject: \"Low funds for #{@coin.name}\")\n end",
"title":... | [
{
"docid": "f0f81f35625e7de4437d844b962d324f",
"score": "0.77534753",
"text": "def admin_emails\n store_admins = store_administrators.collect(&:email)\n system_admins = SystemAdmin.all.collect(&:email)\n store_admins + system_admins\n end",
"title": ""
},
{
"docid": "159b946cfca870... |
e34393ed7b3fdb60515a27e74d969e4a | POST /project_states POST /project_states.xml | [
{
"docid": "1c37148fcb2078009a741cfd5d48bc32",
"score": "0.6979991",
"text": "def create\n @project_state = ProjectState.new( params[:project_state] )\n\n respond_to do |format|\n if @project_state.save\n flash[:notice] = 'ProjectState was successfully created.'\n format.html { ... | [
{
"docid": "b5385aa7de743989dc7160860ce2ed82",
"score": "0.6778821",
"text": "def create\n @project_state = ProjectState.new(params[:project_state])\n\n respond_to do |format|\n if @project_state.save\n format.html { redirect_to(@project_state, :notice => t(\"screens.notice.successfull... |
3bbd09687bd2c6ecc45d28d440fcf487 | GET /bar46s/1 or /bar46s/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "ec0f1c892cb0336e9a00d9e29f0f3a0f",
"score": "0.6325865",
"text": "def get(path)\n begin\n response = client[path].get :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end",
"title": ""
},
{
"docid": "dd341... |
8314b78d03bf1e6ff19e6c897a384961 | id string for dotfile creation | [
{
"docid": "a77db023f3c355ff87055e8eefb437ab",
"score": "0.0",
"text": "def node_id\n \"t#{tid}\"\n end",
"title": ""
}
] | [
{
"docid": "dabf4d52ed40c6efb3820e745963f9e3",
"score": "0.72742724",
"text": "def id_for_filename\n n = @id\n cnt = 0\n while n > 0\n n /= 10\n cnt += 1\n end\n dict = ''\n return sprintf(\"%s%s%s\",dict, '0' * (3 - cnt), @id)\n end",
"title": ""
},
{
"docid": "... |
c72da1c7d0b224bd0c80bb58032fb678 | Write a method count_e(word) that takes in a string word and returns the number of e's in the word My first solution: | [
{
"docid": "42da7645623b8ec6a5b13c9660921375",
"score": "0.86812955",
"text": "def count_e(word)\n letter = 'e'\n i = 0\n count = 0\n while i < word.length\n if word[i] == letter\n count += 1\n end\n i += 1\n end\n return count \nend",
"title": ""
}
] | [
{
"docid": "2bae96a42bca137cd5c334cdf7fe2eb5",
"score": "0.92541236",
"text": "def count_e(word)\n puts word.count('e') \nend",
"title": ""
},
{
"docid": "3b2bcd73b8468c26dc1b1bc2e6b2065b",
"score": "0.89880395",
"text": "def count_e(word)\n\n\tcount = 0 # Count variabe tracks the n... |
bb3bdb2341b8a9ab61abed1b59c2c5d6 | could also use start += 1 (which would work the same way; can also use other functions like , . /) METHODS (same as JS takes an input and puts an output) | [
{
"docid": "d4e79fe62a27be08ecac159f9e737095",
"score": "0.0",
"text": "def square(a) # similar to JS functions\n\ta * a\nend",
"title": ""
}
] | [
{
"docid": "adc488ca674654c61ac12f8e8dd9bfc9",
"score": "0.6951515",
"text": "def start( end_number )\n $o_count += 1\n current_number = 0\n\n while current_number < end_number\n dive( current_number, 0 )\n current_number += 1\n end\nend",
"title": ""
},
{
"docid": "6fdd9250ea0d34c... |
541eea978ae85673152e3eb01721761a | override to return the value of the SugarCRM record's attributes | [
{
"docid": "ea82baa9ef15bd419bd35322ea18f625",
"score": "0.0",
"text": "def instance_variable_get(name)\n name = name.to_s.gsub(/^@/,'')\n @attributes[name]\n end",
"title": ""
}
] | [
{
"docid": "64cfc493ca5694db12a67560444d9580",
"score": "0.72551674",
"text": "def read_attribute_value()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "25879246cbcd5b4238f175d7f9baa189",
"score": "0.7174311",
"text": "def attribute_... |
f3b96f1e7a9847da0b37a37ed852de3b | Detects in corresponding order the roots of the successive, leftmost, full binary subtrees of maximum (and thus decreasing) length, whose lengths sum up to the provided argument. Detected nodes are prepended with a sign (+1 or 1), carrying information for subsequent generation of consistency proofs. | [
{
"docid": "72b4a5425d9bcfb4314088484b254386",
"score": "0.0",
"text": "def principal_subroots(sublength)\n raise NoPrincipalSubroots if sublength.nil? || sublength < 0\n\n principal_subroots = []\n powers = Helper.decompose(sublength)\n start = 0\n powers.each do |power|\n ... | [
{
"docid": "932a1d0d72954d088cb63d23648f11af",
"score": "0.63507974",
"text": "def longest_univalue_path(root)\n\n #bfs, when hit a node, go down\n\n return 0 if root.nil?\n\n best_length = 0\n node_queue = [root]\n until node_queue.empty?\n current_node = node_queue.shift\n next if current_n... |
e5d5edfa29023f256e1534fc7cd129f6 | registration is a hash containing the valid sreg keys given above use this to map them to fields of your user model | [
{
"docid": "e263cb12da023fb8c56e0fe74434613b",
"score": "0.0",
"text": "def assign_attributes_hash\n return {}\n end",
"title": ""
}
] | [
{
"docid": "6f269db6181f7497322f77aadd80e021",
"score": "0.7537362",
"text": "def model_to_registration_mapping\n {:name => 'fullname', :email => 'email'}\n end",
"title": ""
},
{
"docid": "bf73dc0a45fafbaa94ea932a7f813b50",
"score": "0.71125984",
"text": "def assign_registration... |
e97d0e18c612f86c840fe21d533c48f0 | DELETE /loans/1 DELETE /loans/1.json | [
{
"docid": "819e6e09065d9453e2c2bfa854d52623",
"score": "0.67767316",
"text": "def destroy\n @loan.destroy\n respond_to do |format|\n format.html { redirect_to loans_url, notice: 'Loan was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}... | [
{
"docid": "6c6739e9318eae080db0ef1fbc160be5",
"score": "0.7132709",
"text": "def destroy\n @on_loan = OnLoan.find(params[:id])\n @on_loan.destroy\n\n respond_to do |format|\n format.html { redirect_to on_loans_url }\n format.json { head :no_content }\n end\n end",
"title": ""... |
9c977b7f8179bbebcf0a258f72046550 | DELETE /m_questions/1 DELETE /m_questions/1.json | [
{
"docid": "e7a2f8545a1bcb02adab4c8e6ab892c5",
"score": "0.7735181",
"text": "def destroy\n @m_question.destroy\n respond_to do |format|\n format.html { redirect_to questions_path }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] | [
{
"docid": "e030cbcfdf71c561a228839806401f6e",
"score": "0.7753904",
"text": "def destroy\n render json: question.destroy!, status: :ok\n end",
"title": ""
},
{
"docid": "4c030fd877841d54a2d621a7e7d9c0f5",
"score": "0.77009827",
"text": "def destroy\n @question = Question.find... |
f588ac10f91c69ef9f7815d008637c71 | Forward ports from hash | [
{
"docid": "6a1530db03acca72b2ac4d83f9769cdf",
"score": "0.59071",
"text": "def forward_ports(vagrantfile, ports)\n return if ports.nil?\n ports.each do |pgroup|\n forward_port vagrantfile,\n pgroup['guest'],\n pgroup['host'],\... | [
{
"docid": "be51d6779e81924ff8b5958d7366aee5",
"score": "0.6601752",
"text": "def port_forward(host_port)\n\t\tpf_desc = '%s,tcp,,%s,,%s' % [SSHPF, host_port, SSHPort]\n\t\tmanage('modifyvm', @name, '--natpf1', pf_desc)\n\t\t@port = host_port\n\tend",
"title": ""
},
{
"docid": "42f4dff1978d0... |
fc21dc480ad65bd5a963a280de55fd4d | Test that encoding a hash works. | [
{
"docid": "7831366007b5a1281f3dd9e864784b6c",
"score": "0.8023343",
"text": "def test_encode_hash()\n input = {'three' => 3, 'two' => 2, 'one' => 1}\n expected = [\n 131, 108, 0, 0, 0, 3, 104, 2, 107, 0, 3, 111, 110, 101, 97, 1,\n 104, 2, 107, 0, 5, 116, 104, 114, 101, 101, 97, 3, 104, ... | [
{
"docid": "af984c86e7114d5fe8dd19142d11e74d",
"score": "0.76138973",
"text": "def test_check_hash_pass\n sim = VerifierSimulator.new\n assert_equal true, sim.check_hash('1c12', '1c24')\n end",
"title": ""
},
{
"docid": "62907e11027cfbb42be2452e9691a16c",
"score": "0.7544973",
... |
7123fa401952984786b5fef2ac073c57 | POST /ptschedules POST /ptschedules.xml | [
{
"docid": "46ace082ba74c82f98469d622013e007",
"score": "0.70892125",
"text": "def create\n @ptschedule = Ptschedule.new(params[:ptschedule])\n\n respond_to do |format|\n if @ptschedule.save\n flash[:notice] = 'Ptschedule was successfully created.'\n format.html { redirect_to(@p... | [
{
"docid": "edc9ba856d180fd3f81fe90f9c480c69",
"score": "0.6975272",
"text": "def schedule(params = {})\n post @endpoint, params\n end",
"title": ""
},
{
"docid": "589740a86f4af51f3004edd516c70d76",
"score": "0.69244635",
"text": "def schedule(params = {})\n post @endpoint... |
799bbe7308c6a0e0aba073c40c8540fc | Subscribe to the channel under test. Optionally pass subscription parameters as a Hash. | [
{
"docid": "fda3add3598693ab187e6c9ce61cb219",
"score": "0.7909878",
"text": "def subscribe(params = {})\n @connection ||= stub_connection\n @subscription = self.class.channel_class.new(connection, CHANNEL_IDENTIFIER, params.with_indifferent_access)\n @subscription.singleton_c... | [
{
"docid": "5c1a787f5b54329c671837a932caa5ad",
"score": "0.73263043",
"text": "def subscribe(channel, data = {})\n log_to_file(\"#{self.class} tries to subscribe to channel #{channel} with #{data.inspect}\")\n send_action('subscribe', channel, data)\n end",
"title": ""
},
{
"do... |
2422b479380e977a577325ed00da2fa0 | output a line (support formats) | [
{
"docid": "1068b6308c22fac30f0c977dff56732e",
"score": "0.0",
"text": "def output(form, *args)\n if args.length == 0\n puts form\n else\n puts format(form, *args)\n end\n end",
"title": ""
}
] | [
{
"docid": "1b3a0cd911dda8918b78e75398a59b87",
"score": "0.824672",
"text": "def output_line(line)\n puts line\n end",
"title": ""
},
{
"docid": "1b3a0cd911dda8918b78e75398a59b87",
"score": "0.824672",
"text": "def output_line(line)\n puts line\n end",
"title"... |
2fe571f487918fc42dd09ed45647623d | End of Turn Processing on Map Screen | [
{
"docid": "427e1b40940dab69c855baf32bf0088a",
"score": "0.7509088",
"text": "def turn_end_on_map\n on_turn_end\n perform_map_damage_effect if @result.hp_damage > 0\n end",
"title": ""
}
] | [
{
"docid": "b25afb3ace3beec08c1ddc515e298666",
"score": "0.71532685",
"text": "def call_map\n $game_temp.next_scene = nil\n battle_end(1)\n end",
"title": ""
},
{
"docid": "c850fc284c43b47962e116e73348f1fb",
"score": "0.70832306",
"text": "def turnEnd()\n @isActive = fa... |
424525750fcef1e64946bff4ea872104 | Feel free to google "how to generate a random number in ruby" | [
{
"docid": "b399d3d6191f39c1e8cd67e13523dd37",
"score": "0.0",
"text": "def roll\n rang = (1..6).to_a\n return rang[rand(rang.length)]\nend",
"title": ""
}
] | [
{
"docid": "794db8d94fb6d82d6da040ab33447650",
"score": "0.85596156",
"text": "def get_random_number()\n return rand(0x7fffffff).to_s\n end",
"title": ""
},
{
"docid": "64cd186fbbba838a5356ef0035eb8174",
"score": "0.85422206",
"text": "def get_random_number()\n rand(0x7fffffff... |
bc1462da59487a3f23dba75e3e3255ad | Allow applicant to edit payment /applications/1/payment_page/edit js: provide a partial to replace the answer_sheets page area | [
{
"docid": "cc4c1a5118b1bb640dbf68f1de0c05db",
"score": "0.63450044",
"text": "def edit\n @payment = SpPayment.find(params[:id])\n @application = @payment.application\n # if this isn't a staff payment they shouldn't be here for this staff person\n unless 'Staff' == @payment.payment_type && c... | [
{
"docid": "bc7e504f0306fcd09516f16e4ace8c28",
"score": "0.6905971",
"text": "def edit\n @payment = Payment.new\n @payment.apply = @application\n @next_page = next_custom_page(@application, 'payment_page')\n end",
"title": ""
},
{
"docid": "2b3a96351364a20ed25ecb210e2bdb14",
"s... |
2010952408ddd6271670e1973e51e71f | def save_students puts "Enter the name of the file to save\nReturn twice to use students.csv (default)" filename = filename_choice File.open(filename, "w") do |file| open the file for writing iterate over the array of students and add each line to a new file | [
{
"docid": "6486f31dbfdc0e5dc0b7d40887955bd1",
"score": "0.86842227",
"text": "def save_students\n puts \"Enter the name of the file to save\\nReturn twice to use students.csv (default)\"\n filename = filename_choice\n header_row = @students[0].each_with_object([]) { |(k, v), arr | arr << k.to_s.capi... | [
{
"docid": "69d9843ee73b0e3e4e1091fa68ea55ab",
"score": "0.902109",
"text": "def save_students\n if @students.count == 0\n puts \"Students information not provided, please first (1) add some students\"\n interactive_menu\n else\n puts \"File name:\"\n file_name = STDIN.gets.chomp\n file... |
807a8f38b85477ed26b3e25872afd4a4 | Starts new school year | [
{
"docid": "19c109915bdde78e56f47a60ffdfe4b1",
"score": "0.6453266",
"text": "def start_new_year\n ResetDB.start_new_year\n redirect_to root_url, notice: I18n.t('messages.candidates_removed')\n end",
"title": ""
}
] | [
{
"docid": "0ea1063b9527b5f140387fc75d7ee399",
"score": "0.7496227",
"text": "def start_year\n Time.now.year - 75\n end",
"title": ""
},
{
"docid": "c08ace96d92420f86ba862bcda7fe25a",
"score": "0.7384138",
"text": "def start_year\n Time.now.year - 18\n end",
"title": ""
... |
e77df5e2def44c13a5dbefc9cec02ab7 | List of recent tag image id. | [
{
"docid": "2173a1b59cf38b2e970b8a1943038a15",
"score": "0.6968686",
"text": "def tag_image_id name, pages = 1\n url = API + \"tags/#{name}/media/recent/?access_token=\" + @access_token\n pages.times do\n get(url)['data'].map do |image|\n unless image['user_has_liked']\n @imag... | [
{
"docid": "801e6802cd9f7522fae8572a0e6dd033",
"score": "0.70227724",
"text": "def image_ids; (images.map(&:id) rescue []); end",
"title": ""
},
{
"docid": "801e6802cd9f7522fae8572a0e6dd033",
"score": "0.70227724",
"text": "def image_ids; (images.map(&:id) rescue []); end",
"titl... |
1fd1746edb790499efe8841bd4404b5b | PUT /replies/1 PUT /replies/1.xml | [
{
"docid": "9b6071e979ea8983a7a895c30d5b14da",
"score": "0.67052007",
"text": "def update\n @forum = @topic.forum\n @reply = @topic.replies.find(params[:id])\n\n respond_to do |format|\n if @reply.update_attributes(params[:reply])\n flash[:notice] = 'Reply was successfully updated.'... | [
{
"docid": "c5487eefdb7ffd9fd71751174e36c530",
"score": "0.70464295",
"text": "def update\n @question = Question.find(params[:question_id])\n @reply = @question.replies.find(params[:id])\n\n respond_to do |format|\n if @reply.update_attributes(params[:reply])\n format.html { redirec... |
ab9e91074eb4e9350a8bb8a7b1689290 | Returns 0 indexed row and column for element number i (if we start at the top left and increase by one towards the bottom right). | [
{
"docid": "fe4984742caf555cd9badc2bfbc59f81",
"score": "0.6778303",
"text": "def indices(i)\n [(i/WIDTH),(i-1) % (WIDTH)]\n end",
"title": ""
}
] | [
{
"docid": "7d074a68a16d931d811dfe9e0ab86f93",
"score": "0.66346294",
"text": "def index(x, y)\n (y - 1) * width + (x - 1)\n end",
"title": ""
},
{
"docid": "a29e115eaa43c7d46af06195de4550a9",
"score": "0.65829176",
"text": "def at(i)\n return nil if @map.length == 0\n ... |
d834da15749695f9dd15712ca5ac33f0 | callseq: merged_relation(enumeration_method, false[, arg1, arg2]) do |self_t, related_t| end merged_relation(enumeration_method, true[, arg1, arg2]) do |related_t| end It is assumed that +enumeration_method+ is the name of a method on +self+ that will yield an object related to +self+. This method computes the same set... | [
{
"docid": "15542db89faf33eb5d567321d6e0aa36",
"score": "0.7015303",
"text": "def merged_relations(enumerator, intrusive, &block)\n return enum_for(__method__, enumerator, intrusive) unless block_given?\n\n plan_chain = self.transaction_stack\n object = self.real_obj... | [
{
"docid": "a6848a9c47f8f8f5ddc48949008e11bc",
"score": "0.513676",
"text": "def each_relation_edge(rg)\n rg.nodes.each { |node|\n [:src,:dst].each { |rg_level|\n next unless node.get_block(rg_level)\n node.successors(rg_level).each { |node2|\n if node2.type == :exit || no... |
a5cebce4b1aa8fb8d2d3f7f5a351ff38 | GET /mensagens/new GET /mensagens/new.xml | [
{
"docid": "284c79378f3aff9781037efe3a9d2655",
"score": "0.7331798",
"text": "def new\n @mensagem = Mensagem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mensagem }\n end\n end",
"title": ""
}
] | [
{
"docid": "32d23e457194194ed523de156ee89693",
"score": "0.73809445",
"text": "def new\n @node = Node.scopied.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end",
"title": ""
},
{
"docid": "21a45db0041828210bf927... |
d063fcc00f8bec49a52a726fb711467f | PUT /playlists/1 PUT /playlists/1.xml | [
{
"docid": "471d127d606e93a0fbc5c0d4d1c70956",
"score": "0.65397096",
"text": "def update\n @playlist = Playlist.find(params[:id])\n\n respond_to do |format|\n if @playlist.update_attributes(params[:playlist])\n flash[:notice] = 'Playlist was successfully updated.'\n format.html... | [
{
"docid": "27096800d14893529f640b6cf4566aba",
"score": "0.7008934",
"text": "def update\n connection.put(\"/todo_lists/#{id}.xml\",\n \"<todo-list>\n <name>#{name}</name>\n <description>#{description}</description>\n <m... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "93a8f8da05db8949d365c14322a59a4b",
"score": "0.0",
"text": "def set_nitrou\n @nitrou = Nitrou.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.6163163",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.6045976",
"text": "def action_hook;... |
25ac929e43340db952a9370473d6b47a | Tries to find a simple pattern | [
{
"docid": "3bdf7ad3c70e49b14f9add80a7b7bcef",
"score": "0.0",
"text": "def complex_ai_move(historic_plays) \n play = nil\n\n # last_five = historic_plays[1..5] second pass should try this first\n # last_four = historic_plays[1..4] then this\n \n historic_plays_string = []\n historic_p... | [
{
"docid": "79b6fbb7990e7782f1b09494d807b515",
"score": "0.77881414",
"text": "def find(pattern)\n end",
"title": ""
},
{
"docid": "6099250d89fbb11f7d2e00979167fbfd",
"score": "0.731811",
"text": "def match(pattern); end",
"title": ""
},
{
"docid": "4c19d4e82179188870882... |
b6433ccde96b706d35583da614ef590c | Flushes all queued logs to the wrapped logger. source://sass//lib/sass/logger/delayed.rb32 | [
{
"docid": "be972ed6ad12bea6b859350817458045",
"score": "0.0",
"text": "def flush; end",
"title": ""
}
] | [
{
"docid": "6f48585acb5489d4168c681078f63ad1",
"score": "0.70283145",
"text": "def flush!\n if @flushes == 0\n @log_file.write_start\n end\n @log_file.write_buf(@buf)\n @buf.clear\n @flushes += 1\n end",
"title": ""
},
{
"docid": "634939050df9... |
f260b0743e3635ff851ba1fb8f391b00 | GET /users/1 GET /users/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "9f7c735ace683c5c2b12c914cc9ad8a8",
"score": "0.771752",
"text": "def get\n users = User.all.as_json\n render(json: users.as_json, status: :ok)\n end",
"title": ""
},
{
"docid": "a95dfe28d6b386aafc5fb53749e84258",
"score": "0.75107867",
"text": "def user\n... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "2cf6c592aef4495f4767b8d7b71b64b2",
"score": "0.0",
"text": "def drill_type_params\n params.require(:drill_type).permit(:name, :required_frequency)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7496716",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6956598",
"text": "def strong_params\n params.require(:request).permit(param_white... |
470a3d5a0bf4b6c4eef40d273b66c8b3 | Dump the subtree structure starting from this node | [
{
"docid": "6d5f17c64d6f597064e602b1540f44e7",
"score": "0.0",
"text": "def dump\n left = @left.dump\n right = @right.dump\n if !@left.empty? || !@right.empty?\n \"(\" + [@key, left || \"-\", right || \"-\"].compact.join(\" \") + \")\"\n else\n @key || \"\"\n end\n... | [
{
"docid": "11f21130f2431aaae5d97ff5378e971a",
"score": "0.72416013",
"text": "def dump\n nodes.map(&:dump).join\n end",
"title": ""
},
{
"docid": "1a7e307e961a438ad3292dc6e53d6326",
"score": "0.71613795",
"text": "def print_tree\n @tree.print_tree\n end",
"ti... |
c95f9695a03716e9212f95217b424262 | DELETE /bills/1 DELETE /bills/1.xml | [
{
"docid": "69957fa91b8cd6ae6db44ac3305f9f23",
"score": "0.59538245",
"text": "def destroy\n @bill = Bill.find(params[:id])\n @bill.destroy\n respond_to do |format|\n if params[:patent].blank?\n format.html { redirect_to(bills_url) }\n else\n format.html { redirect_to(new_bi... | [
{
"docid": "09a82df94f838294f27fad64a1140dab",
"score": "0.6961129",
"text": "def destroy\n @bill = Bill.find(params[:id])\n \n @bill.destroy\n\n respond_to do |format|\n format.html { redirect_to(bills_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
... |
7ba5bcb666d9b6d7fa2984a9f62fe416 | POST /owners POST /owners.json | [
{
"docid": "bc538af256042535b4c7b495005bafd2",
"score": "0.67687315",
"text": "def create\n @owner = Owner.new(owner_params)\n\n respond_to do |format|\n if @owner.save\n format.html { redirect_to @owner, flash: { success: \"Owner was successfully created.\" } }\n format.json { ... | [
{
"docid": "dc8d1a5cf8f6cccf42dfdbad0bd012db",
"score": "0.693688",
"text": "def create\n @owner = Owner.new(owner_params)\n\n respond_to do |format|\n if @owner.save\n format.html { redirect_to @owner, notice: 'Owner was successfully created.' }\n format.json { render :show, st... |
af527136d21454e3b3d63ee741ba7faf | Recive a response with error handling | [
{
"docid": "7fe1297af0346c25348909c460e114cc",
"score": "0.0",
"text": "def receive_with_error_handling(name,options={})\n message = receive(name,options)\n status = message['status']\n case status\n when 'success'\n message\n when 'error'\n raise_error_for_message... | [
{
"docid": "66dc1c561c8fabbead0dbd76388dbcdb",
"score": "0.7285137",
"text": "def response!\n return response if !response.errors?\n\n raise response.to_exception\n end",
"title": ""
},
{
"docid": "01df7ae6907cbaa34b13d32244f6ca61",
"score": "0.690612",
"text": "de... |
91b5f25a3ab49523785b2c87addbefbd | def twitter_client Twitter::REST::Client.new do |config| config.consumer_key = Rails.application.secrets.twitter_app_id config.consumer_secret = Rails.application.secrets.twitter_app_secret config.access_token = access_token config.access_token_secret = access_token_secret end end def twitter_refresh_token!(token); end | [
{
"docid": "33a553ba40880027542fc07763c6b9cb",
"score": "0.0",
"text": "def google_oauth2_refresh_token!(token)\n response = HTTParty.post(\"https://accounts.google.com/o/oauth2/token\",\n body: {\n grant_type: \"refresh_token\",\n ... | [
{
"docid": "e9897f4a5d82a3727b8816611268543f",
"score": "0.79931104",
"text": "def client\r\n @client ||= Twitter::REST::Client.new do |config|\r\n config.consumer_key = \"6Qp2jNoS9qOVZMpVNjpBNw\"\r\n config.consumer_secret = \"fm7Xplz3ndNsLgMrBRwHaT6oiaBE78wYO8K013dN8\"\r\n config.... |
1c24435ee79feb64cc6d28a04b6e4136 | The context of the response | [
{
"docid": "c64aafb59dd964a78d031aacf293ed8d",
"score": "0.7436296",
"text": "def mws_response_context\n headers['x-mws-response-context']\n end",
"title": ""
}
] | [
{
"docid": "6d11aafb359191208439355da7cb5072",
"score": "0.7939636",
"text": "def response_context\n headers['x-mws-response-context']\n end",
"title": ""
},
{
"docid": "41b39e846f8bfe98a20ce5c1339f122c",
"score": "0.7674309",
"text": "def response\n @_ctx.response\n ... |
f13bb75f283b1c2429fb62720d9148cf | sort an array of hashes specifying an array of the fields names you care about items the array of hashes to sort fields the fields to sort on from most important to least desc true if descending order ignore_case true if you want to ignore case on strings | [
{
"docid": "27e01c67883ca7ea9dd197c1681ae2d4",
"score": "0.8331792",
"text": "def sort_by_fields(items, fields, desc, ignore_case)\n # now do the multi field sort\n items = items.sort do |first, second|\n comp = 0\n fields.each do |key|\n v1 = first[key]\n v2 = second[key]\n next ... | [
{
"docid": "4883c1c777dcda97d84a94d9e254fcca",
"score": "0.74814045",
"text": "def sort_fields(fields)\n fields.sort {|a,b| (COLUMN_SORTING_MAP[a] || a).to_s <=> (COLUMN_SORTING_MAP[b] || b).to_s }\n end",
"title": ""
},
{
"docid": "9039e71cdfff438fe40863a210371297",
... |
858e2da01f7991b8d9f5a2fb497ef7ec | PATCH/PUT /roles/1 PATCH/PUT /roles/1.json | [
{
"docid": "c6c3f07a9f58039aabd4c6780bb4b935",
"score": "0.67363334",
"text": "def update\n respond_to do |format|\n if @role.update(role_params)\n format.html { redirect_to @role, notice: 'Role was successfully updated.' }\n format.json { head :no_content }\n else\n fo... | [
{
"docid": "fb951c90101159860a109a821be66553",
"score": "0.72295135",
"text": "def UpdateRole params = {}\n \n APICall(path: 'custom_roles.json',method: 'PUT',payload: params.to_json)\n \n end",
"title": ""
},
{
"docid": "2fc823546638071fc504a88e886c559c",
"scor... |
3bfab93b8a56f444f26507dc02a1fc45 | Returns the registry strategy instance for the current realm | [
{
"docid": "f421ce1d7743c801f27e4df9c2cbf71b",
"score": "0.8789552",
"text": "def registry_strategy\n RGovData::RegistryStrategy.get_instance(realm)\n end",
"title": ""
}
] | [
{
"docid": "8d6b6ac37221c3f7851413058422933f",
"score": "0.6281485",
"text": "def strategy\n @strategy ||= begin\n strategy = detect_strategy\n strategy.new(ldap, groups)\n end\n end",
"title": ""
},
{
"docid": "e37ba08c484fe86551a900e7cf68c100"... |
b82a9a18ab3de1b2d75361e7dd8bc5c1 | Check for three of a kind | [
{
"docid": "50cf2690995d4ba8a1623fb01d3d998f",
"score": "0.6860456",
"text": "def hand_has_three_of_a_kind?(hand)\n has = false\n \n #Used to hold pairs in this case\n @temp_array = Array.new \n \n #Get all three of a kinds from hand\n hand = (hand.sort_by {|c| c.get_compare_value})... | [
{
"docid": "b033196dc6186995b318de24f360572c",
"score": "0.8250556",
"text": "def three_of_a_kind?\n of_a_kind?(3)\n end",
"title": ""
},
{
"docid": "38eecb458de3706918ccaefdf7ac8c88",
"score": "0.81036836",
"text": "def three_of_a_kind?\n case wilds\n when 2, 3, 4, 5\n... |
65f0eef76176199339a5bf1c993342a2 | DASHES Create a dashboard. | [
{
"docid": "2a6dcec6b7ae762590106bed10886d84",
"score": "0.8256938",
"text": "def create_dashboard(title, description, graphs, template_variables = nil, read_only = false)\n @dash_service.create_dashboard(title, description, graphs, template_variables, read_only)\n end",
"title": ""
}
] | [
{
"docid": "7f2392ac0e0b2f7ffd38bbde5c5e4592",
"score": "0.8052525",
"text": "def create_dashboard(params, id = \"\", space_id = \"\")\n create_saved_object(params, \"dashboard\", id, space_id)\n end",
"title": ""
},
{
"docid": "f89262ea5a92b9a740538a8b26d3c328",
"score":... |
750a49c9451f699bee6a454f365c3db2 | callseq: mtch.to_a > array Returns the MatchData's internal array. m = /(.)(.)(\d+)(\d)/.match("THX1138.") m.to_a => ["HX1138", "H", "X", "113", "8"] | [
{
"docid": "55d05a734d07158a68419341deaa2607",
"score": "0.0",
"text": "def to_a\n `this.__captures__`\n end",
"title": ""
}
] | [
{
"docid": "7949e4fce9c72175bd21fe625bad65ba",
"score": "0.77056205",
"text": "def test_MatchData_InstanceMethod_to_a\n\t\tm = /(.)(.)(\\d+)(\\d)/.match(\"THX1138.\")\n\t\tassert_equal([\"HX1138\",\"H\",\"X\",\"113\",\"8\"], m.to_a)\n\tend",
"title": ""
},
{
"docid": "eac0c6bd5222269023f70ee... |
b46ad13150edb308eac94d4aad71f5aa | POST /invoice_items POST /invoice_items.xml | [
{
"docid": "525f5ec002eb1d1a8810d903593ed514",
"score": "0.69557524",
"text": "def create\n @invoice_item = InvoiceItem.new(params[:invoice_item])\n\n respond_to do |format|\n if @invoice_item.save\n flash[:notice] = 'InvoiceItem was successfully created.'\n format.html { redire... | [
{
"docid": "a45e125849ddb72ea2b13bfdc9e306e0",
"score": "0.69375",
"text": "def create\n @invoice = Invoice.new(invoice_params)\n\n respond_to do |format|\n \n \n # checking the new item, the one that is already on the page\n item = Item.new(new_item_params)\n\n if !item.q... |
d0df87b1bea9b55706b1c7c4184cdaba | PATCH/PUT /posts/1 PATCH/PUT /posts/1.json | [
{
"docid": "2efb5c0af0e5257116f5a28b9acf3d02",
"score": "0.0",
"text": "def update\n respond_to do |format|\n if @post.update(post_params)\n posts = @pet.posts.all.order(created_at: :desc)\n @posts = posts.take(session[:count])\n session[:count] = @posts.count\n @post... | [
{
"docid": "34c10c4557f689baa30ce671828a8692",
"score": "0.7020792",
"text": "def update\n @api_v1_post = Post.find(params[:id])\n params[:post].delete :created_at\n params[:post].delete :updated_at\n respond_to do |format|\n if @api_v1_post.update_attributes(params[:post])\n for... |
661736c23edbd53ccd0abbe8000f1591 | files the given entity under its class to the hash | [
{
"docid": "00921e420863a5e849140c7ca5ac026b",
"score": "0.0",
"text": "def add_rendered_entity(entity)\n return unless entity\n\n key = entity.class.to_s.varnish_ban_header_name\n\n rendered_entities[key] ||= []\n rendered_entities[key] << entity\n end",
"title": ""
}
] | [
{
"docid": "9cf0ec1c4dcd61defc3a371b8782f2b1",
"score": "0.6412731",
"text": "def fix_entity(entity)\n {\n path: entity[:path],\n filetime: DOSTime.new(entity[:time] || File.mtime(entity[:path])),\n binary_name: string_to_bytes(abs_path_for_entity(entity)),\n zip_path: a... |
5a1f2aafeaae1ecc0ae5c2adaa3ba2f9 | DELETE /menu/1/menu_items/2 DELETE /menu/1/menu_items/2.xml | [
{
"docid": "f80b86d0a3b16e47ec8995cf62d5aecb",
"score": "0.64972574",
"text": "def destroy\n @menu_item = MenuItem.find(params[:id])\n @menu = @menu_item.menu if @menu_item.present?\n if uhook_destroy_menu_item(@menu_item)\n flash[:notice] = t('ubiquo.menu_item.removed')\n else\n f... | [
{
"docid": "1944cf9601b270828e3c7602c8c00de0",
"score": "0.6817064",
"text": "def destroy\n @menu_item = current_site.menu_items.find(params[:id])\n @menu_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_menu_items_url) }\n format.xml { head :ok }\n end\n ... |
6e3849022f98b031cbef7bdc0f69ef32 | response : Faraday response | [
{
"docid": "8eada65973594a467eb15c0f0c5b8a7a",
"score": "0.0",
"text": "def initialize(response)\n @real_response = response\n end",
"title": ""
}
] | [
{
"docid": "ba6f2311612e69f07483b022cb57a87f",
"score": "0.7557723",
"text": "def response\n @response ||= Faraday.get loc\n end",
"title": ""
},
{
"docid": "d09832812d00099dfe1de9051d0edc9f",
"score": "0.73023736",
"text": "def response\n api_response = Faraday.get(full_url... |
5d97d86a81ef5bafda3a10636c18acc1 | PATCH/PUT /powerliftings/1 PATCH/PUT /powerliftings/1.json | [
{
"docid": "1807d5566cd247b4629d1f63bc671df5",
"score": "0.7473789",
"text": "def update\n respond_to do |format|\n if @powerlifting.update(powerlifting_params)\n format.html { redirect_to @powerlifting, notice: 'Powerlifting was successfully updated.' }\n format.json { render :sho... | [
{
"docid": "b9724763047ee20edeba067fdfd94056",
"score": "0.6850708",
"text": "def update\n respond_to do |format|\n if @magical_power.update(magical_power_params)\n format.html { redirect_to @magical_power, notice: 'Magical power was successfully updated.' }\n format.json { render ... |
5bad8da7c823e1b5e32a99ee4c4c2060 | Scenario: two args (postive) Default: pass | [
{
"docid": "2a6e508f96b12c7411570a1c3fc7f328",
"score": "0.0",
"text": "def method(a, b)\r\n\treturn a, b\r\nend",
"title": ""
}
] | [
{
"docid": "b698e3cb3d7b4d3ea22dcad01c184097",
"score": "0.720148",
"text": "def test_non_int_args\n args = ['seed', 'prospectors', 'turns']\n refute check_args(args)\n end",
"title": ""
},
{
"docid": "eedce7f6ace2734c858e7fdb9a738232",
"score": "0.7098775",
"text": "def test_... |
64b4b1106f87c4655604343a8b19e8ed | Specify the hours(s) at which the task should run Example: at_hour(3) at_hour(1,12) valid hour values are 0..23 | [
{
"docid": "38dcee95df501bfc5648e21a43cd9eb9",
"score": "0.77916384",
"text": "def at_hour(*hours)\n set_of_hours = hours.to_set\n raise ArgumentError, 'invalid hours (0..23 are valid)' unless set_of_hours.subset?(ALL_HOURS)\n @hour = set_of_hours\n self\n end",
"tit... | [
{
"docid": "89f701494c84798e6aa5392bdbd7f43c",
"score": "0.7155451",
"text": "def increase_hatched_hour(hours)\r\n end",
"title": ""
},
{
"docid": "86866bcf00b45cf027cab4430b5f565c",
"score": "0.7112391",
"text": "def hours\n Routing.comma_delimited_list(Array(\"00\"..\"23\"))\n ... |
2cd057ff00e3048a76ac2e019556cf08 | Add a single characters object to self >> writer = Bio::NeXML::Writer.new >> writer.add_characters( nexml.characters.first ) | [
{
"docid": "9dbedcf4c32e0b8053399398e0e40fc4",
"score": "0.7562324",
"text": "def add_characters( characters )\n @root << characters.to_xml\n end",
"title": ""
}
] | [
{
"docid": "c94c1142b5367d6f72f584b675007383",
"score": "0.671016",
"text": "def characters(text)\n node = @current_node.children.last\n if node and node.text?\n node.content += text\n else\n @current_node.add_child(Nokogiri::XML::Text.new(text, @document))\n end\n e... |