query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
e02922ae1ae44e3fb5b91047881ba233
Define a transformation of SSH connection. Parameters:: transform (Proc): Code to be called to transform an SSH connection (see ssh_connection_transforms signature for details)
[ { "docid": "aa78f703bbf698623c90f837df3ca625", "score": "0.82799196", "text": "def transform_ssh_connection(&transform)\n @ssh_connection_transforms << {\n nodes_selectors_stack: current_nodes_selectors_stack,\n transform: transform\n }\n end", ...
[ { "docid": "004f513bcb3fa5c4bd6a3b1a7f6e0940", "score": "0.6154022", "text": "def transform(transform)\n end", "title": "" }, { "docid": "004f513bcb3fa5c4bd6a3b1a7f6e0940", "score": "0.6154022", "text": "def transform(transform)\n end", "title": "" }, { "docid": "75e73f...
a3bc994b04fdac2e9f24ade3938f29b6
Determines, if a document element has mixed content. element:: Document element to be checked.
[ { "docid": "39d1c55502497197a5126bb58212bd3d", "score": "0.78508866", "text": "def has_mixed_content?(element)\n if element.has_text? && element.has_elements?\n return true if element.texts.join('') !~ /^\\s*$/s\n end\n false\n end", "title": "" } ]
[ { "docid": "0bdf2c861a7c60024fa9d34cd569f1f7", "score": "0.68342996", "text": "def empty_content?(element); end", "title": "" }, { "docid": "01893428a6d4c14fbceb91901e03dcc5", "score": "0.67523193", "text": "def can_contain?(element)\n [String, BeginPairedTag, EndPairedTag, Isol...
0cec3750c20d432b26bd48879502dc0c
Is the name of this Field +name+? Names are case insensitive.
[ { "docid": "500e171b0e3911cbca3bcff73e5b9086", "score": "0.7723289", "text": "def name?(name)\n @name.casecmp(name) == 0\n end", "title": "" } ]
[ { "docid": "713ae0ae03978897c009a5fb0a283aab", "score": "0.74688864", "text": "def matches(name)\n self.name.downcase == name.strip.squeeze(' ').downcase\n end", "title": "" }, { "docid": "ded8480be7f1dcd3396dcda4934882ba", "score": "0.74321485", "text": "def name_all_upcase?...
466656eb3cecb27d0ea4f1ece08d4ebb
PATCH/PUT /customers/1 PATCH/PUT /customers/1.json
[ { "docid": "28cba5164b38d9065801539ecfce44c2", "score": "0.669213", "text": "def update\n respond_to do |format|\n if @customer.update(customer_params)\n format.html { redirect_to @customer, notice: 'Customer was successfully updated.' }\n format.json { head :no_content }\n el...
[ { "docid": "2c60a533470d8275139b2f9c3fe9d1a4", "score": "0.6988014", "text": "def update_customer(id, data)\n put(\"customers/#{id}\", { body: data })\n end", "title": "" }, { "docid": "ac41031ab91b76149b7c7ee5a812520d", "score": "0.6921667", "text": "def update\n @customer = ...
45d1aa141419e682c8953be2045ed41a
Execute _file_ with Adobe AIR adl The JSpec lib must be located beneath the spec folder. This is necessary because Adobe AIR can't reference any files above it's application.xml file.
[ { "docid": "a4c7216a5cb7875708f85b48d9db7bda", "score": "0.75697494", "text": "def air file\n jslib = normalize(\"lib\")\n if !File.exist?(jslib)\n begin \n puts \"Can't find #{jslib} necessary for Adobe AIR adl execution.\"\n\t\t print \"Would you like to (c)opy or (s)ymlink...
[ { "docid": "f50722a856faefaa84d105c64734c83d", "score": "0.5829281", "text": "def run_android(test_file = nil)\n wait_for_valid_device\n cmd = 'bundle exec ruby ./lib/run.rb android'\n cmd = %(#{cmd} \"#{test_file}\") if test_file\n bash cmd\nend", "title": "" }, { "docid": "682700bb094a...
9ff155f4bd0ba2738ff21bb94dc25217
GET /user_details/new GET /user_details/new.json
[ { "docid": "50f7993dbbf653252f7b81f1b839640d", "score": "0.8077881", "text": "def new\n @user_detail = UserDetail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user_detail }\n end\n end", "title": "" } ]
[ { "docid": "10579c3d3cc989fec15a1ace9f9c505e", "score": "0.81649816", "text": "def new\n @newuser = Newuser.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newuser }\n end\n end", "title": "" }, { "docid": "4e4b24e3210b5e180709274...
df422a68f241b7f8e3f42821234f8dae
This test is identical to the one found in Rails, save for the fact that transactions are turned off for test runs. It is necessary to disable transactional tests in order to assert on schema changes due to how CockroachDB handles transactions.
[ { "docid": "a89cbe2adefbd9ac2ac5c1cc01812224", "score": "0.0", "text": "def test_create_and_drop_join_table_with_common_prefix\n with_table_cleanup do\n connection.create_join_table \"audio_artists\", \"audio_musics\"\n assert connection.table_exists?(\"audio_artists_music...
[ { "docid": "d399750608abd7bd027272b7e1d36f89", "score": "0.7361274", "text": "def test_transaction_commit_cycle\n DataStore::Transaction::start\n @attributes = {x: 1, y: 2}\n @record = TestModel.create(@attributes) \n DataStore::Transaction::commit \n saved_rec = TestModel.get(@reco...
391570e57183d8ee8f1064f051c412e1
returns an array of models (using the name of this controller)
[ { "docid": "6044583e2718eacb164ee0f260094821", "score": "0.6619579", "text": "def fetch_model_list\n if parent_model\n return parent_model.send(\"#{model_name.pluralize.downcase}\")\n else\n return model_name.camelize.constantize.find(:all)\n end\n end", "title": "" } ]
[ { "docid": "96f464394e5fa38a3b1f65640185d354", "score": "0.82054937", "text": "def get_models\n eval \"@#{controller_name} = #{controller_name.singular.camelcase}.all\"\n end", "title": "" }, { "docid": "550df099463e4b0a977254c11b470992", "score": "0.753711", "text": "def models\...
b8889a94da262a4da5ad26c5c533f630
Sets the attribute default_query_parser
[ { "docid": "369dc37e81a342135b94bc451c1154bb", "score": "0.8477585", "text": "def default_query_parser=(_arg0); end", "title": "" } ]
[ { "docid": "5821dc2bf18b15953bc14a982bdf0de7", "score": "0.8205245", "text": "def default_query_parser; end", "title": "" }, { "docid": "5821dc2bf18b15953bc14a982bdf0de7", "score": "0.8205245", "text": "def default_query_parser; end", "title": "" }, { "docid": "5821dc2bf1...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "72a9eb2e3ea054fe2105ac0f1414e0eb", "score": "0.0", "text": "def set_pago\n @pago = Pago.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;...
33ace9a194db354a02549a32a5c24947
GET /dislike_counts GET /dislike_counts.json
[ { "docid": "0b65b02bb2eb8f507ecff851ef91c88a", "score": "0.77259845", "text": "def index\n @dislike_counts = DislikeCount.all\n end", "title": "" } ]
[ { "docid": "ab1f24561c2af7a0143dc63193d599be", "score": "0.69683325", "text": "def index\n @dislikes = Dislike.find_user_dislikes(params[:user_id])\n render :index\n end", "title": "" }, { "docid": "96d50e49ad7a0b53c4cc58866df38fb2", "score": "0.69387", "text": "def set_dislik...
86e765985a749404b70f841b9215ed6d
def validate_user unless current_user.posts.ids.to_s.include? params[:id] redirect_to root_path flash[:alert] = "You don't have permissions" end end
[ { "docid": "686f7bea3ebb75a62fd257f12a321072", "score": "0.0", "text": "def is_admin?\n unless current_user.admin?\n flash[:alert] = \"You dont have permissions\"\n redirect_to root_path\n end\n end", "title": "" } ]
[ { "docid": "7af2163807b4f46c12174b8c5f662041", "score": "0.7611268", "text": "def is_post_exist?\n @post = current_user.posts.where(:id => params[:id]).first\n unless @post.present?\n redirect_to user_posts_path, notice: 'You dont have access to requested post'\n end\n end", "title": ...
0dc0d688c33365b01b35880d5830fb15
Set controller variables on initialization. source://railties//lib/rails/generators/resource_helpers.rb17
[ { "docid": "3f21ca984f084ea63784f88bbfa3820a", "score": "0.0", "text": "def initialize(*args); end", "title": "" } ]
[ { "docid": "b4f00f2837270c78d9b92a5f64c3c2ec", "score": "0.693881", "text": "def init_env\n @resource_descriptions = ActiveSupport::HashWithIndifferentAccess.new { |h, version| h[version] = {} }\n @controller_to_resource_id = {}\n @param_groups = {}\n\n # what versions does the contr...
d3b01011eb8f5cde120d326f52ca4824
GET /access_rights/1 GET /access_rights/1.json
[ { "docid": "7a03784fb5be6326ba1100cd178a051f", "score": "0.73213667", "text": "def show\n @access_right = AccessRight.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @access_right }\n end\n end", "title": "" } ]
[ { "docid": "2ef188ffe1af91528c0c4370a85d206f", "score": "0.7450995", "text": "def index\n @access_rights = AccessRight.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @access_rights }\n end\n end", "title": "" }, { "docid": "d21b...
1abef5da44521bad6b85942f743cf19c
PATCH/PUT /questionarios_respostas/1 PATCH/PUT /questionarios_respostas/1.json
[ { "docid": "b2d18a7498fa7db5e4d0705d47fbab1a", "score": "0.73308593", "text": "def update\n respond_to do |format|\n if @questionario_resposta.update(questionario_resposta_params)\n format.html { redirect_to @questionario_resposta, notice: 'Questionario resposta was successfully updated.'...
[ { "docid": "cbca196c349e885e07f317fb8a2624a6", "score": "0.6923503", "text": "def update\n @respuesta = Respuesta.find(params[:id])\n\n if @respuesta.update(params[:respuesta])\n head :no_content\n else\n render json: @respuesta.errors, status: :unprocessable_entity\n end\n end", ...
82901b7953a456f896e42b8858d58cd8
Set the value of the ContentType input for this Choreo.
[ { "docid": "b36b6e9cd09befe1f01ebda8a954be9a", "score": "0.7819588", "text": "def set_ContentType(value)\n set_input(\"ContentType\", value)\n end", "title": "" } ]
[ { "docid": "4aae733f85156400844f3231e8ae9090", "score": "0.76498663", "text": "def set_ContentType(value)\n set_input(\"ContentType\", value)\n end", "title": "" }, { "docid": "4aae733f85156400844f3231e8ae9090", "score": "0.76498663", "text": "def set_ContentType(valu...
fbe0db7bc6c8116631b83520a70f60af
Return order skus along with respective quantity
[ { "docid": "04f4fd9966702ca3aa4a0f8bd25d3895", "score": "0.7914547", "text": "def item_skus_with_quantity\n line_items.map { |line| \"#{line.sku}-#{line.quantity}\" }.join(', ')\n end", "title": "" } ]
[ { "docid": "243878d0d0387ba87ee46d11eccfefa2", "score": "0.7273946", "text": "def item_skus\n line_items.map(&:sku).join(', ')\n end", "title": "" }, { "docid": "83fd6054b5ba264f4a656cd2fe4acae3", "score": "0.6873172", "text": "def product_skus_json\n @product_skus_json = ...
49d8ff24bfc9df4563f74c165d6db390
POST /presentations POST /presentations.json create a new presentation
[ { "docid": "6380bfc0246c676e60f3f2391b5606f4", "score": "0.738453", "text": "def create\n # only admins can create presentations\n redirect_to(root_path) unless current_user.admin\n\n @presentation = Presentation.new(name: presentation_params[:name])\n\n # for each key value pair from the fr...
[ { "docid": "f19be68970c2bd82090024f0c406e42b", "score": "0.8198461", "text": "def create\n @presentation = Presentation.new(params[:presentation])\n\n respond_to do |format|\n if @presentation.save\n format.html { redirect_to @presentation, notice: 'Presentation was successfully create...
a44a8a80e6146b49f7bea51fa97521ae
Method create_fake_name takes string argument create consonant and vowel reference arrays split name string by spaces swap first and last elements of array join array back into a string for each letter in string, change letter to next vowel or consonant, as appropriate return string
[ { "docid": "4ed90e1f6e248ca07dbfaa2cd8f949b3", "score": "0.0", "text": "def increment_letter_by_type(char)\n vowels = ['a', 'e', 'i', 'o', 'u']\n consonants = [*'a'..'z'] - vowels\n is_capital = ('A'..'Z').include?(char)\n char = char.downcase\n\n if vowels.include?(char)\n char = vowels[(vo...
[ { "docid": "73031c0d087f8e98c4cc206aee660616", "score": "0.82264704", "text": "def fake_name (real_name)\n\t\t# Split string into array of first and last name. Swapping the first and last name.\n\t\tnew_name = real_name.split(' ').reverse\t\t\n\n\t\t# Changing all of the vowels (a, e, i, o, or u) to the...
989200680cb8ee84d61378a27ac02d6c
Like duplicates! but does not change the receiver
[ { "docid": "041b37f0a3e801b472d831b52242ac08", "score": "0.67888755", "text": "def duplicates\r\n clone.duplicates!\r\n end", "title": "" } ]
[ { "docid": "9b51694c25a1d82c3e56d475aaaad3ef", "score": "0.676396", "text": "def & that\n (self + that).uniq\n end", "title": "" }, { "docid": "233c4eb98592dc815401395a66a6f73e", "score": "0.6642154", "text": "def duplicate\n k = self.dup\n k.items = self.items.dup\n k\n...
b36331ae88c784c7c7d1665b38a67fd3
POST /car_ratings POST /car_ratings.json
[ { "docid": "68826c449b196f3234c75063a5bc5b52", "score": "0.7208374", "text": "def create\n @car_rating = CarRating.new(car_rating_params)\n\n respond_to do |format|\n if @car_rating.save\n format.html { redirect_to @car_rating, notice: 'Car rating was successfully created.' }\n ...
[ { "docid": "3a582fff6a8a09a8e5a8d7ed38d4d8cb", "score": "0.70349836", "text": "def rate\n recipe = Recipe.find(params[:id])\n recipe.rating = params['rating']\n recipe.save\n \n respond_to do |format|\n format.html { render :json => recipe.rating }\n format.json { render :json =...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "eebb204214ffb297f4544cf1bb5c9791", "score": "0.0", "text": "def set_class_g\n @class_g = ClassG.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...
d99313b1c59ac6372237ffbf21aefce5
Clear the filter, show all rows in tree and try to reconstruct the previous collapse state
[ { "docid": "06cc03eb75ce5d5c85439a1d709c41d1", "score": "0.5849171", "text": "def clear_filter\n @filter_string = ''\n @found_count = -1\n model.refilter\n filter\n end", "title": "" } ]
[ { "docid": "fe6d6abab97832704a3e1111de0cc514", "score": "0.6184261", "text": "def filter\n @tree.filter\n end", "title": "" }, { "docid": "e696b4373f088ea9ebede1b9c8f0cb61", "score": "0.5881068", "text": "def clear_expanders\n add_actions 'ClearExpanders()'\n end"...
83b0099e435254f253fda0c292559c18
process the time params (from and to)
[ { "docid": "1d5caf3c8c5c952faec05e3e570b6551", "score": "0.7628266", "text": "def preprocess_time_params(params)\n params = params.dup\n params['from'] = Time.parse(params['from']) if params['from'].kind_of?(String)\n params['to'] = Time.parse(params['to']) if params['to'].kind_of?(Stri...
[ { "docid": "c9cc95beb9442c67bdaa922325d0feb6", "score": "0.67095804", "text": "def time\n time_parse(params[\"time\"])\n end", "title": "" }, { "docid": "55ac9d993ae7659445a3c41a30f2a493", "score": "0.6496165", "text": "def initialize_times\n if (spec = params[:time_spec])\n ...
65d9c04656776448087017f56d0a9909
=> [[1,2,3],[2,3,4]] As you can see, the lists are cascading; ie, they overlap, but never out of order.
[ { "docid": "f55f567090ea3e47061e8c73c7858705", "score": "0.0", "text": "def each_cons list, n\n list.each_cons(n).to_a\nend", "title": "" } ]
[ { "docid": "76538fad40073f56a2a7d5a19ff6ef6c", "score": "0.63046336", "text": "def merge(list1,list2)\n mixed = []\n list1.size.times do |n|\n mixed.push(list1[n])\n end\n list2.size.times do |n|\n mixed.push(list2[n])\n end\nreturn mixed.sort\nend", "title": "" }, {...
2cb3047973fff920ecbaaec8a3b59187
Creer une hypothese Retour : grille sur laquelle le jeu va "travailler"
[ { "docid": "60cfb84348233fb8692f67ab61c4e661", "score": "0.55967337", "text": "def faireHypothese()\n\n\t\tif @grillesHypothese.empty?\n\t\t\tnewGrille = YAML.load(@grillePrim.to_yaml)\n\t\t\t@grillesHypothese.push(newGrille)\n\t\telse\n\t\t\tnewGrille = YAML.load(@grillesHypothese.last.to_yaml)\n\t\t\t...
[ { "docid": "63e6ec7673aa88c4d0f8f765184ff6c9", "score": "0.64804596", "text": "def jeuTermine\n\t\tlancementAventure(@tailleGrille+1)\n\tend", "title": "" }, { "docid": "4c095bdf75270c1bbbeaa6f59eaf5b68", "score": "0.6431483", "text": "def rejeterHypothese()\n\t\t@grillesHypothese.po...
34c5d48ee49ac2dd2e539ecb6e316d87
assinged as to_i in dispatch spec but binding is a float in driver.rb
[ { "docid": "fa6c57f862d4c6057a2b862b8cc9b4b0", "score": "0.0", "text": "def add_driven_trip(trip)\n raise ArgumentError unless trip.class == Trip\n @driven_trips << trip #using the method in load trips to call\n end", "title": "" } ]
[ { "docid": "3ba8e7d6994188056c23ddf3194b3034", "score": "0.6951368", "text": "def to_i()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "3ba8e7d6994188056c23ddf3194b3034", "score": "0.6951368", "text": "def to_i()\n #This is a stub, used for i...
9fe3ea3b7950288fac4eca63c05421d5
grow/shrink_width/_height ??? Create relative rect with same or adjusted size, adjusted (or adjusted for resize direction) position, above, from_left... start with simple above, before, etc, then we'll deal with opts!!!
[ { "docid": "3e8898053952475357a01011fa9ca696", "score": "0.0", "text": "def above(further=nil)\n\t\t\tself.up(further ? self.height + further : self.height)\n\t\tend", "title": "" } ]
[ { "docid": "4ff797cf23ccce3f5541567e3890893b", "score": "0.66175663", "text": "def resize_to(width, height); end", "title": "" }, { "docid": "4ff797cf23ccce3f5541567e3890893b", "score": "0.66175663", "text": "def resize_to(width, height); end", "title": "" }, { "docid": "...
43301e0ca4b814ee57037813572f8a18
Plot the eigenfunction along the extended domain. Options mag, norm, z can be specified by using a short hand in the name of the graph, eg. efnmagnormz, efnmag, efnnorm etc. If the range is set to 0, it plots the whole eigenfunction. Otherwise it plot a small bit of it. Only specify kx or kx_index if magnetic shear is ...
[ { "docid": "5757af41ccec0630ff28bd743ef7672f", "score": "0.4876726", "text": "def efnmag_graphkit\nend", "title": "" } ]
[ { "docid": "65918b9cec9010d11e061824881ff23c", "score": "0.58432925", "text": "def eigenfunction_graphkit\nend", "title": "" }, { "docid": "6da660948123a2b40dc297b823e826bf", "score": "0.51328456", "text": "def eigensystem; end", "title": "" }, { "docid": "e851a4042cbe510...
74038a0af9d976d7bf51a62984e514e9
Instead of calling "save" directly, you should use this method to create a new revision of translation entity if you want. Only in this case "Traceable Revisions" is available. TODO: Overwrite the method "save" if record is now newly created?
[ { "docid": "bc016c5e4ae347125542b15769f090cd", "score": "0.57601994", "text": "def new_revision(attrs)\n return self.class.new(\n attrs.merge(:entity => self.entity, :language => self.language)\n )\n end", "title": "" } ]
[ { "docid": "60fc87a4a1053333bee41d2871f6e3f1", "score": "0.6391194", "text": "def make_revision()\n rev = self.revisions.create()\n rev.value_proposition = self.business_plan.plan_parts.find_by_title(\"Value Proposition\").content\n rev.revenue_streams = self.business_plan.plan_parts.find_by_t...
d73dc71f1a238ab068fa36844f10c662
GET /question_labels/1 GET /question_labels/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "976d64ebfe490268deeb24846b4edeaf", "score": "0.7037228", "text": "def index\n @question_labels = QuestionLabel.all\n end", "title": "" }, { "docid": "77f275f26cfb3285b371d3b50d6eb537", "score": "0.6887432", "text": "def get_label(label_id)\n query_and_build \"label...
350e14d1bd635183528721313769e69a
Public: Called when the player wins a game Returns nothing
[ { "docid": "cfafe0b71f7ae274405d6857096a86d2", "score": "0.7580779", "text": "def gameWon()\n\t\t@games_won += 1\n\t\t@games_played += 1\n\t\t@score = postmatchScores(@score, @expected_score, @games_played, 1)\n\tend", "title": "" } ]
[ { "docid": "d2162c67e742dd19fd47262ea280df9a", "score": "0.7856278", "text": "def player_wins\n @game_won = true\n puts 'You Win!'\n end", "title": "" }, { "docid": "97ec0331b57a65cc7b4176bb4eacc727", "score": "0.78265697", "text": "def game_won\n @place = @scores.new_score...
c5aadcceb01dc4f6172bb59ec1cec115
logout Clear our rack session BUT essentially redirect to the provider to clean up the Devise session from there too !
[ { "docid": "c64511e4ca86698e04c6f2c9572f7f70", "score": "0.7786439", "text": "def destroy\n reset_session\n flash[:notice] = 'You have successfully signed out!'\n redirect_to \"#{CUSTOM_PROVIDER_URL}/users/sign_out\" #?oauth_token=\" + get_current_user.token\n # si acum ramane pe pagina prin...
[ { "docid": "53933e1d5b477f9111ac18bdb4d68377", "score": "0.82353175", "text": "def logout\n\t\tsession[:user_id] = nil\n\t\tsession[:admin] = nil\n session[:provider] = nil\n\t\tredirect_to root_url\n\tend", "title": "" }, { "docid": "e1e7f7aaf843356f48f06db5bbc384d8", "score": "0.806...
957dd581e7303cafff8a1af561eda7bc
keep outside entities from accessing information after 'private' will return number of deaths for each state. The greater the population density then the higher the predicted deaths.
[ { "docid": "a3a0d21a4ffd6a1597b0ffa57b58c85e", "score": "0.0", "text": "def predicted_deaths\n # predicted deaths is solely based on population density\n if @population_density >= 200\n number_of_deaths = (@population * 0.4).floor\n elsif @population_density >= 150\n number_of_deaths ...
[ { "docid": "535e665259c708b9c0b224ca659b8078", "score": "0.720264", "text": "def predicted_deaths\n # predicted deaths is solely based on population density\n #This method is calculating the number of deaths per state.\n # it creates a variable number_of_deaths which value will be calculated by...
8c23b0b79f31685a75cca5510e7a2941
normalize a phone number
[ { "docid": "53059ed4dc8301accecc2667d9fa0d99", "score": "0.82609427", "text": "def normalize_phone(phone)\n Phoner::Phone.default_country_code = '1'\n if phone.gsub(/[^0-9]/, '').size == 11 && phone[0] == '1'\n phone = '+' + phone\n end\n normalized = Phoner::Phone.parse(phone).to_s\n ...
[ { "docid": "6964139848a60f85a12344f34dde9255", "score": "0.8619604", "text": "def normalize_phone_number\n # stretch\n if !self.phone.nil?\n self.phone = self.phone.gsub(/\\)|\\(|-|\\.|,/,\"\")\n self.phone = self.phone.gsub(/1\\d{10}/,self.phone[1..self.phone.length])\n end\n end", ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "b9ae439277356b94817d4d0c73d00978", "score": "0.0", "text": "def criminal_params\n params.require(:criminal).permit(:first_name, :last_name, :aka, :convicted_felon, :enhanced_powers, :notes)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whit...
b237045cf933300e36970900e8f4d5d0
toggle_diagnostic when users change the diagnostic test setting after creating an extraction form, the included sections table may need to be updated.
[ { "docid": "b001f04630fb6f6ac924f08b393b2d03", "score": "0.8191639", "text": "def toggle_diagnostic()\n diagnostic = self.is_diagnostic\n included_sections = ExtractionFormSection.find(:all, :conditions=>[\"extraction_form_id=?\",self.id])\n # if it's diagnostic, set it back to norm...
[ { "docid": "94ae7bcf0db706bd8a4ad61e1fbc2428", "score": "0.55382586", "text": "def set_diagnostic\n @diagnostic = Diagnostic.find(params[:id])\n end", "title": "" }, { "docid": "77ebe502f3646c37f09b5408c472d639", "score": "0.55162686", "text": "def sections_field_changed\n ...
82dba0403826bb939b523c987e21812b
POST /female4x100mts POST /female4x100mts.json
[ { "docid": "01fc4fc08e28dcef88355eeaf5ed4895", "score": "0.70015424", "text": "def create\n @female4x100mt = Female4x100mt.new(female4x100mt_params)\n\n respond_to do |format|\n if @female4x100mt.save\n format.html { redirect_to action:index, notice: 'Female4x100mt was successfully cre...
[ { "docid": "515975f034232abf02ea6be6a954249b", "score": "0.6841193", "text": "def create\n @female4x400mt = Female4x400mt.new(female4x400mt_params)\n\n respond_to do |format|\n if @female4x400mt.save\n format.html { redirect_to action:index, notice: 'Female4x400mt was successfully crea...
2e8951b2f54e9c6c0a2ae28269f22365
POST /lesson2_as POST /lesson2_as.json
[ { "docid": "68885971b90365e06589e1890362f330", "score": "0.739644", "text": "def create\n @lesson2_a = Lesson2A.new(lesson2_a_params)\n\n respond_to do |format|\n if @lesson2_a.save\n format.html { redirect_to @lesson2_a, notice: 'Lesson2 a was successfully created.' }\n format....
[ { "docid": "7913a418101d25c896937d716812e621", "score": "0.6463071", "text": "def create\n @lesson = Lesson.new(lesson_params)\n\n if @lesson.save\n render json: @lesson, serializer: LessonSerializer\n else\n render json: { error: t('story_create_error') }, status: :unprocessable_enti...
5297421cd80eb11c8b49848488c0fb00
when a tool is reported, the admin can: to dispose the quantity of object reported fix the quantity of object reported replace the quantity of object reported (if the tool have an identifier, else this action is the same of fix)
[ { "docid": "a9c60c390046d523d7fc876abe5ef74b", "score": "0.6241708", "text": "def dismiss\n @tool = @reporting.tool\n @lab = @tool.labs_tools.where(\"lab_id = ?\", @reporting.lab_id).first\n quantity = @lab.quantity\n if quantity < @reporting.quantity\n @lab.quantity = 0\n else\n ...
[ { "docid": "988c26e1d9b6a93fcdaeccb0c3109754", "score": "0.56888276", "text": "def recover_usage(quantity_to_be_recovered)\n self.used_quantity -= quantity_to_be_recovered \n self.save \n \n self.unmark_as_finished\n \n item = self.item \n item.update_ready_quantity\n \n ret...
276afc1f46535d2692d432bf551fa348
translateName Get the name from the string of fill values Param: nameValArr The array containing name fill values Return: string The resultant name from the read
[ { "docid": "985787dec952fe8e1ac09b8ff96c6b11", "score": "0.79669136", "text": "def translateName( nameValArr )\n name = \"\"\n nameValArr.each { |nameVal|\n index = nameVal.floor\n val = nameVal - index\n name = name + translateFromFillValue( val, index )\n }\n newName = (name...
[ { "docid": "3f2aed9008d6c05c6186264d13bd2f80", "score": "0.59506255", "text": "def translate_name(name)\nreversed_name = name.split(' ').reverse\nnew_first = reversed_name[0].chars.map {|x|\n x.next\n }\nnew_last = reversed_name[1].chars.map {|x|\n x.next\n }\nnew_name = \"#{new_first.join} #{new_la...
cba6577561ee66f33f8ba1b919fe6a78
Further Exploration Investigate Enumerable.inject (also known as Enumerable.reduce), How might this method be useful in solving this problem? Answer: the previous method implicitly used reduce/inject in the array sum method. This is equivalent to:
[ { "docid": "1e5f672ba7c40fb31ef9c6cedbb36357", "score": "0.0", "text": "def multisum num\n (1..num).select {|m| m % 3 == 0 || m % 5 == 0}.reduce(:+)\nend", "title": "" } ]
[ { "docid": "1f4f6b47875f62d1950abdff90568d64", "score": "0.819073", "text": "def sum_array(array) #Advanced\n array.inject {|sum, num| sum + num}\nend", "title": "" }, { "docid": "e60051eb5fba64f6453d67a117d9d167", "score": "0.8184191", "text": "def sum_array_inject(array)\n array....
59b1b23e12a8694656e8211dfeb55b51
Method to print a list and make it look pretty input: hash steps: take each keyvalue pair and print them out output: string
[ { "docid": "9d2f44c0162d99af38c58b8984bb7ee6", "score": "0.0", "text": "def print_list(grocery_list)\n grocery_list.each do |item, quantity|\n puts \"#{item}: #{quantity}\"\n end\nend", "title": "" } ]
[ { "docid": "5783d2f6f195007c0ae447edc2dd3bdc", "score": "0.8182662", "text": "def pretty_print_list(hash)\n\thash.each do |key, value|\n\t\tputs \"You need #{value}, #{key}\"\n\tend\nend", "title": "" }, { "docid": "e4e4004212be6a6f6628e3240b898e18", "score": "0.79177576", "text": "d...
2e15a4b50883f134fe3559a9ff81c639
for future proofing connection with SA. Not yet used to store anything
[ { "docid": "594a8ce68270b6c158bdea3e620ef53e", "score": "0.0", "text": "def metadata\n return \"\"\n end", "title": "" } ]
[ { "docid": "6301b48e459f10c66e62f7a8799cef78", "score": "0.6437677", "text": "def connection; end", "title": "" }, { "docid": "6301b48e459f10c66e62f7a8799cef78", "score": "0.6437677", "text": "def connection; end", "title": "" }, { "docid": "6301b48e459f10c66e62f7a8799cef...
b724ca343c6b7c4c4a8206661d6dab70
GET /posts GET /posts.json
[ { "docid": "fa1befb00d31513342c7970a6b79bc6e", "score": "0.0", "text": "def index\n @posts = []\n end", "title": "" } ]
[ { "docid": "fb578f587fdfe1b0a8d3ac27001f9611", "score": "0.7634022", "text": "def index\n render json: @posts\n end", "title": "" }, { "docid": "4e694f9f0a0313f64d4c0582953f2972", "score": "0.754337", "text": "def show\r\n @posts = Post.find(:all)\r\n\r\n respond_to do ...
5ee1800faf65a1e84ede0c658d7a6125
Builds a request that returns a json response from the ganglia server
[ { "docid": "3468ac6714ae20d0c912ad054886d9d6", "score": "0.0", "text": "def json\n \"#{self.to_s}&json=true\"\n end", "title": "" } ]
[ { "docid": "e9ac12488e33ada391a896c670179162", "score": "0.68599534", "text": "def build_request\n client.request request_name\n end", "title": "" }, { "docid": "3c64bfd3e129fd949a789e0d31060483", "score": "0.68177205", "text": "def build_response(connection, request); en...
5823c75f7437cf9f59a185b6d2ebf8b8
GET /posts/1 GET /posts/1.json
[ { "docid": "237199d921c5386bf071e0277a69011a", "score": "0.0", "text": "def show\n @token = 'tok_ymzqv094ztk1ejhrj6ukxjtcnw'\n\n url = {\"url\": @post.file.to_s, \"platform\": \"android\"}\n res = RestClient.post \"https://\" + @token +\"@api.appetize.io/v1/apps\",url.to_json, :cont...
[ { "docid": "c884d3048f42b4b1b768c271940bbed7", "score": "0.74375457", "text": "def show\n post_id = params[:id]\n render json: V1::Post.get_a_post(post_id)\n end", "title": "" }, { "docid": "fb578f587fdfe1b0a8d3ac27001f9611", "score": "0.73646325", "text": "def index\n ...
439271a40cf399c0b395824c61ab7b7a
just need a random number to prevent conflicts in compiled js files this may be too much
[ { "docid": "e708d5ad503255d5be0b353d3125568f", "score": "0.70533204", "text": "def rand_num\n return Digest::SHA1.hexdigest(Time.now.to_s.split(//).sort_by{rand}.join)\n end", "title": "" } ]
[ { "docid": "a31c1db5a6e611f0321a924943bdeb0c", "score": "0.7068053", "text": "def generate_identifier\n rand(99999999) #TODO: Current setup won't necessarily be unique.\n end", "title": "" }, { "docid": "1829a0245b86829be6b9dba145385a92", "score": "0.70404243", "text": "def r...
6ecae8bed85298cb8df0ed0e03123801
Calculates conditional probability P(word | tag)
[ { "docid": "980b7c8d1faacb4f2568468520ac2733", "score": "0.70860904", "text": "def emission_probability (tag, observation)\n\n # The two lines below are beautiful usage examples of reduce. Sadly, they are also slow on big corpi such as Brown. We're resorting to precomputed counts.\n #\n # numbe...
[ { "docid": "574a16f6d08dd9a58c25488525b09f8d", "score": "0.74540484", "text": "def probability(word)\n (dictionary[word] || 0) / total_count\n end", "title": "" }, { "docid": "4abcf3df62b742c627247023023bd1ab", "score": "0.7385878", "text": "def conditional_probability_for(word, ...
2447190278440a1423efc7c61fc56a5e
Check if user is subscriber of this conversation. Returns true if User with given id is a subscriber, false otherwise. === Parameters: +user_id+:: user id of possible subscriber
[ { "docid": "0aedbfe21d3670568f8c6ddf64945b29", "score": "0.8332176", "text": "def has_subscriber?(user_id)\r\n self.subscribers.include?(user_id.to_i)\r\n end", "title": "" } ]
[ { "docid": "3d992a6e0593f6d7fd4f79ac420a32d4", "score": "0.79460526", "text": "def has_subscriber?(user_id)\n # In the case of an Indivual tournament\n if is_individual?\n users.exists?(user_id)\n else\n # If we are in a team kind of tournament\n memberships.exists?(:user_id => u...
877021d40bca75fa031cc56b8d0d84b2
GET /users GET /users.xml
[ { "docid": "76e466e4e8b1a198977b6cf51f030be4", "score": "0.0", "text": "def index\n @users = User.find(:all)\n\t\t@first_name = session[:facebook_session].user.first_name\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end", ...
[ { "docid": "81f820aba49ac09ba424a3c44ecb4bf8", "score": "0.8538107", "text": "def account_users \n make_request(:get,\"#{account_url}/users.xml\")\n end", "title": "" }, { "docid": "c30d74a9ad7eba05edcb8605ab93b040", "score": "0.78325933", "text": "def get_users\n response...
b24f465efafef29f65ae31826b433c30
Must be a live Drupal site
[ { "docid": "6becb1fe49aca50dbb67817e05fdb91f", "score": "0.0", "text": "def can_backup?\n /^drupal/.match(framework) && !frozen\n end", "title": "" } ]
[ { "docid": "63d3bb4840613fac7a2329a91db2fd99", "score": "0.65025836", "text": "def on_live_site\n # for now we use an env variable\n live = ENV['IS_LIVE'].downcase == \"true\" ? true : false\n return live\n end", "title": "" }, { "docid": "b0f5e152764f751c7a6a6ed5c331b99a", "...
73c22e93100ec03c24babe21b8ddfeaf
Expands and prepends the specified paths to $LOAD_PATH, removing any duplicates. Returns $LOAD_PATH.
[ { "docid": "525587ae8bf327d19e76e191123aa6ca", "score": "0.7712392", "text": "def loadpath(*paths)\r\n paths.reverse_each do |path|\r\n $LOAD_PATH.unshift File.expand_path(path)\r\n end\r\n \r\n $LOAD_PATH.uniq!\r\n $LOAD_PATH\r\n end", "title": "" } ]
[ { "docid": "c55e9aa22e915582cfffa58dfc1d20c8", "score": "0.7310271", "text": "def set_load_paths(*paths)\n $:.concat(paths); load_paths.concat(paths)\n $:.uniq!; load_paths.uniq!\n end", "title": "" }, { "docid": "ee33fe7f26795d3b98e19455619b926a", "score": "0.7300473", ...
460d8e81e207bd90da9d7b3155bde405
GET /digitized_links/new GET /digitized_links/new.xml
[ { "docid": "d7e95b118caf270e7512caf583f1e8c1", "score": "0.70575994", "text": "def new\n @digitized_link = DigitizedLink.new\n @book = Book.find(params[:book_id])\n @digitized_links = @book.digitized_link\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { rende...
[ { "docid": "457c3b14b2bf9098f71b2284f9ca8b87", "score": "0.6889988", "text": "def new\n @link = Link.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @link }\n end\n end", "title": "" }, { "docid": "457c3b14b2bf9098f71b2284f9ca8b8...
2bd5e0d42354ac1015cda25a030c9120
(This method is generated in Translator_defaultbuildImpl)
[ { "docid": "800ce7b965212bbe2c7a45ce3cbe4709", "score": "0.0", "text": "def set_tags(v)\n Saklient::Util::validate_type(v, 'Array')\n @m_tags = v\n @n_tags = true\n return @m_tags\n end", "title": "" } ]
[ { "docid": "6baad5035fa25628b4ef5774fc4b6415", "score": "0.68567604", "text": "def translator; end", "title": "" }, { "docid": "58760b1bb01e1b5ea65ee67bbc45bfa1", "score": "0.68115157", "text": "def __build; end", "title": "" }, { "docid": "b950e132fc856b7d4ea43264bfee0d6...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "7170a4f30c8e71c3c175e703b6973e3b", "score": "0.0", "text": "def estudo_params\r\n params.require(:estudo).permit(:title, :description, :image, :buttom_color, :brief_description, :button_img)\r\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...
54866ec1ef4af28da91789c9cab2c84d
FUNCTION: genWindow INTERFACE: genWindow(initNum, windowSize, destIp) initNum: Initial sequence number windowSize: Window size to use for sending windows destIP: IP Address for the destination NOTES: This function handles all the tasks for generating the initial window.
[ { "docid": "5f6e42e411f4a29c708f8fa2dd1c7f1f", "score": "0.77855957", "text": "def genWindow(initNum, windowSize, destIP)\n i = 1\n seqNum = initNum\n while(i <= windowSize.to_i)\n packet = makePacket(destIP, $localIP, 1, seqNum, 0)\n $window.push(packet)\n seqNum += 1\n ...
[ { "docid": "e7f7f06bb08ef113b36c19ef5c2aafb7", "score": "0.5642295", "text": "def tx1(socket, port, destIP, networkIP,currentSequenceNum, numPackets, windowSize)\n i = 0\n size = $window.size\n puts \"Sending window #{$window[0].seqNum} to #{$window[size - 1].seqNum}\"\n $logger.info(\"Sendi...
4fe0e1fb5389ecb5a1b578eac7f1c4ff
Serialize to data stored in the db.
[ { "docid": "12b991e7b77c8dc033701693d91d2244", "score": "0.0", "text": "def to_raw_data\n @letters.join(SEPARATOR)\n end", "title": "" } ]
[ { "docid": "11b4f3ff760c235c436b1ab89cdd2f0e", "score": "0.7142431", "text": "def save()\n File.write(@database_file, @data.to_json)\n end", "title": "" }, { "docid": "0795eac2a3b746fc7fea6373714e1986", "score": "0.68900585", "text": "def serialize\n end", "title":...
ff8a82fdfa121e789582ca9e9932942a
Generate the first line of the request
[ { "docid": "f613dd408644acfa82a2b9714906cd3e", "score": "0.7333112", "text": "def generate_initial_line(type, path)\n\tinitial_line = \"GET \" if type == :get\n\tinitial_line = \"POST \" if type == :post \n\tinitial_line += path + \" HTTP/1.0\" + \"\\r\\n\"\nend", "title": "" } ]
[ { "docid": "f1126ee7ef69102a06cf49e65cf3f168", "score": "0.7801196", "text": "def first_line\n request[0].split(\" \")\n end", "title": "" }, { "docid": "29630b4601741da03a8ba7d316226a70", "score": "0.71371925", "text": "def first_line\n line = buffer[start_line]\n (line[st...
411a71b04712190f95d0637106ff94e1
Install reader and writer methods for the attribute associated with the specified `key`.
[ { "docid": "98a40966ce2ab07c9a0cb36f27de1826", "score": "0.79412264", "text": "def install_accessors( key )\n\t\treader, writer = self.make_attribute_accessors( key )\n\n\t\tself.singleton_class.send( :define_method, key, &reader )\n\t\tself.singleton_class.send( :define_method, \"#{key}=\", &writer )\n...
[ { "docid": "ee0e04add8ce682b6e89b358bdac0680", "score": "0.7260354", "text": "def install\n attributes.each { |attribute| install_reader(attribute) }\n end", "title": "" }, { "docid": "0b0444ec26df64d9e7f9a34cdff4a558", "score": "0.7030977", "text": "def define_attrib...
f894139dc9fdf4c80eb2ea32af7afa0b
DELETE /teammembers/1 DELETE /teammembers/1.json
[ { "docid": "7e0c88abc64082d6f51e29f574aa119b", "score": "0.77946943", "text": "def destroy\n @teammember = Teammember.find(params[:id])\n @teammember.destroy\n\n respond_to do |format|\n format.html { redirect_to teammembers_url }\n format.json { head :no_content }\n end\n end", ...
[ { "docid": "604a848bac2ee0c24b107ca272d50e1d", "score": "0.8008031", "text": "def deleteMember\r\n user = User.find(params['member']) \r\n team_id = params['id']\r\n @team = Team.find(team_id)\r\n Teamsuser.destroy_all(:user_id=>user,:team_id=>team_id)\r\n \r\n respond_to do |format|...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "ddda15cc72f05dfbae8196537780b289", "score": "0.0", "text": "def set_dest_category\n @dest_category = DestCategory.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...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "20d5c3793a277d06b141649ff852a1c7", "score": "0.0", "text": "def set_place\n @place = Place.find(params[:place_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...
ba33594fc009bbd6ad9c4d5753f96e86
GET /contratistas/1 GET /contratistas/1.xml
[ { "docid": "fbe1b9163a088436f204b742e8dea6e8", "score": "0.72710794", "text": "def show\n @contratista = Contratista.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @contratista }\n end\n end", "title": "" } ]
[ { "docid": "4325fe17243a001ff69ea6a7d4947724", "score": "0.6785277", "text": "def index\n @concessionaires = Concessionaire.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @concessionaires }\n end\n end", "title": "" }, { "doci...
761bc9a0098fe1e7e0f26b9abb3dc153
POST /questions POST /questions.json
[ { "docid": "446a8b262ad56c4364a35b2fc809ba6f", "score": "0.6706642", "text": "def create\n @question = Question.new(params[:question])\n\n respond_to do |format|\n if @question.save\n format.html { redirect_to @question, notice: 'Question was successfully created.' }\n format.js...
[ { "docid": "56850646224a2709f3405ab227e6e9c2", "score": "0.7311781", "text": "def create\n \t@question = Question.new(questions_params)\n\n \trespond_to do |format|\n \t\tif @question.save\n \t\t\tformat.html { redirect_to @question, notice: 'question was successfully created.' }\n \t\t\tformat.jso...
9a52538b949860a24069f0296c4d61c2
Method to insert a single document in any collection
[ { "docid": "b5b4151a6f86557ea69c32dea605c616", "score": "0.860324", "text": "def insertDocument(collection, document)\n return collection.insert_one(document)\n end", "title": "" } ]
[ { "docid": "8771b73af8f8f72b30848ed80184257c", "score": "0.84735024", "text": "def insert(document)\n collection.insert document\n end", "title": "" }, { "docid": "14a3bef6de3cdfe4e1f608831a9f906e", "score": "0.83779883", "text": "def insert(document)\n @collection.ins...
f3cca2dc7d56c8d31cc16296273961b8
Stop listening to other peers.
[ { "docid": "499cb73a3d801a74b20d51712239941d", "score": "0.0", "text": "def unsubscribe\n @actor << 'UNSUBSCRIBE'\n end", "title": "" } ]
[ { "docid": "de68c67cec03891c22c5f0ab13c0a811", "score": "0.70145524", "text": "def stop\n @listeners.stop\n end", "title": "" }, { "docid": "5e75de6edd99ae0a4c0785664336043d", "score": "0.69807225", "text": "def stop\n self.listener.stop\n self.listener.close\n self....
eb0e87c39527ce31bf193cf1a16aaddd
Test for when a single, normal app is setup. script_name is '' (To make sure we aren't breaking normal Sinatra apps.)
[ { "docid": "9bc7528c02c18f32ab2811157198c830", "score": "0.0", "text": "def test_resource_name_without_script_name\n @use_multi_app = false\n enable_script_names!\n\n get '/endpoint'\n\n spans = @writer.spans.select { |s| s.name == 'sinatra.request' }\n assert_equal(1, spans.length)\n\n ...
[ { "docid": "71a22e6515e963fe8d16980c809425a4", "score": "0.7098365", "text": "def run_app?; true; end", "title": "" }, { "docid": "71a22e6515e963fe8d16980c809425a4", "score": "0.7098365", "text": "def run_app?; true; end", "title": "" }, { "docid": "bb925f6486ac92d9da4c77...
4341ff9a4662377bbea762e655eb539c
Raises an exception if there is at least one required scope category that has not yet been satisfied. +triggering_method+ is the name of the method called that triggered this check; we include this in the error we raise.
[ { "docid": "fe49270b9ec9525dfb08251c79f06288", "score": "0.81751657", "text": "def ensure_categories_satisfied!(triggering_method)\n required_categories = required_scope_categories\n missing_categories = required_categories - satisfied_scope_categories\n\n if missing_categories.length > 0\n ...
[ { "docid": "f3a25750974ca43d8372f2d471eb4338", "score": "0.5105877", "text": "def validate_has_method_defined(holding_class, method)\n unless holding_class.method_defined?(method)\n raise UndefinedMethodException.new(\"Undefined method #{method.inspect} for #{holding_class}\")\n end\n ...
73984e8ed2d0c7122575ad979fe8abb9
Set the index page
[ { "docid": "40c1c4bef1496a8495d87e0b7938adb3", "score": "0.0", "text": "def set_index_page(indexPage=nil)\n if indexPage.class == String && !block_given?\n @j_del.java_method(:setIndexPage, [Java::java.lang.String.java_class]).call(indexPage)\n return self\n end\n raise Argu...
[ { "docid": "b081c33f8bfe9dcbda4585f882100e8b", "score": "0.78033864", "text": "def set_indexpage\n\t@indexpage = Indexpage.find(params[:id])\n end", "title": "" }, { "docid": "aa9eeeaa5cfa19ced34b0a761adf9e93", "score": "0.7375562", "text": "def index\n @page_source = 'index'\n...
78b878bc5e75777d742d642f935ef0e7
Update all scheduled message as cancelled Update all scheduled message as cancelled
[ { "docid": "c4ee5bdb4ec3245e2e20351df9773755", "score": "0.0", "text": "def sms_cancel_all_put_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SMSApi.sms_cancel_all_put ...'\n end\n # resource path\n local_var_path = ...
[ { "docid": "23546086c1e3f26b779201dbb97a14b8", "score": "0.72022253", "text": "def cancel\n self.update_status :cancelled\n end", "title": "" }, { "docid": "f578b5226ddcc911ea341529b2fd52f6", "score": "0.7068979", "text": "def cancel!\n update(request_cancelled: true)\n end",...
43653d9ea50050cf2d918ae048aa94db
Checks MRN number to see if we have seen patient before MRN is a life time ID for FH
[ { "docid": "bdf10ccc2662fafb00b3d9d71b5af3d4", "score": "0.5040314", "text": "def new_patient?(patient)\n return Patient.find_by_mrn(patient.mrn).nil?\n end", "title": "" } ]
[ { "docid": "439d6e749c1f3cd4c780747bd9a18dac", "score": "0.58972704", "text": "def ldr07_invalid?\n return true unless leader\n leader[7] !~ /[abcdims]/\n end", "title": "" }, { "docid": "4c754dfd370ca3d2342192df81d82976", "score": "0.56985015", "text": "def mnf?\n\t\tga...
bc1891e9f2eb038e2f0e837a5dfee96d
Assigned Shared Credentials Retrieve all of the shared credentials assigned to the site. These shared credentials can be enabled/disabled for the site's scan.
[ { "docid": "5d2e68308643dcbf513be45f4f20161b", "score": "0.613211", "text": "def get_site_shared_credentials(id, opts = {})\n data, _status_code, _headers = get_site_shared_credentials_with_http_info(id, opts)\n data\n end", "title": "" } ]
[ { "docid": "6883dd7c2b9ff8d25505e175b9aab47e", "score": "0.6193303", "text": "def get_site_shared_credentials(id, opts = {})\n data, _status_code, _headers = get_site_shared_credentials_with_http_info(id, opts)\n return data\n end", "title": "" }, { "docid": "d3ee79f6e278d06f2cd...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "deeebe89b4052b0c2527517d6858ebda", "score": "0.0", "text": "def company_params\n params.require(:company).permit(:name, :phone, :description, :branch_id, :province_id, \n :erp_system_id, :inventory_system_id, :salary_system_id, :logistics_system_id, :improve_process_id)\n end"...
[ { "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...
87cf38bae37fb65cf340ddac4bb719ca
Find the next highest value on the right subtree of a node
[ { "docid": "00c4598bc382061334b67104c06b8c33", "score": "0.0", "text": "def succesor(node)\n node = node.left_child until node.left_child.nil?\n node\n end", "title": "" } ]
[ { "docid": "584ee1e86a996c114db17d1453263b72", "score": "0.8080373", "text": "def find_largest root_node\n current = root_node\n while current\n return current.value if !current.right\n current = current.right\n end\nend", "title": "" }, { "docid": "21b595a3302710f5ce3a2dca203c9cbd"...
9be97096baa8ec66285fd426acfafff6
Intended to carry out a user defined Proc action when initial state is set.
[ { "docid": "2fad8987d1552fcb8513cdaace6b50c1", "score": "0.56271446", "text": "def run_initial_state_actions\n return true\n end", "title": "" } ]
[ { "docid": "c6352e6eaf17cda8c9d2763f0fbfd99d", "score": "0.65993893", "text": "def initial_action=(_arg0); end", "title": "" }, { "docid": "2198a9876a6ec535e7dcf0fd476b092f", "score": "0.659089", "text": "def initial_action; end", "title": "" }, { "docid": "7c8578c0f718cc...
046595a13d266c04fec35521bacf6481
Traversal should always begin with an object that is known to be able to reach all other objects in the aggregate (like the root!)
[ { "docid": "efb8bd4845059901f2e2c06380a2cdaf", "score": "0.5260893", "text": "def accept(object, visitor, already_visited=[])\n return if object.nil?\n\n config = @configs.config_for(object.class)\n return if config.nil?\n\n return if already_visited.include?(object)\n already_v...
[ { "docid": "59e3c7d64ea38cd40488707fa61c6ae9", "score": "0.67079717", "text": "def traverse; end", "title": "" }, { "docid": "0c290337a98dc78b76e6bb16a4b1eca6", "score": "0.6143806", "text": "def traverse obj=self, &block\n case\n when obj.respond_to?(:parent?) && obj...
2194d52f79a4f80da76c0cc6f1076d87
DELETE /super_partners/1 DELETE /super_partners/1.json
[ { "docid": "ee5999a7822113064e5375a2f540c5d6", "score": "0.7176529", "text": "def destroy\n @super_partner.destroy\n respond_to do |format|\n format.html { redirect_to super_partners_url, notice: 'Super partner was successfully destroyed.' }\n format.json { head :no_content }\n end\n ...
[ { "docid": "4c1c164b581dbae14285797e584e8fb7", "score": "0.7018655", "text": "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "title": "" }, { "docid": "6d917647d2eca3600568a12851e8656a", "score": "0.6991952", "text": "def destro...
c5f7c0c3ca226406df3331555223f009
PUT /life_jackets/1 PUT /life_jackets/1.json
[ { "docid": "d8ecc585c6bf33c02ed29c796b26e056", "score": "0.7585883", "text": "def update\n respond_to do |format|\n if @life_jacket.update_attributes(params[:life_jacket])\n format.html { redirect_to @life_jacket, notice: 'Life jacket was successfully updated.' }\n format.json { he...
[ { "docid": "b04995ea907240d16cb0122182345a6f", "score": "0.689245", "text": "def update\n @life_jacket_age = LifeJacketAge.find(params[:id])\n\n respond_to do |format|\n if @life_jacket_age.update_attributes(params[:life_jacket_age])\n format.html { redirect_to @life_jacket_age, notice...
c08dc2a82a37d5c46f3411ba6953b78a
My second good answer
[ { "docid": "448c8d03826a91c83f2c725b5bff56c6", "score": "0.0", "text": "def ABCheck2(str)\n (0..str.length-1).any? do |i| \n (str[i] == 'a' && str[i+4] == 'b') || \n (str[i] == 'b' && str[i+4] == 'a')\n end\nend", "title": "" } ]
[ { "docid": "bc658f9936671408e02baa884ac86390", "score": "0.60302436", "text": "def anchored; end", "title": "" }, { "docid": "b6b2bcc0062aeb115edab7b10cbe6930", "score": "0.5946149", "text": "def desired; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",...
7618b48eb88fc0ec689d4cac07dccf4a
GET /web/v1/contact_numbers GET /web/v1/contact_numbers.json
[ { "docid": "6d73125ce563bb9a8bde3b998b2aff9d", "score": "0.78006464", "text": "def index\n @contact_numbers = ContactNumber.all\n\n render json: @contact_numbers\n end", "title": "" } ]
[ { "docid": "9e37a80f2da8b313bdeb5e50fd5642c0", "score": "0.7592007", "text": "def index\n @contact_numbers = ContactNumber.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @contact_numbers }\n end\n end", "title": "" }, { "docid":...
13f345ec5bf592abc137993877d54da8
For budget attributes, converts empty strings to `nil`, so that the request isn't shown as being modified when the fields appear in the edit form.
[ { "docid": "6cd34d58391ddcc569db2975aff35241", "score": "0.0", "text": "def normalize_values\n if self.cl_number.present?\n self.cl_number = self.cl_number.upcase\n self.cl_number.prepend('CL') unless self.cl_number.start_with?('CL')\n else\n self.cl_number = nil\n en...
[ { "docid": "79d45dac66576505a88e393115cc3bb8", "score": "0.70126957", "text": "def convert_blanks_to_nil\n self.attributes.each do |name,value|\n self.send(\"#{name}=\".to_sym, nil) if value.is_a?(String) and value.empty?\n end\n end", "title": "" }, { "docid": "c8573bed1...
5e761a423fef1df6c5cb228517083cc6
For direct equality, make sure all the attributes are the same
[ { "docid": "9466615f193ebff6fe9327efa745fd3f", "score": "0.0", "text": "def ==(other)\n return false unless other.kind_of? RaptorIO::Socket::SwitchBoard::Route\n netmask == other.netmask && subnet == other.subnet && comm == other.comm\n end", "title": "" } ]
[ { "docid": "569a6e70e3c41ee6dd68d73238c5128c", "score": "0.77768373", "text": "def ==(other)\n attributes == other.attributes\n end", "title": "" }, { "docid": "ce5eeaf80566e4180cb68653bb351220", "score": "0.7656932", "text": "def ==(other) # :nodoc:\n @attrs == other.at...
a6527a2ee7f77ed7a93a4b65ae76ef25
Obtain an InputSet object, used to define inputs for an execution of this Choreo.
[ { "docid": "5a1b7252075be8c72149040e6a579f8a", "score": "0.0", "text": "def new_input_set()\n return GetProductCategoriesForASINInputSet.new()\n end", "title": "" } ]
[ { "docid": "d8eb34cfc5a1e737977f7023d4849c46", "score": "0.6741255", "text": "def new_input_set()\n return CreateObjectInputSet.new()\n end", "title": "" }, { "docid": "7c0d7c433cd4eb8e36bdc3a383e9ec33", "score": "0.65807736", "text": "def new_input_set()\n return Ru...
0a566d3976b0f0cb73b00afe9c84745a
discover some more hull at the top
[ { "docid": "e968a7d8414c669eaa8754782e2261c1", "score": "0.51692104", "text": "def prepend_height\n diff = @hull_size[0]\n new_hull = Array.new(diff) { Array.new(@hull_size[1]) }\n new_hull += @hull\n @hull = new_hull\n @hull_size[0] += diff\n @row += diff\n end", "title": "" } ...
[ { "docid": "3a633bf93dfb7c8d87c521157633fcab", "score": "0.6253475", "text": "def convex_hull\n a = @points.to_a\n left = a.first\n a = a[1..-1]\n right = a.pop\n puts \"left = #{left} right = #{right} a = #{a.map{|p| p.to_s}.join(\", \")}\" if @debug\n upper = []\n lower = []\n ...
19b88fde2f36f5e52981d924c0b95e94
Sets the governor. ===Examples cpufreq.governor = "performance"
[ { "docid": "44e38bd553e61b1db17e2d594b48bb53", "score": "0.7380543", "text": "def governor=(newgov)\n raise \"Governor not found.\" if @allowed_govs.index(newgov) == nil\n \n cmd = \"cpufreq-set --cpu #{@data[\"processor\"]} --governor #{newgov}\"\n res = Knj::Os::shellcmd(cmd)\n if res.i...
[ { "docid": "0b8a0c5dec6d28695158010416a6a3b0", "score": "0.5913155", "text": "def set_governorate\n @governorate = Governorate.find(params[:id])\n end", "title": "" }, { "docid": "a281bea86d9afa7e22669a2f2cdc1f2b", "score": "0.5768919", "text": "def bandwidth= bandwidth\n ...
2bbbb2b05dfc1b0df4d04c9313630914
The function will be a method for now on
[ { "docid": "e12ad779ba1457a5cde0465d9a0cae5d", "score": "0.0", "text": "def use_as_method\n @method = true\n end", "title": "" } ]
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.73954964", "text": "def private; end", "title": "" }, { "docid": "a02f7382c73eef08b14f38d122f7bdb9", "score": "0.7278261", "text": "def custom; end", "title": "" }, { "docid": "a02f7382c73eef08b14f38d122f7bdb9", ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "c333ef6ace348d46187a9b4cf3965a35", "score": "0.0", "text": "def set_professional\n @professional = Professional.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;...
b804677d251f35b43c3df60a8a2756ef
Boat params that we need.
[ { "docid": "23cca899beff3dea0120fa8ffbc1fe53", "score": "0.676995", "text": "def boat_params\n\t\tparams.require(:boat).permit(:capacity, :name)\n\tend", "title": "" } ]
[ { "docid": "6b87528630b8cead9d6f8f447ba306ba", "score": "0.7394612", "text": "def batter_params\n params.fetch(:batter, {})\n end", "title": "" }, { "docid": "7fe950c25ce93167a5e737a76dd0f56c", "score": "0.7298481", "text": "def boat_params\n create_params = [\n :name...
896141fadbbfafae2b00ac48a9faf6cb
Writes a debug message to the console.
[ { "docid": "994efaae0cce9a72584906d0d8019dca", "score": "0.68424934", "text": "def debug(message, important = false)\n puts \"[DEBUG : #{Thread.current[:discordrb_name]} @ #{Time.now.strftime(LOG_TIMESTAMP_FORMAT)}] #{message}\" if @debug || important\n end", "title": "" } ]
[ { "docid": "4523cca554587147c26f53a16f431cb5", "score": "0.8037287", "text": "def debug(message)\n $stdout.puts \"D #{message}\" if @debug\n end", "title": "" }, { "docid": "d81c1a4196b82aecfda29fa6420724cf", "score": "0.7978308", "text": "def debug(message)\n ...
ee8c776e7db0aa4cd35fc5515ca2b4b0
PATCH/PUT /cars/1 PATCH/PUT /cars/1.json
[ { "docid": "2585e1f8a90872f18bb689ded1370ad1", "score": "0.69856066", "text": "def update\n @car = Car.find(params[:id])\n\n if @car.update(car_params)\n head :no_content\n else\n render json: @car.errors, status: :unprocessable_entity\n end\n end", "title": "" } ]
[ { "docid": "232b9330ebe66f8fe15e85745ae1b42c", "score": "0.7085492", "text": "def update\n @car = Car.find(params[:id])\n \n if @car.update(car_params)\n render json: @car, status: :ok \n else\n render json: @car.errors, status: :unprocessable_entity\n end\n end", "title": ...
591f3231bfa5bccb7da3c279ffffba4e
Time Complexity: O(n) Space Complexity: O(n)
[ { "docid": "c4022d165ca13f54d20a0fcf0ec975ea", "score": "0.0", "text": "def preorder\n arr = []\n if @root.nil?\n return arr\n end \n current_node = @root\n return preorder_helper(current_node, arr)\n end", "title": "" } ]
[ { "docid": "5944c445a0d5d1383cd670cc84d3fc3b", "score": "0.6913405", "text": "def find_dublicate(array)\n sum = 1000000*(1000000+1)/2 # (n*(n+1))/2\n array.each do |el| \n sum -= el\n end\n return sum\nend", "title": "" }, { "docid": "2481cbf165330db256eee896a32c82e4", "score": "0...
50ae3bee78df54896c8a2127442e5117
Returns true if any connected particle's fixed property is true.
[ { "docid": "8522fe906359fb75e10ee09c5beb1195", "score": "0.71673805", "text": "def fixed?\n @p1.fixed? and @p2.fixed? and @p3.fixed?\n end", "title": "" } ]
[ { "docid": "5bd3e0e361970ade572df627a0d19880", "score": "0.82780343", "text": "def fixed?\n particles.each do |p|\n return false unless p.fixed?\n end\n true\n end", "title": "" }, { "docid": "b1d37096ebcc5b22ec065a8699d74b9b", "score": "0.6775467", "text": "...
d82045c9f4ee3930b3079ef5112fc8e1
> "SEARCH RECENTCHATS" [, ]"
[ { "docid": "98cb1727dde82043e77c4e50438fd8d7", "score": "0.62286264", "text": "def api_search_recentchats\n result_pattern = /CHATS (.*)/\n result = command(\"SEARCH RECENTCHATS\")\n unless chats_match = result_pattern.match(result)\n return []\n end\n\n chats_match[1].split(/,\\s*/)...
[ { "docid": "3cb769e9c78e6380549525480ffaf8d8", "score": "0.5896767", "text": "def searched(params)\n if params.is_a?(::Array)\n params.take(3).join(\", \") + \" ...\"\n else\n params\n end\n end", "title": "" }, { "docid": "e57dc5dd40ef70de760d12f6...
c6ab948610107d6e63b00e21ccaf48b3
Before a scene is transitioned to it is called with the previous scene. This allows for the new scene to retrieve any data from the previous scene to assist with the layout of the current scene.
[ { "docid": "cae822a852f32f79acd29a9c857fe469", "score": "0.7957395", "text": "def prepare_transition_from(old_scene) ; end", "title": "" } ]
[ { "docid": "4844bddd6525ba4e0f7f577cbd6651e5", "score": "0.7797336", "text": "def prepare_transition_to(new_scene) ; end", "title": "" }, { "docid": "ec52650b06104fea56c5bc654d212cd9", "score": "0.74206746", "text": "def change_scene\n if @scene == :none\n SceneManager.re...
5b961d14f2fbb5c1693f46f8e1e3b08b
Parses the remote Website Returns an Array with Scraper::Data items
[ { "docid": "2d7952f65bd845db984ecf5c7ae72573", "score": "0.0", "text": "def parse\n data = []\n if self.static_data.class.name == \"Hash\"\n table = find_table_by_column_size if !self.column_count.nil?\n map_columns(table)\n data = process_rows(table, self.static_data)\n ...
[ { "docid": "115c66bd365d61c58703ecd06d2f295f", "score": "0.710072", "text": "def scrape\n pull_results\n end", "title": "" }, { "docid": "65b99535480d70960c0528634be10519", "score": "0.6983931", "text": "def scrape\n uri = URI.parse(@url)\n http = Net::HTTP.new(uri.host, ur...
c6aac5b19e161cfe4076bfb3743abbfb
GET /baz74s or /baz74s.json
[ { "docid": "5e9e421130e37c707838b1d5712e795b", "score": "0.0", "text": "def index\n @baz74s = Baz74.all\n end", "title": "" } ]
[ { "docid": "7cd6ca78f8717d0f399feaef65251e05", "score": "0.6102868", "text": "def get! *args\n get *args\n expect(last_response.status).to eq(200)\n end", "title": "" }, { "docid": "267d42433c81a818fe6285be04de8b0b", "score": "0.6033532", "text": "def getApiString(url,*args)\n...
0fd4d5d369cedb63524f6d9f8f301fe9
Get the admin that corresponds to this user
[ { "docid": "969afbeff3176abe29a2b678602b5b26", "score": "0.68513244", "text": "def matching_admin\n Admin.active.where(email: email).first\n end", "title": "" } ]
[ { "docid": "b1a41867322764fd322746c32fc32202", "score": "0.8387272", "text": "def get_admin_user\n get_users.find { |u| u.role == UserRole::ADMIN }\n end", "title": "" }, { "docid": "255df9b063018cf992cbf3ddfde96ff7", "score": "0.818154", "text": "def admin\n @admin ||= se...
74e8e23d2ad5743f5649a0628a8af572
Redirect to previous page after sign in
[ { "docid": "20ecace73435501c0974d2b1518e3334", "score": "0.0", "text": "def store_location\n if(request.path != \"/profiles/sign_in\" &&\n request.path != \"/profiles/sign_up\" &&\n request.path != \"/profiles/password/new\" &&\n request.path != \"/profiles/password/edit\" &&\n re...
[ { "docid": "9c046b63990cb325dc79c3b36b333015", "score": "0.81070846", "text": "def redirect_to_appropriate_page_after_sign_in\n if params[:redirect_back_url]\n redirect_to params[:redirect_back_url]+\"?auth_token=#{@current_user.auth_token}\"\n else\n redirect_to default_redirect_url_aft...
5fab683d9917e19cab909d9d0a85be93
A class which controls inventories, equipment, and skills of an Actor instance. TODO: add actual values to the equipment hash
[ { "docid": "6b6b5a0d025bcd0f9cc9464d37eb1d1e", "score": "0.62862396", "text": "def initialize\n @equipped = {:armour => 0, :weapon => 0, :spell => 0}\n end", "title": "" } ]
[ { "docid": "90405bedebb708b0984f6ddd999c3482", "score": "0.65212995", "text": "def setup(actor_id)\n actor = $data_actors[actor_id]\n @actor_id = actor_id\n @job_history = []\n for job in Jobs\n @job_history.push({'name'=>job['name'], 'ap'=>0})\n end\n @job_current = Unemployed\n ...