query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
ca762f80c4e6c1e97255c0f16991616b
Used by EndProductEstablishment to determine what modifier to use for the effectuation EPs
[ { "docid": "763da19395ae10e89e86fe7a88bf347a", "score": "0.662736", "text": "def valid_modifiers\n HigherLevelReview::END_PRODUCT_MODIFIERS\n end", "title": "" } ]
[ { "docid": "90399706b46352a200f525bdc21b5c63", "score": "0.6724711", "text": "def modifier\n fetch('science.modifier')\n end", "title": "" }, { "docid": "4cc47d4349636adb04385c8fa4e5e840", "score": "0.6467422", "text": "def modifier\n @modifier\n end", "title"...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "5a0f59a3dc706df0069631f9af17c8a5", "score": "0.0", "text": "def set_user\n @user = current_user.empresa.users.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...
b5fe405b40ab55f5969afa16026c3615
Get Originator of an order
[ { "docid": "dba8ba34eedfd4766b1a5a9b0765370c", "score": "0.7464935", "text": "def get_originator_of_order(id)\n goto_customer_info\n find(:xpath, \"//*[@id='atg_commerce_csr_customer_order_searchResultsTable']//a[contains(text(),'#{id}')]/../../td[7]\").text\n end", "title": "" } ]
[ { "docid": "042215ca9adf0a06779e271641ee92b6", "score": "0.6831207", "text": "def originator()\n @orignator = self.original_message.sender if @originator.nil?\n return @orignator\n end", "title": "" }, { "docid": "e2a8688e2d39aceb960a59345556d012", "score": "0.6751569", "text"...
eb42a40e9e2af2ef3525c2bbcf47e7c3
13.2.5.33 Attribute name state
[ { "docid": "f36bfa15123a5888be80b29e5a0b023c", "score": "0.7469912", "text": "def parse_attribute_name_state\n case consume_next_input_character\n when *WHITESPACE\n when \"\\u002f\", \"\\u003e\", EOF\n # Reconsume in the after attribute name state.\n reconsume(:after_attrib...
[ { "docid": "16d20ba640b02d42c7ede34a10c8168c", "score": "0.76192236", "text": "def attribute(name); end", "title": "" }, { "docid": "7b69484fdfc65aba73be562c500711a8", "score": "0.74637103", "text": "def attribute_was(attr_name); end", "title": "" }, { "docid": "7b69484fd...
07f75205cc1ccc0b3369e1a15d7827ac
PATCH group_set_admin_path(group_uuid: group.uuid, user_id: user.id)
[ { "docid": "382593963b4854d50dd0d36098ebce14", "score": "0.0", "text": "def set_admin\n # Rende un utente amministratore e gli rimuove il titolo, se lo è già\n @membership.admin = !@membership.admin\n\n if @membership.save\n flash[:success] = \"L'utente #{@user.name} è stato \" +\n (@...
[ { "docid": "12b751e36302cba9a90b91add23d56dc", "score": "0.715388", "text": "def set_group_admin\n @group_admin = GroupAdmin.find(params[:id])\n end", "title": "" }, { "docid": "4b25b7682a58990c8ff754ac5d9d77a2", "score": "0.70501876", "text": "def update\n @group = Group....
4125116176b1ef79c4952802564fea98
(self..x, self.y, width, height) specify the enclosing rectangle angels are degrees
[ { "docid": "36dcebdbb5924fa60b78a8bf43038b20", "score": "0.0", "text": "def fill_arc width, height, starting_angle, arc_angle\r\n \r\n return unless @pen_down\r\n \r\n @gr.fill_arc @x, @y, width, height, starting_angle, arc_angle\r\n \r\n end", "title": "" } ]
[ { "docid": "dfb7652fb423eb4bc5b364fcf8ef427c", "score": "0.6807039", "text": "def ann_rect(top, left, width, height)\n end", "title": "" }, { "docid": "c7c39e35a7b78316d63f3f874375f1ee", "score": "0.6763061", "text": "def rect; end", "title": "" }, { "docid": "c7c39e35a7...
f0306409af3499ff68d9b2fac5191f1b
You need to specify a product. For a static library you can use PBXFileReference.new_static_library.
[ { "docid": "e323b7f0ab4f0c7314ea6c823004d4de", "score": "0.5709724", "text": "def initialize(project, *)\n super\n self.name ||= product_name\n self.build_rule_references ||= []\n self.dependency_references ||= []\n\n unless build_phase_references\n ...
[ { "docid": "8a24039c4ec6eda6408b26fb07008efe", "score": "0.695657", "text": "def new_product_ref_for_target(group, product_basename, product_type)\n if product_type == :static_library\n prefix = 'lib'\n end\n extension = Constants::PRODUCT_UTI_EXTENSIONS[pro...
92644adfe231ee6aca6083f8efd5d5e3
def get_text_scan_iters(line_num, search_str) st, en = get_line_iters(line_num) s, e = st.forward_search(search_str, Gtk::TextIter::SEARCH_TEXT_ONLY, en) end
[ { "docid": "a6afcc72ff55286298881ae614af8ce7", "score": "0.0", "text": "def apply_tag_to_line(line, tag, search_str = nil)\n\t\t\ts, e = get_line_iters(line, search_str)\n\t\t\tbuffer.apply_tag(tag, s, e)\t\n\tend", "title": "" } ]
[ { "docid": "46d3b96d793ded6d47eefd28c5da8cc6", "score": "0.7234153", "text": "def search(ent, txtvu)\n start = txtvu.buffer.start_iter\n first, last = start.forward_search(ent.text, Gtk::TextIter::SEARCH_TEXT_ONLY, nil)\n count = 0\n while (first)\n start.forward_char\n first, last = start.for...
8d97b818d57cd6fb39ab1dfe238f7257
Baseline implementation for the update_subnet REST call
[ { "docid": "4d3a9f3328e90e614734e8a898cb4b62", "score": "0.7373355", "text": "def update_subnet request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_update_subnet_...
[ { "docid": "4e60e0c720b3c48b8ffc43fff5d3d913", "score": "0.75309676", "text": "def patch(subnet_name, options = {})\n @uri += \"?api-version=#{api_version}\"\n end", "title": "" }, { "docid": "8aea1cfa7f45661b5776bc34c2e9c8b7", "score": "0.7395889", "text": "def update\n ...
8315968031f9d7fe54421508ee7677d9
destroys all copies of this standard object
[ { "docid": "a553f0db1906ed3daed0615d63cb6263", "score": "0.6680939", "text": "def destroy_copies\n return unless is_standard?\n\n if self.class.log_replication?\n lines = []\n lines << \"***** DESTROYING COPIES BEFORE DESTROYING STANDARD ***************************************\"\...
[ { "docid": "ab77299a38a2493a653395073083a200", "score": "0.7317082", "text": "def clear() \n @obj.clear() \n end", "title": "" }, { "docid": "611d0e71e33becff3b8be21fcfb7cadd", "score": "0.7309369", "text": "def desist\n self.class.delete self\n end", "tit...
c029c0529189f51f2064606242ed3bcf
Returns an array of Location objects based on the locations found in the page.
[ { "docid": "a79a9303c6e6d69b0d9b00c965799de7", "score": "0.6096105", "text": "def locations\n body_element = hpricot_doc.at(@content_css_selector)\n master_extractor = Extractors::Master.new(body_element)\n master_extractor.locations\n end", "title": "" } ]
[ { "docid": "ef4406a5cf11c2708743de6b135fc76e", "score": "0.7371326", "text": "def locations\n Array(location)\n end", "title": "" }, { "docid": "b5b5334893aee549f105bd57e32b15f7", "score": "0.7181847", "text": "def locations(options={})\n locator.to_a\n end", "tit...
77e87961495d4f567d4f5444affd2638
Testing default commands, more testing is in test_uwchat_server_command.
[ { "docid": "27ab5daaeb3ef47fc36940ab88755657", "score": "0.66267926", "text": "def test_client_quit_command\n # Replacing mocked command with the real commands\n @server.instance_variable_set( :@my_commands, @real_commands )\n \n user = @users.last\n # insure we have the user\n assert ...
[ { "docid": "614e3b8b7184a5fa5c90fa4baa8dcdb9", "score": "0.6913863", "text": "def test_help\n \tassert_equal(UI.parseCommand('help', HelpCmd1*\" \"),UI.main(HelpCmd1))\n \tassert_equal(UI.parseCommand('help', HelpCmdInv*\" \"),UI.main(HelpCmdInv))\n end", "title": "" }, { "docid": "48edc6...
6d2bd45f1bb1af688f65fe3fbc2543db
Returns all the attributes
[ { "docid": "d5bb748b6040b6305d74cb67a586b9d4", "score": "0.7903287", "text": "def attributes\n @attributes ||= @raw_attributes.map { |x| Attribute.new(*x.to_a.first) }\n end", "title": "" } ]
[ { "docid": "d62040f3c6111fd20affdf46a5fa74af", "score": "0.866049", "text": "def all_attributes\n @attributes\n end", "title": "" }, { "docid": "d62040f3c6111fd20affdf46a5fa74af", "score": "0.866049", "text": "def all_attributes\n @attributes\n end", "title": "" ...
29e4bfba1ca480c97da97dbb045dba62
Return each of the databases in this application (as a Cube object).
[ { "docid": "0e933842183106a7dd6752edecdb1aa7", "score": "0.6870734", "text": "def cubes\n require_relative 'cube'\n try{ @app.getCubes().getAll().to_a }.map{ |c| Cube.new(self, c) }\n end", "title": "" } ]
[ { "docid": "c4b8e9153bfcdd96013361c03479d0f1", "score": "0.80465895", "text": "def databases\n Delphix.get(Delphix.database_url).body.result\n end", "title": "" }, { "docid": "722829d2df8640d5212529cc4078b0b9", "score": "0.7881574", "text": "def databases\n connection.ge...
1882140bd2a1b980d0939bee7f507cd5
intro with coding language specialty
[ { "docid": "cffa2d6aace24872d045af6030fdf447", "score": "0.59903467", "text": "def coding_with_language(#{name}, #{language})\n puts \"Hi, my name is #{name} and I am learning to program in #{language}!\"\nend", "title": "" } ]
[ { "docid": "d5e400832b9856645cc6e7cddd895cfe", "score": "0.7084321", "text": "def introduction\r\n\r\n end", "title": "" }, { "docid": "53dd321289b8681a072c6bb1d671f90c", "score": "0.7046275", "text": "def introduction_with_language(name,language)\n puts \"Hi, my name is #{name} and...
baf1adf53508c1846631b10afabe72fc
Returns the bucket index for a value
[ { "docid": "a7ec59bdda8aa99f4cbe34ea9a79e1d5", "score": "0.8605435", "text": "def bucket_index(value)\n return 0 if value < @min_bucket_value\n return @number_of_buckets - 1 if value >= @max_bucket_value\n\n ((Math.log(value) - Math.log(@min_bucket_value)) / @bucket_size).floor\n end",...
[ { "docid": "3a1e482e5e994ea3c7b63a83a1dbb7ac", "score": "0.76771814", "text": "def bucket(hash_value)\n (hash_value.abs % 100) + 1\n end", "title": "" }, { "docid": "d7dc4506469a8d05a0f01ec0cdad8811", "score": "0.67564315", "text": "def value_index\n VALUES.index value\n...
6bee304c4ad4eb81b8df328214ea4879
Requires that the value is a valid sheet view type. valid types must be one of normal, page_break_preview, page_layout
[ { "docid": "9196af80e696cb64a9253a4a672321b2", "score": "0.8437417", "text": "def validate_sheet_view_type(v); end", "title": "" } ]
[ { "docid": "c1468a6599bb28c8f37694aacbad5bdd", "score": "0.6646245", "text": "def validate_pane_type(v); end", "title": "" }, { "docid": "7c2783e17335b619a081a09f80cff68b", "score": "0.6439712", "text": "def sheet_view; end", "title": "" }, { "docid": "728cf9f7f338ff8cb5d...
6cd5f98763bab4c774fb4acb2380ef21
Gets the lists of status codes that when matched, traffic will be sent to the "fallback_host". An exception will be thrown if fallback status codes are set when "fallback_host" has not been specified.
[ { "docid": "fda6545de7647450d860d9fb98f71507", "score": "0.62355983", "text": "def fallback_status_code\n super\n end", "title": "" } ]
[ { "docid": "0e0b510d75d83c0452399e10d9b1e498", "score": "0.6435455", "text": "def add_fallback_status_code(opts)\n opts = check_params(opts,[:status_codes])\n super(opts)\n end", "title": "" }, { "docid": "13eb1d5e0df318aa8441cd11a06c7623", "score": "0.62948036", "text":...
2969baeafd59c13717ea57a9d67e8cdb
call the block with the values as parameters only if they are all present
[ { "docid": "2441177bba4b14454e21c14aa92911a9", "score": "0.0", "text": "def and(*complements)\n raise(TypeError, 'a block is expected') unless block_given?\n options = [self] + complements.each_with_index.map { |o, i| Option.expected!(o, \" at index #{i}\") }\n options.all?(&:some?) ? Opt...
[ { "docid": "c7f4d17f867d5a858c96eb65b2a3bea7", "score": "0.6808102", "text": "def values value=nil, &block\n @values=value || block if value || block_given?\n @values\n end", "title": "" }, { "docid": "b737be105fd3e61cce08722abe0dca64", "score": "0.6566169", ...
3988a157cef265973607ac16024f2fe9
Lists all groups that a user belongs to. Warning: Utilizes serverside recursive search but may be slower than walking the tree clientside.
[ { "docid": "046df91e5955bac2ab74a7a273141399", "score": "0.71732813", "text": "def all_ldap_groups(username)\n return [] if service.nil?\n results = service.search(base: group_tree,\n filter: Net::LDAP::Filter.eq('objectcategory', 'group') &\n Net::LDAP:...
[ { "docid": "24e6abcc6cb92c4c8556e93c612ed1df", "score": "0.766122", "text": "def groups\n response = @api.request(:get, \"users/#{@userid}/groups\")\n parse_with_meta(response, \"//data/groups/element\")\n end", "title": "" }, { "docid": "bb7b2ade13482ade456ebbc89f5f42b9",...
f991e0d502a14552dc85f59578f65ff8
I worked on this challenge with: Kathryn Your Solution Below
[ { "docid": "605810bacaf4d08ecec6675b0b2234f2", "score": "0.0", "text": "def get_grade(grade)\n if grade >= 90\n return 'A'\n elsif grade >=80 && grade < 90\n return 'B'\n elsif grade >=70 && grade < 80\n return 'C'\n elsif grade >=60 && grade < 70\n return 'D'\n else return 'F'\n end\n...
[ { "docid": "b9960478999684c2b536f76e22f6fc63", "score": "0.6597748", "text": "def solution4(input)\n end", "title": "" }, { "docid": "61a5aa5387d7586d627164f40eaf623a", "score": "0.64431083", "text": "def solution6(input)\n end", "title": "" }, { "docid": "aa89b26c88485...
23df619760c72d01dac6a2cd2c67c36a
Returns available options for kinds of notify methods.
[ { "docid": "6b79e3c5d2101b39f2d490da5bd47384", "score": "0.6851832", "text": "def available_options\n [:key, :group, :group_expiry_delay, :notifier, :parameters, :send_email, :send_later, :pass_full_options].freeze\n end", "title": "" } ]
[ { "docid": "449ad7670b9de71568307631fd5fb55f", "score": "0.6878917", "text": "def available_notifier_options\n [:printable_notifier_name, :printable_name].freeze\n end", "title": "" }, { "docid": "d5a20411a5a77db2865a9bb5190eb7f2", "score": "0.6535331", "text": "def get_o...
79b2c71d467a75ed693fb192e060a48a
Example For picture = ["abc", "ded"] the output should be addBorder(picture) = ["", "abc", "ded", ""]
[ { "docid": "70d1703fa044358d10caac64e727dfe0", "score": "0.8701211", "text": "def addBorder(picture)\n picture.map! { |el| el = '*' + el + '*' }.unshift( '*' * ( picture[0].length) ).push( '*' * ( picture[0].length) )\nend", "title": "" } ]
[ { "docid": "872886e5bd4d99b5ab4b1360f43668ea", "score": "0.8756257", "text": "def addBorder(picture)\n border = Array.new\n \n for i in 0..(picture[0].length+1)\n border << \"*\"\n end\n \n border = border.join(\"\")\n \n finalArray = Array.new\n \n for i in 0..(pict...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "6be7733d07b6acf227af792a7635e329", "score": "0.0", "text": "def image_params\n raw_image_params = params.require(:image)\n raw_image_params.permit(:title, :url).merge({\n :aspect_ratio => image_aspect_ratio(raw_image_params[:url])\n })\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69792545", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781151", "text": "def strong_params\n params.requ...
745ea8c38bdcd0a70db59a770ceaca4e
Wait for an element to appear in the DOM
[ { "docid": "f38eff576d4afb6ef1dd0ea7d112de58", "score": "0.6898806", "text": "def wait_for_element(id, name, time)\n wait = Selenium::WebDriver::Wait.new(:timeout => time)\n wait.until {@driver.find_element(id => name) }\nend", "title": "" } ]
[ { "docid": "99dfe4e8e958f6276b2bb63f1f553a7a", "score": "0.8048109", "text": "def wait_for_element(element)\n @wait.until {\n bool = false\n\n if(element.displayed?)\n bool = true\n @element = element\n break\n end\n\...
855b673805357e1da26da40aa91c3b33
DELETE /channels/1 DELETE /channels/1.json
[ { "docid": "efe9910516c5904d639a14c84f0d65cc", "score": "0.69463253", "text": "def destroy\n @activity = Activity.create(user_id: current_user.id, activity_type: 'Destroy', target_type: 'Channel', target_id: @channel.id)\n @channel.destroy\n respond_to do |format|\n format.html { redirect...
[ { "docid": "e09061cfc4fb587636e0e97c35263002", "score": "0.79550797", "text": "def destroy\n @channel = Channel.find(params[:id])\n @channel.destroy\n\n respond_to do |format|\n format.html { redirect_to channels_url }\n format.json { head :ok }\n end\n end", "title": "" }, ...
d3ea6c8b8d97dda881e66d80fb99ddf2
confirm new account with email confirmation_token
[ { "docid": "948aeb06bf43c7e0070f9094beea4720", "score": "0.70429075", "text": "def confirm\n @user = User.first(:conditions => { :confirmation_token => params[:id] })\n if @user.nil?\n flash[:notice] = 'This link is not valid..!'\n signin()\n else\n @user.update_attributes(:confi...
[ { "docid": "9fae062e31d44b5082c17b6a609a3040", "score": "0.8084427", "text": "def confirm_email\n\t user = User.find_by(confirm_token: params[:confirm_token])\n\t if user\n\t \t# Reset all the actions\n\t\t\tuser.email_confirmed = true\n\t\t\tuser.confirm_token = \"\"\n\t\t\tuser.save\t\n\t\t\t...
1d3b315de2e9208454fad7fe93b0e423
GET /items/1 GET /items/1.json Display a specific item
[ { "docid": "3a8b68009d65a837bd7dfedbd3c8b291", "score": "0.0", "text": "def show\n # Find item from DB\n @item = Item.find(params[:id])\n # Get item location\n #@location = @item.postal_code\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @i...
[ { "docid": "41699dd17c12d7e8d1afd1406f087302", "score": "0.82317936", "text": "def item(id)\n get(\"/item/#{id}.json\")\n end", "title": "" }, { "docid": "eb354ffc8205e277e16c339add996ccd", "score": "0.8148269", "text": "def show\n item = Item.find(params[:id])\n render jso...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "5810cf14a6b4cc5bf24e314ec953b544", "score": "0.0", "text": "def set_artwork\n @artwork = Artwork.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...
942d574ba63c9d00d2c92b848798017e
Returns an array of ResourceGroup objects for the current subscription.
[ { "docid": "6d3c5fd4f5d29bde21db43d12468d7cb", "score": "0.73568976", "text": "def list_resource_groups\n Azure::Armrest::ResourceGroupService.new(configuration).list\n end", "title": "" } ]
[ { "docid": "ab54ee217a69e568454d3db39cfad5fc", "score": "0.7703775", "text": "def resource_groups\n url = url_with_api_version(\n configuration.api_version,\n @base_url,\n 'subscriptions',\n configuration.subscription_id,\n 'resourcegroups'\n )\...
8e823715e1d96a0bbd84a44266ffd483
Sends an arbitary gauge value for the given stat to the statsd server.
[ { "docid": "ef7e0c1ff3c81c4a6ee76ebd52460c1d", "score": "0.8351868", "text": "def gauge(stat, value)\n send stat, value, GAUGE_TYPE\n end", "title": "" } ]
[ { "docid": "ee5cac8c9057466ba67174de0d935b85", "score": "0.84238493", "text": "def gauge(stat, value, opts={})\n send_stats stat, value, :g, opts\n end", "title": "" }, { "docid": "bad531ce925835bb9b376ebbec58e3ee", "score": "0.82858676", "text": "def gauge(stat, value)\n ...
e4721dd8100a8b8aad611c0dab6898c2
Log a debugging message, if the proper environment flag was specified.
[ { "docid": "deff78e82c33e14b8f688d4647ffd648", "score": "0.63118905", "text": "def debug(message)\n return if quiet?\n say('[DEBUG] ' + message, :yellow) if $DEBUG\n end", "title": "" } ]
[ { "docid": "c4946e79ef3d6f52338a9d62e74b2fa9", "score": "0.73792356", "text": "def debug(message)\n warn \"==== VLO DEBUG: \" + message if ENV[\"VLO_DEBUG\"] == 'true'\nend", "title": "" }, { "docid": "78d4458951238539ba7faec91e850490", "score": "0.7206642", "text": "def log(msg)\n ...
21e23cd9245fb4142018d9dcc30ed571
Get the OG containing the gene (returns the first, if multiple).
[ { "docid": "24b371aa1232c103487b3df0c4175f7e", "score": "0.80918205", "text": "def get_og(gene)\n idx = self.ogs.index { |og| og.include? gene }\n idx.nil? ? nil : self.ogs[idx]\n end", "title": "" } ]
[ { "docid": "294fbb579686975463b8b9f12d1ded28", "score": "0.8091954", "text": "def get_og(gene)\n idx = self.ogs.index { |og| og.include? gene }\n idx.nil? ? nil : self.ogs[idx]\n end", "title": "" }, { "docid": "2dc84def7068ed24916e92830840da19", "score": "0.6717535", "text": ...
c3f24bb5b9d842c872789a10f8f98ddd
DO THE ACTUAL CONVERTING
[ { "docid": "cfaf6c5a8056d62038218d75a55bcef1", "score": "0.0", "text": "def convert(path, options)\n\n @java_classes = {}\n @java_fields = {}\n @java_lists = {}\n @field_info = {}\n\n @do_chop = true\n @config = Configurator.new\n\n parse_args(path, options)\n\n if !File.exists?(@config.json_fil...
[ { "docid": "69101d91fc64f433f2c3740f8d762d21", "score": "0.75462306", "text": "def convert(to)\n\n end", "title": "" }, { "docid": "98fb4540f82b0bf969802354d5797900", "score": "0.75154907", "text": "def converter; end", "title": "" }, { "docid": "98fb4540f82b0bf9698023...
2c7a4352535f8d5947da0cec5dd94d95
Check for a valid physattr name Automatically add the plyrattr if it does not exists Returns the plyrattr object if it exists
[ { "docid": "8ddc8c8d85e85f94d80a54f1e0acf19f", "score": "0.76803565", "text": "def plyrattr_exists?(rattr_name)\n rattr = self.plyrattrs.where(name: rattr_name).first\n\n # We are done if the rattr exists\n return rattr if rattr != nil\n\n # Now check if the name actually exists\n pattr =...
[ { "docid": "342bd78c2f2e02ad5636a4b936a0d805", "score": "0.7545392", "text": "def physattr_exists?(rattr_name)\n plyrattr_exists?(rattr_name)\n end", "title": "" }, { "docid": "351c7745085e41469a9bf2278606ebea", "score": "0.7037498", "text": "def physattr_exists?(rattr_name)\n ...
af2b441aa027e1c5a7712b4d105cbafe
Test that a string of a negative integer value is treated as an invalid positive integer
[ { "docid": "63040d2d61b974b6932dc311c59c48ef", "score": "0.72157836", "text": "def test_verify_pos_int_negative\n refute verify_positive_int('-1')\n end", "title": "" } ]
[ { "docid": "0aad601d361d1a200dbfce4751f5b131", "score": "0.75520307", "text": "def is_positive_int(string)\n\t!!(string =~ /^[0-9]+$/)\nend", "title": "" }, { "docid": "ed00a4ff058a13b97fefb01346559453", "score": "0.75012803", "text": "def valid_number?(intString)\n intString.to_i.t...
9e3165e6b60be10744d64796f769d3c5
Method: updateGameResult Input: Return:
[ { "docid": "75e53d704004432b6ccb00080a7ef40a", "score": "0.7032626", "text": "def updateGameResult\n if(request.post?)\n cGameID = self.findKeyInJSON(params[:params], \"GameID\", 2)\n cStatus = self.findKeyInJSON(params[:params], \"Status\", 2) # 100: Owner Win, 101: Opp Win, 102: draw\n ...
[ { "docid": "2ec65c90b8b647026e57b7db15e68499", "score": "0.68413436", "text": "def process_result(game)\n if game.red == @player\n as_red\n my_score = game.redscore\n opp_score = game.bluescore\n my_rating_diff = game.red_rating_diff\n opp_rating_diff = game.blue_rating_diff\...
62de4bbd8d170777034355be9d7f54fa
Ping the Rails app to get all the AWON station database IDs. Return a Hash e.g. 4751 => 7 (or whatever the ID of Hancock's record is in the database)
[ { "docid": "cbdf98d7e40a3fe2a33c2fcdfec057c6", "score": "0.7008868", "text": "def awon_station_ids(http)\r\n stn_ids = {}\r\n JSON.parse(http.get(\"#{URL_PREFIX}/awon_stations.json\").body).each do |rec|\r\n stn_ids[rec[\"stnid\"]] = rec\r\n end\r\n stn_ids\r\nend", "title": "" } ]
[ { "docid": "cbcde3409e3ec023cf5e09be4c4b1d6e", "score": "0.6210169", "text": "def find_stats\n indices = {}\n return indices if (app.nil? || !app.started?)\n\n message = { :droplet => app.id, :version => app.generate_version,\n :states => ['RUNNING'], :include_stats => true }\n ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "04f09fded54019c559e784d7fb8e9ced", "score": "0.0", "text": "def diet_type_params\n params.require(:diet_type).permit(:name)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69792545", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781151", "text": "def strong_params\n params.requ...
dc07a5d59500de1e800759e025eac6df
Get the total Unsubscribed/Pending apartments
[ { "docid": "59f18b6481e9f878046e2f463147b501", "score": "0.0", "text": "def unsubscribed_apartment\n apartments.reject(&:subscribed)\n end", "title": "" } ]
[ { "docid": "1e7e42d705c65b8f91298df0a2393e21", "score": "0.71544445", "text": "def total_paid\n @group.subscriptions.sum { |s| s.total_paid }\n end", "title": "" }, { "docid": "875ffd0bb01b76993b14535e5a7debe4", "score": "0.7045734", "text": "def total_paid\n self.total_due - ...
bd3ff50cc07b625b338e688e364321c1
GET /home_pictures/1 GET /home_pictures/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "ba8d0949e0018fd15c1674f6f165c041", "score": "0.7749593", "text": "def show\n @home_picture = HomePicture.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @home_picture }\n end\n end", "title": "" }, { "doc...
5093c6ecb75ba8a547b52bd0a53992a0
URL of worksheetbased feed of the spreadsheet.
[ { "docid": "20264254e1a27136d1d73a0830e23ddb", "score": "0.83388734", "text": "def worksheets_feed_url\n format(\n 'https://spreadsheets.google.com/feeds/worksheets/%s/private/full', id\n )\n end", "title": "" } ]
[ { "docid": "b6e7bfce7c868a02e05d914d92bf6222", "score": "0.89711684", "text": "def worksheet_feed_url\n return '%s/%s' % [spreadsheet.worksheets_feed_url, worksheet_feed_id]\n end", "title": "" }, { "docid": "4b37318311b5718d86d2b049a95f9ffb", "score": "0.8587348", "text": "d...
fc188128dd9f5f4421230c32ef18e8bb
(: (conditional ?c ?ci ?cv) (and (active ?c ?ci ?cv) (not (p ?c ?ci ?cv)) ))
[ { "docid": "cfa7cedc66c5f20b44514204c6d62d06", "score": "0.76681644", "text": "def conditional(c, ci, cv)\n active(c, ci, cv) and not p(c, ci, cv)\nend", "title": "" } ]
[ { "docid": "8c00ae808c928901f9c08a6fecb0d9ac", "score": "0.65052783", "text": "def satisfied(c, ci, cv)\n not null(c, ci, cv) and not terminal(c, ci, cv) and q(c, ci, cv)\nend", "title": "" }, { "docid": "993d45abcb1d96311106cbe79ca636f9", "score": "0.64927197", "text": "def complex...
a4f1ecdbe2437d8f2e75dff9661946a9
Instantiates a new securityRegistryKeyEvidence and sets the default values.
[ { "docid": "de3eabd13dae01d22303017926f54e09", "score": "0.6641544", "text": "def initialize()\n super\n @odata_type = \"#microsoft.graph.security.registryKeyEvidence\"\n end", "title": "" } ]
[ { "docid": "ec6ee7167886b962f225179e8b0a3cf4", "score": "0.59963787", "text": "def initialize()\n super\n @odata_type = \"#microsoft.graph.security.containerRegistryEvidence\"\n end", "title": "" }, { "docid": "2fe69a61f50a06ed2337008dc7eaef3a", "...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "328fbe27b69d2ed112a360d766e8b49c", "score": "0.0", "text": "def compchallenge_params\n params.fetch(:compchallenge, {})\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whit...
5c66446129244e49ec8a6836cc28cbca
deletes the assignment from the parent object
[ { "docid": "8bd9c76946cae6b55de60d59f37047d4", "score": "0.59724796", "text": "def destroy\n #primitives in structs are without parent\n parent and parent.children.delete self\n end", "title": "" } ]
[ { "docid": "fefa536e53b8b32b241c90b8f7cca6f8", "score": "0.7325093", "text": "def unassign\n self.owner = nil\n save\n end", "title": "" }, { "docid": "63ba6ede23dc9af10be16a98a7739738", "score": "0.6614776", "text": "def detach\n @parent, @key_in_parent = n...
12e1a57ef9d7151e2e173876e32bb701
Convenience method for getting the sort options.
[ { "docid": "177c4fe223c8b990088c203d399a0111", "score": "0.635123", "text": "def sort\n self[:sort]\n end", "title": "" } ]
[ { "docid": "1d506dc7d3c6cbc6d33d83ab587eb1c5", "score": "0.76511866", "text": "def __sort_option__\n multi.inject({}) do |options, criteria|\n options.merge!(criteria.__sort_pair__)\n options\n end\n end", "title": "" }, { "docid": "d5...
f476145a9d34bf1f063912d6dba670a7
generate password reset info (token + digest + send email) after request
[ { "docid": "29be3d7a9d68dba50d36ccc947998f39", "score": "0.0", "text": "def create\n @user = User.find_by(email: params[:password_reset][:email].downcase)\n if @user\n # create token & digest\n @user.create_reset_digest\n # send email to recover the password\n @user.send_passwo...
[ { "docid": "1e90c711a43ad653c531c4af3a95e57b", "score": "0.77303624", "text": "def create_reset_digest\n self.reset_token = User.new_token\n update_attribute(:reset_digest, User.digest(reset_token))\n update_attribute(:reset_sent_at, Time.zone.now)\n UserMailer.password_rese...
6ec5b222d3fdbebb6aed4bcf215572a7
GET /snaps/1 GET /snaps/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "7c15acf29d1e3ca25686fc82d37dd561", "score": "0.7661868", "text": "def show\n @snap = Snap.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @snap }\n end\n end", "title": "" }, { "docid": "63cf3040b721ae337...
904e40be83526e4fa35ac5043e67386c
ENSURE THAT ON CREATE THE MAP HAS LAYERS
[ { "docid": "5cff233b8a967434a660e46babdbc8fe", "score": "0.5831334", "text": "def validate_on_create\n begin\n map_xml = Nokogiri::XML(open(url)) \n check_layers map_xml\n extract_keywords map_xml # extract keywords from WMS\n extract_layers map_xml # extract layers from the WM...
[ { "docid": "5e246ecf3c59b69b45b6e69beee3a397", "score": "0.72521216", "text": "def check_map_layers\n raise EmptyLaterException, \"No layers present for this map data\" if map_layers.empty?\n end", "title": "" }, { "docid": "492007fd294949c32afb9193f1112d51", "score": "0.67873657", ...
947fe355abb9de2d1c43cf2fb027c18d
Converts a time in UTC to the local timezone. utc can either be a DateTime, Time or timestamp (Time.to_i). The returned time has the same type as utc. Any timezone information in utc is ignored (it is treated as a UTC time).
[ { "docid": "3410abeb86179cb14badff51ff3fbd4b", "score": "0.72792643", "text": "def utc_to_local(utc)\n TimeOrDateTime.wrap(utc) {|wrapped|\n period_for_utc(wrapped).to_local(wrapped)\n }\n end", "title": "" } ]
[ { "docid": "9cf4d891e189c62f096aaebf95122a8b", "score": "0.682305", "text": "def to_time\n\n @time ||= @zone.utc_to_local(utc)\n end", "title": "" }, { "docid": "9cf4d891e189c62f096aaebf95122a8b", "score": "0.682305", "text": "def to_time\n\n @time ||= @zone.utc_to_local...
c2b3759a2522441053d9f5231522bbc3
Return a quadtree representing the first quarter on clockwise direction
[ { "docid": "6cfbdab346eb8bc453865119081790cf", "score": "0.64280015", "text": "def third_quarter\n return @third_quarter if @third_quarter\n\n @third_quarter = self.class.new(\n Point.new(upper_left.x, upper_left.y - quarter_height - LAMBDA),\n Point.new(upper_left.x + quarter_le...
[ { "docid": "5aceb2713ddfb86745260fba32406d35", "score": "0.68577737", "text": "def fourth_quarter\n return @fourth_quarter if @fourth_quarter\n\n @fourth_quarter = self.class.new(\n Point.new(upper_left.x + quarter_length + LAMBDA, upper_left.y - quarter_height - LAMBDA),\n Point...
10ad05447871bba3e940663244142827
POST /xmt/ad/advertisements POST /xmt/ad/advertisements.json
[ { "docid": "f905ed4b4d3329ae49fa798bb8da46f2", "score": "0.6190163", "text": "def create\n @advertisement = Advertisement.new(advertisement_params)\n\n respond_to do |format|\n if @advertisement.save\n format.html {redirect_to xmt_ad_advertisements_url(site_id: @site.id...
[ { "docid": "f505c680fff7941b050a72c018cbc155", "score": "0.716385", "text": "def delta_advertisements(params = {}, options = {}, &block)\n default_option(options, :record_class, DeltaAdvertisement)\n perform_request(:post, 'delta/advertisements', options.merge(body: params), &block)\n end",...
7c9a3f435c457f70ebb8526cfb069f08
GET /auctions/new GET /auctions/new.xml
[ { "docid": "3b1e442755dfadbb0539bf8d48f0647e", "score": "0.0", "text": "def new\n if is_login\n @user = User.find_by_id(session[:user_id])\n if @user.identity\n @auction = Auction.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { rende...
[ { "docid": "00815d6f8fd6a5e028347aef15d28f9c", "score": "0.7525189", "text": "def new\n @auction_item = AuctionItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @auction_item }\n end\n end", "title": "" }, { "docid": "eb6a6a1f...
5b44fbe0088d0b1bb5b2b2d975fe8071
this method is called when control returns to this page from the show_AC.erb page
[ { "docid": "2d32aa1372d29beaa9741232b84282ae", "score": "0.0", "text": "def show_search_index \n WebView.navigate(url_for(:action => :search, :controller => :SearchContacts, :query => {:show_results => 'true'}), Constants::TAB_INDEX['Contacts'])\n end", "title": "" } ]
[ { "docid": "55a421fb0445897ef57396ffa99fb90c", "score": "0.5941553", "text": "def show\n redirect_to account_details_home_path(id: @account) and return\n end", "title": "" }, { "docid": "4ff8675bb5945e05baf61d1f02b7e36f", "score": "0.5914853", "text": "def show\n redirect_to :...
6f8691834760d8ebe261694acb92cc06
Fetch the current roles in a Roles object.
[ { "docid": "faf7f0d8f4c4f77d72dcd68e9825e0db", "score": "0.71489567", "text": "def roles\n @access_context.roles\n end", "title": "" } ]
[ { "docid": "e9d19c22abf4521f0dd1ff59b9afb9fe", "score": "0.82234865", "text": "def fetch_roles\n @current_user.nil? ? [] : @current_user.roles\n end", "title": "" }, { "docid": "a1d730f58061c1c14d98141a1c22fd8b", "score": "0.7630712", "text": "def get_roles\n self.class.ge...
907883afefaf6d57b63d1b87c64fa96a
query para obtener los detalle de una estacion, se le pasa el nombre de la estacion y la fecha actual mapa /info_polens/estacion mapa /info_polens/estacion.json
[ { "docid": "7ecb5316b36d3b9be1c28fa45764be6f", "score": "0.706229", "text": "def estaciones\n\n param_estacion = params[:estacion]\n param_fecha = params[:fecha].to_i\n @info_polens = InfoPolen.where({\"ESTACIONES\" => param_estacion, \"FECHA\" => param_fecha}).order_by(:TIPOS_POLINICOS.asc)\n\...
[ { "docid": "989a82ed61341ab7f853a7ef3867a375", "score": "0.6152503", "text": "def infosSauvegardes\n\t\n return requete(\"SELECT nompartie, nomgrille, taillegrille, jokersRestants, grillejouee.datemaj FROM grillejouee INNER JOIN grilleediter ON grillejouee.idGrille=grilleediter.id WHERE joueur = #...
e548f01733b90906772dd18e2e6d2c61
Set the filename or file object to operate on. If the object has all methods in FILE_OBJ_METHODS, it is treated as a file, otherwise, it is treated as a filename. If the filename is invalid, Errno::ENOENT or Errno::EINVAL will probably be raised when calling methods. Optional argument check_id3 checks for ID3 tags. If ...
[ { "docid": "86fa9aa6d6fba1d6c7b06d7641590274", "score": "0.684418", "text": "def initialize(filename, check_id3 = nil)\n if FILE_OBJ_METHODS.each{|method| break unless filename.respond_to?(method)}\n @file = filename\n @check_id3 = check_id3.nil? ? @@check_id3 : check_id3 \n else\n ...
[ { "docid": "0c3688f1dd00253b87f1ad6c7df06a26", "score": "0.5617483", "text": "def set_file_object\n @file_object = FileObject.find(params[:id])\n end", "title": "" }, { "docid": "d8656f13353535868d58baa133869b5f", "score": "0.5534284", "text": "def load(filename, **kwargs)\n ...
f2a0e0c9a395d9e1ef2b246f51f7f41b
Returns the complete array of Wheres
[ { "docid": "73e58d06d5acfdae34784e1095abd29a", "score": "0.0", "text": "def all\n @@wheres\n end", "title": "" } ]
[ { "docid": "5f4be965abb002691c8765ef1fa4a93c", "score": "0.61530423", "text": "def to_a; [w, x, y, z] end", "title": "" }, { "docid": "b190e9716f2125c653f64e6c0ca60b5d", "score": "0.60736454", "text": "def wells\n @wells ||= []\n end", "title": "" }, { "docid": "5...
2f43b97339ed23f4d2acd1213ef4587a
send an error notification email
[ { "docid": "5f48a55f05d6211e91dfd2e0b9d519ba", "score": "0.8297272", "text": "def send_error_email(error)\n @error = error\n mail( :to => 'cave.survey.project+error@gmail.com',\n :subject => 'Error reported' )\n end", "title": "" } ]
[ { "docid": "3fd63789960499807d98dcb5b1e5a18e", "score": "0.8297547", "text": "def notify_error(error)\n @error = error\n\n mail to: 'alessandro.asac@gmail.com', subject: 'Application Error Notification'\n end", "title": "" }, { "docid": "e83449ff39861952dd5683deb1642b91", "score":...
8a03054d049b6d6db56e89e85bd88374
DELETE /order_items/1 DELETE /order_items/1.json
[ { "docid": "44e9bb363b0b2595a31430240c31aec6", "score": "0.7259253", "text": "def destroy\n @order_item.destroy\n respond_to do |format|\n format.html { redirect_to order_items_url, notice: 'Order item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", ...
[ { "docid": "a2ee841c093b6873595230ab15402c26", "score": "0.7660662", "text": "def destroy\n @item_order = ItemOrder.find(params[:id])\n @order = Order.where(:id => @item_order.item_id)\n @item_order.destroy\n\n respond_to do |format|\n format.html { redirect_to order_url(@order) }\n ...
cf9aa94584b08a0564e235f7dd152bb0
this is using two select statements, then we need to fix...
[ { "docid": "aed22a379237f8c303a76fa1c392a303", "score": "0.0", "text": "def friends\n first_set = self.initiated_friendships\n second_set = self.received_friendships\n return first_set + second_set\n end", "title": "" } ]
[ { "docid": "435ec51293e0f5fc7b9e081e4382879f", "score": "0.60772616", "text": "def select; end", "title": "" }, { "docid": "435ec51293e0f5fc7b9e081e4382879f", "score": "0.60772616", "text": "def select; end", "title": "" }, { "docid": "142ce909655865f67dbfb137b1bd4f24", ...
3ae0a27d3a7e52eecf068ab4ab111087
def cards [] end def self.cards
[ { "docid": "f7c7c75d08d6faa2e00b182e5c87f8c9", "score": "0.66844356", "text": "def choose_card \n\n @cards.shift\n end", "title": "" } ]
[ { "docid": "c92edf0a2f0c7f6e8399b6e095101aba", "score": "0.8476114", "text": "def cards\n @cards\n end", "title": "" }, { "docid": "5357f5dc8289842c1be9a15a45b5d640", "score": "0.83319545", "text": "def initialize\n @cards = []\n end", "title": "" }, { "docid"...
386b04a4b18a28fd8625de141eaa727f
like encode, but only calls as_json, without encoding to string.
[ { "docid": "c92e2c5522ef4c96e71e70322d416d26", "score": "0.0", "text": "def as_json(value, use_options = true)\n check_for_circular_references(value) do\n use_options ? value.as_json(options_for(value)) : value.as_json\n end\n end", "title": "" } ]
[ { "docid": "06fa7195b090da619c2ba202f9d2db24", "score": "0.74802446", "text": "def json_encoder; end", "title": "" }, { "docid": "06fa7195b090da619c2ba202f9d2db24", "score": "0.74802446", "text": "def json_encoder; end", "title": "" }, { "docid": "06fa7195b090da619c2ba202...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "7a0d14b4375a07f9ec4d5e82e0a283fe", "score": "0.0", "text": "def set_expense\n @expense = Expense.find(params[:id])\n\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60328794", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6017492", "text": "de...
35b26ab0ddb7132d55ab5099f73d5e56
for the 1.0.0 specification.
[ { "docid": "1469e8bf12d88d3a86e80b6e5041d7fe", "score": "0.0", "text": "def format_1_0_0(json_object)\n\n investor = Investor.new\n investor.investor = json_object[\"investor\"]\n investor.url = json_object[\"url\"] if json_object[\"url\"]\n\n companies = json_object[\"investments\"].reject ...
[ { "docid": "5a848e1a78e814f4addafb82445f2b93", "score": "0.73142505", "text": "def version; 1; end", "title": "" }, { "docid": "5a848e1a78e814f4addafb82445f2b93", "score": "0.73142505", "text": "def version; 1; end", "title": "" }, { "docid": "5a848e1a78e814f4addafb82445f...
60c02a33b0154557dc34282e63ceb138
Fires whenever a PR is opened to check for autoblacklist and post stats
[ { "docid": "98d00a3868226ac4c78ab7cabdf5ea52", "score": "0.5741055", "text": "def pull_request_hook\n # Check signature from GitHub\n\n signature = 'sha1=' + OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha1'), AppConfig['github']['secret_token'], request.raw_post)\n puts \"calculated signature...
[ { "docid": "f320d38e214c2e46f1d9d56f2bb31f98", "score": "0.6706018", "text": "def on_synchronize\n number = @payload[\"number\"]\n\n if PullRequest.exists?(number: number)\n pr = PullRequest.find_by(number: number)\n\n status = \"pending\"\n description = \"Not all reviewers have ap...
ab5b0ff2e67d281b5e62dc3dfc5058fc
PUT /trends/1 PUT /trends/1.json
[ { "docid": "64930493efb8852a6d312896e4d3af05", "score": "0.70530486", "text": "def update\n @trend = Trend.find(params[:id])\n\n respond_to do |format|\n if @trend.update_attributes(params[:trend])\n format.html { redirect_to @trend, notice: 'Trend was successfully updated.' }\n ...
[ { "docid": "df6dd7b3c3097645fc63940f913efd20", "score": "0.7115279", "text": "def update\n @trend = Trend.find(params[:id])\n\n respond_to do |format|\n if @trend.update_attributes(params[:trend])\n format.html { redirect_to @trend, :notice => 'Trend was successfully updated.' }\n ...
59d699a74b425bb0b5b8bbc05ae7666a
Returns an index to the XF record in the workbook. Note: this is a function, not a method.
[ { "docid": "e653fd217e9e2af95c3ab43d78f43fa5", "score": "0.7368421", "text": "def xf_record_index(row, col, xf=nil) #:nodoc:\n if xf.respond_to?(:xf_index)\n xf.xf_index\n elsif @row_formats.has_key?(row)\n @row_formats[row].xf_index\n elsif @col_formats.has_key?(col)\n @co...
[ { "docid": "8adf0fc6dc60fa7c8b95c8d6995d6c95", "score": "0.7839115", "text": "def find_xf(workbook, xf)\n workbook.cell_xfs.each_with_index { |xfs, index| return index if xfs == xf }\n return nil\n end", "title": "" }, { "docid": "0bf9ba92fd9b607f9826c1c20aaa1b15", "score": ...
96306e72225d53120f546d8f2fbe116b
Get the class of the join on arel
[ { "docid": "f3a1359fa814d856f6ffaa0cd8672893", "score": "0.7375827", "text": "def arel_join\n case @join_type\n when :inner then ::Arel::Nodes::InnerJoin\n when :left then ::Arel::Nodes::OuterJoin\n when :right then ::Arel::Nodes::RightOuterJoin\n when :full...
[ { "docid": "52301c52e689eaf89cfb13dd518c137d", "score": "0.7909284", "text": "def join_table\n assigned_to_klass.arel_table\n end", "title": "" }, { "docid": "adabef8331687e2b2d733bae8838ebaa", "score": "0.7568922", "text": "def join_type; end", "title": "" }, { "...
86bc07ff29bdf8240d9a3d14f7e2da58
generate edit link with icon
[ { "docid": "7d39dfdfe5f0ef0328661278cf5c310c", "score": "0.8052878", "text": "def link_to_edit(path)\n link_to image_tag('icons/001_45.png',\n :size => ICON_SIZE,\n :alt => 'Edit'), path\n end", "title": "" } ]
[ { "docid": "1ee0772850e03f5b79bce08d8cbcae2f", "score": "0.7980728", "text": "def edit_button\n 'Edit <i class=\"icon-edit icon-white\"></i>'.html_safe\n end", "title": "" }, { "docid": "b364b151f4f973debb000d5c8cfa04b1", "score": "0.7898001", "text": "def link_to_edit(path)\n ...
e6c6c11c1bcd2c545681062fb31d8eaf
If either parameter julianyear or julianday was set, update the yield date using these parameter values.
[ { "docid": "dc359611aa820768548d3eebc0021ade", "score": "0.6676588", "text": "def maybe_set_from_julian_date(params)\n\n # They can also enter the date in julian format, so if they do, overwrite\n # the other date field:\n if !(params[:julianyear].blank? and params[:julianday].blank?)\n p...
[ { "docid": "b32551fa5af0e71c0ee01d0f976ba68b", "score": "0.5764879", "text": "def update\n @yield = Yield.all_limited(current_user).find(params[:id])\n\n set_default_date_fields(params)\n\n @yield.update_attributes(params[:yield])\n\n maybe_set_from_julian_date(params)\n\n if params['assi...
49053847e606fd6fece974b82781d08f
Returns an Array containing the names of all libraries defined in the Ivy dependency file(s) for this subtree. The Array elements are simple file names and do not include any paths.
[ { "docid": "85cb24f45ab1da1488021dbd9f383c0f", "score": "0.7104577", "text": "def ivy_dependencies(type)\n result = Array.new\n\n dependencies_file = ivy_file_name.canonicalize.to_s\n if File.exists?(dependencies_file)\n xml = DOM4J::SAXReader.new.read(FileReader.new(dependencies_f...
[ { "docid": "959e51949ffed71d093445efecf542a0", "score": "0.7305336", "text": "def get_dep_libs_list\n\t\tdep_libs_list = Array.new\n\t\t@dep_libs.each do |dep_lib|\n\t\t\tdep_libs_list.push(dep_lib)\n\t\tend\n\t\treturn dep_libs_list\n\tend", "title": "" }, { "docid": "7fd7c46005b1eed558d13d...
f3cd6335643afc42d38159b1ec2e7341
use this format to change status:
[ { "docid": "949547e90116b98e648ffbb0a6fa5335", "score": "0.0", "text": "def method_missing(key, *args)\n if s=STATUSES.detect {|e| e == key.to_s.gsub(/(\\?|!)$/, '').titleize}\n if key.to_s[-1] == \"!\"\n self.status = s\n elsif key.to_s[-1] == \"?\"\n self.status == s\n ...
[ { "docid": "601a1b360e99ce50182b8c89e9184e5b", "score": "0.7474982", "text": "def status=(v)\n @status = alma_string v\n end", "title": "" }, { "docid": "0a34039c0761e788cd397bad0988f7b7", "score": "0.74647725", "text": "def status=(new_status)\n super new_status.to_s\n end",...
1102c3cbf8fe2da31afc3e5d5f59eb5e
PUT /picoposts/1 PUT /picoposts/1.xml
[ { "docid": "3af84929729159094f0dc951e3678ea0", "score": "0.64539707", "text": "def update\n @picopost = Picopost.find(params[:id])\n\n respond_to do |format|\n if @picopost.update_attributes(params[:picopost])\n format.html { redirect_to(@picopost, :notice => 'Picopost was successfully...
[ { "docid": "38979984bdedacd95706689e25f09f9e", "score": "0.6335881", "text": "def put(document, method='')\n @resource[method].put(document.to_s, :content_type => 'text/xml')\n end", "title": "" }, { "docid": "23b5f5e4dacfb330cb1e0ffd4590ef63", "score": "0.5843228", "text": "...
025928a321723e9941a5a655264b85ac
Method for checking parameters from "select_params"
[ { "docid": "44a8173c6164ce8c5b6446b66275149a", "score": "0.5847647", "text": "def check_params2(params, action='list')\r\n # check first for #nr genes > 400 which can cause browser errors\r\n nr_genes = params[:genes].split.size if params[:genes]\r\n if nr_genes && nr_genes > 400\r\n par...
[ { "docid": "2122b8e308d79b43550b07ac5b626455", "score": "0.68996936", "text": "def valid_select(result, arr, request)\n if validate_select_query(result)\n val_result = validate_select_query_params(arr, request)\n if val_result == true\n request.run\n ...
d10033e6defc369bf156748c64469c2b
The cell class constant for +cell_name+.
[ { "docid": "cf983aef2ace22e2d8d11ccd78405d32", "score": "0.8519415", "text": "def class_from_cell_name(cell_name)\n \"#{cell_name}_cell\".classify.constantize\n end", "title": "" } ]
[ { "docid": "ad8df932eeeca25754644586f23f0db4", "score": "0.8108774", "text": "def cell_name(name)\n self.cell_class = \"#{name}_cell\".camelize.constantize\n end", "title": "" }, { "docid": "541e1a5c705e274de36094505590a98f", "score": "0.74067056", "text": "def ce...
ea8f0f99e9ea0fbb5b04ca7591912994
Includes the specified module only if it has not already been included!
[ { "docid": "c25f0d872d9665d10921ebf8026607a5", "score": "0.8352683", "text": "def include_if_missing(mod)\n include(mod) unless included_modules.index(mod)\n end", "title": "" } ]
[ { "docid": "02f38785d0f452851677a4c900a58cb3", "score": "0.74831426", "text": "def module_include(base, mod); end", "title": "" }, { "docid": "02f38785d0f452851677a4c900a58cb3", "score": "0.74831426", "text": "def module_include(base, mod); end", "title": "" }, { "docid":...
2508efca3628cd6f6f14bf09c937114a
GET /notifications/new GET /notifications/new.xml
[ { "docid": "71ae54e4c3b5f5a1527ca0b1bd1f2ee0", "score": "0.7780601", "text": "def new\n @notification = Notification.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @notification }\n end\n end", "title": "" } ]
[ { "docid": "f5c2ef295b91f19943b2db19c418b695", "score": "0.8215699", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @notifications }\n end\n end", "title": "" }, { "docid": "c107f7544c2b63f11cab23e13bb728d8", "score"...
d70e95f55bea2c9234599ead45f2319b
Indicates whether its possible to capture the payment
[ { "docid": "1ca995deac6b4de643135bf2e8128f1e", "score": "0.840692", "text": "def can_capture?(payment)\n ['pending'].include?(payment.state)\n end", "title": "" } ]
[ { "docid": "93b3fbad3a3f58dc38c0b85ac77c2645", "score": "0.8574391", "text": "def can_capture?(payment)\n payment.pending? || payment.checkout?\n end", "title": "" }, { "docid": "93b3fbad3a3f58dc38c0b85ac77c2645", "score": "0.8574391", "text": "def can_capture?(payment)\n ...
a88d58e93a918c0129ac562f0976afdc
POST /finalidad_cultivos POST /finalidad_cultivos.json
[ { "docid": "e440ed99009dea6dfc5110efceee87eb", "score": "0.7054997", "text": "def create\n @finalidad_cultivo = FinalidadCultivo.new(params[:finalidad_cultivo])\n\n respond_to do |format|\n if @finalidad_cultivo.save\n format.html { redirect_to @finalidad_cultivo, notice: 'Finalidad cu...
[ { "docid": "9373ff8f319f75697d6dab0616151a62", "score": "0.6512548", "text": "def new\n @finalidad_cultivo = FinalidadCultivo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @finalidad_cultivo }\n end\n end", "title": "" }, { "doci...
8676056fb4d525687007bc54cd69455d
validate if which one required other should be blank
[ { "docid": "3c14a047156ae1fadcb49687c26cd4b1", "score": "0.0", "text": "def validate_respiratory_rate\n if data[\"respiratory_rate\"].nil? || !data[\"respiratory_rate\"].empty?\n respiratory_rate = data[\"respiratory_rate\"].to_i\n errors.add(:respiratory_rate, \"must be a whole number betw...
[ { "docid": "65f1d11c80ff0aecf436f05c74e2d4e2", "score": "0.70993745", "text": "def must_have_type_and_value\n return if blank?\n\n errors.add(:type, \"cannot be blank\") if @type.blank?\n errors.add(:value, \"cannot be blank\") if @value.blank?\n end", "title": "" }, { ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "201b7293a5a876c47ee411b902d248c6", "score": "0.0", "text": "def tichet_params\n params.require(:tichet).permit(:name, :seat_id, :address, :price_paid)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whit...
7310476bbb2899063b47747445b312c8
return the string "Arithmetic" if the sequence follows an arithmetic pattern or return "Geometric" if it follows a geometric pattern. If the sequence doesn't follow either pattern return 1. An arithmetic sequence is one where the difference between each of the numbers is consistent, where as in a geometric sequence, ea...
[ { "docid": "ed26f636e88e89d34a3e9b9eaf32da43", "score": "0.6365783", "text": "def ArithGeo(arr)\n difference = arr[1] - arr[0]\n ratio = arr[1] / arr[0]\n arith = true\n geo = true\n i = 2\n while i < arr.length\n if arr[i-1] + difference != arr[i]\n arith = false\n end\n if arr[i-1]...
[ { "docid": "ab92f519c43624e351f40e68c87cae87", "score": "0.7226374", "text": "def ArithGeo(arr)\n return \"Arithmetic\" if (1..arr.length - 1).map {|i| arr[i] - arr[i - 1]}.uniq.size == 1\n return \"Geometric\" if (1..arr.length - 1).map {|i| arr[i] / arr[i - 1]}.uniq.size == 1\n -1\nend", "title...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "4af0a799abb402c5542ff68928a427f0", "score": "0.0", "text": "def pseudo_params\n params.require(:pseudo).permit(:fake_name, :real_name, :votes)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69792545", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781151", "text": "def strong_params\n params.requ...
88a1fe55aff9801e09e8b98415f5433c
this is called once the todo is done ( called at the end of todo )
[ { "docid": "43ddaca2b52cf13b4c53cab41cab6cbc", "score": "0.7033086", "text": "def end_todo\n @todo = false\n puts ''\n puts 'finished downloading todo pages'.magenta\n puts ''\n end", "title": "" } ]
[ { "docid": "cf9cede7c60aa7db180369051afe2ac1", "score": "0.738961", "text": "def complete(todo)\n todo.complete\n save_todos\n end", "title": "" }, { "docid": "a9c4a44a58b857c852a802378f81a36a", "score": "0.7279324", "text": "def done!\n @todos.each_index do |idx|\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "7b4ac461112075df84416413d0ea8acb", "score": "0.0", "text": "def set_brokerage\n @brokerage = Brokerage.find_by!(slug: 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...
0210a5c85e3b72db5ab626523897629d
=> [0, 1, 2, 3, 4, 5] Write a method even_nums(max) that takes in a number max and returns an array containing all even numbers from 0 to max
[ { "docid": "80d344be954999e93cdc54eedf9aa809", "score": "0.90669405", "text": "def even_nums(max)\n result = []\n\tfor i in 0..max\n \tif i % 2 == 0 \n result << i\n end\n end\n return result\nend", "title": "" } ]
[ { "docid": "49d66a9a271a8c04cb377999b1819423", "score": "0.898293", "text": "def even_nums(max)\n\tnums = []\n \n\ti = 0\n\twhile i <= max\n\t\tif i % 2 == 0\n\t\t\tnums << i\n\t\tend\n\t\ti += 1\n end\n \n\treturn nums\nend", "title": "" }, { "docid": "bd18d3b5508990a6759bad678119f8fd", ...
2ce4568844ddd2c9f4338055f099b016
provides access to the :g2o configuration key in the current warden scope
[ { "docid": "d8eb557619ec28e0b45b49154e425274", "score": "0.75744057", "text": "def config\n env[\"warden\"].config[:scope_defaults][scope][:g2o]\n end", "title": "" } ]
[ { "docid": "e798bfad2f7aa5aefb6e36ccb776ee60", "score": "0.6376144", "text": "def config_key\n\t\treturn 'gameworld'\n\tend", "title": "" }, { "docid": "9d64bbda4c0bb1503cd70f7c9c32daec", "score": "0.6340745", "text": "def key\n @config[\"key\"]\n end", "title": "" }, { ...
5f5fbc03ddecfc680489014003978a7e
Convert libraries configuration form YAML configuration into a string that can be given to the compiler.
[ { "docid": "c9867b2ae65fd3b1160e59e2f590e803", "score": "0.0", "text": "def convert_libraries_to_arguments()\n args = ((@configurator.project_config_hash[:libraries_test] || []) + ((defined? LIBRARIES_SYSTEM) ? LIBRARIES_SYSTEM : [])).flatten\n if (defined? LIBRARIES_FLAG)\n args.map! {|v| LI...
[ { "docid": "c2c2dc90303be5b6a6a6cb053a46b9ba", "score": "0.59459513", "text": "def to_config\n str = %{The configuration file for #{Puppet[:name]}. Note that this file\nis likely to have unused configuration parameters in it; any parameter that's\nvalid anywhere in Puppet can be in any config file, ...
f863688e446adad5e6600b9864e24355
Return the JobOrder object for the specified JobOrder id
[ { "docid": "e3741850d78f75baeb146a6cec02e86d", "score": "0.80221355", "text": "def find_job_order_by_id(id)\n message = { session: @session, entity_name: 'JobOrder', id: id, \n attributes!: { id: { 'xsi:type' => \"xsd:int\" } } }\n soap_response = @client.call(:find, message: ...
[ { "docid": "771fc642680cd4a95782aef59e7f53ba", "score": "0.7184416", "text": "def set_job_order\n @job_order = JobOrder.find(params[:id])\n end", "title": "" }, { "docid": "771fc642680cd4a95782aef59e7f53ba", "score": "0.7184416", "text": "def set_job_order\n @job_order =...
c33d5cafbe1e3bb0bf760e2da36dea05
Serializes the relation objects Array.
[ { "docid": "bd8c405645e1d9bcd135e7dca871a146", "score": "0.0", "text": "def encode_with(coder)\n coder.represent_seq(nil, records)\n end", "title": "" } ]
[ { "docid": "c20d19c83268f03046be642f4eff8453", "score": "0.69740826", "text": "def serialize\n to_a.map(&:serialize)\n end", "title": "" }, { "docid": "5394d897ab444ac9cd72196c4c3b32ac", "score": "0.6771968", "text": "def relations\n each_relation.to_a\n ...
6a9fa639023e9980e8ccd99017ef07f7
Creates an externally hosted asset in MediaSilo An external asset means that all files associated with the asset (source, thumbnails, etc) are stored externally and must be valid and provided to this call. All file URL's must contain the filename and an extension, but can also contain URL variables if needed. All URL's...
[ { "docid": "7ace70ebd5090123c34f94fe841ad0c5", "score": "0.7991512", "text": "def asset_create_external(source_url, args = { })\n params = {\n :source => source_url\n }\n add_params = [ :projectid, :folderid, :proxy, :thumbnailsmall, :thumbnaillarge, :height, :width, :durat...
[ { "docid": "c9aedbb1167c8762b0d77fe6a7db7cd1", "score": "0.7534844", "text": "def asset_create_using_path(args = {})\n\n file_url = args[:url] || args[:file_url] || args[:source_url]\n raise ArgumentError ':url is a required parameter.' unless file_url\n\n file_path = args[:mediasilo_path] || a...
f9b6126f4e2879709c0d91ea4db406bd
Is this really even used anymore?
[ { "docid": "1e17deb9d61f93e7fe162aab04547f6d", "score": "0.0", "text": "def comma_color\n @breadcrumb_comma_color ||= params[:private] ? \"#DCDCDC\" : \"#FFF\"\n end", "title": "" } ]
[ { "docid": "0a39799e76643367f1b6bfac65569895", "score": "0.7544944", "text": "def used?; end", "title": "" }, { "docid": "33e1db3c06643dd523dcc31fccf3a005", "score": "0.75039256", "text": "def used; end", "title": "" }, { "docid": "33e1db3c06643dd523dcc31fccf3a005", "...
a7983d564fdd4edc0155a32c922ae96a
GET /gradelists/1 GET /gradelists/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "8d1bfd0891246be79dd37f000591516c", "score": "0.7406524", "text": "def index\n @gradelists = Gradelist.all\n end", "title": "" }, { "docid": "378b8c3cc64d183cb277a10cc1b2a913", "score": "0.7131221", "text": "def index\n @grades = Grade.all\n\n respond_to do |form...
a2df6a15fbc47cb8e7e72e2c59799cab
This is necessary, as it allows Cordova to properly delegate 401 response handling to our application. If we keep this header, Cordova will defer handling to iOS, and we'll never see the 401 status in the app... it'll just do nothing.
[ { "docid": "8ccb31b7331b154eba9521ff1036407a", "score": "0.7370051", "text": "def allow_client_to_handle_unauthorized_status\n headers.delete('WWW-Authenticate')\n end", "title": "" } ]
[ { "docid": "05418fd6bd02355c8178bc55d0e969d3", "score": "0.6749783", "text": "def render_unauthorized\n logger.debug \" *** UNAUTHORIZED REQUEST: '#{request.env['HTTP_AUTHORIZATION']}' ***\"\n self.headers['WWW-Authenticate'] = 'Token realm=\"Application\"'\n render json: {error: \"Bad cr...
afa51224faa2f00ac374e1c1fabab761
Public: Find the number of divisors of the given number. number A positive integer. Returns an integer.
[ { "docid": "7926cf56e288d81d5fdfdd53ac4b3ca8", "score": "0.8005547", "text": "def divisor_count_of(number)\n # Count the divisors by computing the prime factorization of the number and\n # multiplying PF exponents. 1 is added to the exponents since each base can\n # be raised to the 0 power, which i...
[ { "docid": "6c7c4384687903dd73c43446490f2e6b", "score": "0.8761941", "text": "def get_number_of_divisors(number)\n\t\tdivisors = 2 # 1 and number\n\t\tif (number == 1)\n\t\t\tdivisors = 1\n\t\telsif (number == 2)\n\t\t\tdivisors = 2\n\t\telse\t\t\n\t\t\tfor i in 2..Math.sqrt(number)\n\t\t\t\tif (number%...
e00e3dcdafd3bdcf0e5b72a316fa769a
Restore any relevant files that were present when repo was in the middle of a cherrypick.
[ { "docid": "0026dd2a7202c6c59740433c7bce607e", "score": "0.68509847", "text": "def restore_cherry_pick_state\n if @cherry_head\n File.open(File.expand_path('CHERRY_PICK_HEAD',\n Overcommit::Utils.git_dir), 'w') do |f|\n f.write(\"#{@cherry_head}\\n\...
[ { "docid": "5ea08400aa7f1e0e33d72c98bfdb43be", "score": "0.703418", "text": "def restore_cherry_pick_state\n if @cherry_head\n File.open(File.expand_path('CHERRY_PICK_HEAD',\n Overcommit::Utils.git_dir), 'w') do |f|\n f.write(@cherry_head)\n ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "e4e46e4e5fd57b76d7c14629f360682a", "score": "0.0", "text": "def data_log_params\n params.require(:data_log).permit(:user_id, :plant_id, :humidity_soil, :humidity_air, :light, :temperature)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.6978086", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6780264", "text": "def strong_params\n params.requi...
562c371308546cd601f75116a975314c
Return the Thumbalizr URL for the screenshot requested
[ { "docid": "cc058103e1fa49160a98c58affa03de0", "score": "0.6705718", "text": "def thumbalizr_url(url, options={})\n\t \t\tthumbalizr = Thumbalizr.new(ThumbalizrClient.api_key, ThumbalizrClient.secret)\n \t\t\treturn thumbalizr.url(url, options)\n\t\tend", "title": "" } ]
[ { "docid": "37428bd6bc43452d80e39ae8f067f4c1", "score": "0.7752141", "text": "def screenshot_thumb_url(package)\n url_for :controller => :package, :action => :thumbnail, :package => package, protocol: 'https'\n end", "title": "" }, { "docid": "e31a9cf1d19b3f4697f3d4e1f49bd6cd", "scor...