query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
2005e3ce76b1927fbf34d8a957115052
PUT /comments/1 PUT /comments/1.json
[ { "docid": "07cc2d5d9e708241aef65eed93c147a0", "score": "0.0", "text": "def update\n respond_to do |format|\n if @comment.update_attributes(params[:comment])\n format.js \n else\n format.js { render action: \"edit\" }\n end\n e...
[ { "docid": "1dbb9320c747e53a3ed8fbd81c7b2d14", "score": "0.72931236", "text": "def update\n @api_v1_comment = @post.comments.find(params[:id])\n params[:comment].delete :created_at\n params[:comment].delete :updated_at\n respond_to do |format|\n if @api_v1_comment.update_attributes(para...
391fd666bf64dd6ccb61d55109e8aebe
Copyright (c) 2013 University of Manchester and the University of Southampton. See license.txt for details.
[ { "docid": "2737a1d4101f91b55eda2548f11e8381", "score": "0.0", "text": "def workflow_aux(action, opts = {})\n\n # Obtain object\n\n case action\n when 'create';\n return rest_response(401, :reason => \"Not authorised to create a workflow\") unless Authorization.check('create', Workflow, opts[:...
[ { "docid": "a9dd648a5d0d2e7d56223e7c753f5e2e", "score": "0.62940145", "text": "def telegraphical()\n end", "title": "" }, { "docid": "e44ae2cef169d29f78b2b6306add59da", "score": "0.6180619", "text": "def huddlingly()\n end", "title": "" }, { "docid": "9dcc74dd11eb11...
8ed00556d4122e3eccfd9b5389522ebd
PUT /users/1 PUT /users/1.json
[ { "docid": "b0b28249bcc19b8c72959481fe71a4c3", "score": "0.0", "text": "def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json ...
[ { "docid": "b5edb8a9b2cad14c7874c5f42c5809e9", "score": "0.7438286", "text": "def test_put_user\n json_data = '{\"name\":\"test\", \"last_name\":\"test\", \"document\" : \"098\"}'\n put '/users/4', json_data\n assert_equal 204, last_response.status, 'Código de respuesta incorrecto'\n end", ...
808c10b4a58060480240a7725f5e94c9
Regresa todos los ejemplares que coincidan con el tipo de region,region id y idcat
[ { "docid": "51023686f25342c3540bc1a957cf0698", "score": "0.63708836", "text": "def ejemplares\n tipo_region_a_llave_foranea\n \n # Hace el query en vivo, ya que es una cantidad relativamente pequeña de ejemplares\n if campo_tipo_region.present? && params[:region_id].present? \n self.res...
[ { "docid": "832a0b89435ed064cd3ce345706e2259", "score": "0.62080926", "text": "def consulta_ejemplares_por_region\n resultados = Geoportal::Snib.select(:id, :latitud, :longitud, :tipocoleccion).where(idnombrecatvalido: params[:catalogo_id])\n\n if campo_tipo_region.present? && params[:region_id].p...
3304d9f05a66068f74c893f2074f4315
all functions here in the following format: [problem number]: [problem summary] ([answer]) def problem[problem number] ...code... end 3: find largest prime factor of 600851475143 (6857)
[ { "docid": "492437f2e991f148c8eecc8ab4f4f8d5", "score": "0.77306485", "text": "def problem3\n primeFactors(600851475143)[-1]\nend", "title": "" } ]
[ { "docid": "fd373a56539b5320e7ec4bc9f4d23180", "score": "0.8251594", "text": "def p3\n require 'Prime'\n puts \"The largest prime factor of 600,851,475,143 is:\"\n puts 600851475143.prime_division.last[0]\n end", "title": "" }, { "docid": "a59c5edd9c4b5bbad96ac5921bb76303",...
dffe0ed0ce7b2f755ba2d3754309077d
def select_category_from_projects "SELECT category FROM projects;" end Make sure each ruby method returns a string containing a valid SQL statement.
[ { "docid": "b92a9c1b97b0e6382f86571a6809f75f", "score": "0.55734766", "text": "def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n<<-SQL\n SELECT DISTINCT title ,SUM(amount) FROM projects INNER JOIN pledges ON projects.id = pledges.project_id\n GROUP BY projects.titl...
[ { "docid": "f29c03f41fcbf7f3deef5c9ec9edc233", "score": "0.91981363", "text": "def select_category_from_projects\n\"SELECT category FROM projects;\"\nend", "title": "" }, { "docid": "3c34955a35dbbb73618bec24984ca15e", "score": "0.70684034", "text": "def selects_the_category_names_and...
685015d75cb079efb0c62e696a38e26b
additional names for convieniencee
[ { "docid": "789ecd92951eb3974efe57289b3fc79b", "score": "0.0", "text": "def user \n\t\tself.viewer\n\tend", "title": "" } ]
[ { "docid": "40ba36ef5bb45ebc29ece43ad379653c", "score": "0.6810477", "text": "def possible name ; end", "title": "" }, { "docid": "0430b5e3f4873113d804699ac5b29902", "score": "0.67880803", "text": "def cop_names; end", "title": "" }, { "docid": "9f9409c4583549771b4c0f529a...
0fadf911b35d29dbe16f67e23c8b28cc
DELETE /subdomains/1 DELETE /subdomains/1.xml
[ { "docid": "722a7a65e4c52b6e746f2eb6957daeec", "score": "0.738915", "text": "def destroy\n @subdomain = Subdomain.find(params[:id])\n @subdomain.delete\n\n respond_to do |format|\n format.html { redirect_to(subdomains_url) }\n format.xml { head :ok }\n end\n end", "title": ""...
[ { "docid": "264301fd08fa640264e85ab33b603fc4", "score": "0.67641795", "text": "def delete(*args)\n url, subdomain, path, = parse_args(*args)\n rewrap_errors do\n RestClient.delete(build_url(url || subdomain, path), headers)\n end\n end", "title": "" }, { "docid": "f8...
43412067cbc5bf0d64472bc416edd294
When a user is setting up a new vagrant, prompt them for their full name and email. We'll set these within vagrant so we avoid people accidently commiting as the "vagrant" user.
[ { "docid": "8cc5e1251bb22626318060bde0edd58e", "score": "0.5306732", "text": "def generate_git_commiter_facts()\n existing_details = fetch_git_commiter_details_from_file()\n # don't set the git configs if the user opted out\n if existing_details.has_key? 'optout'\n ...
[ { "docid": "b52ca0f1ef8c3341734d3890cc81d2ae", "score": "0.6425329", "text": "def vagrant_vm_name(name)\n return \"vagrant-#{name}-#{ENV['USER']}\"\nend", "title": "" }, { "docid": "0237e9c424098e7137ab8fcf4d367cff", "score": "0.615175", "text": "def determine_default_user_email\n...
5de939ccd957f3702c21862065a79d3e
test basic guest level requests
[ { "docid": "7dc3be34db03d43a323771846102a599", "score": "0.6999567", "text": "def test_default_guest_gives_login_screen\n get '/'\n assert last_response.ok?\n assert last_response.body.include?('log in to continue')\n end", "title": "" } ]
[ { "docid": "a62a6bf40caeda4e8af2cce0bcd95a3b", "score": "0.6861626", "text": "def get_a_guest(args = {}) \n get(\"/guestaccess.json/#{args[:guestId]}\", args)\nend", "title": "" }, { "docid": "a62a6bf40caeda4e8af2cce0bcd95a3b", "score": "0.6861626", "text": "def get_a_guest(args = {}...
a58d3706e61c0ecbe1b5785d226eb698
create an unique identifier 'order_number'
[ { "docid": "1051422c3d8e30aa45efbc5c099720d0", "score": "0.7260888", "text": "def order_number\n \"66-#{Time.now.strftime('%m%d')}-#{self.id}\"\n end", "title": "" } ]
[ { "docid": "fecd46a7877c41a2a5bdf647a93e6708", "score": "0.7992339", "text": "def generate_order_number\n self.number = generate_unique_number\n end", "title": "" }, { "docid": "f6edf3af0bb16e30ce10c6f447ba94a2", "score": "0.7933669", "text": "def unique_order_number\n # \"#...
4792a585a5560aa6e165963a29587fd9
Convert results to entities
[ { "docid": "25b20ae795267ad27a028f3c1dc23770", "score": "0.63376874", "text": "def create_entities\n results = []\n if @attributes.has_key?(:entities)\n @attributes[:entities].each do |result|\n results.push Muddyit::Collections::Collection::Entities::Entity.new(@muddyit, result.merge...
[ { "docid": "f2e1baea7c732105d1e15f6fa753f78c", "score": "0.68390524", "text": "def to_a\n list = parsed_body['Data']['Entities']['Entity']\n if Hash === list\n list = [list]\n end\n list.map do |data|\n Result.new('Entity', renderer.result(data),...
9146985ae802fbd807130d218a3607fd
validates if a user is logged_in, reroutes to root_path if not
[ { "docid": "bde45fdf68116391cb4f2bbd77f3d0b5", "score": "0.72439444", "text": "def logged_in?\n if session[:user_id].nil?\n redirect_to root_path\n else\n true\n end\n end", "title": "" } ]
[ { "docid": "c0d4af5398d098f9c0de8adf5e577751", "score": "0.77892125", "text": "def verify_logged_in\n redirect_to root_path unless logged_in?\n end", "title": "" }, { "docid": "a50f556fc6f436c446e8849e8d795ea2", "score": "0.76900214", "text": "def logged_in_user\n unless...
1a1cc8588d73a6cdc9f78603f8e84b2f
DELETE /poas/1 DELETE /poas/1.json
[ { "docid": "cb9a35717712194ef3cda024a4d3d4e8", "score": "0.71604455", "text": "def destroy\n @poa.destroy\n respond_to do |format|\n format.html { redirect_to poas_url, notice: 'Poa was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.72508603", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "3b5a87acaef0470cb174588fae6685bf", "score": "0.0", "text": "def set_search\n @search = Search.friendly.includes(:origin,:destination, :locations).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...
b1b8ded159747250873689b3bf1ee585
SURF_FEE = 0.15 YANDEX_PROCESSOR_FEE = 0.035 SURF_GROSS_FEE = SURF_FEEYANDEX_PROCESSOR_FEE
[ { "docid": "646108abfb8f146460310f6ac7917def", "score": "0.0", "text": "def sample_product?\n self.kind == \"sample_product\"\n end", "title": "" } ]
[ { "docid": "d4aef2b56f6746b32786d0e1943c953f", "score": "0.70245206", "text": "def ship_fedex\n 0.0\n end", "title": "" }, { "docid": "309e6fb58a08ca0a6cbee41fcb1d5d11", "score": "0.6656666", "text": "def trainer_fee_gst\n (trainer_fee_amount * Settings.fees.gst_percent).round...
3581e696ca6b462175769f7e2820c3df
Get whether the task list is completed or not. ==== Returns true, if the task list is completed else returns false.
[ { "docid": "ae7d1b060d198cf4fdc9cd92da877b38", "score": "0.7386688", "text": "def isCompleted\r\n\t\t\t\t\treturn @completed\r\n\t\t\t\tend", "title": "" } ]
[ { "docid": "65516927542e2b0f7474464c09c7799b", "score": "0.80854744", "text": "def to_do_list_completed?\n return @to_do_list.all? {|item| item.completion_status == true}\n end", "title": "" }, { "docid": "017894f3280580d2f2fdfe3cabaa3c81", "score": "0.8046172", "text": "def ...
ea505f5ce73c684ff95aa3c9a9cb5f68
GET /regexes/1 GET /regexes/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "66a58fbdeb5e7b5329337d02db778567", "score": "0.69273245", "text": "def show\n @regex = Regex.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @regex }\n end\n end", "title": "" }, { "docid": "3156ead821f6c...
7dc42c8df562c812e0c1c1e1f0a39779
PATCH/PUT /generated_feedbacks/1 PATCH/PUT /generated_feedbacks/1.json
[ { "docid": "cba5cdac8aac8ee13efc66fb8234c020", "score": "0.6766348", "text": "def update\n\n if @generated_feedback.update(generated_feedback_params)\n redirect_to(edit_auto_gens_path, :notice => \"Generated feedback was successfully edited.\")\n else\n redirect_to(edit_auto_gens_path, :...
[ { "docid": "d7e3523b3cfdad8e224ae64bf8cbd5a9", "score": "0.7192793", "text": "def update\n respond_to do |format|\n if @feedback.update(feedback_params)\n format.json { head :no_content }\n else\n format.json { render json: @feedback.errors, status: :unprocessable_entity }\n ...
59680d95ab2dee54edc31d1c803b09cb
1^2 + 2^2 + ... + 10^2 = 385 The square of the sum of the first ten natural numbers is, (1 + 2 + ... + 10)^2 = 55^2 = 3025 Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is 3025 385 = 2640. Find the difference between the sum of the squares of the first on...
[ { "docid": "87d73bb1db982a3c6143c4e683c05b72", "score": "0.0", "text": "def sum_of_squares( range )\n range.inject(0){ |sum, i| sum + i**2 }\nend", "title": "" } ]
[ { "docid": "978b7cd00819d4961d7b5be41889c4bd", "score": "0.82670116", "text": "def p6\n ans = ( ((1..100).inject(:+) )**2 ) - ( (1..100).reduce { |sum, n| sum += n**2 } )\n puts \"The difference between the sum of the squares of the first \"\\\n \"one hundred natural numbers and the ...
2b13b375e28de1c3803f54d869ecbcc9
Removes all ConfirmationEvent public for TEST Only
[ { "docid": "835197508e4c86047746950e9bf7ca06", "score": "0.7904881", "text": "def remove_all_confirmation_events\n ConfirmationEvent.find_each(&:destroy)\n end", "title": "" } ]
[ { "docid": "c351ba5fbde40eb9d8eaf8ecddc3009e", "score": "0.6233453", "text": "def clear_common_event\r\n @common_event_id = 0\r\n end", "title": "" }, { "docid": "439046cb65de489b9e550784c19a3453", "score": "0.62034243", "text": "def clear_common_event\n @common_event_id = 0\n...
8784f4698f667ec82a25b0c3a4505036
POST /therapists POST /therapists.json
[ { "docid": "5df7d6b3019d76b25828496db980cf21", "score": "0.61932355", "text": "def create\n @therapist = Therapist.new(therapist_params)\n @therapist.user_id = current_user.id\n @therapist.specialty_ids = params[:therapist][:specialty_ids]\n\n respond_to do |format|\n if @therapist.save...
[ { "docid": "9f2142b93dc29198f09831d312479608", "score": "0.64040893", "text": "def create\n @therapist = Therapist.new(params[:therapist])\n\n respond_to do |format|\n if @therapist.save\n format.html { redirect_to @therapist, notice: 'Therapist was successfully created.' }\n fo...
2aed6295049d6012538e82e80d0b6ed2
POST /textiles POST /textiles.json
[ { "docid": "737e35647590da751fbfcefa1474b544", "score": "0.6782706", "text": "def create\n @textile = Textile.new(textile_params)\n\n respond_to do |format|\n if @textile.save\n format.html { redirect_to @textile, notice: 'Textile was successfully created.' }\n format.json { ren...
[ { "docid": "6028023c3fce075928700008fb8bf438", "score": "0.63485086", "text": "def index\n @textiles = Textile.all\n end", "title": "" }, { "docid": "0ad99512631716d3e9ea7760924277e5", "score": "0.63054466", "text": "def textile_params\n params.require(:textile).permit(:size...
0fa6afe21b7ac803b1f41bfe34287ccc
angular momentum of rotating rigid body with moment_inertia rotating at angular_velocity_ (vector in J s)
[ { "docid": "240974d21b73b5d0ed36b619fab4d6d4", "score": "0.8494529", "text": "def angular_momentum_rigid_(moment_inertia, angular_velocity_)\n moment_inertia * angular_velocity_\n end", "title": "" } ]
[ { "docid": "9241a7b845da227950745f90e4b72331", "score": "0.7441311", "text": "def init_angular_velocity\n z = rotation_axis()\n v = init_linear_velocity_direction()\n d = z.cross(v) # if d points to the center, init_anglar_velocity > 0, \n \n to_c = center - @init_posi...
6ad64d8c10ab8aa3e6609de9a4e6f918
Returns true if this input is a coinbase input.
[ { "docid": "6e0f281b0688edafc707289d321db20a", "score": "0.69452494", "text": "def coinbase?\n return self.previous_index == INVALID_INDEX && self.previous_hash == ZERO_HASH256\n end", "title": "" } ]
[ { "docid": "8ec34e42de903f43db73c8b4d25dc737", "score": "0.8398845", "text": "def coinbase?\n self.inputs.size == 1 && self.inputs[0].coinbase?\n end", "title": "" }, { "docid": "f64a4823021eef71b647e29006ad3b5a", "score": "0.74623275", "text": "def coinbase?\n (@prev_...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "ce85e824167329495258f1a03b560ed6", "score": "0.0", "text": "def set_billhi\n @billhi = Billhi.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...
f39dadd565e07294baaafa987a6a74a2
Add multiple filters using +add_filter+
[ { "docid": "3782c76b1d0d48a9106181fae2668125", "score": "0.61016643", "text": "def add_filters(fields, operators, values)\n if fields.is_a?(Array) && operators.is_a?(Hash) && (values.nil? || values.is_a?(Hash))\n fields.each do |field|\n add_filter(field, operators[field], values && value...
[ { "docid": "4e6a938aafa6c7582b1367a74e6acd56", "score": "0.7975065", "text": "def add_filters(filters); end", "title": "" }, { "docid": "a9d0bf97082ad54e16ad5ad3f3c05105", "score": "0.7520046", "text": "def add_filters\n add_term_filters\n add_terms_filters\n add...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "39be87ce157b7f64ab1225845ddcd3d3", "score": "0.0", "text": "def set_ticket\n @ticket = Ticket.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60315156", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6018921", "text": "de...
3f52973818698070d105a2c20fdb77a5
Serializes information the current object
[ { "docid": "1e9eff479be19ed308c24ffa0f0a2a33", "score": "0.0", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_boolean_value(\"check32BitOn64System\", @check32_bit_on64_system)\n ...
[ { "docid": "0795eac2a3b746fc7fea6373714e1986", "score": "0.7951372", "text": "def serialize\n end", "title": "" }, { "docid": "762bca0e2db3ff19d91cc4521bb1e1d9", "score": "0.7645999", "text": "def serialize(object) end", "title": "" }, { "docid": "a126e681346630c4ec3...
1de50042ad0ffe1ba10791f8d668fd64
CREER UN NOUVEAU POTIN
[ { "docid": "82e0cdeac10320f07f5336e0d4c3601a", "score": "0.0", "text": "def new\n @gossip = Gossip.new\n end", "title": "" } ]
[ { "docid": "af28645848ef7ec87d8260abda095840", "score": "0.66161615", "text": "def crea_con_nombre_comun\n ad = Adicional.new\n ad.especie_id = id\n ad.nombre_comun_principal = ad.pon_nombre_comun_principal\n ad\n end", "title": "" }, { "docid": "2ad67147439033e652f0bad8389b491d...
0c4b9b0dd5d48f24dcff1b59012b6e39
difference of left and right heights is not more than 1 returns boolean
[ { "docid": "d09b07d6b6d4645e96f75065868c52df", "score": "0.7193949", "text": "def balanced?\n left_height = height(@root.left_child)\n right_height = height(@root.right_child)\n return (left_height - right_height).abs <= 1\n end", "title": "" } ]
[ { "docid": "a879af0a5d892104266312c5005a251c", "score": "0.6862807", "text": "def balanced_horiz?\n number_nodes_horiz.between?(2**(get_depth_horiz - 1), 2**get_depth_horiz)\n end", "title": "" }, { "docid": "beb113b91a05f542d6e3934b491d83c7", "score": "0.6855589", "text": "def h...
6cafb60056c35b20e714dc8e196d4617
Sets which indexer should be used for the given node class. You can share an indexer between several different classes. ==== Example class Contact include Neo4j::NodeMixin index :name has_one :phone end class Phone include Neo4j::NodeMixin property :phone node_indexer Contact put index on the Contact class instead inde...
[ { "docid": "4521669dcb1b405a7f8c5b82add8ed78", "score": "0.7098424", "text": "def node_indexer(clazz)\n indexer(clazz, :node)\n end", "title": "" } ]
[ { "docid": "b941567c21df40ad3b4fece69974f9a6", "score": "0.6320463", "text": "def node_indexer(config = _config || IndexConfig.new(:node), &config_dsl)\n config.instance_eval(&config_dsl)\n indexer(config)\n end", "title": "" }, { "docid": "c35915b6a73ea857533e4efe3d...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "cbd121649bf052d77f8f02585d3df404", "score": "0.0", "text": "def set_group\n # byebug\n @group = Group.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;...
5a1180ed3fddd1d6600a3e2efcbda572
sets order status text
[ { "docid": "683d9764342dd4f8082951648263e812", "score": "0.0", "text": "def set_ordsts_txt (ordsts)\n if ordsts.to_i==1\n txt=\"Available\"\n elsif ordsts.to_i==2\n txt=\"Submitted\"\n elsif ordsts.to_i==3\n txt=\"Accepted\"\n else \n txt=\"Unknown\"\n end\n return txt\n...
[ { "docid": "be55f2c75d5b5e855d7a617625596f70", "score": "0.68072915", "text": "def order_status_label(order)\n cls = {\n 'pending' => 'info',\n 'payed' => 'success',\n 'cancelled' => 'warning'\n }\n \"<span class='label label-#{cls[order.status]}'>#{order.status}</span>\".html_sa...
3c0cea336c723962096a695126867d0f
Provide a detailed, user friendly representation
[ { "docid": "d9cca740a917394a643eb2069194fce8", "score": "0.0", "text": "def inspect\n values = @properties.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Api.V2010.ParticipantInstance #{values}>\"\n end", "title": "" } ]
[ { "docid": "80363631cebade0e9ef3f8882509b99d", "score": "0.6817552", "text": "def details; end", "title": "" }, { "docid": "10e71201c7d33f56a89616b30aa39d6b", "score": "0.6813698", "text": "def to_s; description end", "title": "" }, { "docid": "3a05240b53527a0d76b85fb7354...
4ef945d8f68ba6e556467d3a4aadab75
Verify an SSH signature. signed_data The String message that the signature was calculated over. signature The binary String signature with SSH encoding. Returns boolean.
[ { "docid": "5f5dc82e2593476dd60970c5b7b1a695", "score": "0.7807632", "text": "def verify(signed_data, signature)\n self.class.ed25519_gem_required!\n\n sig_algo, raw_sig, _ = Encoding.decode_signature(signature)\n if sig_algo != self.class.algorithm_identifier\n raise Decod...
[ { "docid": "2a1047396367bef9e07e3bf22a0b0160", "score": "0.8195794", "text": "def verify(signed_data, signature)\n sig_algo, ssh_sig, _ = Encoding.decode_signature(signature)\n if sig_algo != ALGO_DSA\n raise DecodeError, \"bad signature algorithm: #{sig_algo.inspect}\"\n e...
aa5103c7cbabf143e5715edad86f1ec3
Public: Used to read a data_set. data_set The data_set instance to be read. by An ordered array of variable names that define a bygroup (default: []) Examples Example goes here Returns nothing.
[ { "docid": "e6b2904b5e1c170af1493d79e9bec52c", "score": "0.7779131", "text": "def read(data_set, by: [])\n RemiLog.sys.debug \"Reading Dataset **#{data_set.name}**\"\n\n data_set.open_for_read(by_groups: Array(by))\n\n begin\n while !data_set.last_row\n data_set.read_row\n...
[ { "docid": "5ba1a171732ef6dd5a509e33b4fe9c5c", "score": "0.5818392", "text": "def read_data_set_metadata\n metadata = @interface.read_metadata\n @variable_set = metadata[:variable_set]\n end", "title": "" }, { "docid": "667b71eff0fa0ce4ddd1c0f1a0967069", "score": "0.5568219"...
3258ae052a8f8af3812eb69eaf63e6de
def say_hi puts "hey! i was called for the beginning!!" end def say_bye puts "hey!! i was called when method exited" end def say_hellow puts "Hellow!!i need check for both begin and start" end def say_miaow puts "Miaow!! i need only beginning check" end before_filter :say_hi, :only => [:say_miaow, :say_hellow] after_fi...
[ { "docid": "29d07a419023bc9a12bed9c242f8d9d5", "score": "0.0", "text": "def greet\n puts \"in greet\"\n end", "title": "" } ]
[ { "docid": "dcc6749c2270ff875d24ec6eecdfc64f", "score": "0.66198236", "text": "def filter\n end", "title": "" }, { "docid": "b1e457646e25a4598ee8139ce7517e71", "score": "0.65859604", "text": "def before_filter msg, session, &block\n index = 0\n\n next_p = Proc.new ...
c026b67dad8950d10937d3af59d2472d
def avg_total_savings (object.avg_total_water_savings_per_resident object.no_residents).round(2) if object.avg_total_water_savings_per_user != nil end
[ { "docid": "39fbea6d27bb3add7e83e782d36859f1", "score": "0.67440677", "text": "def total_spent\n object.water_bills.map{|b| b.price}.reduce(0){|s, n| s+ n} if !object.water_bills.empty?\n end", "title": "" } ]
[ { "docid": "597b36abca560dce36c21721151886d6", "score": "0.7203522", "text": "def average_total_carbon_saved_per_resident\n if self.no_residents > 0\n total_carbon_savings_to_date / self.no_residents\n end\n end", "title": "" }, { "docid": "3886068f53644c582f9c95f...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "30434187625b75b84309632818de55aa", "score": "0.0", "text": "def manage_news_params\n param=params.require(:manage_news).permit(:title, :author, :content, :is_draft, :publish_at,:contest_id)\n param[:admin_id] = @admin.id\n if params[:commit] == \"存为草稿\"\n param[:is_draf...
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7496729", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6958585", "text": "def strong_params\n params.require(:request).permit(param_white...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "d514841a06719997509748f83fc23d96", "score": "0.0", "text": "def set_bs_column\n @bs_table = BsTable.find(params[:bs_table_id])\n @bs_column = @bs_table.bs_columns.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60310596", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6014974", "text": "de...
44f2a7fbc2650f3866ea2650ebe3f823
Returns the maximum coordinate for an area.
[ { "docid": "0b40d5aeada5d3d2a4e1f3b550bfb2fd", "score": "0.0", "text": "def dn_position\n return 0 if d_dn <= 0\n\n d + d_dn\n end", "title": "" } ]
[ { "docid": "6a645f0f10e65daab7efdb291a6314a4", "score": "0.75360477", "text": "def sq_area_max(coordinates, matrix_length)\n binding.pry\n area = matrix_length ** 2\n right = (matrix_length-1) - coordinates[0]\n left = (matrix_length - 1) - right\n top= (matrix_length-1) - coordinates[1]\n bottom=...
3d1863134f58e683356e76e45a3e0828
Adds support for one or more aspects for the given simple function Example: Compass::BrowserSupport.add_support("image", "moz", "webkit") => Adds support for moz and webkit to the image() function. This function can be called one or more times in a compass configuration file in order to add support for new, simple brow...
[ { "docid": "ea7f87dff14fa8e4af2d7182da0bb99d", "score": "0.81435853", "text": "def add_support(function, *aspects)\n aspects.each do |aspect|\n unless ASPECTS.include?(aspect)\n Compass::Util.compass_warn \"Unknown support aspect: #{aspect}\"\n next\n end\n un...
[ { "docid": "14327bdc3c0988b20debe4589207fa8e", "score": "0.5662177", "text": "def add_supports\n if !self.supports.empty?\n Railspress::PostsHelper.add_post_type_support(self.name, self.supports)\n self.supports = nil\n elsif false != self.supports\n # Add default featur...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "500cd9628bcc2f608f24217b541e4cb7", "score": "0.0", "text": "def update!(**args)\n @object_definitions = args[:object_definitions] if args.key?(:object_definitions)\n @operation_ids = args[:operation_ids] if args.key?(:operation_ids)\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...
03351ededcd1c725301ef793e7dca16f
same as task.start in ruby run scripts
[ { "docid": "5d886bc5a7e661b38c6946cd8f0e0209", "score": "0.6488434", "text": "def start(task)\n @tasks[task].start\n end", "title": "" } ]
[ { "docid": "55e60e9378af6047a7ac03c6d784996a", "score": "0.6991436", "text": "def startcmd\n [initscript, :start]\n end", "title": "" }, { "docid": "f22e5a1c8afa8b9194cad554d3c30aa2", "score": "0.6978421", "text": "def start\n runner.run if options[:all_on_start]\n rescue...
40af467d61736635bf9d3746ec4f3d9c
open temp YAML file(s) for editing, return edited contents
[ { "docid": "9a9b23fbd705cf4dff93f2e13a0d04ac", "score": "0.76237047", "text": "def edit_tmp_yaml num = nil\n name = File.basename($0, File.extname($0))\n temps = Array.new(num || 1) { Tempfile.new([name, '.yaml']) }\n\n if num\n yield temps\n else\n yield temps[0]\n end\n\n temps.each(&:flus...
[ { "docid": "b86bbddee0a1e026747521870ffd12b7", "score": "0.7000562", "text": "def edit_in_yaml( object )\n\t\t\tyaml = object.to_yaml\n\n\t\t\tfn = Digest::SHA1.hexdigest( yaml )\n\t\t\ttf = Tempfile.new( fn )\n\n\t\t\ttf.print( yaml )\n\t\t\ttf.close\n\n\t\t\tnew_yaml = edit( tf.path )\n\n\t\t\tif new_...
a69d1fb338daf33f39abdeb0b1e045e1
helper function that puts blinds in pot upon dealing cards in first round of game sets first player to person after big blind
[ { "docid": "97f36d539c0924ceed7cb9b6d6837e01", "score": "0.71772695", "text": "def addBlinds()\n s_blind_loc = get_next_player(self.dealer) # location of small blind player\n b_blind_loc = get_next_player(s_blind_loc) # location of big blind player\n # get player data for small and big blind lo...
[ { "docid": "633cf5403077a81055a70cf6867f6a00", "score": "0.701084", "text": "def set_blinds\n @active_players[0].current_bet = @small_blind_value\n @active_players[1].current_bet = @big_blind_value\n @table_current_bet = @active_players[1].current_bet\n @pot_size += @active_players[0].current_bet + ...
ce86eed889efd605f9f1d3ee4a5d480c
GET /items/1 GET /items/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "41699dd17c12d7e8d1afd1406f087302", "score": "0.80987954", "text": "def item(id)\n get(\"/item/#{id}.json\")\n end", "title": "" }, { "docid": "eb354ffc8205e277e16c339add996ccd", "score": "0.74948645", "text": "def show\n item = Item.find(params[:id])\n render js...
df9f2f57cccd5255b4a142cf0822a36c
Select the near servers from a list of provided candidates, taking the local threshold into account.
[ { "docid": "123f8b2909bad7743486cccce5b038e0", "score": "0.79037696", "text": "def near_servers(candidates = [], local_threshold = nil)\n return candidates if candidates.empty?\n\n # Average RTT on any server may change at any time by the server\n # monitor's background thread. ARTT...
[ { "docid": "de9aa73875ca6239db09b1e37546c02d", "score": "0.79165083", "text": "def near_servers(candidates = [])\n return candidates if candidates.empty?\n nearest_server = candidates.min_by(&:average_round_trip_time)\n threshold = nearest_server.average_round_trip_time + (local_thr...
e1e35728ac85140d6f8ff2ce2dd1ac71
Determines the moves a queen can make at any given time
[ { "docid": "c3e5406dc401d909b1e3c2f889da1c5d", "score": "0.67742735", "text": "def moves_queen(color, a, b)\n\t\t_moves = []\n\t\t(continue_left(color, a, b)).each{|move| _moves << move}\n\t\t(continue_right(color, a, b)).each{|move| _moves << move}\n\t\t(continue_up(color, a, b)).each{|move| _moves << ...
[ { "docid": "c4922f920965f2e263f73c069f60f8f5", "score": "0.6882753", "text": "def possible_moves(spaces)\n possible_moves = []\n if ((@position + 1) % 8 == 0)\n @moves = [8,7,-1,-9,-8]\n elsif (@position % 8 == 0)\n @moves = [-8,-7,1,9,8]\n end\n @moves.each do |move|\n pos...
16db3ef075547c7f6068183a8257c168
DELETE /run_histories/1 DELETE /run_histories/1.json
[ { "docid": "e008503ff64c306a3a94d6fdb25145c4", "score": "0.75385565", "text": "def destroy\n @run_history.destroy\n respond_to do |format|\n format.html { redirect_to run_histories_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "162bc3ad5b1bc316dc328036f6446967", "score": "0.69162446", "text": "def destroy\n @pur_hist = PurHist.find(params[:id])\n @pur_hist.destroy\n\n respond_to do |format|\n format.html { redirect_to pur_hists_url }\n format.json { head :no_content }\n end\n end", "title...
d30cf75ce4888bcbeb6f568c109d9fd5
PUT /users/1 PUT /users/1.xml
[ { "docid": "a9cefa8af3f8964e2b308cb918686b42", "score": "0.0", "text": "def update\n @user = User.find(params[:id])\n if not (@current_user.mine?(@user) || @current_user.admin? || @current_user.produce? )\n redirect_to @current_user\n else\n\n respond_to do |format|\n if @use...
[ { "docid": "796bea4dfdd3ac16e7fb19e770af3338", "score": "0.6381075", "text": "def update_user_attributes(attributes)\n # puts \"update_user_attrbites: [#{attributes.inspect}]\"\n raise ArgumentError, \"username blank\", caller if attributes['username'].empty?\n path = \"/a/feeds/nyit.edu/...
3722c1eaa84001816677cf69e514ca4f
Displays the report via the configured reporter.
[ { "docid": "27c24b94422ea3729fbcddd6aa1a1dbd", "score": "0.8511658", "text": "def display\n @reporter.display_report(self)\n end", "title": "" } ]
[ { "docid": "bc33b7d5f03d0063327c3f5efcb07387", "score": "0.68412495", "text": "def report\n end", "title": "" }, { "docid": "bc33b7d5f03d0063327c3f5efcb07387", "score": "0.68412495", "text": "def report\n end", "title": "" }, { "docid": "56e1dbd233cb245ce5ba45e07bdd...
d31f52a5d6586abcb7e327baf0d78df6
GET /materials/1 GET /materials/1.json
[ { "docid": "1a500bfeec9c218c04691be0489968be", "score": "0.6502998", "text": "def show\n if @material\n @object=@material\n curriculum_id=@material.curriculum_id\n @curriculum = Curriculum.find(curriculum_id)\n @materials=Curriculum.get_root_material(curriculum_id)\n else\n ...
[ { "docid": "8a41b32bd282ecaac703a3741b5f7655", "score": "0.8052943", "text": "def show\n\n type = params[:material_type]\n id = params[:id]\n include_related = params.has_key?(:include_related) ?\n params[:include_related].to_i :\n ...
974bf9e414c6b1f7ef85a48c118113da
Linux container processes Runs the "lxcps" command.
[ { "docid": "13c8e676872cb714aab9bda068c5bbc0", "score": "0.5494576", "text": "def ps(*args)\n self.exec(\"lxc-ps\", *args).split(\"\\n\")\n end", "title": "" } ]
[ { "docid": "1664e66d9354c7cc961cf07e2faccd17", "score": "0.57496953", "text": "def start(*args)\n self.exec(\"lxc-start\", *args)\n end", "title": "" }, { "docid": "949135f1d7f4f365d951e702f95123aa", "score": "0.5618335", "text": "def exec(*args)\n arguments = Array.new\...
96932d06e4932ac3ff1008a2652c90d3
PUT /trackings/1 PUT /trackings/1.json
[ { "docid": "a7d44de81c402a22c1b47b5630944cfd", "score": "0.631741", "text": "def update\n @tracking = Tracking.find(params[:id])\n\n respond_to do |format|\n if @tracking.update_attributes(params[:tracking])\n format.html { redirect_to @tracking, notice: 'Tracking was successfully upda...
[ { "docid": "c7faf8c55127145d7f3645fb1d60b6e0", "score": "0.6991279", "text": "def update\n @track = Track.find(params[:id])\n\n if @track.update(track_params)\n head :no_content\n else\n render json: @track.errors, status: :unprocessable_entity\n end\n end", "title": "" }, ...
8a910a8fc5eab06f2f4eff1021c716c3
Devuelve la huella nutricional de un plato
[ { "docid": "99d53ec8f52281677e2772297b7ed610", "score": "0.61443675", "text": "def new_Huella_nutricional\n\t\t((Float(self.new_VCT + self.new_GEI))/2).round(1)\n\tend", "title": "" } ]
[ { "docid": "aaa94c6ac7458336986d42612c438e8a", "score": "0.7088777", "text": "def plato(n)\n\t\t plat=\"#{@descripcion[n]}, #{@porcion[n]}, #{@gramos[n]}\"\n\t\t return plat\n\t end", "title": "" }, { "docid": "6f549691c907be92de6414ace3102203", "score": "0.6663754", "text":...
066675d4dedb4f6f6bebce652b9d552f
Execute the Choreo using the specified InputSet as parameters, wait for the Choreo to complete and return a ResultSet containing the execution results.
[ { "docid": "1b857122a7654efbde23598f4bb52c0f", "score": "0.0", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = DeleteResultSet.new(resp)\n return results\n end", "title": "" } ]
[ { "docid": "c4ca32683e8ce75eb6a187d63df8fa77", "score": "0.76639634", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = DoneResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "6f7a7d9be674ad4cf17d6743eb1f7836", "scor...
42384a48a310b2c7e2f01a93352ae979
Returns true if the given token matches the digest
[ { "docid": "ccf1dd4fda2592dea22553a6fc9e9cbe", "score": "0.0", "text": "def authenticated?(attribute, token)\n digest = self.send(\"#{attribute}_digest\")\n return false if digest.nil?\n BCrypt::Password.new(digest).is_password?(token)\n end", "title": "" } ]
[ { "docid": "8ddd0f11de4f651615620fb44c9e44e9", "score": "0.8236084", "text": "def matches_token?(digest, token)\n if digest.present?\n BCrypt::Password.new(digest).is_password?(token)\n else\n false\n end\n rescue BCrypt::Errors::InvalidHash\n false\n end", "t...
0921b16cdf55ed6112aa91dcdf749e91
CHANGE THIS CODE so that the tests pass. when you put in fruit as a key, you should get apple
[ { "docid": "723d25834f1f3a96e7baaf908d984d7b", "score": "0.5849558", "text": "def get_favorite(key, json)\n\n\t#first- get some string and parse for JSON to get array of favorites\n\th = JSON.parse(json)\n\tfavorites=h[h.keys[0]]\n\t\n\n\t#find fruit in array favorites\n\treturn favorites[key]\n\nend", ...
[ { "docid": "a6bef6cc65f0c510526cd79d121cc760", "score": "0.7041882", "text": "def select_fruit(prod)\n keys = prod.keys\n counter = 0\n fruits = {}\n key_term = \"Fruit\"\n loop do\n break if counter > keys.size\n if prod[keys[counter]] == key_term\n fruits[keys[counter]] = key_term\n ...
2a07966b82b10bf26d6e72b604961bce
PUT /wikis/1 PUT /wikis/1.json
[ { "docid": "9b57e2b6396f24350e69d6b08b33892b", "score": "0.57333785", "text": "def update\n @wiki = Wiki.find(params[:id])\n @wiki.update_attributes(:changed_by => current_user)\n \n\n respond_to do |format|\n if @wiki.update_attributes(params[:wiki])\n @wiki.audit_tag_with(@wi...
[ { "docid": "d17160edc2e7eb736ae42e1c01a2db55", "score": "0.6466409", "text": "def update\n @wiki = @project.wikis.find(params[:id])\n\n respond_to do |format|\n if @wiki.update_attributes(params[:wiki])\n flash[:notice] = 'Wiki was successfully updated.'\n format.html { redirect...
49cd3ed2daf30f1788343b88be96d0ae
submit follow user request
[ { "docid": "d331e404f0f51b8a3da6ae2b564d4ac4", "score": "0.0", "text": "def fu\r\n @follow = FollowUser.new(:user_id => @u_id, :second_user_id => params[:id])\r\n if @follow.save\r\n redirect_to follow_path\r\n end\r\n @follow = FollowUser.where(user_id: @u_id, second_user_id: params[:i...
[ { "docid": "a72b0ad68699a26ec4bb0a216996adfd", "score": "0.7630949", "text": "def submit\n self.oaw_follow(params[:follow])\n self.oaw_unfollow(params[:unfollow])\n end", "title": "" }, { "docid": "d33e5a63056fac536664bdc2791ca5c7", "score": "0.73980045", "text": "def follow\n...
9087297ea63d593d6e404743f9a0d955
note that pixels per radian is for full raster must apply conversion based on shooting resolution!
[ { "docid": "633a58b3beeafa3dd918318bd1bffc0c", "score": "0.5098602", "text": "def create_rokinon_distortion_map(tilt_offset, output_basename, output_dir)\n output_x = 1920 # output resolution\n output_y = 1080 # output resolution\n max_theta = PI / 2.0 # sets half width of output warp file\n...
[ { "docid": "826447b7a2af81d5b35b2beb91dd994c", "score": "0.6070055", "text": "def pixels; end", "title": "" }, { "docid": "8a3d9d5d88c8e7c74f2be41b6e26da02", "score": "0.6045502", "text": "def pixels_to_raster(px, py, zoom)\n map_size = @tile_size << zoom\n [px, map_size - ...
b0cf5749cf614da3c84c1e2e1685a6f7
Displays all the Zendesk search options.
[ { "docid": "9ba815788f5152c29f336eb93a63e979", "score": "0.5936587", "text": "def search_menu\n resources = @storage_instance.resources\n @cli.choose do |menu|\n menu.prompt = 'search: Select option'\n\n count = 0\n resources.each do |resource|\n menu....
[ { "docid": "9e71cec6814ee99197d7eb71abc65db2", "score": "0.6615198", "text": "def show\n\n if (@search.provider.match(/\\ASearchProvider::/) && SearchProvider::Provider.subclasses.include?(@search.provider.to_s.constantize) )\n @provider_options = @search.provider.constantize.options\n else\n...
db515cdcf3f439f1e4cf566d59e99ec6
POST /m_authorities POST /m_authorities.json
[ { "docid": "851a6d6ba9898bd810c159a2bc20b592", "score": "0.62494826", "text": "def create\n @m_authority = MAuthority.new(params[:m_authority])\n\n respond_to do |format|\n if @m_authority.save\n format.html { redirect_to :controller => \"m_authorities\", :action => \"index\" }\n ...
[ { "docid": "86617bbc5b922a58b41f7c02b0bf44d0", "score": "0.64662117", "text": "def authorizations(params = {})\n scope 'default'\n post('authorizations/', params)\n end", "title": "" }, { "docid": "33bc11975cd0aaae12d0cae2d0d5fe01", "score": "0.62113917", "text": "def in...
6808f162249d01e83a1a8302abe38b04
Update an existing table Update an existing HubDB table. You can use this endpoint to add or remove columns to the table as well as restore an archived table. Tables updated using the endpoint will only modify the &x60;draft&x60; verion of the table. Use &x60;publish&x60; endpoint to push all the changes to the &x60;pu...
[ { "docid": "1ff5a7886baa6300c4d7a513624234cb", "score": "0.5954997", "text": "def update_draft_table_with_http_info(table_id_or_name, hub_db_table_v3_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TablesApi.update_draft_table ......
[ { "docid": "fbe1c944110b8a97c0b40d65402254b2", "score": "0.6354429", "text": "def update\n if ActiveRecord::Base.connection.tables.include? params[:table]\n table = params[:table].classify.constantize\n row = table.find(params[:row])\n # update row using parsed JSON\n ro...
f2722875d3acf8c157c8f1c401d1139d
returns the local project directory
[ { "docid": "174d853e6f8ab59b3e23a81f1b4277b6", "score": "0.71558505", "text": "def path\n @path ||= @project.dir.path\n end", "title": "" } ]
[ { "docid": "5779713d0c083420d8df562401d05129", "score": "0.8262279", "text": "def project_dir\n config.project_dir\n end", "title": "" }, { "docid": "e03e663ae63e40706eefe6a28ca1d975", "score": "0.77350706", "text": "def project_dir\n File.expand_path(\"#{fetch_dir}/...
d994f8e93f289b604d02128411133022
Returns the nonbase, nonpseudoelement selectors in this sequence.
[ { "docid": "81dc724a899a3d5505be75b6e7e6972d", "score": "0.0", "text": "def rest\n @rest ||= Set.new(members - [base] - pseudo_elements)\n end", "title": "" } ]
[ { "docid": "d1f9fdc2cf9785859fd25893b1a49f69", "score": "0.6683125", "text": "def standard_xpath_nots\n \"[not(self::did)][not(self::c)][not(self::c02)][not(self::c03)][not(self::c04)][not(self::c05)][not(self::c06)][not(self::c07)][not(self::c08)][not(self::c09)][not(self::c10)][not(self::c11)][not(...
09207dc90e3ed83d59f9fdf29f1a0edc
Create a new +RTeX::Document+ in either the current directory (default) or a specified, preexisting directory. The +content+ parameter should contain the document source. The +options+ hash may contain: [+:processor+] Executable with which to output the document (default: 'pdflatex') [+:preprocessor+] Executable to use...
[ { "docid": "3c81cdf99302f875853a5fca42ac92cf", "score": "0.5595098", "text": "def initialize(content, options={})\n @options = self.class.options.merge(options)\n if @options[:processed]\n @source = content\n else\n @erb = ERB.new(content)\n end\n end", "title": ...
[ { "docid": "6d1683e82bd90605cf1da1b93f9427e9", "score": "0.5837966", "text": "def render_document(input, outdir, outname, format, vars, config=nil)\r\n\r\n #TODO: Clarify the following\r\n # on Windows, Tempdir contains a drive letter. But drive letter\r\n # seems not to work in pandoc -> pdf i...
09ddc6a7715e523f28f7941bd4d5edc6
GET /prd_thresholds/new GET /prd_thresholds/new.xml
[ { "docid": "c41a68f9724f6de1a4d57748ca5a092c", "score": "0.7616998", "text": "def new\n @prd_threshold = PrdThreshold.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @prd_threshold }\n end\n end", "title": "" } ]
[ { "docid": "c79ec7ad7b044fdcd5d504ca05eb2aa3", "score": "0.72468853", "text": "def create\n @prd_threshold = PrdThreshold.new(params[:prd_threshold])\n\n respond_to do |format|\n if @prd_threshold.save\n format.html { redirect_to(@prd_threshold, :notice => 'PrdThreshold was successfull...
1a36b23deb9b015a6e4cbdf12b7400b0
Gets all the values in the current row, column, and cell, and finds values from 1 to 9 that are not already included in the set
[ { "docid": "9fdccef9dce85ba965de947b1ce6a5db", "score": "0.7214551", "text": "def possible_values(row, col)\n\t\t((1..9).to_a - (row_values(row) + col_values(col) + cell_values(row, col)).uniq)\n\tend", "title": "" } ]
[ { "docid": "0d861d1073ab572dbd9944d50e80b467", "score": "0.7160862", "text": "def find_possible_cell_numbers(row, col, sodoku)\n possible_nums = [1, 2, 3, 4, 5, 6, 7, 8, 9]\n\n used_nums = []\n used_nums << find_row_numbers(row, sodoku)\n used_nums << find_col_numbers(col, sodoku)\n used_nums << fi...
7abffa4e3264e2eabffbb6e1d03ec45b
DELETE /tipos_examenes/1 DELETE /tipos_examenes/1.xml
[ { "docid": "e5a9028186170b45d3ab08bb12ffea26", "score": "0.69900274", "text": "def destroy\n @tipo_examen = TipoExamen.find(params[:id])\n @tipo_examen.destroy\n\n respond_to do |format|\n format.html { redirect_to(tipos_examenes_url) }\n format.xml { head :ok }\n end\n end", ...
[ { "docid": "3812fc48120dcd3d5ab0f4830e033c81", "score": "0.6807479", "text": "def destroy\n @tipos = Tipo.find(params[:id])\n @tipos.destroy\n\n respond_to do |format|\n format.html { redirect_to(homes_path) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "...
ed0f1f0d52b8bd01d7a225cb796dcd18
Creates a new view table from the given query.
[ { "docid": "b404d473638c2d373f97fda7e555cf38", "score": "0.82443726", "text": "def create_view table_id, query, name: nil, description: nil\n options = { query: query, name: name, description: description }\n insert_table table_id, options\n end", "title": "" } ]
[ { "docid": "e0005a9dd43940720a5b3153a27fecff", "score": "0.67507875", "text": "def view(name)\n new_view = view_old(name)\n new_view.table_name = name\n new_view\n end", "title": "" }, { "docid": "6285a0102bf56678f015ac4ab662a512", "score": "0.65332705", "text": "de...
3341a75228724c47fd6b03561c9ba70d
Public: Instantiate new validator. ldap: GitHub::Ldap object groups: Array of Net::LDAP::Entry group objects options: Hash of options
[ { "docid": "3a97e5d84a8321ac5c4e730568b765c6", "score": "0.7811679", "text": "def initialize(ldap, groups, options = {})\n @ldap = ldap\n @groups = groups\n @options = options\n end", "title": "" } ]
[ { "docid": "311cf9f1dd279e48cadb493517f7de31", "score": "0.65478474", "text": "def initialize(ldap, options = {})\n @ldap = ldap\n @options = options\n end", "title": "" }, { "docid": "c69c5026b61ca28ecf517f736360f65b", "score": "0.6146484", "text": "def i...
e0f7251197cf54f5640250cb796708ee
Tests to see if a template file exists for the specified format. If one doesn't exist then the style would fall back to an 'anonymous' template.
[ { "docid": "447163a3bbbf3c2d8a6f76d0226844fe", "score": "0.69802785", "text": "def template?(format = :html, renderer = default_renderer)\n !(inline_template(format) || file_template(format, renderer)).nil?\n end", "title": "" } ]
[ { "docid": "a1538bd16533603e3af89dba4930903c", "score": "0.7739857", "text": "def template?(name, format)\n glob = dir.join(\"#{name}.#{format}.*\")\n Dir[glob].first\n end", "title": "" }, { "docid": "2d97c4d8d266e7ee44d5b542397be1c8", "score": "0.73571116", "text...
29307493d8b5d3748f0c80a3c6ed8de5
Asserts attributes passed in for chaos mode are valid
[ { "docid": "98ccbbdfe9a8749b320c7daa67bed88c", "score": "0.70680845", "text": "def assert_chaos_options( chaos )\n eval = -> { [Array, String, TrueClass, FalseClass, Symbol].include? chaos.class }\n msg = \"chaos: arg does not support object of type: '#{chaos.class}'\"\n raise NoSuchAttri...
[ { "docid": "70614cca49616d8819f4001d4d9f468f", "score": "0.7085583", "text": "def test_attribute_detection\n verify_method :is_attribute?, with: [\n {param: ' attr_reader :a', expect: true},\n {param: ' attr_accessor :a1', expect: true},\n {param: ' attr_writer...
6843f9aa515b68718036234e1b6b09bd
return a list of tags
[ { "docid": "14af7cea5532682cf53c5a7e34326c9e", "score": "0.7703888", "text": "def get_tags() tag_ids.inject([]) { |l, tag_id| l << get_tag_from_id(tag_id) } end", "title": "" } ]
[ { "docid": "ab239355c19730b1272435965e9fb6a4", "score": "0.8610595", "text": "def list_of_tags\n tag_list\n end", "title": "" }, { "docid": "03aed83d9d03ecbeb45773b9ee5962cf", "score": "0.8404396", "text": "def taglist\n\tself.tags.map {|t| t.name}\n end", "title": "" }, ...
de68a811753527833b44756f66f8dfe3
path to the site
[ { "docid": "0b2d76cae5e9140cfd338d3101979a4a", "score": "0.0", "text": "def create_page\n segments = self.slug.split('/').find_all { |segment| segment != '' }\n max_segments = segments.size\n\n while segment = segments.pop do\n _options = self.page_options(...
[ { "docid": "4fe91caa98259fae08eb84e6b888fa85", "score": "0.8112752", "text": "def pathWebSite\n \"./website/\"\nend", "title": "" }, { "docid": "baed70316f622a449a3cd0199fbf4484", "score": "0.8052568", "text": "def site_path\n settings.site_path\n end", "title": "" ...
7577b2e51a4db3aa9d85448be5c5b766
Invoke the given command if the given args. source://thor//lib/thor/invocation.rb122
[ { "docid": "88abbe24c823730f7785af58f4ad1208", "score": "0.8435125", "text": "def invoke_command(command, *args); end", "title": "" } ]
[ { "docid": "85559646bf3e9645f9538d980587d5af", "score": "0.74566203", "text": "def thor(command, *args); end", "title": "" }, { "docid": "c455192366f05c7d28205802ab26b867", "score": "0.7383362", "text": "def invoke(*args)\n handle_options(args)\n if options[:help]\n ...
2f767b2b12b774f3209cb2c321844eb9
GET /campaigns/1 GET /campaigns/1.json
[ { "docid": "6865e582b12ed0b04a885f6b6dfcd82b", "score": "0.0", "text": "def show\n # solicitations where campaign_id == @campaign.id.include donations include donation.users return s.amount raised and user email\n @top_amount = @campaign.fundraisers_by_amount_raised.select { |f| f[0] > 0 }\n # ...
[ { "docid": "72b190ff4ca249af6f70a1203c574d9f", "score": "0.8128707", "text": "def get_campaigns\n get('/fcb30500-7b98-476f-810d-463a0b8fc3df')\n end", "title": "" }, { "docid": "5799619765be2031d6b4a1e3ca6883fb", "score": "0.8022026", "text": "def get_campaigns()\n exec_ge...
57eefd057e365a938c35730459540804
read user data from file
[ { "docid": "f8dcfad2733728d554b8d2e30f98de57", "score": "0.0", "text": "def get_all_data\n Hash[*File.read(\"#{@path}scripts/data\").split(/[, \\n]+/)]\n end", "title": "" } ]
[ { "docid": "61c82d0e4b80e6ba3f0acb43795278d7", "score": "0.76339334", "text": "def fetch_data(user)\n array = read_from_file(\"userdata/#{user}.txt\")\n array[0]\nend", "title": "" }, { "docid": "ef9803394501351d95b8d0e11d1d9d72", "score": "0.6893017", "text": "def read_data_fi...
afc1884dc2c726ef79f4e6eb2f158993
given a set of words, we find all documents that have all these words
[ { "docid": "cc2c31e24bd3cd94aabfa474f97624b1", "score": "0.8393497", "text": "def find_documents_with_all_words(words)\n # Just get the names of all possible documents\n documents = @documents.keys\n # Now for each word passed in\n words.each do |word|\n # We do a repeated setwise inter...
[ { "docid": "2f442583f4a9d305e3ef076885468f29", "score": "0.83883786", "text": "def find_documents_with_all_words(words)\n # Just get the names of all possible documents\n documents = @documents.keys\n # Now for each word passed in\n words.each do |word|\n # We do a repeated setwise inte...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "15b92e6fbbc3646c5e9d5204cb330ce2", "score": "0.0", "text": "def installer_params\n params.require(:installer).permit(:employee_key, :first_name, :last_name)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7497917", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69572496", "text": "def strong_params\n params.require(:request).permit(param_whit...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "1dd4e23af35ecda2231a661fe25791fc", "score": "0.0", "text": "def creation_category_params\n params.require(:creation_category).permit(:creation_id, :category_id)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7497917", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69572496", "text": "def strong_params\n params.require(:request).permit(param_whit...
04562a9edd9be132eed06d4d51457809
Dumps the contents of this streaming buffer onto the given buffer and closes the queue
[ { "docid": "dfdc2144a5e9f291e4bc249d11b9034c", "score": "0.64784175", "text": "def transfer(new_buffer)\n @lock.synchronize do\n until @queue.empty? do new_buffer.push(@queue.pop) end\n @queue.close\n end\n end", "title": "" } ]
[ { "docid": "fd6dd7a998d37336c31029f5502d86a0", "score": "0.6720757", "text": "def write\n while (chunk = @sink_queue.pop)\n @sink << chunk\n end\n end", "title": "" }, { "docid": "0e85e89d337e9ed2c7084ab637448d5f", "score": "0.65800196", "text": "def dump_...
a0ae9b0354dbf40000f7b4483f4461bb
recipe can be either a String, or an Executable host_dns is optional and will default to objects self.dns_name
[ { "docid": "e58b825fca727bce0b5d78515aa8e14e", "score": "0.6487825", "text": "def run_recipe_with_ssh(recipe, ssh_key=nil, host_dns=self.dns_name)\n raise \"FATAL: run_script called on a server with no dns_name. You need to run .settings on the server to populate this attribute.\" unless self.dns_nam...
[ { "docid": "837ad6e0adf99a7fc37e2dff6d08fc29", "score": "0.6111741", "text": "def recipe(arg=nil)\n set_or_return(\n :recipe,\n arg,\n :kind_of => [ String ]\n )\n end", "title": "" }, { "docid": "22672094a272d74ae3b2b07ece3c2538", "score": "...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "22e76e1764e442b78e4fc718304e8f7b", "score": "0.0", "text": "def update!(**args)\n @description = args[:description] if args.key?(:description)\n @disallow_ads_personalization = args[:disallow_ads_personalization] if args.key?(:disallow_ads_personalization)\n @displ...
[ { "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...
a6d6e7336f175bfce29a114962055222
Add any value related data to a coded entry from this data criteria.
[ { "docid": "653b9b37dc278d9d1d3d15173bfba094", "score": "0.6092706", "text": "def modify_entry_with_values(entry, value_sets)\n return nil unless entry.present? && values.present?\n\n # If the value itself has a code, it will be a Coded type. Otherwise, it's just a regular value with a unit.\n...
[ { "docid": "cc2a1ddfe1d9afe298ebe19d267d3dfe", "score": "0.6099036", "text": "def add_data(key,value)\n update(self.value.merge({key => value}))\n end", "title": "" }, { "docid": "affa257f3c77268c6625bd361e93b75f", "score": "0.58183813", "text": "def add(value)\n return ...
9da6e7e9d4e40daaefdd9198f4582446
Process a Retina XML file
[ { "docid": "7a36084b13c9be83b84f86c32e9e325a", "score": "0.7038728", "text": "def import_retina_xml_file(args={})\n filename = args[:filename]\n\n data = \"\"\n ::File.open(filename, 'rb') do |f|\n data = f.read(f.stat.size)\n end\n import_retina_xml(args.merge(:data => data))\n end...
[ { "docid": "b996d1e777211107356ce38c2eac9e5f", "score": "0.5608331", "text": "def parse_xml\n \n if @noko and @noko.content\n \n self.location = @noko.content.to_s.strip || nil\n self.height = @noko['height'] ? @noko['height'].to_i : 0 \n self.width ...
0ada8cb674384bcf03dd8dacd7c249fb
Computes cos of input elementwise.
[ { "docid": "ab8f1a9000047f507e4b40f243bce814", "score": "0.777574", "text": "def cos(input, name: nil)\n check_allowed_types(input, FLOATING_POINT_TYPES)\n _op(:cos, input, name: name)\n end", "title": "" } ]
[ { "docid": "821d3d0277994a9367cf86cdf29dd36d", "score": "0.8383694", "text": "def cos\n apply_lambda_flat(->(x){Math.cos(x)})\n end", "title": "" }, { "docid": "65b08d03eea3d3da93b2fadc74cdb75e", "score": "0.76940924", "text": "def cos(input_a, name: nil)\n check_allowed...
6c6eb0a1e87daeddabd66c2c92b98f0d
PATCH/PUT /familia/1 PATCH/PUT /familia/1.json
[ { "docid": "4a480caa04f29c3df6b427aac5da852b", "score": "0.6385046", "text": "def update\n respond_to do |format|\n if @familium.update(familium_params)\n format.html { redirect_to @familium, notice: 'Familium was successfully updated.' }\n format.json { render :show, status: :ok, ...
[ { "docid": "d0677deb429289072f1f1c66ca72b8f2", "score": "0.67716855", "text": "def update\n @familium = Familium.find(params[:id])\n\n respond_to do |format|\n if @familium.update_attributes(params[:familium])\n format.html { redirect_to @familium, notice: 'Familia fue actualizada exis...
9992e354df782d906ddff8e98f1b1f72
POST /pages POST /pages.json
[ { "docid": "19f0aa8d44efeb677002d9d144fa2258", "score": "0.6717724", "text": "def create\n @page = Page.new(params[:page])\n\n respond_to do |format|\n if @page.save\n format.html { redirect_to @page, notice: 'Page was successfully created.' }\n format.json { render json: @page,...
[ { "docid": "64808f4537c5e34ea99a48cbfcb7da26", "score": "0.7101859", "text": "def create\n @page = Page.new(page_params)\n respond_to do |format|\n if @page.save\n format.html { render json: @page }\n format.json { render json: @page, status: :created}\n else\n forma...
c47b699f9462caafa5e035de58a22321
declares a class as ferretsearchable. ====options: fields:: names all fields to include in the index. If not given, all attributes of the class will be indexed. You may also give symbols pointing to instance methods of your model here, i.e. to retrieve and index data from a related model. additional_fields:: names fiel...
[ { "docid": "49f2f9860a7e1c0e3ca5c1f35206d7d0", "score": "0.790699", "text": "def acts_as_ferret(options={}, ferret_options={})\n\n # force local mode if running inside the Ferret server\n options.delete(:remote) if ActsAsFerret::Remote::Server.running\n if options[:remote] && options[:rem...
[ { "docid": "9b513c255f657338644adaf9ccc4a793", "score": "0.8208757", "text": "def acts_as_ferret(options={}, ferret_options={})\n configuration = { \n :index_dir => \"#{FerretMixin::Acts::ARFerret::index_dir}/#{self.name.underscore}\",\n :store_class_name => false,\n ...
eccf40171288e1415ee400a451348eb2
The number of tracks that the pattern with the greatest number of tracks has. TODO: Is it a problem that an optimized song can have a different total_tracks() value than the original? Or is that actually a good thing? TODO: Investigate replacing this with a method max_sounds_playing_at_once() or something like that. Wo...
[ { "docid": "8be963fd52d230221c8c9a9823bfb47d", "score": "0.8238709", "text": "def total_tracks\n @patterns.keys.collect {|pattern_name| @patterns[pattern_name].tracks.length }.max || 0\n end", "title": "" } ]
[ { "docid": "00ee714527ee451dcd85c7ef34bb86cc", "score": "0.82945156", "text": "def total_tracks\n @patterns.keys.collect {|pattern_name| @patterns[pattern_name].tracks.length }.max || 0\n end", "title": "" }, { "docid": "d79f8252052a61b7ac0d38cdbed15da3", "score": "0.82334447", ...
35e3dedf8c7a104f5baa21cf6e3b123d
helper function to find out which model is our owner returns a project instance if this is owned by a project returns an article instance if this is owned by an article
[ { "docid": "7f2904e5a1e54214f2920a3ffc6b861a", "score": "0.789801", "text": "def owner\n self.project or self.article\n end", "title": "" } ]
[ { "docid": "8163838519170f9d64fec0de9deb888d", "score": "0.7319768", "text": "def owner\n self.projects.first or self.jobs.first\n end", "title": "" }, { "docid": "ff49f65b74e7199c168637321339c2ec", "score": "0.72292614", "text": "def load_owner\n local_params = params\n ...
9e116980532422b93cd6ea05b7a582f1
I'm using this to encode things. source://rubyopenid//lib/openid/server.rb1301
[ { "docid": "6f8737871b4d595388dff4c5fca7b1ae", "score": "0.6789569", "text": "def encoder; end", "title": "" } ]
[ { "docid": "39cad6cf03e4622e478f5be0aa1e8a4f", "score": "0.74977154", "text": "def encoded; end", "title": "" }, { "docid": "39cad6cf03e4622e478f5be0aa1e8a4f", "score": "0.74977154", "text": "def encoded; end", "title": "" }, { "docid": "124998e0c7a9a4201748c093b6268da6",...
24d4f7ce6ee960591d5e18eecd8eb3f8
Sorts a text search by relevance, can only be chained after `fulltext_search()`
[ { "docid": "984df38c3b0b089f4719f7ff27b5927d", "score": "0.73180884", "text": "def by_relevance\n self.order(\"search_ranking DESC\")\n end", "title": "" } ]
[ { "docid": "4062c0be607f0cce1b3d52bbd3aa2cbf", "score": "0.63799274", "text": "def handling_fulltext\n options = yield\n add_sort_by_relevance options if fulltext_name_filtering?\n options\n end", "title": "" }, { "docid": "e88c72a9aa06b8980a50a8506bbfa4ff", "score": "0.6290256...
dc736e9eddaa1048a86321078892f114
codecite index codecite create POST /posts//comments POST /posts//comments.xml
[ { "docid": "3bb8bab5bf2f8e430eb7d8796bea7718", "score": "0.6009759", "text": "def create\n # codecite create\n\n # codecite two models\n @post = Post.find(params[:post_id])\n @comment = @post.comment(params[:comment][:body], current_user)\n # codecite two models\n\n respond_to do |format...
[ { "docid": "668554c50d0198da5b8f3204d1da9b3b", "score": "0.6892517", "text": "def create\n hash = params[:comment].dup\n hash.delete('parent_id') unless hash['parent_id'].presence\n response = RestClient.post(([Share.config.endpoint, 'sources', params[:post_id], 'comments.json'].join('/') + \"?...
ee0a20d0d08d3abf53cfebb76d75fa90
Return the provided metatags
[ { "docid": "64428b3bb61d7ea7bd33a53babfa23f9", "score": "0.6101481", "text": "def show_metatags( tags = @@default_tags, format = @@outputformat, show_filename = @@show_filename )\n\n # Build the output hash from the tags matching the values in @@default_tags\n metadataOutputHash = Hash.new\n ta...
[ { "docid": "762583aa16afbf5193c3aa8369c0efe2", "score": "0.75395125", "text": "def metatags\n self.tags.split(',').map do |tag|\n Metatag.find_by(tag: tag)\n end.compact\n end", "title": "" }, { "docid": "079db8d43a89a1ef4bf9a3e7ee6321b2", "score": "0.7175424"...
5a8893f9e47acceb9cc86e5aad1341eb
GET /activity_refs/new GET /activity_refs/new.json
[ { "docid": "0fde5d518bfb374746c22b63e3d47795", "score": "0.7849113", "text": "def new\n @activity_ref = ActivityRef.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @activity_ref }\n end\n end", "title": "" } ]
[ { "docid": "a5110da580d5b7870feebc4d25e8c3f2", "score": "0.73859644", "text": "def create\n @activity_ref = ActivityRef.new(params[:activity_ref])\n\n respond_to do |format|\n if @activity_ref.save\n format.html { redirect_to @activity_ref, notice: 'Activity ref was successfully create...