query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
fc8b2031f4d0d5f1b74de1b342288641
Delete a trigger May fail if there are existing rules against it. Cannot delete core triggers. Permissions Needed: BRE_RULE_ENGINE_TRIGGERS_ADMIN
[ { "docid": "8eff0b5e6938c06df30c7bc0654e1a78", "score": "0.5696159", "text": "def delete_bre_trigger(event_name, opts = {})\n delete_bre_trigger_with_http_info(event_name, opts)\n return nil\n end", "title": "" } ]
[ { "docid": "d4476bab6361123c7514f755e7c894d3", "score": "0.70751697", "text": "def delete_trigger(trigger_id)\n http_delete \"/triggers/#{trigger_id}\"\n end", "title": "" }, { "docid": "03c2fae8b93c7b79e8f7ba558a400791", "score": "0.68201166", "text": "def drop_trigger(trigg...
daa70c6a684ad64b3d220d1ef4a7b38b
Returns a Nokogiri object
[ { "docid": "ed6eaff3e2b756bfbea96b7254abf785", "score": "0.5959296", "text": "def nokogiriDoc(file)\n doc = Nokogiri::XML(IO.read(\"#{file}\"))\n \n #Nokogiri won't parse out the information of an XML file that uses namespaces unless you add xmlns, and vice versa.\n @xmlns = \"xmlns:\" i...
[ { "docid": "b3de31975d812a0614d9b62ae8c41146", "score": "0.77985656", "text": "def init_nokogiri(url)\n page = Nokogiri::HTML(open(url))\n return page\nend", "title": "" }, { "docid": "bc9f28a4ba6eb8261c0a8b07de753bce", "score": "0.7549552", "text": "def nokogiri_document \n\t\...
18c311092a7e61545594675b55f3478e
O B J E C T M E T H O D S
[ { "docid": "f8ce541031a5cf669f88954203b40395", "score": "0.0", "text": "def test_show_calendar_description\n assert_equal \"Sal's\", items(:sals).calendar_description\n end", "title": "" } ]
[ { "docid": "d8216257f367748eea163fc1aa556306", "score": "0.5711417", "text": "def bs; end", "title": "" }, { "docid": "afbc4c54dabf4c09a70792d90ead3525", "score": "0.5704632", "text": "def sn\n end", "title": "" }, { "docid": "4a8a45e636a05760a8e8c55f7aa1c766", ...
bdaf2e914f8a6dba04665f91af5b1e0e
This is a callback
[ { "docid": "98cbb645a56d7a2cfcacd192872fdf40", "score": "0.0", "text": "def delete_dataset_in_github\n begin\n jekyll_service.delete_dataset_in_github\n rescue Octokit::NotFound\n Rails.logger.info \"Repository does not exist\"\n end\n end", "title": "" } ]
[ { "docid": "bce3e1d1089bf6d6722900bd3cac0f36", "score": "0.8884164", "text": "def callback\n end", "title": "" }, { "docid": "11f830af7a28e3a91fcf2311c1d4f679", "score": "0.87967414", "text": "def callback\n\n end", "title": "" }, { "docid": "a60ba27ead23e31d07276274c...
747f7e59491e0366541d0c41d3b6c901
sidekiq process to clone the git repository into the app
[ { "docid": "84305d9e6763b96aaa5b4eb3e0ebd380", "score": "0.67004883", "text": "def perform(project_id, default_branch=nil)\n project = Project.find(project_id)\n project.worker.destroy if project.worker\n project.create_worker(job_id: self.jid, class_name: self.class.name)\n project.worker.r...
[ { "docid": "47ff43ace9dc519a31a5ed31468a1391", "score": "0.72140443", "text": "def clone_repository\n `cd #{client.config.tmp_folder} && git clone #{client.config.repository_url}.git`\n `cd #{client.config.tmp_folder}/#{client.config.repository_name} && git fetch origin #{client.config.ref_tree} &...
db4855efb94661b7db4f0a41d8b19bdf
GET Displays a receipt.
[ { "docid": "cca3dab4cd64277ec2f46b9a5720f648", "score": "0.0", "text": "def receipt\n @auth_code = params[:x_auth_code]\n end", "title": "" } ]
[ { "docid": "a29674d0ce2974dd2c75cc2e18fc1fcd", "score": "0.7481892", "text": "def show\n @receipt = Receipt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @receipt }\n end\n end", "title": "" }, { "docid": "5dbd91e1...
c99da31218080545e6b8aa3e681b3e96
PATCH/PUT /customer_view_controls/1 PATCH/PUT /customer_view_controls/1.json
[ { "docid": "fca7fb17c1b92d848336327acdc683c5", "score": "0.67073125", "text": "def update\n respond_to do |format|\n if @customer_view_control.update(customer_view_control_params)\n @customer_view_control.update(:updated_by=>session[:kitchen_user_id])\n format.html { redirect_to ac...
[ { "docid": "6f5d270ae1b02f509a594382bf64c715", "score": "0.6088919", "text": "def edit_customer(params: {})\n path = '/api/customer/edit'\n\n private_post(path, params)\n end", "title": "" }, { "docid": "af66746a0a4cb5b9f0888db9dd8f1712", "score": "0.5920712", "text": "d...
e3bd810207d42cfc143796c2a9beedc1
generate request and send ceate user post
[ { "docid": "2b3b78a63775783496a9770b2e96dfa0", "score": "0.0", "text": "def generate_builder\n\t\t@email = params[:vitalsource][:email]\n\t\t@first_name = params[:vitalsource][:first_name]\n\t\t@last_name = params[:vitalsource][:last_name]\n\t\t@affiliate = params[:vitalsource][:affiliate]\n\t\t@passwor...
[ { "docid": "d98bb4ed5f545d26c4f359441374028b", "score": "0.71522546", "text": "def generate_request\r\n end", "title": "" }, { "docid": "c2c6d2f572b3f112dc8d5daacbdeb33c", "score": "0.6600213", "text": "def post; end", "title": "" }, { "docid": "5c89e8017bfcff526a305cc98...
da106bb9dc4723bf5f38869670c1db37
function to create a new user.
[ { "docid": "c31a6626fb5def4ffa523b1d6c4e2ce1", "score": "0.0", "text": "def createUser\n @user = User.new()\n @user.team = params[:user][:team]\n @user.username = params[:user][:username]\n @user.password = params[:user][:password]\n if @user.save\n puts('Account created!')\n end\...
[ { "docid": "ec9c812c1e03febd0d6c5617e738c688", "score": "0.8401284", "text": "def create_new_user \n User.create(sign_up_prompt)\n end", "title": "" }, { "docid": "62358ea1e489ff762a6c4e04cf5b8f63", "score": "0.8315144", "text": "def create_user(params)\n user = new_use...
3db4eed4ab80702a3597cad1959be219
Create Rake tasks for archival
[ { "docid": "9d7e480f89bf859d51c3118580c6fee8", "score": "0.5912823", "text": "def create_static_library_tasks(objects, library_name)\n library_file = File.join(@output_folder, \"lib#{library_name}#{@output_decorator}.a\")\n library_folder = @output_folder\n\n unless @tracked_folders.inclu...
[ { "docid": "0b1ee40af04cd604877e09092ef8847c", "score": "0.7292981", "text": "def define\n build_task :tar, 'tar.gz'\n end", "title": "" }, { "docid": "4d7c831412bc6343d9fe43fa083ef0e9", "score": "0.7210891", "text": "def define\n desc \"Download source archive for...
97afa1683063e823b67b9e7f8c1c2953
Given a transform spec YAML file, instantiate the transform objects. The result of this can be piped using TransformingEnumeratorpipe.
[ { "docid": "43ec45d4d4094d9e56bfff069808c38c", "score": "0.48882487", "text": "def load_file(filename,\n container:,\n transforms_by_id: {},\n allow_unsafe: false,\n unsafe_error: nil)\n transform_doc = parse(filename, allow_unsafe...
[ { "docid": "831bba093b913df339927e706f48a71d", "score": "0.58179235", "text": "def from_yaml(filename); end", "title": "" }, { "docid": "eb8fc5d2f4e693125984999c3b786c9a", "score": "0.5625795", "text": "def load_transform(content)\n # Parse the transform file.\n transfo...
3beae98c55df9ef0a819824cbbd92382
GET /shifts/1 GET /shifts/1.json
[ { "docid": "0db63a467cf307a3157f73f405272810", "score": "0.0", "text": "def show\n @assignment = Assignment.find(params[:assignment_id])\n @employee = @assignment.employee_profile\n end", "title": "" } ]
[ { "docid": "3026a08963a0631ff5dcfdcdb928e705", "score": "0.7529043", "text": "def index\n @shifts = Shift.all\n @serializedShifts = json_shifts(@shifts)\n end", "title": "" }, { "docid": "cf0a96ec0ef092449b60c1d06689d9df", "score": "0.74031246", "text": "def index\n if curr...
d13be62583af62dfee802bfdd0bf48d4
loop for wait() times: the number of wait calls to make
[ { "docid": "60865b5ea667c82ab903bae84a6abef3", "score": "0.69487244", "text": "def loop(times=nil)\n if times.kind_of? Numeric\n times.times do\n self.wait\n end\n elsif times.nil?\n self.wait while not @exited\n end\n end", "title": "" } ]
[ { "docid": "6c1f7d8b8d65cdd32962161deaa9f69f", "score": "0.7422477", "text": "def wait\n while (@running_count != 0) do\n sleep(0.5)\n end\n end", "title": "" }, { "docid": "dcde825038cc1ecdc48baf4afcc5b273", "score": "0.73123133", "text": "def wait(count = nil)\n\t\t\tif...
a229800f4805ce08a344a944ea0641ad
Get the Terminal instance of the application. Returns the Terminal instance.
[ { "docid": "ebe01ffaafa167ab13f8a258ed94843e", "score": "0.5269946", "text": "def term\n @app.term\n end", "title": "" } ]
[ { "docid": "de973201b6761a3718e0f4caa295921f", "score": "0.7339607", "text": "def terminal\n @terminal ||= TerminalApi.new @global_configuration\n end", "title": "" }, { "docid": "3263afa97c5a637d2727bbeb0b219ed4", "score": "0.7318788", "text": "def terminal\n @terminal ...
d5882935ad04319f2c819e0e78ed446c
Public: Determines if Repo is inactive. Examples repo.inactive? => false Returns: true if the Repo is inactive, false if it's active.
[ { "docid": "1dbbce65b8113dbcc2a550193c64e7f0", "score": "0.7148207", "text": "def inactive?\n !self.active?\n end", "title": "" } ]
[ { "docid": "112752deea71b0629d337a11e49bbd10", "score": "0.77520466", "text": "def inactive?\n (status == INACTIVE)\n end", "title": "" }, { "docid": "44865e9de970a0b60876c8864addfca8", "score": "0.77515435", "text": "def inactive?\n\t\t\treturn account_life_cycle_status == INACT...
c2ea749ce4813843ac7cad8ac594a4aa
make sure our coordinates are always valid. lets ensure this in the monome class, as this is the interface used by the applications.
[ { "docid": "51f044ec6261b54cce763eb7685bb695", "score": "0.0", "text": "def normalize(x,y)\n x = x % (max_x + 1)\n y = y % (max_y + 1)\n return x,y\n end", "title": "" } ]
[ { "docid": "bb3d8dd706e5902e8534a1e8195149e3", "score": "0.77613455", "text": "def validate_coordinates\n return if coordinates.present?\n\n errors.add(:coordinates, :bad_format)\n end", "title": "" }, { "docid": "63be436f29fa19ee8591afbf61d703ce", "score": "0.7541838", "text"...
5e3131acced3ca3f7d284270dae32212
Reads a string to populate the object. Note that this appends new packets to any existing packets in the PcapFile.
[ { "docid": "4bd176d9b1f37f0aedab9a3af6c26121", "score": "0.5709429", "text": "def read(str)\n force_binary(str)\n self[:head].read str[0,24]\n self[:body].read str\n self\n end", "title": "" } ]
[ { "docid": "0f76c486d9475283104d8036b28a3798", "score": "0.6773931", "text": "def read(str)\n PacketFu.force_binary(str)\n\n return self if (!str.respond_to? :to_s || str.nil?)\n self[:source_ip].read(str[0, 4])\n self[:destination_ip].read(str[4, 4])\n self[:nexthop].read(str[8...
d6ca27c0b9d0f865be23558e4d8bcffd
GET /dspace_items/1 GET /dspace_items/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "41699dd17c12d7e8d1afd1406f087302", "score": "0.67776763", "text": "def item(id)\n get(\"/item/#{id}.json\")\n end", "title": "" }, { "docid": "f1082b9d415682dd50c0a3cf4f8b12f4", "score": "0.6432333", "text": "def item(id)\r\n get(\"item/#{id}\")\r\n end", ...
05b9b818308036c61195f0e025dfb29e
SQL fragment for AliasedExpression
[ { "docid": "a0e8f663e2162e8b6fa1406013f1f6f9", "score": "0.82626474", "text": "def aliased_expression_sql(ae)\n as_sql(literal(ae.expression), ae.aliaz)\n end", "title": "" } ]
[ { "docid": "069c91aa6e8c55da9c67d247a71c2954", "score": "0.7524716", "text": "def aliased_expression_sql_append(sql, ae)\n literal_append(sql, ae.expression)\n as_sql_append(sql, ae.alias, ae.columns)\n end", "title": "" }, { "docid": "7b028fddd2fdd47b198f5675f2f35636", "sco...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "74ac5123497b2609a6e0a79cf205e647", "score": "0.0", "text": "def set_engagement\n @engagement = Engagement.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60326946", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6015941", "text": "de...
76b6ec9613f3316db8a5251b73bbdb2b
places key, iv, and encrypted strings into c++ files
[ { "docid": "120f66dca1021b39acc42ce26e0fbe17", "score": "0.0", "text": "def erb(file_name, template_name)\n template = ERB.new(File.open(template_name, \"r:UTF-8\", &:read), nil, \"-\")\n File.open(file_name, \"w:UTF-8\") { |file| file.write(template.result(binding)) }\nend", "title": "" } ]
[ { "docid": "c7c3ed73055a1a871c4895f476c1057d", "score": "0.6736284", "text": "def encryptFile(fileIn,conf)\n\nsalt_len = 8\nbuf=''\npassword = conf[:passphrase]\ncipher = 'aes-128-cbc'\nputs aktTime()+' encrypting archive...'\nSTDOUT.flush #write out immediately\nsalt= OpenSSL::Random::pseudo_bytes(sal...
3b9ef5901e9e55c22ee246c2d2b64ac9
refactors: is a callback needed/possible for relationship params?
[ { "docid": "04c1ed20fc66c8ad385ced722f2ecbc1", "score": "0.0", "text": "def create\n if current_student.has_already_requested(@teacher)\n redirect_to '/teacher_profiles', notice: 'You have already requested this teacher'\n else\n @relationship = Relationship.create(teacher_id: @teacher.i...
[ { "docid": "2324e7936ad2950431743b09fe5ac4fd", "score": "0.66278577", "text": "def relationship; end", "title": "" }, { "docid": "2324e7936ad2950431743b09fe5ac4fd", "score": "0.66278577", "text": "def relationship; end", "title": "" }, { "docid": "2324e7936ad2950431743b09...
639fc88ecd9123b7682d598d317b6157
instance methods returns a 8digit customer number, e.g. "0000012"
[ { "docid": "514242831c51a8b56fc72ba89a94a97d", "score": "0.66196907", "text": "def number\n \"#{self.id}\".rjust(8, \"0\")\n end", "title": "" } ]
[ { "docid": "b0e001f4b50c1c3006855afc9ed8b90a", "score": "0.76719403", "text": "def clearinghouse_customer_number(return_integer = false)\n raw = read_attribute(:clearinghouse_customer_number)\n return nil if raw.nil?\n return_integer ? raw : raw.to_s.rjust(6, \"0\")\n end", "title": "" }...
54c896cb786ae456f2140e3e1d973b9a
get a list of column names for a given class
[ { "docid": "2bad567664c5f0f8d8f00678e8f92f3a", "score": "0.8004628", "text": "def column_names\n klass.properties\n end", "title": "" } ]
[ { "docid": "99a252551225b3084905af742dee62e2", "score": "0.8186296", "text": "def column_names\n klass.properties.map(&:name)\n end", "title": "" }, { "docid": "99a252551225b3084905af742dee62e2", "score": "0.8186296", "text": "def column_names\n klass.properties.ma...
9b0e86ac62f0a775563047aa0a8e4204
Devuelve la lista de alimentos de cada plato
[ { "docid": "fcdc19fb6f31788f32bc86f0147f4724", "score": "0.56230116", "text": "def to_s\n\t\talimentos = \"El plato contiene : \"\n\t\t@listaAl.each do |element|\n\t\t\talimentos = alimentos + element.alimento\n\t\t\talimentos = alimentos + \" \"\n\t\tend\n\t\treturn alimentos\n\tend", "title": "" ...
[ { "docid": "b559ffc46b0e077e56aa20206d51a470", "score": "0.63548046", "text": "def aliens\n # Add code here\n # this should return an Array of Planet Objects that this alien has colonies on\n self.colonies.map do |name|\n # colony.alien\n end\n end", "title": "" }, { "docid...
4f6d1566066391607498ffa6b2f97937
Helper module to house functions needed during the build. Execute a command using rake 'sh'
[ { "docid": "3ab9cf260e42303fcc3e40cbe8e37cda", "score": "0.0", "text": "def execute!(cmd, sudo = true, verbose = true)\n cmd = sudo ? \"sudo #{cmd}\" : cmd\n # `echo '#{cmd}' >> ./cmds.txt` if sudo\n # puts(cmd) if verbose\n # `#{cmd}`\n sh cmd, verbose: verbose do |ok, res|\n if !ok...
[ { "docid": "aedd61ff6c1cd499782c06bbf9349873", "score": "0.6672896", "text": "def build(filetask, system_config, platform)\n cmd_file = command_file(filetask.name, system_config, platform)\n if File.exist?(cmd_file)\n config = system_config.platform_config(platform)\n if ...
ba02e57f965e37c9b6d57a80a65c4fc3
Does implement the methods seek and length= ? FileTransfer will only then offer a ranged transfer. result:: [false] or [true]
[ { "docid": "7b9b921b482b9f1c0ea6a0a428744b4a", "score": "0.0", "text": "def can_range?\n false\n end", "title": "" } ]
[ { "docid": "0020faf86094536dbfdde968336db516", "score": "0.6920882", "text": "def seekable?\n @seekable\n end", "title": "" }, { "docid": "55a278a914c540a8d10c3e148c95da92", "score": "0.68033004", "text": "def seekable?\n ! duplexed? && respond_to?(:unbuffered_seek, true...
f10e938033ac3ebe31e1c2d3909e10cd
DELETE /admissive_volumes/1 DELETE /admissive_volumes/1.json
[ { "docid": "8b044abe1371deef9aab0acc9cf502c0", "score": "0.7672268", "text": "def destroy\n @admissive_volume = AdmissiveVolume.find(params[:id])\n @admissive_volume.destroy\n\n respond_to do |format|\n format.html { redirect_to admissive_volumes_url }\n format.json { head :no_content...
[ { "docid": "17cf09b1327df57555bc580fd73260f9", "score": "0.7382248", "text": "def destroy\n @volume.destroy\n respond_to do |format|\n format.html { redirect_to volumes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "179ff0053e8f4f967cb3d...
3eb7bde99e7f75967fab3164bf0871a9
If the without_newline flag is turned on, return the result without a newline using `print` instead of `puts`.
[ { "docid": "fbd09872ac174d919c9339a4de44dbd0", "score": "0.74662304", "text": "def print_with_or_without_newline(data)\n if $options[:without_newline]\n print data\n else\n puts data\n end\nend", "title": "" } ]
[ { "docid": "174ab1faffd0ca31997b6a55b4117f73", "score": "0.67018664", "text": "def newline\n print('')\n end", "title": "" }, { "docid": "a8fb2424b52351bc511937377e2685df", "score": "0.6694871", "text": "def newline\n puts\n end", "title": "" }, { "docid":...
e6dd303e63d6272f872244d98cd2e9bc
Form to validate token sended via EMail
[ { "docid": "caa275a93dd9c4c53f7469044d5caa47", "score": "0.5839997", "text": "def validate_token\n @user=User.find(params[:id])\n if @user.confirmed?\n if @user.data_complete?\n redirect_to root_path\n else\n redirect_to edit_user_user_details_path(@user)\n end\n en...
[ { "docid": "ddf5584072106de88850a6ff4ac6b011", "score": "0.6919122", "text": "def validate\n\n r = super\n return r unless r.success?\n\n decryptor_obj = LocalCipher.new(GlobalConstant::SecretEncryptor.email_tokens_key)\n r = decryptor_obj.decrypt(@t)\n return r unless r.success...
fd841665360dbd6863c76f9aaa77b0ef
this function check whether an integer is even
[ { "docid": "28defbcc52d2617ccbec11ee10b51546", "score": "0.80514497", "text": "def isEven(i)\n\t(i & 1) == 0\nend", "title": "" } ]
[ { "docid": "781657eaa9cea2b65b61628bbfec7b8c", "score": "0.8657751", "text": "def even? num\n num.to_i % 2 == 0\n end", "title": "" }, { "docid": "044cdc24cb30c71e1ac1ddd8a613dcc8", "score": "0.8520074", "text": "def is_even(number)\n number.to_i\n if number%2 == 1\n ...
ef1c65cada36499ff3f6c7ace2467c7d
Override to_json and to_xml to protect hashed passwords Exclude password info from xml output.
[ { "docid": "e40436c504f108cfc03ba5049b2d1b8a", "score": "0.7576041", "text": "def to_xml(options={})\n options[:except] ||= [:password_digest]\n super(options)\n end", "title": "" } ]
[ { "docid": "cbd67a1e6f7590b641f7110db0afcd1d", "score": "0.76575625", "text": "def to_json\n\t\tsuper(:except => :password)\n\tend", "title": "" }, { "docid": "c594e3f0010ad8eb068701ef8353318c", "score": "0.764478", "text": "def to_xml(options={})\n options[:except] ||= :password_...
33258a45b2012c9ccd01fbca3776672c
zone managed by a server
[ { "docid": "1e7f3736324724a2372ebdeef7629246", "score": "0.0", "text": "def list_zone(server_id, zone_id, opts = {})\n data, _status_code, _headers = list_zone_with_http_info(server_id, zone_id, opts)\n data\n end", "title": "" } ]
[ { "docid": "2b9ed89fbbc16aa2c791d13e471c003b", "score": "0.7497363", "text": "def zone() end", "title": "" }, { "docid": "226cdd0268748ed99942d6487b89cf6e", "score": "0.73772615", "text": "def zone; end", "title": "" }, { "docid": "16e21523e7e96c032f900ea0ba437ef0", "...
4eb57f28539d60d7fe8082f46fc2e64d
Renders noindex and nofollow meta tags.
[ { "docid": "336eb5f26906e84f79acec67dba6b9f9", "score": "0.7397039", "text": "def render_noindex(tags)\n meta_tags.extract_noindex.each do |name, content|\n tags << Tag.new(:meta, :name => name, :content => content) if content.present?\n end\n end", "title": "" } ]
[ { "docid": "4d343086942cbf313ca17af0310f539a", "score": "0.8330787", "text": "def no_index\n set_meta_tags nofollow: true\n end", "title": "" }, { "docid": "94db97c3befe2f8c18882729829d9dbf", "score": "0.7654203", "text": "def render_noindex(tags)\n meta_tags.extract_robots....
91383c3cbd4ecbbf7415bf7dcf9d8c00
boolean validations for game methods that access the board
[ { "docid": "a6c066fe76e5106b7c23297b104e8053", "score": "0.0", "text": "def blank?(row, col)\n @grid[row][col] == BLANK ? true : false\n end", "title": "" } ]
[ { "docid": "b409ab1376f60121f998f8316f10767b", "score": "0.85254264", "text": "def valid_board?\n self.valid_rows? && self.valid_cols? && self.valid_squares?\n end", "title": "" }, { "docid": "f6f36ad16da07586bf76f9d33d7b385f", "score": "0.80470973", "text": "def valid?\n # Re...
5300526c6dfb6e97c3365300d4681d1a
PUT /game/scheduled_server_downtimes/1 PUT /game/scheduled_server_downtimes/1.json
[ { "docid": "aae8beb5035361caeb416b8a3991452c", "score": "0.7552919", "text": "def update\n @game_scheduled_server_downtime = Game::ScheduledServerDowntime.find(params[:id])\n\n respond_to do |format|\n if @game_scheduled_server_downtime.update_attributes(params[:game_scheduled_server_downtime...
[ { "docid": "131731bdf084374e940c0d1720a2c82e", "score": "0.6952516", "text": "def update\n @game_scheduled_game_downtime = Game::ScheduledGameDowntime.find(params[:id])\n\n respond_to do |format|\n if @game_scheduled_game_downtime.update_attributes(params[:game_scheduled_game_downtime])\n ...
3373b6ca1547f3671e3c7bbc04dff640
Description: Display course information Show all the sections for a given course Route: courses/:season/:year/:subject_code/:course_number
[ { "docid": "3b736d3cfacff4c0f527d73415d9ae17", "score": "0.77552825", "text": "def course\n get_course(params)\n if @course.nil?\n all_semesters = Semester.all\n (all_semesters.size..1).each do |i|\n semester = all_semesters[i-1]\n semester_subjects = semester.subjects.find...
[ { "docid": "42c27b23c9e3f5f3bb26c359e463964c", "score": "0.7313447", "text": "def index\n if params[:section_id].nil?\n @courses = Course.all\n else\n @courses = Section.find_by_id(params[:section_id]).courses\n end\n end", "title": "" }, { "docid": "2a28ac5770856e8a8c967...
d71c93ade3b9808c36c8424c8d234cdb
The following four methods are copied from lib/rails/generators/erb.rb
[ { "docid": "a7e1486697e5d0fa012f0dd334ae9381", "score": "0.0", "text": "def formats\n format\n end", "title": "" } ]
[ { "docid": "1de75b43db59f9da642730acc00dcdd5", "score": "0.67546153", "text": "def render_erb\n end", "title": "" }, { "docid": "d65de1644b286e74f3b32e630eabc0a0", "score": "0.6735143", "text": "def __in_erb_template;\n end", "title": "" }, { "docid": "d65de1644b286...
e4c79b981ad6cd161c5bcf1068096d31
Set the lat param : float Needs to be accompanied by :long. Usage: PYR.call :reps do |r| r.lat = 45.0 r.long = 70.0 end Resulting URI '
[ { "docid": "da3861c632f5056b9ce2a8dd48bc75aa", "score": "0.65274787", "text": "def lat=(float)\n @lat = Param.new(:lat, float)\n params << @lat\n end", "title": "" } ]
[ { "docid": "1704742cb59c23d7992bc59c5f053bba", "score": "0.6265382", "text": "def set_lat_lng_remotely\n lat_lng = PactCoffeeGeoService.get_lat_lng(get_address)\n self.lat = lat_lng[:lat]\n self.lng = lat_lng[:lng]\n end", "title": "" }, { "docid": "7b273d71a78591f8ef7c884a8fc88392...
165f7ffdfcaac35e75974a9634e19684
Checks the certificate text info passed in as a parameter for the fingerprint algorithm and lengths. Returns true if they meet Apple's requirements. Returns true if there were problems parsing the input or if said requirements were not met. Honors the verbose flag for more detailed information about what was detected.
[ { "docid": "342516fa6d9e7613e85a3a503eecd2d5", "score": "0.5199955", "text": "def check_sig_algo(leaf_text)\n print \"Checking Signature Algorithm... \" if $verbose\n\n sig_algo=leaf_text.match(/Signature Algorithm: (.+?)$/m)[1]\n\n case sig_algo\n when /sha(\\d+)WithRSAEncryption/\n sha_sig_bits...
[ { "docid": "d93ceaf4ff93896f4e636526e030bc68", "score": "0.5269187", "text": "def certificate_to_use\n certificates = certificates_for_profile_and_platform\n\n # Filter them\n certificates = certificates.find_all do |c|\n if Sigh.config[:cert_id]\n next unless c.id == Sigh...
111506bee32d711901846a35d4af1e1a
POST /compromissos POST /compromissos.json
[ { "docid": "53bd90483544cdf10c2ca5ceead65d01", "score": "0.68279886", "text": "def create\n @compromisso = Compromisso.new(compromisso_params)\n\n respond_to do |format|\n if @compromisso.save\n format.html { redirect_to @compromisso, notice: 'Compromisso was successfully created.' }\n...
[ { "docid": "160212e098061fba8f75cbbc08393fae", "score": "0.6491382", "text": "def create\n @compromiso = Compromiso.new(compromiso_params)\n\n respond_to do |format|\n if @compromiso.save\n format.html { redirect_to @compromiso, notice: 'Recepcion was successfully created.' }\n ...
5046222842304b5af04d3c3700402294
Notes: Your output lines should not have any trailing or leading whitespaces. 0 < Max Number of Inputs <= 100 0 < Number of Words in one input < 100 0 < Length of Word In A Sentence < 20 Words will always be separated by a single whitespace. Each letter should retain its original case Punctuation does not require speci...
[ { "docid": "3909a9dd88c7008261b181c8a6dad0bb", "score": "0.0", "text": "def flip(word)\n word = word.each_char.to_a\n flipped = \"\"\n word.length.times do \n flipped << word.last\n word.pop\n end\n flipped\nend", "title": "" } ]
[ { "docid": "6fc104b9fdc811df8f5b7e461fd132ef", "score": "0.62254417", "text": "def make_word_phrase(array_of_words)\n array_of_words.each do |word|\n n = array_of_words.index(word)\n # Creates a two word array\n two_word = array_of_words[n..n+1]\n # Checks for the punctuations\n ...
13fd033055d27df0c706ff9eee21a5e4
def more_than_four_of_each_rank_played(played_cards) HINT: use hash end
[ { "docid": "7a1f7732e2779888233a2dd2a8563429", "score": "0.6571359", "text": "def card_count(input)\n count = 0\n\n return false if input.size > CARDS_IN_A_DECK\n\n played_cards = input.chars\n\n played_cards.each do |input|\n if input == '2' || input == '3' || input == '4' || input == '5' || i...
[ { "docid": "75210151f2aadb1dbca6dc40ad4308c7", "score": "0.72673595", "text": "def four_of_a_kind?\n cards_by_rank.values.first.count == 4\n end", "title": "" }, { "docid": "b8f8ec269a3e3dcd97dcd74054449823", "score": "0.7151051", "text": "def card_in_game\n (2..14).each {|r|...
87dc3ae4dd8df3f0ad530f9559b17d78
Name: David Keller We will be creating a method that allows us to search for the index of "data" within a given array.
[ { "docid": "7ff82b8e9d1335d986e8586c1d838e83", "score": "0.6226237", "text": "def arr_search(arr, num)\r\n\tindex = 0\r\n\tarr.each do |search|\r\n\t\tif (index < arr.length && search == num)\r\n\t\t puts index\r\n\t\tend \r\n\t\tindex += 1\r\n\tend \r\nend", "title": "" } ]
[ { "docid": "1f408bc6355449633f66a3043a483d85", "score": "0.77427536", "text": "def find(data)\n @array.each do |element|\n return @array.index(element) if element.value == data\n end \n return nil \n end", "title": "" }, { "docid": "6159ae7656e710b936cc5caa9f888e20", "scor...
49e8c5dfec3e6eb612380c500590fe8d
GET /comentariu_capitols/1 GET /comentariu_capitols/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "0fb7feffeb81008dfcf17383b84b4279", "score": "0.72203636", "text": "def index\n @comentariu_capitols = ComentariuCapitol.all\n end", "title": "" }, { "docid": "229e90929026a813fe6f7a130e3f67cf", "score": "0.65442926", "text": "def index\n @convos = Convo.all\n re...
0640c5422c99180bdb65f2c356ab46fa
Returns the image data as a binary string.
[ { "docid": "7d5194e118357d22b8e4966385ce7035", "score": "0.0", "text": "def read\n tempfile = Tempfile.new([\"dynamic_image\", target_format.extension],\n binmode: true)\n tempfile.close\n write(tempfile.path)\n tempfile.open\n tempfile.read\n ens...
[ { "docid": "adfcc5965a209dfad7b8da76a575ad28", "score": "0.7728836", "text": "def to_s\n return data unless data.is_a?(ImageData)\n \"data:#{data.content_type};base64,#{::Base64.encode64(data.body)}\"\n end", "title": "" }, { "docid": "ec0899b07065849b1bb243da3bc860de", "score": "...
dae83399cc89f4ef02a02b0065e82641
What's the Java home for this JVM? Returns a FilePath object.
[ { "docid": "0deb1671ce8d1634ef193d271fe257ae", "score": "0.7388568", "text": "def home\n @java_home\n end", "title": "" } ]
[ { "docid": "a0952357c714f90e70c0c9a7488fd35b", "score": "0.7984949", "text": "def get_java_home_path\r\n return get_java_property('java.home')\r\n end", "title": "" }, { "docid": "04e47523e7e85204288b47aa2ac7a20e", "score": "0.73204315", "text": "def home\n ['HOME', 'USERPRO...
3087d81bbe3a1bbba0fff4c8ec90aedd
check_salary(result, salary, line_num) check_required_education(result, required_education, line_num) check_category(result, category_name, line_num) check_zip_code(result, location, line_num) check_state(result, state, line_num) check_employment_type(result, employment_type, line_num) check_posted_date_age(result, pos...
[ { "docid": "00b2319669dbea690b4687210348a41d", "score": "0.6474547", "text": "def check_salary(result, salary, line_num)\n result_pay = result[\"pay\"]\n result_pay =result_pay.downcase\n result_pay = result_pay.gsub(\"$\", \"\").gsub(\"/year\", \"\")\n result_pay = result_pay.gsub(\"k\", \"000\").g...
[ { "docid": "f66c6cd31805ee3814a56c3b238fdda0", "score": "0.5957233", "text": "def custom_validations\n self.validate_baseline && validate_baseline_date && \n self.validate_trial_days && self.validates_goal_name && self.validation_due_date\n end", "title": "" }, { "docid": "028...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "ed81f6b31117e0405beb9a97e101e62b", "score": "0.0", "text": "def set_citation\n @citation = Citation.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6162554", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.60452986", "text": "def action_hook...
672ec1ef743b1518c637cafdeb4d5f17
Get one placeholder sentence
[ { "docid": "d0e427d1caa0cddffcfbeab9336808c7", "score": "0.55476403", "text": "def sentence\n sentences(1)\n end", "title": "" } ]
[ { "docid": "69617c86fc71af7e14ecfd1cfa877780", "score": "0.71586543", "text": "def placeholder\n \"%s\"\n end", "title": "" }, { "docid": "8e2f15b0a7f2e1e439d8775112a398cc", "score": "0.6683998", "text": "def hide_word\n\t\tplaceholder = \"\"\n\n\tend", "title": "" }, ...
c1344e8c80514dc413eaab4f98ff2c03
make the model and controller dirs
[ { "docid": "6aa48fac9f523cc665fa314071bcf21c", "score": "0.7975291", "text": "def make_controllers_and_models_dir\n FileUtils::mkdir_p \"controllers\"\n FileUtils::mkdir_p \"models\"\nend", "title": "" } ]
[ { "docid": "117f9eb7b1d5b77c5b40f006c3f83bb5", "score": "0.6857579", "text": "def generate_model_helper\n dirs = ['app', 'models', namespace_alone].compact\n empty_directory File.join(dirs) unless File.directory?(File.join(dirs.flatten))\n template \"app/models/model.rb\", File.join([dirs, \"#{...
6ad73350de33d9ddf7934a949acaf39d
O & utiliza um metodo para passar um bloco para uma variavel
[ { "docid": "c049f0058807f7526218be07e606c9a8", "score": "0.7011439", "text": "def metodo_para_definir_bloco(&bloco)\n bloco\nend", "title": "" } ]
[ { "docid": "a5d856d912310770c277fda7ac4f2861", "score": "0.571499", "text": "def bloco_com_parametros (valor)\n yield valor\nend", "title": "" }, { "docid": "bb324e5995d6bab3bcf35d207a571a2b", "score": "0.56853765", "text": "def BSN03=(arg)", "title": "" }, { "docid": ...
dbff9956922fd9a03a526f25232805b2
PATCH/PUT /parts/1 PATCH/PUT /parts/1.json
[ { "docid": "0d31073384f2264423ce6090594a8c83", "score": "0.62544155", "text": "def update\n params[:part][:image_url] = Cloudinary::Uploader.upload(params[:part][:image])[\"url\"] if params[:part][:image]\n params[:part][:pdf_url] = Cloudinary::Uploader.upload(params[:part][:pdf])[\"url\"] if para...
[ { "docid": "8cea79fc398c51dc5a1b0b0b82fc0b3a", "score": "0.6851175", "text": "def update\n @part = Part.find(params[:id])\n\n respond_to do |format|\n if @part.update_attributes(params[:part])\n format.html { redirect_to @part, :notice => 'Part was successfully updated.' }\n for...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "5e523ff09f64520d10dada2b449a8f73", "score": "0.0", "text": "def set_voiture\n @voiture = Voiture.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;...
9fa91ecbb63ad301e7a4787ee3e2236b
Manually fire an Income webhook Use the &x60;/sandbox/income/fire_webhook&x60; endpoint to manually trigger a Payroll Income webhook in the Sandbox environment.
[ { "docid": "33d3baa62ee092ab8879747f6c3b32bc", "score": "0.70689756", "text": "def sandbox_income_fire_webhook_with_http_info(sandbox_income_fire_webhook_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PlaidApi.sandbox_income_fire_webhook...
[ { "docid": "4cddb81781f543228859d3da9500de10", "score": "0.7700756", "text": "def sandbox_income_fire_webhook(sandbox_income_fire_webhook_request, opts = {})\n data, _status_code, _headers = sandbox_income_fire_webhook_with_http_info(sandbox_income_fire_webhook_request, opts)\n data\n end",...
c00543729e6d2b77e1527cf08ac95d2c
fsremovem remove a method facet from a frameset requires that name[sname,facets] exists modifies name[name,facets], name[sname,method], associated frames
[ { "docid": "99fac3ced0da2743b5c49d7cc5f5c9c2", "score": "0.5288169", "text": "def fsremovem(name, sname)\n if fremoved name, sname\n s = fslistf name\n s.each do |i|\n fremovem i, sname\n end\n return true\n else\n return false\n end\nend", "title": "" } ]
[ { "docid": "a094220e2158558813523b4056a89971", "score": "0.68995297", "text": "def fremovem(fname, sname)\n removed = false\n if fexists fname, sname\n if eval \"$#{fname}['#{sname},facets'].include? 'ref'\"\n fname2 = eval \"$#{fname}['#{sname},ref']\"\n if eval \"$#{fname}['#{snam...
a1e5462fdb06111603d1c2ca6e93ed93
GET /sources GET /sources.json
[ { "docid": "a0a05d7bb028e6646137d49acdc16f2e", "score": "0.0", "text": "def index\n respond_to do |format|\n format.html do\n @recent_objects = Source.created_this_week.order(updated_at: :desc).limit(10)\n render '/shared/data/all/index'\n end\n format.json {\n @so...
[ { "docid": "04c48ba684e874c42f64d4a7eee0faee", "score": "0.8055116", "text": "def get_sources\n response = execute_get(\"/reference/source\")\n Source.from_array(decode(response))\n end", "title": "" }, { "docid": "1d5a8f015af9606ef4d6ec5adf904971", "score": "0.781809", "text"...
7dcccf3ddd867e3931612bfee0d780c0
If a record is not in the index, and is updated, it should still not be in the index.
[ { "docid": "f857a3588c9926cdfcd21f4c474cb453", "score": "0.6610504", "text": "def test_update_if_not_in\n Post.acts_as_indexed :fields => [:title, :body], :if => Proc.new { |post| post.visible }\n destroy_index\n\n assert_equal [6], Post.find_with_index('crane', {}, { :no_query_cache => true, :...
[ { "docid": "6c031d20c243340113f3baa497e4b613", "score": "0.70831066", "text": "def update_index\n if should_be_in_index?\n mapper.process_with([record]) do |context|\n writer.put(context)\n end\n else\n writer.delete(record.ark_id)\n end\n ...
80a67277dad51e2286f3e3ea65aa4d29
=begin 1. Method to create a list input: string of items separated by spaces (example: "carrots apples cereal pizza") steps: define a method to take a string convert to hash keys iterate the keys and add a default quantity print the hash output: hash 2. Method to add an item to a list input: item and quantity(optional)...
[ { "docid": "04ba5f1e5d4df97cbbe5801e53845dcb", "score": "0.0", "text": "def list (strings)\n array_list = strings.split(/ /)\n grocery_list = Hash.new(0)\n array_list.each do |x|\n grocery_list[x] += 1\n end\n print_list(grocery_list)\n return grocery_list\nend", "title": "" } ]
[ { "docid": "1b5af997e5a7ee91a815e9ba1649108d", "score": "0.82155436", "text": "def createlist(str)\r\n# steps:\r\n# break the string into an array\r\n items = str.split\r\n item_list = {}\r\n\r\n\t# iterate through array and build hash\r\n items.each do |item|\r\n\r\n\t\t# iterate through array...
5cb9b7d9c86843f4d62063955b7a808d
DELETE /applicant_reports/1 DELETE /applicant_reports/1.json
[ { "docid": "118926da97dddbac4d0c9cc4c0ac0e9a", "score": "0.7524569", "text": "def destroy\n @applicant_report.destroy\n respond_to do |format|\n format.html { redirect_to applicant_reports_url, notice: 'Reporte de becario eliminado correctamente.' }\n format.json { head :no_content }\n ...
[ { "docid": "e3b6d71d47030315e5f4eb5726c80dde", "score": "0.70700467", "text": "def destroy\n @report.destroy!\n render json: {status: :ok}\n end", "title": "" }, { "docid": "ddc200bb064bffe93965b9dba5350443", "score": "0.696153", "text": "def destroy\n @applicant = Applican...
1f8f74841c3cf32d46a960933e5c9963
GET /friends/new GET /friends/new.xml
[ { "docid": "8c6b4d5f9923e284babb34ce58c4ef05", "score": "0.7550902", "text": "def new\n @friend = Friend.new\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @friend }\n end\n end", "title": "" } ]
[ { "docid": "649c93bddf41e8c09fe89b971aa2bb60", "score": "0.7616655", "text": "def new\n @friend = Friend.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @friend }\n end\n end", "title": "" }, { "docid": "649c93bddf41e8c09fe89b971...
eafb375fd1ecaa6989ac6be4a33e43d0
Forward method calls to the current revision, so the page responds to all revision calls
[ { "docid": "091632e709900ac010fee8f57302f127", "score": "0.56524456", "text": "def method_missing(method_id, *args, &block)\r\n method_name = method_id.to_s\r\n # Perform a hand-off to AR::Base#method_missing\r\n if @attributes.include?(method_name) or md = /(=|\\?|_before_type_cast)$/.match(me...
[ { "docid": "82511f626dcda937eaa5bc5cc6b7bac5", "score": "0.6686811", "text": "def page_revisions\n self.back_to_top\n page_revisions_button\n self.wait_for_ajax\n\n end", "title": "" }, { "docid": "74859c24270d84a1e713425b93960c1b", "score": "0.64998", "text": "def revision...
fcb360cf47e9044bc8b2add1f199ce4d
PUT /trainees/1 PUT /trainees/1.xml
[ { "docid": "e61148308ef11c98f7a2dd170b39f552", "score": "0.6368375", "text": "def update\n @trainee = Trainee.find(params[:id])\n\n respond_to do |format|\n if @trainee.update_attributes(params[:trainee])\n format.html { redirect_to(@trainee, :notice => 'Trainee was successfully update...
[ { "docid": "fbd7c46b15ae2792fd842ba0d764b7d0", "score": "0.60727537", "text": "def put uri, args = {}; Request.new(PUT, uri, args).execute; end", "title": "" }, { "docid": "1902573afc096534eb0589b391028bf0", "score": "0.606278", "text": "def update\n @trainee = Trainee.find(params...
0f45dec3ca8d9723252f366abbd1c4ef
Stores a tweet in the TweetQueue model so that the bot can access it
[ { "docid": "c9e2dbf9e1156bb23c4292fdc0628c0b", "score": "0.81546146", "text": "def store_tweets (tweets)\n\t\ttweets.each do |t|\n\t\t\tnew_tweet = TweetQueue.create(:text => t, :source => @tweet_id)\n\t\t\tnew_tweet.save\n\n\t\tend\n\t\n\tend", "title": "" } ]
[ { "docid": "04d2e71d63db4190f6a972aafc646b52", "score": "0.73004377", "text": "def save_tweet key, tweet\n\t\t@db.rpush key, tweet\n\tend", "title": "" }, { "docid": "ae248014f58fe45c0e1b2e739cea4d97", "score": "0.72274595", "text": "def store_tweet tweet\n tweet_id = tweet.id.to_...
fe4cad943f5a231e56b60d497d724943
this function deletes the addresses and address group from the firewall
[ { "docid": "a31606245a2af04a8ee67edd1b04b6c1", "score": "0.66238034", "text": "def delete_addresses_and_dag(address_group_name, addresses, device_groups)\n device_groups.each do |device_group|\n # delete the addresses\n address_request = AddressRequest.new(@url, @key)\n addresses['entr...
[ { "docid": "c80742823e03004cc9cbcc65922e6565", "score": "0.64338344", "text": "def delete_all_node_addresses\n super\n end", "title": "" }, { "docid": "a2ff4de6842eb4bb65e17b5d6b762c97", "score": "0.630097", "text": "def delete_unused_host_only_networks\n end", "ti...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "fb593c22b30c3919ef01e0fd1e38ef8a", "score": "0.0", "text": "def set_pet_photo\n @pet_photo = PetPhoto.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...
4c05b93a5e737fa692713201c0d26cc5
GET /films/1 GET /films/1.xml
[ { "docid": "4bef27179688353829084e6291f7126c", "score": "0.6345123", "text": "def show\n @film = Film.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @film }\n end\n end", "title": "" } ]
[ { "docid": "7e138945cf04c5821c83663c32701182", "score": "0.6089171", "text": "def filmography\n @artist = Artist.find(params[:id])\n @movies = @artist.filmography(current_user)\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @artist }\n end\n ...
e8376aa256ea81d7ceb80bb10b8804fe
4) Continuos dividend record This is pushed as the most important Shold have uninterupted dividends over past 20 years Beware! does not include current year
[ { "docid": "aaabfc7489752670303a25ae525a31f3", "score": "0.5734269", "text": "def continous_dividend_record?(years = 20)\n current_year = YEAR\n dg = dividends.group_by{ |d| d.date.year }\n\n (current_year - years..current_year - 1).each do |year|\n return false if dg[year].nil? || (!dg[ye...
[ { "docid": "98d488ba4e6bc5c8a8c81b66bac5b8e2", "score": "0.60703135", "text": "def compute_five_year_dividend_yield\n start_date = Time.now - 5.years\n divs = Dividend.where(stock_id: id).where( \"issue_date > ? \", start_date)\n return if divs.size == 0\n\n total_amount = divs.map(&:amount)...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "558d3ee0a3278b4c55dff0303eaa67c2", "score": "0.0", "text": "def component_tag_params\n params.require(:component_tag).permit(:component_id, :tag_id)\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...
8a1d29437ea44ac31d8fd6058c1e08a8
Transliterates text to ASCII and removes unknown characters leaving just words.
[ { "docid": "d0c8fcf9ead83b395cf6324a029710e9", "score": "0.70963424", "text": "def clean_words(text=nil, enc=nil)\n cw = clean_text(text, enc)\n cw.gsub!(/\\[\\s*?[^\\:]+?\\:\\/+?.*?\\]/mi, ' ')\n cw.gsub!(/\\[\\s*?(\\d|\\s|[^\\w])+\\]/mi, ' ')\n cw.gsub!(/[^a-z0-9]+/im, ' ')\n cw.squeeze...
[ { "docid": "af7dd8a3d049a18d422f9504dd874cbf", "score": "0.763907", "text": "def clean(text)\n if String.method_defined?(:encode)\n text.encode!('ascii', :invalid => :replace, :undef => :replace, :replace => '?')\n else\n require 'iconv' unless defined?(Iconv)\n text = Iconv.iconv('ascii//tra...
415a144cec6e3168d30c162471b10656
GET /virtual_users/1 GET /virtual_users/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "9f034899e4ae3657778b99f839bb7447", "score": "0.72373325", "text": "def index\n @virtual_users = VirtualUser.all\n end", "title": "" }, { "docid": "4152fb6556ae83f7cdd6c362f17ad9bf", "score": "0.69832444", "text": "def index\n if params[:single]\n\t url = \"#{API_B...
6ec6651b9a70a934742bc92dc81b056f
Increase left column line number by one.
[ { "docid": "9943eecb7b7884b62b43dad64265565c", "score": "0.71839017", "text": "def increase_left\n left_column << increase_or_start(:left)\n right_column << nil\n end", "title": "" } ]
[ { "docid": "1f3e5fb4b7f21065de7edac5d61018e1", "score": "0.70420945", "text": "def increment_line_nums\n @start_line += 1 if @start_line\n @end_line += 1 if @end_line\n end", "title": "" }, { "docid": "035238eb5de471472cf28b42f2ca479e", "score": "0.70008665", "text": "de...
96f3dab8f26ca4849b39a4c2b88fe2c6
Determine the template to be rendered using the given options.
[ { "docid": "0ec0b3152245fc295fdfadfa060b7bd2", "score": "0.82222384", "text": "def _determine_template(options) #:nodoc:\n if options.key?(:inline)\n handler = Template.handler_class_for_extension(options[:type] || \"erb\")\n Template.new(options[:inline], \"inline template\", handler...
[ { "docid": "480077b4fd86c512903eb5c262997c00", "score": "0.8575421", "text": "def determine_template(options)\n\n\t \t# keys are for local variables passed to template\n\t keys = options.has_key?(:locals) ? options[:locals].keys : []\n\n\t if options.key?(:body)\n\t ::ActionView::Tem...
07e75966df8675954d366938628f4e98
Raises an exception if a nonnil provided_hexdigest is given and it does not match the given hexdigest.
[ { "docid": "91afc0e50c555764f57e8fc3311f0d30", "score": "0.8320108", "text": "def validate_provided_hexdigest!(provided_hexdigest, hexdigest)\n return unless provided_hexdigest && hexdigest != provided_hexdigest\n raise ChecksumMismatchError, \"Checksum mismatch. Provided checksum (#{provided_...
[ { "docid": "afb2ca5d0992bd6d6f3d03445118c806", "score": "0.65816873", "text": "def hexdigest_integrity_uri(hexdigest); end", "title": "" }, { "docid": "afb2ca5d0992bd6d6f3d03445118c806", "score": "0.65816873", "text": "def hexdigest_integrity_uri(hexdigest); end", "title": "" }...
170580549756099483263ae21af242b9
Never trust parameters from the scary internet, only allow the white list through
[ { "docid": "780652d8f84e28e6a080b3c5025f0241", "score": "0.0", "text": "def reference_params\n params.require(:reference).permit(:url, :topic, :annotation, :creationtime)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7498969", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.7031948", "text": "def strong_params\n params.require(:request).permit(param_white...
a98e707558d340a1a98584b13cddcd38
list = [2, 3, 6, 7, 6, 7] list = [5, 3, 7] largest_continugous(list) how to get O(n) time? and 0(1) space complexity this is still just O(n^2)
[ { "docid": "1c370915b933c23f2596973ce97cdc04", "score": "0.8099479", "text": "def largest_continugous_second(list)\n max = list[0]\n list.each_with_index do |el, idx|\n list[(idx)..-1].each_with_index do |second_el, jdx|\n value = list[idx..idx + jdx].inject(:+)\n if value > max\n ...
[ { "docid": "493b5a14181948ed7023ef25a7072f0c", "score": "0.7655057", "text": "def largest_contiguous_subsum2(list)\n largest = list.first #O(1)\n current = list.first #O(1)\n\n (1...list.length).each do |idx| #O(n)\n current = 0 if current < 0 #O(1)\n current += list[idx] #O(1)\n ...
1097a7e7758f08d32addfc88ea3fdcab
GET /users GET /users.json
[ { "docid": "8b1dbac81472eff58cb602a4a1473ebb", "score": "0.0", "text": "def index\n @users = User.all\n end", "title": "" } ]
[ { "docid": "9f7c735ace683c5c2b12c914cc9ad8a8", "score": "0.8407128", "text": "def get\n users = User.all.as_json\n render(json: users.as_json, status: :ok)\n end", "title": "" }, { "docid": "543509c6588e2f79a8dbcd1cdcdaf7b9", "score": "0.8359616", "text": "def users\...
79c5422cc373f667ed595386a99f5cf3
Create an association between the trackgroup and an existing account
[ { "docid": "2244b57a0303c3df193595e625fd081c", "score": "0.7417314", "text": "def create\n \n @account = Account.find(params[:account][:id])\n @trackgroup.accounts << @account\n redirect_to account_path(:region => @account.region, :idLoL => @account.idLoL)\n \n end", "title": "" } ...
[ { "docid": "47293794fb09000038969b8ac1d7da8f", "score": "0.65680975", "text": "def createAPI\n \n idLoL = LOL_WRAPPER.get_summoner_id(params[:accname], params[:region])\n #Find the summoner with the corresponding id and region\n @summoner = LOL_WRAPPER.get_summoner_by_id(idLoL, params[:regi...
93e4f48fe1c3c8d440393e5e4891afdc
How long are you? exercise Small Problems exercises from LaunchSchool
[ { "docid": "832a9c47f8302a6fb4110016c7f4a696", "score": "0.0", "text": "def word_lengths(str)\n str_length_arr = []\n str.split.each { |s| str_length_arr << \"#{s} #{s.length}\"}\n str_length_arr\nend", "title": "" } ]
[ { "docid": "aa89b26c8848588848ff622b5d313173", "score": "0.63461095", "text": "def solution\n 31875000\nend", "title": "" }, { "docid": "74d22b2a38c2a85ac10d31346b8621fe", "score": "0.6291449", "text": "def trip_length\n \"The trip will take around #{156*3} seconds\"\nend", "...
5992584916d5289c692bc47a07980d36
Parse a quoted word. Assumes that s points at an opening quote. Performs variable and command interpolation. Returns contents of word without quotes and index just after closing quote as a pair.
[ { "docid": "2fe0892f2bff355c285d32955551f7c8", "score": "0.6729518", "text": "def parse_quoted_word(input)\n input.consume # skip starting quote\n result = \"\"\n while not input.eof? do\n c = input.look_ahead\n case c\n when \"\\\"\" : input.consume; return result\...
[ { "docid": "69f13c938bd25c88269707d0ecd58358", "score": "0.60355335", "text": "def _quoted_string\n\n _save = self.pos\n while true # sequence\n _tmp = match_string(\"\\\"\")\n unless _tmp\n self.pos = _save\n break\n end\n while true\n\n _save2 = self.pos\...
51ada49d78ba9cc7baa15c924ddb8d5a
Extracts the scale from PostgreSQLspecific data types.
[ { "docid": "42782c231c10e10fd178b81e22d6f98d", "score": "0.74659497", "text": "def extract_scale(sql_type)\n # Money type has a fixed scale of 2.\n sql_type =~ /^money/ ? 2 : super\n end", "title": "" } ]
[ { "docid": "e52ab70f7e0db892f175f2931e41fc5a", "score": "0.74887127", "text": "def extract_scale(sql_type)\n # Money type has a fixed scale of 2.\n sql_type =~ /^money/ ? 2 : super\n end", "title": "" }, { "docid": "ac2282db5fb75391b73fc46a0e8e490a", "score": "0.634563...
65556c9c97116cacc2a69b14e91ff258
def test_elapsed_time_condition condition = ElapsedTimeCondition.new condition.interval = 0.2 Test for falsehood. On first pass, its clock will only be at 0.1 seconds.
[ { "docid": "f5c4290ac1ba0e40558f6c626ad00270", "score": "0.689649", "text": "def test_active_less_than_condition\n condition = ActiveLessThanCondition.new(0.15)\n #Test for truth.\n #On the first pass, the condition's clock will only be at 0.1 seconds.\n assert(condition.select(@actor, [@tar...
[ { "docid": "39887c3cb559589f1e921db0f9e71cc4", "score": "0.7707949", "text": "def test_inactive_longer_than_condition\n condition = InactiveLongerThanCondition.new(0.15)\n #Test for falsehood.\n #On the first pass, the condition's clock will only be at 0.1 seconds.\n assert(! condition.selec...
b83eff5be5dba1940a5af9629d059353
GET /data_file_types GET /data_file_types.xml
[ { "docid": "9d0f716581ef1d943eb810fec5fc8e79", "score": "0.7465812", "text": "def index\n @data_file_types = DataFileType.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @data_file_types }\n end\n end", "title": "" } ]
[ { "docid": "138a170603d9da9966ebd67a1411e798", "score": "0.6992546", "text": "def list_resource_file_types(options={}) path = \"/api/v2/definitions/resourcefiletypes\"\n get(path, options, AvaTax::VERSION) end", "title": "" }, { "docid": "33ca6e6b8efe4a55a4b2a0322abe9649",...
bac92d24fc0e69d93155707a36d6e12a
PUT /press_releases/1 PUT /press_releases/1.xml
[ { "docid": "d93134c1cfc4b1ec588f840aba1813d4", "score": "0.63112843", "text": "def update\n @press_release = PressRelease.find(params[:id])\n\n respond_to do |format|\n if @press_release.update_attributes(params[:press_release])\n format.html { redirect_to(@press_release, :notice => 'P...
[ { "docid": "330aef787277451074ed7e0a39f04964", "score": "0.66278666", "text": "def box_version_release(username:, name:, version:)\n request(method: :put, path: \"/box/#{username}/#{name}/version/#{version}/release\")\n end", "title": "" }, { "docid": "882c8317370987b86425c0adbf5bfe8...
3b88e6db478da20d62866188e0812070
Checks current user is the project owner. Safety catch incase it makes it past project
[ { "docid": "ee8349ffbc83b3941e844a63f45f05a5", "score": "0.8078142", "text": "def project_owner\n\t\t@project = Project.find(params[:project_skill][:project_id])\n\t\t\n\t\tunless @project.user_id == current_user.id\n\t\t\tflash[:warning] = 'Access denied as you are not owner of this Project'\n\t\t\t@us...
[ { "docid": "ac91f3f96112d556fa32a219479374ee", "score": "0.87740946", "text": "def check_if_owner(project, user)\n project.user.id == user.id\n end", "title": "" }, { "docid": "4dfe4cc3dd320c1ad356f5c369be087a", "score": "0.8764582", "text": "def check_owner\n set_projec...
140bb594b65e525d802e021619733c6b
1) Jonathan Huang 2) Mohammad Amin We spent [1] hours on this challenge. Bakery Serving Size portion calculator.
[ { "docid": "1eec34096ceb909dd69f4b45aab9cc1e", "score": "0.6291618", "text": "def serving_size_calc(item_to_make, order_quantity)\n\n #hash\n library = {\"cookie\" => 1, \"cake\" => 5, \"pie\" => 7}\n raise ArgumentError.new(\"#{item_to_make} is not a valid input\") if !library.include?(item_to_make...
[ { "docid": "04cbfbb702aa9620695a7cca6a7ab31a", "score": "0.70581967", "text": "def calculate_sizes\n @big_blocks = (@book_size.to_f/BlockDiv.to_f).ceil\n @list_blocks = (@big_blocks / ListBlocks) + 1\n @root_start = @big_blocks\n end", "title": "" }, { "docid": "e6e963840648dec99...
a7e5b7574e1bdacf3d18a4e8134eee5e
Logs the given text to the plaintext logfile. Does NOT acquire the file mutex!
[ { "docid": "4206d73f8523a41981f4a4a859f00db0", "score": "0.0", "text": "def log_own_htmlmessage(text, is_notice)\n time = Time.now\n anchor = timestamp_anchor(time)\n converter = Cinch::MircCodesConverter.new\n @htmllogfile.puts(<<-HTML)\n <tr id=\"#{anchor}\">\n <td class=\"msgt...
[ { "docid": "74c6a139725fa23993ad83456c15ab5e", "score": "0.75588006", "text": "def writeLog(text)\n\n Utils_visiona.verifyInput(String, text.class)\n\n return if @logFile.nil?\n\n Thread.new do\n\n File.open(@logFile, 'a+') {|file| file.puts \"#{Time.now} #{text}\"}\n end\n\t\...
285f129cd89e4477bdfe1c936688d391
close must never be called on the input stream. huh?
[ { "docid": "cfa45b8d2090eb233392a3bf84558bd4", "score": "0.0", "text": "def close_write\n if @output.respond_to?(:close)\n @output&.close\n end\n\n @output = nil\n end", "title": "" } ]
[ { "docid": "8e46709b7350c25879b635a6df37d880", "score": "0.75755763", "text": "def close_read() end", "title": "" }, { "docid": "8e46709b7350c25879b635a6df37d880", "score": "0.75755763", "text": "def close_read() end", "title": "" }, { "docid": "8e46709b7350c25879b635a6df...
717cbd9b94e1f1e5af81a5d5e21b67c0
PUT /portgroups/1 PUT /portgroups/1.json
[ { "docid": "0da1ffa219048a7c40ac08c3e9c9fdf4", "score": "0.7148917", "text": "def update\n @portgroup = Portgroup.find(params[:id])\n\n respond_to do |format|\n if @portgroup.update_attributes(params[:portgroup])\n format.html { redirect_to @portgroup, notice: 'Portgroup was successful...
[ { "docid": "641941ccce9db9b5f592b8748b4f16a7", "score": "0.6820559", "text": "def update\n @group_id = group_params[:group_id]\n puts group_params\n puts \"PARAMS\"\n @reponse = HTTParty.put(\"https://rails-api-ipo.herokuapp.com/api/v1/groups/#{@group_id}.json\",\n :body => {:group_name =...
aaeb1afed13fd6d35dcd2bc3c8592e1d
GET /notify_observers/1 GET /notify_observers/1.json
[ { "docid": "7df66c331cda62a9174b3473348768ca", "score": "0.7137802", "text": "def show\n @notify_observer = NotifyObserver.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @notify_observer }\n end\n end", "title": "" ...
[ { "docid": "2fc55cefab3fb1a497ae9c288dc322d8", "score": "0.6679375", "text": "def new\n @notify_observer = NotifyObserver.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @notify_observer }\n end\n end", "title": "" }, { "docid": "...
895abe5e38fbcb3a8cc55bdd82dc14e7
Serialize the tag object to an html string. Supports +Tag+ instances, +Input+ instances (recursing into +call+ with the result of formatting the input), arrays (recurses into +call+ for each entry and joins the result), and (html escapes the string version of them, unless they include the +Raw+ module, in which case no...
[ { "docid": "6aae6d78deee7de34ec9cc20dfc40066", "score": "0.74448925", "text": "def call(tag)\n case tag\n when Tag\n if SELF_CLOSING.include?(tag.type)\n \"<#{tag.type}#{attr_html(tag.attr)}/>\"\n else\n \"#{serialize_open(tag)}#{call(tag.children)}#{serialize_c...
[ { "docid": "111bfc23c3868df03e2cf4526857126b", "score": "0.69009495", "text": "def call(tag)\n case tag\n when Tag\n case tag.type.to_sym\n when :input\n case tag.attr[:type].to_sym\n when :radio, :checkbox\n tag.attr[:checked] ? '_X_' : '___'\n ...
0aa238356bc8aabdb4e7f2163d003e9a
PATCH/PUT /promotions/1 PATCH/PUT /promotions/1.json
[ { "docid": "09f775b4c2558d41dc507be0f028e4c5", "score": "0.0", "text": "def update\n if @promotion.update(promotion_params)\n vendors_importer = VendorsExcelImporter.new(params[:promotion][:file], @promotion)\n begin\n vendors_importer.import\n rescue Exceptions::InvalidVendorsI...
[ { "docid": "b6d21de2ce8f5f71fb6c1f1a230a3851", "score": "0.64256454", "text": "def update\n respond_to do |format|\n if @promoter.update(promoter_params)\n format.html { redirect_to root_url, notice: 'Promoter was successfully updated.' }\n format.json { render :sho...
043d2a8afd48face13ec237c685411b4
A list of child pages which have both +active+ and +show_in_nav+ set to true. Only the attributes needed to render navigation are returned, these are: +page_id+, +path+, +external_url+, +name+ and +has_content+.
[ { "docid": "f037d8b05cc31217eb3e359a689f2df0", "score": "0.8266054", "text": "def navigable_children\n page_children.minimal.where(active: true, show_in_nav: true)\n end", "title": "" } ]
[ { "docid": "489e8e86135bf526aa910a24cacc8de0", "score": "0.7722021", "text": "def children\n navigation.pages.where(parent_id: id)\n end", "title": "" }, { "docid": "ab2c85850d53f2c4b955f0d38def8294", "score": "0.73464894", "text": "def navigation\n if has_children?\n ...
0837e9a1690a74f0c7169a50aaeefa03
POST /applicants POST /applicants.json
[ { "docid": "7cb4ddcb3c2edffb47c125e1814d4b62", "score": "0.0", "text": "def create\n @hair_colour = HairColour.select(:hair_colour).order(:hair_colour).map(&:hair_colour)\n @eye_colour = EyeColour.select(:eye_colour).order(:eye_colour).map(&:eye_colour)\n @applicant = Applicant.new(params[:appl...
[ { "docid": "36ecdc59a8cbf36f3ad5245a3215093e", "score": "0.6386846", "text": "def create\n # @applicant = Applicant.new(applicant_params)\n # @applicant = current_user.build_applicant(applicant_params)\n @applicant = current_user.applicants.build(applicant_params)\n\n respond_to do |format|\...
f2478a600cfe9d2fe12aa95ace42ec44
POST /portal_schools POST /portal_schools.xml
[ { "docid": "077499245591eedec4a74624d2bdc4be", "score": "0.6266232", "text": "def create\n # PUNDIT_REVIEW_AUTHORIZE\n # PUNDIT_CHECK_AUTHORIZE\n # authorize Portal::School\n cancel = params[:commit] == \"Cancel\"\n if params[:nces_school]\n @nces_school = Portal::Nces06School.find(p...
[ { "docid": "6eaa84af85fc69ae75bf175e65e09d0c", "score": "0.6428368", "text": "def create\n # PUNDIT_REVIEW_AUTHORIZE\n # PUNDIT_CHECK_AUTHORIZE\n # authorize Portal::Nces06School\n @nces06_school = Portal::Nces06School.new(params[:nces06_school])\n\n respond_to do |format|\n if @nces...
b7fada24d9c298dc66b11c872b1bcada
Provide the first (or first `number`) entries
[ { "docid": "1e49052549f80a270e0fcf707cd8efb0", "score": "0.6665485", "text": "def first(number = nil)\n if number\n self.class.new(@list.first(number), type: @type, api_client: @api_client)\n else\n @list.first\n end\n end", "title": "" } ]
[ { "docid": "633327374f5f7ad0ae1421e894e7e02a", "score": "0.72849655", "text": "def first(*n) end", "title": "" }, { "docid": "6afe5ce8f9a9be7d0bb3fed6cdc16f08", "score": "0.6881762", "text": "def first(numbers, int)\n numbers.first(int)\nend", "title": "" }, { "docid": "...
1646533022c753d5009bd3d4894a3830
Return the numeric category of the response's status code (15)
[ { "docid": "521c0a4c2c4aa969d0e988e5817edce7", "score": "0.67781264", "text": "def status_category\n\t\treturn 0 if self.status.nil?\n\t\treturn (self.status / 100).ceil\n\tend", "title": "" } ]
[ { "docid": "797c0662b2321006997744e2b2e8c5a3", "score": "0.7142085", "text": "def status_code\n @data[:status_code].to_i\n end", "title": "" }, { "docid": "f2906495bd8cee7c41aac239cad7017a", "score": "0.7130086", "text": "def status_code\n response_value(:code)\n end"...
8c84a0bbf92c07f42253d82194d43319
GET /cursos GET /cursos.json
[ { "docid": "220607b145a64767c4a13facaccbd44c", "score": "0.0", "text": "def index\n\n if session[:universidade_id] == nil\n redirect_to root_url and return\n end\n\n @q_cursos = Curso.ransack(params[:q].try(:merge, m:'or'))\n\n @q_cursos.sorts = 'nome asc' if @q_cursos.sorts.empty?\n ...
[ { "docid": "ad1e4323a9b5bf8b33c40d8ec22a983c", "score": "0.7299236", "text": "def index\n @cursos = Curso.all\n end", "title": "" }, { "docid": "ad1e4323a9b5bf8b33c40d8ec22a983c", "score": "0.7299236", "text": "def index\n @cursos = Curso.all\n end", "title": "" }, { ...
38afc93af8693ec61bca806d38c5ddd6
GET /bookmarks/1 GET /bookmarks/1.json
[ { "docid": "2f6c08ecc37618cfaacd71562edd8a24", "score": "0.7135275", "text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @bookmark }\n end\n end", "title": "" } ]
[ { "docid": "a2ba5902ea11577874794c5738ebc71d", "score": "0.77293515", "text": "def index\n @bookmarks = Bookmark.all\n render json: { bookmarks: @bookmarks }, status: :ok\n end", "title": "" }, { "docid": "4e56911bf8e1e86a9053caf4d54feeb4", "score": "0.75858563", "text": "def ...
5d88d879cb8605fdf1722cf12c620157
Pass a new UserFunder object to the form
[ { "docid": "27d78f0f83689e1cccd54bbba5fc6882", "score": "0.7064072", "text": "def fund_user\n @user_funder = UserFunder.new\n end", "title": "" } ]
[ { "docid": "d154914f7acf2539d328c7fcb0efbf33", "score": "0.716839", "text": "def new\n # give form access to model methods\n @user = User.new\n end", "title": "" }, { "docid": "7021c5e75564b956a18edd3a79e4a38f", "score": "0.7021289", "text": "def set_form\n @user = User.f...