query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
5a714b2aca2031fe9ad80007df0395c2
Fetch token details Author: Shlok Date: 21/01/2019 Reviewed By:
[ { "docid": "25abc7cbe1c13b9532ea59e1ac6db6ab", "score": "0.0", "text": "def fetch_goto\n\n FetchGoToByEconomyState.new({\n token: @token,\n client_id: @client_id,\n mint_workflow: @mint_workflow...
[ { "docid": "e0aa113d95fef8cb4948c2c3a1ea29e7", "score": "0.74699295", "text": "def fetch_token_details\n\n @token = {}\n token_resp = Util::EntityHelper.fetch_and_validate_token(@client_id, 'a_s_mm_su_gd')\n\n if token_resp.success?\n @token = token_resp.data\n end\n...
0140ba8119a7aa30eb61ff1d48b8088e
Returns a string with the attributes of a Record instance Params: +show_token+:: boolean value that indicates if the string returned has the object_id
[ { "docid": "6b6bf6610ef71fa7e2c4037f0c21373d", "score": "0.76402646", "text": "def to_s(show_token)\n \"#{flags} #{object_id if show_token}\\r\\n#{value}\"\n end", "title": "" } ]
[ { "docid": "903dfc29a221f93ff1b6ecb458831c8c", "score": "0.6478984", "text": "def inspect\n str = +\"#<#{self.class.name}:0x#{object_id}\"\n str << \" id=\\\"#{@id}\\\"\" if @id\n str << ' deleted=\"true\"' if @deleted\n str << '>'\n end", "title": "" }, { "d...
6c126eb90331e263a9ed4d9422dca09a
color yellow method defined on string object
[ { "docid": "93a066ab156b8fe1a92683f700ed23aa", "score": "0.0", "text": "def yellow\n shade(33)\n end", "title": "" } ]
[ { "docid": "4cba2b9937224a9b7901385b05399cd4", "score": "0.815202", "text": "def yellow(str)\n colorize(str, 33)\n end", "title": "" }, { "docid": "688042d3f311e75f781383f6bb90b579", "score": "0.7932239", "text": "def yellow(text)\n colorize(text,33)\n end", "titl...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "8375dca40480e181de910e592bbe9c68", "score": "0.0", "text": "def set_visit\n @visit = Visit.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;...
f132af1f130c90e2d72d39d70dbe6f16
Delete the given team
[ { "docid": "3f9bc356351e8d09680a7bc628d961f5", "score": "0.0", "text": "def delete\n TeamsUser.where(team_id: self.id).find_each(&:destroy)\n node = TeamNode.find_by(node_object_id: self.id)\n node.destroy if node\n self.destroy\n end", "title": "" } ]
[ { "docid": "103fc09c458682d75f549add4066304b", "score": "0.88031715", "text": "def delete(_team)\n # stub\n end", "title": "" }, { "docid": "8f24ea4b124c0e0e38dbfb3432be479d", "score": "0.8411219", "text": "def delete()\n\n Team.destroy(self.id)\n end", "title...
bdb6bb9fa2d4d044fcdac29576c45a1b
GET /tour_times GET /tour_times.json
[ { "docid": "95a3ce69fd8fbc5340c9e3af804310dd", "score": "0.6226883", "text": "def index\n @tour = Tour.all.map do |t|\n [t.title, t.id]\n end\n \n @dates = TourTime.date_list\n @passenger_options = [1,2,3,4,5,6]\n @tour_time_id = params[:tour_time_id]\n @tour_id = params[:tour_...
[ { "docid": "23a7d1dbb48af38d370c85b425f59def", "score": "0.79112154", "text": "def index\n @tours = Tour.tours_by_start_time\n render json: @tours\n end", "title": "" }, { "docid": "2e13632e15667584f9534cee4cbe9ea0", "score": "0.7036256", "text": "def timeQueries\n t = Time...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "e8fbb948b5e9a5022a311c94ce7441b7", "score": "0.0", "text": "def bill_payable_params\n params.require(:bill_payable).permit!\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...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "81cafe3e52632adc3fe4d5ab5cb56273", "score": "0.0", "text": "def set_pledge\n @pledge = Pledge.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163821", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045432", "text": "def action_hook;...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "784c18224a5fb44b7ba2e2d95d76b340", "score": "0.0", "text": "def post_params\n params.require(:post).permit(:title, :body, :school_class_id)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whit...
98a5522c4bae46eea02ec6991bed3d72
Register an entity on the Conductor Server uuid, first_name, last_name, auth_key, type TODO need to marshal dump and load EventMachine instance for messaging...
[ { "docid": "cf497d8200573e2ad533b2b3f4266f6b", "score": "0.6237612", "text": "def register(data)\n unless @registered\n @user = Hashie::Mash.new(data)\n @user.event_machine_connection_id = @connection.id\n @user.event_machine_connection = self\n puts \"uuid: #{@user.uuid}\"\n ...
[ { "docid": "bda359e657709d4b6382f3fe70e8d3f3", "score": "0.67836505", "text": "def register\n physical_entity = {name: @name, description: @description, location:@location}\n virtual_entity = {uuid: nil}\n body = {body: {device: {name: @name, \n description: @descript...
d62d14149c18f8ec04035988f728d261
Output the specified msg as an ANSIcolored error message (white on red).
[ { "docid": "0601a32b0407ec47ee20122a236c2959", "score": "0.7692939", "text": "def error_message( msg, details='' )\n\t$stderr.puts colorize( 'bold', 'white', 'on_red' ) { msg } + details\nend", "title": "" } ]
[ { "docid": "d5726911b60c7d957a0df44ee44b2116", "score": "0.8239322", "text": "def error(msg)\n puts red(bold(\"[!] #{msg}\"))\n end", "title": "" }, { "docid": "bff891d0a9033ed5576ec357a54218b3", "score": "0.81380427", "text": "def error_msg( msg )\n\t\tmessage ansi_code( 'bo...
a166d125f3c7f4f99f90ef586ac79cff
PATCH/PUT /deeds/1 PATCH/PUT /deeds/1.json
[ { "docid": "9f9abc72dcf1ae54330af6f6e6b30115", "score": "0.60245335", "text": "def update\n respond_to do |format|\n if @deed.update(deed_params)\n format.html { redirect_to @deed, notice: 'Hito ha sido actualizado.' }\n format.json { render :show, status: :ok, location: @deed }\n ...
[ { "docid": "0f8872308cd71e90aed963baf02fd23e", "score": "0.6605289", "text": "def update\n request = RestClient.put File.join(API_SERVER,\"rest-api/departments\"), { \n 'id' => params['id'], \n 'name' => params['department']['name'], \n 'description' => params['department']['desc...
6ae253c382a7a9a2ed6ae33b01c7c7b8
GET /intervals/1 GET /intervals/1.json
[ { "docid": "6dbe43f22c8ccaad8b355f51ce477395", "score": "0.71936697", "text": "def show\n @interval = current_user.intervals.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @interval }\n end\n end", "title": "" } ]
[ { "docid": "6259d9e3dcbd072ae51cea32ec4b850e", "score": "0.76402557", "text": "def index\n @intervals = Interval.all\n\n render json: @intervals\n end", "title": "" }, { "docid": "90cb7dd95b8ba1c8d724fc4ab5e83b90", "score": "0.71222043", "text": "def show\n render json: @in...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "75ebdf697a24b79bcba480e427e5563a", "score": "0.0", "text": "def spartan_basketball_params\n params.require(:spartan_basketball).permit(:player_name, :player_number, :has_graduated)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74939764", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6955084", "text": "def strong_params\n params.require(:request).permit(param_whit...
37207f699d77f21d4caf3c392006f0c1
Emulate UPDATE using INSERT OVERWRITE AS SELECT. For all columns used in the given +values+, use a CASE statement. In the CASE statement, set the value to the new value if the row matches WHERE conditions of the current dataset, otherwise use the existing value.
[ { "docid": "dea0a358f92c36c512ee3ed53417a93c", "score": "0.7078802", "text": "def update_sql(values)\n sql = \"INSERT OVERWRITE \"\n source_list_append(sql, opts[:from])\n sql << \" SELECT \"\n comma = false\n\n if where = opts[:where]\n where = Sequel.lit(lit...
[ { "docid": "b49b0af95d0f75306629cdbacc9802be", "score": "0.6924258", "text": "def update_sql(values)\n sql = String.new\n sql << \"INSERT OVERWRITE \"\n source_list_append(sql, opts[:from])\n sql << \" SELECT \"\n comma = false\n\n if where = opts[:where]\n ...
e40e4ad485668e3ee2578ea7afca82b3
GET /solicitations/new GET /solicitations/new.xml
[ { "docid": "611927c565a7feb12e7f45820cfc4b0a", "score": "0.77767277", "text": "def new\n @solicitation = Solicitation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @solicitation }\n end\n end", "title": "" } ]
[ { "docid": "329b75bda5f81d08302fc7f3a1142f95", "score": "0.74228233", "text": "def new\n @solicitation_type = SolicitationType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @solicitation_type }\n end\n end", "title": "" }, { "d...
f283eb3b3558e30353f14f7c591df95d
Copyright 2010 Red Hat, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS...
[ { "docid": "b277c025033e531c07f3294e3cc33a05", "score": "0.0", "text": "def usage\n puts <<USAGE\n== Synopsis\n\nss-cartridge-list: Lists all cartridges installed on the node\n\n== Usage\n\nss-cartridge-list --with-descriptors [--porcelain]\n\nOptions:\n-h|--help:\n Prints this message\n\nUSAGE\nen...
[ { "docid": "51a79b6e4544f99b3a3bf05313175e9f", "score": "0.56485575", "text": "def server_software; end", "title": "" }, { "docid": "6ab77a9219ee157923bc58599ba6aa77", "score": "0.55940115", "text": "def in_use; end", "title": "" }, { "docid": "6ab77a9219ee157923bc58599ba...
e8cccc18785b26ddec2492b64bd93688
PATCH/PUT /stagelevels/1 PATCH/PUT /stagelevels/1.json
[ { "docid": "1aacb170cc7fcd3bb043e665e4d20a9e", "score": "0.7282867", "text": "def update\n respond_to do |format|\n if @stagelevel.update(stagelevel_params)\n format.html { redirect_to @stagelevel, notice: 'Stagelevel was successfully updated.' }\n format.json { render :show, statu...
[ { "docid": "08328512a41c323dbd26504dcc139208", "score": "0.66741115", "text": "def update\n logger.info \"got to update stages\"\n @stage = Stage.find(params[:id])\n\n respond_to do |format|\n if @stage.update_attributes(params[:stage])\n format.html { redirect_to @stage, :notice =>...
8d5ad7bc82782fb648d4b27bdf628b26
Returns true only if the result is a success and a user was assigned.
[ { "docid": "e354feff7a11860838dc2667f76a1c59", "score": "0.7678611", "text": "def successful?\n @result == :success && !user.nil?\n end", "title": "" } ]
[ { "docid": "a5eefa51e822ead79fb23c6477285853", "score": "0.7075488", "text": "def is_assigned?(user, assigned_id)\n return false if assigned_id == nil\n return false if user.id != assigned_id\n return true\n end", "title": "" }, { "docid": "01eb5f89134f56c1b62bb09a07d4d568", "s...
fa02855ad68c2ef23174239fd4627919
Encode a single event to a hash data structure with keys and types conforming to the JSON envelope.
[ { "docid": "2cfd87c51cbc377141d7d08b31572c42", "score": "0.7600815", "text": "def encode_hash_structure event, data_encoder: nil\n case event\n when Event::V0\n encode_hash_structure_v0 event\n when Event::V1\n encode_hash_structure_v1 event, data_encoder\n else\n ...
[ { "docid": "2c5166816bcb6508dc369b1944492343", "score": "0.742676", "text": "def encode event, sort: false, **_other_kwargs\n structure = encode_hash_structure event\n structure = sort_keys structure if sort\n ::JSON.dump structure\n end", "title": "" }, { "docid": "fe52df3...
9261f53d8f3fb2d2e6172113da5c50d8
=begin rdoc Return true if path exists in content tree. Note: a value of 'true' does not indicate that a valid document item exists. This is a lowlevel call for repo management. =end
[ { "docid": "5ffe9df2a804ee78fe3b15d096035ec4", "score": "0.8166476", "text": "def path_exist?(path)\n @content_tree.path_exist? path\n end", "title": "" } ]
[ { "docid": "93fd63b0355b223210096b693e304f8e", "score": "0.7661448", "text": "def exist?(path, ctype=nil)\n @content_tree.exist? path, ctype\n end", "title": "" }, { "docid": "e6711fa20090d174a4ab15f8f0a0ccd9", "score": "0.7409562", "text": "def exist?\n # shouldn't ...
7d23ed67577f579ba312d187ab4a2fda
We need to be able to access the version's width so that we can provide that info to browsers to let them select the best version for the screen size.
[ { "docid": "d3b66989548cd6ca811ebd79a1d121f1", "score": "0.79549223", "text": "def width\n self.class::VERSIONS[version_name]\n end", "title": "" } ]
[ { "docid": "d41a3ca327020209356fdc834bf9c02c", "score": "0.71022135", "text": "def screen_width(); end", "title": "" }, { "docid": "1cc3e9f006ad82c49dfaff6bc398d885", "score": "0.7034178", "text": "def browser_width\n @width + 8\n end", "title": "" }, { "docid": "b4ae...
9c5b9d39390c179ca18ce0a37bfcb7bb
Sets the attribute hosts
[ { "docid": "c5ba5e13453dfaf544e97d6473045911", "score": "0.65048766", "text": "def hosts=(_arg0); end", "title": "" } ]
[ { "docid": "4da4376f895e192a4d1f09b994cf00d8", "score": "0.7927044", "text": "def hosts=(hosts)\n @host = nil\n @hosts = hosts\n end", "title": "" }, { "docid": "0c8d894087f028b0f19c73e80964efda", "score": "0.7109149", "text": "def host=(host)\n @hosts = nil\n ...
ffe6ff2273f1f8b29f3366a25728bcdf
Iterates over all the DOT formatted edges with nodes having the most edges first and the edges without a constraint attribute before those that do.
[ { "docid": "372c35b52f3a16b1d7723fc1fc1c903d", "score": "0.6674304", "text": "def edges(options={}) # :yields: edgestring\n @edges.sort { |a,b| b[1].length <=> a[1].length }.each do |(fromnode,nh)|\n nh.sort_by { |(t,a)| (a.has_key?('constraint') ^ options[:constraints_first]) ? 1 : 0 }.each do ...
[ { "docid": "d3edbc413883c52513fb5b5989d79bab", "score": "0.6163097", "text": "def ordered_edges(loop)\n # Yields each edge and its end vertex (end for the given ordering)\n # Sketchup does not guarantee edges are in order, or that start matches end.\n return to_enum(:ordered_edges, loop) unless...
a553c1f1b350cb7a00c818ade39e9b12
Return the traditional unit cell of bulk zinc blende
[ { "docid": "bf5a7e8e311369f841ca0c30e6ea70e6", "score": "0.61455315", "text": "def get_bulk\n b = 0.25*self.lattice_const\n a1 = Atom.new(0, 0, 0, self.cation)\n a2 = Atom.new(b, b, b, self.anion)\n \n v1 = Vector[0.5, 0.5, 0.0]*self.lattice_const\n v2 = Vector[0.5, 0.0, 0....
[ { "docid": "7dbe12a212d9999c4d52f742cf06226f", "score": "0.6349032", "text": "def current_unit_cell\n self.unit_cell\n end", "title": "" }, { "docid": "c2ceab72dce4fe1c748f345726e0de5e", "score": "0.6047429", "text": "def get_001_surface(monolayers, vacuum, constrain_layers = 0)\...
e5214cf6231c3294b4b9464185e70347
Starts the listener by initializing the adapter and building the directory record concurrently, then it starts the adapter to watch for changes. The current thread is not blocked after starting.
[ { "docid": "78acd336b629fdd4fcca1a3e6b9e3636", "score": "0.7144328", "text": "def start\n _signals_trap\n _init_actors\n unpause\n Celluloid::Actor[:listen_adapter].async.start\n @thread = Thread.new { _wait_for_changes }\n end", "title": "" } ]
[ { "docid": "f9184a2d029bcac2b2e6dde1c2da50f6", "score": "0.7230236", "text": "def start\n _init_actors\n unpause\n @stopping = false\n registry[:adapter].async.start\n Thread.new { _wait_for_changes }\n end", "title": "" }, { "docid": "771aff063d71088c538a69fe9eab...
c8eb69867091e6604aef075a2cea5815
Directory where uploaded files will be stored (default is /public/uploads)
[ { "docid": "32392bf64e296576ab2e4269b244adad", "score": "0.0", "text": "def store_dir\n 'images/portraits/'\n end", "title": "" } ]
[ { "docid": "49da9be7899af8f7344570f6fb265caa", "score": "0.85019636", "text": "def store_dir\n 'public/uploads'\n end", "title": "" }, { "docid": "ea699330da698ab82238282eaec50ce6", "score": "0.83943826", "text": "def store_dir\n \"uploads\"\n end", "title": "" }, { ...
ed8359e66c3b3606bc267c1d6fb34be5
Returns true if these attributes appear to describe a symlink.
[ { "docid": "9ee4a0ac856510ff14b57cc8621a2869", "score": "0.7541709", "text": "def symlink?\n case type\n when T_SYMLINK then true\n when T_UNKNOWN then nil\n else false\n end\n end", "title": "" } ]
[ { "docid": "fbf79f65af779abff5dfe50ffad642fd", "score": "0.76242495", "text": "def symlink?\n type == :symlink\n end", "title": "" }, { "docid": "d883c577feb6f9f62ada15b6a22e7c35", "score": "0.75957197", "text": "def symlink?\n @symlink\n end", "title": "" }, { ...
3c16c446392942b26231c6fcd5208e69
Defines an attribute writer method
[ { "docid": "83c2b6f2dbac7ad26cfac27dacb526fa", "score": "0.7402525", "text": "def define_writer_method(attribute, method_name, visibility)\n define_method(method_name) { |value| attribute.set(self, value) }\n send(visibility, method_name)\n self\n end", "title": "" } ]
[ { "docid": "5a0bcdaca95c21b13aacca36f9fad742", "score": "0.7735571", "text": "def _write_attribute(attr_name, value); end", "title": "" }, { "docid": "5812dd7a37c0eccc3d9481c23d74c649", "score": "0.7695904", "text": "def write_attribute(attr_name, value); end", "title": "" }, ...
3a96035aa7eead95fe936401fd78a4f3
Builds a Credentials object
[ { "docid": "aba34030965f298e2ac0cc30746e9b55", "score": "0.0", "text": "def initialize(client_id, client_secret, refresh_token)\n merge!(\n {\n client_id: client_id,\n client_secret: client_secret,\n refresh_token: refresh_token,\n grant_type: \"refresh_to...
[ { "docid": "0a9d2fe8e75a2455be857e650b79a738", "score": "0.66769147", "text": "def credentials_obj\n @credentials_obj ||= Aws::Credentials.new(\n access_key,\n secret_key\n )\n end", "title": "" }, { "docid": "20fb8b37e1450abaad750dbce1028658", "score": "0....
648af493c400e47e40623cc66b07cd84
Used to manually enable class specific override class.
[ { "docid": "7e1b4d55363e17a9b832edcd9ef00ffb", "score": "0.7158031", "text": "def enable_factory_override overriding_class\n\t\t\tFactory.enable_override self, overriding_class\n\t\tend", "title": "" } ]
[ { "docid": "109fdebdc9c10bb836abb07392ba1b58", "score": "0.6933879", "text": "def add_inherited_override sub_class\n\t\t\t@sub_class_overrides << sub_class\n\t\tend", "title": "" }, { "docid": "b853134c88d9a55023d22c26d89a0972", "score": "0.66646385", "text": "def override\n use...
04ff1b6a9935d767070a00a82dced166
PUT /formats/1 PUT /formats/1.json
[ { "docid": "5bd340a43a770df63fd997db8e658d97", "score": "0.7016364", "text": "def update\n @format = Format.find(params[:id])\n\n respond_to do |format|\n if @format.update_attributes(params[:format])\n format.html { redirect_to @format, notice: 'Format was successfully updated.' }\n ...
[ { "docid": "cc54bf80275f0c127a73e78a22f2fba7", "score": "0.70535725", "text": "def update\n @format = Format.find(params[:id])\n\n maybe_add_mimetype(params)\n\n respond_to do |format|\n if @format.update_attributes(params[:form])\n format.html { redirect_to(@format, :notice => 'For...
b4664d2f36f2c2dda547a767ce402bc6
Check if the file has been downloaded.
[ { "docid": "a1f5c6ee7271a01e20dd94a0cd670fac", "score": "0.6273711", "text": "def check_file_downloaded_on_selenium_driver(filename, waiting_time)\n log('waiting for file download (selenium)...')\n sleep(waiting_time)\n result = search_files_result(filename, downloaded_files_list)\n [result.present?...
[ { "docid": "3c082fa17f1787d478c15c4dc8fe8892", "score": "0.7937488", "text": "def downloaded?\n File.file? path\n end", "title": "" }, { "docid": "ff08a70d28d5b605160455706a3690b8", "score": "0.7786902", "text": "def downloaded?\n Dir.exist?(File.join(DOWNLOAD_DIR, title)) and...
927d7c5135936336cfb229b195f54a29
Method for listing oligo designs, based on parameters entered above
[ { "docid": "ec69e0fbff43b7b4d885ec5b5d3e2276", "score": "0.6601854", "text": "def index\n \n @version = (params[:version] ? Version.find(params[:version][:id]) : Version::DESIGN_VERSION)\n #@version = Version.includes(:gene_lists).find(params[:version][:id])\n\n @condition_array = define_con...
[ { "docid": "2abbb0a1c99c6bbb966cdf48ac00e0a4", "score": "0.6546354", "text": "def index\n @designs = Gooey::Design.all\n end", "title": "" }, { "docid": "4264ef4e5cf9f6bd1f5ab38db32a367a", "score": "0.6211504", "text": "def index\n @designs = if params[:sort]\n De...
82b9d5833b025b92b0c266151072c166
Provides the ability to create quick fieldsets as blocks for your forms. Note: Block helpers use the syntax ==== Parameters attrs:: HTML attributes and options ==== Options +legend+:: Adds a legend tag within the fieldset ==== Returns String:: HTML ==== Example "Customer Options" do %> ...your form elements Generates t...
[ { "docid": "4cb1a5ac29a45a26514ed9e34cbcf254", "score": "0.7267888", "text": "def fieldset(attrs, &blk)\n legend = (l_attr = attrs.delete(:legend)) ? tag(:legend, l_attr) : \"\"\n tag(:fieldset, legend + @origin.capture(&blk), attrs)\n # @origin.concat(contents, blk.binding)\n end", ...
[ { "docid": "64d48dec624ea3b47ec0118f27f6cfee", "score": "0.7885887", "text": "def form_field_set(options={}, &block)\n with_groups = options[:with_groups] || false \n id = \"id='#{options[:id]}'\" if options[:id]\n # wish I could do > field_set_tag(options[:legend]) { content_tag('dl', :clas...
b5697e2e53c96b5096b30bc8cd360514
HOLDS RHYMED WORDS AS PAIR PUTS TO VIEW
[ { "docid": "91b64c9837b39390d797d5e45f1d28b6", "score": "0.56816745", "text": "def rhymed_to_s\n\n @rhymed_word_collection << @rhymed_words\n end", "title": "" } ]
[ { "docid": "e4d26133c0fda0af076a83cd86a76390", "score": "0.6067544", "text": "def switch_viewpoint (words)\n new_string = \"\"\n \n words.split.each do |word|\n if(@viewpoints[word.downcase])\n word = @viewpoints[word.downcase][0]\n end\n \n new_string += word + \" \"...
fef65f4ccfca25e47b89e97ec6fdc156
returns the current precipitation intensity info array of the weather information from forecast.io
[ { "docid": "3614a9f9fe41da2fde3a93902d3750ce", "score": "0.7296965", "text": "def precip(info)\n\treturn info[\"currently\"][\"precipIntensity\"]\nend", "title": "" } ]
[ { "docid": "2c66ffd484fdf3dd97c4c934f98e901b", "score": "0.75956887", "text": "def precipIntensity(weather_info)\n\tweather_info[\"currently\"][\"precipIntensity\"]\nend", "title": "" }, { "docid": "93a41c7e8947f86a410d22b9b9cbb8b4", "score": "0.66476834", "text": "def forecast_array...
8d8831b839bdfbda39b239961bb5deea
Creates a fee (tax). Creates a fee (tax).
[ { "docid": "2c943d9f15eda316ab78dd57e815146c", "score": "0.6390678", "text": "def create_fee(location_id, body, opts = {})\n data, _status_code, _headers = create_fee_with_http_info(location_id, body, opts)\n return data\n end", "title": "" } ]
[ { "docid": "38de108927372ddd6de3059e055fd30b", "score": "0.68295306", "text": "def create\n params[:fee][:amount].gsub!(/[$,]/, '')\n params[:fee][:amount] = (params[:fee][:amount].to_f * 100).to_i\n\n @fee = Fee.new(fee_params)\n @fee.booth = Booth.find(params[:booth_id])\n\n respond_to ...
7c3fcb7603750f24598592adf760670b
raises an exception if the given options are not valid
[ { "docid": "99e5d1b2826c7820e6c785fe15461fad", "score": "0.0", "text": "def validate(options = {})\n options = normalize_options(options)\n self.sql(options[:table_class])\n raise \"No column defined.\" if column.nil? or column.strip == \"\"\n if options[:table_class]\n\traise \"Cond...
[ { "docid": "6be21f7b6e88b1c4b531a8e941daa265", "score": "0.7595731", "text": "def unrecognized_option(err); end", "title": "" }, { "docid": "d27a82160b27f952feae646a4aadcce8", "score": "0.74968255", "text": "def validate_options!(options)\n return if options[:help] || options[:v...
f5bdbc65b7697b38c09aa7459ff62831
Options: +rlp_services+ services used to talk to remote RLP DBs. +pool_size+ thread pool size
[ { "docid": "6ce25597a052690afefdc97f4a55f75d", "score": "0.6873933", "text": "def initialize(options={})\n @rlp_services = options.fetch(:rlp_services)\n @distance = options.fetch(:distance)\n pool_size = options.fetch(:pool_size, 3)\n @pool = Concurrent::FixedThreadPool.new(pool_siz...
[ { "docid": "462741889420a28396c61926e6b7f8f3", "score": "0.59881055", "text": "def build_pool(options)\n hosts = options[:hosts] || [\"127.0.0.1\"]\n client_settings = options[:client_settings] || {}\n timeout = options[:timeout] || 0\n\n host_ssl_opt = client_settings[:ssl].nil? ? n...
af3e8dc13f7778374c820e3f04af6b83
DELETE /service_providers/1 DELETE /service_providers/1.json
[ { "docid": "5ee3e626de81b05311afd0c97fe07c3c", "score": "0.76298946", "text": "def destroy\n @service_provider.destroy\n respond_to do |format|\n format.html { redirect_to service_providers_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "52f7f464963f27fc5bd6a5bd735a4c8e", "score": "0.7455817", "text": "def destroy\n @service_provider.destroy\n respond_to do |format|\n format.html { redirect_to service_providers_url, notice: 'Service provider was successfully destroyed.' }\n format.json { head :no_content }\n ...
b22ae9ba506e9a91f628fd3774e8a351
Set the value of a hash field, only if the field does not exist.
[ { "docid": "b957b6087673204dec3d90fea4c2663c", "score": "0.64213145", "text": "def hsetnx(key, field, value); end", "title": "" } ]
[ { "docid": "677d2be4a26f8fb26bc3b53d7c3c98fa", "score": "0.6926171", "text": "def hsetnx(key, field, value)\n\t\tunless hexists(key, field)\n\t\t\thset(key, field, value)\n\t\t\treturn true\n\t\tend\n\t\treturn false\n\tend", "title": "" }, { "docid": "315f086d8b5e2603384dc46618e5e15f", ...
a466b985faa6c3df06018c29c96b55fd
string How is this user authenticated?
[ { "docid": "a5a61902d1fb72e4161e7f4d6dfbf8e6", "score": "0.0", "text": "def authentication_method\n @attributes[:authentication_method]\n end", "title": "" } ]
[ { "docid": "a3c6ac75cbda1307ba89015b6724f685", "score": "0.73474085", "text": "def get_user_logged_in\n\t\tif current_user != nil\n\t\t\treturn 'Currently signed in as: ' + current_user.forename + ' ' + current_user.surname\n\t\telse\n\t\t\treturn 'You are not logged in!'\n\t\tend\n\tend", "title": ...
0c4682c637ad7e59d5e31717b9e87008
GET /orgs/new GET /orgs/new.json
[ { "docid": "e866fec8898b8e2fff22a7efba5c244e", "score": "0.0", "text": "def new\n @org = Org.new\n# @org.donor_id = 1\n# @activity = Activity.find(:all, :conditions => { :name => 'clean' })\n\n@org.user_id = current_user.id\n\n respond_to do |format|\n format.html # new.html.erb\n ...
[ { "docid": "cabb4b7b0121f6ede07870071883efa7", "score": "0.73055184", "text": "def create\n @org = current_user.orgs.create(params[:org])\n\n if @org.save\n flash[:success] = 'Org was successfully created.'\n redirect_to @org\n else\n render :new\n end\n\n end", "title": ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "c9e78f669610f23dd24e85f65887674e", "score": "0.0", "text": "def set_guess\n @guess = Guess.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...
cef8f6d8791517df01583456a6246214
the link to the result page
[ { "docid": "5b296d91c98eef5c558eeb1a20a444f5", "score": "0.0", "text": "def get_hyperlink(row)\n URI.join(native_host, row.dig('uri')).to_s\n end", "title": "" } ]
[ { "docid": "91652e4c8ea186bd7795221d4026afac", "score": "0.71166086", "text": "def link_to_result(t, result)\n url_method = method(result.class.to_s.underscore << '_path')\n url = url_method.call(:id => result, :search_recording_id => @search_recording.full?(&:id))\n link_to(t, url)\n end", ...
b0e3ee36b341b08dc53ca754cf6ada9d
Sets the categories property value. Represents the categories that an incoming message should be labeled with in order for the condition or exception to apply.
[ { "docid": "c9f4db0df69988924999cf58e65e8524", "score": "0.74572724", "text": "def categories=(value)\n @categories = value\n end", "title": "" } ]
[ { "docid": "59f9e615ec232cc44c6f3917e90fdac2", "score": "0.7258638", "text": "def categories=(value)\n @categories = value\n end", "title": "" }, { "docid": "bc298d4c2735bc0e8bcc23c92ee40127", "score": "0.71693194", "text": "def categories=(value)\n\t\t@categories = value\n...
dfdf4aa1b270a21c234c03be7188041a
Derives Sensu package version strings for Redhat platforms. When the desired Sensu version is '0.27.0' or later, the package requires a '.elX' suffix.
[ { "docid": "c08e7aa14712301f0eb64793ed12e3c8", "score": "0.7762666", "text": "def redhat_version_string(sensu_version, platform_version, suffix_override = nil)\n bare_version = sensu_version.split('-').first\n if Gem::Version.new(bare_version) < Gem::Version.new('0.27.0')\n sensu_...
[ { "docid": "ee44f5fa47e609c4012a7b211dcd8d24", "score": "0.6696706", "text": "def rpm_family_and_version\n if Pkg::Config.vanagon_project\n Pkg::Config.rpm_targets.split(' ').map do |target|\n rpm_el_family, rpm_el_version, = target.split('-')\n \"#{rpm_el_family}-#{rpm_el_version}\"\n ...
2a3dfd00701a5315536c2f6af89ccf89
Asserts that the body of the response contains the supplied tag with the associated selectors
[ { "docid": "6cdd3e0ea9e7ae80f08bfb0a82ed77d0", "score": "0.63878226", "text": "def assert_have_tag(name, attributes = {})\n ht = HaveTag.new([name, attributes])\n assert ht.matches?(response_body), ht.failure_message\n end", "title": "" } ]
[ { "docid": "2f7f99f519e2e0aafc71f55558439830", "score": "0.6436876", "text": "def should_have_tag(tag, *opts)\n __response_body.should_have_tag tag, *opts\n end", "title": "" }, { "docid": "5625747d9c6e23d231e23b0fffe77eb0", "score": "0.632028", "text": "def assert_render...
8ca5fda72d64b0a27c389853f427b086
FalseFailure Passed if object is +false+. value.assert is_false
[ { "docid": "da4b9b0c8dabbd9cdee3850eb55d8751", "score": "0.7972581", "text": "def is_false\n FalseFailure.to_matcher\n end", "title": "" } ]
[ { "docid": "4f6a8c01115b9966bcc086dfac822a5a", "score": "0.8077804", "text": "def be_false\n FalseFailure.to_matcher\n end", "title": "" }, { "docid": "644fa34e31bc6b4935d6c83f27d318ff", "score": "0.7822609", "text": "def be_false\n FalseAssay.assertor\n end", ...
eea83a83a529095df383706e81bd87ea
Provides hash representing students and enrolled sections
[ { "docid": "ff6ae0b3f8b00934487f1fe32c8d4b40", "score": "0.69011647", "text": "def get_student_section_columns_hash(students)\n students.inject({}) do |map, student|\n map[student[:student_id]] = section_columns_hash(student[:sections])\n map\n end\n end", "title": "" } ...
[ { "docid": "de898fb4a9c6f52b73b55ac01b1f8dd5", "score": "0.66450995", "text": "def students_by_section\n class_map = Hash.new{ |h,k| h[k] = [] }\n self.followers.includes([:section, :student_user]).each do |f|\n class_map[f.section] << f.student_user\n end\n class_map\n end", "titl...
60d8dece01113a829fa10694f2d16f32
RuleSet needs to know `kind` to give a definitive answer on event permissions. At event grid or event form load time, kind isn't known, so some rules can't be applied until event submission. But many protocols don't involve kind, and for those we can use the RuleSet to show things about the RuleSet in the UI like the e...
[ { "docid": "8141f8541f69b18b39597c5777a2acc2", "score": "0.5817156", "text": "def rule_set\n @rule_set ||= Rules::RuleSet.build_for(calendar: calendar, kind: kind)\n end", "title": "" } ]
[ { "docid": "61c622e90e7df0ee8759d6918d7660e0", "score": "0.6282693", "text": "def rules(rule_name:, kind:)\n Rules::RuleSet.build_for(calendar: calendar, kind: kind).rules_with_name(rule_name)\n end", "title": "" }, { "docid": "f8e8a9d2b61118945f15a972619bdfd6", "score": "0.59524...
65f0634fecfd4913ab26cfae584b5fed
Give 1 exp point to a pokemon
[ { "docid": "6ca4223c5f0b97680a335141c6c767fc", "score": "0.7740598", "text": "def exp_pokemon(pokemon)\n return if pokemon.level >= $pokemon_party.level_max_limit\n pokemon.exp += 1\n if pokemon.exp >= pokemon.exp_lvl\n pokemon.level_up_stat_refresh\n pokemon.check_skill_and...
[ { "docid": "badc2676debb0e92bb9709882b5b0d62", "score": "0.70086575", "text": "def exp=(value)\n validate value => Integer\n @exp = value\n if self.level < 1\n raise \"A Pokemon can never be below level 1.\"\n end\n self.calc_stats\n end", "title": "" }, { "docid": "f269...
9bea8a31186b3059d073d77f85c4ddc3
Returns a bootable component if it can be found or loaded, otherwise nil
[ { "docid": "c54712ebe9bf4ef6bbddb3e5b013a6b9", "score": "0.6813636", "text": "def find_component(name)\n name = name.to_sym\n\n return components[name] if components.exists?(name)\n\n return if finalized?\n\n require_boot_file(name)\n\n components[name] if components.e...
[ { "docid": "35af68126079b32660261bc09ead43b9", "score": "0.6175526", "text": "def find_application_component\n self.application_component_lookup_failed = false\n unless self.app_name.blank? || self.component_name.blank?\n my_application_component = ApplicationComponent.by_application_and_comp...
f92dd25ac65b7164db61c84e14ede509
Convert an image and write the result to a local file. +url+ The address of the image to convert. The supported protocols are http:// and +file_path+ The output file path. The string must not be empty.
[ { "docid": "50f14f147f696dcbcf8017bc11ff214e", "score": "0.7454288", "text": "def convertUrlToFile(url, file_path)\n if (!(!file_path.nil? && !file_path.empty?))\n raise Error.new(Pdfcrowd.create_invalid_value_message(file_path, \"convertUrlToFile::file_path\", \"image-to-pdf\"...
[ { "docid": "529343419102984202b18e02997d7c75", "score": "0.7914003", "text": "def convertUrlToFile(url, file_path)\n if (!(!file_path.nil? && !file_path.empty?))\n raise Error.new(Pdfcrowd.create_invalid_value_message(file_path, \"convertUrlToFile::file_path\", \"image-to-image...
6d008956833a32114321b08714bf7b08
Create a collection and return it.
[ { "docid": "9a59781f3e9f514302a767fcb050d578", "score": "0.72330755", "text": "def create_collection(name)\n @change_collections_mutex.synchronize do\n collection = native.collection(name)\n collection.create\n collections[name] = Robe::DB::Mongo::Collection.new(self, c...
[ { "docid": "c259de75da1924698a5ad1ad09cf3763", "score": "0.8030693", "text": "def new_collection\n Models::Collection.new\n end", "title": "" }, { "docid": "9021186752465637abfd754e26422ac2", "score": "0.7787464", "text": "def make_collection\n @resource.make_collect...
112a1295a6910d36f9927fb81bd50afc
Raises exceptions from Net::HTTP for response codes outside of the 200 range or different than the expected response
[ { "docid": "738eaf88b426c9ef84d5b498efb3b972", "score": "0.0", "text": "def handle_response(response, expected = nil)\n response.value\n # todo: pick a better exception\n raise \"Expected a #{expected} response\" if expected and expected != response.code.to_i\n response\n ...
[ { "docid": "6b62a14b3b457cdfb8405409548bde40", "score": "0.77661264", "text": "def validate_response(response) # :nodoc:\n code = response.code.to_i\n raise HttpError, \"#{code} #{response.msg}\" if code < 200 || code > 299\n end", "title": "" }, { "docid": "c48c52f16b500c7993c8...
1aa9729446386cea66559e4384079a99
Removes sample from its context when getting transferred. It's added to the destination context when confirmed.
[ { "docid": "f96a28a3ea746acddcdc3c1ac010b29c", "score": "0.4830972", "text": "def detach_from_context\n assign_attributes(\n batch: nil,\n old_batch_number: batch.try(:batch_number),\n site: nil,\n institution: nil\n )\n end", "title": "" } ]
[ { "docid": "688986a20ad42cbe83f50d8caef45a61", "score": "0.6171725", "text": "def destroy\n @sample.destroy\n end", "title": "" }, { "docid": "c82e4d167b9f654c7a49040b91199a08", "score": "0.5647012", "text": "def sample_without_replacement(sample=1)\n if @data.respon...
4378ca49ffc5ea6cd862776d5e73580b
POST /requisitos POST /requisitos.json
[ { "docid": "1a99bd2950c8becc91bafa45e25d8a7c", "score": "0.6885191", "text": "def create\n @requisito = Requisito.new(requisito_params)\n\n respond_to do |format|\n if @requisito.save\n format.html { redirect_to @requisito, notice: 'Requisito was successfully created.' }\n forma...
[ { "docid": "f4c7346a869a66e0cfea7e323c8a5988", "score": "0.697717", "text": "def create\n @requisito = Requisito.new(params[:requisito])\n\n respond_to do |format|\n if @requisito.save\n format.html { redirect_to @requisito, notice: 'Requisito was successfully created.' }\n form...
5be10c3d09a96945eb8715b3a37e34a8
POST /videos POST /videos.xml
[ { "docid": "f4ba50e10b957cad5a24cba948ac62eb", "score": "0.0", "text": "def create\n @video = Video.new(params[:video])\n @video.safe_name = @video.name.urlize(:regexp => /[^A-Za-z0-9]/)\n if (params[:video][:is_film] == \"1\")\n file = params[:file]\n FileUtils.copy_file file.path, '...
[ { "docid": "5ef1a6c3ec93d6f5094b55594aac5db4", "score": "0.69252187", "text": "def create\n @video = @client.videos.build(params[:video])\n\n respond_to do |format|\n if @video.save\n format.html { render :text => \"Video Successfully Uploaded\" }\n # format.xml { render :xml =>...
d2ab2ba5d6e8a14e526c0526e44b7a13
Builds appletouchicons from the given source file.
[ { "docid": "473db3554221e69865d3db94378de6e9", "score": "0.6079746", "text": "def build(source, destination)\n @apple_sizes.each do |size| \n if size == '180x180'\n build_size(source, '180x180', \"#{destination}/apple-touch-icon.png\") ...
[ { "docid": "adc14a6528484f3a9b47890b60b86871", "score": "0.615837", "text": "def build_single(source, destination)\n build_size(source, '152x152', \"#{destination}/apple-touch-icon-precomposed.png\")\n end", "title": "" }, { "docid": "0fe31bf76500e3563bf934e59d2a1b49", ...
4eb68881a49691fdc3050c02ffc728f9
Cookbook Name:: ssh_key_wrapper Provider:: private Copyright 2014, Virender Khatri Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software ...
[ { "docid": "5df439bcfb982aa8a070e97f159fa342", "score": "0.0", "text": "def whyrun_supported?\n true\nend", "title": "" } ]
[ { "docid": "d5bef3bd85f7846ba9c8edcf2bcb3898", "score": "0.6630206", "text": "def ssh_key(arg=nil)\n set_or_return(:ssh_key, arg, :kind_of => String)\n end", "title": "" }, { "docid": "9ac3473ac019890b7eab6d4b71fbb269", "score": "0.6564048", "text": "def get...
d6a2c1dab78c14c71ec40f0f25c65a93
Calculate Operated Value operation : operation (0: increase, 1: decrease) operand_type : operand type (0: invariable 1: variable) operand : operand (number or variable ID)
[ { "docid": "3f4594aac9443a391c773fffb98d9e0b", "score": "0.79542345", "text": "def operate_value(operation, operand_type, operand)\n if operand_type == 0\n value = operand\n else\n value = $game_variables[operand]\n end\n if operation == 1\n value = -value\n end\n return...
[ { "docid": "83fc187a8f3d5abb50dfc14bda31f4cf", "score": "0.7774289", "text": "def operate_value(operation, operand_type, operand)\r\n value = operand_type == 0 ? operand : $game_variables[operand]\r\n operation == 0 ? value : -value\r\n end", "title": "" }, { "docid": "9e5dfc81a1fadf4...
233fc7f12f4532654f7dfd48b31b2eb1
returns a string telling the user if their answer was correct returns a String
[ { "docid": "573fe43bf6ef626660253659eab8bfed", "score": "0.8238532", "text": "def tell_user_if_they_are_correct\n if correct_answer?\n \"You got the right answer!\"\n else\n \"Your answer was incorrect.\"\n end\n end", "title": "" } ]
[ { "docid": "dbd90b2f112c5607c1ef2328d89b14b0", "score": "0.7978411", "text": "def check_answer\n\tanswer = gets.chomp\n\tif(answer != \"yes\" && answer != \"no\")\n\t\tabort(\"Not a correct response.\")\n\telsif (answer == \"yes\")\n\t\treturn \"1\"\n\telsif (answer == \"no\")\n\t\treturn \"2\"\n\tend\n...
01376e6b7839300e66f5ab188a7d763c
Tests if replication stream is in error state
[ { "docid": "52ba0c3ea400a20de343c942d55dda1f", "score": "0.68425316", "text": "def error?\n self.State == P2::DS_STATE_ERROR\n end", "title": "" } ]
[ { "docid": "6abc0c4452bf70a0088e8d40137dff81", "score": "0.7117488", "text": "def error?\n @status == ERROR_FLAG\n end", "title": "" }, { "docid": "eb2fc6be3dea89783d72c80904f77d33", "score": "0.69711083", "text": "def error?\n\t\tEventMachine::report_connection_error_status(...
8e43bf117f0f258f83405ac6873873ba
Preferred by a Rubyist
[ { "docid": "d868770f360a2e37e573c62c0a008d7b", "score": "0.0", "text": "def get_avg(num_1, num_2)\n (num_1 + num_2) / 2\nend", "title": "" } ]
[ { "docid": "142778c4bdd287e558dd6e337afee8cf", "score": "0.6394588", "text": "def prefered\n first\n end", "title": "" }, { "docid": "94a9f9cebb96ca3b29ccb5ba3cfcdd94", "score": "0.5958863", "text": "def alternatives; end", "title": "" }, { "docid": "a9810c1006c12...
08053b355c5da4a244a0f01716c079c1
Generates a new Lita adapter.
[ { "docid": "b44d74a6a17c052bec825db39002ba82", "score": "0.51121104", "text": "def adapter(name)\n config = generate_config(name, \"adapter\")\n generate_templates(config)\n post_messages(config)\n end", "title": "" } ]
[ { "docid": "b67b069aa59db4e159b46811743f9ece", "score": "0.62656707", "text": "def connect_adapter()\n @adapter=\"Lolita::Adapter::#{self.adapter_name.to_s.camelize}\".constantize.new(self)\n end", "title": "" }, { "docid": "68efb777315657402d26a53a0c5179fa", "score": "0.5765...
cf0d3e17c530680de31d136e6b5d7a0f
POST /occupancies POST /occupancies.xml
[ { "docid": "b828123e840921f1f19e234acd841508", "score": "0.6557069", "text": "def create\n @occupancy = Occupancy.new(params[:occupancy])\n @occupancy.location = @location\n \n respond_to do |format|\n if @occupancy.save\n flash[:notice] = 'Occupancy was successfully created.'\n ...
[ { "docid": "3bd7bce06e1e64ffda6383724700a381", "score": "0.6538107", "text": "def create\n @occupant = Occupant.new(params[:occupant])\n\n respond_to do |format|\n if @occupant.save\n format.html { redirect_to @occupant, notice: 'Occupant was successfully created.' }\n format.js...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "890ef5fe4aaf3bcfd20596ace93d6ea5", "score": "0.0", "text": "def event_photo_params\n params.require(:event_photo).permit(:event_id, :image)\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...
593bcddc6fb958d2665409cefe711f8d
equal to location.open_days minus days_requested returns in format [[month, day], [month, day], ...] for consumption by the javascript date picker
[ { "docid": "9ae5bee5977be3ca3c2a62ab30aa8036", "score": "0.5904201", "text": "def pickup_times_for_datepicker(days_out = 90, *excluded_loans)\n excluded_loans.flatten!\n times = pickup_times(days_out, excluded_loans)\n return times.map { |d| d.to_s(:js) }\n end", "title": "" } ]
[ { "docid": "c9ca3e6d834b100d672042cfb54bbfdd", "score": "0.67443687", "text": "def available_days\n days_in_month - unavailable_days\n end", "title": "" }, { "docid": "3a210feb4a5627d728d2f202d9248b3f", "score": "0.6277393", "text": "def monthdays; end", "title": "" }, { ...
abe4f9490de612db3f0b53f6b1b39144
This method generates an array of all moves that can be made after the current move.
[ { "docid": "de0a14e0a02baf3eca82284f7a92870f", "score": "0.0", "text": "def children\n empty_pos = []\n\n @board.rows.each_with_index do |row, i1|\n row.each_with_index do |ele, i2|\n if @board.empty?([i1, i2])\n empty_pos << [i1, i2]\n end\n end\n end\n\n po...
[ { "docid": "ab6b87d439d2ac15bdfbf3aebcff6da0", "score": "0.7375647", "text": "def generate_moves\n @delta.each do |step|\n (1..7).each do |i|\n new_pos = [@pos[0] + step[0] * i, @pos[1] + step[1] * i]\n if valid_coord?(new_pos)\n @move_list << new_pos\n break if @...
f1cccede37851dcf3a4c2b39a6270436
Gets the firstlevel dependencies of the input formulae and recurses down to the leaves to get the complete dependency graph. The output of `brew deps foreach 1 ` is of the form: formula1: dep1 dep2 dep3 ... formula2: dep1 dep2 dep3 ... We need to add additional lines dep1: dep2: dep3: for all dependencies. This is cons...
[ { "docid": "28df8dea731f46a3045e44bec7f4b53a", "score": "0.6297279", "text": "def brew_deps_formulae(res, arg)\n out = %x[brew deps --for-each --1 #{arg}]\n unless $? == 0 # Check exit code\n abort\n end\n out.split(\"\\n\").each do |line|\n formula,deps = line.split(':...
[ { "docid": "56264f41ad605f58d7c21a5542fc759c", "score": "0.6446065", "text": "def recursive_deps\n Formula.expand_deps(self).flatten.uniq\n end", "title": "" }, { "docid": "d8be7602c952a412574049c21cae7923", "score": "0.6266251", "text": "def dependency_tree(keg_name, recursive=t...
f9d86dbdcd68970f1249e6b2be2e82b9
DELETE /processmasters/1 DELETE /processmasters/1.json
[ { "docid": "4dc2281f44e14b1ae3be8e3138fc51ed", "score": "0.7374029", "text": "def destroy\n @processmaster.destroy\n respond_to do |format|\n format.html { redirect_to processmasters_url, notice: 'Processmaster was successfully destroyed.' }\n format.json { head :no_content }\n end\n ...
[ { "docid": "d819015a419e4ad08c49cf8ba1b17c00", "score": "0.684996", "text": "def destroy\n @childmaster = Childmaster.find(params[:id])\n @childmaster.destroy\n\n respond_to do |format|\n format.html { redirect_to childmasters_url }\n format.json { head :no_content }\n end\n end",...
b2143ad03f4091030318c08f97029d09
def current_player(board) if turn_count(board) % 2 == 0 return "X" else return "O" end end
[ { "docid": "2d72d6536dc2162e26c678c603c07378", "score": "0.97210616", "text": "def current_player(board)\n turn_count(board) % 2 == 0 ? \"X\" : \"O\"\nend", "title": "" } ]
[ { "docid": "e5cb015d899aa10b2a70c120dec9b477", "score": "0.9867085", "text": "def current_player(board)\n if turn_count(board) == 0\n return \"X\"\n elsif\n turn_count(board) % 2 == 0 \n return \"X\"\n else\n return \"O\"\n end \n end", "title": "" }, { "doci...
e4ca57ce51140c29f55cc382f9f6d70c
adds the given list of cells to the route and makes it valid
[ { "docid": "433af9f5d2c3229d8a2fc28a117ec1b2", "score": "0.7342274", "text": "def add_cells(routeCells)\n add_members_to_collection(routeCells) {|routeCells| @cellpath = routeCells }\n end", "title": "" } ]
[ { "docid": "179bfa1edff304954bc3368bfc2aced0", "score": "0.7478061", "text": "def add_maze_cell_to_route_cells(cell, routeCells)\n (@cells.include? cell) ? routeCells << cell : []\n end", "title": "" }, { "docid": "c842f53cff9cbef23f4c930c96600987", "score": "0.6792328", "text": ...
66a389bc746615b42e162026bf746b56
GET /beer_mains/1 GET /beer_mains/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "a84e82c8e8ea69d91217a4ea140fd19a", "score": "0.72948754", "text": "def index\n @beer_mains = BeerMain.all\n end", "title": "" }, { "docid": "55661ff5a7a662de6c34c647d1e2ee73", "score": "0.64980966", "text": "def index\n @beers = Beer.all\n\n render json: @be...
45d65112296c9172b8ea5ff5c690f16e
Create favoring of given user_id and some generated posts Param : +user_id+:: the user id of user to peform the follow Returns : array of the odd post which is favored by the user
[ { "docid": "a24368d77c20611642b61688e2fec4a6", "score": "0.7595685", "text": "def create_favoring(user_id) \n # create 20 post of topic1, favor odd id post\n posts = FactoryGirl.create_list(:post,20, user_id: user_id)\n #favoring odd index post\n favor_posts = posts.reject{|p| p.id % 2 ==0}\...
[ { "docid": "7de64c5607f1b521387e08f7d103adc8", "score": "0.6650629", "text": "def post_favorite\n if current_user != nil\n if object.favorites.exists?(user_id: current_user.id)\n object.favorites.where(user_id: current_user.id).first\n else\n Favorite.new\n end\n else\...
09e70af04a4adf2848e5803299563c57
POST /rss_slides POST /rss_slides.xml
[ { "docid": "faa8488f75ec66ea4dfa2b7a3f15b1bf", "score": "0.71576697", "text": "def create\n @rss_slide = RssSlide.new(params[:rss_slide])\n\n respond_to do |format|\n if @rss_slide.save\n format.html { redirect_to(@rss_slide, :notice => 'Rss slide was successfully created.') }\n ...
[ { "docid": "79c5afd56e69e8479186408844a4f591", "score": "0.6627301", "text": "def slides\n @id = params[:id]\n @item = Item.find(@id)\n begin\n @slides = @item.images.where(['publish=?', true]).order('position')\n rescue => error\n flash[:error] = error.message\n ensure\n # n...
df080b85a2582221bd757c0b22cdbfba
The item that is called.
[ { "docid": "f1e241a5ce46c0ee6c8a8353a90c955d", "score": "0.0", "text": "def to; end", "title": "" } ]
[ { "docid": "05e766db106426775e44446bdc007ed6", "score": "0.74823266", "text": "def item\n self\n end", "title": "" }, { "docid": "604f204becc31165c12673ef2300f0b1", "score": "0.7419819", "text": "def item; end", "title": "" }, { "docid": "604f204becc31165c12673ef2...
83a089ceb30ff47442f8ea70e805911e
Clean up after unsubscribing
[ { "docid": "5d862213f3b582aedef1b4a810b4020b", "score": "0.0", "text": "def unsubscribed\n @subscription_ids.each do |sid|\n TodoManagerSchema.subscriptions.delete_subscription(sid)\n end\n end", "title": "" } ]
[ { "docid": "db6d3fbf672cdd76bd9850de5fa58e72", "score": "0.78038883", "text": "def unsubscribed\n # Any cleanup needed when channel is unsubscribed\n end", "title": "" }, { "docid": "db6d3fbf672cdd76bd9850de5fa58e72", "score": "0.78038883", "text": "def unsubscribed\n # Any cl...
e001251b12ba504d8044f6b0a0ba8d03
Return json payload +text+:: Text you want to send +options+:: Options you want on payload +env+:: Environments :prod, :dev +type+:: Notification type :normal, :silent, :nosound
[ { "docid": "0df77706082da80c7736ec51b394c907", "score": "0.7653178", "text": "def message(text, options = {}, env = :prod, type = :normal)\n if type == :normal\n data = normal_notification(text, options)\n elsif type == :silent\n data = silent_notification(text, options)\n e...
[ { "docid": "3d46e53f6336464d2bac321d5e3d1b97", "score": "0.58228374", "text": "def get_instance_message\n dropdown_options = get_instance_dropdowns\n instance_json = {\n \"text\": \"Did you want to run a test?\",\n \"attachments\": [ { \n \"text\": \"Choose environment to execute...
baf6b73d698f11f9fcf3481e2f21d93e
DELETE /classes_planifications/1 DELETE /classes_planifications/1.json
[ { "docid": "95578f233b81e638882ac70e6ab6be8c", "score": "0.7763773", "text": "def destroy\n @classes_planification.destroy\n\n head :no_content\n end", "title": "" } ]
[ { "docid": "40a3fca9b10a8aadcf207d36703902b8", "score": "0.7070158", "text": "def destroy\r\n @testplan = Testplan.find(params[:id])\r\n @testplan.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to testplans_url }\r\n format.json { head :no_content }\r\n end\r\n ...
254ac66d16a4272de718a9c946b994e2
Returns a copy of value with spaces replaced by nonbreaking space characters. With no arguments, return a single nonbreaking space. The output uses the escaping format '&160;' since that works in both HTML and XML (as opposed to ' ' which only works in HTML).
[ { "docid": "48e1efa4dda6de9e444c12d1e2e26dda", "score": "0.7323672", "text": "def nbsp(value = \" \")\n raw(h(value).gsub(/ /,'&#160;'))\n end", "title": "" } ]
[ { "docid": "bed4d52a159e6ddd30bc582e6a7872a8", "score": "0.7450067", "text": "def widont(text)\n text.gsub(/([^\\s])\\s+([^\\s]+)\\s*$/, '\\1&nbsp;\\2').html_safe\n end", "title": "" }, { "docid": "b8129ad72fd303bea09297e5b11a5029", "score": "0.7404689", "text": "def nbsp(value =...
faa3fc46f3e8c180e8455f0525b693ca
better solution, O(n) time & space
[ { "docid": "d8e0e0ebbf16ff6fc1e04abd94836826", "score": "0.0", "text": "def permutation_is_palindrome?(str)\n char_count = {}\n pointer = 0\n while pointer < str.length\n char_count[str[pointer]] = 0 unless char_count[str[pointer]]\n char_count[str[pointer]] += 1\n pointer += 1\n end\n\n s...
[ { "docid": "94b952c4eec254dafeaf15d164f67032", "score": "0.65950614", "text": "def slow_solution(m, a)\n n = a.size\n return 1 if n == 1\n distinct = 0\n n.times do |back|\n (back..n - 1).each do |front|\n if a[back..front] == a[back..front].uniq\n distinct += 1\n else\n b...
04150c0c38a4c2c9b33097740537a749
`Instructorfail_student` should take in a student instance and test name. Like `pass_student`, it should try to find a matching `BoatingTest` and update its status to 'failed'. If it cannot find an existing `BoatingTest`, it should create one with the name, the matching student, and the status 'failed'.
[ { "docid": "a83435a77bce270f26b8a60615111663", "score": "0.7600791", "text": "def fail_student(student, test_name)\n student_found = BoatingTest.all.find do |test_info|\n test_info.student == student && test_info.boating_test_name == test_name\n end \n if student_fou...
[ { "docid": "04a769ab3345d884085e318763c680eb", "score": "0.8233136", "text": "def fail_student(student, test_name)\n test_exist = BoatingTest.all.find do |boating_test|\n boating_test.instructor == self && boating_test.student && student && boating_test.name == test_name\n end\n...
d9a3013bb93626adb12e9949bb845410
I adapted this solution from C++ code at:
[ { "docid": "d8f36bab17cd17dd62044a77077683e8", "score": "0.0", "text": "def cache_largest_collatz_chain\r\n number = 1000000\r\n sequence_length = 0\r\n starting_number = 0\r\n sequence = 0\r\n cache = Array.new(number + 1, -1)\r\n cache[1] = 1\r\n i = 2\r\n while i <= number\r\n sequence = i...
[ { "docid": "bc658f9936671408e02baa884ac86390", "score": "0.5185479", "text": "def anchored; end", "title": "" }, { "docid": "a412e9fd2c9bc00d7cf684e2b7c9ad16", "score": "0.5178289", "text": "def subStringMatchExact(target,key)\n \n#Assign new variable to replace target during calcul...
3ab243e190d88118d6b76d7ea6d2518b
Open an SSH control master to multiplex connections to a given list of nodes. This method is reentrant and reuses the same control masters. It is multiprocesses:
[ { "docid": "7174d433de3c24230bcddc36f1914f03", "score": "0.79373664", "text": "def with_ssh_master_to(nodes, timeout: nil, no_exception: false)\n nodes = [nodes] if nodes.is_a?(String)\n with_platforms_ssh(nodes: nodes) do\n # List of user_ids that acquired a lock, per node\...
[ { "docid": "4afc34e1bfbb771ad7440c7e91099da9", "score": "0.6829398", "text": "def open_ssh_session(cnodes=[])\n handler = Proc.new do |server|\n server[:connection_attempts] ||= 0\n if server[:connection_attempts] < 6\n server[:connection_attempts] += 1\n t...
23b89c0ccfcd120c0625a1a784922afa
DELETE /presentacion_productos/1 DELETE /presentacion_productos/1.json
[ { "docid": "fa7b8fb041d8b590e4786effc19e5c2a", "score": "0.0", "text": "def destroy\n @presentacion_producto.destroy\n respond_to do |format|\n format.js\n format.html { redirect_to presentacion_productos_url, notice: 'Presentacion producto was successfully destroyed.' }\n format.js...
[ { "docid": "2fa0a3656e86962ca1a10fa31aede189", "score": "0.78498614", "text": "def destroy\n @productos_json.destroy\n respond_to do |format|\n format.html { redirect_to productos_jsons_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9fc2...
47f538b44f8410c659e7d0e6cf6cebbe
announce win condition description
[ { "docid": "8a5a183cd1e039afffcc1fe72f58709a", "score": "0.7690653", "text": "def win_condition_message(win_description)\n \"To defeat this monster, you must #{win_description}.\"\n end", "title": "" } ]
[ { "docid": "c3e16da3ffce87acbff3b5bc5e24c3ec", "score": "0.678628", "text": "def winning_message(won:) \n puts won != false ? \"-----#{won.name} has won!------\" : \" \"\n end", "title": "" }, { "docid": "138b0e4455db672f6f5c07547f77612c", "score": "0.67360646", "text": "def ...
f496d74df1ef43f1eee029a886f51566
appends a filtered policy from file/database.
[ { "docid": "1f5e92d7b4bab0e623f9ec9cc49725b4", "score": "0.52936006", "text": "def load_increment_filtered_policy(filter)\n raise ArgumentError, 'filtered policies are not supported by this adapter' unless adapter.respond_to?(:filtered?)\n\n adapter.load_filtered_policy(model, filter)\n m...
[ { "docid": "9eea96c9585f1655d215a2edafb9ad9e", "score": "0.6004303", "text": "def load_filtered_policy(_model, _filter); end", "title": "" }, { "docid": "a7589b6ceda67f69427de98c262e8c50", "score": "0.5974355", "text": "def add_and_filter(file, add, filter_re)\n lock = lock(@new_res...
c83ea70c654eb51a9ab6df5bd0521342
POST /alercos POST /alercos.xml
[ { "docid": "9addeaf686cfe5130cfa2315d901680d", "score": "0.5877304", "text": "def create\n @alerco = Alerco.new(params[:alerco])\n\n respond_to do |format|\n if @alerco.save\n format.html { redirect_to(@alerco, :notice => 'Alerco was successfully created.') }\n format.xml { ren...
[ { "docid": "f66bf040835c9dd594b69359194af6d9", "score": "0.61307806", "text": "def request\n #server = Net::HTTP.new(\"eCommerce.airborne.com\", 443)\n server = Net::HTTP.new(\"eCommerce.airborne.com\", 80)\n #path = \"/ApiLandingTest.asp\"\n path = \"/ApiLanding.asp\"\n data = ...
50b1c2487bff3dff32667086fb56e6d3
Restituisce la nuova opzione selezionata dall'utente
[ { "docid": "33cc72efc2e802c79344105e37307f9e", "score": "0.0", "text": "def selected_value\n return @keys ? @keys[self.index] : self.index\n end", "title": "" } ]
[ { "docid": "13f7d657b315a10f5ae06c7c39d7612c", "score": "0.62364", "text": "def excede_control_de_pago_global()\n @sumatoria_posible_pago_todos_tickets_de_hoy_todos_parlay_global = 0 # inicializacionn de variable sumatoria en cero ok\n #La idea aqui es verificar si la sumatoria de posible pago de ...
d84db93b3d7bce13b63531a3cc6fe83d
PATCH/PUT /salesmen/1 PATCH/PUT /salesmen/1.json
[ { "docid": "711151ad95297ba69dab8bd924136250", "score": "0.61507565", "text": "def update\n respond_to do |format|\n if @salesman.update(salesman_params)\n format.html { redirect_to @salesman, notice: 'Salesman was successfully updated.' }\n format.json { render :show, status: :ok,...
[ { "docid": "fa4427ddda3b04af8bd370b464c396a1", "score": "0.719331", "text": "def update\n\n respond_to do |format|\n if @sale.update_attributes(sale_params)\n format.html { redirect_to @sale, notice: 'Sale was successfully updated.' }\n format.json { head :no_content }\n else\...
c5d2e5a71683bf52d3a7e79610ca7b0a
POST /projects POST /projects.json
[ { "docid": "11062254dfa4d0874b8b12c47fd71ca4", "score": "0.6948445", "text": "def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { r...
[ { "docid": "3987b362caed851c61fc0c13c211f4a8", "score": "0.7338293", "text": "def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.json { render :json => @project, :status => :created, :location => @project }\n format.html ...
c256fbb2bca998edcf163a602160bb70
Getting the Maximum Element Since the maximum element in max heap is always at root, it will be stored at this.array[0].
[ { "docid": "8d2595efdfdefe473050d885a977596a", "score": "0.7740931", "text": "def max\n return -1 if @count == 0\n return @array[0]\n end", "title": "" } ]
[ { "docid": "d4891d3416d7daea425738098a0efb4d", "score": "0.8585525", "text": "def extract_maximum!\n raise \"Heap Underflow - The heap is empty\" if self.heapsize < 1\n\n max_value = self[0]\n self[0] = self[self.heapsize - 1]\n self.heapsize = self.heapsize - 1\n self.max_heapify!(0)\n\n...
6004291a60ef9b01e4ecaffeac8c6f12
Read the stored data in ~/.rgfile
[ { "docid": "c0aae20d519914d3062f9703b5bcb08d", "score": "0.567468", "text": "def read\n File.open(path, 'r').read\n end", "title": "" } ]
[ { "docid": "bda3e2a2911be8d458aa2a374e693746", "score": "0.647283", "text": "def read\n begin\n @mg.get_file_data(@key)\n rescue => e\n puts \"read error: #{e.inspect}, key: #{@key}\"\n ''\n end\n end", "title": "" }, { "doci...
8986f5d4d8eff243d3c040ba1a97772d
TODO Get the fuck off of CanCan, it is such a pain to use Usage: There are two ways to authorize. 1. add 'load_and_authorize_resource' at the top of the controller make sure to only try and authorize(here in ability.rb) the object that load_and_authorize_resource instantiates. Do not create an object yourself inside th...
[ { "docid": "06de4a3c183f8f827d160e7e6a400a8c", "score": "0.0", "text": "def initialize(current_user)\n # Define abilities for the passed in user here.\n current_user ||= User.new # guest user (not logged in)\n\n # admin can access everything\n if current_user.admin?\n can :manage, :all\...
[ { "docid": "aa126b9bc0cddfe8a1fe380a3439dfe2", "score": "0.75217396", "text": "def authorize_resource(*args); end", "title": "" }, { "docid": "5863ba252369b103dc0a9c9e0ac67385", "score": "0.74272615", "text": "def authorize_resource\n EffectiveResources.authorize!(self, action...
6f5fe1c9a9cfa73d718f0e7edf1d7efb
Start with any amount of IO objects or filenames; defaults to STDOUT
[ { "docid": "ea5066f16fd6c86851a7a7c74a3d9c10", "score": "0.0", "text": "def initialize(*args)\n # Handle default\n if args.empty?\n args = [STDOUT]\n end\n\n # Initialization\n @default_level = Logger::Severity::INFO\n @formatter = ::TeeLogger::Formatter.new\n @...
[ { "docid": "a2d70fc1589dc4ba5d94abcbd9312fe1", "score": "0.6455093", "text": "def stdouts; end", "title": "" }, { "docid": "d3ec5177a036dbc4b089431a57c403bc", "score": "0.60068375", "text": "def output=(io); end", "title": "" }, { "docid": "11d6527086ab119eae27dcc1759669b...
7c7b7a0de40ec9af1d10cea5dbb03318
Public: Metadata as extracted from the file reparse Force reparsing of raw metadata (if blob's changed) Returns the Yaml parsed version of raw_meta_data
[ { "docid": "7dcd855ba79d33f56ae93e8f3cd1f0fe", "score": "0.7228375", "text": "def meta_data(reparse = false)\n return @meta if @meta && !reparse\n if data = raw_meta_data\n @meta = YAML.load(data)\n else\n @meta = {}\n end\n end", "title": "" } ]
[ { "docid": "8cb50c74b1c4dc40e4cec4927c6a6593", "score": "0.7069947", "text": "def metadata(raw)\n raw.match data_regex\n OpenStruct.new YAML.load($1) if $1\n end", "title": "" }, { "docid": "a2003e2828b2cf55387bba26539e1bff", "score": "0.70054066", "text": "def raw...
1c56ff845a5fac047229667ba925a072
Method to get domain name of a site
[ { "docid": "67d31ef689e7c0b967930e04ca2b259e", "score": "0.78004086", "text": "def getDomainName(url)\n url = \"http://#{url}\" if URI.parse(url).scheme.nil?\n host = URI.parse(url).host.downcase\n host.start_with?('www.') ? host[4..-1] : host\n return host.to_s\n end", "title": "" } ]
[ { "docid": "6f2ade27268ec53709440b903348eed5", "score": "0.87780565", "text": "def site_domain\n if self.site_url\n split_host = URI.parse(self.site_url).host.split('.')\n \"#{split_host[split_host.size - 2]}.#{split_host[split_host.size - 1]}\" if split_host.size > 1\n end\n rescue URI...