query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
c1832cc7cb583aba59a689898fd492ed | Returns the token initialized after the call to initial_token. If the encoded argument is true, it returns a base64 encoded token. | [
{
"docid": "a2eaaf44876f13c1cd6eb864a4c5787a",
"score": "0.0",
"text": "def type_1_message(encoded = false)\n if encoded\n Base64.encode64(@type_1_message).delete(\"\\n\")\n else\n @type_1_message\n end\n end",
"title": ""
}
] | [
{
"docid": "9da1f3abbcecf6868071e52746e38c1a",
"score": "0.68621296",
"text": "def token\n return @token_b64\n end",
"title": ""
},
{
"docid": "8618428d7418ee155e0b24ea6d1c00d5",
"score": "0.6654065",
"text": "def encoding_token\n self.class.encoding_token\n end",
... |
d4a1edaae4d92d004632cf64501ce2e7 | DELETE /users/1 DELETE /users/1.json | [
{
"docid": "15bbd6148634eeae1703a9d0983f5a27",
"score": "0.0",
"text": "def destroy\n @user.destroy\n respond_to do |format|\n format.html { redirect_to users_url, notice: 'User was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] | [
{
"docid": "be9d8ff5c0124f1d5efc98ec2baa3fc1",
"score": "0.7590582",
"text": "def test_delete_user\n delete '/users/2'\n data = JSON.parse last_response.body\n\n assert_equal 'Daniel', data['name'], 'Propiedad name incorrecta'\n assert_equal 'Arbelaez', data['last_name'], 'Propiedad last_nam... |
9b5c5f7c5a91367dd53b25a92ef23085 | is it unsafe to have role_ids here?? | [
{
"docid": "4c4dfbd9bf13ce8c8a71a439f8061959",
"score": "0.0",
"text": "def hasRole?(rolename)\n #self.roles.find_by_name(role).length\n self.roles.includes(:roles).where(roles: {name: rolename}).any?\n #puts 'yo2'\n end",
"title": ""
}
] | [
{
"docid": "57d579c67033f91a75e25a33abf16317",
"score": "0.73805124",
"text": "def role_list\n self.role_ids\n end",
"title": ""
},
{
"docid": "570748e93beaf8d1be872306a3e12068",
"score": "0.69111246",
"text": "def role_ids=(role_ids) \t \t\n permissions.each do |permission... |
682fab787166bbe4bbe4bbe3a61f2765 | Saves A, B and C, executes P, restores A, B and C. A B C [P] => A B C | [
{
"docid": "4834d4b1b2b45dab0cc1f13b146205b6",
"score": "0.0",
"text": "def threedip\n\t\t\tprogram = pop\n\t\t\traise ArgumentError, \"2DIP: first element is not an Array.\" unless program.is_a? Array\n\t\t\titems = []\n\t\t\t3.times { items << pop }\n\t\t\t~program\n\t\t\titems.reverse.each {|i| push ... | [
{
"docid": "4d8178836af57d73382054c1337f4de4",
"score": "0.61052704",
"text": "def op_savea\n push vm.save(pop)\n end",
"title": ""
},
{
"docid": "7ab9ffbd6366e3d40083b5c6b21f2c2b",
"score": "0.5351362",
"text": "def safe_save(dmp:)\n dmp.project = safe_save_proj... |
9298da8c1dd2b88e3b3a108d2ad3dee3 | Lists all KYC results for a business | [
{
"docid": "e97156c9addaee5b9166f4c125a3b48a",
"score": "0.0",
"text": "def get_kyc_business_businesstoken_with_http_info(business_token, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: KycApi.get_kyc_business_businesstoken ...'\n end\n ... | [
{
"docid": "f6b1a4c8146f81b849064ef874037291",
"score": "0.6739495",
"text": "def index\n @business_listings = BusinessListing.all\n end",
"title": ""
},
{
"docid": "2ec237caba2f3aadeb62dd03ed67c8ed",
"score": "0.6713057",
"text": "def index\n @businesses = Business.where(cust... |
fe85c9db806fbe45c57282631b1b0ee5 | Execute a command with a spinner animation until it completes. | [
{
"docid": "3f93fd595d662dabc6e2a74fc1ec8411",
"score": "0.6291866",
"text": "def spinner(*args)\n spinner = TTY::Spinner.new(*args)\n spinner_thread = Thread.new do\n loop do\n sleep 0.1\n spinner.spin\n end\n end\n\n yield\n ensure\n spinner_... | [
{
"docid": "c0a4b771041623ee5ba12a27d4103700",
"score": "0.71491057",
"text": "def spinner\n spinner = TTY::Spinner.new(\"[:spinner] Loading ...\", format: :pulse_2)\n spinner.auto_spin # Automatic animation with default interval\n sleep(2) # Perform task\n spinner.stop('Done!') # Stop anima... |
1ab5eb2bbb7d4ed200fe90a2c637533d | Returns whether the public key is DSA | [
{
"docid": "0b34233d712b637dd6f79e4767ce3589",
"score": "0.8585192",
"text": "def dsa?\n @spki.public_key.kind_of?(OpenSSL::PKey::DSA)\n end",
"title": ""
}
] | [
{
"docid": "6b287c53e03fda4c5b5110f7e7587c92",
"score": "0.8704484",
"text": "def dsa?\n @pub.is_a? OpenSSL::PKey::DSA\n end",
"title": ""
},
{
"docid": "9c54a6d10f099993070d4b75a40b2a56",
"score": "0.86297065",
"text": "def dsa?\n @cert.public_key.kind_of?(OpenSSL... |
dbb0b9a9915575b2959f02909d245710 | Essentialy FileUtils.ln_s under hood. But with some Grably flows kept in mind: products argument can be any expandable expression Needed directory structure will be created If base_dir provided it will be appended to resulting products dst This method returns list of all newly created products. | [
{
"docid": "392623201bed7cff9e921b989f8d9d3b",
"score": "0.64597815",
"text": "def ln_s(products, dir, base_dir: nil)\n targets = prelink(products, dir, base_dir)\n targets.each do |from, to|\n FileUtils.ln_s(File.expand_path(from.src), File.expand_path(to.src))\n end\n\n targets.map(&:... | [
{
"docid": "16f68d129c9247de90d89f0690b78478",
"score": "0.714062",
"text": "def prelink(products, dir, base_dir)\n products = Product.expand(products)\n dirs = products.map { |p| File.dirname(File.join(dir, p.dst)) }.uniq\n FileUtils.mkdir_p(dirs)\n\n products.map do |product|\n dst = ... |
29ac95aaa657454653451ca5fee63c7d | This method displays the 8Ball answers | [
{
"docid": "9b09fa4ffbf33b07c88cbd25c2bfc828",
"score": "0.5823955",
"text": "def tell_fortunte()\n\t\tprint \"The answer is \" + $prediction + \". \\n\\n: \"\n\tend",
"title": ""
}
] | [
{
"docid": "424bd06a6ea52711cb83dee12f2ed79c",
"score": "0.70927536",
"text": "def printAnswersOnScreen()\n $lblAnswerA['text'] = $arrAnswerA[$intQuestionOnScreen - 1]\n $lblAnswerB['text'] = $arrAnswerB[$intQuestionOnScreen - 1]\n $lblAnswerC['text'] = $arrAnswerC[$intQuestionOnScreen - 1]\n $lblAn... |
00ef2c028083bddf87f3b92a3cb84623 | Objective: To load the contents of 'Manage Roles' tab (5.5.3) Input: Output: Renders a partial with the contents of 'Manage Roles' tab | [
{
"docid": "b910692183fd6719d1bf302fd3971880",
"score": "0.74320835",
"text": "def manage_roles\n render :partial => \"manage_roles\", :locals => { :roles => Role.all, :permissions => Permission.all }\n return\n end",
"title": ""
}
] | [
{
"docid": "a2146945cc339f3a235106df9e47a8b3",
"score": "0.69335145",
"text": "def show_roles\n @id = params[:id]\n # Get the Identity and Contact Details\n @rightsholder = Rightsholder.new(@id)\n @party = Party.get_party(@id)\n @roles = @party.active_roles\n @delegators = @party.activ... |
5ca4fbde42ea9eb16373955059008a56 | definimos la funcion initialize para colocar los valores iniciales en numerador y denominador | [
{
"docid": "6979222d7754e3dade65cb51a136386f",
"score": "0.7460663",
"text": "def initialize(numerador,denominador)\n @numerador=numerador\n if(denominador==0)\t\t#si el denominador es 0 lo ponemos a 1\n @denominador=1\n else\n ... | [
{
"docid": "4feeee3f59b6fda13fbebab692d903e1",
"score": "0.7757702",
"text": "def initialize(num,denom)\n \n @num, @denom = num.to_i, denom.to_i\n \nend",
"title": ""
},
{
"docid": "f409e6c41478b257b2baedf29ecd16aa",
"score": "0.7721182",
"text": "def initialize(numerador, d... |
c4fc6c4df7ba35470429e1c3e34f101a | PATCH/PUT /product_verify_types/1 PATCH/PUT /product_verify_types/1.json | [
{
"docid": "6fd9273164b561e50e569826af54cb84",
"score": "0.5932641",
"text": "def update\n # respond_to do |format|\n @product_verify_type.modify_user_id = session[:user_id]\n if @product_verify_type.update(product_verify_type_params)\n flash[:notice] = '三證類型修改成功'\n redirect_to... | [
{
"docid": "aa42eed4bb894d0f5561983e40186cad",
"score": "0.66857076",
"text": "def update\n respond_to do |format|\n if @product_type.update_attributes(product_type_params)\n format.html { redirect_to action: :index, notice: 'Update Success.' }\n format.json { render action: :index... |
bd8fbadae77dbd039cd09d6f3dce33d3 | Accepts an invitation to a game. | [
{
"docid": "7e6be8f6a2a7687b87f9780a66e116b2",
"score": "0.7976462",
"text": "def accept_invitation(game_id)\n Utils.raw_send(self, \"<weewar game='#{game_id}'><acceptInvitation/></weewar>\")\n end",
"title": ""
}
] | [
{
"docid": "4e2e4cc6fcd6c1eede6757c56752aa8c",
"score": "0.7754988",
"text": "def accept_invitation( game_id )\n response = WeewarAI::API.accept_invitation( game_id )\n %r{<ok/>} === response\n end",
"title": ""
},
{
"docid": "dc378ed750b912474f7d86acfe18018c",
"score": "0.7... |
e00e3dcdafd3bdcf0e5b72a316fa769a | Restore any relevant files that were present when repo was in the middle of a cherrypick. | [
{
"docid": "5ea08400aa7f1e0e33d72c98bfdb43be",
"score": "0.7035182",
"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": "0026dd2a7202c6c59740433c7bce607e",
"score": "0.6852075",
"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\"... |
d1c1f46df134a50c43d043838f44e578 | GET /practice_types GET /practice_types.json | [
{
"docid": "4d1bd769d3828df1556e42512091e5ce",
"score": "0.7118012",
"text": "def index\n @practice_types = PracticeType.all\n end",
"title": ""
}
] | [
{
"docid": "341982657361bebf9d59165f89b68eb1",
"score": "0.70301235",
"text": "def getResourcesType\n type = [Announcement, Discussion, DiscussionSolution, Exam, ExamSolution, Homework, HomeworkSolution, LectureNotes, OnlineResource, Other]\n dic = {:type => type}\n respond_to do |format|\n ... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "de2f7f5b430a983139560d7dab1582a0",
"score": "0.0",
"text": "def set_goal_bunch\n @goal_bunch = GoalBunch.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... |
691edc4c49c081df3e2fc5d0a2ce0416 | Creates readers and writers that allow assignment to the attributes of the singleton of the declaring object that correspond to the specified +symbols+. | [
{
"docid": "390ac4ab9a691cf164a2d898a10831c9",
"score": "0.68989426",
"text": "def singleton_attr_accessor( *symbols )\n\t\t\tsymbols.each do |sym|\n\t\t\t\tsingleton_class.__send__( :attr_accessor, sym )\n\t\t\tend\n\t\tend",
"title": ""
}
] | [
{
"docid": "4dc3851b4a4f42b659a3a6411d55d98d",
"score": "0.7104821",
"text": "def singleton_attr_writer( *symbols )\n\t\t\tsymbols.each do |sym|\n\t\t\t\tsingleton_class.__send__( :attr_writer, sym )\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "4dc3851b4a4f42b659a3a6411d55d98d",
"sco... |
9f437b7c9db9f9bbd27d4a37ca83095c | Printable string for table row for a given number, number Params: +number+:: multiplication row for number | [
{
"docid": "1a191b942bb18d6b54e1742625d6bc80",
"score": "0.8275894",
"text": "def row(number = nil)\n row = \"#{number}\\t\"\n (1..@table_size).each do |index|\n row += \"#{index * (number || 1)}\\t\"\n end\n row\n end",
"title": ""
}
] | [
{
"docid": "a3b52aafee881adead3cc0f189456376",
"score": "0.7559275",
"text": "def multiTable(number)\n table = \"\"\n\n (1..10).each do |n|\n table << \"#{n} * #{number} = #{n * number}\\n\"\n end\n\n table[0..-2]\nend",
"title": ""
},
{
"docid": "9af6d268180234a010a8abf65dc762d0",
... |
b0b90c08cee68317559feef8b42f557f | Returns the value of attribute indentation. source://rubocop//lib/rubocop/cop/correctors/if_then_corrector.rb20 | [
{
"docid": "deaf937c473d357673708a04d53b251f",
"score": "0.62893397",
"text": "def indentation; end",
"title": ""
}
] | [
{
"docid": "bb4ddb129d04321f0613c8321a80f30f",
"score": "0.6835431",
"text": "def calculate_indent(line)\n # /^(\\s+)(.+)$/\n line =~ INDENTED_REGEX\n return $1\n end",
"title": ""
},
{
"docid": "d03a3619994183c7c2cb31495c7f940b",
"score": "0.6704419",
"text... |
5a34dcbcdf5ca07b36ac45f54bf9c609 | POST /admins POST /admins.json | [
{
"docid": "1b93b2198650b640e0dd1e637274e349",
"score": "0.6289789",
"text": "def create\n @admin = Admin.new(admin_params)\n\n respond_to do |format|\n if @admin.save\n admin_log_in @admin\n flash[:success] = \"Admin was successfully created !!!\"\n format.html { redirec... | [
{
"docid": "2b0313de1c268ac5c11228d7d2fda547",
"score": "0.6809298",
"text": "def create\n @admin = Admin.new(params[:admin])\n\n respond_to do |format|\n if @admin.save\n format.html { redirect_to admin_admins_url, notice: t('admins.flash.created') }\n format.json { render json... |
e513ce8b95550b2b316cbe0b812075d4 | Retreive older season categories and prepare them for the new season | [
{
"docid": "bfbdf4d10a2a89939bb88de489939f33",
"score": "0.5810062",
"text": "def renew_season!\n sql_diff_text_log << \"-- Season\\r\\n\"\n newer_season = Season.new(@older_season.attributes.reject { |e| %w[id lock_version created_at updated_at].include?(e) })\n newer_season.id = @new... | [
{
"docid": "0680dad49ed1cdbc38584306f9d4a29b",
"score": "0.70679134",
"text": "def renew_categories!\n newer_categories = []\n sql_diff_text_log << \"-- Categories\\r\\n\"\n @older_season.category_types.each do |category_type|\n newer_category = CategoryType.new(category_type.attributes.re... |
b5adea0d3ec6d1b819ffcabdd2aa6a28 | Build an instance of PlayerStreamerInstance | [
{
"docid": "263252da80ab04241372fc9e20c76f7b",
"score": "0.0",
"text": "def get_instance(payload); end",
"title": ""
}
] | [
{
"docid": "977392f5798a0cdb6d36b3c6f64c9cc7",
"score": "0.67122215",
"text": "def initialize(streamer)\n @streamer = streamer\n end",
"title": ""
},
{
"docid": "a30060ce5c3e8ceb4521861cb898e8a3",
"score": "0.59583914",
"text": "def new_streamer(access_token, access_secret)\n ... |
cbc93e813f7561f092fd27aa7bf62b7a | Return new entries from a stream using a consumer group, or access the history of the pending entries for a given consumer. Can block. For each stream mentioned: O(M) with M being the number of elements returned. If M is constant (e.g. always asking for the first 10 elements with COUNT), you can consider it O(1). On th... | [
{
"docid": "e0e646e1d73112624a51a3a6f9d8095a",
"score": "0.0",
"text": "def xreadgroup(*arguments)\n\t\t\t\t\tcall(\"XREADGROUP\", *arguments)\n\t\t\t\tend",
"title": ""
}
] | [
{
"docid": "a047049a73cc367221c2a39f9e34824c",
"score": "0.6323536",
"text": "def xreadgroup(group, consumer, keys, ids, count: T.unsafe(nil), block: T.unsafe(nil), noack: T.unsafe(nil)); end",
"title": ""
},
{
"docid": "05fe1e594349b48b48ce3dc4f43d9072",
"score": "0.6129843",
"text"... |
8aa559f0e2301a7070a29919641328e0 | return the current loggedin user | [
{
"docid": "c90c97a2db3521e86a65c3db7f11568d",
"score": "0.0",
"text": "def current_user\n User.find_by_id(session[:user_id]) if session[:user_id] \n end",
"title": ""
}
] | [
{
"docid": "0b53b78fde4cca9b9eb436a24bf4b07c",
"score": "0.8671718",
"text": "def current_user\n User.get_user(session[:user_id]) if session[:user_id]\n end",
"title": ""
},
{
"docid": "b908539d4607c39a3e73514ac7af843f",
"score": "0.86331135",
"text": "def current_user\n ... |
be34bd553ef0383db133413f7e244683 | Return a FOLIO authentication token for API calls either from the session if a token was prevoiusly created, or directly from FOLIO otherwise. | [
{
"docid": "b3d1bd00ddf63ced006a84c76f386f67",
"score": "0.7383648",
"text": "def folio_token\n if session[:folio_token].nil?\n url = ENV['OKAPI_URL']\n tenant = ENV['OKAPI_TENANT']\n response = CUL::FOLIO::Edge.authenticate(url, tenant, ENV['OKAPI_USER'], ENV['OKAPI_PW'])\n ... | [
{
"docid": "9fab0f6571b648ac42b349c313ed68eb",
"score": "0.75239104",
"text": "def authentication_token\n object.authentication_token if !current_user || object.id == current_user.id\n end",
"title": ""
},
{
"docid": "7fec6f3c49a6695ebb1b2783efd2320e",
"score": "0.75089365",
"tex... |
62c7e80cee0e18284644f0d3c0724917 | check and see if a user exists? | [
{
"docid": "8373cd0c11cd2e9a3cb4b6d0825bd530",
"score": "0.7696425",
"text": "def does_user_exist?(email)\n user = User.find_by(email: email)\n if user\n return true\n else\n return false\n end\nend",
"title": ""
}
] | [
{
"docid": "19e922c367b9083c7d9dfdb4acde5834",
"score": "0.8451846",
"text": "def user_exists?(username)\n Sys::Admin.get_user(username)\n true\n rescue\n false\n end",
"title": ""
},
{
"docid": "f2267ecd13deeec6fa62962be9ffa316",
"score": "0.8366389",
"text": "d... |
814a8c8c023a3173edfa6fe457c889bc | GET /lessons GET /lessons.json | [
{
"docid": "2031b8486316acd1f82f04d53a98be18",
"score": "0.0",
"text": "def index\n if teacher_signed_in? && request.original_url.include?(\"teacher\")\n @lessons = current_teacher.lessons\n else\n set_classes_timetable\n @lessons = @classes_timetable.lessons\n end\n end",
"... | [
{
"docid": "97f28a4a169a749373afdac6691b39a9",
"score": "0.7814525",
"text": "def index\n @lessons = Lesson.where(:user_id => current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @lessons }\n end\n end",
"title": ""
},
{
... |
39dbe1cc303175601f959a70cc9b7722 | Finds the maximum value of an attribute by converting it to an integer. Non numeric portions of values are ignored. source://sablon//lib/sablon/document_object_model/numbering.rb51 | [
{
"docid": "aa3ddf2b6c445a60f800bdc94445660b",
"score": "0.6050725",
"text": "def max_attribute_value(selector, attr_name); end",
"title": ""
}
] | [
{
"docid": "2b8a04f3c54f06ea7b595dabe0a27699",
"score": "0.7349912",
"text": "def maximum\n object.maximum.to_f\n end",
"title": ""
},
{
"docid": "d96f57575940854b858e12d8187ef467",
"score": "0.7287612",
"text": "def max\n return super if super.nil?\n (numeric_type == 'Inte... |
ac558c3eb022b3a59d139ef7bc52e886 | main loop which calls all other programs | [
{
"docid": "772722dad53df8e56bf45017f825c5ef",
"score": "0.0",
"text": "def run()\n ctr=0\n config_read\n $files = `zsh -c 'print -rl -- *(#{$hidden}M)'`.split(\"\\n\")\n fl=$files.size\n\n selectedix = nil\n $patt=\"\"\n $sta=0\n while true\n i = 0\n if $patt\n if $ignorecase\n ... | [
{
"docid": "59ac35ff1ac98658504629a26f9730dd",
"score": "0.75432444",
"text": "def run_main\n end",
"title": ""
},
{
"docid": "c167407934e47ce777a21aa594dbd541",
"score": "0.70726377",
"text": "def start_program\n load_questions\n say_hello\n program_loop\nend",
"titl... |
271aa03acc5a507e9d6af35fc2d53b1d | Returns the user corresponding to the remember token cookie. | [
{
"docid": "7d58cb966398006caea1471db8ef678a",
"score": "0.0",
"text": "def current_user\n if (user_id = session[:user_id])\n @current_user ||= User.find_by(id: user_id)\n elsif (user_id = cookies.signed[:user_id])\n user = User.find_by(id: user_id)\n if user && user.authenticated?(... | [
{
"docid": "b4b32646c00cf674c6f7ce4a2675a0e1",
"score": "0.83219117",
"text": "def user_from_remember_token\n User.authenticate_with_salt(*remember_token)\n end",
"title": ""
},
{
"docid": "b4b32646c00cf674c6f7ce4a2675a0e1",
"score": "0.83219117",
"text": "def user_from_remem... |
b0a7b0bbe183332762f82c8f30a084f0 | Part 2 Task For added security, yet another system policy has been put in place. Now, a valid passphrase must contain no two words that are anagrams of each other that is, a passphrase is invalid if any word's letters can be rearranged to form any other word in the passphrase. Example: abcde fghij is a valid passphrase... | [
{
"docid": "4fe9a35b71df2645e92e5ccb6a8d929b",
"score": "0.638823",
"text": "def count_valid_passwords(input)\n valid_count = 0\n\n File.readlines(input).each do |line|\n words = line.split(\" \")\n phrases = Hash.new { |h,k| h[k] = 0 }\n\n words.each do |word|\n sorted_word = word.split... | [
{
"docid": "fa433772252a91aeffff2cb85466232a",
"score": "0.69820225",
"text": "def pe59s4()\n\tct = File.open(\"cipher1.txt\").read.gsub(/\\n/,\"\").split(\",\").map {|x| x.to_i}\n\tpwLength = 3\n\tpw = ('a'..'z').to_a\n\tpw = pw.product(pw,pw).map {|x| x.join}\n\twl = {} # try to use hash for performan... |
0895222f582f1add56eb9e79ed03894b | GET /process_payrolls GET /process_payrolls.xml | [
{
"docid": "a0084fcb8c1696ee9aeb8e64dd246bbb",
"score": "0.6174148",
"text": "def index\n @menu = 'Process payroll'\n @page_name = 'Process payroll'\n @process_payrolls = ProcessPayroll.where(:company_id => @company.id, :month => params[:month].to_s)\n @users = @company.users\n\n\n respon... | [
{
"docid": "1b98f121bd5a8b3d6db28c5521153a76",
"score": "0.6434998",
"text": "def list\n\t@billpays = Billpay.paginate :page => params[:page], :per_page => 10\n\t\trespond_to do |format|\t\t\n\t\tformat.html \n\t\tformat.xml { render :xml => @billpays }\t\t#Render to XML File\n\t\tend\n\tend",
"tit... |
4f52569f1d76b77d4baaaf3e875f337e | Transform a copy of the given email +addr+ into an escaped version safer for posting publicly. | [
{
"docid": "a7c0f572a11af7dd6f4d38299fc9496c",
"score": "0.7303357",
"text": "def encode_email_address( addr )\r\n\r\n\t\trval = ''\r\n\t\t(\"mailto:\" + addr).each_byte {|b|\r\n\t\t\tcase b\r\n\t\t\twhen ?:\r\n\t\t\t\trval += \":\"\r\n\t\t\twhen ?@\r\n\t\t\t\trval += Encoders[ rand(2) ][ b ]\r\n\t\t\te... | [
{
"docid": "0f1c2a2ca6e82e16b91cab656858380c",
"score": "0.68588763",
"text": "def render_contact_email_address(address)\n mail_to address, sanitize(address).gsub(/([@.])/, '\\1<wbr />').html_safe\n end",
"title": ""
},
{
"docid": "9f6ffb77c5d2d07ea818de170f9957ef",
"score": "0.6... |
eb9a380498373452bd4f83a6c36fbc85 | Return the Roda class related to this request. | [
{
"docid": "d790014a9464cb1fddcedbdf3a61d652",
"score": "0.7280019",
"text": "def roda_class\n self.class.roda_class\n end",
"title": ""
}
] | [
{
"docid": "1903ccacca9d02e13cdf34dbe4a98175",
"score": "0.71678144",
"text": "def inspect\n \"#{roda_class.inspect}::RodaRequest\"\n end",
"title": ""
},
{
"docid": "1903ccacca9d02e13cdf34dbe4a98175",
"score": "0.71678144",
"text": "def inspect\n \"#{roda_cl... |
b17a3439e2578cb930f03e595b9c268a | GET /admin/user_reservations/:id(.:format) TODO: allow golf admin to view the admin, especially when it'd made by other members | [
{
"docid": "972aaf1a52a94bdfde5179f935328241",
"score": "0.0",
"text": "def show\n user_reservation = UserReservation.find(params[:id])\n contact = user_reservation.contact.nil? ? nil : (\n user_reservation.contact.attributes.merge({contact_type:user_reservation.contact_type})\n )\n\n i... | [
{
"docid": "0d4cdda1b436029b74b5df10eae46daf",
"score": "0.78458524",
"text": "def show_reservations\n user = User.find(current_user.id)\n @reservations = user.reservations\n end",
"title": ""
},
{
"docid": "721bd8ad74fbc66948518e34c044377f",
"score": "0.7473185",
"text": "def... |
bbd502dbb6ca7e85afb1fb6be39eee6e | Compute the sum of cubes for a given range a through b. NOTE: looks clunky, redo later in a more 'rubyesque' way | [
{
"docid": "8615240c6f5ab5e99c884dc94cf4da2e",
"score": "0.8855239",
"text": "def sum_of_cubes(a, b)\n range_a_b = (a..b).to_a\n cubes_a_b = range_a_b.map { |x| x**3 }\n return cubes_a_b.reduce(:+)\nend",
"title": ""
}
] | [
{
"docid": "0659b315278fe15b6e8479a4b23664d7",
"score": "0.87409985",
"text": "def sum_of_cubes(a, b)\n sum = 0\n (a..b).each do |i|\n sum += i**3\n end\n sum\n end",
"title": ""
},
{
"docid": "34f2f52d47a4765529dec9f92c020712",
"score": "0.84741676",
"text": "def s... |
9dcdf151e1eb06664709ce56ea456917 | Checks to see if a board's index is vacant or if it contains an "X" or an "O" If the position is free the method will return false. | [
{
"docid": "b54c482442195a4514d53413079f908c",
"score": "0.0",
"text": "def position_taken?(location)\n @board[location] != \" \" && @board[location] != \"\"\n end",
"title": ""
}
] | [
{
"docid": "8cec90bce248ae2297088646a563936d",
"score": "0.77908087",
"text": "def position_taken?(board, index)\n a = board[index]\n filled = a == \"X\" || a == \"O\"\n return filled\nend",
"title": ""
},
{
"docid": "899bcc9ad8b583b05a9990c4d10f238f",
"score": "0.7752519",
... |
93cc7c8545bdad6a9af377f4e35e835d | Provide access to the wrapped object | [
{
"docid": "e5e66c45bc182e7b497e69388a01d1fd",
"score": "0.8131749",
"text": "def _wrapped_object\n @wrapped_object\n end",
"title": ""
}
] | [
{
"docid": "cea2f3562cc3f5380093bb0e61cacf49",
"score": "0.7345805",
"text": "def delegate_object_reader_method; end",
"title": ""
},
{
"docid": "bf1ce9774737d15f7e2bf7a579dbeb28",
"score": "0.7336268",
"text": "def wrap(object); end",
"title": ""
},
{
"docid": "b6cdb6026... |
f8a2896db19be7b0f580102107dceba3 | PATCH/PUT /legs/1 PATCH/PUT /legs/1.json | [
{
"docid": "4d33fadac8faa61a4b160952d3ff1b41",
"score": "0.57457465",
"text": "def update\n respond_to do |format|\n if @leg.update(leg_params)\n format.html { redirect_to @leg, notice: 'Leg was successfully updated.' }\n format.json { render :show, status: :ok, location: @leg }\n ... | [
{
"docid": "82625c859fd9b71daa32e7b60461d30e",
"score": "0.64745754",
"text": "def update\n respond_to do |format|\n if @legs1.update(legs1_params)\n format.html { redirect_to \"/legs1s\"}\n format.json { render :show, status: :ok, location: @legs1 }\n else\n format.ht... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "3402e6c04cf8010455f181ffe4b67948",
"score": "0.0",
"text": "def update!(**args)\n @email = args[:email] if args.key?(:email)\n @kind = args[:kind] if args.key?(:kind)\n @mfa_info = args[:mfa_info] if args.key?(:mfa_info)\n @new_email = args[:new_email] if ... | [
{
"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... |
cae7fc9d75ae65844df84521b8aa85f3 | see last element in queue (which is in turn the first) | [
{
"docid": "79b3486e5c41570347a402ec52fdbe4b",
"score": "0.71010226",
"text": "def peek\n queue_array.first\n end",
"title": ""
}
] | [
{
"docid": "d136008bb34f237a7aa32373abf9a264",
"score": "0.8056531",
"text": "def next\n @queue.empty? ? nil : @queue[-1][0]\n end",
"title": ""
},
{
"docid": "49c02676280e35fd71e1e207ab8fd614",
"score": "0.78258765",
"text": "def dequeue\n # Return the value (first element) o... |
5c3be5e3ae3ae2d4db28c6886d890e10 | Generates the random browser identifier | [
{
"docid": "5190fd77fa6465e8e8c9f93e24d434cc",
"score": "0.0",
"text": "def user_agent(vendor: T.unsafe(nil)); end",
"title": ""
}
] | [
{
"docid": "26c783d33e9fb50e8d551e01d8a17e73",
"score": "0.7725192",
"text": "def identifier\n SecureRandom.hex(16)\n end",
"title": ""
},
{
"docid": "bdb94e4fdaa3e16ea5fe6f35df2bbaf0",
"score": "0.7562576",
"text": "def random_id\n \"#{('a'..'z').to_a.sample}-#{SecureRa... |
ac3c69e0a47322518c267240cd22fa7f | PUT /tstats/1 PUT /tstats/1.xml | [
{
"docid": "1778ccc894124d415dedc4547ac3c95d",
"score": "0.65962386",
"text": "def update\n @tstat = Tstat.find(params[:id])\n\n respond_to do |format|\n if @tstat.update_attributes(params[:tstat])\n flash[:notice] = 'Tstat was successfully updated.'\n format.html { redirect_to(... | [
{
"docid": "c2c0b673628fdc28b181d18c0afd2d5b",
"score": "0.62389714",
"text": "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end",
"title": ""
},
{
"docid": "b03268beb33528df6cca3bba6a115e59",
"score": "0.60... |
f8a1eedbb14464e177c0326e4da9f9b2 | PUT /undefind_fees/1 PUT /undefind_fees/1.xml | [
{
"docid": "67b228ff937e35bb872341a44d346114",
"score": "0.59731424",
"text": "def update\n @undefind_fee = UndefindFee.find(params[:id])\n\n respond_to do |format|\n if @undefind_fee.update_attributes(params[:undefind_fee])\n format.html { redirect_to(@undefind_fee) }\n format.... | [
{
"docid": "7ee4268d66832ecc70f04d1a688641a9",
"score": "0.5824775",
"text": "def destroy\n @undefind_fee = UndefindFee.find(params[:id])\n @undefind_fee.destroy\n\n respond_to do |format|\n format.html { redirect_to(undefind_fees_url) }\n format.xml { head :ok }\n format.json {... |
5cce908493f4014d7c8fb7bda0ca5a0e | POST /sucursals POST /sucursals.json | [
{
"docid": "2fcbd03d58f7d602619da8c76cf743c2",
"score": "0.6493243",
"text": "def create\r\n @sucursal = Sucursal.new(sucursal_params)\r\n\r\n respond_to do |format|\r\n if @sucursal.save\r\n format.html { redirect_to @sucursal, notice: 'Sucursal fue creado correctamente.' }\r\n ... | [
{
"docid": "f35af2219cfb34181036726e80fdda74",
"score": "0.6637048",
"text": "def create\n @empresa = Empresa.find(params[:empresa_id])\n @sucursal = Sucursal.new(params[:sucursal])\n @empresa.sucursals << @sucursal\n\n respond_to do |format|\n if @sucursal.save\n format.html { r... |
3849524ef8a4d8ecb8bc83e9e76dbfa9 | Detect if an email address is listed in a suppressions (do not contact) list | [
{
"docid": "2216c04f83bd2dc51b12cfc5d7cb6733",
"score": "0.7387024",
"text": "def detect_email_in_suppression_list(email)\n ret_msg = nil\n if !email.blank?\n suppression_emails = get_suppression_email_list(\"bounces\") + get_suppression_email_list(\"unsubscribes\") + get_suppression_em... | [
{
"docid": "355de438c3f305d05f2f4326347c9edf",
"score": "0.6256303",
"text": "def duplicateds_filter\n from_filter = from.split('@').last == ENV['HEALTH_IQ_DOMAIN']\n to_domains = Email.get_email_domains(to)\n to_filter = to_domains.include? ENV['HEALTH_IQ_DOMAIN']\n from_filter && to_filter... |
a7e958024a800269d38a12ba76a89570 | PUT /sheds/1 PUT /sheds/1.xml | [
{
"docid": "d5be6eec14f52e353fe8b60d39eed12c",
"score": "0.70720106",
"text": "def update\n @shed = Shed.find(params[:id])\n\n respond_to do |format|\n if @shed.update_attributes(params[:shed])\n format.html { redirect_to(@shed, :notice => 'Shed was successfully updated.') }\n f... | [
{
"docid": "daca17e272f58377696bc7026975b02d",
"score": "0.6785911",
"text": "def update\n @shed = Shed.find(params[:id])\n\n if @shed.update(shed_params)\n head :no_content\n else\n render json: @shed.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
... |
0865cd0199d0326dda8a4727f5b26b00 | Read data from a file using exclusive lock ==== Parameters cache_file:: the full path to the file ==== Returns data:: the data that has been read from the file | [
{
"docid": "a83b1bdd2954c2a165ba4c09996f0491",
"score": "0.8003363",
"text": "def cache_read_page(cache_file)\n _data = nil\n File.open(cache_file, \"r\") do |cache_data|\n cache_data.flock(File::LOCK_EX)\n _data = cache_data.read\n cache_data.flock(File::LOCK_UN)\n end\n _dat... | [
{
"docid": "20f9a97a7b887c67c093e14d742e68c9",
"score": "0.8042705",
"text": "def read_cache_file key\n f = File.open( cache_file(key), \"r\" )\n f.flock(File::LOCK_SH)\n out = f.read \n f.close\n return out\n end",
"title": ""
},
{
"docid": "f8164b939ddff5e214e28... |
f60d9cd8c1c7bf8a88b02ca24a5215bf | embedded: Is the Martile object being run inside another Martile object? | [
{
"docid": "fdda48ffd82f9acc2873f934b19f0650",
"score": "0.0",
"text": "def initialize(raw_s='', ignore_domainlabel: nil, toc: true,\n embedded: false, debug: false, log: nil, plugins: {})\n\n\n @debug = debug\n @data_source = {}\n \n @ignore_domainlabel, @log = ignore_domain... | [
{
"docid": "d1c6eb6dcdbc269c5100d2db43dd3226",
"score": "0.6578662",
"text": "def summoned_object?\r\r\n return true\r\r\n end",
"title": ""
},
{
"docid": "d9ebbbe5574bf0f7800a679ae22c382a",
"score": "0.61118",
"text": "def is_child()\n in_child\n end",
"title": ""
... |
81f7469603a15f8946c812fd516e8ab9 | Public: Checks if the repository is clean. Returns boolean answer to the question. | [
{
"docid": "36820410ab4570f47fe252d8c0ab6fea",
"score": "0.67611605",
"text": "def clean?\n # copy code from http://stackoverflow.com/a/3879077/16390\n git.update_index '-q', '--ignore-submodules', '--refresh'\n git.diff_files '--quiet', '--ignore-submodules', '--'\n git.diff_index '... | [
{
"docid": "85148837e8d0164e7dc35d834a507fbd",
"score": "0.7773121",
"text": "def clean?\n @repo.changes.each do |change|\n return false if change.path == path\n end\n true\n end",
"title": ""
},
{
"docid": "78429ac0bd3275b5d726ff0a5f08f23e",
"score": "0.764059",... |
09354e11205bbd9d60e2502827089467 | POST /songs POST /songs.json | [
{
"docid": "f02e663ec4203e3cb491ffb6289cd728",
"score": "0.65793824",
"text": "def create\n\n @song = Song.new(song_params.merge(album_id: params[:song][:album_id]))\n respond_to do |format|\n if @song.save\n format.html { redirect_to @song, notice: 'Master Jerry Says: Song was success... | [
{
"docid": "38ae9511711bed969523df89163db483",
"score": "0.7459006",
"text": "def create\n @song = Song.new(song_params)\n\n if @song.save\n render json: @song, status: :created, location: \"/api/v1/songs/\"+@song.id.to_s\n else\n render json: @song.errors, status:... |
27987cd54ca1b3c71f076202cf755adc | Benzophenone goaf inappertinent adonia leadenpated outhue Zooperal unpunishingly vulvar woodendite cristobalite webber Launcher negativeness italianity gonosome untriturated nanoid Impermeability apagogic avoidless ladin omentosplenopexy precompliant Permissioned prodeportation misdemeanant torrid bechirp varicellate | [
{
"docid": "734c96db01ee35f99db969a91c698598",
"score": "0.0",
"text": "def weathermaker_bear_intolerability(gemaric)\n unitism()\n end",
"title": ""
}
] | [
{
"docid": "6a4563bbf76de05c2239fb7a3114351f",
"score": "0.63193935",
"text": "def foresinger_leucism(chalybeous)\n end",
"title": ""
},
{
"docid": "80ea69445ecf6f3b8cacb7cafce1e270",
"score": "0.6145257",
"text": "def beethoven\n fetch('opera.german.by_ludwig_van_beethov... |
977f32799caeb16e8d5da5ba8eb4fa73 | GET /pubs/1 GET /pubs/1.json | [
{
"docid": "83fa7028839959f74e42ebc325c10c8a",
"score": "0.75104165",
"text": "def show\n @pub = Pub.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pub }\n end\n end",
"title": ""
}
] | [
{
"docid": "571628becc39a79f3532a22aaf9d05a2",
"score": "0.77478933",
"text": "def index\n @pubs = Pub.all\n\n render json: @pubs\n end",
"title": ""
},
{
"docid": "466a6c18e5c50d6301abdc815e4a8511",
"score": "0.7489766",
"text": "def show\n render json: @pub\n end",
"... |
e00179866b60aec3025f796c6e76ee26 | GET /admin/serial_code_batches/1 GET /admin/serial_code_batches/1.json | [
{
"docid": "db0f989db69393a77c035cf56a0ba731",
"score": "0.69816434",
"text": "def show\n @admin_serial_code_batch = Admin::SerialCodeBatch.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_serial_code_batch }\n end\n end",... | [
{
"docid": "00c0f24ba91ae9ef54c43a51c03fddfa",
"score": "0.69681495",
"text": "def index\n @admin_serial_code_batches = Admin::SerialCodeBatch.all\n @admin_review_activity = Admin::ReviewActivity.find params[:activity_id]\n respond_to do |format|\n format.html # index.html.erb\n forma... |
2c7743e90e5bae65ebb5aeb61593a254 | GET /game_types/new GET /game_types/new.json | [
{
"docid": "8b68e7fb44636caa3563e3e0136961d7",
"score": "0.80143493",
"text": "def new\n @game_type = GameType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @game_type }\n end\n end",
"title": ""
}
] | [
{
"docid": "2e12b5b5fe87b664f1b6e6244876a3b1",
"score": "0.7715529",
"text": "def new\n @type = Type.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @type }\n end\n end",
"title": ""
},
{
"docid": "2e12b5b5fe87b664f1b6e6244876a3b1",
... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "da04f8fab03f93d85afbe2c87335070f",
"score": "0.0",
"text": "def like_list_params\n params.require(:like_list).permit(:shout_id, :user_id)\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.6980629",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.67819995",
"text": "def strong_params\n params.requ... |
378798aeeb995b6cf02ce375e96fa0be | GET /supervisor/unit_statuses GET /supervisor/unit_statuses.json | [
{
"docid": "d35c708c15b788f36383a8b7ce83089c",
"score": "0.0",
"text": "def index\n end",
"title": ""
}
] | [
{
"docid": "2e7509da370b88f5d67d4654d155c65d",
"score": "0.7019329",
"text": "def set_supervisor_unit_statuses\n @period = Period.find(params[:id])\n end",
"title": ""
},
{
"docid": "a8d668a2310cfd6696901c858736f633",
"score": "0.6579406",
"text": "def statuses\n Statuses\... |
eda2388524a637ffb9a78d8692455697 | DELETE /groups/1 DELETE /groups/1.json | [
{
"docid": "04812d29ad797524363f9c4ded065f72",
"score": "0.7686834",
"text": "def destroy\n authorize! :admin, :site\n\n @group = Group.find(params[:id]) \n @group.destroy \n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :ok }\n end\n end"... | [
{
"docid": "fb8cdcffb9dec3ec8ff696f7195c58d5",
"score": "0.8048623",
"text": "def destroy #delete group\n @group = Group.find(params[:id])\n @group.destroy\n render json: {message:\"Group Deleted\"}\n end",
"title": ""
},
{
"docid": "6bcedfe965043af5e8a2fb7e281d0626",
"score": ... |
25dc0adeaae0b0ae1fe6dfc57eb8dbdb | GET /relations/1 GET /relations/1.xml | [
{
"docid": "073990aad7b78b5b3b03208d4d6a1472",
"score": "0.6777423",
"text": "def show\n\t\tshow_\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.xml { render :xml => @relation }\n\t\tend\n\tend",
"title": ""
}
] | [
{
"docid": "7c560e69c9e8f9db49cee8090b8a0909",
"score": "0.6912527",
"text": "def show\n\t\t@relation = Relation.find(params[:id])\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.xml { render :xml => @relation }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "0fe84... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "d886e69af0c2cb1f62b5b17de19b1a85",
"score": "0.0",
"text": "def update!(**args)\n @allow_missing = args[:allow_missing] if args.key?(:allow_missing)\n @inventory = args[:inventory] if args.key?(:inventory)\n @set_mask = args[:set_mask] if args.key?(:set_mask)\n ... | [
{
"docid": "184b1b1ed771473d3eb9f338c0734c38",
"score": "0.730762",
"text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end",
"title": ""
},
{
"docid": "5076c5a88404ae72986f958710f5687a",
"score": "0.7263234",
"text": "def update(pr... |
1e0e8a7474657649b08a96ba8815f0dc | DELETE /orders/1 DELETE /orders/1.json | [
{
"docid": "4704323a702a741576e89fecbe9c75df",
"score": "0.0",
"text": "def destroy\r\n @order = Order.find(params[:id])\r\n @order.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to orders_url }\r\n format.json { head :ok }\r\n end\r\n end",
"title": ""
}
... | [
{
"docid": "d95245ee8d8e63ffab2dfbac802158ee",
"score": "0.80884975",
"text": "def destroy\n delete(\"/orders/#{id}/delete\")\n end",
"title": ""
},
{
"docid": "8e531349d930fb6fede4efc401d68904",
"score": "0.76707834",
"text": "def destroy\n @order.destroy\n\n render js... |
57532c102d44a308313d606696a66185 | GET /projects/1 GET /projects/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "dc8505687156cb859adc07f1e0435407",
"score": "0.81873786",
"text": "def projects\n return get(\"/projects/list\")\n end",
"title": ""
},
{
"docid": "e5cff083faf736771900db26645e7ffe",
"score": "0.80175847",
"text": "def get_projects\n self.class.get(\"/projects.js... |
0954771c82bda5c1026ef9b89f7a8fb4 | Encrypts a file or directory. All data streams in a file are encrypted. All new files created in an encrypted directory are encrypted. The caller must have the FILE_READ_DATA, FILE_WRITE_DATA, FILE_READ_ATTRIBUTES, FILE_WRITE_ATTRIBUTES, and SYNCHRONIZE access rights. Requires exclusive access to the file being encrypt... | [
{
"docid": "243c762338ba335b0f52b9c1cbd8ca19",
"score": "0.6614143",
"text": "def encrypt(file)\n unless EncryptFileW(string_check(file).wincode)\n raise SystemCallError.new(\"EncryptFile\", FFI.errno)\n end\n self\n end",
"title": ""
}
] | [
{
"docid": "3a2599c8c65b7f32e03e796a25aa6bab",
"score": "0.6914163",
"text": "def encrypt_file(path, password = nil)\n salt = random_bytes(@salt_len)\n iv = random_bytes(@salt_len)\n aes_key, mac_key = keys(salt, password)\n\n cipher = cipher(aes_key, iv)\n hmac = OpenSSL::HMAC.new(mac_ke... |
d4a1edaae4d92d004632cf64501ce2e7 | DELETE /users/1 DELETE /users/1.json | [
{
"docid": "c82588c8b903f3cd5c7673c589556d47",
"score": "0.0",
"text": "def destroy\n message = Message.find(params[:id])\n #change value of 'is_deleted' to true so that it no longer displays\n message.is_deleted = true\n\n if message.save\n flash[:notice] = 'Message Deleted' \n r... | [
{
"docid": "be9d8ff5c0124f1d5efc98ec2baa3fc1",
"score": "0.7590564",
"text": "def test_delete_user\n delete '/users/2'\n data = JSON.parse last_response.body\n\n assert_equal 'Daniel', data['name'], 'Propiedad name incorrecta'\n assert_equal 'Arbelaez', data['last_name'], 'Propiedad last_nam... |
c63eee7b5585152dab0d38aeda8fd418 | Determine if the underlying Rack Environment includes a header of the given name. | [
{
"docid": "312b7f5be3919f9a190ed9ef71f05b1b",
"score": "0.8272673",
"text": "def include?(header_name)\n @env.include?(env_name(header_name))\n end",
"title": ""
}
] | [
{
"docid": "fae66b75569bbb86b74c35f50c838b88",
"score": "0.8382635",
"text": "def header?(name)\n headers.include? name\n end",
"title": ""
},
{
"docid": "e470b90aa3f8c36f55ad1488da7b0e5a",
"score": "0.81636834",
"text": "def has_header(name)\n return !@headers[name].n... |
cd6cd60c874237efbdd84bf76da49fdf | If true, the agent will start regardless of safety checks. | [
{
"docid": "bcb222baaa1014b975f9b548e0673332",
"score": "0.0",
"text": "def force?\n @options[:force]\n end",
"title": ""
}
] | [
{
"docid": "629059eade3bcfd6e0959f0b25036656",
"score": "0.74425554",
"text": "def agent_should_start?\n return false if already_started? || disabled?\n\n if defer_for_delayed_job?\n ::NewRelic::Agent.logger.debug \"Deferring startup for DelayedJob\"\n return fals... |
247e4378b23d06ac5f049bac0ce5e2d1 | pragma mark pragma mark FayeObjc delegate | [
{
"docid": "7c0b88e6a2ebafb15e7848f1ee2ba739",
"score": "0.0",
"text": "def fayeClientError(error)\n puts \"Faye Client Error: #{error}\"\n @overlay.postMessage \"Faye Client Error: #{error}\" if @overlay\n end",
"title": ""
}
] | [
{
"docid": "7ef2893382e279f8bf7f693f2eb79c7d",
"score": "0.6700087",
"text": "def delegate_object; end",
"title": ""
},
{
"docid": "fd40e880e72647ca6d2d1ab7f5505987",
"score": "0.65600765",
"text": "def delegate_method; end",
"title": ""
},
{
"docid": "11f830af7a28e3a91fc... |
cff89d40241cb8efb489c9c648056c41 | game_status checks if the game has been won, lost, or is still ongoing. if the game has been won, or lost, the game exits, otherwise it keeps going. | [
{
"docid": "96e1709d63dcf810545a526bbde57052",
"score": "0.6312143",
"text": "def game_status\n if gameboard_complete\n puts \"YOU WON!\".colorize(:white)\n exit\n elsif @guess_count >= 6\n new_image = Cactus.new\n puts new_image.show_ascii(6)\n puts \"You lost... the cor... | [
{
"docid": "08c82a5b8bfbcdeb01e1269b95de2452",
"score": "0.75779927",
"text": "def check_status\n\t\t#game status\n\t\t# \"Rejected\"\n\t\t# \"Not Started\"\n\t\t# \"Started\"\n\t\t# \"1-0\"\n\t\t# \"0-1\"\n\t\t# \"1/2-1/2\"\n\t\tif board.half_move_counter > 49 or board.past_states.count(board.fen_str) ... |
4b1df7662cb3d5fa89ece2798eaf67ca | Internal: Refreshes the manifest. | [
{
"docid": "e63f058340cfefea9bc8bded1cbd0cbd",
"score": "0.61694556",
"text": "def bootstrap\n instance.manifest.refresh\n end",
"title": ""
}
] | [
{
"docid": "a07e9bd1e5098c8315894f25728f3933",
"score": "0.77106833",
"text": "def refresh\n @manifest = load_manifest\n end",
"title": ""
},
{
"docid": "7d633bf27e0818b35a3d582b19ea4361",
"score": "0.6918281",
"text": "def rebuild_manifest\n @build_manifest = nil\n ... |
e64955dfc784edd2123af65b8e198b0f | basic_calc prints add, subtract, multiply... and gets input | [
{
"docid": "5fcc128fc10708e894103ee7c7e5802c",
"score": "0.7453583",
"text": "def basic_calc\n print \"(a)dd, (s)ubtract, (m)ultiply, (d)ivide: \"\n user_input = gets.chomp.downcase\n # \"return user_input\" is implied (Ruby methods ALWAYS returns the last expression)\nend",
"title": ""
}
] | [
{
"docid": "29208cfb981917736803692c3f4ceff2",
"score": "0.7968095",
"text": "def basic_calc\n\tprint \"(a)dd, (s)ubtract, (m)ultiply, (d)ivide:\" \n\tuser_input = gets.chomp\nif user_input == \"a\"\n\tadd\nelsif user_input == \"s\"\n\tsubtract\nelsif user_input == \"m\"\n\tmultiply\nelsif user_input ==... |
896a7ead1000d888b400753693bdf9a5 | Handle prerequisite libraries by adding them to the source path | [
{
"docid": "a2a17dcc7af9c50afad41d3c442ce40f",
"score": "0.0",
"text": "def resolve_library(library_task)\n #TODO: Add support for libraries that don't get\n # copied into the project\n path = library_task.project_path\n if(path.match(/.swc$/))\n raise MTASCError.new(\"MTASC d... | [
{
"docid": "9965ae0f1aedf4116d31600238801f20",
"score": "0.6798774",
"text": "def add_gem_paths; end",
"title": ""
},
{
"docid": "7fe9be3b4667af212d09d99ac82e82f3",
"score": "0.6674764",
"text": "def add_lib_folders(conf, *paths)\n paths.each do |path|\n conf.linker.library_p... |
8bd558a6ea4fad38e93e63dc638579c3 | Reports robot's current place and direction | [
{
"docid": "46f73020ceebe743ae73839ab39198c7",
"score": "0.5752107",
"text": "def report\n if @toy_place\n report_str = @toy_place[0].to_s + \",\"\n report_str += @toy_place[1].to_s + \",\"\n report_str += @toy_direction\n else\n report_str = \"Out of table top - \"\n repo... | [
{
"docid": "3398d788cd7823191f9010fe7c99640b",
"score": "0.78341514",
"text": "def report\n\t\tputs \"My current location is (#{@x}, #{@y}) facing #{@robot_direction}.\"\n\tend",
"title": ""
},
{
"docid": "87c890eb193322c9c3f89fbd17a3233a",
"score": "0.75750315",
"text": "def report_... |
c15aa8a4d4289b0f9fe035831390725d | Reloads the attributes of this object from the database. | [
{
"docid": "bd5dde1596e1a5c3800ceb145869ea32",
"score": "0.7389506",
"text": "def reload\n return false if !persisted?\n fresh_object = self.class.find(id)\n refresh_data fresh_object.instance_variable_get('@attributes')\n self\n end",
"title": ""
}
] | [
{
"docid": "7d18cf0dd35ea0dcadd95a2d88ab7a3e",
"score": "0.8022345",
"text": "def reload\n self.attributes = self.class.find(self.Id).attributes\n self\n end",
"title": ""
},
{
"docid": "e1203d8470fa44608e2ce7f0531a7498",
"score": "0.7681003",
"text": "def reload\n... |
e267d3127e99a0879714ae561a2bbb7a | clamp_value: test if some interpretation of the hand has a value that lies between min and max (inclusive). | [
{
"docid": "83c89d3e5c5290a9fa9292e819127c29",
"score": "0.7678173",
"text": "def clamp_value(min, max)\n\t\t\tvalue = @min_value\n\t\t\tn_aces = @n_aces\n\t\t\twhile n_aces >= 0\n\t\t\t\tif value >= min && value <= max\n\t\t\t\t\treturn value\n\t\t\t\tend\n\t\t\t\tvalue += 10\n\t\t\t\tn_aces -= 1\n\t\t... | [
{
"docid": "7a3f01d989f0720a2ab2139e6bab7794",
"score": "0.8347335",
"text": "def clamp(value, min, max)\n return min if value < min\n return max if value > max\n return value\n end",
"title": ""
},
{
"docid": "73f1a10549cf80c29c9600fa6ba7d2dc",
"score": "0.7899265",
"text"... |
5d602303d819f5b8dfde8649979e7b90 | DELETE /task1s/1 DELETE /task1s/1.json | [
{
"docid": "47f2ee8379bc71d8b44e565178765159",
"score": "0.7831285",
"text": "def destroy\n @task1 = Task1.find(params[:id])\n @task1.destroy\n\n respond_to do |format|\n format.html { redirect_to task1s_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] | [
{
"docid": "2148e2fd9383c12872890f51efee3615",
"score": "0.7543177",
"text": "def delete\n begin\n task_id = \"#{@file}\".gsub(/\\.\\/singularity\\//, \"\").gsub(/\\.json/, \"\")\n # delete the request\n RestClient.delete \"#{@uri}/api/requests/request/#{task_id}\"\n put... |
a7d8e9a08f4ac7765779feadb586c563 | It parses the request, creates a response object, and forwards the call to the next middleware. If the amf response is constructed, then it serializes the response and returns it as the response. | [
{
"docid": "768759fa94bf2d13753f6b34fc1490e9",
"score": "0.62568855",
"text": "def handle_amf env\n # Wrap request and response\n env['rack.input'].rewind\n begin\n env['rubyamf.request'] = RubyAMF::Envelope.new.populate_from_stream(env['rack.input'].read)\n rescue Exception =... | [
{
"docid": "d1a587f8940b803a0ec08884f3afb8d5",
"score": "0.6539154",
"text": "def call env\n return @app.call(env) unless should_handle?(env)\n\n # Wrap request and response\n env['rack.input'].rewind\n env['rails3amf.request'] = RocketAMF::Envelope.new.populate_from_stream(env['rack... |
d2f8a282d962e5eec1150f2f44b8d11a | Takes an existing ServiceTicket object (presumably pulled from the database) and sends a POST with logout information to the service that the ticket was generated for. This makes possible the "single signout" functionality added in CAS 3.1. See | [
{
"docid": "692e5d86b88476dd0ffbd2b2e37465fc",
"score": "0.7464233",
"text": "def send_logout_notification_for_service_ticket(st)\n uri = URI.parse(st.service)\n http = Net::HTTP.new(uri.host, uri.port)\n #http.use_ssl = true if uri.scheme = 'https'\n\n time = Time.now\n rand = CASServer:... | [
{
"docid": "da8ebaf8fb9e3144f6994acfcccd3a54",
"score": "0.6287423",
"text": "def issue_service_ticket\n if tgt = has_valid_tgt and has_service_info?\n st = ServiceTicket.create(\n :service => cookies[:service],\n :username => current_user.id,\n :granted_by_tgt_id => tgt.id\... |
655bd85f0ceb5dbc9832d4177186b03f | use mime magic to find mime type based on file content (magic numbers) | [
{
"docid": "921f0cdb4141da318fd2128885750a43",
"score": "0.7823706",
"text": "def mime_from_file(filepath)\n # moved here, as mimemagic can cause installation issues\n require 'mimemagic'\n require 'mimemagic/version'\n require 'mimemagic/overlay' if MimeMagic::VERSION.start_... | [
{
"docid": "983b211fdf1d0fc6e142fce01d971bcb",
"score": "0.8249959",
"text": "def get_mime_type file\n FileMagic.new(FileMagic::MAGIC_MIME).file(file).split(';').first\n end",
"title": ""
},
{
"docid": "dc8cd584c44ac87351b4e7b8e7635286",
"score": "0.8092426",
"text": "def _ex... |
98aae6793984b359ec281078428bba32 | Helper method to return the first known provider associated with the person | [
{
"docid": "b41dba4c1ef0e124cc3014f3e63b3ff5",
"score": "0.7778769",
"text": "def provider\n providers.first\n end",
"title": ""
}
] | [
{
"docid": "5714f47fa4a8d0566674e3582df10a32",
"score": "0.78957057",
"text": "def first_provider(provider)\n @first_provider ||= authentications.each { |a| return a if a.provider == provider }\n end",
"title": ""
},
{
"docid": "0df52c01295e55e24f956e5b9b54699b",
"score": "0.7157012"... |
89d9575288d92eb747841b2be131b047 | GET /generos/1 GET /generos/1.json | [
{
"docid": "746348db1293834e2b028482f7b257a7",
"score": "0.0",
"text": "def show\n @itens = @genero.itens.group(\"itens.id\").paginate(page: params[:page], :per_page => 30)\n end",
"title": ""
}
] | [
{
"docid": "df23fdfaf929b29ed2c3cb05f60e90a5",
"score": "0.66583735",
"text": "def index\n @generations = Generation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @generations }\n end\n end",
"title": ""
},
{
"docid": "aa86595e... |
49913015c4e2b823433c0d54148c4c1b | should function normally without extra data | [
{
"docid": "eab6e52a0decfff27c877361fddd6951",
"score": "0.0",
"text": "def simple\n url = 'https://activities.osu.edu/involvement/student_organizations/find_a_student_org?v=list&l=W&c=Columbus'\n orgs = []\n get_org_list url, orgs\n output_handler orgs, [], url\nend",
"title": ""
}
] | [
{
"docid": "b6b2bcc0062aeb115edab7b10cbe6930",
"score": "0.7039919",
"text": "def desired; end",
"title": ""
},
{
"docid": "5928f8efe9c6c2d408ea21a4cdce83ad",
"score": "0.6806129",
"text": "def preliminary?; end",
"title": ""
},
{
"docid": "a29c5ce532d6df480df4217790bc5fc... |
618c3741276722ce4d1866ff47ab7614 | Return the loading screen | [
{
"docid": "7cb24aa38a78a3caa08f89e041850a5e",
"score": "0.8095199",
"text": "def loading_screen\n @loading_screen\n end",
"title": ""
}
] | [
{
"docid": "a29e07913cd9ac62a61498d4c43f5334",
"score": "0.7612971",
"text": "def show_loader\n end",
"title": ""
},
{
"docid": "655e07f732619f3cea3ad1be43a8317c",
"score": "0.75568604",
"text": "def loading\n div(:id => 'hammer-loading') { text 'Loading ...' }\n end",
"... |
6678687336714cf388d5e1a930200698 | define the code to execute when the migration is rolled back "undo" | [
{
"docid": "979369178e5dd7e3bea5618665d92af0",
"score": "0.0",
"text": "def down\n\n end",
"title": ""
}
] | [
{
"docid": "b5a16ab1bcc1b60a3a82d68635f809de",
"score": "0.75213474",
"text": "def after_rollback(*args, &block); end",
"title": ""
},
{
"docid": "536b44657d0883fff5e7f69de4f49ee0",
"score": "0.73316133",
"text": "def rollback; end",
"title": ""
},
{
"docid": "536b44657d0... |
53bf81cf286cf9a88c0a84932b1dd96c | quick check to see if a single file is still in the study's bucket can use cached list of bucket files, or check bucket directly | [
{
"docid": "3b070d2db27c9d1d0a62b98ea4391d5b",
"score": "0.0",
"text": "def verify_remote_file(remotes:, file_location:)\n remotes.any? ? remotes.detect {|remote| remote.name == file_location} : Study.firecloud_client.execute_gcloud_method(:get_workspace_file, 0, self.bucket_id, file_location)\n end... | [
{
"docid": "6dc9530646d780c09e45662a4225a377",
"score": "0.70485914",
"text": "def exist?(bucket, key)\n File.exist?(cache_path(bucket, key))\n end",
"title": ""
},
{
"docid": "1cf01e1070d6550e4d712400ef7db1d3",
"score": "0.697675",
"text": "def check_blob_cache(key)\n @bl... |
b36482b32e3e35154650f57c5323c84f | the numbers in the array. the array will never be empty and the numbers will always be positive integers. E: puts average([1, 5, 87, 45, 8, 8]) == 25 puts average([9, 47, 23, 95, 16, 52]) == 40 D: use arrays A: get a count of elements in the array, sum the elements, divide by the result of the element count. | [
{
"docid": "a3331c930e119f4b25d6d710681a2fe6",
"score": "0.79268146",
"text": "def average(array)\n array.sum / array.count.to_f\nend",
"title": ""
}
] | [
{
"docid": "a24273cc2a6cc6aaae48bd0f8aa3d9d1",
"score": "0.826614",
"text": "def array_int_avg(array=nil)\n # If we didn't get an actual array, return 0\n return 0 if array.nil?\n # If the array has 0 elements in it, return 0\n return 0 if array.size < 1\n # Use some array inject magic to sum all e... |
f3ae2ffae2c9bba6b60a79bb5c216438 | Public: [Re]Load class instance variables from group attributes. Unknown (not installed) template will be nil. Returns nothing. | [
{
"docid": "afc908c03a75440180bbff263133f010",
"score": "0.5861911",
"text": "def load_attributes\n\n # Set instance variable for each attribute.\n load_attributes_to_hash.each_pair do |key, value|\n instance_variable_set(\"@\" + key.to_s, value)\n end\n\n nil\n\n end",
"title": ""... | [
{
"docid": "f2b24603fab8d2ed8c479f4b2c2c24ae",
"score": "0.5656967",
"text": "def copy_instance_variables\n template_scope.instance_variables.each do |var|\n val = template_scope.instance_variable_get(var)\n instance_variable_set(var, val)\n end\n end",
"title": ... |
6a70f7c3040d4863b78c181feb7ae54f | GET /batches GET /batches.json | [
{
"docid": "9cd7fb8a7453c7f45468c9df2028d9f1",
"score": "0.6813342",
"text": "def index\n # Получаем список всех загруженных файлов\n @batches = Batch.all\n end",
"title": ""
}
] | [
{
"docid": "2322b6670eefbfa8fed43a9a779dd898",
"score": "0.7686503",
"text": "def index\n @batches = Batch.all\n respond_to do |format|\n format.html {}\n format.json {\n\n data = Hash.new\n data[\"batches\"] = @batches\n return_success_response(data, \"Request Succe... |
9ce5dff8cc32fc2b7d286ef015100611 | GET /mformats/1 GET /mformats/1.json | [
{
"docid": "85f10949be976e6c92cf7a936122ab6b",
"score": "0.0",
"text": "def show\n\t\t@mformat = Mformat.find(params[:id])\n\t\t@movies= @mformat.movies.order('name asc')\n end",
"title": ""
}
] | [
{
"docid": "02d3b5f710e43e6a3ffa7782728acecc",
"score": "0.73493695",
"text": "def formats_list(page, per_page)\n path = sprintf(\"/api/v2/formats\")\n data_hash = {}\n post_body = nil\n \n reqHelper = PhraseApp::ParamsHelpers::BodyTypeHelper.new(data_hash, post_body)\n rc, err... |
4847d0baf2f57628ea3215585f150c72 | Consumes messages from Kafka one by one | [
{
"docid": "91cbfd07e2c223b938f17a5e7586cfd1",
"score": "0.77904594",
"text": "def consume_each_message\n kafka_consumer.each_message do |message|\n yield(message)\n end\n end",
"title": ""
}
] | [
{
"docid": "8ded79e74fb398e5be9742e6da3fc898",
"score": "0.77210003",
"text": "def consume_each_message\n kafka_consumer.each_message(\n ConfigAdapter.consuming(consumer_group)\n ) do |message|\n # always yield an array of messages, so we have consistent API (always a b... |
61708402742bc91d1c0cbf3fb23d3df0 | update activity, or render edit page with errors list | [
{
"docid": "1fb2cb075a928a54b20dfa40b22ce070",
"score": "0.7055161",
"text": "def update\n @activity = Activity.find(params[:id])\n if @activity.update(activity_params)\n redirect_to activities_url\n flash[:success] = \"Activty updated successfully!\"\n else\n render 'edit'\n ... | [
{
"docid": "b6e5a2884775b24cf501d22bfcdcfb38",
"score": "0.74387383",
"text": "def update\n respond_to do |format|\n if @activity.update(activity_params)\n format.html { redirect_to @activity, notice: I18n.t('crud.updated', model: Activity.model_name.human) }\n format.json { head :... |
649dd214333f033b516a2255f459985d | PATCH/PUT /products/1 PATCH/PUT /products/1.json | [
{
"docid": "6d39f9e1ac5881083b242eae75407a33",
"score": "0.64077",
"text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: \"Product was successfully updated.\" }\n format.json { render :show, status: :ok, loca... | [
{
"docid": "fa2eeaa45445dd76141374dc13ffab6d",
"score": "0.7269931",
"text": "def update\n begin\n @api_v1_product.update!(api_v1_product_params)\n head :no_content\n rescue => ex\n json_response({error: ex.message}, :unprocessable_entity)\n end\n end",
"title": ""
},
{
... |
90460cd69808b14ee58c35bfe0162d3e | Start the server. This method does not block since the server runs asynchronously from the current process. You may only call this method if the server is not already started. Otherwise, a ServerAlreadyStarted will be raised. Derived classes may raise additional exceptions. | [
{
"docid": "e5922b7dd5b5f9195aa2f54b126168d0",
"score": "0.66643935",
"text": "def start\n\t\tif started?\n\t\t\traise ServerAlreadyStarted, \"Server is already started\"\n\t\tend\n\t\t\n\t\ta, b = UNIXSocket.pair\n\t\tFile.unlink(@socket_filename) rescue nil\n\t\tserver_socket = UNIXServer.new(@socket_... | [
{
"docid": "2e41edea2cba99268a906f1fdc451c2f",
"score": "0.7688675",
"text": "def start!\n Thread.start { @server.start }\n end",
"title": ""
},
{
"docid": "ff77885a4ad950d41fa0813ab4c78429",
"score": "0.75308216",
"text": "def start_server\n command = execute_jar\n\n ... |
e98681ec93c9c68cc113d0b0774cec50 | RC: n = (n 1) + (n 2) BC: fib(1) = 1 BC: fib(2) = 1 | [
{
"docid": "65ef077b139c90a1e9d795bce858db52",
"score": "0.8187324",
"text": "def fib(n)\n if n == 1 || n == 2\n return 1\n end\n return fib(n - 1) + fib(n - 2)\nend",
"title": ""
}
] | [
{
"docid": "f110e16e95dd694a071afa32a59020c9",
"score": "0.84463125",
"text": "def fib(n) (n<=2) ? 1 : (fib(n-2)+fib(n-1)) end",
"title": ""
},
{
"docid": "100e71dc71377e8ad61a845fcb40207d",
"score": "0.8343818",
"text": "def fib2(n)\n a = 0\n b = 1\n\n while n > 1\n ... |
0bccdca6e74623660df42b1ee5164bd9 | use only in tests, prefer other methods such as `map`, `flat_map` or `get_or_else` | [
{
"docid": "a96b05f347ef3b6ddbf261899d7c0a4c",
"score": "0.0",
"text": "def get!\n throw NotImplementedError\n end",
"title": ""
}
] | [
{
"docid": "b1af7001cd3b028a2fbfdff271e14bd6",
"score": "0.6247153",
"text": "def test_0130_map\n @@log.debug \"test_0130_map starts\" if @@log.debug?\n assert_respond_to(@list, :map, \"test_0130_map_respond\")\n # And array of dummy objects is returned\n new_list = @list.map { \"dummy\" }\n... |
7367d82e012d3ceff0aeb12c9c420734 | don't allow a registrant to be changed from competitor to noncompetitor (or viseversa) | [
{
"docid": "d5af78c46c0479be0449447e005a9f87",
"score": "0.0",
"text": "def registrant_update_params\n attrs = attributes\n attrs.delete(:competitor)\n clear_events_data!(clear_artistic_data!(params.require(:registrant).permit(attrs)))\n end",
"title": ""
}
] | [
{
"docid": "1af93283998bc44a72ff117e9171dc27",
"score": "0.63293695",
"text": "def can_change_tom?\n self.active? or self.provisional?\n end",
"title": ""
},
{
"docid": "87de0261d6a19f790d2d09a0942d1aef",
"score": "0.60899067",
"text": "def deny\n self.granted = -1\n restau... |
bc8e05a58da788f348486f876edf905d | /h_sujet Retourne l'expectation au format humain | [
{
"docid": "78046a491caf41266dccd287af19f604",
"score": "0.68580735",
"text": "def h_expected\n @h_expected ||= membre_as_human(expected)\nend",
"title": ""
}
] | [
{
"docid": "4201c17de28a1e5a1f5164f71691ff17",
"score": "0.6550709",
"text": "def test_resta_densa_dispersa\n\t\tassert_equal(@h12.m, @h9-@h10, \"Resultado Incorrecto\" )\n\tend",
"title": ""
},
{
"docid": "e6c9b5f25b317636fe54a462566cf9d9",
"score": "0.64276904",
"text": "def test_m... |
9f4e111f2ecfb0e95e0241b9a4677b67 | List of current recurring campaigns | [
{
"docid": "7e5edd8ee79af02e6467b97fabeef2e6",
"score": "0.8053701",
"text": "def list(&block)\n call(method: :get, path: \"/campaigns/recurrings\", &block)\n end",
"title": ""
}
] | [
{
"docid": "c7e7850979f921c65242c3db3de78147",
"score": "0.71218926",
"text": "def campaigns\n @campaigns\n end",
"title": ""
},
{
"docid": "0eeb27eca5770a792f620000aed14459",
"score": "0.7120894",
"text": "def all\n get(\"#{domain}/campaigns\")\n end",
"title": "... |
866a99f41ef85a293e447ea84be55de2 | Optional: Add a decimal_to_binary method which converts a decimal number received as a parameter into an array of binary digits. Then write 3 tests for the method. | [
{
"docid": "83881ec22f0638259a4c4d233a03100e",
"score": "0.70187527",
"text": "def decimal_to_binary(decimal_num)\n binary_array = []\n until decimal_num == 0\n binary_array.push(decimal_num % 2)\n decimal_num = decimal_num / 2\n end\n return binary_array.reverse\nend",
"title": ""
}
] | [
{
"docid": "267265272d416eb75a3c1d2a9bb5c73b",
"score": "0.7448749",
"text": "def binary_conversion\r\n\tdecimal = read_integer('What is the Decimal value you would like to convert to Binary?')\r\n\t@final_result = Array.new()\r\n\twhile decimal > 0\r\n\t\titem = decimal % 2\r\n\t\tdecimal = decimal / 2... |
2cb63caf08306ed59fb5d4de79196c66 | funcion para obtener el estado de los sensores | [
{
"docid": "617360a434b30826a719e6edeb737ad7",
"score": "0.0",
"text": "def get_status\n @accessory = Accessory.find(params[:id])\n @ibox = Ibox.find(session[:ibox_id])\n res = iboxExecute(@ibox.ip, @ibox.port, '/cgi-bin/Status.cgi?ZID=' + @accessory.zid, @ibox.user, @ibox.password) \n stat... | [
{
"docid": "422d918b2c8aedd6578a0dc9d5650d9e",
"score": "0.5869223",
"text": "def estados\n\t\tdevuelto = Array.new\n\t\t@renglones_reporte.each do |renglon|\n\t\t\tdevuelto << renglon.estado\n\t\tend\n\t\tdevuelto\n\tend",
"title": ""
},
{
"docid": "ff54641b1b381941eae492c68db1d898",
"s... |
b0a8187e3dc346cc37b062369df19580 | This endpoint is deprecated. | [
{
"docid": "d8f0b05ade830efb94416008f8d839bf",
"score": "0.0",
"text": "def get_device_session_junit_using_get1_with_http_info(device_session_id, run_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AdminApi.get_device_session_junit_using_get1 ... | [
{
"docid": "77b0c109415e0f3e761fd3df7d4dff39",
"score": "0.7556771",
"text": "def deprecated; end",
"title": ""
},
{
"docid": "77b0c109415e0f3e761fd3df7d4dff39",
"score": "0.7556771",
"text": "def deprecated; end",
"title": ""
},
{
"docid": "77b0c109415e0f3e761fd3df7d4dff... |