query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "f406ee110a1e3639dc7d3e1ef976378e", "score": "0.0", "text": "def generic_item_params\n params.require(:generic_item).permit(:title, :description, :graphic, :button_link, :button_text, :component, :parent_item_id, :priority, :background_color, :color, :icon, :icon_color)\n end", "t...
[ { "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...
526d6f57f13c92e99718879f7ac6a8e4
Returns the previous proxy or a head sentinel.
[ { "docid": "8e0e803f6f3f51fbec2d47af48a6e7eb", "score": "0.62731326", "text": "def prev\n @prev ||=\n if prev_uri\n node_cache.fetch(prev_uri) do\n node = self.class.new(node_cache, prev_uri, graph)\n node.next = self\n node\n end\n e...
[ { "docid": "55134b6e65569152693f46babf1a1e6e", "score": "0.6919499", "text": "def prev\n\t\tif(@index>1)\n\t\t\t@index-=1\n\t\t\treturn @data[@index-1]\n\t\telse\n\t\t\treturn nil\n\t\tend\n\tend", "title": "" }, { "docid": "91f1c478929536a0ac9580b9f261c87b", "score": "0.6751212", "t...
223dd3730d051ec4190a2a4d89b247a0
Get the number of samples that will be written. This is called before execute, as it is needed to write the output file. It is possible to give a majoration: it will be padded with silence. Parameters:: iInputData (WSK::Model::InputData): The input data Return:: _Integer_: The number of samples to be written
[ { "docid": "4db95bf70245b3d8d4f1c20a503fb28f", "score": "0.7320953", "text": "def get_nbr_samples(iInputData)\n return iInputData.NbrSamples\n end", "title": "" } ]
[ { "docid": "624ceba79bbea50184665930a2ae437c", "score": "0.7716523", "text": "def get_nbr_samples(iInputData)\n return 0\n end", "title": "" }, { "docid": "624ceba79bbea50184665930a2ae437c", "score": "0.7716523", "text": "def get_nbr_samples(iInputData)\n return 0\...
9a3206b960b854276efade7e00db786a
Guess the next round number (starting at 0) from the state in driver.
[ { "docid": "888f58f22eb95cfe9809225b0ca2cbb3", "score": "0.6344008", "text": "def guess_round(driver)\n Algorithm::DoubleBracket.guess_round(driver.seeded_teams.length,\n driver.non_bye_matches.length)\n end", "title": "" } ]
[ { "docid": "6df4dca277d9c741f7cc011d85ea6c43", "score": "0.72673804", "text": "def next_round_number\n self.current_round_number + 1\n end", "title": "" }, { "docid": "659d0072bf95503f5fa2330df351a67d", "score": "0.71145", "text": "def get_next_round\n if !self.last_round? and...
b36c2c604449ca7fddd0e32a7c3f4de8
GET /aceptions GET /aceptions.json
[ { "docid": "ef820a08fc1e89ce348bbcb75aa5d5c9", "score": "0.6906674", "text": "def index\n @aceptions = Aception.all\n end", "title": "" } ]
[ { "docid": "5e652d07c5a6590993a73ed8982d2dff", "score": "0.63637877", "text": "def index\n @adoptions = Adoption.all\n end", "title": "" }, { "docid": "5e652d07c5a6590993a73ed8982d2dff", "score": "0.63637877", "text": "def index\n @adoptions = Adoption.all\n end", "title"...
9e25d4440ab1999386d911d16791a823
The deserialization information for the current model
[ { "docid": "8670668aa12e32eac8248d4ed754d6bb", "score": "0.0", "text": "def get_field_deserializers()\n return super.merge({\n \"createdBy\" => lambda {|n| @created_by = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::IdentitySet.create_from_discriminator_value(...
[ { "docid": "613f62eeb3655523fae5d548dc6e7875", "score": "0.6580273", "text": "def get_field_deserializers()\n return {\n \"downloadUrl\" => lambda {|n| @download_url = n.get_string_value() },\n \"fileName\" => lambda {|n| @file_name = n.get_string_val...
599abf6cc5f344e2753fa5a168c36558
Gets the riskLevelAggregated property value. Aggregated risk level. The possible values are: none, low, medium, high, hidden, and unknownFutureValue. The value hidden means the user or signin was not enabled for Azure AD Identity Protection. Supports $filter (eq). Note: Details for this property are only available for ...
[ { "docid": "6d4ed31d33cb1591c2a4a706fceba859", "score": "0.78700984", "text": "def risk_level_aggregated\n return @risk_level_aggregated\n end", "title": "" } ]
[ { "docid": "23071fe9a715a16f2a3836d14768ea43", "score": "0.74188524", "text": "def risk_level_aggregated=(value)\n @risk_level_aggregated = value\n end", "title": "" }, { "docid": "96fdbd0341186da2ff35abcf666821e3", "score": "0.67309767", "text": "def risk_l...
db55ebd7cd6114c8800709d161d74c68
Determines if this hand is a flush.
[ { "docid": "4af7f3f8ba0a2cf0cb1b72a5e5428df6", "score": "0.6026076", "text": "def flush?\n for i in 0..(@cards.size - 2) do\n return false if @cards[i].suit != @cards[i+1].suit\n end\n true\n end", "title": "" } ]
[ { "docid": "b765c974a2fc66fb088a90bab3d13ceb", "score": "0.8228549", "text": "def straight_flush?\n type == HandType::STRAIGHT_FLUSH\n end", "title": "" }, { "docid": "125780859b42aa4df81dc955331fe447", "score": "0.76212907", "text": "def royal_flush?\n straight? and flush? an...
ea0158d4cbb4da124f312d789118a860
before_filter :require_login, only: [:new, :edit, :update, :destroy] GET /sales GET /sales.json
[ { "docid": "9bf9b3980359b926fe624984ff90b7bc", "score": "0.6110923", "text": "def index\n @sales = Sale.all \n end", "title": "" } ]
[ { "docid": "b6a56ab5fac1412174dabcbddebf62f1", "score": "0.7241579", "text": "def index\n @sales = Sale.all\n authorize @sales\n end", "title": "" }, { "docid": "ab7fe76cfe7c35db861a08a8a8ad550e", "score": "0.70439255", "text": "def index\n if current_user.nil?\n auth...
51cecd0251f5df80542540ff9c11eab6
valprt = (puby | valchk)
[ { "docid": "0040eaf3c7909c65250b8afb4f31bc41", "score": "0.74781555", "text": "def _valprt\n\n _save = self.pos\n while true # choice\n _tmp = apply(:_puby)\n break if _tmp\n self.pos = _save\n _tmp = apply(:_valchk)\n break if _tmp\n self.pos = _save\n break\n ...
[ { "docid": "c473e3b393685cd9f0cd27028f9e27e0", "score": "0.62578464", "text": "def value\n not @exprs.map{|e| e.value === false}.inject(:|)\n end", "title": "" }, { "docid": "52e05219f53b5f0347ed6071a3e2b78a", "score": "0.61316574", "text": "def value\n not @exprs.map{|e| e.va...
0ec29cf7fe4b31ae11f34c6a5c4db9bd
Draw elemental resistance battler : actor x : draw spot xcoordinate y : draw spot ycoordinate
[ { "docid": "00ae7ae32e11603d360c223d48e27aaa", "score": "0.6980771", "text": "def draw_element_resist(battler, x, y)\n self.contents.font.size = Scan_Window_Font_Size\n max_elment = [Scan_Max_Elements_Shown, 8].min\n y = y + (200 - (max_elment * 25)) / 2\n if battler.actor? and not $atoa_scr...
[ { "docid": "2c58e42794532eac7c44de75454c4c88", "score": "0.6599446", "text": "def draw(x_position, y_position)\n $app.fill(rgb(255,255,255))\n\t$app.title(@number)\n #$app.oval(x_position * Game::PIECE_SIZE + Game::PIECE_SIZE, y_position * Game::PIECE_SIZE + Game::PIECE_SIZE, \n # Game::PIECE_...
76727213cdde82c776cf1413a59ba7c4
Replaces whitespace with dashes ("").
[ { "docid": "c16b45298fddc1c85b3590b20cf0f311", "score": "0.64735985", "text": "def with_separators!(char = \"-\")\n @wrapped_string = @wrapped_string.gsub(/\\s/u, char)\n end", "title": "" } ]
[ { "docid": "678a531e924d27e08292fa8620cc7b2e", "score": "0.77812225", "text": "def hyphenize s\n s.gsub!(' ', '-')\n end", "title": "" }, { "docid": "bae912fcdf3b8500eec57491f823b6fb", "score": "0.75632966", "text": "def hyphenify(string) \n return string = string.gsub(/[ ]/, '-...
5024b018fce289d7547d7653342a8bf2
Deletes an email connection
[ { "docid": "e1a666698e9d698636c6c9f955d72d03", "score": "0.71566904", "text": "def delete_connection(username, conn_id)\n\t\tpath = '/v1/users/%s/email_connections/%d' % [username, conn_id]\n\t\tparams = {}\n\n\t\tadd_common_params('DELETE', path, params)\n\n\t\trequest = Net::HTTP::Delete.new path\n\t\...
[ { "docid": "69fc022dbea9518f0a1f455e387641f9", "score": "0.6788817", "text": "def destroy\n @email_config.destroy\n end", "title": "" }, { "docid": "4c3504bbd47d3fb3f7e00028e01e135d", "score": "0.6570466", "text": "def destroy\n @received_mail.destroy\n end", "title": "" ...
4e1e00b877821dcd972f6e6578c3157f
or any other size.
[ { "docid": "a2bba3309f4751cd624aaacda5c4fb86", "score": "0.0", "text": "def setup\n size 640, 360\n # The file \"jelly.jpg\" must be in the data folder\n # of the current sketch to load successfully\n @a = load_image \"jelly.jpg\" \n no_loop # Makes draw only run once\nend", "title": "" } ...
[ { "docid": "dbb0a36fff0ad27d33741a938065f388", "score": "0.7824417", "text": "def size(*) end", "title": "" }, { "docid": "2312e401a8c94701975ebb0e5a480613", "score": "0.78087103", "text": "def original_size; end", "title": "" }, { "docid": "735fddcb0dc4a5c799b06468239ee1...
556d964f4c4a883e14369281006fd941
DELETE /twitterposters/1 DELETE /twitterposters/1.json
[ { "docid": "c3bc20b72f5958a0487a821eef3828ef", "score": "0.7025053", "text": "def destroy\n @twitterposter.destroy\n respond_to do |format|\n format.html { redirect_to [:admin, twitterposters_url], notice: 'Twitterposter was successfully destroyed.' }\n format.json { head :no_con...
[ { "docid": "89d8d2047e3fc92e9061df0280c642bb", "score": "0.7198198", "text": "def destroy\n @tweeter = Tweeter.find(params[:id])\n @tweeter.destroy\n\n respond_to do |format|\n format.html { redirect_to tweeters_url }\n format.json { head :no_content }\n end\n end", "title": "...
1bfb59a6ea58a068560f825ecbe327a6
This Node just checked in. Check if the image is correct and then inform all observers of the joyous event. initialName = Initial name of node agentVersion = Version of node agent image = Name of image installed on node
[ { "docid": "5f82b572e46d4a7f91539c95ea249833", "score": "0.7860532", "text": "def checkIn(initialName, agentVersion, image)\n info(\"Checked in as #{initialName} booting off #{image}\")\n if (@image != nil && image != @image)\n warn(\"Expected image '\", @image, \"', but node reported '\", im...
[ { "docid": "d49c5ffe72178df743a7820edad9c6f3", "score": "0.6154003", "text": "def ready_image(action_handler, image_spec, _image_options)\n img = @one.get_resource(:image, :id => image_spec.reference['image_id'].to_i)\n fail \"Image #{image_spec.name} (#{image_spec.reference['image_id'...
689b586a0e6d22db180c265066f6aecd
method to display as a string to the console
[ { "docid": "5ac77db40eeb417a093264c3091e2a21", "score": "0.0", "text": "def to_s\n\t\tprint \"-\" + @author + \", \" + @title + \"\\n\" + @description + \"\\n\\n\"\n\tend", "title": "" } ]
[ { "docid": "e01f2e09c425b1c39468fe20124fe048", "score": "0.81408894", "text": "def display\n $stdout.puts to_s\n end", "title": "" }, { "docid": "40d6d254cf1905acec0ecffc0de0be73", "score": "0.77819794", "text": "def print\n puts(as_string)\n end", "title": ""...
d0ead5255b6b70bfaf547db0b785cc30
Runs the services set. Running the service set entails starting all of the service set's enabled services.
[ { "docid": "bcb64339fc5147ebfddb66c4d935b4e6", "score": "0.5979582", "text": "def run\n start_enabled\n end", "title": "" } ]
[ { "docid": "21768c97e77ff84030482bdeaed3d8f7", "score": "0.7857946", "text": "def start\n do_for_each_service { |service| service.start }\n end", "title": "" }, { "docid": "f3fc24300e2cdcc814756bc01212532a", "score": "0.76320046", "text": "def start_services(services)\n ...
9c0da883892f891e8f17b20339e0f6f7
fetches default factor norms fetches norm buckets for dropdowns fetches default_norm_bucket_ranges for the assessment's FA, Industry and Exp creates job_assessment_factor_norm for each factor with default values
[ { "docid": "1c4ae241505b740668a696ad4f5a7f47", "score": "0.7080046", "text": "def get_competency_norms\n @norm_buckets = Vger::Resources::Suitability::NormBucket.where(:order => \"weight ASC\").all\n default_norm_bucket_ranges = get_default_norm_bucket_ranges\n\n added_factors = @assessment.job...
[ { "docid": "a9ec2059a003b55ad647febbf185abbe", "score": "0.75692767", "text": "def get_norms\n params[:assessment] ||= {}\n params[:assessment][:job_assessment_factor_norms_attributes] ||= {}\n\n selected_factors = Hash[params[:assessment][:job_assessment_factor_norms_attributes].values.map{|fa...
d0f150f58b2a98857e295a628aa3f4b8
Is the enum value valid?
[ { "docid": "7d17fb53ef023eac95150e308cb413fc", "score": "0.0", "text": "def valid?\n verify\n end", "title": "" } ]
[ { "docid": "5d8eb84436220f806eb50c8a0bc66867", "score": "0.78241444", "text": "def valid?\n ENUM.include? @type.downcase.to_sym\n end", "title": "" }, { "docid": "57afa6b65a77e5651a5dd7df65e1a85b", "score": "0.77033526", "text": "def valid?(value)\n return false if...
1177f88321f4a9e401fda0b82227ea4a
This will generate the nearest driver
[ { "docid": "ef6ca75fa5df346e0717d949c6c4aadb", "score": "0.7326585", "text": "def getNearestDriver\r\n\t\tnearestDriver = nil\r\n\t\tnearestDistance = 99999\r\n\t\tu = @user.coordinate\r\n\t\t@drivers.each do |d|\r\n\t\t\tdRadius = (u.x - d.coordinate.x).abs + (u.y - d.coordinate.y).abs\r\n\t\t\tif dRad...
[ { "docid": "01f87072a4bc4ca842976c445865e42e", "score": "0.7630558", "text": "def nearest_driver\r\n\t\tcandidate_driver = nil\r\n\t\tminimum_distance = 2*@maps.mapsize\r\n\t\t@array_of_driver.each do |driver|\r\n\t\t\tdistance = distance(@user.location, driver.location)\r\n\t\t\tif distance < minimum_d...
275e73999df317e52069021b9ea11caa
DELETE /tasks/1 DELETE /tasks/1.json
[ { "docid": "22aa9dc236ee9a654a25a051c19713d3", "score": "0.73315316", "text": "def destroy\n @task = current_user.tasks.find(params[:id])\n @task.destroy\n\n respond_to do |format|\n format.html { redirect_to tasks_url }\n format.json { head :ok }\n end\n end", "title": "" }...
[ { "docid": "8379665eb11157da423e4d478103f0b0", "score": "0.76986516", "text": "def delete_task\n Task.find(params['task_id']).destroy\n render json: {success: true}\n end", "title": "" }, { "docid": "9d5e7fb54fb48465ffe5dcad22720803", "score": "0.7661382", "text": "def delete_...
553984f6a68bad4c98e612f0e9832816
is a faculty member?
[ { "docid": "de1ca9874f6fcac59a6201f1eabe4bcd", "score": "0.88831216", "text": "def faculty?\n\t\tmember_of.downcase.include? \"faculty\"\n\tend", "title": "" } ]
[ { "docid": "2ff08cd2a15bae5306ceda4e5584a3d6", "score": "0.7739069", "text": "def can_use_leo?\n faculty?\n end", "title": "" }, { "docid": "297498107163aec3130577fad24f249c", "score": "0.7699636", "text": "def faculty?\n roles.where(name: Ability.faculty_group_name).exists?\n...
2a0cf54a6113ffbc98e135151cad7333
POST /insurance_coverages POST /insurance_coverages.json
[ { "docid": "bdc8c0fdcc073eba5d6b4dd2b8475c72", "score": "0.78471655", "text": "def create\n @insurance_coverage = InsuranceCoverage.new(insurance_coverage_params)\n\n respond_to do |format|\n if @insurance_coverage.save\n format.html { redirect_to @insurance_coverage, notice: 'Insuranc...
[ { "docid": "3c53acc6015b0fa17aa6789c1be57848", "score": "0.743645", "text": "def create\n @coverage = Coverage.new(coverage_params)\n\n respond_to do |format|\n if @coverage.save\n format.html { redirect_to @coverage, notice: 'Coverage was successfully created.' }\n format.json ...
a89207e142576c9656eef98e8321f465
def test_admin_creates_organization_with_foster_based fill_basic_form check 'organization_foster_based' click_on 'Add physical addresses' fill_in 'organization_physical_addresses_attributes_0_name', with: 'Testing' fill_in 'organization_physical_addresses_attributes_0_address', with: '345 Spear St' fill_in 'organizatio...
[ { "docid": "80215f29972cf61f76cdba32b8e045ce", "score": "0.7021223", "text": "def fill_basic_form\n fill_in 'organization_name', with: 'org'\n fill_in 'organization_director', with: 'isay'\n fill_in 'organization_description', with: 'org description'\n fill_in 'organization_facebook', with: ...
[ { "docid": "f7bb4c442c96a2660e7a5fef7b59736b", "score": "0.651435", "text": "def test_validations\n a = Address.new\n a.first_name = 'X'\n a.last_name = 'Y'\n a.address_1 = 'Z'\n a.city = 'C'\n a.postcode = '1'\n assert !a.valid?\n # assert a.errors.invalid?(:first_name)\n # a...
582e0a2d26188959589198a1ec006317
PUT /aquestions/1 PUT /aquestions/1.json
[ { "docid": "d138c50db2634eac11ef2e2a377756d2", "score": "0.0", "text": "def update\n @attachment = Attachment.find(params[:id])\n @select = Select.where(:id => @attachment.select_id).last\n\n respond_to do |format|\n if @attachment.update_attributes(params[:attachment])\n if @attach...
[ { "docid": "e200c2e45d5e06159f21daee27b74aa8", "score": "0.7085408", "text": "def update\n @v1_question = V1::Question.find(params[:id])\n\n if @v1_question.update(question_params)\n render json: @v1_question, status: :ok\n else\n render json: @v1_question.errors, status: :unprocessab...
49049a20b175f3f5fb228e4b89f9f155
Test if the operation is negated Defaults to return false.
[ { "docid": "27a6c70e8e1d3342e3adc406b7e86970", "score": "0.70296067", "text": "def negated?\n parent = self.parent\n parent ? parent.negated? : false\n end", "title": "" } ]
[ { "docid": "d76eec89abb08afafc22d9db20e7b22a", "score": "0.83960336", "text": "def negated? #:nodoc:\n !!@negated\n end", "title": "" }, { "docid": "6893917f24b4df32ad6cd2f591b33d8f", "score": "0.83522034", "text": "def negated?\n @negated\n end", ...
40e7ade1412f5aa58446af61b5fa677e
Public: Get an array of available Pygments formatters
[ { "docid": "074345b3531297c9447b7279b7336ac2", "score": "0.65246344", "text": "def formatters\n mentos(:get_all_formatters).each_with_object({}) do |(name, desc, aliases), hash|\n # Remove the long-winded and repetitive 'Formatter' suffix\n name.sub!(/Formatter$/, '')\n hash[na...
[ { "docid": "7d1b1d87e11f41d2b5a000f8c3b7f71a", "score": "0.7216259", "text": "def formatters\n @formatters ||= []\n end", "title": "" }, { "docid": "8e64b3a9b738eb9630e6d27b5af1052c", "score": "0.69570744", "text": "def all\n formatters.map(&:name)\n end", "title"...
8e421cd24b6d1ec9622d02908e3b1efd
PART 2 Returns a string greeting
[ { "docid": "76e7ec200feb618ed093d48bdfd819ae", "score": "0.0", "text": "def hello(name)\n return \"Hello, #{name}\"\nend", "title": "" } ]
[ { "docid": "3e7328754a7321b44d98167b4bc6b61e", "score": "0.81446326", "text": "def greeting(phrase,name)\n phrase = phrase.to_s \n name = name.to_s\n puts \"#{phrase} #{name}\"\n return phrase + name\nend", "title": "" }, { "docid": "c7058f02f615df9eb537bfb5270088a5", "score": "0.809...
282f8e0b5d4e28c71ac6f37c4bcd0ebf
A string is blank if it's empty or contains whitespaces only: ''.blank? => true ' '.blank? => true "\t\n\r".blank? => true ' blah '.blank? => false Unicode whitespace is supported: "\u00a0".blank? => true
[ { "docid": "ed919a7d06263fb82cafc624b2e762c8", "score": "0.70638114", "text": "def blank?\n BLANK_RE === self\n end", "title": "" } ]
[ { "docid": "e47ede34d7d0aa5970bc92050c55882d", "score": "0.83545005", "text": "def blank?(str)\n str.nil? || str.to_s.strip == ''\nend", "title": "" }, { "docid": "cf1d11c690b713a3d09fe6d9d0cd501c", "score": "0.82786846", "text": "def blank?(str)\n str.nil? or (str.is_a? String...
5b7c091adbcc377d953cfab7355b67c4
Returns the vrrp port check true: port check enabled false: port check disabled
[ { "docid": "69213de92dc1d45fd358a1c21921c6cd", "score": "0.800404", "text": "def vrrp_port_check_enabled?\n @vrrp_port_check\n end", "title": "" } ]
[ { "docid": "5bcddb8c58eb5ba0f77938b349c10d18", "score": "0.6160793", "text": "def hasPorts1\t\t\r\n\tend", "title": "" }, { "docid": "7131e7639a46b058ee50550711461bfc", "score": "0.5954885", "text": "def vpn?\n vpn = false;\n IO.popen( '/opt/cisco/vpn/bin/vpn status' ) do |out|...
783983ae0176ef67976a6c13a857904a
GET /setlists/1 or /setlists/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "4d64e2d693b959cc6ccbdba5e1269336", "score": "0.7328448", "text": "def get_list(list_id)\n rest(\"get\", \"lists/#{list_id}\")\n end", "title": "" }, { "docid": "e68588403412144502e230106ec60d92", "score": "0.7020082", "text": "def get_list(user, list)\n get(\"/#{...
956367030e5b27d01960a225a001c5f8
Description: Following action is responsible for the snacks list details in home page snacks section.
[ { "docid": "b97346bed53468eee1e25cea7f6ecd9e", "score": "0.6601512", "text": "def snacks\n\n @snacks = Spree::Product.limit(5).order('id desc')\n @snacks.sort_by! { |x| x[:name].downcase }\n end", "title": "" } ]
[ { "docid": "6ca06c1a952cf091ce247e028114f6fc", "score": "0.7289212", "text": "def index\n @snacks = Snack.all\n end", "title": "" }, { "docid": "260ec3d8b4a9541fe5e0f40f9cccbdca", "score": "0.6327824", "text": "def get_snacks_list\n @complete_snacks_list = Spree::Product.selec...
331dcc3f02159f8f7c15fcf64c7d3569
POST /sparrings POST /sparrings.json
[ { "docid": "632b654078e1aa8bbd54a84122c54915", "score": "0.6734884", "text": "def create\n @sparring = Sparring.new(sparring_params)\n\n respond_to do |format|\n if @sparring.save\n format.html { redirect_to @sparring, notice: 'Sparring was successfully created.' }\n format.json...
[ { "docid": "a42cfe91cabeac786b8003986bdc4f46", "score": "0.6580888", "text": "def create\n @speding = Speding.new(speding_params)\n\n respond_to do |format|\n if @speding.save\n format.html { redirect_to @speding, notice: 'Speding was successfully created.' }\n format.json { ren...
489461887cdbaeb3d29180c8d5558026
POST /fabric_variants POST /fabric_variants.json
[ { "docid": "c20e12cc4bfa56f710dfea6135fb3514", "score": "0.7370807", "text": "def create\n @fabric_variant = FabricVariant.new(fabric_variant_params)\n\n respond_to do |format|\n if @fabric_variant.save\n format.html { redirect_to @fabric_variant, notice: 'Fabric variant was successful...
[ { "docid": "9bab63413c9894240e97c93e782365f4", "score": "0.66713727", "text": "def create\n respond_to do |format|\n format.json do\n if @variant.save\n render json: @variant\n else\n render json: { :errors => @variant.errors.messages }, status: :unprocessable_ent...
346e85dfccd3fde9a422d6ba6e282f6f
Public: Instantiates a group object, and adds it to the database POST /groups POST /groups.json
[ { "docid": "936c428c874c4e48e92367a3fa54cb24", "score": "0.7567167", "text": "def create\n @group = Group.new(group_params)\n\n respond_to do |format|\n if @group.save\n format.html { redirect_to @group, notice: 'Group was successfully created.' }\n format.json { render action: ...
[ { "docid": "eed29c964e25be504f0dbb4cecf6ce19", "score": "0.80236185", "text": "def create_group(group_id, request)\n start.uri('/api/group')\n .url_segment(group_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .post()\n .go()\n end", "t...
66792c2ad9e147484844cf154f6c6de5
down the road, we will need a mcuh faster way to easily access piece data thats not through the database
[ { "docid": "4ab69bd3412899fc8858c085218c8c07", "score": "0.0", "text": "def pieces_as_array\n pieces = self.pieces.where(captured_piece: false)\n piece_array = [\n [0,0,0,0,0,0,0,0],\n [0,0,0,0,0,0,0,0],\n [0,0,0,0,0,0,0,0],\n ...
[ { "docid": "8e0d1518aee2dce149b639a3d9639eb3", "score": "0.5921758", "text": "def data\n return self.pieces.map{ |piece| piece.data }\n end", "title": "" }, { "docid": "848dd63c533450b6449c832687b076df", "score": "0.5855823", "text": "def get_existing_piece\n logger.info \"get...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "7ac169d6c21ee2da1bf4ca1f13580113", "score": "0.0", "text": "def update!(**args)\n @day_of_week = args[:day_of_week] if args.key?(:day_of_week)\n end", "title": "" } ]
[ { "docid": "184b1b1ed771473d3eb9f338c0734c38", "score": "0.73066413", "text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end", "title": "" }, { "docid": "5076c5a88404ae72986f958710f5687a", "score": "0.72631145", "text": "def update...
53d14c59ede1b9a21faf30bef94abe10
Measures the sum of downhills between segments of the route.
[ { "docid": "b5c2f7c36bf1f0b9e5b6b290a9f0d55b", "score": "0.7725922", "text": "def total_downhills\n segments.inject(0) {|result, segment| result + segment.total_downhills}\n end", "title": "" } ]
[ { "docid": "1d6278e92ce3c01e4d78120272eaf1bc", "score": "0.68864506", "text": "def total_downhills\n return 0 if track_points.length <= 1\n\n result = 0\n latest_track_point = track_points.first\n track_points.each do |track_point|\n if track_point.elevation < latest_track_poi...
36cffafa92f2d9d177daf05c426bf671
Provides access to the request's HTTP headers, for example: request.headers["ContentType"] => "text/plain"
[ { "docid": "460203a931eb42910262a3169c00a61d", "score": "0.7477412", "text": "def headers\r\nHttp::Headers.new(@env)\r\nend", "title": "" } ]
[ { "docid": "618ee01a365b3977e44ee9730d4e9866", "score": "0.86891913", "text": "def headers\n request.headers\n end", "title": "" }, { "docid": "0a91b2899a19acd4d2c53a4dacdd5968", "score": "0.84828126", "text": "def get_headers\n request_object.headers\n end", "title":...
a2aa5caeb3dbff9dec4a32b6dbb97fe7
END GROUP PROPERTIES GROUP METHOD MISSING
[ { "docid": "a82c912a23f2f4875749625fc40a9f30", "score": "0.0", "text": "def method_missing(key, *args)\n if (name = key.to_s)[-1, 1] == \"=\" \n @data[name.chop.to_s] = args.first\n else\n (@data.keys.include? name) ? (@data[text].instance_eval((name[-2, 2] == \"id\") ? \"to_i\" : \"self...
[ { "docid": "6fe4e6885430bb587c75f184976eeb09", "score": "0.69247264", "text": "def group; end", "title": "" }, { "docid": "6fe4e6885430bb587c75f184976eeb09", "score": "0.69247264", "text": "def group; end", "title": "" }, { "docid": "6fe4e6885430bb587c75f184976eeb09", ...
1945a8eeaf9dc92c0e10b0398f86d19d
Convert geometry to GeoJSON
[ { "docid": "17b2c06c387251f64f1fa2eaa10542ec", "score": "0.8472759", "text": "def geojson\n obj = factory.parse_wkt(geometry_as_wkt)\n RGeo::GeoJSON.encode(obj).to_json\n rescue\n Geoblacklight.logger.warn \"Geometry is not valid: #{geom}\"\n default_extent\n end", "title":...
[ { "docid": "2cdd96b39ed8a22d0ba582b4bd74b09a", "score": "0.752731", "text": "def to_geo_json_feature\n retval = {\n 'type' => 'Feature',\n 'geometry' => RGeo::GeoJSON.encode(self.geographic_area.geographic_items.first.geo_object),\n 'properties' => {\n 'asserted_distribu...
f16ff20f90c3fe2260e38d7f74f629f1
Empty strings were being interpreted as ASCII strings breaking `msgpack` decoding on the agentside.
[ { "docid": "ecf809aa53a422dfc8b39c284d71543f", "score": "0.0", "text": "def test_enconding\n error = Datadog::Error.new\n\n assert_equal(::Encoding::UTF_8, error.type.encoding)\n assert_equal(::Encoding::UTF_8, error.message.encoding)\n assert_equal(::Encoding::UTF_8, error.backtrace...
[ { "docid": "0c36fe1f9623bb5f36fc546f060ee148", "score": "0.62107503", "text": "def simple_str(s)\n if s.encoding.name != 'ASCII-8BIT' && s.encoding.name != 'UTF-8'\n die(\"string [%s]\\n encoding is %s,\\n expected ASCII-8BIT\\n\",s,s.encoding.name)\n end\nend", "title": "" }, { "docid"...
d44e8b183ad65be6171ae946905d3133
This method is going to return a nil.
[ { "docid": "2a3d05eae6af22a5bc83fcce811aef06", "score": "0.0", "text": "def calculate_circle_area(radius)\n 1 + 1\n \"Hi, from the calculate circle area\"\n PI * radius**2\nend", "title": "" } ]
[ { "docid": "d72fff9d18bc0e92c65bc23f36199c99", "score": "0.78818786", "text": "def returns_nil; end", "title": "" }, { "docid": "30b74fc52802965c5cbbc10cb15ce7fb", "score": "0.7076203", "text": "def null\n end", "title": "" }, { "docid": "425992b986dbf57924f12aad1e81ef0b...
8a9ab2a4faf26a013af48d38e661c4d5
Handles ajax request to update options in room select based on selected building
[ { "docid": "2d31b96072aceafa85927caf702398c9", "score": "0.76605403", "text": "def update_room\n\t@room_options = {}\n\t@room_options[\"data\"] = {}\n\trooms = Room.where(\"building_id = ?\",params[:building_id])\n\tif rooms.length == 0\n\t\t@room_options[\"data\"][\"\"] = \"\"\n\telse\n\t\trooms.each {...
[ { "docid": "a9976e1d5f672b4cbd258830f370a626", "score": "0.7040252", "text": "def update_room\n @rooms = Room.where(\"building_id = ?\", params[:building_id])\n respond_to do |format|\n format.js\n end\nend", "title": "" }, { "docid": "cea386f3bfa8b84aa679a380391e2961", "score": "0...
fcf0b99039498c6693ffd0c9cc0c23c5
rails g model comuna name:string province:references
[ { "docid": "acdaa73c30aa5af9bbbb1698ea00a06c", "score": "0.0", "text": "def read_communes\n path = 'public/json/comunas.json'\n json = JSON.parse(File.open(path).read)\n\n Commune.delete_all\n json.each do |data|\n Commune.create(name: data[\"nombre\"], province_id: data[\"pro...
[ { "docid": "a81eea1db06b67bbf24b7b70f2c8418d", "score": "0.569795", "text": "def build_province\n {\n code: code,\n cities: [],\n name: name\n }\n end", "title": "" }, { "docid": "ed8f80cf7abf8d27614f0b0358aa3f58", "score": "0.5541866", "text": "def source_macro...
11007373710144246a3cef4e3501bf4f
GET /properties/1 GET /properties/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "0bf5477934b357705f9f253da9b9b1fe", "score": "0.7496478", "text": "def show\n @property = Property.find(params[:id])\n\n render json: @property\n end", "title": "" }, { "docid": "45e3beeffb8bc807c13b4fe7e42983c5", "score": "0.7347074", "text": "def show\n propert...
a566adf94d906001d90084ab1be1ace7
Used internally to define field properties
[ { "docid": "b862e65feff5dfffaec98f2ba47aaa67", "score": "0.0", "text": "def new_sd_struct_member(name)\n name = name.to_sym\n unless singleton_class.method_defined?(name)\n define_singleton_method(name) { @table[name] }\n define_singleton_method(\"#{name}=\") {|v| @original_table[name] =...
[ { "docid": "b08df9aa742fb15c9cb701c36804d4d0", "score": "0.7561526", "text": "def field_definition; end", "title": "" }, { "docid": "a76a35ae2c9f8770844e9e93ad4d76a6", "score": "0.7372271", "text": "def field_definitions; end", "title": "" }, { "docid": "4b1b0277ef2e72579...
894b80ee9d10ddf12d090bf2a0afff2e
GET /registrations/1 GET /registrations/1.xml
[ { "docid": "499077f148d8df33f793dc5ef0daf3f2", "score": "0.656514", "text": "def show\n @registration = Registration.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @registration }\n \n end\n end", "title": "" } ]
[ { "docid": "0a99a9274e76ddf491e16d4b5f334a90", "score": "0.6882667", "text": "def index\n @registrations = Registration.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @registrations }\n end\n end", "title": "" }, { "docid": "0...
4449307a59a13c92c0dc8f081edcd761
translate an array of bytes to a string with the base32like dictionary
[ { "docid": "97738011ab5d92733783dd6f4588c186", "score": "0.6641436", "text": "def dict_translate_binary(arr)\n arr.map{ |n| DICTIONARY[n] }.join(\"\")\n end", "title": "" } ]
[ { "docid": "ea8dc84a140d28f75694111d79752864", "score": "0.6566817", "text": "def a32_to_base64(a)\n base64urlencode(a32_to_str(a))\n end", "title": "" }, { "docid": "9f024ad3e66f6617b36f8966db07ed0f", "score": "0.64995027", "text": "def convert\n binary = hex_to_binary\n g...
6c8205926fb95af66b59ee3c62dfc593
Location must be in the format of "file_path\file_name.rb:line_number" Scenario must be a string array containing everything from the first tag to the last example table where applicable.
[ { "docid": "f8344a662b73cf2eb55fc7393cd486b6", "score": "0.7104375", "text": "def initialize(location, scenario)\n super(location)\n @start_line = location.match(/:(?<line>\\d*)$/)[:line].to_i\n @steps = []\n @inline_tables = {}\n @examples_table = []\n split_scenario(scena...
[ { "docid": "e3cb7573a205bb2ab7d1ad2e2a35dd75", "score": "0.6586569", "text": "def initialize(location, scenario)\n super(location)\n @start_line = location.match(/:(?<line>\\d*)$/)[:line].to_i\n @steps = []\n @inline_tables = {}\n @examples_table = []\n split_scenario(scena...
3db932b7e970de739aa444cb7a97a19b
Writes a formatted representation (based on the configuration of the object) to the given output, which must respond to `<<`. source://pry//lib/pry/code.rb269
[ { "docid": "4fe329a90b9ca2fd34a33ee90ad872a0", "score": "0.0", "text": "def print_to_output(output, color = T.unsafe(nil)); end", "title": "" } ]
[ { "docid": "49e39c7b41628d67ca4fcda7b3a5b05c", "score": "0.7082602", "text": "def write( output, indent )\n output << to_s\n end", "title": "" }, { "docid": "4cbd49b7f5181b3be2cd8df58e8dfdea", "score": "0.6964295", "text": "def write( output, indent=-1 )\n output << to_s...
66a638f158e251ab2f35af026c40490d
DELETE /amertumes/1 DELETE /amertumes/1.json
[ { "docid": "6c83818d35f58d27058b38125a08965c", "score": "0.75129694", "text": "def destroy\n @amertume.destroy\n respond_to do |format|\n format.html { redirect_to amertumes_url, notice: 'Amertume was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "ti...
[ { "docid": "ea4d2632f55ba9db8f75705570d844e6", "score": "0.7302637", "text": "def destroy\n @royaume = Royaume.find(params[:id])\n @royaume.destroy\n\n respond_to do |format|\n format.html { redirect_to royaumes_url }\n format.json { head :no_content }\n end\n end", "title": "...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "84c681a8890722da3f51f2d603726a5a", "score": "0.0", "text": "def user_work_experience_params\n params.require(:user_work_experience).permit(:company_name, :address, :city, :province, :country, :industry, :position, :date_from, :date_to)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.6980384", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6782743", "text": "def strong_params\n params.requi...
b85ddd67778f1fcd54319de97e5cbbc1
Updates given story. PUT /sprints/:sprint_id/stories/:id
[ { "docid": "4d65bdd2df9ec08d20fe2b2bdc93270e", "score": "0.7991314", "text": "def update\n @story.update_attributes(params[:story])\n\n respond_with(@sprint, @story)\n end", "title": "" } ]
[ { "docid": "e53497d58398b452be6dfced70048e80", "score": "0.77861613", "text": "def update\n # @story = Story.find(params[:id])\n @story = @section.stories.find(params[:id])\n\n respond_to do |format|\n if @story.update_attributes(params[:story])\n flash[:notice] = 'Story was success...
742281d22ccd9ae331f1fa8745461a0d
Return a list of valid product names based on the configuration in trello.yml to match against
[ { "docid": "858ba0b881626e9527b59a880ca5a6d5", "score": "0.0", "text": "def valid_products\n @valid_products ||= initialize_valid_products\n end", "title": "" } ]
[ { "docid": "1629035de71a0ac73c4e8b33f6070c77", "score": "0.6151259", "text": "def slug_candidates\n [\n :name,\n [:name, :sku]\n ]\n end", "title": "" }, { "docid": "310652bd0a99aac9e9f59bec79b0843f", "score": "0.6117516", "text": "def for_which_products_ar...
728878c6f4b64453ffc6818f6216e5ee
Unregisters ip from all services
[ { "docid": "143d6ef7488520d3770129cdd7a18dcf", "score": "0.6934029", "text": "def unregister_ip_from_all(ip)\n\tmatches = []\n\tret = false\n\t@contexts.each_pair do |context_id, applications|\n\t applications.each_pair do |application_id, services|\n\t\tservices.each_pair do |service_id, addresses|\...
[ { "docid": "556bdc4d3b2bd308e5ad8ceae24993f4", "score": "0.6854026", "text": "def de_register(service)\n services.delete(service) if services.include?(service)\n end", "title": "" }, { "docid": "7410e7503b368fdd73033ad7cc536a58", "score": "0.6683532", "text": "def remove_ip i...
b67c3ada886c6fac6725043d5536ef7a
reduce 246 omitted reduce 247 omitted reduce 248 omitted reduce 249 omitted reduce 250 omitted
[ { "docid": "b6480833f90e989b513619c406eb1d1a", "score": "0.0", "text": "def _reduce_251(val, _values, result)\n lhs, op, rhs = val\n result = new_call lhs, op.to_sym, argl(rhs)\n\n result\nend", "title": "" } ]
[ { "docid": "dd458ee5bd7f974c08686357ef463ece", "score": "0.7170268", "text": "def _reduce_608(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "ad801b8250ddef70cf7a067f3e475838", "score": "0.71665746", "text": "d...
6b1f04ff69077da8cb32eb794c97d8a8
Handle new data received from the source. This is called from EventMachine when new data is written to the source. It comes in as a blob and may contain several text entries.
[ { "docid": "8141b0cd50b0fdef340b9fd3d589f449", "score": "0.62710845", "text": "def receive_data(data)\n @buffer.extract(data).each do |line|\n event = Woodchuck::Event.new ({ :path => source,\n :host => Socket.gethostname,\n ...
[ { "docid": "e6151a4cbbb128d458d6200847bfb45d", "score": "0.6516437", "text": "def handle_data(state, stream, text)\n logger.info \"[#{stream}] #{text}\"\n nil\n end", "title": "" }, { "docid": "5e9e6e9f2e340f2906dab4b05c8d028c", "score": "0.62930167", "text":...
d30d13f9337b0506ff267a5b736bd607
=begin rdoc Terminate JRubyD if usage count is 0. =end
[ { "docid": "60e03dfc59b1ffcb72c5dc2ccad8aa80", "score": "0.60449916", "text": "def stop_if_unused\n @mutex.synchronize { stop if (@usage_count <= 0 && @running) }\n end", "title": "" } ]
[ { "docid": "2910852cf6d670c697d6625c6e7ae97d", "score": "0.59764296", "text": "def terminate() end", "title": "" }, { "docid": "687d20c0fa3ce758c67f45fa5c60104f", "score": "0.5898461", "text": "def terminate!() end", "title": "" }, { "docid": "b9e8b61ef2b232231b5be7ee8eaf...
7255b0cf335c3e25a55e735117aa2e88
Remove stray quotation mark if there are an odd number of them
[ { "docid": "04e85e95c431bd233174dea5d755a9ab", "score": "0.66324633", "text": "def odd_quotes(query)\n if query&.count('\"')&.odd?\n query.sub(/\"/, '')\n else\n query\n end\n end", "title": "" } ]
[ { "docid": "8b72dca82a556a8aa84ebcad3f4a3926", "score": "0.71197563", "text": "def erase_quotation_marks(str)\n\tstr[0] = \"\" if str[0] == '\"'\n\tstr[-1] = \"\" if str[-1] == '\"'\n\treturn str\nend", "title": "" }, { "docid": "129b76992944248b47c5d3740ebc5af5", "score": "0.678805", ...
b36cee17c7eddf5d179d46af9d43e271
This method will destructively reset the capture state on this object. The existing headers array is emptied when this is called. See also: capture_complete?, reset_capture
[ { "docid": "67a04d02e34aba1effb2b2b770abe64e", "score": "0.7389421", "text": "def reset_capture!\n @capture_state = nil\n self.data = []\n end", "title": "" } ]
[ { "docid": "c7fd708664d44f1a388d2378ed3a15e2", "score": "0.83715016", "text": "def reset_capture\n if @headers\n @headers.reset_capture if not @headers.capture_complete?\n else\n attach_new_header()\n end\n\n if @body\n @body.reset_capture if not @body.capture_co...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "c756633b5216437aaa173815b2fa19c7", "score": "0.0", "text": "def set_document\n @document = Document.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;...
20a1526fd50edd6d13430b185d3a51c2
ROOT_DIR = $0 unless defined? ROOT_DIR Helper method for file references.
[ { "docid": "5f398c533e098e0e5d97283a3305dd79", "score": "0.7223469", "text": "def root_path(*args)\n File.join(ROOT_DIR, *args)\nend", "title": "" } ]
[ { "docid": "6c1eb6e288a64c1283eb296a95761b5d", "score": "0.758819", "text": "def root\n @root ||= File.expand_path File.dirname(__FILE__)\n end", "title": "" }, { "docid": "d90fd4f97cfd636f8185a10da83c4930", "score": "0.75838244", "text": "def root_path\n @root_path ||= ...
79af1c9838f74972af3e63965b0a0e83
Time complexity: O(n^2) Space complexity: O(n)
[ { "docid": "948ab40933e5050c998a1d9d8b9d10b5", "score": "0.0", "text": "def reverse_inplace(s)\n return reverse_helper(s, 0, s.length-1)\nend", "title": "" } ]
[ { "docid": "9bfaea331eedce3072d8464bb5cccee1", "score": "0.66952795", "text": "def fast_two_sum?(arr)\n # O(n) in time and space\n result = []\n complements = {}\n\n arr.each_with_index do |el, i|\n if complements[el]\n result.push([complements[el], i])\n else\n complements[-el] = i\...
16e1c4e25c8222c67e9c02a828e109ad
Comprised of xranges, tildes, stars, and gtlt's at this point. Already replaced the hyphen ranges turn into a set of JUST comparators.
[ { "docid": "d813eefbe4ca76d061334312dd40c36f", "score": "0.57814157", "text": "def parse_comparator(comp, loose)\n comp = replace_carets(comp, loose)\n comp = replace_tildes(comp, loose)\n comp = replace_xranges(comp, loose)\n comp = replace_stars(comp, loose)\n comp\n end", "title":...
[ { "docid": "ba246cd2dbc7e195cfbf245c48df072a", "score": "0.6225548", "text": "def to_comparators(range, loose)\n r = make_range(range, loose)\n r.set.map do |comp|\n set = comp.map(&:value).join(' ').strip.split(' ')\n set.empty? ? [''] : set\n end\n end", "title": "" }, { ...
22f690b5ba96ff400884da23953de053
Determines if this sequence is the top sequence of an instrument
[ { "docid": "5a6591f89e905c5f43a01844bcf2d8bc", "score": "0.61213124", "text": "def is_top?\n self.parent.nil?\n end", "title": "" } ]
[ { "docid": "72e9f15b99aa111beee9c56a8c6c5166", "score": "0.71327555", "text": "def at_top?\n higher_siblings.empty?\n end", "title": "" }, { "docid": "f9b1d26b5d1bc5edde434185af77cc33", "score": "0.7108747", "text": "def at_top?\n self.higher_siblings.empty?\n end...
2ac733d46811d5e7324b932645a227c3
Controller & Method Name : Category controller Create method Summary : This method was used to add master category in database. Status : NOT IN USED (Master Categories Added database Manually )
[ { "docid": "a1df831abd5019edeebbc65fe194de9c", "score": "0.0", "text": "def create\n @category = MasterCategory.new\n @category.category_name = params[:category][:category_name]\n @category.category_image = params[:category][:category_image]\n @category.is_active = \"1\"\n# data = StringIO.ne...
[ { "docid": "67a827555738160215fd10ecd3598ff5", "score": "0.759804", "text": "def create\n @master_category = Master::Category.new(master_category_params)\n\n respond_to do |format|\n if @master_category.save\n format.html { redirect_to @master_category, notice: 'Category was successful...
088f3b01a7fb575058dc757e9b5f9fcd
Creates a configParser object
[ { "docid": "6a70ccca4c647a2126c781fd6c8098e7", "score": "0.0", "text": "def initialize(file_path, log, verbose=false, mock = false)\n @config_file = file_path\n @parsed_hash = {}\n @verbose = verbose\n @log = log.dup\n @log.level = verbose ? Log4r::DEBUG : Log...
[ { "docid": "35410e351c9eb6aed04585b0e7fb6bd1", "score": "0.666675", "text": "def to_parser(*args, &block)\n parser = ConfigParser.new(*args, &block)\n traverse do |nesting, config|\n next if config[:hidden] == true || nesting.any? {|nest| nest[:hidden] == true }\n \n nest_...
ff15821d2bb9bf44b59c9c56f0c48807
6. Find the total of everyone's money (hint: use the people array)
[ { "docid": "927877ec0c47b1e046ab3e273e678781", "score": "0.77746844", "text": "def total_money(people)\n total = 0\n for person in people\n total += person[:monies]\n end\n return total\nend", "title": "" } ]
[ { "docid": "ff8a7f2c6685431e96ed8d963fa804d9", "score": "0.7911876", "text": "def total_everyone_money(people)\n total_money = 0\n for person in people\n total_money += person[:monies]\n end\n return total_money\nend", "title": "" }, { "docid": "660d1ba2103ecee2dc4d70d3650eee04", ...
7243d7975826d630e39a15c89bc33a40
Check if an unloaded record exists in the database
[ { "docid": "62ff6bc381d00d3069499c2d4b316a8e", "score": "0.71293247", "text": "def exists?\n load!\n true\n rescue RecordNotFound\n false\n end", "title": "" } ]
[ { "docid": "daa365eb36fe0e6990bc6c02f42851d4", "score": "0.6526588", "text": "def exists?\n rec = run_sql(\"SELECT * FROM #{table} WHERE id = #{@id};\")\n if rec.empty?\n @errors << \"That id does not exist in the table.\"\n false\n else\n true\n end\n end", "title": "" ...
a5c2319acaa781e8a575192e59693d8e
return number of XY coords if XY record
[ { "docid": "eabe26955453028dc201de2affa81f90", "score": "0.8189846", "text": "def returnNumCoords\n if @RecordType == XY ## 4 byte signed integer\n ((@Length - 4) / 8).to_i\n else\n false\n end\n end", "title": "" } ]
[ { "docid": "28f35d4a2c52a8023334a932f5485f6b", "score": "0.7125506", "text": "def points\n self.concatenate_data_arrays('x', 'coordinates').count\n end", "title": "" }, { "docid": "a395907e4499e4d0a873bcabbd44f8bd", "score": "0.70950466", "text": "def count\n return line_poi...
a28e478681ac9d29c5dd796aa824781d
PATCH/PUT /users/1 PATCH/PUT /users/1.json
[ { "docid": "e60c8e80e55678fb067fd31081a866f8", "score": "0.0", "text": "def update\n respond_to do |format|\n if @user.update(user_params)\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.ht...
[ { "docid": "f0686f191a0def3b6c3ad6edfbcf2f03", "score": "0.72438735", "text": "def update_user(email)\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/users/2.json'\n ).to_s\n\n puts RestClient.patch(\n url,\n { user: { email: email } }\n ...
e1814aa296eb5e41793c13a844cb5c28
tree is of the form: n1 n2 n3 n4 n5 n6
[ { "docid": "4f8cd2d559912ec0a1ebdce0f66eb46e", "score": "0.6993822", "text": "def build_tree(model)\n # inflate the node id to test id wrap around edge cases\n ENV[\"NODES\"].to_i.times { model.create!.destroy } if ENV[\"NODES\"]\n\n n1 = model.create!\n n2 = model.create!(:parent => n1)\n ...
[ { "docid": "032f579338e58ed933619240fe9953ca", "score": "0.70274323", "text": "def calc_tree\n tree = []\n n = 1\n while n <= @n\n result = []\n result = [[0, 1]] if n == 1\n tree.each do |row|\n line1 = []\n line2 = []\n row.each_with_index do |elem, i|\n ...
0fa6db1144a4aa3e3a930f59021c87f7
initialize hash between ID and product object
[ { "docid": "6e9f0123b1e4dd95151b805fed056da0", "score": "0.62282777", "text": "def init_vault\n @vault={}\n @products.each do |product|\n product.identifiers.each do |ident|\n @vault[ident.uniq_id]=product\n end\n end\n\n @products.each do |product|\n if...
[ { "docid": "189ec5a41b227c4648744a83b2f5c3f9", "score": "0.76709867", "text": "def initialize (product_hash)\n @product_id = product_hash[:product_id]\n @product_name = product_hash[:product_name]\n @vendor_id = product_hash[:vendor_id]\n end", "title": "" }, { "docid": "86a2d89840...
5cf9037cc69e742a71b0cbc50bf72918
Returns the pdf file
[ { "docid": "65c74559a291e44c807b691c14b6ac73", "score": "0.0", "text": "def pdf(html)\n WickedPdf.new.pdf_from_string(html,\n margin: {:top => 0, :bottom => 0, :left => 0, :right => 0})\n end", "title": "" } ]
[ { "docid": "abfcff27c0f79e63e8ac7a974507240e", "score": "0.79333675", "text": "def pdf_file\n ActiveSupport::Deprecation.warn('This API has changed: Please use order.pdf_invoice.pdf instead')\n pdf_invoice.pdf\n end", "title": "" }, { "docid": "738a5166f83c90a7fdda6cba9ddfa973", "...
23bb442be0d1b24ec3df77768ee507a3
This method should return the image PATH of the payment gateway to be displayed in Unlock's gateways configurations, such as 'my_gateway/logo.png'.
[ { "docid": "791a8a287b17dcf81b1ddd2fd4217668", "score": "0.0", "text": "def image\n end", "title": "" } ]
[ { "docid": "a363149128842a51c903c327aa21d96f", "score": "0.647887", "text": "def gateway_url\n if developer?\n File.join \"/pagseguro_developer/create\"\n else\n GATEWAY_URL\n end\n end", "title": "" }, { "docid": "74c480b1ec9a49b5c88a833a9f5544b1", "score": "0.626205...
4efbf92dbb882010651a7a6fcd3647c5
extrait l'id correspondant a l element pour faire un link_to ds la vue, avec id comme parametre transmis
[ { "docid": "257f011155c3d069cc61202f7584ba46", "score": "0.0", "text": "def detail_element\n @pe=ProjectElement.find(:all, :conditions=> [\"project_id= ?\",self.id])\n \n #elements id correspondant à ce projet\n @t=@pe.collect do |el|\n el.element_id\n end\n \n #elements...
[ { "docid": "f19a11c777328cc7efe09d6e95bdaf73", "score": "0.606846", "text": "def debug_id_linked id\n \"<a href=\\\"#exo-#{id}\\\">#{id}</a>\"\n end", "title": "" }, { "docid": "adf8d667352991b1d0df444f4a18a47f", "score": "0.58591163", "text": "def anchor\n \"#{self.class}...
f4bd0856ecb405adb3b3a595e5f36f39
Update a 'vnic.EthNetworkPolicy' resource.
[ { "docid": "147e4aa413ce8b1ea72d62f5fed0cfbd", "score": "0.6112845", "text": "def patch_vnic_eth_network_policy(moid, vnic_eth_network_policy, opts = {})\n data, _status_code, _headers = patch_vnic_eth_network_policy_with_http_info(moid, vnic_eth_network_policy, opts)\n data\n end", "ti...
[ { "docid": "2cd0076f4f66a7efbf7f436c946ce8ee", "score": "0.64693075", "text": "def update_vnic_eth_network_policy(moid, vnic_eth_network_policy, opts = {})\n data, _status_code, _headers = update_vnic_eth_network_policy_with_http_info(moid, vnic_eth_network_policy, opts)\n data\n end", ...
c228d6580c0abee57c4f3255201d82b7
Override and call super as necessary.
[ { "docid": "95af73ef23173c42f7a8a9716ee4c014", "score": "0.0", "text": "def on_start_listener(event)\n start_listener\n end", "title": "" } ]
[ { "docid": "086a26aefd5216dc70f7732d0c34aaec", "score": "0.73149353", "text": "def run\n super\n end", "title": "" }, { "docid": "086a26aefd5216dc70f7732d0c34aaec", "score": "0.73149353", "text": "def run\n super\n end", "title": "" }, { "docid": "e6431ff47476c901...
dfc46a9f835c5f7c1ac9355967ab9a35
use preflabel_si to get exact match (string instead of token)
[ { "docid": "63eaaee44cc15f950cdf5158e2f78db3", "score": "0.57226014", "text": "def find_id val\n parse_terms_id_response(SolrQuery.new.solr_query(q='inScheme_ssim:\"' + terms_id + '\" AND preflabel_si:\"' + val + '\"', fl='id'))\n end", "title": "" } ]
[ { "docid": "f9a5a2e2dee527cf2b0fe6677bfc73ce", "score": "0.6863956", "text": "def find_by_label(label)\n result = @cyc.cyc_query( -> { '`(#$prettyString-Canonical ?s ' + transliterate(label).to_cyc + ')' }, :EnglishMt)\n if result\n result.map!{|e| convert_ruby_term(extract_term_n...
dca8934f4580f473ce5cc2d89cda3978
creates an array of calendar dates that represent the specified interval interval specifies: start date end date holidays num of instructional days (not used)
[ { "docid": "0d2e2f3c35342623660ecb5d5c171a1d", "score": "0.8137248", "text": "def create_calendar_dates(interval, ed_org_id)\n calendar_dates = []\n begin_date = interval.get_begin_date\n end_date = interval.get_end_date\n holidays = interval.get_holidays\n (begin_date..en...
[ { "docid": "e65669e5d841d26d8cac3dfcfdba7312", "score": "0.69506305", "text": "def dates_ranges\n (1..8).to_a.collect do |i|\n {\n start_date: i.days.ago,\n end_date: DateTime.now,\n num_of_days: i + 1\n }\n end\n end", "title": "" }, { ...
6a7d780e0fb5c23c5c1582c6a37ab78a
/stories/hot list of all hot stories
[ { "docid": "85006e801fa0fa7ceb71c4fd96a1e04d", "score": "0.0", "text": "def test_stories_find_hot\n assert_not_nil @rdigg.stories.find_hot(:count => 3)\n end", "title": "" } ]
[ { "docid": "4516791e52c8329b6caf2b09ddc3d309", "score": "0.75052303", "text": "def get_mashable_stories\n\n\ts = JSON.load(RestClient.get('http://mashable.com/stories.json')) \n\ts[\"hot\"].map do |story|\n\ts = {story: story[\"title\"], category: story[\"channel\"]}\n\tget_upvotes(story)\n\tdisplay_new...
3407f1911edbdadcdbec554453e306ad
The top level type of this field. Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY").
[ { "docid": "581e55784bbfe5e61a5c7076ad945f11", "score": "0.0", "text": "def type_kind\n @gapi_json[:typeKind]\n end", "title": "" } ]
[ { "docid": "196676870292fb30f1c187c1cefed0d9", "score": "0.69934493", "text": "def field_type\n self.class.field_types[self.safe_kind.to_sym]\n end", "title": "" }, { "docid": "edca5b2eb274b1dbcf0869a199011474", "score": "0.697439", "text": "def type_name\n @field.type...
1b978b8bbf90537b5c3fd5b098bf7e1a
Render a nested ul list from a treelike hash structure (where each hash key is a node, and the value containing the children)
[ { "docid": "ab996017ffa4f12ac3dec68400997c95", "score": "0.69458157", "text": "def tree_list\n result = \"<ul>\\n\"\n elements.each { |parent, children| result << subtree_list_for(parent, children) }\n result << \"</ul>\\n\"\n result\n end", "title": "" } ]
[ { "docid": "042529ae38f57ca893451dc3d09e90fc", "score": "0.70510215", "text": "def from_hash_to_html(dict, depth_to_traverse=1000, start_depth=0)\n depth = start_depth\n if dict.is_a?(Hash) && !dict.empty?\n str =''\n str << '<ul>'\n depth += 1\n dict.each do |key, value|\n ...
1fdf02acec628edb94422a2c9cd6485d
Provide a user friendly representation source://twilioruby//lib/twilioruby/rest/preview/sync/service/document/document_permission.rb116
[ { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.0", "text": "def to_s; end", "title": "" } ]
[ { "docid": "d6b76a54ec9113238db218d9e0d3ef9f", "score": "0.6809255", "text": "def index_show\n @permissions = DocumentPermission.document(@document)\n .user(@user)\n end", "title": "" }, { "docid": "d24fc854d7bc4cb0872ffb4e11078e85", "score": "0.66...
4b29bd4cfa7caca5e9ac34114c411325
Values of memoized methods are remembered only for the duration of a single unit of work. These are typically created using the `let` DSL method.
[ { "docid": "a0a07805604c9662e352de8b419484dd", "score": "0.68326354", "text": "def add_memoized_method(name, &block)\n define_method(name) do\n memoized[block] ||= instance_eval(&block)\n end\n end", "title": "" } ]
[ { "docid": "1a3812e56a32b223cc8bfd304b564d79", "score": "0.76070166", "text": "def memoize\n lambda do |*args|\n @memo ||= {}\n @memo[args.hash] ||= call(*args)\n end\n end", "title": "" }, { "docid": "2b8bf85a581a9154c7acc69c2f317e4a", "score": "0.75535905", ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "0fc4f1dcaabc175a9531445ccd74d4e1", "score": "0.0", "text": "def payment_params\n params.require(:payment).permit(:scholarship_id, :bank_date, :amount,:amount_aud,:effective_year, :effective_month, :notes)\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...
06dbeefe2d923a903340d15820e9a3c1
Decodes a URI string to a normal string.
[ { "docid": "f78dfa5ae3256d8e7791d2f7e717f5cd", "score": "0.6270818", "text": "def uri_unescape\n tr('+', ' ').gsub(/((?:%[0-9a-fA-F]{2})+)/n){[$1.delete('%')].pack('H*')}\n end", "title": "" } ]
[ { "docid": "5562fcf161284d8e0d3bcaff6d2300a2", "score": "0.7431164", "text": "def unescape_uri(uri); end", "title": "" }, { "docid": "d2902c049273fd5642dc97c0ec18f992", "score": "0.7083723", "text": "def unescape_uri(str)\n str = str.dup\n str = binary_encode(str)\n st...
e04551990615eba21bcf647573748606
GET /conjunctions/new GET /conjunctions/new.json
[ { "docid": "321b699b2b62498a873b9f806dc43977", "score": "0.85137945", "text": "def new\n @conjunction = Conjunction.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @conjunction }\n end\n end", "title": "" } ]
[ { "docid": "6ca77d13c0d7d2bc00958f9fbacb697f", "score": "0.80191463", "text": "def create\n @conjunction = Conjunction.new(params[:conjunction])\n\n respond_to do |format|\n if @conjunction.save\n format.html { redirect_to @conjunction, :notice => 'Conjunction was successfully created....
c16603663ce71bc2fb89b2885ef58625
get_next_page Parameters:: (Page) params:page Return:: The next page to be scraped Author::
[ { "docid": "8a9dc9719005360da17955176bebc5be", "score": "0.66758907", "text": "def get_next_page(page)\n # The trick is that before you issue a HTTP request, you MUST rotate_proxy first\n # Todo: Put your code here to get the next page to be scraped\n\n if has_next_page(page)\n link = get_next_url...
[ { "docid": "4e7cf8ead58183da3430051cd37aa648", "score": "0.755987", "text": "def get_next_page(page)\n # Todo: Put your code here to get the next page to be scraped \nend", "title": "" }, { "docid": "4e7cf8ead58183da3430051cd37aa648", "score": "0.755987", "text": "def get_next_page(...
3ff1ca6a8559204c6ce02f630494bfa9
POST /loans POST /loans.json
[ { "docid": "6fae0a1e8741e3b7cbb8c1fb0691079e", "score": "0.0", "text": "def create\n @loan = Loan.new(loan_params)\n @loan.monthly_installment = compute_monthly(@loan).round(2)\n @loan.downpayment = (@loan.purchase_price * 0.2).round(2)\n @loan.balance_penalty_amount = 0\n\n respond_to do...
[ { "docid": "124124de4d6a268854421372da1fc44a", "score": "0.6424209", "text": "def create\n @user = User.find(current_user.id)\n @loan = @user.loans.new(loan_params)\n\n respond_to do |format|\n if @loan.save\n format.html { redirect_to @loan, notice: 'Loan was successfully created.'...
555fdbd89edd41d4b6477238bcc199a0
Flushes the lookup cache.
[ { "docid": "23dea7780816f80f9a4b10979c33aa18", "score": "0.6368545", "text": "def flush_cache\r\n @cache.clear\r\n @nick_cache.clear\r\n end", "title": "" } ]
[ { "docid": "ea182be94b927dc8b5a2f5e2bf03d796", "score": "0.7481926", "text": "def flush\n cache.flush\n end", "title": "" }, { "docid": "5df9058ff175d3474dfd1ae46a38f8b2", "score": "0.727995", "text": "def flush\n @cache.clear\n @id_maps.clear\n end", "ti...
f186fb14f35cc26bfce7cf08193fa0ab
GET /workshops/1 GET /workshops/1.json
[ { "docid": "42115726a12725b58df5d458391c004a", "score": "0.0", "text": "def show\n @check_workshop = Workshop.find(params[:id])\n if (@check_workshop.allow_access == true || current_user.try(:is_user?) || current_user.try(:is_admin?))\n @workshop = Workshop.find(params[:id])\n @feedback_...
[ { "docid": "0a6cfdcfae749733303521cd79bf1794", "score": "0.7173123", "text": "def index\n \n @works = Work.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @works}\n end\n\n end", "title": "" }, { "docid": "207dabf2ebe89596203b...
964c5765b0e5fb19b58aa19c93801bc7
Check for the test id based on the status of the test
[ { "docid": "89e939aa28003ded1c33e124f2450248", "score": "0.6961458", "text": "def set_test_id(running)\n if !running && status == :completed\n @test_id = raw.data.id\n elsif raw.data\n @test_id = raw.data.testId\n else\n # When @test_id is nil, calling `get_status` wi...
[ { "docid": "f1ea7bb35f8dd7e3784c169b7dd764ef", "score": "0.62749785", "text": "def getTestId\n @test_id\n end", "title": "" }, { "docid": "c18698773a87bde649d8f005116a32b3", "score": "0.6207557", "text": "def test_id(test_key)\n request = ServiceHelper.new base_url: @jira_url,...
99a92c21f1053ce91a1af01cdb2e3490
Returns a keyvalue pair (hash) with the token values parsed. __NOTE__: multivalued claims (provided as comma separated values, like checkboxes on HTML forms) are returned like arrays.
[ { "docid": "75828b0d97be4093cb48c3066dde541d", "score": "0.6194618", "text": "def parse(token)\n raise InvalidToken unless valid?(token)\n token.split('&').map{|p| p.split('=') } \\\n .inject({}){|t, i| t.merge!(CGI.unescape(i[0]) => value_for(CGI.unescape(i[1])))}\n en...
[ { "docid": "84a88319d93c6f3a5cbb758df5917ac1", "score": "0.6479788", "text": "def parse_token\n binary_token = get_element('//t:RequestSecurityTokenResponse/t:RequestedSecurityToken/wsse:BinarySecurityToken')\n @validation_errors << \"No binary token exists.\" and return if binary_token.nil?\n...
f6d1c0a1abc9ce3f09499232ecb93ef8
searches for profile on the basis of filter
[ { "docid": "6d2b563d105ec76a56308643ad5feb9e", "score": "0.0", "text": "def search_result\n query = search_params.presence && search_params\n results = query.present? ? helpers.search_query(query) :helpers.create_query(current_user)\n render json: {:data => results, :total => results.results.tota...
[ { "docid": "ab427cb938b4885341b3f06862f726fa", "score": "0.75183964", "text": "def index\n @profile = Profile.exclude_blank_profiles.where.not(id: current_runner.profile.id)\n if params[:q].present?\n p params[:q][:username_eq]\n @profile = @profile.where(:pace => params[:q][:pace_eq]) i...
3870be7010c09d089c9f73d08304be5f
Inputs: An array, a minimum size, and a padding element Returns: An array which has been padded with the padding element if the array is smaller than the minimum size Prints: Nothing For example, pad_array([1,2,3], 5, "waffles") == [1,2,3,"waffles","waffles"] pad_array([1,2,3], 4, "waffles") == [1,2,3,"waffles"] pad_ar...
[ { "docid": "de9b68a105e1a157403b8ddfbeb54b50", "score": "0.8712737", "text": "def pad_array(array, min_size, pad_with)\n if min_size == 0 || array.length\n return array\n\n elsif min_size < array.length\n return array\n\n elsif min_size > array.length\n difference = min_size - array.length\n...
[ { "docid": "c0a02bb09da8efbc1001568868b377cf", "score": "0.89031047", "text": "def pad!(array, min_size, value = nil) #destructive\n if array.length >= min_size\n return array\n elsif array.length < min_size\n a = min_size - array.length #Used to find amount of padding needed\n array1 = Arr...
22b9fa7fb974affb2a4bfab53bdae39e
add a new key value pair
[ { "docid": "e92b4e047f3ad243e647da57b970f8f9", "score": "0.0", "text": "def add key, value = nil\n if key.class == Node\n new_node = key\n else\n check_key key\n new_node = Node.new key, value\n end\n\n if @root.nil?\n @root = new_node\n ...
[ { "docid": "6a51602772983023894ae46183895d00", "score": "0.86610305", "text": "def add(key, value); end", "title": "" }, { "docid": "6a51602772983023894ae46183895d00", "score": "0.86610305", "text": "def add(key, value); end", "title": "" }, { "docid": "84b4d27f4d17b0b6ab...
deb5af83ac149f7b16e1782a47c5812c
DELETE /studies/1 DELETE /studies/1.xml
[ { "docid": "71105369c5a72b86d7fdcd3ec9506d28", "score": "0.676374", "text": "def destroy\n @study = Study.find(params[:id])\n @study.remove_from_key_question_junction\n @study.destroy\n\n respond_to do |format|\n format.html { \n \t\tunless params[:from] == \"home\"\n\t \tredire...
[ { "docid": "c6a424d865ae5b87e6f373fe109ccaf8", "score": "0.7561501", "text": "def destroy\n \n @study.destroy\n\n respond_to do |format|\n format.html { redirect_to(studies_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "c7631623340acbd186f1b...