query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
f377be7fbe6ace95009050c297ca21b2 | GET /posts GET /posts.xml | [
{
"docid": "138852ad1e229a6f2db2ef90a2c6119f",
"score": "0.7197632",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end",
"title": ""
}
] | [
{
"docid": "96353a9632432f29bdb1830a6be90489",
"score": "0.7286619",
"text": "def index\n @posts = Post.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end",
"title": ""
},
{
"docid": "f2ee44b73f3580e582... |
86f2bba28b247153c06a3b5485217acf | FIXME Config.port.to_i equals 0 when Config.port is nil | [
{
"docid": "c23138b36f28817fd33c5551cc92cf2e",
"score": "0.0",
"text": "def apush\n socket = EM::Synchrony::TCPSocket.new('localhost', 22195)\n socket.write(to_bytes)\n socket.close\n end",
"title": ""
}
] | [
{
"docid": "f15a33a455d20148b0ce828b6626f327",
"score": "0.75000477",
"text": "def actual_port; end",
"title": ""
},
{
"docid": "f15a33a455d20148b0ce828b6626f327",
"score": "0.75000477",
"text": "def actual_port; end",
"title": ""
},
{
"docid": "67519263fc920612f162762aff... |
b320a34760a460536625df8a1a2c1803 | Returns true if exp is (probably) a model instance | [
{
"docid": "e9b9ec05dfd689326260494428c2041b",
"score": "0.7635579",
"text": "def model_instance? exp\n if node_type? exp, :or\n model_instance? exp.lhs or model_instance? exp.rhs\n elsif call? exp\n if model_target? exp and\n (@model_find_calls.include? exp.method or exp.method.t... | [
{
"docid": "295554ea59e0dd52c0c7ccf9534d6315",
"score": "0.736382",
"text": "def instance_of?(klass)\n model.class == klass\n end",
"title": ""
},
{
"docid": "a12007e5e079d6fb1b5bfa9f608fe9a5",
"score": "0.71500033",
"text": "def model?\n type == :model\n end",
... |
9b019d0cd98e59f402dea3f004043dee | POST /link_builders or /link_builders.json | [
{
"docid": "59d658ec52c3fe25efe2979340857fda",
"score": "0.70385885",
"text": "def create\n @link_builder = LinkBuilder.new(link_builder_params)\n\n respond_to do |format|\n if @link_builder.save\n format.html { redirect_to @link_builder, notice: \"Link builder was successfully created... | [
{
"docid": "82904d043258b966cba5460206d523e5",
"score": "0.605935",
"text": "def set_link_builder\n @link_builder = LinkBuilder.find(params[:id])\n end",
"title": ""
},
{
"docid": "8954a9788f23529c5a059ba01fb228a8",
"score": "0.5940177",
"text": "def create\n @link = Link.... |
7a30ac9f924a998ccb51d6b40c052a44 | Test if currently forced to mobile view. | [
{
"docid": "b6c5fbbd9a02dcf9320d67c6705a779e",
"score": "0.7307512",
"text": "def forced_mobile?\n cookies[COOKIE_NAME] == FORCE_MOBILE_VALUE\n end",
"title": ""
}
] | [
{
"docid": "15e81a9f60fd1ea259f02ccbdc9f181f",
"score": "0.81764555",
"text": "def mobile_forcing?\n forced_mobile? || forced_non_mobile?\n end",
"title": ""
},
{
"docid": "b0c13c6ebe1a87f33abd262afa2814e3",
"score": "0.8063161",
"text": "def mobile?\n detect_mobile?... |
f110d812e9b22fe9298a9cded2216e64 | POST /tipo_correccions POST /tipo_correccions.json | [
{
"docid": "1f9c6d427511b92dc14b6787cc70e381",
"score": "0.70380235",
"text": "def create\n @tipo_correccion = TipoCorreccion.new(tipo_correccion_params)\n\n respond_to do |format|\n if @tipo_correccion.save\n format.html { redirect_to @tipo_correccion, notice: 'Tipo correccion was suc... | [
{
"docid": "bab3b7313e7caff3e678674f5c5924b7",
"score": "0.71465445",
"text": "def create\n @tipo_correo = TipoCorreo.new(tipo_correo_params)\n\n respond_to do |format|\n if @tipo_correo.save\n format.html { redirect_to @tipo_correo, notice: 'Tipo correo was successfully created.' }\n ... |
f90135bab47173e01c2fa54ec2b5eb22 | Provides operations to manage the cookies property of the microsoft.graph.security.host entity. | [
{
"docid": "530da7ce1a2906bbeb026edda1c5298e",
"score": "0.6737896",
"text": "def cookies()\n return MicrosoftGraph::Security::ThreatIntelligence::Hosts::Item::Cookies::CookiesRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"title": ""... | [
{
"docid": "52c47e41ed4c90d6991480c56e93c36d",
"score": "0.7698189",
"text": "def host_cookies=(value)\n @host_cookies = value\n end",
"title": ""
},
{
"docid": "fef27495b6af08c6b4474925c94a68be",
"score": "0.71658826",
"text": "def host_cookies()\n ... |
0f90666523aab21047b15a35e5f30d9a | Attempts to save the record like Persistence, but will raise ActiveRemote::RemoteRecordInvalid if the record is not valid Validations can be skipped by passing :validate => false example Save a record, raise and error if invalid post.save! example Save a record, skip validations post.save!(:validate => false) | [
{
"docid": "4cee41e353c2b3d8573e02b2a9b6bf79",
"score": "0.6817622",
"text": "def save!(options = {})\n perform_validations(options) ? super : raise_validation_error\n end",
"title": ""
}
] | [
{
"docid": "e052526a820f516354b483d99d50d944",
"score": "0.79339015",
"text": "def save!\n validate\n ( errors.empty? && save ) || raise(RecordNotSaved)\n end",
"title": ""
},
{
"docid": "cde945b852837418a121671c45211364",
"score": "0.7819691",
"text": "def save!\n save o... |
ea02d5327be6aa30837de1d5413f6f25 | TODO: write selection sort | [
{
"docid": "082de26c0fc691dbb01794892e1101e8",
"score": "0.68326324",
"text": "def selection_sort(arr)\n\tsmaller = 0\n\t@array = arr\n\t@index = 0\n\n\twhile !finish_selection?\n\t\tsmaller = @index\n\t\tfor i in (@index..(@array.length-1))\n\t\t\tif @array[i] < @array[smaller]\n\t\t\t\tsmaller = i\n\t... | [
{
"docid": "056fa4809757eba0bdbb78d9740457d2",
"score": "0.7638372",
"text": "def selection_sort(arr)\n\treturn arr\nend",
"title": ""
},
{
"docid": "22cdf7d44bdf59181337e3a9a4b59b18",
"score": "0.7631489",
"text": "def sort_select\n l = self.length\n [].tap do |sorted|\n ... |
02c5665a5061a86f1cc95b51d690cd13 | Restore a profile backup. curl X POST u admin:admin F 'backup=backup' v | [
{
"docid": "0c4eceacf59272bb46a9b02b11cab609",
"score": "0.7794633",
"text": "def restore\n verify_post_request\n access_denied unless has_role?(:profileadmin)\n require_parameters :backup\n\n backup = Api::Utils.read_post_request_param(params[:backup])\n\n messages=java_facade.restorePro... | [
{
"docid": "b177311329a5885a2d0510b0b862eabc",
"score": "0.6802294",
"text": "def restore\n bid = params[:backupid]\n version = params[:version] \n backup = Backup.find(bid)\n \n filename = backup_filename(backup.id, backup.name)\n filename_with_version = backup_filename_with_versio... |
6538e9095fba72217037b8768dbe2458 | GET /scholarships GET /scholarships.xml | [
{
"docid": "525dc5a27895538cf1b1559e14542c13",
"score": "0.69698226",
"text": "def index\n # There's three ways to hit this page -- either all scholarships (no params), scholarships for a tag (tag_id),\n # or scholarships for a provider (scholarship_provider_id). Probably a cleaner way to do this... | [
{
"docid": "3c22871e7124c7de0a71c725c136b4f2",
"score": "0.7039747",
"text": "def index\n @scholarships = @university.scholarships\n end",
"title": ""
},
{
"docid": "e98fb5bcb78b9ede46caf4e40c1fe179",
"score": "0.6945757",
"text": "def show\n @scholarship = Scholarship.find(pa... |
11b06786332c1e2190d8fa898f5c1e39 | Determines a time as an integer within the interval when the code is, was or will be valid | [
{
"docid": "d62ea72fc5037719130f68cab2660dc4",
"score": "0.5928058",
"text": "def otp_time(code, totp = otp, drift = self.class.otp_allowed_drift, time = Time.now)\n time = time.to_i\n times = (time-drift..time+drift).step(totp.interval).to_a\n times << time + drift if times.last < ... | [
{
"docid": "576c9c130c3bfd1e9d9d7f37c50a51bc",
"score": "0.709172",
"text": "def timeInterval(optional=nil)\n\n if num = expect(/(\\d+)/, \"integer\", ANYWHERE, optional) then\n n = num.to_i\n if mult = expect(@@TimeUnits, \"Time Units\", SAME_LINE, true) then\n num.to_i * mult\n ... |
6b448e2eef3525dab0982cc964bee725 | GET /archivos/1 GET /archivos/1.json | [
{
"docid": "9e58957dd3a561cf23687a0a869ada3a",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "c70ba96b0a05591c7a651f1fb26f1275",
"score": "0.73204076",
"text": "def index\n @archivos = Archivo.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @archivos }\n end\n end",
"title": ""
},
{
"docid": "b5ff3d0d50633493... |
b03827e6134af64b7425f1133dc4582d | Detect genes appearing in text | [
{
"docid": "2c61600337dabb470cb7dd3d745b3d31",
"score": "0.6595464",
"text": "def detect(text)\n # Check dependency\n BioTCM::Databases::HGNC.ensure\n # Prepare symbol list\n unless @symbols\n @symbols = String.hgnc.symbol2hgncid.keys\n # Exclude symbol patterns\n @symbols.rej... | [
{
"docid": "4e3ec0bab8bb34ff9ca2302ca4f1265b",
"score": "0.651864",
"text": "def genres\n search_by_text('жанры').split(', ')\n end",
"title": ""
},
{
"docid": "bc07dd49f5819af9d3ef86c2787443c4",
"score": "0.60581076",
"text": "def obscene?(text)\n text.include?(\"obscenitie... |
00d748c9f115426e20e223c829ebbcb1 | Return the time this cron instance is expected to run at. | [
{
"docid": "d37f3e568f0b59b7e606d6cc42199b8e",
"score": "0.65124935",
"text": "def current_time\n @current_time ||=\n begin\n Time.parse(worker.job_meta.get(key(:time_at)).to_s)\n rescue ArgumentError\n Time.try(:current) || Time.now\n end\n e... | [
{
"docid": "ca756e3be1a0d1e769404bd38b56aa7b",
"score": "0.73039377",
"text": "def actual_time\n # Time.now.min\n Time.now.hour\n end",
"title": ""
},
{
"docid": "9f2aaff46d0de7e86dffe18a3bab23ab",
"score": "0.71593237",
"text": "def execute_time\n @trigger.ex... |
696c2b6f23e0ad95e260aa195386fc06 | PATCH/PUT /links/1 or /links/1.json | [
{
"docid": "e9db1ead34ecc736db6a70849695d438",
"score": "0.6270206",
"text": "def update\n respond_to do |format|\n if @link.update(link_params)\n format.html { redirect_to @link, notice: \"Link was successfully updated.\" }\n format.json { render :show, status: :ok, location: @lin... | [
{
"docid": "f3f809a0e3b53d74963f79e8846c1a29",
"score": "0.68053514",
"text": "def update\n update_and_respond(@link, link_params)\n end",
"title": ""
},
{
"docid": "6ef1d749d242920bd51d43f06112aba7",
"score": "0.6667373",
"text": "def update\n @link = Link.find(params[:id])\n... |
927d91a811b76218239955f2962e7831 | Strong parameters access for Devise's create method | [
{
"docid": "c2eaf1157a4af00701da542a1f4e6326",
"score": "0.0",
"text": "def sign_up_params\n params.require(:user).permit(:first_name, :last_name, :avatar, :email, :password,\n :password_confirmation)\n end",
"title": ""
}
] | [
{
"docid": "4be19ff89e182dde19b6c8bead5d9d8b",
"score": "0.73607546",
"text": "def params_create_user\n params[:user]\n .permit(\n :username,\n :email,\n :password\n )\n end",
"title": ""
},
{
"docid": "f1136801541b2c273a6f0440d9c20e82",
"score": "0.721... |
737cdb239c194e1ff91c74c1c591da9c | Retrieve initial slapd DB configuration index. | [
{
"docid": "e9d90b8133d52f5bb0146cacf7a236a7",
"score": "0.8045297",
"text": "def slapd_init_db_index\n slapd_init_db_path_matcher[1]\n end",
"title": ""
}
] | [
{
"docid": "6c5a17e5de67c01e43546907f9acacf9",
"score": "0.7047986",
"text": "def slapd_db_config_index\n ::File.basename(slapd_db_config_file).match(/{(\\d+)}#{ node['ca_openldap']['db_backend'] }\\.ldif/)[1]\n end",
"title": ""
},
{
"docid": "2602a34b7608c9f272aeb9fdfd7a5ec4",
"sco... |
2dcac1dca5ce0c9facb07b13ad255d7e | Serialize the object from the type defined in the model to a MongoDB compatible object to store. | [
{
"docid": "88cfcec185bad7a5b151c23140a96b48",
"score": "0.62348455",
"text": "def serialize(object); object; end",
"title": ""
}
] | [
{
"docid": "3eefc890f0e2f741bc012463c6d6a3f3",
"score": "0.69654286",
"text": "def to_mongo\n convert_object self, :_to_mongo\n end",
"title": ""
},
{
"docid": "34a9ef3af421efe6194b51b31a674be6",
"score": "0.6709496",
"text": "def force_convert_to_bson\n ::BSON.serialize... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "090e77c0c1010405469fc0dc2c9e5f97",
"score": "0.0",
"text": "def set_api_v1_news_feed_link_segment\n @api_v1_news_feed_link_segment = Api::V1::NewsFeedLinkSegment.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... |
2faec3d2a844ec3014b062088418886b | Reload application routes regardless if they changed or not. source://railties//lib/rails/application.rb148 | [
{
"docid": "16316d14aaf11ee6e70aefdc9692b819",
"score": "0.7920565",
"text": "def reload_routes!; end",
"title": ""
}
] | [
{
"docid": "31ad49d0d3ab49f983d604b26956f87b",
"score": "0.8294917",
"text": "def reload_routes!\n Rails.application.reload_routes!\n end",
"title": ""
},
{
"docid": "31ad49d0d3ab49f983d604b26956f87b",
"score": "0.8294917",
"text": "def reload_routes!\n Rails.application.reloa... |
0800f8e0406c03bc47b114768dbd7d8a | Adds an index to a table for the given columns: DB.add_index :posts, :title DB.add_index :posts, [:author, :title], :unique => true | [
{
"docid": "86025f832121993426f6263c83f238ce",
"score": "0.67218953",
"text": "def add_index(table, *args)\n alter_table(table) {add_index(*args)}\n end",
"title": ""
}
] | [
{
"docid": "68c5ef26bdf9a8139edfc9110abb246d",
"score": "0.7069466",
"text": "def add_index(*col_names)\r\n raise \"Do not execute this method in client/server mode!\" if \\\r\n @db.client?\r\n\r\n col_names.each do |c|\r\n raise \"Invalid column name: #{c}\" unless \\\r... |
0659f47fb678c625076b66821c0463b5 | before_action :configure_sign_up_params, only: [:create] before_action :configure_account_update_params, only: [:update] GET /resource/sign_up def new super end POST /resource def create super end GET /resource/edit def edit super end PUT /resource def update super end DELETE /resource def destroy super end GET /resour... | [
{
"docid": "1e69ceb19b63b6ac941a5579b7991726",
"score": "0.0",
"text": "def edit\nend",
"title": ""
}
] | [
{
"docid": "cdd69125ae507d5cde30d119935e6309",
"score": "0.7340991",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:email,:password, :password_confirmation, :first_name, :last_name, :circonscription])\n devise_parameter_sanitizer.permit(:account_update,... |
c58fbc3ed8f71dd9c273a4d926c2837a | A method to ask the user to confirm something | [
{
"docid": "ec330667d74c9e59b6e538885283a545",
"score": "0.0",
"text": "def are_you_sure? # Define a method. Note question mark!\n while true # Loop until we explicitly return\n print \"Are you sure? [y/n]: \" # Ask the user a question\n response = gets ... | [
{
"docid": "5a1020ca77ab041c4f16f92a237272a4",
"score": "0.8453731",
"text": "def confirm(prompt); end",
"title": ""
},
{
"docid": "50daf35d5ba57de08ec1fd7c97bc4b84",
"score": "0.8330337",
"text": "def confirm(question)\n CLI::UI.confirm(question)\n end",
"title": ""
},
{... |
e81bcf64bac72a833666aa27f2c900fa | super_attr accpects the attr name and a hash with type: and required: | [
{
"docid": "fa0f39cf98bdd03b4e77064c2729ebdf",
"score": "0.78230613",
"text": "def super_attr(name, opts={})\n\t\t\t\t\n\t\t\t\t# Defines getter\n\t\t\t\tdefine_method(\"#{name}\") do\n\t\t\t\t\tinstance_variable_get(\"@#{name}\")\n\t\t\t\tend\n\n\t\t\t\t# Defines setter\n\t\t\t\tdefine_method(\"#{name}... | [
{
"docid": "77f5044fd4a848412af368327d7e56b2",
"score": "0.6896312",
"text": "def init_super_attrs(args={}, inst)\n\t\t\t\targs_keys = args.keys\n\n\t\t\t\tif @@required_attrs.any?\n\t\t\t\t\t# Checks if args_keys has all attr in the \n\t\t\t\t\t# @@required_attrs. If args is empty, it will\n\t\t\t\t\t#... |
9f53aed15ff485435f289e00d2538c62 | strip out all nonnumeric characters except a leading + | [
{
"docid": "55d852a65e2857ef3294f926785e4d89",
"score": "0.0",
"text": "def normalize(value)\n return value if value.blank?\n\n value = \"+#{value}\" if value.to_s[0..0] == '1' # north american bias\n value = \"+#{implied_country_code}#{value}\" unless value.to_s[0..0] == '+'\n\n leading_plu... | [
{
"docid": "b7964ffc8ad1e96d85b35d1722303573",
"score": "0.7419523",
"text": "def stripChars(text)\n return text.gsub(/[^0-9]/,'')\n end",
"title": ""
},
{
"docid": "e93f333b5b59df0b36f6aa5b1c3cf278",
"score": "0.73668975",
"text": "def remove_extra_characters(number)\n number.g... |
a126a834a55ac7959bf0664b7d0c2d65 | Iterates over all decorations (note that the component itself is excluded) | [
{
"docid": "c9faf3ea67844110ca9d36825f2ae660",
"score": "0.65228975",
"text": "def each_decoration # :yields: decoration\n d = @decoration\n while d and d != self\n yield d\n d = d.next\n end\n end",
"title": ""
}
] | [
{
"docid": "48c9fbd9a5807c786715f28acd57b70c",
"score": "0.64217865",
"text": "def decorations\n embellishments.select { |e| e.is_a?(Decoration) }\n end",
"title": ""
},
{
"docid": "a7b9bb77ce511d437c5d5f050d29fc59",
"score": "0.6283511",
"text": "def each(&block)\n deco... |
55fda71d6a409a672e7de4790781d1e1 | Provides operations to manage the runs property of the microsoft.graph.identityGovernance.workflow entity. | [
{
"docid": "813ef96f68f5d0bca4bf96f705c1ebf1",
"score": "0.7399024",
"text": "def runs()\n return MicrosoftGraph::IdentityGovernance::LifecycleWorkflows::Workflows::Item::Runs::RunsRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"title... | [
{
"docid": "4b5ab2c9b750289575c0d0f59c2632de",
"score": "0.6016965",
"text": "def workflow=(value)\n @workflow = value\n end",
"title": ""
},
{
"docid": "34e43fa8e3dec46899a1c2c84f6018b6",
"score": "0.5680614",
"text": "def set_run\n @run = current_user... |
fba5eb559765017ce82bc517b676b7eb | no gevernment offical shall temper the report. | [
{
"docid": "817d443845ee23e35ba1fdfc4fec793e",
"score": "0.0",
"text": "def update?\n admin.admin? and report.pending?\n\n end",
"title": ""
}
] | [
{
"docid": "0332dbd5ce277743bb9bfd646e3056c5",
"score": "0.62257785",
"text": "def no_report\n false\n end",
"title": ""
},
{
"docid": "1e0bb96dc06cb9589949f1ae221c6dcb",
"score": "0.59759384",
"text": "def full_report; end",
"title": ""
},
{
"docid": "8069e05f0b9277e... |
eb342cbad5f5b064800446d737979030 | Overwrite method : Init visibility | [
{
"docid": "735baff10062cf69256ff4ccb5782f65",
"score": "0.66695225",
"text": "def init_visibility\n return if actor? && !@battler.data_battler.dead_key.empty?\n @battler_visible = !@battler.hidden? && (@battler.enemy? ? \n !@battler.collapsed : true)\n self.opacity = 0 unless @battler_vis... | [
{
"docid": "d75a67b080cd2616ad4385f1565933e6",
"score": "0.72528124",
"text": "def visibility; end",
"title": ""
},
{
"docid": "b48ef9f8fa068619ee52bdc998fed83a",
"score": "0.7084335",
"text": "def set_default_visibility\n self.visibility ||= Visibility::PUBLIC\n end",
"title... |
b10035a1a37e55021973405167042406 | GET /feedbacks/1 GET /feedbacks/1.json | [
{
"docid": "0ad85dd61afbec07d60ecaa64cb16772",
"score": "0.0",
"text": "def show\n @user = User.find_by(id: @feedback.user_id)\n end",
"title": ""
}
] | [
{
"docid": "1bf079e32ac92ebca6eefc8b6453b66f",
"score": "0.80852723",
"text": "def show\n @feedbacks = Feedback.find(params[:id])\n render json: @feedbacks\n end",
"title": ""
},
{
"docid": "11e609d060a674d59be2e683d430e530",
"score": "0.77096236",
"text": "def index\n @fee... |
459b27b1eeb1ea27393d99dcf4d47c6d | Reimplementing. The logic is: if there is already a user that can log in or LDAP support is enabled, work as usual. Otherwise, redirect always to the signup page. | [
{
"docid": "33d4f8c3c61a6996d8574d077fa4b32c",
"score": "0.7169825",
"text": "def new\n signup_allowed = !Portus::LDAP.enabled? && APP_CONFIG.enabled?(\"signup\")\n\n if User.not_portus.any? || !signup_allowed\n @errors_occurred = flash[:alert] && !flash[:alert].empty?\n super\n else\... | [
{
"docid": "6a3e1b76b1a8387834a49fab7918300b",
"score": "0.76073384",
"text": "def authenticate_user_or_signup!\n unless current_user\n redirect_to new_user_registration_path\n false\n end\n\n true\n end",
"title": ""
},
{
"docid": "c7d2d0f9465970a8dd4487e6c62... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "2e5044e8f7c8b078e83e4291e9aeec3e",
"score": "0.0",
"text": "def update!(**args)\n @kind = args[:kind] if args.key?(:kind)\n @operation = args[:operation] if args.key?(:operation)\n end",
"title": ""
}
] | [
{
"docid": "184b1b1ed771473d3eb9f338c0734c38",
"score": "0.73066413",
"text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end",
"title": ""
},
{
"docid": "5076c5a88404ae72986f958710f5687a",
"score": "0.72631145",
"text": "def update... |
0c6e4aef636999ede03d324fcf645755 | GET /festivals/new GET /festivals/new.xml | [
{
"docid": "2bdd92106b76da33233808f9fbec6bb2",
"score": "0.77950376",
"text": "def new\n @festival = Festival.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @festival }\n end\n end",
"title": ""
}
] | [
{
"docid": "95df8d2bc3ad70dabf8b945c6bc2d539",
"score": "0.70986617",
"text": "def new\n @frnd = Frnd.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @frnd }\n end\n end",
"title": ""
},
{
"docid": "c1d2bf7ff5fb2f21f4877ebc9cd0ee... |
1e4181f7d9205b9f6cb0fddb0d9a2192 | Parse the trimet response and output simple instructions | [
{
"docid": "41b88e58ca4ceece7814f08456e02b63",
"score": "0.53084",
"text": "def do_some_stuff_with_trimet_response trimet\n xml = Nokogiri::XML(trimet)\n xml.xpath(\"//xmlns:itinerary\").each do |itinerary|\n puts \"itinerary #{itinerary[\"id\"]}\"\n legs = itinerary.xpath(\"xmlns:leg\")\n ... | [
{
"docid": "30c69dce9be5dc95ae9e55dc9fe57d0e",
"score": "0.6192964",
"text": "def parse_response\n parse_address()\n parse_expires()\n parse_token_type()\n parse_token()\n end",
"title": ""
},
{
"docid": "bac9e520e9dbc6bd61ee6c03a9b1e3b8",
"score": "0.61576587",
... |
d1f6dc91ad718ad39008ec8eef28cc93 | add two keys for which will be written in db | [
{
"docid": "94f37bf4bddbf70c424e01efd50554df",
"score": "0.0",
"text": "def to_db_hash\n super.merge(\n {\n 'text' => @text,\n 'url' => @url\n }\n )\n end",
"title": ""
}
] | [
{
"docid": "1963cc7c78514f7995a88a116a252a69",
"score": "0.65446204",
"text": "def hash_add! tables, item_key, item_value\n if tables.has_key? item_key then\n tables[item_key] += item_value\n else\n tables.store item_key, item_value\n end\nend",
"title": ""
},
{
"docid": "6b07913412... |
f945fc4f2a8802637632f34584523aab | Define a method `binary_multiple_of_4?(s)` that takes a string and returns true if the string represents a binary number that is a multiple of 4. NOTE: be sure it returns false if the string is not a valid binary number! | [
{
"docid": "c3bb9866cd82f1e35c0017759d2ad051",
"score": "0.845282",
"text": "def binary_multiple_of_4? s\n s =~ /^[01]+$/ && s.to_i(2) % 4 == 0\nend",
"title": ""
}
] | [
{
"docid": "0e7252364a034be16d308f929b34aa31",
"score": "0.91078144",
"text": "def binary_multiple_of_4?(s)\n regex = /\\A(1|0)+\\z/ # String uses only binary digits\n (s =~ regex && s.to_i(2) % 4 == 0) ? true : false\nend",
"title": ""
},
{
"docid": "2cb5e75fed22a991137938803b1451fc",
... |
90df8750142c9fb8c26fe9c5b909c1ea | The character or symbol the operation uses to delimit fields in the exported data. The default is a comma (,) for tables. Not applicable when extracting models. | [
{
"docid": "6fa455c2385d6630ff43e6e6f5e4c5a6",
"score": "0.68197393",
"text": "def delimiter\n return unless table?\n val = @gapi.configuration.extract.field_delimiter\n val = \",\" if val.nil?\n val\n end",
"title": ""
}
] | [
{
"docid": "89e3f8cf74d214abdba0859bcfa6dc6d",
"score": "0.689856",
"text": "def column_seperator\n return \"|\" if @delimiter == :pipe\n \",\"\n end",
"title": ""
},
{
"docid": "c931dcef392a4f535d5f676dec55f187",
"score": "0.6852232",
"text": "def field_value_separator\... |
8cf39bce1d67c19370df79e962c4ec36 | Make sure update_view_stats is working as advertised. | [
{
"docid": "3a23b73211fac4654a91c3fb9c578ed6",
"score": "0.0",
"text": "def test_save_updated_at\n obs = observations(:detailed_unknown_obs)\n updated_at = obs.updated_at\n Observation.record_timestamps = false\n obs.last_view = Time.now.getlocal\n obs.save\n Observation.record_timesta... | [
{
"docid": "51158a47e1cbd743b11eaa9c30d5dd6e",
"score": "0.75856334",
"text": "def update_view_stats(object)\n return unless object.respond_to?(:update_view_stats) && !browser.bot?\n\n object.update_view_stats\n end",
"title": ""
},
{
"docid": "dcbbcd9de2db4464fef0203925c83ebd",
"... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "2f9c5cff53a32850ddc357f0b29f7249",
"score": "0.0",
"text": "def class_session_params\n params.require(:class_session).permit(:subject, :notes, :number_of_students, :start_time, :end_time, :room)\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.69792545",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6781151",
"text": "def strong_params\n params.requ... |
3421605bc624e89aa1e187520b54f503 | Read the next available chunk. | [
{
"docid": "cfa7b0daff7b2a1e79a7e43d74aaf9be",
"score": "0.0",
"text": "def read\n\t\t\t\t\tunless @task\n\t\t\t\t\t\t@stream = Stream.new(@input)\n\t\t\t\t\t\t\n\t\t\t\t\t\t@task = Task.current.async do |task|\n\t\t\t\t\t\t\ttask.annotate \"Streaming hijacked body.\"\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t@blo... | [
{
"docid": "9d9533cbfeb442d92707b1021aeb9479",
"score": "0.7883745",
"text": "def peek_next_chunk_in_seq\n @chunks[@current_chunk_index + 1] || @reader.peek_next_chunk\n end",
"title": ""
},
{
"docid": "b7c3a3aae4dda53fc94287fbc69676cb",
"score": "0.7837224",
"text": "def rea... |
5c756865c827f67da65c27e9c93016e7 | To get the grade parameters for calculating earned grade and final grade in the javascript. | [
{
"docid": "be954acc2177b500eaa6224ce62d51d0",
"score": "0.79412436",
"text": "def get_grade_params_for_javascript\n weight_hash = []\n self.course.assignments.each do |assignment|\n score = assignment.maximum_score\n if self.grade_type == \"weights\"\n score *= 0.01\n end\n ... | [
{
"docid": "3e0f9890479b86873de5ee2e0c603a01",
"score": "0.6741972",
"text": "def grade\n @grade\n end",
"title": ""
},
{
"docid": "71d89c26b9c723cf603cf1b4b152081f",
"score": "0.6427538",
"text": "def get_grade(*args)\n ave = args.reduce(:+) / args.size\n\n case ave\n when 90... |
6485f63c371a9c9bd8fe4a4548839be4 | Verify the parser can handle multple parameters | [
{
"docid": "78fa1c17e663bfa4ba44afb17e6131e5",
"score": "0.0",
"text": "def test_multiple_parameter3\n @cl.url = 'http://craigslist.com?city=${city}&item=${city}'\n @cl.save\n \n assert_equal \"http://craigslist.com?city=san+francisco&item=san+francisco\",\n Parser.get_url('c... | [
{
"docid": "3cfebb9c2aff3d0d78e54e1044c0147d",
"score": "0.7132534",
"text": "def validate_parameters?\n opts = OptionParser.new\n opts.parse!(@parameters) rescue return false\n @parameters.length >= 2\n end",
"title": ""
},
{
"docid": "d903069a631ccd0084e7016a8ad41696",
"score... |
2fc3f596d89eb55d22a17dc3350909ab | PATCH/PUT /employers/1 PATCH/PUT /employers/1.json | [
{
"docid": "e0ebcf2aa5ff0f0efc82840a3b5aa0f5",
"score": "0.7020444",
"text": "def update\n respond_to do |format|\n if @employer.update(employer_params)\n format.html { redirect_to @employer, notice: 'Employer was successfully updated.' }\n format.json { render :show, status: :ok, ... | [
{
"docid": "48fa07cc791d14aaa7373a45f5d6d198",
"score": "0.7202266",
"text": "def update\n @employer = Employer.find(params[:id])\n\n respond_to do |format|\n if @employer.update_attributes(params[:employer])\n format.html { redirect_to @employer, :flash => {notice: 'Employer was succe... |
661800c87bc53b185dd8f3812f0a7a29 | Purchase using PayfortMerchant amount Number token String ==== Options :id Order reference (REQUIRED) :command (REQUIRED) :email Customer email address (REQUIRED) :name Customer name (OPTIONAL) :ip Customer IP address (REQUIRED) :currency Currency, defaults to AED (OPTIONAL) :eci Ecommerce indicator (OPTIONAL) :card_se... | [
{
"docid": "b3ba007313d60e8f5e83056d13d9f742",
"score": "0.8192362",
"text": "def purchase(amount, payfort_token, options = {})\n request_params = {}\n request_params[:amount] = amount\n request_params[:eci] = options[:eci]\n request_params[:card_security_code] = options[:car... | [
{
"docid": "ad9c7e4ce55660404f7a88d3724d484f",
"score": "0.7450327",
"text": "def purchase(payment_method_token, amount, options = {})\n execute(:purchase, options.merge(:payment_method_token => payment_method_token, :amount => amount))\n end",
"title": ""
},
{
"docid": "39d9ca2dc7849680... |
ea99c28d08ac0528bda6f52b7d90c76c | Max sessions Check if maximum number of sessions was reached. Logs max session if max sessions was reached. | [
{
"docid": "9efc20f8d098f3afeaf9418d045a88e9",
"score": "0.83209556",
"text": "def max_sessions?\r\n @logger.warn(\"Max sessions reached: #{@maxSessions}\") if @sessions.keys.size >= @maxSessions\r\n @sessions.keys.size >= @maxSessions\r\n end",
"title": ""
}
] | [
{
"docid": "acb2fc075e5d930903d6781f1e38d3d3",
"score": "0.71501535",
"text": "def check_max_session_time\n # Method for checking the user is logged or not\n if devise_current_user.setting\n timeout = devise_current_user.setting.session_max\n if %w(24 48).include?(timeout)\n if d... |
a217f51593e59cdbe151a15df9d508e6 | post method for update of game this method will update the game with each guess of a letter it takes in a letter through params and calls the check_letter method below | [
{
"docid": "e17a93fd0e77f731d8d083dc7a7e4962",
"score": "0.0",
"text": "def update\n check_letter(params[:letter])\n respond_to do |format|\n format.js { render 'show' }\n format.html {render 'show' }\n end\n end",
"title": ""
}
] | [
{
"docid": "4b1c12c706abb962c3887653766124e6",
"score": "0.7747477",
"text": "def update_guess(guess_letter)\n @game_word.include?(guess_letter) == false ? incorrect_letter(guess_letter) : correct_letter(guess_letter)\n show_game_info\n end",
"title": ""
},
{
"docid": "0842df6617cba1e... |
ea43c4c966223d065e1f2f01105c5d69 | Can be initialized with a block | [
{
"docid": "335e61e7b52ea14e58f59b0ca91ccffe",
"score": "0.0",
"text": "def initialize\n @servers = []\n @nicks = []\n @realname = ''\n @username = ''\n @c_state = :connecting\n @read_buffer = ''\n @events = Events::Handler.new self\n @events.start\n yield se... | [
{
"docid": "ec0d2d07690e20be51d1067cb7e08e6b",
"score": "0.8542913",
"text": "def initialize(&block)\n @block = block\n end",
"title": ""
},
{
"docid": "15fe7a2ead469b7ffc7c4a947ee2a1a8",
"score": "0.80913514",
"text": "def initialize(&block)\n\t\t\t\tinstance_eval &block\n\t... |
1604420869bd9326be5699c980528f1d | If the goal of patch is to "update/change" a an item, create a Story/Step and then attempt to change it's name with your patch request. And check your servers response that it now has the new name, as well as that name being in the database 4: | [
{
"docid": "01571f47587f28b9bfa6721a3d897879",
"score": "0.0",
"text": "def test_can_delete_a_story\n # skip\n story = Story.create\n delete \"/story_delete/#{:id}\"\n # response = last_response.body\n # binding.pry\n assert_equal false, Story.exists?(story.id)\n end",
"title": ""... | [
{
"docid": "21e241623b00c940b5730a101ea390c0",
"score": "0.6701007",
"text": "def test_the_application_can_update_a_previous_item_title_on_our_to_do_list\n #Create an item to test\n #Send a PUT request to '/items/:id' that will update the item's title\n #Assert that the controller responds with... |
7d408648520c97d7d616ab685026add9 | Create a HierarchicalRecordSet from the EdiOutProposal record. This method is implemented by each specific document type transformer. | [
{
"docid": "0ce9d6457882441d3731f54ee04576f1",
"score": "0.4715364",
"text": "def create_doc_records(proposal)\n puts \"create_doc_records Not implemented\"\n end",
"title": ""
}
] | [
{
"docid": "c9b30f55b1ea70b4aa3a3530a9348efd",
"score": "0.61478055",
"text": "def create_doc_records(proposal)\n\n EdiHelper.transform_log.write \"Transforming Hansa World Enterprise (HWE)..\"\n\n # ---------\n # BH record (heading)\n # ---------\n # Headings are provided by the schema's... |
e42d732c4d88e1adcfdd1aa83d8bd4ad | Fetch key from the chest as if it were a hash. | [
{
"docid": "c96c279981f0e969847cd66a7d3d0848",
"score": "0.0",
"text": "def fetch(*args)\n @hash.fetch(*args)\n end",
"title": ""
}
] | [
{
"docid": "e8715e7da5bf99ca2bb46051034fa361",
"score": "0.685744",
"text": "def fetch\n value_of @key\n end",
"title": ""
},
{
"docid": "95bd1d9a3c9f4e9821762baf565c51b8",
"score": "0.67867327",
"text": "def fetch(key); end",
"title": ""
},
{
"docid": "79b35f3bad... |
6efee86a2c1d4da0f5baf21dd65085df | DELETE /meal_plans/1 DELETE /meal_plans/1.json | [
{
"docid": "ca34220cba7fc0a6e4a48c0fad94cb72",
"score": "0.79680324",
"text": "def destroy\n @meal_plan = MealPlan.find(params[:id])\n @meal_plan.destroy\n\n respond_to do |format|\n format.html { redirect_to meal_plans_url }\n format.json { head :no_content }\n end\n end",
"t... | [
{
"docid": "4f1df36279d6906b28df64fd8dce00a3",
"score": "0.7977005",
"text": "def destroy\n @meal_plan = MealPlan.find(params[:id])\n @meal_plan.destroy\n\n respond_to do |format|\n format.html { redirect_to meal_plans_url }\n format.json { head :ok }\n end\n end",
"title": ""... |
26c51c75ede1ae48a4a8e9926520e501 | Route a caller to an IVR app | [
{
"docid": "c757a8d8fe37f7c2d673f7a8ce249c4c",
"score": "0.0",
"text": "def survo(id, usr_param={}, pt='') \n self.helper('survo', id)\n \n if usr_param.any?\n params = @param.add_element('user_params')\n usr_param.each do |k,v|\n params.add_element(k).text = v\n end \n ... | [
{
"docid": "4e962e401504aa7d0ba3e8890b5f486f",
"score": "0.5854036",
"text": "def route\n #TODO\n end",
"title": ""
},
{
"docid": "886049deedcf4fb24f3aef02d374d0f7",
"score": "0.58411735",
"text": "def route(*args)\n @app.log << \"route #{args.inspect[1..-2]}\"\n @app.route(*ar... |
dd8d8d9d1c92c5e4bb213cc7d052d344 | Vertical Rectangle with a gradient | [
{
"docid": "db37630eebe4f7c740cedc8fb5df7a43",
"score": "0.70794743",
"text": "def test_gradientVertical\n [@window, @sprite, @bitmap].each{|container|\n c = CRectangle.new(container, Rect.new(150, 100, 50, 100), Color.hp_gauge_color1, Color.hp_gauge_color2)\n c.draw()\n }\n return tr... | [
{
"docid": "f442c38e17c73d17e7c2e72aa5c4c64f",
"score": "0.73328125",
"text": "def test_verticalGradientVertical\n [@window, @sprite, @bitmap].each{|container|\n c = CRectangle.new(container, Rect.new(250, 100, 50, 100), Color.hp_gauge_color1, Color.hp_gauge_color2, true)\n c.draw()\n }\... |
03038bca41f6498ed27b2f05dc9d673a | Read information about one issue in GitHub and return it as a map. | [
{
"docid": "72067a7fb416edd9a8d2b8aef692f144",
"score": "0.64215326",
"text": "def issue(issue_id)\n hash = @client.issue(@repo.name, issue_id)\n id = hash[:user][:id] if hash[:user]\n username = hash[:user][:login] if hash[:user]\n {\n state: hash[:state],\n author: {\n id:... | [
{
"docid": "64b04b31fb01a0a82c390fe5c6d83815",
"score": "0.71050006",
"text": "def get_issues_info\n closed_issues = []\n stop = false\n page = 1\n\n until stop\n issue_fetch = HTTParty.get(@GITHUB_API_BASE_URL + \"/issues?state=closed&page=#{page}&access_token=#{@access_token... |
ca2ba1f3af8805a7f3592bb54d2175c3 | GET /recurring_gifts/1 GET /recurring_gifts/1.xml | [
{
"docid": "a58f1043ac16ee2ffb69ef54eab1082a",
"score": "0.6226202",
"text": "def show\n @recurring_gift = RecurringGift.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @recurring_gift }\n end\n end",
"title": ""
}
] | [
{
"docid": "e9f10f702211f6f0b7ac3b4faf7bc811",
"score": "0.7143769",
"text": "def index\n @recurring_gifts = RecurringGift.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @recurring_gifts }\n end\n end",
"title": ""
},
{
"docid... |
748c46a58e052a095eaa0c8c14b176dc | GET /sigans/1 GET /sigans/1.json | [
{
"docid": "907d13c8afe924e5cb5d0f5cbf44bb35",
"score": "0.0",
"text": "def show\n @currentgwamokid = params[:currentgwamokid]\n end",
"title": ""
}
] | [
{
"docid": "c25e85f5382ed73749d68fce19b03c9c",
"score": "0.6239413",
"text": "def index\n @sigans = Sigan.all\n @currentgwamokid = params[:currentgwamokid]\n end",
"title": ""
},
{
"docid": "3204dff0d150c412269152e485e8823c",
"score": "0.58638793",
"text": "def show\n @bio_... |
424d0734e2a49a427af955a1dec61f27 | Retrieves meta data from the file using exiftool, and returned in a hash allowing for complex conversion rules. video_bitrate "300k" if meta[:video_bitrate].to_f > 300 | [
{
"docid": "49e4e5def156aecbbee7e5e8faa792c5",
"score": "0.5534468",
"text": "def meta\n if `which #{EXIF_UTILITY}`.empty?\n {}\n else\n @meta_data ||= `#{EXIF_UTILITY} #{@from_file}`.split(\"\\n\").inject({}) {|hash, element| \n hash.merge(((split = element.split(':')) ... | [
{
"docid": "f762051b27e5c662342dd79a22362c20",
"score": "0.6383714",
"text": "def read_metadata\n Merb.logger.info \"#{self.key}: Reading metadata of video file\"\n \n inspector = RVideo::Inspector.new(:file => self.tmp_filepath)\n \n raise FormatNotRecognised unless inspector.valid? and ... |
aaece6ce10c84fbdeebae3e13a738c36 | Whatever you say to grandma, she should respond with HUH?! SPEAK UP, SONNY! unless you shout it (type in all capitals). If you shout, she can hear you (or at least she thinks so) and yells back NO, NOT SINCE 1938! However if you say 'I LOVE YOU GRANDMA!', she should respond with 'I LOVE YOU TOO PUMPKIN!' | [
{
"docid": "c4c4b6f0f8342f22d62f582cdbf07b0b",
"score": "0.6600456",
"text": "def speak_to_grandma(str)\n if str != str.upcase\n return \"HUH?! SPEAK UP, SONNY!\"\n elsif str == \"I LOVE YOU GRANDMA!\"\n return \"I LOVE YOU TOO PUMPKIN!\"\n elsif str == str.upcase\n return ... | [
{
"docid": "c0d085b013efe8ef5675b9c9508721f1",
"score": "0.7311017",
"text": "def coach_answer(your_message)\n if your_message.downcase == \"i am going to work right now!\"\n ''\n elsif your_message.end_with?(\"?\")\n \"Silly question, get dressed and go to work!\"\n else\n \"I d... |
bd5f40f0e982526b56d6f5aa354e5d10 | Define an event. This takes a block which describes all valid transitions for this event. Example: class Order :open state :open state :closed event :close_order do transitions :to => :closed, :from => :open end end +transitions+ takes a hash where :to is the state to transition to and :from is a state (or Array of sta... | [
{
"docid": "5ef7b60c6ff37b0627971022dcc26524",
"score": "0.6593622",
"text": "def event(event, &block)\n class_eval <<-EOV\n def #{event.to_s}!\n next_states = next_states_for_event(:#{event.to_s})\n #p \"available states insid \\#{self.class}: \\#{next_states.inspe... | [
{
"docid": "8e41cf4beae90d08fe5441ecd457648e",
"score": "0.75292516",
"text": "def event(name, &block)\n name = name.to_s\n event = events[name] ||= Event.new(self, name)\n event.instance_eval(&block)\n \n # Record the states so that the machine can keep a list of all ... |
3ef9d6b58ac24ec2919ea1e9c7d8ac80 | Bonus: When printing out candidates, colour the output based on their qualification (green for qualified, red for unqualified) | [
{
"docid": "4e7d224d1f073ebf9dda97b3907c83b5",
"score": "0.7654242",
"text": "def qualified_color(candidates)\n candidates.each do |candidate| \n if experience?(candidate) && languages?(candidate) && last_15_days?(candidate) && over_17?(candidate)\n puts candidate.to_s.green\n else\n pu... | [
{
"docid": "35c18d101efbf88ad69062a1d83845b1",
"score": "0.6179352",
"text": "def print_candidates(candidates)\n puts \"----- Starting search -----\"\n if candidates.empty?\n puts \"Couldn't find candidate. Are you sure that's a proper ID integer?\"\n else\n begin\n candidates.each do |can... |
9a076e688b827a9ac37d5b32535a4a02 | This method will convert hours decimal into a Time object and let you see H:M:S format | [
{
"docid": "bc17e642666acfb3b25975d738f154ae",
"score": "0.66856194",
"text": "def decimal_to_strf(time_in)\r\n t = Time.now\r\n year = t.year\r\n month = t.month\r\n day = t.day\r\n hours = Integer(time_in)\r\n decimal_minutes = (time_in - hours) * 60.0\r\n minutes = Integer(decimal_minutes)\r\n... | [
{
"docid": "c67e2ac6f18ce639ecc2aa2ecf56d016",
"score": "0.7542518",
"text": "def convert_to_time_notation\n s = @seconds\n if @seconds > 3600\n formatted_time = \"%02d:%02d:%02d\" % [s / 3600, s / 60 % 60, s % 60]\n else\n \"%02d:%02d\" % [s / 60 % 60, s % 60]\n # Time.at(@secon... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "8b9970da2e9c1ef3ca0d6b6ce265991a",
"score": "0.0",
"text": "def relationship_params\n params.require(:relationship).permit(:follower_id, :followed_id)\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.69792545",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6781151",
"text": "def strong_params\n params.requ... |
80dca64018261f1539e4404bdf1469e7 | all collections, including retired | [
{
"docid": "40beb452d8c9985927e36277a56d83d5",
"score": "0.0",
"text": "def collections_count\n Collection.count(:all, :joins => :plugin, :conditions => { :plugins => { :content_provider_id => self.id } })\n end",
"title": ""
}
] | [
{
"docid": "df924a87946808cda796790f2104ed7c",
"score": "0.7772329",
"text": "def collections; end",
"title": ""
},
{
"docid": "17a53ca76deefefedf85f3ab4f14d1fd",
"score": "0.7504767",
"text": "def collections\n return self.root_collection.subcollections\n end",
"... |
3d5d9daa453e5bdf694088f7938dca45 | Returns a hash with the following fields: Available_MB, Total_MB, Percent_Free | [
{
"docid": "fd5f9848cac5f642c1482b8f7a092ec1",
"score": "0.0",
"text": "def get_sql_disk_space(connection_string, target_folder)\n sql_script = ::File.read(\"#{sql_script_dir}/Status/DiskSpace.sql\")\n execute_query(connection_string, sql_script, return_type: :first_row, values: { 'targetfolder' =... | [
{
"docid": "0ec334719b13d9055a01ccf910212cff",
"score": "0.71960974",
"text": "def free_space\n sum = 0\n\n mount_points.each do |mount_point, values|\n sum += RelayRegister::Converter.convert_to_gb(values['size_available'])\n end\n\n \"#{sum.round(1)} GB\"\n end",
"title": ""
},... |
0c0b9dba5a29c924d5b94db696965974 | I have no value | [
{
"docid": "171434061a4f67f870369fc3d01c6002",
"score": "0.73252785",
"text": "def value\n nil\n end",
"title": ""
}
] | [
{
"docid": "dc038ab791dc8d56c5f2ea35e3167f38",
"score": "0.7321413",
"text": "def value\n nil\n end",
"title": ""
},
{
"docid": "dc038ab791dc8d56c5f2ea35e3167f38",
"score": "0.7321413",
"text": "def value\n nil\n end",
"title": ""
},
{
"docid": "0f... |
2aeb466d4f1c4c77646836a5095ac0c3 | sourceID ==== DESCRIPTION The source ID of the object. ==== RETURNS I4(Fixnum) | [
{
"docid": "020ed4e36da9bacd7486cb4ebe59f151",
"score": "0.795015",
"text": "def source_id\n @ole.sourceID\n end",
"title": ""
}
] | [
{
"docid": "20db91178d78e19a94f96034a59fb2a2",
"score": "0.78595",
"text": "def source_id\n return @source_id\n end",
"title": ""
},
{
"docid": "678451913a57a40fa61faa7ad0b7bbcf",
"score": "0.76061255",
"text": "def source_id=(value)\n @source... |
5bce6c7988036945c1f1b6590297af6a | GET /admin/vle_documents/1 GET /admin/vle_documents/1.xml | [
{
"docid": "791fdf453e5b3044b9013d67e6473a55",
"score": "0.7376935",
"text": "def show\n @vle_document = VleDocument.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vle_document }\n end\n end",
"title": ""
}
] | [
{
"docid": "7046787db45a222cc4baa40023c674cd",
"score": "0.7123253",
"text": "def xml = \"docs/index.xml\"",
"title": ""
},
{
"docid": "17efbf71a836c2bfe11c134c79aedb5b",
"score": "0.7055299",
"text": "def index\n @documents = @account.documents.desc\n\n respond_to do |format|... |
046b972c394b632e43d1b632073df52f | POST /forms POST /forms.json | [
{
"docid": "646e4af4c3f7454f6b05c98573e37bcd",
"score": "0.6562657",
"text": "def create\n @form = Form.new(params[:form])\n\n respond_to do |format|\n if @form.save\n format.html { redirect_to edit_form_path @form, notice: 'Form was successfully created.' }\n format.json { rend... | [
{
"docid": "2969547820c893e146806ae4361ab418",
"score": "0.7203528",
"text": "def create_form(form_id, request)\n start.uri('/api/form')\n .url_segment(form_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .post()\n .go()\n end",
"title": ""... |
b0908793a57c4a99e9a333dce7c2a686 | Update a 'firmware.SasExpanderDescriptor' resource. | [
{
"docid": "53459f67c79d9a2fa8d3404ca47f110c",
"score": "0.685581",
"text": "def update_firmware_sas_expander_descriptor(moid, firmware_sas_expander_descriptor, opts = {})\n data, _status_code, _headers = update_firmware_sas_expander_descriptor_with_http_info(moid, firmware_sas_expander_descriptor,... | [
{
"docid": "c2124e2dd38aa546ccd1dd347de0b10d",
"score": "0.6482579",
"text": "def patch_firmware_sas_expander_descriptor(moid, firmware_sas_expander_descriptor, opts = {})\n data, _status_code, _headers = patch_firmware_sas_expander_descriptor_with_http_info(moid, firmware_sas_expander_descriptor, ... |
eed557c61602d8751ef60f27c544eff0 | Get name of support task | [
{
"docid": "45fc1dccd28fa8980a17f915fead0b55",
"score": "0.6469286",
"text": "def task_name(verb_stage)\n case ENV[\"RUM_TASK_NAMES\"]&.upcase\n when \"STAGE_FIRST\" then verb_stage.first.reverse\n when \"VERB_FIRST\" then verb_stage.first\n else verb_stage.first\n end.joi... | [
{
"docid": "fd260310fed609239bbb675d7260d3c5",
"score": "0.8277937",
"text": "def name\r\n return @task_name \r\n end",
"title": ""
},
{
"docid": "072f0f0ac888394b1f7b81e7c5285701",
"score": "0.81939524",
"text": "def name\n task.name\n end",
"title": ""
},
{
... |
d89a8de5bb789aba0655267e422c601e | Set preference pref in prefs section prefs_section to value specified. TODO: This needs to be moved to a separate preference section. | [
{
"docid": "022e7585aa81af6adbe75a5f487a2b4b",
"score": "0.8426259",
"text": "def set_preference(prefs_section, pref, value)\n @driver.setPref(prefs_section, pref, value.to_s)\n end",
"title": ""
}
] | [
{
"docid": "85977f3feab3c7f81dc5bd93c0ff04ef",
"score": "0.6645793",
"text": "def set_pref(key, value)\n success = _set_pref(key, value)\n @prefs_cache[key] = value if success\n success\n end",
"title": ""
},
{
"docid": "73e36466c19557b8b11b450648a2d78f",
"score": "0.65... |
117365f9332001e66fac49da252e0838 | Calculate response count for a question based on empty_response_character | [
{
"docid": "5f2feb9e719e63b733c6364ee85c956d",
"score": "0.83676445",
"text": "def find_number_of_responses(question)\n empty_response_character=''\n case question.question_type.q_type\n when \"TextBox\", \"TextArea\", \"Rating\" # For ratings, we count responses for comments instead of dropd... | [
{
"docid": "a36a73a75f0c3723df15ce7284ad0422",
"score": "0.8301042",
"text": "def find_number_of_responses(question)\n empty_response_character = ''\n case question.question_type.q_type\n when \"TextBox\", \"TextArea\", \"Rating\" # For ratings, we count responses for comments instead of dropdo... |
fba80842a2f01e56d0fd638fad351ffb | Takes the array of muscle groups from params and formats it for our database | [
{
"docid": "582063734a03c957e3af65fceda80094",
"score": "0.68202096",
"text": "def update_muscle_groups groups\n groups = {} unless groups.is_a?(Hash)\n groups.symbolize_keys\n self.muscle_groups = \"\"\n Activity::MUSCLE_GROUP_VALUES.each do |name|\n bit = groups[name] == \"1\" ? \"1\"... | [
{
"docid": "ca034cea187f1875441c5485a1ff6ce3",
"score": "0.63260436",
"text": "def groups(*groups); end",
"title": ""
},
{
"docid": "ca034cea187f1875441c5485a1ff6ce3",
"score": "0.63260436",
"text": "def groups(*groups); end",
"title": ""
},
{
"docid": "92a65f32bf7c046b3b... |
1e0e8a7474657649b08a96ba8815f0dc | DELETE /orders/1 DELETE /orders/1.json | [
{
"docid": "c11017741232f15b76427cbdddd90f0a",
"score": "0.0",
"text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url, notice: 'Order was successfully destroyed.' }\n format.json { head :no_content }\n end\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... |
4e250865a4b2635295f6c55a60d34394 | Shows on particular movie object | [
{
"docid": "f2a7565c06f15cb740549c94c4d5fe67",
"score": "0.6717275",
"text": "def show\n\t\tmr = MovieRetriever.new\n\t\t@movie = mr.get_movie(params[:id])\n\t\t@movie[\"ratings\"] = Rating.by_movie(params[:id])\n\t\t@movie[\"reviews\"] = Review.by_movie(params[:id])\n\n\t\tif params[\"page\"].to_i >= 2... | [
{
"docid": "4fa4ba203b718fb50c9281c6d494c958",
"score": "0.73886436",
"text": "def show\n @imdb_movie = Movie.find(params[:id])\n end",
"title": ""
},
{
"docid": "29a579b3656ccdc8837df9fbb03cc0ea",
"score": "0.737448",
"text": "def show\n @movie = Movie.find(params[:id])\n en... |
7d96df5482ac17cdfc28d2a48ae5363d | Used to load and initialize data for databinding | [
{
"docid": "62512a055afbe538d0fd66521630b8ab",
"score": "0.0",
"text": "def details\n @vouch_list = VouchList.find(params[:id])\n render json: {\n title: @vouch_list.title,\n items: @vouch_list.items_formatted\n }\n end",
"title": ""
}
] | [
{
"docid": "8c8a872a76e746b282b6333438bbcf97",
"score": "0.6786686",
"text": "def init_data\n end",
"title": ""
},
{
"docid": "5eb4f4d273c0f594f4f97460640e0072",
"score": "0.6770922",
"text": "def initialize\n super()\n init_data()\n end",
"title": ""
},
{
... |
cd312a0ca0be40f9b834bcfc2c6532f8 | Calculate the avarage vote of all children | [
{
"docid": "c7cce6d07a22bb5b8169895e29618f7f",
"score": "0.8287264",
"text": "def vote\n vote = 0\n self.children.each { |c|\n vote = vote + c.vote\n }\n if self.children.size > 0\n (vote / self.children.size)\n else\n vote\n end\n end",
"title": ""
}
] | [
{
"docid": "fe74e43f1c0e1c1ade0aca4d8651f5be",
"score": "0.6592061",
"text": "def vote_sum\n sum = 0.0\n votes.each do |v|\n sum += v.value\n end\n sum\n end",
"title": ""
},
{
"docid": "77f4fa8e4eb3ad84edf6e1ae83047f14",
"score": "0.6569757",
"text": "def total_vot... |
c74e45084e59b745fef435596d639632 | Convert this array to an range index against the spec. | [
{
"docid": "2d2b9b0e4f85cdf5da70b233b0e82940",
"score": "0.747883",
"text": "def to_index_range(spec)\r\n spec_max = spec.max\r\n\r\n self.collect do |value|\r\n value = Integer(value)\r\n value = spec_max + value + 1 if value < 0\r\n\r\n unless spec === value\r\n fail IndexE... | [
{
"docid": "a0da803c2cb505349766b250bafc96d1",
"score": "0.76162934",
"text": "def to_index_range(spec)\r\n if self == :all\r\n spec.range\r\n else\r\n fail IndexError, \"Invalid subscript: #{self.inspect}\"\r\n end\r\n end",
"title": ""
},
{
"docid": "19729686e7980f55598... |
9f494437a08309e39397f0c575f81bd3 | Publish any pending changes to the zone required to make any alterations permanent. See: | [
{
"docid": "2d30a76dd9c6a853759a74564abba533",
"score": "0.7240671",
"text": "def publish\n @dyn.put(\"Zone/#{@zone}\", { \"publish\" => true })\n end",
"title": ""
}
] | [
{
"docid": "8fc6d64a8a5f3409a66f1c808fa40bfd",
"score": "0.6662822",
"text": "def publish(zone=nil)\n zone ||= @zone \n put(\"Zone/#{zone}\", { \"publish\" => true })\n end",
"title": ""
},
{
"docid": "9fcd0280d86e37600158f4d04d0d1752",
"score": "0.6572564",
"text": "def apply... |
4dbf9f24d497548292df6f9f71115ca0 | GET /version_comments/1 GET /version_comments/1.json | [
{
"docid": "6b6f5eb075227caf14037511af47e4c6",
"score": "0.7715775",
"text": "def show\n @version_comment = VersionComment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @version_comment }\n end\n end",
"title": ""
}
] | [
{
"docid": "d4339fde446ae962647ec19bcf5c0609",
"score": "0.7780798",
"text": "def index\n @version_comments = VersionComment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @version_comments }\n end\n end",
"title": ""
},
{
"doci... |
52a70ceb99842fd8ff0d330cddd43024 | Create a new subscription to a live stream or historics query Possible params are hash, historics_id, name, output_type, initial_status, start, end and output_params. where output_params. depends on the output_type for specific options see the documentation at For a list of available connectors see | [
{
"docid": "44ca136a0b850b5bbf1dfee7f09537ee",
"score": "0.0",
"text": "def create(params)\n DataSift.request(:POST, 'push/create', @config, params)\n end",
"title": ""
}
] | [
{
"docid": "49f5ca4a38ed0493f5052503cbcf5a48",
"score": "0.66830814",
"text": "def subscribe(hash_type, hash, name)\n\t\t\tbegin\n\t\t\t\t# API call parameters\n\t\t\t\tparams = {\n\t\t\t\t\t'name' => name,\n\t\t\t\t\thash_type => hash,\n\t\t\t\t\t'output_type' => @output_type\n\t\t\t\t}\n\t\... |
9360f7f2853908bb89b69de1f1ed3a00 | Initializes a living or dead cell. | [
{
"docid": "cb79b08c2c87e42997b65fb877ef9b0b",
"score": "0.0",
"text": "def initialize(alive = false)\n @alive = alive\n self\n end",
"title": ""
}
] | [
{
"docid": "c4f5ebf35a44daf5b8f31689a752f6c5",
"score": "0.75026655",
"text": "def initialize(x=0,y=0)\n @x = x\n @y = y\n #default as dead cell\n @alive = false\n end",
"title": ""
},
{
"docid": "6ca6530933fd4dd740c64c3896273425",
"score": "0.7290966",
"text": "def init... |
5ffeacd67e46e579a4c85cd407a20bf4 | Get role Get the details of the specified role. To see all the roles, use [List roles](operation/getAllRoles). | [
{
"docid": "6810753177d5b363d4a24ad230dac89a",
"score": "0.7163058",
"text": "def get_role(role_id, opts = {})\n data, _status_code, _headers = get_role_with_http_info(role_id, opts)\n data\n end",
"title": ""
}
] | [
{
"docid": "dcaf6ea3f33594500edfa394d7fa2c98",
"score": "0.78039527",
"text": "def get_role(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'GetRole'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'https'\n\t\tif optional.key? :_meth... |
efe64621e0347b363d38886d43fc8fd2 | Retrieve head node ip and dns from file (HIT only) | [
{
"docid": "eefcb3587aeef43ce463f6db310d2aa3",
"score": "0.72162396",
"text": "def hit_head_node_info\n head_node_private_ip_file = \"#{node['cfncluster']['slurm_plugin_dir']}/master_private_ip\"\n head_node_private_dns_file = \"#{node['cfncluster']['slurm_plugin_dir']}/master_private_dns\"\n\n [IO.r... | [
{
"docid": "38411b5cb6b6de6fcd1083e930561ad1",
"score": "0.7285867",
"text": "def hit_head_node_info\n head_node_private_ip_file = \"#{node['cluster']['slurm_plugin_dir']}/head_node_private_ip\"\n head_node_private_dns_file = \"#{node['cluster']['slurm_plugin_dir']}/head_node_private_dns\"\n\n [IO.re... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "7d1ac5f4f77d6710e33cec33f455cef3",
"score": "0.0",
"text": "def update!(**args)\n @taxonomies = args[:taxonomies] if args.key?(:taxonomies)\n end",
"title": ""
}
] | [
{
"docid": "184b1b1ed771473d3eb9f338c0734c38",
"score": "0.73066413",
"text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end",
"title": ""
},
{
"docid": "5076c5a88404ae72986f958710f5687a",
"score": "0.72631145",
"text": "def update... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "f7b320218b105715392e4c85ad53d5a6",
"score": "0.0",
"text": "def set_good_to_know\n @good_to_know = GoodToKnow.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60339844",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6014297",
"text": "de... |
e900370103e9fc47ed95203b94cddc77 | POST /boards POST /boards.json | [
{
"docid": "20e8bb00ac6f77496738d98551fed60d",
"score": "0.67380357",
"text": "def create\n @board = Board.new(board_params)\n @board.user_id = current_user.id\n\n respond_to do |format|\n if @board.save\n format.html { redirect_to user_board_path(current_user.id, @board), notice: '... | [
{
"docid": "b4f5ee6c8a5177684991f33fc1bf8b64",
"score": "0.723541",
"text": "def create\n @board = Board.new(params[:board])\n\n respond_to do |format|\n if @board.save\n format.html { redirect_to @board, :notice => 'Board was successfully created.' }\n format.json { render :jso... |
37d8db642b8776e33b97623f9ca6b171 | :nodoc: get_color(colour) Used in conjunction with the set_xxx_color methods to convert a color string into a number. Color range is 0..63 but we will restrict it to 8..63 to comply with Gnumeric. Colors 0..7 are repeated in 8..15. | [
{
"docid": "02d7fcb5b9d070e4a9fb92636b710638",
"score": "0.7751946",
"text": "def get_color(color = nil) # :nodoc:\n if color.respond_to?(:to_int) && color.respond_to?(:+)\n # the default color if arg is outside range,\n if color < 0 || 63 < color\n 0x7FFF\n # or an index < 8 ma... | [
{
"docid": "82c202c66f7ee9183fe3dc662e0cbbc2",
"score": "0.75287515",
"text": "def to_rgb(colour)\n case colour\n when :red\n :'#FF0000'\n when :blue\n :'#0000FF'\n when :green\n :'#00FF00'\n when :white\n :'#FFFFFF'\n when :black\n :'#000000'\n else\n colour\n end.to_s.delete(... |
e54027939b4ae788509d56c1f129b66f | p uncompress('a2b4c1') 'aabbbbc' p uncompress('b1o2t1') 'boot' p uncompress('x3y1x2z4') 'xxxyxxzzzz' | [
{
"docid": "a93376cd8868fca34e17821d8348ec1a",
"score": "0.0",
"text": "def conjunct_select(arr, *procs)\n arr.select { |el| procs.all? { |prc| prc.call(el) } }\nend",
"title": ""
}
] | [
{
"docid": "89df348329e3d5fdc5e34f82d8fb2a52",
"score": "0.6728213",
"text": "def uncompress(str)\n output = \"\"\n (0...str.length).step(2).each do |idx|\n str[idx+1].to_i.times { output += str[idx] }\n end\n output\nend",
"title": ""
},
{
"docid": "9456b3afdf64adcf2562412bcaee0179",... |
224b5bfcf35f66283a65477fcdbe403c | DELETE /availabilities/1 DELETE /availabilities/1.json | [
{
"docid": "673a02a4ab7186f6c4a123ce26ab810d",
"score": "0.7168745",
"text": "def destroy\n @availability = Availability.find(params[:id])\n @availability.destroy\n\n respond_to do |format|\n format.json { head :ok }\n end\n end",
"title": ""
}
] | [
{
"docid": "e085afb149664e8601dece44d7a1f210",
"score": "0.7428785",
"text": "def destroy\n @availibility.destroy\n respond_to do |format|\n format.html { redirect_to availibilities_url, notice: 'Availibility was successfully destroyed.' }\n format.json { head :no_content }\n end\n e... |
92f96b010f988b08b6a6882520f3a5aa | Runs each stage of the generator, returning the resulting structure. | [
{
"docid": "a19f3ef0ee368258f7dddca55e59be4d",
"score": "0.6820548",
"text": "def generate\r\n Logger.echo 1, \"Beginning world generation\"\r\n @stages.each do |stage|\r\n Logger.echo 2, \"Running #{stage.name}\"\r\n stage.run @data\r\n end\r\n Logger.echo 1, \"World generation co... | [
{
"docid": "a059839851abb196f51c96d121b297fa",
"score": "0.6793138",
"text": "def yields\n parsed {\n @yields\n }\n end",
"title": ""
},
{
"docid": "a059839851abb196f51c96d121b297fa",
"score": "0.6793138",
"text": "def yields\n parsed {\n @yields\n ... |
08c44e819a6a2e013973056f22496e4a | Checks if the current user is an admin | [
{
"docid": "2ee4b7cb9f275996c127dbdfe1fc31bb",
"score": "0.0",
"text": "def admin_user\n if current_user.blank?\n store_location\n flash[:error] = 'You must be an admin to perform this action.'\n redirect_to login_path\n elsif !current_user.is_admin?\n flash[:error] = 'You must... | [
{
"docid": "2e96b2e8b9aab4d0cd14044ba12e415f",
"score": "0.8922141",
"text": "def admin?\n\t\t\tcurrent_user && current_user.username == \"admin\"\n\t\tend",
"title": ""
},
{
"docid": "1f557b7c4d248ade0861af1d8b49aea7",
"score": "0.88953876",
"text": "def admin_user?\n current_u... |
0662991e46b23ec947d699ff8580d186 | iterate through hash table instead | [
{
"docid": "8d5086e01f8be5aa6cb4b8f5cb07a26e",
"score": "0.0",
"text": "def translateDoc(fileName)\n\t\tt = Time.now\n\t\tfile = File.open( fileName , \"r+\")\n\t\toutput = file.read\n\t\toutput.split.uniq.each do |word|\n\t\t\tif @@dictionary.has_key?(word)\n\t\t\t\toutput.gsub!(/(\\s)(#{word})(\\s)/, ... | [
{
"docid": "644c9f5cbd26abdce442cbe57702a2f3",
"score": "0.75910383",
"text": "def each_hash; end",
"title": ""
},
{
"docid": "c70dff78779129aa1d20400b691fa23d",
"score": "0.7471045",
"text": "def each \r\n\t\t@table.each do |hashkeys|\r\n\t\t\tif hashkeys != nil\r\n\t\t\t\tyield has... |
f7ce63b11629bc3a921d87dad4b69be1 | (2 24 60 60) | [
{
"docid": "be20268c2ba2bbeb21a165ac265e6501",
"score": "0.0",
"text": "def initialize(type)\n\t\tsuper\n\t\t@current_week_start = nil\n\tend",
"title": ""
}
] | [
{
"docid": "f499519904b34ce9c9db5e7d9e316249",
"score": "0.74169785",
"text": "def one_hour\n return 60 * 60\n end",
"title": ""
},
{
"docid": "f499519904b34ce9c9db5e7d9e316249",
"score": "0.74169785",
"text": "def one_hour\n return 60 * 60\n end",
"title": ""
},
{
... |
46b466f0391c47a384c5b282a67b1b93 | Workaround for Braid writing .braids.json with LF line endings on Windows, while the .braids.json files in the fixtures get converted to CRLF under Git for Windows recommended settings. | [
{
"docid": "d737cce59a09ccb2d0401dee17419b52",
"score": "0.51338685",
"text": "def assert_no_diff_in_braids(file1, file2)\n # --ignore-trailing-space is not present in the platform diff command under osx so only use it when needed\n assert_no_diff(file1, file2, Gem.win_platform? ? '--ignore-traili... | [
{
"docid": "85d49120de186245d74bddfd13d61e76",
"score": "0.6034016",
"text": "def gitFixCRLFEndings(fileToCheckWith)\n runOpen3Checked 'git', 'config', 'core.autocrlf', 'off'\n\n puts 'Deleting files and re-checking them out'\n `git ls-files`.strip.lines.each do |f|\n f = f.chomp.strip\n\n File... |
0d9c52f4b54b935403e03566ca023bcd | POST /english_country_residences POST /english_country_residences.json | [
{
"docid": "9be9ee858dc49232627b9ab76a9dcd6d",
"score": "0.7912656",
"text": "def create\n @english_country_residence = EnglishCountryResidence.new(english_country_residence_params)\n\n respond_to do |format|\n if @english_country_residence.save\n format.html { redirect_to @english_cou... | [
{
"docid": "bef3deea58517db728b110e1bc89c5ed",
"score": "0.74613255",
"text": "def english_country_residence_params\n params.require(:english_country_residence).permit(:name)\n end",
"title": ""
},
{
"docid": "9e93bb975891437afe83b0c824e8eea9",
"score": "0.7225076",
"text": "... |
528c278ef9991ca6ca80b4452fe7c6b1 | Internal: Log an error for the worker, outputting the entire error stacktrace and applying the appropriate log level. exception An Exception object. Returns nothing. | [
{
"docid": "64081ceacf53738b0be757d9f2995ae3",
"score": "0.7029447",
"text": "def error(exception)\n log exception, :error\n end",
"title": ""
}
] | [
{
"docid": "db9d8afe82a018a06e75fa87117a093c",
"score": "0.76552767",
"text": "def log_exception(e)\n Worker.logger.error(\"! [#{Worker.name}] #{name} failed with #{e.class.name}: #{e.message} - #{attempts} failed attempts\")\n Worker.logger.error(e)\n end",
"title": ""
},
{
"do... |
9228db8e1a9ae856221b29848ea64c87 | This method adds a HeapNode instance to the heap Time Complexity: O(log(n)) Space Complexity: 0(1) | [
{
"docid": "7a2db255c8b31052f072bec5b47aeec9",
"score": "0.75254077",
"text": "def add(key, value = key)\n @store << HeapNode.new(key, value)\n heap_up(@store.length - 1)\n end",
"title": ""
}
] | [
{
"docid": "754be4fee4ef4f75f14559b03e34d281",
"score": "0.7686515",
"text": "def add(key, value = key)\n node = HeapNode.new(key, value)\n @store << node\n\n new_idx = @store.length - 1\n heap_up(new_idx) if @store.length > 1 # heap up only if there is something to sort\n end",
"title"... |
c730e62fddbb0c5ef1ee04a8a311a7d1 | Allows the user to reconfigure the Karafka application if this is needed. (eg. to set some rubykafka driver default settings, etc) | [
{
"docid": "e5b43b49ca634f3538dd3f1e53bba4a5",
"score": "0.0",
"text": "def configure(&block)\n setup(&block)\n self\n end",
"title": ""
}
] | [
{
"docid": "0f26921eaa6468f0abbafe7ac0536c05",
"score": "0.6690843",
"text": "def set_defaults\n set_if_empty :karafka_role, :karafka\n set_if_empty :karafka_processes, 1\n set_if_empty :karafka_consumer_groups, []\n set_if_empty :karafka_default_hooks, -> { true }\n set_if_empt... |