query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
806c657effe6f4b568eabd1652964f24 | PUT /coretypes/1 PUT /coretypes/1.json | [
{
"docid": "5d0ca964fac0d0012f224d9f82157b22",
"score": "0.7154064",
"text": "def update\n @coretype = Coretype.find(params[:id])\n\n respond_to do |format|\n if @coretype.update_attributes(params[:coretype])\n format.html { redirect_to @coretype, notice: 'Coretype was successfully upd... | [
{
"docid": "e392b3e94167617f55483f9f509abb66",
"score": "0.6281209",
"text": "def update_entity_type(entity_type_id, request)\n start.uri('/api/entity/type')\n .url_segment(entity_type_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .put()\n .go()... |
57ca51903d9139ebf512dceeb282c2e1 | generate a sine wave: input range: PI to PI ouput range: 1 to 1 | [
{
"docid": "9c86ebfadbd936273df77d4892f9a775",
"score": "0.7304068",
"text": "def sine x\n y = K_SINE_B * x + K_SINE_C * x * x.abs\n # for extra precision\n y = K_SINE_P * (y * y.abs - y) + y # Q * y + P * y * y.abs\n \n # sin normally output outputs -1 to 1, so to adjust\n # it to o... | [
{
"docid": "dfe873d17eea648fc1ac296a0eda007b",
"score": "0.8118864",
"text": "def sine_wave freq, pos\n Math.sin(2 * Math::PI * pos / (OUTPUT_FREQUENCY / freq))\nend",
"title": ""
},
{
"docid": "8291902259303e63b4bc45ea6caebc1c",
"score": "0.7640121",
"text": "def sine_wave()\n ret... |
b8e28f1e6fd04e92a4aa31f86fccbea6 | Resolves the repository based upon the file path of a PULFA EAD file | [
{
"docid": "9deb13e39699ba71353aa964587f5ba8",
"score": "0.6578804",
"text": "def resolve_repository_id(file_path)\n parent_path = File.expand_path(\"..\", file_path)\n File.basename(parent_path)\n end",
"title": ""
}
] | [
{
"docid": "66593c8a77bd6d61aed87d6eb4f7e5cd",
"score": "0.63111246",
"text": "def find_file(repo_location, *components)\n if file_exists_and_is_readable?(File.expand_path( components.last ))\n File.expand_path( components.last )\n else\n relative_path = File.join... |
c6f8282bf5d1c3e04a629f8f5c85433c | Called when the event loop starts. | [
{
"docid": "328cbd3e292240fde6a4ab6f601e3121",
"score": "0.67506623",
"text": "def on_reactor_init(event)\n self.on_start(event)\n end",
"title": ""
}
] | [
{
"docid": "1ee83822a64687cdfa7017f29034f1d3",
"score": "0.7807002",
"text": "def start!\n @eventloop.start\n end",
"title": ""
},
{
"docid": "440146e7dfba9298873c59966382c964",
"score": "0.7284993",
"text": "def run\n\t\t# Implement event loop here.\n\tend",
"title": ""
... |
939d097d251dec3cd2428470f20693bb | Simple composition is one that is either empty or singular. | [
{
"docid": "2f07be50d28a4ab667229c5d33c7f995",
"score": "0.6361919",
"text": "def simple?\n empty? or singular?\n end",
"title": ""
}
] | [
{
"docid": "70b0934b360f20284d791866baaa250d",
"score": "0.6258368",
"text": "def atomic?\n puts \"composition is #{self}\" if SY::DEBUG\n puts \"first[0].dimension is #{first[0].dimension}\" if SY::DEBUG\n singular? && first[0].dimension.base?\n end",
"title": ""
},
{
"docid": "35... |
269fe0bb4ebd1726baf93f9a42f24934 | Gets the bearing from point 1 to point 2 | [
{
"docid": "db3c66a29594f0b9bbd66d38f52b3e0a",
"score": "0.84999317",
"text": "def bearing(x1, y1, x2, y2 )\n \t\tdx, dy = x2 - x1, y2 - y1\n \t\tmagnitude = distance( x1, y1, x2, y2 )\n \t\tif( dx >= 0 && dy >= 0 ) || ( dx <= 0 && dy >= 0 )\n \t\ttheta = Math.acos(-dx / magnitude) + Math::PI\n \... | [
{
"docid": "60ed828ee5d324b06599b0f33d40eff1",
"score": "0.87025136",
"text": "def getBearing(p1, p2)\n dLon = rad(p2[0]-p1[0])\n lat2 = rad(p2[1])\n lat1 = rad(p1[1])\n y = Math.sin(dLon) * Math.cos(lat2)\n x = Math.cos(lat1)*Math.sin(lat2) -\n Math.sin(lat1)*Math.cos(lat2)*Math.c... |
b482ce8fa46dd25097ff23392f30e25d | GET /channels/new GET /channels/new.xml | [
{
"docid": "45f834619bccae79560d95deeea3663e",
"score": "0.78767926",
"text": "def new\n @channel = Channel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @channel }\n end\n end",
"title": ""
}
] | [
{
"docid": "2d31b9b331f8467bf95962ca94246139",
"score": "0.74308115",
"text": "def new\n @channel = Channel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @channel }\n end\n end",
"title": ""
},
{
"docid": "e17048491db644eafb6210d... |
c54788b6aedfeed3b4375ec80c1cdc48 | lowercases and removes a trailing period (if one exists) from a domain name | [
{
"docid": "d368d658c2f15923060c1f043bc8cd61",
"score": "0.8315169",
"text": "def normalize_domain(domain)\n return domain.downcase.gsub(/\\.$/,'')\n end",
"title": ""
}
] | [
{
"docid": "f2945cebdd7836a11b9e67ed728637bd",
"score": "0.7963893",
"text": "def normalize_domain\n raise \"String #{self} is not a domain\" if self.match(/([\\w]+\\.)?.+\\..+/).nil?\n self.downcase! # Make everything lower case\n self.gsub!(',','.') # Change c... |
b761ed767973ff21b239370b76273cc7 | PEDAC input: a hash output: a hash with age_group pair rules: a kid is in the age range 0 17, an adult is in the range 18 64 and a senior is aged 65+. Algorithm iteration thru each pair, based on their age, decide he/she belongs to what group in each iteration, add a new pair to the hash value | [
{
"docid": "3c7ba7f514037a3b924a314b1880a5d1",
"score": "0.53512007",
"text": "def age_group(age)\n case \n when 17 >= age && age >= 0\n return \"kid\"\n when 64 >= age && age >= 18\n return \"adult\"\n when age > 65\n return \"senior\"\n end\nend",
"title": ""
}
] | [
{
"docid": "5529bad50e834d71724ed47a2a2ae0ab",
"score": "0.689708",
"text": "def add_age_range(hash)\n hash.each do |_, value|\n case value[\"age\"]\n when (0..17)\n value[\"age_group\"] = \"kid\"\n when (18..64)\n value[\"age_group\"] = \"adult\"\n else\n value[\"age_group\"... |
d7bcbcd39ae7775d53c546fe8597ef5c | POST /general_ledger_accounts POST /general_ledger_accounts.json | [
{
"docid": "07fc7ed8e8760e94916a4979ee99a416",
"score": "0.66630954",
"text": "def create\n\n @ledger_account = GeneralLedgerAccount.new(form_params)\n\n respond_to do |format|\n if @ledger_account.save\n notify_user(:notice, \"The general ledger account was successfully saved.\")\n\n ... | [
{
"docid": "7235bff70bec89f4c0092b9bedbefa24",
"score": "0.657746",
"text": "def add_accounttttttttttttttttttttttttttt\n\n res = {\n :success => false,\n :msg => '',\n :data => []\n }\n\n begin\n params[\"account\"][:company_id] = params[:... |
50e5c34f153f6097c130f8c8e48cb182 | ////////////////////////////////////////////////////////////////////////// Constructors ////////////////////////////////////////////////////////////////////////// Object Initialization x : window xcoordinate y : window ycoordinate width : window width height : window height modes : optimize modes list | [
{
"docid": "16f4c65e609d2358a8c85ed9113d97cb",
"score": "0.8070946",
"text": "def initialize(x, y, width, height, modes)\n super(x, y, width, height, 32, 32)\n \n @row_max = modes.size\n @column_max = 1\n \n @modesList = []\n window_update(modes)\n self.index = 0\n end",
"ti... | [
{
"docid": "8ba8e03915f4024d2da5305a0f0c69ee",
"score": "0.6329094",
"text": "def initialize(x, y, width, height)\n super()\n self.windowskin = Cache.system(\"Window\")\n self.x = x\n self.y = y\n self.width = width\n self.height = height\n self.z = 100\n self.back_opacity = 200\... |
7745a11e7ed787121547053332c2d37c | DELETE /order_detail_statuses/1 DELETE /order_detail_statuses/1.json | [
{
"docid": "a304207363fdc91b7c10ed603608a441",
"score": "0.8068407",
"text": "def destroy\n @order_detail_status = OrderDetailStatus.find(params[:id])\n @order_detail_status.destroy\n\n respond_to do |format|\n format.html { redirect_to order_detail_statuses_url }\n format.json { head... | [
{
"docid": "b032bd0c4abbb714a83b587da4d59e78",
"score": "0.75058246",
"text": "def destroy\n @order_item_status = OrderItemStatus.find(params[:id])\n @order_item_status.destroy\n\n respond_to do |format|\n format.html { redirect_to order_item_statuses_url }\n format.json { head :no_co... |
3a2a8458d08a1966bbee5dabb6aa306b | override the r_c create since we need special logic to deal with the presenter in the create case | [
{
"docid": "212c829c587ba88f05cdc970d1e3fb17",
"score": "0.0",
"text": "def create\n creditcard = @payment_presenter.creditcard\n creditcard.address = @payment_presenter.address\n creditcard.order = @order\n \n begin\n creditcard.authorize(@order.total)\n rescue Spree::GatewayErro... | [
{
"docid": "e3e19932c850d6c73f0462cb68c7ffc1",
"score": "0.69027144",
"text": "def create\n super\n end",
"title": ""
},
{
"docid": "e3e19932c850d6c73f0462cb68c7ffc1",
"score": "0.69027144",
"text": "def create\n super\n end",
"title": ""
},
{
"docid": "e3... |
a9bbc6715b6dff70d1024925b2b799df | Only deletes a RecipeType Object if no Recipe Objects are assigned to it Returns true/false Boolean | [
{
"docid": "c83dc1b31087d6564e1a5f076a6b4295",
"score": "0.7319846",
"text": "def delete_category\n if self.recipes.empty?\n self.delete\n else\n false\n end\n end",
"title": ""
}
] | [
{
"docid": "864766d7f6954ce19b29c75ebca1873f",
"score": "0.6872496",
"text": "def check_for_recipes\n recipes = self.recipes.map(&:id)\n if recipes.any?\n self.errors.add :base, \"Cannot delete ingredient while dependant recipes exist.\"\n return false\n end\n end",
"title": ""
... |
7a4c25426581bfa1ab34d0115d01a769 | Get highest level viewed for topic. Return 1 for never viewed. | [
{
"docid": "128f1a9d74177bdb66820aa08d2dac70",
"score": "0.8651335",
"text": "def highestViewedLevel(topicID)\n topic = Topic.find(topicID)\n\n # If a view hash exists, use that. \n if highest = levelViewsDictionary[topic.shortName] \n return highest\n end \n\n # If topic neve... | [
{
"docid": "3296e92767b9b72a05cc0960b0394da4",
"score": "0.72398174",
"text": "def levelAccess(topicID)\n maxView = highestViewedLevel(topicID)\n maxLevelScored = highestPassedLevel(topicID)\n maxView >= maxLevelScored ? maxLevelScored + 1 : maxLevelScored\n end",
"title": ""
},
{
... |
65eba9b4ba564a6d5e3494b212d8c09c | Returns method name as a Symbol if args are empty or a Message which will call `name` with your evaluated `args` [1]. | [
{
"docid": "b093b377301829ccee372f8128935e33",
"score": "0.6463445",
"text": "def method_missing(name, *args)\n if args.length > 0\n Message.new(name, args)\n else\n name\n end\n end",
"title": ""
}
] | [
{
"docid": "9c22cf79512c08d9a93bf0864e5bb1be",
"score": "0.6944697",
"text": "def method_s(method_name, args = nil)\n method_s = arg_s = nil\n method_s = \"#{class? ? '##' : '#'}#{method_name}\" if method_name\n if args\n arg_s = '('\n if args.is_a? Hash\n c = 0\n args.e... |
e5b06a3a5304c793b8d5731f4d9b9dd8 | add item to existing cart with cart id | [
{
"docid": "4a7e89c473f6a0de674712c9185650e8",
"score": "0.7503436",
"text": "def add_item_to_cart\n shopping_cart = ShoppingCart.find(shopping_cart_add_params[\"cart_id\"])\n\n products = shopping_cart.shopping_cart_products\n product_addition = products.new(\n product_id: params[:product... | [
{
"docid": "5ca65bceff14d0316c61652230d791c7",
"score": "0.89574707",
"text": "def add_item_to_cart(item_id)\n cart << item_id\n end",
"title": ""
},
{
"docid": "5ca65bceff14d0316c61652230d791c7",
"score": "0.89574707",
"text": "def add_item_to_cart(item_id)\n cart << item_id\... |
fcba489dbf6bcd0fc65da0dd1b7291cb | Gets the includedGroups property value. User groups that will be targeted by on premises conditional access. All users in these groups will be required to have mobile device managed and compliant for mail access. | [
{
"docid": "ac6d7a633ae80ed371282801fc5fd3a1",
"score": "0.7250203",
"text": "def included_groups\n return @included_groups\n end",
"title": ""
}
] | [
{
"docid": "7a18c1ac62bbed388635a07f043852de",
"score": "0.7109775",
"text": "def include_groups\n return @include_groups\n end",
"title": ""
},
{
"docid": "70b420bea1dcf410deec34c6a457b317",
"score": "0.69720244",
"text": "def ldap_user_include_groups\n ... |
f9161d0f0b49532948f264f16bc093ae | Accepts search method as optional argument | [
{
"docid": "3daa5f0b76930cc2ba23c57e6963d0ec",
"score": "0.0",
"text": "def initialize(dbi, *args)\n @dbi = dbi\n @options = args.extract_options!\n @search_method = args[0]\n end",
"title": ""
}
] | [
{
"docid": "7b3b34b3700f5c6921a4fe5f61ec20cf",
"score": "0.80457795",
"text": "def search(args)\n raise NotImplementedError, \"Not implemented\"\n end",
"title": ""
},
{
"docid": "ff175af0860f7d84836b5e662548205d",
"score": "0.78863305",
"text": "def search(*args)\n end",
"t... |
2e2547d244876164bb4df3bdeec6b3ba | Remove the given object(s) (single or multiple) from the Quadtree (or any children). | [
{
"docid": "19ea6cddfc6a43bc5e5fe32e09fb0f97",
"score": "0.8204583",
"text": "def remove_object object\n objects = [object].flatten\n objects.each do |obj|\n @objects.delete obj\n get_quadtrees.each do |quadtree|\n quadtree.remove_object obj\n end\n end\n ... | [
{
"docid": "14eb5f763d68de4f47042a47801ad78a",
"score": "0.81333816",
"text": "def remove_object object\n super\n [object].flatten.each do |obj|\n get_quadtree.remove_object obj\n end\n end",
"title": ""
},
{
"docid": "449e80f2822c15f330d1c488f36362f2",
... |
92dc75689c01d41a733c550b894e7d76 | Create a new cl.ly item by bookmarking a link. Requires authentication. | [
{
"docid": "d3049fe99a04c5de1570debb3e71b6fe",
"score": "0.7826112",
"text": "def bookmark(url, name = \"\")\n Item.create(:bookmark, {:name => name, :redirect_url => url})\n end",
"title": ""
}
] | [
{
"docid": "2bd9bb292b680240629b803f54f55fa8",
"score": "0.6723651",
"text": "def bookmarklet\n unless session[:user_id] \n flash[:info] = \"Please Sign In.\"\n session[:return_to] = request.fullpath\n redirect_to login_url\n end\n @bookmark = Bookmark.find_or_create_by(:url => p... |
db1801e0fb0a0311176f011806512f0e | POST /enrolls POST /enrolls.json | [
{
"docid": "dcb54d6386fb4edf93b2eb27838156ce",
"score": "0.7462776",
"text": "def create\n @enroll = Enroll.new(enroll_params)\n\n respond_to do |format|\n if @enroll.save\n format.html { redirect_to @enroll, notice: 'Enroll was successfully created.' }\n format.json { render :s... | [
{
"docid": "55eb57c8344f89b45ea0f18d94fb381e",
"score": "0.7566003",
"text": "def enrollment(params = {})\n scope 'default'\n post('enrollment/', params)\n end",
"title": ""
},
{
"docid": "9883b8085443e161f2cba70e7ef767d9",
"score": "0.7204799",
"text": "def create\n ... |
aa73577d5b1026977df7d4e258b78c88 | Requires that the params :movie_id and :actor_id be set. Since a contain is a relationship, it does not make sense to create one without knowing the movie and actor. | [
{
"docid": "b5bdda6ef1ab9495996a4a623e4f98c7",
"score": "0.56938654",
"text": "def new\n @first_node = Movie.find(params[:node_id])\n @second_node = Actor.find(params[:node_id])\n @contain = Contain.new\n end",
"title": ""
}
] | [
{
"docid": "1a2003244da9c00883aeec550d7d476e",
"score": "0.6608622",
"text": "def movies_actor_params\n params.require(:movies_actor).permit(:belongs_to, :belongs_to)\n end",
"title": ""
},
{
"docid": "bce07a6363a75a7bd0eed664851fe3ee",
"score": "0.646223",
"text": "def actor... |
c9e299ecf20bdb7cc5bdd79d1e3e3576 | Sends XTYP_EXECUTE transaction to server if conversation was already established. data:: data being sent (will be coerced to String unless is already a (packed) String) | [
{
"docid": "b521d14ea48f1c4c3815b798c64fc84c",
"score": "0.76451737",
"text": "def execute_data( data )\n data_pointer = FFI::MemoryPointer.from_string(data.to_s)\n result, trans_id = start_transaction(XTYP_EXECUTE, data_pointer, data_pointer.size, 0, 0)\n return result\n end",
"ti... | [
{
"docid": "951f09f589c477006e240cab92611500",
"score": "0.6493977",
"text": "def send_command(data)\n\t\tmessage = header + data + ETX + checksum(data) + EOT\n\t\t@sp.puts message\n\tend",
"title": ""
},
{
"docid": "425a73fb72093c0a30731db864cbb2ef",
"score": "0.62011814",
"text": "... |
88b3d86630af16616e2d9859d8e59c5d | Delete LBPersistenceProfile and all the entities contained by this LBPersistenceProfile Delete the LBPersistenceProfile along with all the entities contained by this LBPersistenceProfile. | [
{
"docid": "be8f71c03c3cdd63b53234d61662b2b7",
"score": "0.58967376",
"text": "def delete_lb_persistence_profile_0_with_http_info(lb_persistence_profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingNetworkServicesLoadBalanci... | [
{
"docid": "2d33432a0eeded6b2a5e777f6b1c03e7",
"score": "0.6873894",
"text": "def delete_lb_persistence_profile(lb_persistence_profile_id, opts = {})\n delete_lb_persistence_profile_with_http_info(lb_persistence_profile_id, opts)\n nil\n end",
"title": ""
},
{
"docid": "b2a6b2cc... |
507730afee840c346495bee84b5db0c8 | DELETE /socialize_plans/1 DELETE /socialize_plans/1.xml | [
{
"docid": "e528e7bf8d80df770b3dd3930be09aac",
"score": "0.7524242",
"text": "def destroy\n @socialize_plan = SocializePlan.find(params[:id])\n @socialize_plan.destroy\n\n respond_to do |format|\n format.html { redirect_to(socialize_plans_url) }\n format.xml { head :ok }\n end\n ... | [
{
"docid": "ec185fa1bb9a14555d5a8cddcd846447",
"score": "0.6782498",
"text": "def destroy\n @plan = Plan.find(params[:id])\n @plan.destroy\n\n respond_to do |format|\n format.html { redirect_to(plans_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"doc... |
5352398f73f610f065df056239ee5f97 | Because we have softdeletes uniqueness validations must be custom | [
{
"docid": "d8928d0b241acc37ad4456d8ee6f1b5c",
"score": "0.0",
"text": "def unique_name\n return true unless company && name\n scope = company.time_periods.where('LOWER(name) = ?', self.name.downcase)\n scope = scope.where('id <> ?', self.id) if self.id\n\n errors.add(:name, \"with value #{n... | [
{
"docid": "adc5c108b4e6c4a74eb1a25e39e25603",
"score": "0.66650736",
"text": "def allows_unique?\n true\n end",
"title": ""
},
{
"docid": "f1a196f3bf5dce4fb214d67b18bc5392",
"score": "0.66486144",
"text": "def preconditions\n validator.kind == :uniqueness\n end",
... |
869479eb7c13d5d39a1e6272e07c0434 | Get raw caniuse data from redis. If it's not in redis, GET from Github and cache in redis for a day. | [
{
"docid": "9bde95bda8f404bf23ef3f02590d384b",
"score": "0.76845175",
"text": "def get_caniuse_data\n caniuse_data = $redis.get(\"caniuse\")\n if caniuse_data.nil?\n uri = \"https://raw.githubusercontent.com/Fyrd/caniuse/master/data.json\"\n request = HTTParty.get(uri)\n caniuse_data = reques... | [
{
"docid": "4641cbd22809543bcf991d226eb66a51",
"score": "0.67170846",
"text": "def cache\n $Redis\n end",
"title": ""
},
{
"docid": "75307e3a0a1d3a4dace41ebd417f9bef",
"score": "0.6607802",
"text": "def read_cache(login)\n redis = Redis.new\n repos = redis.keys(\"#{login}:*/*\"... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "518b4fd6ab05bfdf31bf8932b6f7bb00",
"score": "0.0",
"text": "def set_user\n @user = User.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.61642385",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.60448",
"text": "def action_hook; ... |
8912f90d274f0f88fa16171c6b9a8b6f | GET /vehicle_trips GET /vehicle_trips.json | [
{
"docid": "279d287c598779052dce7a3202311748",
"score": "0.69350356",
"text": "def index\n @vehicle_trips = VehicleTrip.paginate(:page => params[:page], :per_page => 15)\n \n respond_to do |format|\n format.html { render :index }\n format.json {\n render :json => {\n :... | [
{
"docid": "05d09302be982f21a67335593750f388",
"score": "0.7464127",
"text": "def all_trips\n @trips = Trip.all\n render json: @trips\n end",
"title": ""
},
{
"docid": "9786bf4b45c1fa79d5dc5c66e89f139f",
"score": "0.7412401",
"text": "def index\n @trips = Trip.all... |
7de860ca5e9c632d222e666203faab49 | same as recent searched cities, create cookie for favorite city. | [
{
"docid": "577b547c8ffb99f0db4d35c2c18cce58",
"score": "0.7313583",
"text": "def favorite_city\n city = City.find_by(name: params[:name])\n if session[:client_id]\n client = Client.find_by(id: session[:client_id])\n if (@quality.nil?)\n @quality = city.daily_data[\"Dail... | [
{
"docid": "22938cef3d93967482601b505dff5533",
"score": "0.7007298",
"text": "def create\n city = Hash.new\n city[:name] = params[:city][\"name\"]\n \n city[:cityId] = OpenWeather.getCitiesIDs(params[:city][\"name\"],1)[0]\n \n latLon = Geocoder.getLatLon(params[:city][\"na... |
6514d096d710952fe76c21bef96f92b6 | Validate start_houdd_time is earlier than end_houdd_time. | [
{
"docid": "d8832088a074e05d8daf713c969cd568",
"score": "0.8615479",
"text": "def end_houdd_time_is_earlier_than_start_houdd_time\n return if start_houdd_time.blank? or end_houdd_time.blank?\n if end_houdd_time < start_houdd_time\n errors.add(:base, I18n.t('activerecord.errors.models.mission.... | [
{
"docid": "4f6f112390c2d6f7a813c53c5fac3231",
"score": "0.7712581",
"text": "def start_time_early_than_end_time\n if self.start_time.present? && self.end_time.present? && self.start_time >= self.end_time\n errors.add(:end_time, \"结束时间不得小于开始时间\")\n end\n end",
"title": ""
},
{
"d... |
1dfeca3c9be7860514314b2087380910 | products: returns a collection of FarMar::Product instances that are associated by the FarMar::Product vendor_id field. | [
{
"docid": "f2bf8bcbd5c38f65b6ba0aeccb52c720",
"score": "0.786039",
"text": "def products\n FarMar::Product.vendor_products(@vendor_id)\n end",
"title": ""
}
] | [
{
"docid": "0729ab5d507a320ce7c15b6eec1cccd0",
"score": "0.89740914",
"text": "def products\n return FarMar::Product.by_vendor(vendor_id)\n end",
"title": ""
},
{
"docid": "f45049dc61f2c600de5fee98207b89c9",
"score": "0.8727647",
"text": "def products\n return array_of_ins... |
d55931618c92bd3c18bf59c30462d731 | Gets a secton Element. Will call template_id to find the appropriate id to place in it's XPath expression | [
{
"docid": "95aa65500b3fa7ae96d02ba8a6f30bf2",
"score": "0.69494617",
"text": "def section(document)\n REXML::XPath.first(document,\"//cda:section[cda:templateId[@root = '#{template_id}']]\", DEFAULT_NAMESPACES)\n end",
"title": ""
}
] | [
{
"docid": "4ac16c7e63de86c5237ed26efe964b4b",
"score": "0.61459297",
"text": "def capybara_element\n section = context.send(\"#{name}_sections\").first\n section.try(:capybara_context)\n end",
"title": ""
},
{
"docid": "ff0961689f04439ad520fa653d80e91c",
"score": "0.5... |
b98706d424b3f56b4305f112c3db29e3 | called once for every message sent directly | [
{
"docid": "aade3fb3eb941fef485411c223ac8509",
"score": "0.0",
"text": "def personal_message(msg, cl, state)\n respond(msg, cl, \"Hi. Your message was: #{msg.inspect}\")\n respond(msg, cl, \"Body: #{msg.body.to_s}\")\nend",
"title": ""
}
] | [
{
"docid": "e9d720859c96b8430d5091532c0b59db",
"score": "0.7189096",
"text": "def sent\n end",
"title": ""
},
{
"docid": "7ffe635c868cb97f875a1616e9e25670",
"score": "0.71493864",
"text": "def on_message(m)\n\tend",
"title": ""
},
{
"docid": "650cdadfabd056834257fe5f816b... |
9a14bb3a5c55e10593d49714c2a008fc | Validation routine to check if the tag is formatted correctly | [
{
"docid": "5bcfe3a8b39467f031ed638788d85a15",
"score": "0.7564146",
"text": "def check_tag_format\n errors.add(:name, 'is not a valid tag') unless name =~ Tag.validation_regex\n end",
"title": ""
}
] | [
{
"docid": "22a60e8c59dedac1d072403f9e328377",
"score": "0.66324145",
"text": "def check_for_invalid_tags\n unless self.invalid_tags.blank?\n errors.add(:base, \"The following tags are invalid: \" + self.invalid_tags.collect(&:name).join(', ') + \". Please make sure that your tags are less than ... |
ac09b6d9722ad2c06452c7e118ffdd42 | Missing line number = first occurence of markup in string | [
{
"docid": "2cc8e57cb3ed5be755f08ff804421e1e",
"score": "0.56345975",
"text": "def test_positions_handles_missing_line_number_gracefully\n position = Position.new('23', @contents, line_number_1_indexed: nil)\n assert_equal(2, position.start_index)\n assert_equal(4, position.end_index)\n ... | [
{
"docid": "55d0dbcb01b38cf32620d10603529f58",
"score": "0.6619959",
"text": "def beginning_line_number; end",
"title": ""
},
{
"docid": "55d0dbcb01b38cf32620d10603529f58",
"score": "0.6619959",
"text": "def beginning_line_number; end",
"title": ""
},
{
"docid": "99e75a63... |
780e8eba900dfb34b24cb0cc52ca0b9f | i18ntasksuse t('arclight.views.show.download.single.pdf') i18ntasksuse t('arclight.views.show.download.single.ead') | [
{
"docid": "7c63e5d1457c7f7fafe32743a800be6a",
"score": "0.6632551",
"text": "def label(file)\n t(file.type, scope: 'arclight.views.show.download.single')\n end",
"title": ""
}
] | [
{
"docid": "388749002a401f78af6da5c6f7ac0662",
"score": "0.67816985",
"text": "def link_to_extract\n link_to I18n.t(\"PDF\", :default => \"PDF\"), { :action => :extract, :id => params[:id], :format => :pdf }, :class => \"positive\"\n end",
"title": ""
},
{
"docid": "fe8e241d951db4f9c471e... |
15e48d1156fe67b48d8a04810678893d | GET /myimages GET /myimages.xml | [
{
"docid": "0fe03890c131f07cb7498a25a57f20b1",
"score": "0.0",
"text": "def get_list\n \n if params[:myimage_folder_id] == \"\" or params[:myimage_folder_id].nil?\n folder_id = \"photo\"\n else\n folder_id = params[:myimage_folder_id]\n end\n \n if folder_id == \"photo\"\n ... | [
{
"docid": "6ae970456f0561628b443df6e12d6b1a",
"score": "0.739969",
"text": "def index\n @images = Image.find_images\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @images }\n end\n end",
"title": ""
},
{
"docid": "8891e1f691e4d8c... |
db1f77d1d3f95503d4fa4b9df8c13faf | Given the provided key URI determine what kind of chef resource we need to fetch the key | [
{
"docid": "029ff95e6e5ed4ddd1ecc62be1048ecf",
"score": "0.7513775",
"text": "def key_type(uri)\n if uri.start_with?(\"http\")\n logger.trace(\"Will use :remote_file resource to cache the gpg key locally\")\n :remote_file\n elsif has_cookbook_file?(uri)\n logger.... | [
{
"docid": "1de01fcb42b1544cd1690d3ff9ab8179",
"score": "0.753549",
"text": "def key_type(uri)\n if uri.start_with?(\"http\")\n :remote_file\n elsif has_cookbook_file?(uri)\n :cookbook_file\n else\n raise Chef::Exceptions::FileNotFound, \"Canno... |
e04469f27498ed70a07de7ffee3ba8e7 | any dir containing wav files that's not in /repo | [
{
"docid": "a4c8d99311536b591fd27df87e9a26c7",
"score": "0.58989924",
"text": "def unarchived_paths(*args)\n t = []\n Dir.chdir(self.path) do\n Find.find('unarchived') do |f|\n if false\n Find.prune \n elsif File.directory?(f)\n if Dir.entries(f).any? {|e| e.ma... | [
{
"docid": "e949913bf8930c1c7b0696993eaaaf47",
"score": "0.6829146",
"text": "def directories_with_audiofiles\n self.directories(true)\n end",
"title": ""
},
{
"docid": "89130b6699dcd94b5ecb5c753cef03b6",
"score": "0.6713387",
"text": "def audio_files_in_dir(dir)\n extensions = ... |
d5c1b0b15b0f9b69da0342f5aa66f2f3 | :callseq: on_qsymbols_add: (QSymbols qsymbols, TStringContent element) > QSymbols | [
{
"docid": "2eb3122688cdddb85b90039839d5aa3b",
"score": "0.8583545",
"text": "def on_qsymbols_add(qsymbols, element)\n QSymbols.new(\n beginning: qsymbols.beginning,\n elements: qsymbols.elements << element,\n location: qsymbols.location.to(element.location)\n )\n end",... | [
{
"docid": "ceb2b7f36edc9fa5f5fd9657ba05ca97",
"score": "0.9021486",
"text": "def on_qsymbols_add(qsymbols, element); end",
"title": ""
},
{
"docid": "d12d21c06425e19d7b024fc39238486e",
"score": "0.7972274",
"text": "def on_qsymbols_add(qsymbols, tstring_content)\n qsymbols.merge!... |
8223aadb57edfe138c1240648d4a4ae6 | PATCH/PUT /consulta_clientes/1 PATCH/PUT /consulta_clientes/1.json | [
{
"docid": "bfdc2b0a67e98985013d8cfc2881f8cc",
"score": "0.7206892",
"text": "def update\n @empresa = Empresa.find(params[:empresa_id])\n @consulta_cliente = @empresa.consulta_clientes.find(params[:id]) \n respond_to do |format|\n if @consulta_cliente.update(consulta_cliente_params)\n ... | [
{
"docid": "4dee5d7247a1197b30592c58a7c1336d",
"score": "0.69663197",
"text": "def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to show_feuilles_client_path, notice: 'Le client a été mis ... |
1446086a5c7fedb7fc60ce95cd8b9396 | Abstract base class methods, please keep the consistent naming in all subclasses of the Model class Initialize a record | [
{
"docid": "35a37bd3068c0abf9e765c94e92e97ad",
"score": "0.0",
"text": "def initialize(attributes)\n # Old 'connection' is renamed as service and should be used instead\n prepare_service_value(attributes)\n super\n end",
"title": ""
}
] | [
{
"docid": "a6527b5b7b13c243780a748ad9c4a1de",
"score": "0.7789146",
"text": "def init\n if super_init\n @record = self.record_class.send(:new) unless @record\n define_record_methods! unless self.class.instance_variable_get(:@record_methods_defined)\n self\n end\n end",... |
87f2655df10379d7ede386016b28e229 | ////////////////////////////////////////////////////////////////////////// Public Methods ////////////////////////////////////////////////////////////////////////// Update formations : battle formations list | [
{
"docid": "3f58c0fb75f59178c04a13979baea05d",
"score": "0.6021143",
"text": "def window_update(formations)\n @data = [] \n if formations != nil\n for formation in formations\n if formation != nil\n @data.push(formation)\n end\n end\n @item_max = @data.size\... | [
{
"docid": "8c455cdba924718feb4ef9160f540031",
"score": "0.5983907",
"text": "def update\n if @formation.update(formation_params)\n redirect_to admin_formations_path \n flash[:notice] = \"La formation a été mise à jour avec succès\"\n else\n flash[:alert] = \"Il y a... |
4ec29ab7d14b827759fcf05b1cb2f096 | Valid order_field: pu_name, order direction: incrementally | [
{
"docid": "c127489fe79e2ff5c1d7ff8a524a82e0",
"score": "0.0",
"text": "def test_ut_da10b_t1_06\n p \"Test 06\"\n # gets a list of subtasks ordered incrementally by pu_name\n subtasks = @pj.get_paginate_subtasks(1,\n \"pu_name\",\n \"asc\",\n PER_PAGE)\n\n # this subtask list ... | [
{
"docid": "a46ced4e6897c0ca575d74567dad45c9",
"score": "0.6645599",
"text": "def order\n @order || \"99_99\"\n end",
"title": ""
},
{
"docid": "c5ef9c02548f8abd6ff171214546ccab",
"score": "0.6395056",
"text": "def validate_order!(options)\r\n return unless options && option... |
5b3c1d291f28a64f32a8f05f775bdb6c | method to reverse the singly linked list note: the nodes should be moved and not just the values in the nodes time complexity: O(N) => Iterate througth the linked list once space complexity: O(1) => memory allocation not dependent on linked list size | [
{
"docid": "0c96ebe0875d831f583b710a69920f30",
"score": "0.80397725",
"text": "def reverse\r\n # Do nothing if the list is empty or only has one element\r\n return if @head == nil || @head.next == nil\r\n\r\n # Start with prev set to nil, so that 1st node will point to nil\r\n prev = nil\r\n... | [
{
"docid": "e3f42c1c182ad2d5a8f8d857e08a52f6",
"score": "0.87475175",
"text": "def reverse\r\n # start at head, create prev\r\n current = @head\r\n prev = nil\r\n \r\n # traverse the list\r\n while current != nil\r\n temp = current.next_node # save next node\r\n current.next_... |
e83fc6af1f371e536bc6c3589580de3e | POST /subjects POST /subjects.xml | [
{
"docid": "9e5b5df9156dcb317533184aa5924b58",
"score": "0.54001147",
"text": "def create\n hasError = 0\n @subject = Subject.new(params[:subject])\n if params[:teachers_id] == nil\n session[:error] =\"You have to select one or more teachers.\"\n hasError = 1\n else\n if @... | [
{
"docid": "cd49e914a97d3fb159411216e0c17890",
"score": "0.6739039",
"text": "def create\n @subject = Subject.new(params[:subject])\n\n respond_to do |format|\n if @client.subjects << @subject\n flash[:notice] = 'Subject was successfully created.'\n format.html { redirect_to cli... |
227f70b72409388993f2a1a4391fe5a0 | Detect if browser is Opera Mini. | [
{
"docid": "751034dc7a296e6e6adade75f8523324",
"score": "0.849835",
"text": "def opera_mini?\n !!(ua =~ /Opera Mini/)\n end",
"title": ""
}
] | [
{
"docid": "2119d06b162f3b75edee7f7fbde865bd",
"score": "0.83467996",
"text": "def opera_mini?\n !!(ua =~ /Opera Mini/)\n end",
"title": ""
},
{
"docid": "cdd26715719ae9ca02998fe8a20294c5",
"score": "0.798404",
"text": "def opera_browser?\n user_agent = UserAgent.parse(reque... |
266d06cb9033cc4ca84a2e7836f3c3d0 | Log the request being sent to the API verb A Symbol of the HTTP verb for the request path A String of the path of the request params A Hash of the request params being sent to the server | [
{
"docid": "c6650b2ddd2df6d129607c023d9ea7c7",
"score": "0.8185561",
"text": "def log_request(verb, path, params = {})\n return unless Evvnt.configuration.debug\n debug <<~TEXT\n Headers: #{headers}\")\n Request: #{verb.to_s.upcase} #{base_uri}#{path} #{params}\n ... | [
{
"docid": "5dc1e2caf368d741f7a67ceedd842e42",
"score": "0.71820515",
"text": "def log_request; end",
"title": ""
},
{
"docid": "3acbe9563d29968ed2fb73047b2ed16a",
"score": "0.69804037",
"text": "def log_request( msg, req )\n Kinokero::Log.log_request( msg, req, @options[:verbose]... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "3bf31dd8d646193730e4fee7964368b9",
"score": "0.0",
"text": "def set_omment\n @omment = Omment.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60322535",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6012846",
"text": "de... |
b774ba8da9c112ec91eac971c3d5019d | POST /leagues POST /leagues.json | [
{
"docid": "8122beec51fd23f15741e35ca09fba21",
"score": "0.57630825",
"text": "def create\n @league = League.new(league_params)\n\n respond_to do |format|\n if @league.save\n\n (0..(@league.size-1)).each_with_index do |i|\n fantasy_team = @league.fantasy_teams.create(owner: \"... | [
{
"docid": "3bd23a72f5b1a380adff35f7ccfa91b1",
"score": "0.6851047",
"text": "def create\n @team = Team.new(team_params)\n @leagues = League.all.order(:name)\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n ... |
c19d89555ba7f69961ad12183282560d | => "Hello, my name is Arel." | [
{
"docid": "1ea7fc469642af50538856b29c0fcd1b",
"score": "0.0",
"text": "def badge_maker(name)\n return \"Hello, my name is #{name}.\"\nend",
"title": ""
}
] | [
{
"docid": "82257a5ca5cb496eb0bdfb2d4219cdb9",
"score": "0.7116922",
"text": "def say_hello\n string = \"This is me saying, hello world!\"\n return string\n end",
"title": ""
},
{
"docid": "4ab132bf9b4a6348373d68fd6fef6a77",
"score": "0.7052",
"text": "def greet name\n\t\"Good... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "221fe56f27079b64affefab529c243f1",
"score": "0.0",
"text": "def set_profile\n @profile = Profile.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;... |
7813a649f3b11dbf0eef482771ca6203 | puts "this is a debug message" | [
{
"docid": "15275b9348e1a9c0f647e7d12936ce91",
"score": "0.0",
"text": "def solution(a)\n result = 0\n prev = 0\n i = 0\n while i < a.length\n diff = a[i] - prev\n if diff > 0\n result += diff\n end\n prev = a[i]\n i += 1 \n end\n return result\nend",
"title": ""
}
] | [
{
"docid": "59422abef433590bb630a39dafeff63b",
"score": "0.82900083",
"text": "def debug(msg); output(:debug, msg); end",
"title": ""
},
{
"docid": "099cbebe66d6a66a9c87aaaf15127f23",
"score": "0.81688136",
"text": "def debug(message)\n if @debug\n puts message\n end\n en... |
2568ff1b1c2408817c726b4af0288128 | Returns segwit address string which generated from hrp, witness version and witness program. | [
{
"docid": "aba8f7e575823e99ee9b88e33c1304bc",
"score": "0.6851139",
"text": "def addr\n Bech32.encode(hrp, [ver] + convert_bits(prog, 8, 5))\n end",
"title": ""
}
] | [
{
"docid": "d450c426f3b831190506cb5de4f25768",
"score": "0.642271",
"text": "def bech32_addr\n segwit_addr = Bech32::SegwitAddr.new\n segwit_addr.hrp = Bitcoin.chain_params.bech32_hrp\n segwit_addr.script_pubkey = to_hex\n segwit_addr.addr\n end",
"title": ""
},
{
"doc... |
e64cd0d182be0f13ae2a1a4503f017b9 | GET +url+ and return only its contents | [
{
"docid": "3c8f87225532e5dc1e98fc005504382a",
"score": "0.7232143",
"text": "def get_file(url)\n get(url).body\n end",
"title": ""
}
] | [
{
"docid": "76308ac57fb8027d690c39aaaf89a5f8",
"score": "0.7934429",
"text": "def get(url); end",
"title": ""
},
{
"docid": "9e6110df61274f59da4eb3ea27bb5004",
"score": "0.79276407",
"text": "def http_get(url)\n require \"open-uri\"\n URI.parse(url).read\n end",
"title": "... |
703101dd9d8794f8ed57ee7320ea05dd | GET /client_phones/1 GET /client_phones/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "e22472e3de1d815fb45823034e5a4f60",
"score": "0.70350486",
"text": "def client_phone\n method = \"clientPhone\"\n post_request(method)\n end",
"title": ""
},
{
"docid": "7e512c6ac5508a1f4ef20195b9134481",
"score": "0.6914883",
"text": "def show\n @mobile_client =... |
ed8097ab123fef64b37a45f15774481a | POST /reviews POST /reviews.json | [
{
"docid": "85994db11670ef825fea7b61cf0c2c04",
"score": "0.0",
"text": "def create\n @review = current_or_guest_user.reviews.new(params[:review])\n @review.dish = @dish\n @review.score = params[:score]\n\n if @review.save\n flash[:notice] = \"The review has been added.\"\n else\n ... | [
{
"docid": "8efc0fbf5b99d3ed070fc5f9e06c19f3",
"score": "0.7683334",
"text": "def create\n @review = @reviews.build(review_params)\n\n respond_to do |format|\n if @review.save\n format.json { render :index }\n else\n format.json { render json: @review.errors, status: :unpro... |
37eee2448daf1c25b43610e34ed01a8c | When an item changes position in a TiledLocation, check if the new position leads out an exit. If so, send them where the exit leads instead. | [
{
"docid": "4ec4d65d6e8de1156cf4b38bad2852b8",
"score": "0.7646558",
"text": "def item_change_position(item, old_pos, new_pos)\n exit = @state[\"exits\"].detect { |e| e[\"from\"] == new_pos }\n return super unless exit # No exit? Do what you were going to.\n\n # Going to hit an exit? Can... | [
{
"docid": "c8e8fcd3661a66ff0b90526779b69d64",
"score": "0.61300373",
"text": "def maze_teleport(exiting)\n \n print \"\\n\\n\\n------------------\"\n \n exiting_bef = exiting\n\n @exitsAlias = self.exits\n \n if (exiting.class == String)\n i = 0\n while (i < @exitsAlias.l... |
d5ab2bd160fdf7828f4bdb29cb1c0d1b | Extract breadrcumb from page so they can be migrated as folder names in vortex | [
{
"docid": "0e43a01fd0db4a9d415134fd41f4a3f0",
"score": "0.6893301",
"text": "def extract_breadcrumb\n\n end",
"title": ""
}
] | [
{
"docid": "8afe278795f419495991805d63edb3ca",
"score": "0.6610317",
"text": "def extract_filename2(doc)\n path = \"/\"\n breadcrumb = \"\"\n\n # Detect the frontpage /corner case\n # if(@doc.css(\"#path>.pathway>.pathway\").size > 0 and @doc.css(\"#path>.pathway>.pathway a\").size == 0)then... |
95f5b50bc55d0d40f49a38f3fe1dc451 | Matias Pan Implement this two methods for checking if a character is lower or upper case | [
{
"docid": "fd23de22483e011ada99320d9013e435",
"score": "0.7811522",
"text": "def is_upper?(c)\n return c == c.capitalize\n end",
"title": ""
}
] | [
{
"docid": "a30036676ec9e526aa04dd027b6dd8fc",
"score": "0.8421066",
"text": "def is_lower?(letter)\r\n letter != letter.upcase #if letter is not uppercase return true, else return false\r\nend",
"title": ""
},
{
"docid": "634188b040aa363a9f658102acdac1f9",
"score": "0.83290976",
... |
b9ca1ec4b5ee409e28512ad17a60f038 | process and return the end_date | [
{
"docid": "3681da32fa2d45a32d0818d41faec3df",
"score": "0.65815496",
"text": "def end_date\n\t\treturn @start_date + (@duration * 60)\n\tend",
"title": ""
}
] | [
{
"docid": "71e10e52933a3318a2c524bb80f32825",
"score": "0.7715274",
"text": "def end_date\n date\n end",
"title": ""
},
{
"docid": "c14e7b76a3517a78914d712863ba8ace",
"score": "0.7644058",
"text": "def end_date\n @end_date ||= begin\n date_string = @data[... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "c63e286c33179c0223751e0614a9d6cf",
"score": "0.0",
"text": "def set_phone_rental\n @phone_rental = PhoneRental.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;... |
1d59f59e4cfcf261714cb64a9e398421 | `current_player` The `current_player` method should take in an argument of the game board and use the `turn_count` method to determine if it is `"X"`'s turn or `"O"`'s. | [
{
"docid": "b31f4178327f529f3b4fd3aae125960b",
"score": "0.0",
"text": "def current_player(board)\n turn_count(board).even? ? \"X\" : \"O\"\nend",
"title": ""
}
] | [
{
"docid": "31e0e7c63347cb64f8765641111f88da",
"score": "0.816183",
"text": "def current_player(board)\n if turn_count(board) % 2 == 0\n \"X\"\n else\n \"O\"\n end\n end",
"title": ""
},
{
"docid": "8fa128db68e815aa183ec9b78814f7b6",
"score": "0.8140665",
"text": ... |
6d52c62df9ec2dce91b96a20cd20be7e | Retrieve a KalturaDropFolderFile object by ID | [
{
"docid": "320c87efe4c933ffe626d0408d59cb8f",
"score": "0.7573612",
"text": "def get(drop_folder_file_id)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'dropFolderFileId', drop_folder_file_id);\n\t\t\tclient.queue_service_action_call('dropfolder_dropfolderfile', 'get', kparams);\n\t\t\tif (clien... | [
{
"docid": "112c070531dc60b2294cb6ab9ead8ad4",
"score": "0.71115965",
"text": "def file_by_id(id)\n files.fetch(id)\n end",
"title": ""
},
{
"docid": "0b1cdc3fe9ea482e45503585d5d8ba44",
"score": "0.6894276",
"text": "def get(drop_folder_id)\n\t\t\tkparams = {}\n\t\t\tclient.a... |
c624b6c59a06e4e3452522de9df32535 | Minor version, as defined by the gemspec's Version module. For 1.5.3, this would return 5. | [
{
"docid": "224c9a2c09c5a0155279ecc15ea1779b",
"score": "0.82674533",
"text": "def minor_version\n @version_helper.minor\n end",
"title": ""
}
] | [
{
"docid": "6e8936a69e256e9d7705526ad1d19e0e",
"score": "0.8101256",
"text": "def minor(version)\n res = 0\n res = Regexp.last_match(1) if version =~ /^\\s*\\d+\\.(\\d+)\\.\\d+/\n res\n end",
"title": ""
},
{
"docid": "ea98d808c055b4fb1f7216321fee1aad",
"score": "0.7969... |
441595bf71d8732a44f4d9810cd63c92 | lexer rule colon! (COLON) (in Foma.g) | [
{
"docid": "229e390b953a24d39c8d04fd8fd67516",
"score": "0.7918219",
"text": "def colon!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 40 )\n\n\n\n type = COLON\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\... | [
{
"docid": "500032ac72127017a903c39744241a1c",
"score": "0.81599057",
"text": "def colon!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 11)\n\n type = COLON\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - ... |
b91762015530c916f1e8241cf0880081 | def converted_schedule the_schedule = Schedule.new(self.start_date) the_schedule.add_recurrence_rule(RecurringSelect.dirty_hash_to_rule(self.schedule)) the_schedule end | [
{
"docid": "e7f4a83d6ca67272657ed4d841d13719",
"score": "0.0",
"text": "def archive\n project_id = self.project_id\n if self.next_action\n all_chores = Chore.where(:project_id => project_id)\n if all_chores.where(:next_action => true).length == 1\n all_chores.update_all(:next_action... | [
{
"docid": "ccfdf4d583bc56eadbea820ad00eddfd",
"score": "0.75159526",
"text": "def get_schedule\n # Set the Occurrence start date and time and duration - end_time if the end time of the configured availability\n start_time = self.start_date\n end_time = get_end_date\n\n #Create the inital Sc... |
b1dcfbd6ddf123d4f5e57f1c681a7ccc | PATCH/PUT /gallerys/1 PATCH/PUT /gallerys/1.json | [
{
"docid": "4c457629f1bb18481b3dd21d37f0c7e4",
"score": "0.72314495",
"text": "def update\n respond_to do |format|\n if @gallery.update(gallery_params)\n @gallery.touch\n # if @gallery.published?\n # @gallery.published!\n # end\n format.html { redirect_to adm... | [
{
"docid": "df1d1868d4d91593f1c23aa4990225f0",
"score": "0.7561936",
"text": "def update\n @gallery = Gallery.find(params[:id])\n\n if @gallery.update(gallery_params)\n head :no_content\n else\n render json: @gallery.errors, status: :unprocessable_entity\n end\n end",
"title":... |
76278623ee7190431de1f3a92ac41560 | display the properties dialog for the selected door/window | [
{
"docid": "701729889db5bcb145df7fe6ec1645f9",
"score": "0.80552906",
"text": "def show_prop_dialog\r\n # puts \"wall = \" + @wall.inspect\r\n # puts \"window = \" + @obj.inspect\r\n case @objtype\r\n when \"Window\"\r\n\t\twindowtool = WindowTool.new\r\n results = MM_HouseBuilder.dis... | [
{
"docid": "0a6a599e401ba916dacf74e24d326251",
"score": "0.619035",
"text": "def properties_show_around(elt)\n bnds = elt.localToScene(elt.getBoundsInLocal)\n scr_x = @scene.x + @stage.x\n scr_y = @scene.y + @stage.y\n scr = Screen.getScreensForRectangle(scr_x + bnds.min_x, scr_y + bnds.min_... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "c50911053fc261a742d8b1ed1d3bee5b",
"score": "0.0",
"text": "def set_board\n @board = Board.friendly.find(params[:id] || params[:board_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... |
4cd855107ea86f72072d9d03d4786e5b | GET /attr_templates GET /attr_templates.json | [
{
"docid": "4c4bc357b7eb35e3c3ac12cef0e1aaec",
"score": "0.75401354",
"text": "def index\n @attr_templates = AttrTemplate.all\n end",
"title": ""
}
] | [
{
"docid": "88c544c265ccbafeced4b371a73363e4",
"score": "0.6775477",
"text": "def templates\n response = get 'templates'\n response.map{|item| Hashie::Mash.new(item)}\n end",
"title": ""
},
{
"docid": "f06a72d209c9ebfb01e22ac0cb84b0f6",
"score": "0.66033477",
"text": "de... |
c92185060ac9e936c08f36b211e14e68 | Action for press the cell | [
{
"docid": "3a732077b813bded8d1fce2c62fc471a",
"score": "0.0",
"text": "def tableView(tableView, didSelectRowAtIndexPath:indexPath)\n tableView.deselectRowAtIndexPath(indexPath, animated: true)\n moveDetail(indexPath.row)\n end",
"title": ""
}
] | [
{
"docid": "d26d35f88dd822158bbab24b42cd85d3",
"score": "0.74040973",
"text": "def cell_pressed (source)\n @delegate.shopBasicCell(self, buttonPressed: source) if @delegate.respond_to? 'shopBasicCell:buttonPressed:'\n end",
"title": ""
},
{
"docid": "40062e64b0e4ceb729e771b9476f9305",
... |
9d429ea15f6b90ade700d1deb32cfe08 | GET /statuses/new GET /statuses/new.json | [
{
"docid": "92baf84156c06272a37f00597b09027c",
"score": "0.62628525",
"text": "def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status.as_json(user: current_user)}\n end\n end",
"title": ""
}
] | [
{
"docid": "54f6dc15237f83d4848458ffd8bff27a",
"score": "0.7218971",
"text": "def new\n @status = current_user.statuses.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @status }\n end\n end",
"title": ""
},
{
"docid": "25c77e4e1b... |
44f1394a44e90f0f1e5087f25832d66d | Gets the rel canonical URL for the HTML document Gets the rel canonical URL of an HTML document. | [
{
"docid": "767416ed0a4909a5356acbe21560b343",
"score": "0.6716134",
"text": "def edit_html_html_get_rel_canonical_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: EditHtmlApi.edit_html_html_get_rel_canonical ...'\n end\n #... | [
{
"docid": "6cf540fe80c3d3d593fda3122ab006a3",
"score": "0.78335327",
"text": "def edit_html_html_get_rel_canonical(opts = {})\n data, _status_code, _headers = edit_html_html_get_rel_canonical_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "b3fa883c31640dcf405baed... |
37d7802628673d2394dfa737070bf048 | given a file, process it for redactions | [
{
"docid": "464fbec54e741ef54eb4e74f9cf4bf7a",
"score": "0.7225249",
"text": "def perform_redactions_on_file(filename)\n File.open(temp_out, 'w') do |outfile|\n lines_processed = 0\n lines_redacted = 0\n File.readlines(temp_in).each do |line|\n result = Problem2::Redac... | [
{
"docid": "ac746f7d6db605c6cc8dbd3bd2334fc7",
"score": "0.7935757",
"text": "def process_file file\n process_string File.read(file)\n end",
"title": ""
},
{
"docid": "0ce0112aafcba0d9c532e56604d34e56",
"score": "0.7719438",
"text": "def process_file(file)\n File.open(fi... |
5e6e4795130009ac37f2bf76990fec45 | Convert the file from some known format to html | [
{
"docid": "bde46448490b765b23025e9a6c54a327",
"score": "0.75801325",
"text": "def to_html(file, format)\n content = file\n content = File.open(file).read if File.exist?(file)\n\n case format\n when 'markdown'\n content = content.split('--CONTENT--')\n\n # process todo links\n content.last.... | [
{
"docid": "c7c88bc6476b596319de29669dd61ef7",
"score": "0.7063496",
"text": "def file_to_rendered_html(path, options = nil)\t\t\n\t\t\thtml_to_rendered_html(read_file(path), options)\n\t\tend",
"title": ""
},
{
"docid": "9fd5821589e3624b60451648e1fddb46",
"score": "0.7038756",
"text... |
251be858a5d002a64f19a1fa00c0d903 | Calcula la division de dos fracciones. | [
{
"docid": "1d6873b35a2f0b55c503d3e61047543a",
"score": "0.72421974",
"text": "def /(other) # Calcula la division de dos fracciones.\n Frac.new(@numerador * other.denominador, @denominador * other.numerador)\n end",
"title": ""
}
] | [
{
"docid": "a9e49014acdad62051717298a58fd4c4",
"score": "0.71781874",
"text": "def /(fraccion) #/\n n = fraccion.den * @num\n d = fraccion.num * @den\n Fraccion.new(n,d)\n end",
"title": ""
},
{
"docid": "5f0810cf5925a0a735873cb882ca3bd0",
"score": "0.7050331",
"text... |
eb130947482119800190cf1ea98f326c | DELETE /periodes/1 DELETE /periodes/1.xml | [
{
"docid": "1981b9673f0158e390ada6596744cf05",
"score": "0.70365995",
"text": "def destroy\n @periode = Periode.find(params[:id])\n @periode.destroy\n\n respond_to do |format|\n format.html { redirect_to(periodes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
}
... | [
{
"docid": "df26116eb86dbadafed7137f9e3c2f9e",
"score": "0.6711962",
"text": "def delete!\r\n return nil unless exists? \r\n xml = xml_at_top\r\n par = xml.instance_variable_get(:@parent) \r\n par['delete'] = 'delete'\r\n xml_on_delete( xml )\r\n rsp = write_xml_config!( xml.doc.... |
df5822287b56a26294158db5930ccfe1 | The server provides document highlight support. | [
{
"docid": "947208b399202239309739459b63fbc3",
"score": "0.6355593",
"text": "def document_highlight_provider\n attributes.fetch(:documentHighlightProvider)\n end",
"title": ""
}
] | [
{
"docid": "13ad5b6eb7a46d3251d55bcd74158e54",
"score": "0.80923635",
"text": "def document_highlight; end",
"title": ""
},
{
"docid": "4c3fdd5efdc98d364ddbb68617f2db9b",
"score": "0.7757707",
"text": "def document_highlight_provider; end",
"title": ""
},
{
"docid": "04fd... |
615c7b1f8621c56578f178307b23ee2d | Select a method from a given array of methods | [
{
"docid": "bd64a1bdc4271f9a32a8f3523804d2ae",
"score": "0.7354829",
"text": "def select_method methods\n raise NotImplementedError\n end",
"title": ""
}
] | [
{
"docid": "6df69fcfba5b4c3763596daa49333b61",
"score": "0.69440603",
"text": "def pick(*method_symbols)\n if method_symbols.empty?\n return nil\n elsif method_symbols.length > 1\n return collect{|element|\n method_symbols.collect{|meth|\n element.send(meth)\n }\n ... |
41e95045eb7cfa242b71b8b373a5c77c | Metodo para insertar por la cola | [
{
"docid": "51db0c866e4b60001147951f9e29c3d0",
"score": "0.0",
"text": "def insert_tail (value) # Insertar desde la cola ( este es el que usaremos para practica 7)\n\tnodo=Node.new(value,nil,nil)\n nodo.prev = @tail\n @tail = nodo\n if (@head == nil)\n @head = nodo\n ... | [
{
"docid": "1146ec55b14135ff2aba9dc4a63e7444",
"score": "0.7844993",
"text": "def insert()\n\n end",
"title": ""
},
{
"docid": "68cff14b6dad2713ba2f45ae337c57a5",
"score": "0.76347846",
"text": "def insert(value)\n # YOUR WORK HERE\n end",
"title": ""
},
{
"docid": "... |
f5747371f1cbd11bf3c0b7a1128e10ad | ==== Parameters layout:: The layout that should be used for this class ==== Returns ~to_s:: The layout that was passed in | [
{
"docid": "ca3e4598709fd6f421a52a8f45a9c397",
"score": "0.70119166",
"text": "def layout(layout)\n self._layout = layout\n end",
"title": ""
}
] | [
{
"docid": "db20ea547a326a111bef28c84723dac7",
"score": "0.72939956",
"text": "def layout\n properties[:layout]\n end",
"title": ""
},
{
"docid": "add3fdbf85699182887d682e68f452e7",
"score": "0.72782946",
"text": "def get_layout(layout)\n logger.debug( [ 'layout', \"#{$pjp... |
0f42112a518d7c1088af2a9ce8e28786 | Get Ingredient Substitutes Search for substitutes for a given ingredient. | [
{
"docid": "676707ad45e1c889a600ebc29cfd4e88",
"score": "0.7350362",
"text": "def get_ingredient_substitutes(ingredient_name, opts = {})\n data, _status_code, _headers = get_ingredient_substitutes_with_http_info(ingredient_name, opts)\n data\n end",
"title": ""
}
] | [
{
"docid": "0152d8a4fd2a353992a9f86f7ef03073",
"score": "0.66307217",
"text": "def get_ingredient_substitutes_by_id(id, opts = {})\n data, _status_code, _headers = get_ingredient_substitutes_by_id_with_http_info(id, opts)\n data\n end",
"title": ""
},
{
"docid": "4dd5030a42f7511... |
912c0e0cf8816366872f1b29941d2de1 | DELETE /events/1 DELETE /events/1.json | [
{
"docid": "d1969a852ec23c24beaffd2232a5a9d2",
"score": "0.0",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Event was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] | [
{
"docid": "11f7138ce2d6d84fa0d9949fbd14cb07",
"score": "0.76929694",
"text": "def destroy\n @event = Event.using(:shard_one).find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
... |
19de3ea4d51627e37c733c546be5c05f | Find the model by its ID, or return a new model. | [
{
"docid": "76808fe5d7559771af20687f1b9dd4db",
"score": "0.0",
"text": "def model\n model_class.send resource_finder_method, resource_id\n end",
"title": ""
}
] | [
{
"docid": "cdf7d1a6540fa36e2ab080d00a27e107",
"score": "0.81009424",
"text": "def find_model\n return nil unless model\n model.find(params[:id])\n end",
"title": ""
},
{
"docid": "99bd8952d7cbe16a0d1b56d2faac9386",
"score": "0.77597946",
"text": "def find(id = nil)\n ... |
97fb0df80b0d2c8835c7f12aa530cd6d | This produces a list of error message, error mapping pairs. ActiveRecord, in some cases, will automatically try to validate associated models when you call valid on the base model. As such, the actual `error_mapping` instance variable will be on the associated model. It will create an error key that looks like `base.as... | [
{
"docid": "8b13471fb7c9507902adc7a05e41076c",
"score": "0.81619406",
"text": "def error_mappings\n error_pairs = []\n each do |key, mapping_key|\n delineated_keys = key.to_s.split('.')\n\n mapping = @error_mapping\n error_message = mapping_key.dup\n if ... | [
{
"docid": "1f7b15bcdac8c1daecb9262c49599c56",
"score": "0.65685755",
"text": "def errors\n errors = record.errors.dup\n association_records.each do |record|\n record.errors.each do |attribute, message|\n if attribute == \"base\"\n errors.add_to_base(\"#{record}: #{message}\")... |
8eaf2e9a4db9bbc1b2cf65df121b7a04 | infer base network/CIDR values from IP/netmask | [
{
"docid": "7a6ecb6ad3e8a9fcb0ff079ee83b087f",
"score": "0.6736135",
"text": "def recommended_value\n begin\n address = @config_items.fetch('ipaddress').value\n nm = @config_items.fetch('netmask').value\n rescue IndexError => e\n say_yellow(\"WARNING: #{e}\") if !@sil... | [
{
"docid": "b94f76bb7297df57315a59d582600d52",
"score": "0.7137294",
"text": "def ip_address_with_mask\n ip_address.try(:to_cidr_s)\n end",
"title": ""
},
{
"docid": "9b6ad54518abaa164f7f64804ea8f8d4",
"score": "0.7081036",
"text": "def ip_v6_cidr; end",
"title": ""
},
{
... |
89f271f9ccb2859feddb72d6527a7da4 | Extract Traffic Manager Profile Name from Endpoint id(String) | [
{
"docid": "69899582af9d77c788d751fa8e40b667",
"score": "0.882458",
"text": "def get_traffic_manager_profile_name_from_endpoint_id(endpoint_id)\n endpoint_id.split('/')[8]\nend",
"title": ""
}
] | [
{
"docid": "4a40582354b505b860f8429929889503",
"score": "0.63507956",
"text": "def get_uid endpoint\n\t\t\t\t@endpoints[endpoint.downcase][:uid]\n\t\t\tend",
"title": ""
},
{
"docid": "e948282f08811d9832a85ca6a590216f",
"score": "0.6233662",
"text": "def profile_name\n ng_xml.cs... |
0a29046f0e6c0374367ae32e97e5bc7e | Create an account This endpoint creates an account related to a connection or not. | [
{
"docid": "01277654212302bbaa2c3c673b01e5ae",
"score": "0.0",
"text": "def users_id_user_accounts_post(id_user, name, opts = {})\n data, _status_code, _headers = users_id_user_accounts_post_with_http_info(id_user, name, opts)\n data\n end",
"title": ""
}
] | [
{
"docid": "868777c7674c8ea39260dbe7317b4d0e",
"score": "0.7737544",
"text": "def create_account(opts)\n HelloSign::Resource::Account.new post('/account/create', :body => opts)\n end",
"title": ""
},
{
"docid": "9079939177e869a00a4ac4621a4eba3b",
"score": "0.7697475",
"te... |
ac16507a005e8bd4e1a59d2b23e9d3bd | Delete documents by a given query. Per: | [
{
"docid": "13a92312067c03785e74b4cc41a99687",
"score": "0.74437195",
"text": "def delete_query(query, params = {})\n do_delete_query(query, params)\n end",
"title": ""
}
] | [
{
"docid": "ff2d7afe7308a03f445d782fd15b0e43",
"score": "0.825307",
"text": "def delete_by_query index, query, conflicts_proceed\n conflicts = conflicts_proceed ? 'conflicts=proceed' : ''\n uri = URI(\"http://#{@host}:#{@port_s}/#{index}/_doc/_delete_by_query?#{conflicts}\")\n\n req = Net::HTTP... |
f93209f31e90d7e50eb684bb0560207c | serialize would treat false the same as nil | [
{
"docid": "d9549b932e2b332c4cff1a90ec15ccd6",
"score": "0.0",
"text": "def value=(x)\n x = x.to_yaml unless x.nil?\n write_attribute :value, x\n end",
"title": ""
}
] | [
{
"docid": "19a2797f5ec2cbc6bde04faf10dba814",
"score": "0.8207427",
"text": "def serialized?; end",
"title": ""
},
{
"docid": "19a2797f5ec2cbc6bde04faf10dba814",
"score": "0.8207427",
"text": "def serialized?; end",
"title": ""
},
{
"docid": "19a2797f5ec2cbc6bde04faf10db... |
e561e11bcf379ef5dc139c210017366b | Only allow a list of trusted parameters through. | [
{
"docid": "0aad4d64b3204ad4506709161816e50d",
"score": "0.0",
"text": "def autors_libro_params\n params.require(:autors_libro).permit(:libro_id, :autor_id)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7476923",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "36956168ba2889cff7bf17d9f1db41b8",
"score": "0.71697617",
"text": "def set_param_whitelist(*param_list)\n self.param_whitelist ... |
2ea57d910303afecd1cf1815b9a962f1 | Where in the X area the label is drawn Centered in the field, should be width/2. Start, 0. | [
{
"docid": "98b9a28360b4602d73ede476d1909c89",
"score": "0.7450555",
"text": "def x_label_offset( width )\n 0\n end",
"title": ""
}
] | [
{
"docid": "87c13b51b5338d191654efa89a96b07b",
"score": "0.7308628",
"text": "def center_x\n (Graphics.width / 32 - 1) / 2.0\n end",
"title": ""
},
{
"docid": "87c13b51b5338d191654efa89a96b07b",
"score": "0.7308628",
"text": "def center_x\n (Graphics.width / 32 - 1) / 2.0\n e... |
157513ac5c34434933e6b637291c69bb | def getSerializerById Arguments: serializerName: Name of the Serializer ( String ) Returns: Serializer | [
{
"docid": "5a14880f424e4e8908372dfb7e337dfe",
"score": "0.8090533",
"text": "def getSerializerByName( serializerName )\n\n # parameter TypeCheck\n #BIMserverAPI::TypeCheck::String( serializerName )\n\n # BIMserver request\n request( { serializerName: serializerName } )\n end",
... | [
{
"docid": "f51cbfe276f6148d1af474f4304eb874",
"score": "0.7343584",
"text": "def get_serializer(name)\n if s = serializers[name]\n s\n else\n Fields.traverse_association_tree(name, serializers, associations, aliased_associations)\n end\n end",
... |
6757b80a34b1c62c88d18cd44595fd2f | PATCH/PUT /opens/1 PATCH/PUT /opens/1.json | [
{
"docid": "54f9031708a3cb90185b1f40ad49996e",
"score": "0.0",
"text": "def update\n door = Door.find params[:door_id]\n open = Open.new(open_params)\n respond_to do |format|\n if open.send_to_server(door.open_uri)\n format.js { redirect_to door_path(door), format: 'js', success: 'r... | [
{
"docid": "0c1a09a9d20ee815b5c9f998eda70b44",
"score": "0.6263258",
"text": "def patch(path, params = {}, options = {})\n options[:content_type] ||= :json\n options[:Authorization] = \"simple-token #{self.access_token}\"\n RestClient.patch(request_url(path), params.to_json, options)\n end",
... |
8b2c0222d1c1b41b0b593599e96e45b0 | Optparse doesn't properly handle the case where you specify an argument with mandatory input and then pass another argument after it. It detects the second argument as input to the first argument. For example, if you have two arguments with mandatory input, username NAME and publickeypath PATH, defined in optparse, and... | [
{
"docid": "d138fb0dce54f6649765372fe78c76d8",
"score": "0.6497439",
"text": "def catch_argument_passed_as_input(arg_list, arg, arg_input)\n arg_list.each do |arg_element|\n if arg_input.strip == arg_element\n exit_failure(missing_input_msg(arg))\n end\n end\n ... | [
{
"docid": "d4da4cf5324a87eef7aef81b0fd62909",
"score": "0.7204104",
"text": "def validate_arguments!(list)\n chk_idx = list.find_index do |item|\n item.start_with?(\"-\")\n end\n if chk_idx\n marker = list.find_index do |item|\n item == \"--\"\n ... |
10d39398b1128d97b97824c8f03dcd65 | GET /activities/1 GET /activities/1.xml | [
{
"docid": "3d9bdab49122cb252772d0a51d62003e",
"score": "0.0",
"text": "def show\n\n @title_description = \"Show Activity\"\n @activity = Activity.find(params[:id]) \n \n# @program_id = Program.find_by_sql [\"SELECT * FROM programs where activity_id = ?\",@id];\n# @category_id = Category.f... | [
{
"docid": "63b3a970941149325bce66e9eaded074",
"score": "0.77731735",
"text": "def activity(id)\n get(\"/api/activities/#{id}\")\n end",
"title": ""
},
{
"docid": "85c1a0e9f35edaa903a723ebc94de74f",
"score": "0.744107",
"text": "def show\n @activity = get_user.activities.f... |
8c3e07b6fca83982a0547ec868db9a62 | Search all users for a handle that matches the provided sting via regex. Returns up to limit matching users in no partiucular order. ===ARGS: handle is a search query to search existing handles for a match to, a String. limit should be the maximum number of User handles you want returned. The default limit is 50. | [
{
"docid": "3990a33545afb527f3e785ce831be3f0",
"score": "0.82947737",
"text": "def user_search(handle, limit = 50)\n results = []\n User.where(handle: /#{handle}/i).limit(limit).each do |user|\n results << user.handle\n end\n return results\n end",
"title": ""
}
] | [
{
"docid": "9ebb25d2e3be96f06ba237b9a7887530",
"score": "0.6133902",
"text": "def user_matches(search,count=false)\n results = []\n rangelen = 17 # Max minecraft username length is 16, add 1 for * entry\n count = 5 unless count # Most of the time we aren't returning results if there is more tha... |