query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "3c9b0ddc404206b154a61c52d0a3e140", "score": "0.0", "text": "def job_cast_params\n params.require(:job_cast).permit(:organization_id, :title, :description, :compensation_min, :compensation_max, :skills, :city, :state, :postal_code, :country_code)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7496716", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6956598", "text": "def strong_params\n params.require(:request).permit(param_white...
f43e616bec51839a423a13a987b9db8c
process_update_fab_houses Description: Updates the FAB houses called from admin button on review form Parameters from params id the review id fab_houses list of fab house from review
[ { "docid": "350ebef9efd4363fa2f598d3038d0d4a", "score": "0.7673455", "text": "def process_update_fab_houses\n\n design_review = DesignReview.find(params[:design_review][:id])\n fab_msg = post_fab_house_updates(design_review, params[\"fab_house_ids\"] )\n\n redirect_to(:action => :view, :id => params[...
[ { "docid": "d9ee19649cf0c84d9dcf50f3bbbbabf4", "score": "0.7691714", "text": "def post_fab_house_updates(design_review, fab_house_list)\n\n comment_update = false\n\n # Check to see if the reviewer is an SLM-Vendor reviewer.\n # review_results[:fab_houses] will be non-nil.\n added = ''\n removed ...
c62a95e83f50037c96a8f0c46f2cd2ad
GET /offers GET /offers.json
[ { "docid": "923abfbc8b5fb91b5d29824369edf67a", "score": "0.0", "text": "def index\n user = User.find_by(id: session[:user_id])\n proposed_offers = Offer.proposed? user\n received_offers = Offer.received? user\n offers = received_offers.concat(proposed_offers)\n if (params[:pending]==\"all...
[ { "docid": "7f47a1014a99be7230782ce9a237237b", "score": "0.79196864", "text": "def get(params = {})\n client.get(\"/v2/shopping/hotel-offers/#{@offer_id}\", params)\n end", "title": "" }, { "docid": "d019bd1853a72c3c85667866bcbaf988", "score": "0.7916423", "text": "de...
de6864257ae7be2d6d80fe70791cb79a
PATCH/PUT /itineraries/1 or /itineraries/1.json
[ { "docid": "ba8acbd867bcd87d33cafa7ff7797fdd", "score": "0.6689564", "text": "def update\n respond_to do |format|\n if @itinerary.update(itinerary_params)\n format.html { redirect_to @itinerary, notice: \"Itinerary was successfully updated.\" }\n format.json { render :show, status:...
[ { "docid": "fd7230f87a8750750f8afd3cefba5bb5", "score": "0.6685904", "text": "def update\n respond_to do |format|\n if @itinerary.update(itinerary_params)\n format.html { redirect_to @itinerary, notice: 'Itinerary was successfully updated.' }\n format.json { render :show, status: :...
678f0647e1d3b6a6be49ec9aa47bd13f
Returns the cached model that has been wrapped by the combined model.
[ { "docid": "433587279a15cfde1014fcdf1a6a46ee", "score": "0.5993843", "text": "def unwrap_to_cached\n # logger.debug(\"CMB: unwrap <#{self.class}:#{self.object_id}>\")\n @cached\n end", "title": "" } ]
[ { "docid": "6da5c88709b479b8ce68d22713dbfcdb", "score": "0.63334936", "text": "def cache_local\n return CachedModel.cache_local\n end", "title": "" }, { "docid": "6da5c88709b479b8ce68d22713dbfcdb", "score": "0.63334936", "text": "def cache_local\n return CachedModel.cache_loca...
04c6a52310b0465d943f60688566644f
Adjusts the view in the window so that fraction of the horizontal span of the text is offscreen to the left. Fraction is a fraction between 0 and 1.
[ { "docid": "8f9effa5312ec50ed88cc749c8f472c2", "score": "0.46118513", "text": "def xview_moveto(fraction)\n execute_only(:xview, :moveto, fraction)\n end", "title": "" } ]
[ { "docid": "cf8800be5aa30dcffd4dcfb42dc681a2", "score": "0.6306272", "text": "def refresh_window_alignment\n self.x = case @@alignment\n when 0 then 0\n when 1 then Graphics.width/2-(width/2)\n when 2 then Graphics.width-width\n end\n end", "title": "" }, { "docid": "32804142...
db1a1f469d0e751d31d5620c669dd620
A description of this type of node. Returns a Symbol.
[ { "docid": "d0f1b31ac3259fd3598759fd0f7eb4e3", "score": "0.0", "text": "def node_type\n :route\n end", "title": "" } ]
[ { "docid": "e255b730ba32c0b56de76bc848d4e3d4", "score": "0.74785763", "text": "def inspect\n \"Node(#@sym, #@wt)\"\n end", "title": "" }, { "docid": "bb500fc17073261cf24fb7329eeffa8c", "score": "0.7163782", "text": "def symbol()\n self.context_node.text_value.strip.to_...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "393c9342e6ed9e8a6d712905962e04b9", "score": "0.0", "text": "def instance_time_params\n params.fetch(:instance_time, {})\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7493595", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6954758", "text": "def strong_params\n params.require(:request).permit(param_white...
e08e25effefe59ba5a5ff9a9e2dce079
POST /search_sets POST /search_sets.json
[ { "docid": "e22582cba68566fc9edb4ddfee82fa44", "score": "0.7628517", "text": "def create\n @search_set = SearchSet.new(params[:search_set].slice(:title, :description))\n\n searches = params[:search_set][:searches].select(&:present?).collect { |search_id| Search.find(search_id)}\n @search_set.se...
[ { "docid": "cf791e52b3acfb155566e00d0261137b", "score": "0.63668483", "text": "def create\n @search_set = SearchSet.new(params[:search_set])\n\n respond_to do |format|\n if @search_set.save\n format.html { redirect_to(@search_set, :notice => 'Search set was successfully created.') }\n ...
f32970e4efd406b9db4dd360c1263fde
Starts the connection and traffic handlers
[ { "docid": "7a65ba70fe7162235159c7380994110d", "score": "0.67416567", "text": "def start_connection_and_handlers\n server_list = servers\n\n Log.info(\"Starting Federation Broker %s Processor %s#%s against %s\" % [processor_type, cluster_name, instance_name, server_list.to_s])\n\n ...
[ { "docid": "bb53dfe6e15844ad4025c7711e9bfad3", "score": "0.7708536", "text": "def _start\n\n # On join, we need to subscribe and register the different handlers\n self.client.on :join do |session, details|\n self.join_handler session, details\n end\n\n # On...
47082c1627962609d0528e1daac10d21
Union_Shape x Point > Bool
[ { "docid": "3db3c5e72d68a379abc40dafef3a038e", "score": "0.675036", "text": "def in_shape?(val) check_pre((val.int? or val.point?)); self.first.in_shape?(val) or self.last.in_shape?(val) end", "title": "" } ]
[ { "docid": "75cbc468438862b52114bb35ffd26473", "score": "0.81609285", "text": "def unionshape?; false end", "title": "" }, { "docid": "147b01cfb2e84061832fb98e82b70f3c", "score": "0.81203675", "text": "def union_shape?(o)\n o.union1d? or o.union2d?\nend", "title": "" }, { ...
b3728b46c194d709a9046bd3405631aa
is equivalent to: attr_reader :chocolate_chip_count attr_writer :chocolate_chip_count 1g of sugar has 4 calories 1g of flour has 5 calories
[ { "docid": "5e3c26d73b577702fbae8a66f66ad608", "score": "0.5802144", "text": "def calorie_count\n total = (@sugar_amount * 4) + (@flour_amount * 5)\n puts \"This cookie has #{total} calories\"\n end", "title": "" } ]
[ { "docid": "de717d4b6b688a2225d1e7fe6b0f0293", "score": "0.7138521", "text": "def amount_of_chocolate_chips\n return $perfect_10_recipe[:mini_dark_chocolate_chips]\nend", "title": "" }, { "docid": "895a7061ff89fdfbc9adddfcf41e1507", "score": "0.6643205", "text": "def amount_of_choc...
cb44c2427a012c6bb219cc0591f446e0
=begin Modify the word_sizes method from the previous exercise to exclude nonletters when determining word size. For instance, the length of "it's" is 3, not 4. =end using tally
[ { "docid": "aaff321aadbbc113b1b83dc55fb170cd", "score": "0.7539164", "text": "def word_sizes(str)\n str = str.gsub(/[^a-zA-Z ]/,\"\")\n str.split.map { |element| element.size }.tally\nend", "title": "" } ]
[ { "docid": "1a9065a36c1e77f9954ab445bb691b48", "score": "0.76561236", "text": "def word_sizes(string)\n clean_string = string.gsub(/[^a-zA-Z]/, \" \")\n \n clean_string.split.map { |word| word.size }.tally\n \nend", "title": "" }, { "docid": "bae06dd87c7f1b2b5449d23449d858c6", "score...
b4e25f3dfbae5c362e88f7c91759c7b9
PATCH/PUT /admin/welcomes/1 PATCH/PUT /admin/welcomes/1.json
[ { "docid": "8ba605a42042574d3012e44709bc69f5", "score": "0.7549434", "text": "def update\n respond_to do |format|\n if @admin_welcome.update(admin_welcome_params)\n format.html { redirect_to @admin_welcome, notice: 'Welcome was successfully updated.' }\n format.json { render :show,...
[ { "docid": "f4c71223fae0a27aafd93fa3b734f0d1", "score": "0.7290675", "text": "def update\n @welcome = Welcome.find(params[:id])\n\n respond_to do |format|\n if @welcome.update_attributes(params[:welcome])\n format.html { redirect_to root_path, notice: 'Welcome was successfully updated....
d768e49c5647bd675653fef38da0646c
Output words and their ranks in groups according to the first letter of the word.
[ { "docid": "5b8d5da6aae4c7d5063e13ea9a2523d2", "score": "0.66419137", "text": "def letter_ranks(opts={})\n out = opts[:out] || $stdout\n max = opts[:max] || 12\n\n # sort by score\n word_scores = scoresheet.sort_by{ |w, s| s }.reverse\n\n letters = Hash.new{ |h,k| h[k] = [] }\n ...
[ { "docid": "37ad5f0daea3473251ef9f26508d8b81", "score": "0.6778411", "text": "def word_ranking(str)\n \n # return empty string if it it empty \n if str.length == 0\n return str\n # else split str to an array of words\n else\n word_arr = str.split(\" \")\n end\n \n # ma...
34e021b7fffb22a0beb0bf26c4cab7fc
whether the piece is black
[ { "docid": "60241d240c36bb18a813a2892ddf9e79", "score": "0.7797597", "text": "def black?\n color == :Black\n end", "title": "" } ]
[ { "docid": "5e4b754cb71f6f88ba36b5cb00453aab", "score": "0.8271415", "text": "def black?\r\n BLACK == @colour\r\n end", "title": "" }, { "docid": "ef7e8302707283336ed8c762e9fe3e98", "score": "0.80549973", "text": "def piece_is_black?(piece)\n\tpiece === piece.downcase\nend", ...
09194b0388aed20f19669656ca3fd0b2
sync_closed_positions helpers rubocop:disable Metrics/AbcSize Metrics/AbcSize: Assignment Branch Condition size for create_or_cancel! is too high. [17.23/16]
[ { "docid": "8f3c1d2d67848042f9e12a7d6fc798e3", "score": "0.53050905", "text": "def create_or_cancel!(orders, transactions)\n order_id = latest_close.order_id.to_s\n order = orders.find { |o| o.id.to_s == order_id }\n\n # When order is nil it means the other exchange is done executing it s...
[ { "docid": "4cdee66df52280e4ee8c0a6a754fbc4f", "score": "0.725927", "text": "def sync_closed_positions(orders, transactions)\n # Maybe we couldn't create the bitstamp order when this flow was created, so we try again when syncing.\n latest_close.nil? ? create_initial_order_and_close_position! ...
c8368399a5f837f94ff12e40fb08276b
GET /comandas GET /comandas.json
[ { "docid": "11a5a7ee1c32639a3ce472cc1c97b61a", "score": "0.0", "text": "def index\n @comandas = Comanda.all\n @comanda = Comanda.new\n end", "title": "" } ]
[ { "docid": "956e542386985d92bb739119ea0d03e0", "score": "0.65144485", "text": "def index\n @commemts = Commemt.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @commemts }\n end\n end", "title": "" }, { "docid": "4079933a25e567073...
d170640c08c494b3532bcfeda39085ff
POST /nexttimeslots POST /nexttimeslots.json
[ { "docid": "bcdc57a11cf9a3aa75618086cf5c1324", "score": "0.69271386", "text": "def create\n #@nexttimeslot = Nexttimeslot.new(nexttimeslot_params)\n resp = Faraday.get \"https://www.honestbee.tw/api/api/next_available_timeslot?storeId=#{nexttimeslot_params['store_id']}\\\n &latitude=#{nexttimes...
[ { "docid": "dd07d926b53fc32ab5bd2fe93f398e74", "score": "0.6429535", "text": "def index\n @nexttimeslots = Nexttimeslot.all\n end", "title": "" }, { "docid": "0f0ebc5985aa1978ed2bee348e2745da", "score": "0.6149107", "text": "def nexttimeslot_params\n params.require(:nexttime...
8cfc222f02d7938c07a30f2e08fc1a50
PATCH/PUT /pollitems/1 PATCH/PUT /pollitems/1.json
[ { "docid": "8dfef45aa603420dd87e7b816f13f2bb", "score": "0.6889228", "text": "def update\n @poll = Poll.find(@pollitem.poll_id)\n respond_to do |format|\n if @pollitem.update(pollitem_params)\n format.html { redirect_to @pollitem, notice: 'Pollitem was successfully updated.' }\n ...
[ { "docid": "903ea6414b0289e62090727cc8aa3fdf", "score": "0.6911512", "text": "def update_single_poll(id,polls__question__,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n :polls__question__,\n :polls__description__,\n \n ]\n\n # verify...
2bd5e0d42354ac1015cda25a030c9120
(This method is generated in Translator_defaultbuildImpl)
[ { "docid": "92e24cbfc70331fd18f0fef95bf5866b", "score": "0.0", "text": "def get_region\n return @m_region\n end", "title": "" } ]
[ { "docid": "ff75a0cca84995bb03ba5f9692b7b225", "score": "0.6883647", "text": "def translation_target\n super\n end", "title": "" }, { "docid": "d79f297ba3bdcf1af117c5690350a637", "score": "0.6533848", "text": "def build; end", "title": "" }, { "docid": "335961c358...
3d6b4a26061706af589b5b8bdffa5727
For example, Given 1>1>2, return 1>2. Given 1>1>2>3>3, return 1>2>3. class ListNode attr_accessor :val, :next def initialize(val)
[ { "docid": "0110d04486a6a6d1293d63d3c333501c", "score": "0.0", "text": "def delete_duplicates(head)\n return head if head.nil? || head.next.nil?\n\n tail = head.next\n result = delete_duplicates(tail)\n\n if result.val == head.val\n result\n else\n head.next = result\n head\n end\nend", ...
[ { "docid": "cb23680dad530d8f9e39d8fc55ef253a", "score": "0.7501171", "text": "def initialize(val)\n @val = val\n @next = nil\n end", "title": "" }, { "docid": "426aae40a05ac1e807c7e3e50ed71a9d", "score": "0.74197495", "text": "def build_linked_list(vals)\n root = Node.new(val...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "4ce4a2678ab224b44a1b4cfccf2fd412", "score": "0.0", "text": "def adventure_option_result_params\n params.require(:adventure_option_result).permit(:reward, :adventure_option_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...
690249522abe13f56473d44657be57c0
Cannot have promoters with duplicate contact information
[ { "docid": "851df5a91cc8b023cdade7179e25bcde", "score": "0.52979654", "text": "def unique_info\n person = Person.find_by_info(name, email, home_phone)\n if person && person != self\n errors.add(\"existing person with name '#{name}'\")\n end\n end", "title": "" } ]
[ { "docid": "2885939117c4945a274a403348c7b8ad", "score": "0.6296076", "text": "def promoter\n Contact.find(promoter_id)\n end", "title": "" }, { "docid": "f4d3cbb62a6b385fb073ce68e97cc74a", "score": "0.59805244", "text": "def production\n Contact.find(promoter_id)\n end", ...
15b6319714fbdf6d7b077f9a4addc09c
manages date range if date is selected i.e checkbox is true then set start_date and end_date parameter if params contaion duration then 1 indicates 1week,2 for 1 month, 3 for 3 month,4 for 6 month and if it is range then set date start and end date
[ { "docid": "1aa92ba625d99efa0358ac200d289ac9", "score": "0.86954945", "text": "def manage_date_range\n @start_date,@end_date = @params[\"date_start\"], @params[\"date_end\"] if @params[\"date_selected\"] == \"true\" || @params[\"date_selected\"] == \"1\"\n if @params[\"report\"] && @params[\"repo...
[ { "docid": "efbe950db0abf59ec54399d0e71aa92b", "score": "0.7714831", "text": "def set_date_range\n if params[:start_year].nil? or params[:end_year].nil?\n @needs_date_picker = true\n day=Array.new(31){|d|d + 1 } \n\n @days = [\"\"].concat day\n\n @monthOptions = \"<option>\" \"\" ...
bd9c702a48927b84388ec8f416625b6e
CRUD Methods Visits CRUD
[ { "docid": "1103a26bef518dd0635d810915b7a408", "score": "0.0", "text": "def get_array_of_visits\n $user_traveller.my_visits\nend", "title": "" } ]
[ { "docid": "1f56c8eb3d5a92cb608bfbf818bc8719", "score": "0.74395937", "text": "def crud(env)\n model_name = path(2)\n id = path(3)\n\n model = @component.model_by_url(model_name)\n\n if model\n if request.post?\n case request.params['_method']\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "a280245a260cd1283eca6bfbdf96923b", "score": "0.0", "text": "def set_article\n @article = Article.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...
cfa6a171008e9c68078f5c38497d186b
Attributes to copy over to the neo4j database. Example: attributes_to_copy_to_neo4j :name, :email
[ { "docid": "5de9f96922a9a80808c7e93a20477b9d", "score": "0.6879978", "text": "def attributes_to_copy_to_neo4j(*keys)\n @attribute_keys_to_copy_to_neo4j = [] unless defined?(@attribute_keys_to_copy_to_neo4j)\n @attribute_keys_to_copy_to_neo4j += keys\n end", "title": "" } ]
[ { "docid": "98b77dbf335765e095ca8b61c4dbba27", "score": "0.7099481", "text": "def copied_attributes\n\t\tattrs = {}\n\t\tattrs[:year] = self.year\n\t\tattrs[:age] = self.age\n\t\tattrs[:amount] = self.amount\n\t\tattrs[:rate] = self.rate\n\n\t\tattrs\n\tend", "title": "" }, { "docid": "18489...
a38f8426d97b4946e5277a20b4667bed
Model > ComponentInstance > Group1 > Group2 > Group3 > Edge
[ { "docid": "d3fc442b2a71f4d3dda2b103efc0d06d", "score": "0.0", "text": "def create_test_instances\n model = Sketchup.active_model\n definition = model.definitions.add('TC_Sketchup_InputPoint')\n group1 = definition.entities.add_group\n group2 = group1.entities.add_group\n group2.transform...
[ { "docid": "67906f0bf5ea0360c45862bdbf14ade1", "score": "0.5899033", "text": "def test_parent_in_group\n erase_all()\n model = Sketchup.active_model\n entities = model.active_entities\n group = entities.add_group\n group = group.to_component\n group.definition.entities.add_line([0,0,0]...
51d9ef7f1e9fe18293a1ddb029c5f80b
GET /customer_contacts/new GET /customer_contacts/new.json
[ { "docid": "3b79529bcb52c8c9e6836b5cbb68bca4", "score": "0.7995357", "text": "def new\n @customer_contact = CustomerContact.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @customer_contact }\n end\n end", "title": "" } ]
[ { "docid": "41ce236d1b1ee1c6318832b69b370601", "score": "0.7835069", "text": "def new\n\t @contact = Contact.new\n\t \n\t respond_to do |format|\n\t format.html # new.html.erb\n\t format.json { render json: @contact }\n\t end\n\t end", "title": "" }, { "docid...
161a9600bd66d13a182081590469b087
Hash the public key by using RMD160 on SHA256 hashed public key
[ { "docid": "312e2cf19c349228365720b2700ac04e", "score": "0.8571823", "text": "def hash_public_key(public_key)\n pk_sha256 = sha256(public_key)\n rmd160(pk_sha256)\n end", "title": "" } ]
[ { "docid": "997416f81741afdf9136485fab2d56a9", "score": "0.8147402", "text": "def public_key_hash(hex)\n rmd160(sha256(hex))\nend", "title": "" }, { "docid": "cc472b80a4bab3736d6c7d6465c3bbee", "score": "0.75223374", "text": "def compute_public_key_hash(public_key)\n public...
335daa9bf0fd65fd3f5dab72bb6dd279
Sets account by name
[ { "docid": "2832a5a9f43b8508b8ac42f22d1e95ea", "score": "0.82462573", "text": "def account_name=(name)\n self.account = Account.find_or_create_by(name: name)\n end", "title": "" } ]
[ { "docid": "0818568adcad032dacdec67e8d0ecad2", "score": "0.8532826", "text": "def account_name=(name)\n self.account = Account.find_by_name!(name)\n end", "title": "" }, { "docid": "0818568adcad032dacdec67e8d0ecad2", "score": "0.8532826", "text": "def account_name=(name)\n ...
e659e374f9df85d7ab80e1d34d61869b
Returns the value of the `id` attribute.
[ { "docid": "84607347a1c54679a8961c8525fed15e", "score": "0.0", "text": "def id\n @id\n end", "title": "" } ]
[ { "docid": "d800b257bfdc34d27ff1f519d573830d", "score": "0.8528124", "text": "def id\n (a = attribute('id')).nil? ? a : a.value\n end", "title": "" }, { "docid": "fe58cf24252be77de724e98700a5aef0", "score": "0.82572293", "text": "def id # :nodoc:\n @attributes[ 'id' ]\n ...
156b06e96106ce941bb87f3d222150c0
Begins the process of destroying this box. This cannot be undone!
[ { "docid": "59f7c70ad95a35159ed175d48928ba85", "score": "0.7166564", "text": "def destroy\n @action_runner.run(:box_remove, { :box_name => @name, :box_directory => @directory })\n end", "title": "" } ]
[ { "docid": "d9c12437c7e5319cb4b696472d587ef0", "score": "0.64666617", "text": "def destroy\n # Remove comments to use Paranoia\n # if @force = params[:force]\n flash[:error] = \"Box was successfully destroyed.\"\n @box.destroy!\n # else\n # flash[:alert] = \"Box was successfully ...
59be26c595b6f713b59fd9e157efc2f3
GET /suburbs GET /suburbs.json
[ { "docid": "5bb7d6c8916bc1af5fec8d8d5e22c9a7", "score": "0.7767945", "text": "def index\n @suburbs = Suburb.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @suburbs }\n end\n end", "title": "" } ]
[ { "docid": "99d4f196cc48857ae3d2279321dc012e", "score": "0.68502223", "text": "def show\n @suburb = Suburb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @suburb }\n end\n end", "title": "" }, { "docid": "9d2bc5201e...
f11377eec70adba0aa5d535a57bb8ea9
rubocop: disable Metrics/AbcSize, Metrics/MethodLength, Metrics/LineLength
[ { "docid": "2d3a32311e7b546c1e206224923a7c51", "score": "0.0", "text": "def display_board(brd)\n clear_screen\n puts \"\"\n puts \" | | | |\"\n puts \" #{brd[1]} | #{brd[2]} | #{brd[3]} | #{brd[4]} | #{brd[5]}\"\n puts \" | | | |\"\n puts \"-----+-----+----...
[ { "docid": "33e1db3c06643dd523dcc31fccf3a005", "score": "0.63257575", "text": "def used; end", "title": "" }, { "docid": "33e1db3c06643dd523dcc31fccf3a005", "score": "0.63257575", "text": "def used; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "...
84619fbf4bd6b444816ee052cf9bb9cd
209 / 209 test cases passed. Status: Accepted Runtime: 36 ms
[ { "docid": "578f9fb388bdfcd1a33786053488bd3f", "score": "0.0", "text": "def traverse(node, track, result)\n track += \"#{node.val}->\"\n return (result << track) if !node.left && !node.right\n traverse(node.left, track, result) if node.left\n traverse(node.right, track, result) if node.right\nend", ...
[ { "docid": "6ac0f028dc11e1a857038fd8e748bba1", "score": "0.6429664", "text": "def test\n raise 'Failing test' if Global.fail\n\n Global.nbr_runs += 1\n end", "title": "" }, { "docid": "8070cf01e82acc4e4d86843e06ba340a", "score": "0.64221525", "text": "def run_test\...
ae6d7a0f983df1b73bceaa4a4f6679fd
Print occurred error details only if environment variable PUMA_DEBUG is defined. +options+ hash with additional options: +error+ is an exception object +req+ the http request +text+ (default nil) custom string to print in title and before all remaining info.
[ { "docid": "98bcf3f3e0e7533587d8aa8c8eff5174", "score": "0.70865995", "text": "def debug(options={})\n return unless @debug\n\n error = options[:error]\n req = options[:req]\n\n string_block = []\n string_block << title(options)\n string_block << request_dump(req) if reques...
[ { "docid": "33c6686eea5a719d23c393288cb3c208", "score": "0.69529784", "text": "def debug_error(error, req=nil, text=\"\")\n @error_logger.debug(error: error, req: req, text: text)\n end", "title": "" }, { "docid": "520eb1c24e7ec2f9698242c53484fe3f", "score": "0.6262927", "tex...
1e0e8a7474657649b08a96ba8815f0dc
DELETE /orders/1 DELETE /orders/1.json
[ { "docid": "ed55b2467fddc38ef51b10e531802f5d", "score": "0.0", "text": "def destroy\n @order.destroy\n respond_to do |format|\n format.html { redirect_to orders_url, notice: 'Order status was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" ...
[ { "docid": "d95245ee8d8e63ffab2dfbac802158ee", "score": "0.808749", "text": "def destroy\n delete(\"/orders/#{id}/delete\")\n end", "title": "" }, { "docid": "8e531349d930fb6fede4efc401d68904", "score": "0.7670167", "text": "def destroy\n @order.destroy\n\n render json:...
bfd853ee38a8e986980f3ee459297f7f
The activity of the package in reverse chronological order. Each element represents a stop on the package's journey. Returns an array of OmniShip::USPS::Track::Activity objects.
[ { "docid": "e0cf544955b10c006617a7c13e090818", "score": "0.5348919", "text": "def activity\n @root.xpath('TrackSummary').map do |act|\n Activity.new(act)\n end +\n @root.xpath('TrackDetail').map do |act|\n Activity.new(act)\n end\n end", ...
[ { "docid": "329a8d412abe41b39ea65877646040c4", "score": "0.62618154", "text": "def activities\n @grouped_activities.flatten\n end", "title": "" }, { "docid": "f1c20a8caebbbd9f5ae29c46c3b39d36", "score": "0.59193134", "text": "def activities\n re...
ad13ac8476efad84e38b5ea112c957ed
pass in list of one or more records each record is an array [ :chron, optional dimensions, :measure ] series.add([1990, 27]) series.add([1990, 27], [1991, 104]) series.add([1990, 27])
[ { "docid": "25093fc839e850243c78755459d5463f", "score": "0.5926512", "text": "def add(*rows)\n rows.each do |row|\n entry = {}\n keys = []\n if @chron then\n entry[:chron] = case row.first\n when Chron::Base\n raise \"Chron mismatch: #{row.first.cla...
[ { "docid": "6c7bb4e747141e5717df8924461e3a86", "score": "0.6387268", "text": "def get_series_from_record(record)\n all_series = []\n f8xx = record.fields('800'..'830')\n f490 = record.fields('490')\n f4xx = record.fields('400'..'440')\n return all_series if (f8xx + f490 + f4xx).empty?\n f8xx.each ...
cb1b90b0986f8ed7560ba12297b8305d
Just a lil method for printing...
[ { "docid": "60d2c6500852dc8b30d73a0c7fabcd0d", "score": "0.0", "text": "def print_all_players(print_title, players)\r\n puts\r\n puts(print_title)\r\n players.each do |player|\r\n puts(\"\\t >> #{player}\")\r\n end\r\n puts\r\nend", "title": "" } ]
[ { "docid": "5fbecc66de2d4794dde1d149dec88773", "score": "0.75336426", "text": "def print\n end", "title": "" }, { "docid": "eccfd3f95d9a0c2fa9bb9e96ff43d257", "score": "0.7504735", "text": "def print\n\n end", "title": "" }, { "docid": "3a4747227466f18dfdf3b3dbe28ba0b...
af43ba3211e882dd09652646f6824102
This is a template method that is used to escape results values (returned in execute) that would cause the XML to be invalid. This method is not necessary if values do not contain character that have special meaning in XML (&, ", ), however it is a good practice to use it for all return variable results in case the val...
[ { "docid": "9924368ca2def54b5d463405898949da", "score": "0.0", "text": "def escape(string)\n # Globally replace characters based on the ESCAPE_CHARACTERS constant\n string.to_s.gsub(/[&\"><]/) { |special| ESCAPE_CHARACTERS[special] } if string\n end", "title": "" } ]
[ { "docid": "5129c8eaa1eb4a75f87661f1db7dcef6", "score": "0.67917436", "text": "def escape_xml(value)\n value.to_s.gsub(/[&<>\"']/) { |s| ESCAPE_TABLE[s] } # or /[&<>\"']/\n end", "title": "" }, { "docid": "9da2e524f14ab478024b0bdcdd73b9cf", "score": "0.67336917", "text"...
0a2388f6601f45f24e076e0102890ca8
Braindead nearestneighbors implementation. Slow as hell. Percy Liang
[ { "docid": "d5530c48206643203b45eb6d981aa932", "score": "0.0", "text": "def readExamples(path)\n IO.readlines(path).map { |line|\n next if line =~ /^#/\n y, *xl = line.split(/ /)\n xh = {}\n xl.each { |s| s =~ /^(\\d+):(.+)$/ && xh[$1.to_i] = $2.to_f }\n [y, xh]\n }\nend", "title": ...
[ { "docid": "bb3531cae4639f802e469495488e7d8b", "score": "0.66178405", "text": "def get_neighbors(i, j, x, y, grid)\n return 0\n end", "title": "" }, { "docid": "7c2adeb414050f1dfb2703a4a48fd82b", "score": "0.66088516", "text": "def nearest_neighbours(to_classify)\n find_closes...
0785fd9b10b51569fc6983202bff4f1c
belongs_to :prefecture has_one :payment has_one :creditcard has_one :evaluation
[ { "docid": "3db1a23b91dae75708b150892b387810", "score": "0.0", "text": "def name\n last_name + ' ' + first_name\n end", "title": "" } ]
[ { "docid": "19a64115e72f7bf8f5137d0436494159", "score": "0.59551597", "text": "def prefecture\n Prefecture.find(self.prefecture_id)\n end", "title": "" }, { "docid": "01743795c024cdb8a711f3129ea8b4e6", "score": "0.5882578", "text": "def set_evaluation_credit\n @evaluatio...
e6e37f2cb281b25ef82e5a6f12e5f809
recalculate distance (after cutting coords)
[ { "docid": "674401709da28c98e52cb62b10b944f7", "score": "0.59335035", "text": "def recalculate_distance(coords)\n\tnew_coords = []\n\t# Find first distance\n\tfirst_distance = coords[0][2].to_f\n\tcoords.each{|x|\n\t\tnew_distance = x[2].to_f - first_distance\n\t\tnew_coords << [x[0],x[1],new_distance,x...
[ { "docid": "ea4c92c552bebc624326e01b38b5647d", "score": "0.64768994", "text": "def adjust_distances_if_needed\n self.distance_from_town_centre_m = closest_distance(distance_from_town_centre_m)\n end", "title": "" }, { "docid": "e04f3abb5ae2ac5293dfa0a0429df810", "score": "0.6303268",...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "d1e63158e93578f37011b7e85cfae7dd", "score": "0.0", "text": "def batch_params\n params.require(:batch).permit(:marker, :item_id, :item_type)\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": "a97e0be2935f1e59dba7f56c1e10a5d0", "score": "0.0", "text": "def booking_params\n params[\"booking\"][\"room_type\"] = params[\"booking\"][\"room_type\"].to_i if params[\"booking\"][\"room_type\"].present?\n params.require(:booking).permit(:room_type, :room_id, :start_date, :last_da...
[ { "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...
14b3608bb006d4e9c3a664c986d00f21
Change the worldmap image to the given one
[ { "docid": "b7f3a3ab0f938903142919a4a4f2a5aa", "score": "0.7844173", "text": "def set_worldmap_image(id, new_image)\n worldmap_filename = GameData::WorldMap.worldmap_image_filename(new_image)\n if RPG::Cache.interface_exist?(worldmap_filename)\n GameData::WorldMap.get(id).image = new_im...
[ { "docid": "4ae07bbbe28bd3ff37d25cade055a81e", "score": "0.69368297", "text": "def worldmap_image_filename(filename)\n return filename if filename.start_with?('worldmap/worldmaps/')\n return \"worldmap/worldmaps/#{filename}\"\n end", "title": "" }, { "docid": "ad75635aef45...
d80bd8eed122a2a0e124a821763c494a
Main entry for the authority. Performs the lookup and returns a list of found terms.
[ { "docid": "fb77b041ff010645ea645b34ed4cd790", "score": "0.0", "text": "def search(q)\n q=build_q(q)\n if q.empty?\n # don't perform empty queries\n return []\n end\n _, list = search_results({q: q }, [\n :default_solr_parameters,\n :add_query_to_solr])\n translate...
[ { "docid": "aacde9f0ec21939a4e2a2040c27dfa09", "score": "0.64161336", "text": "def show\n begin\n term = @authority.find(id, subauth: subauthority, language: language, replacements: replacement_params)\n rescue Qa::TermNotFound\n logger.warn \"Term Not Found - Fetch term #{id} unsuccessf...
ab5a8c4555b25e621b149811a125fe64
The order of tags in dropdown lists.
[ { "docid": "8b9cb57a6a56b54992bd31ad19aac7a6", "score": "0.0", "text": "def canonical_mapping\n {\n \"Artist\" => 1,\n \"Copyright\" => 3,\n \"Character\" => 4,\n \"General\" => 0,\n \"Meta\" => 5,\n }\n end", "title": "" } ]
[ { "docid": "329fad54ab449976976238629208a588", "score": "0.67561007", "text": "def sorted_tags\n tags.order(:name)\n end", "title": "" }, { "docid": "e82bd060af07c3d26e5fcd8671f1e674", "score": "0.6443381", "text": "def sorted_tags\n tags.order('id ASC')\n end", "title": ...
7d6f4acecf6e90d68f71731c6f05d55c
PATCH/PUT /sponsors/1 PATCH/PUT /sponsors/1.json
[ { "docid": "b0dac40d79147329e16cf8ca30c26d5d", "score": "0.0", "text": "def update\n respond_to do |format|\n if @standard.update(standard_params)\n format.html { redirect_to admin_standards_path, notice: 'El estandar de raza fue Modificado' }\n format.json { render :show, status: ...
[ { "docid": "e7fb302efb0887b38811b0d1b3442554", "score": "0.71287376", "text": "def update\n respond_to do |format|\n if @api_v1_sponsor.update(api_v1_sponsor_params)\n format.html { redirect_to @api_v1_sponsor, notice: 'Sponsor was successfully updated.' }\n format.json { render :s...
9691765f598d2181b5ee050abad20c18
This method saves the category_id for a product before saving it to database
[ { "docid": "f5b80594a16ef691cd53d02f28ee2919", "score": "0.7267646", "text": "def set_product_category\n self.product_category_id = self.product_bundle.product_category_id\n end", "title": "" } ]
[ { "docid": "01623362688d880121dddbb9f8470d42", "score": "0.7129075", "text": "def save_categories\n\t\t\t@categories.each do |category_id|\n\t\t\t\tCategoriesProduct.create(categories_id: category_id, products_id: self.id)\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "0567bda5f0e3d0bb03cd...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "e5c8d2e25d2b9ad7163a296271ec5944", "score": "0.0", "text": "def update!(**args)\n @double_values = args[:double_values] if args.key?(:double_values)\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...
59c7cf62091e861409a0e2471e0c1bb0
Initiates a transaction and handles the commit or rollback of it. if an exception is raised the transaction will be committed. It accepts a block that will receive a transaction ID as argument. db_name transaction block
[ { "docid": "5bac0e4a11cc39980a3a8cc46a7aa1ea", "score": "0.72884434", "text": "def with_transaction(db_name)\n begin\n txID = self.begin(db_name)\n yield txID\n result = commit(db_name,txID)\n raise ICVException.new(\"ICV constraing violated\") if(!result.success? && res...
[ { "docid": "b74a910af18131c42a32694005849262", "score": "0.77454954", "text": "def transaction(&block)\n @db.query('START TRANSACTION;')\n begin\n yield\n @db.query('COMMIT;')\n rescue Exception => e\n @db.query('ROLLBACK;')\n raise e\n end\n end", ...
89bda64f816e8fb1e7fa9274154fa300
User assigned name for this resource. Must be unique within the project. The name must be 132 characters long, must begin with a letter, end with a letter or digit, and only contain lowercase letters, digits or dashes.
[ { "docid": "f870bf5967dc2b66ba74785be1798bae", "score": "0.0", "text": "def name\n @gapi.name\n end", "title": "" } ]
[ { "docid": "dfee9527f10169169b7d82b17d0d7b0f", "score": "0.713885", "text": "def unique_name\n \"#{project.name} / #{name}\"\n end", "title": "" }, { "docid": "c1152689f305cfe5bcac1552638bcd71", "score": "0.6945637", "text": "def user_name(name = nil)\n return user_name_from...
709e5a1c3ef70d8384d7d99c86b071d6
Returns the number of records in this table db
[ { "docid": "c1a51e28c5214058c3ddbeb1b7191a6e", "score": "0.7809494", "text": "def size\n\n @db.rnum\n end", "title": "" } ]
[ { "docid": "49e4671dfb0a19e50833e4639d12662c", "score": "0.87418705", "text": "def count\n Ecore::db[table_name].count\n end", "title": "" }, { "docid": "607421dc51f412d9eced470246e77b46", "score": "0.8570211", "text": "def count\n self.db.get_first_value(\"select co...
9f3d2b0d7af57c2924f4a92489b8c672
GET /pcr_inspections GET /pcr_inspections.json
[ { "docid": "37b975c00b45571c0966ab5805913f14", "score": "0.76820225", "text": "def index\n @pcr_inspections = PcrInspection.all\n end", "title": "" } ]
[ { "docid": "4cb16f647637fca781608acce21624e9", "score": "0.66860104", "text": "def set_pcr_inspection\n @pcr_inspection = PcrInspection.find(params[:id])\n end", "title": "" }, { "docid": "21ea584e9a88e1570f87cdae4535c8fe", "score": "0.65141404", "text": "def create\n @pcr...
3116e3bc923973f20bce4703cf957302
returns true if an user is allowed to edit
[ { "docid": "73f5aa13e8473f5ddfef349e1294aa8a", "score": "0.7631594", "text": "def can_edit?(item)\r\n item.editable_by?(self)\r\n end", "title": "" } ]
[ { "docid": "5d645d351134cdca0e81f8d7c83c49d5", "score": "0.89824325", "text": "def can_edit?(user)\n user == current_user\n end", "title": "" }, { "docid": "f96fcabe9a10e9b1750b2693381fd1c4", "score": "0.89695275", "text": "def can_edit?(user)\n (self.user == user) || !!(user ...
775a137291c267e4e68b82c9d609b7c7
Sets condition for scoring a normal roll.
[ { "docid": "8ec0d11876a3b9132d87c220705be228", "score": "0.58814865", "text": "def score_normal\n @total_score += @roll + @next_roll\n @current_roll +=2\n end", "title": "" } ]
[ { "docid": "8edba02efa4a18be89912515f78c3c1c", "score": "0.59485376", "text": "def score_normal\n @total_score += @roll + @next_roll\n @current_roll += 2\n end", "title": "" }, { "docid": "3a42ef375aa7ac16ba4b8356d2f3d78b", "score": "0.5691406", "text": "def setRolled(rolled)\...
fbbb6fc55a6de39ed6305dd223c43ded
Setter for schema_file(). Use this to override location of local schema file.
[ { "docid": "20bcd569b7e2421ad02fec4b52b772d4", "score": "0.85450125", "text": "def schema_file=(file)\n @schema_file = file\n end", "title": "" } ]
[ { "docid": "0fce8b52d93b4572330399d66fffd0c1", "score": "0.7799014", "text": "def schema_file\n @schema_file || SCHEMA_FILE\n end", "title": "" }, { "docid": "8e97f049d3e522a2c848acd2b4b62426", "score": "0.75481373", "text": "def schema_file\n @schema_file ||= fi...
620931acfd1a89a00e1482378541e55f
Outputs nonarray value in the form of hash For object, use to_hash. Otherwise, just return the value
[ { "docid": "f0ff79d474b4d3d5b9687d897ed56ca8", "score": "0.0", "text": "def _to_hash(value)\n if value.is_a?(Array)\n value.compact.map{ |v| _to_hash(v) }\n elsif value.is_a?(Hash)\n {}.tap do |hash|\n value.each { |k, v| hash[k] = _to_hash(v) }\n end\n elsif...
[ { "docid": "a34f3dad821ba9744bc8d807b65489ad", "score": "0.6719518", "text": "def hash\n [value].hash\n end", "title": "" }, { "docid": "a34f3dad821ba9744bc8d807b65489ad", "score": "0.6719518", "text": "def hash\n [value].hash\n end", "title": "" }, { "doc...
07a83684066cd920541d4897d9b12ddc
Create new Array containing the id's of the tracks of a clicked playlist
[ { "docid": "8e98b6b68b85348b5d54e54d5eb606a4", "score": "0.65509844", "text": "def playlist_track_uris\n @playlist_return = playlist\n @playlist = JSON.parse(@playlist_return.data[:body])\n @playlist_track_uris = @playlist[\"tracks\"][\"items\"].map { |track| track[\"track\"][\"uri\"] }\n end"...
[ { "docid": "e659c60421d877230f70da21b77c96cf", "score": "0.7291478", "text": "def tracks #returns array of tracks in the playlist\n PlaylistTrack.all.map do |playTrack|\n if playTrack.playlist_id == self.id\n song = RSpotify::Track.find(playTrack.track_id).id\n ...
81a389fd6d81a4eb0a03b720238b2f9a
Submit a batch download request for recordings. Recordings in response will be in their original format/codec configured in the Trunk configuration.
[ { "docid": "dcd771c882994412901031c31e0e2773", "score": "0.5604111", "text": "def post_recording_batchrequests_with_http_info(body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: RecordingApi.post_recording_batchrequests ...\"\n end\n ...
[ { "docid": "6433f0540c35dccfcf839d2e1aa8a691", "score": "0.59474653", "text": "def fetch\n @recordings.map do |uri, path|\n STDERR.puts(\"# Fetching #{uri} to #{path}\")\n fetch = Mixlib::ShellOut.new(\n \"curl --continue-at - --output #{path} #{uri}\",\n live_stream...
e097e20575e9bd85722567114bc2072d
Different time formats were causing problems, this method standardizes them
[ { "docid": "7944fb84a96503ac581481bbbd678b82", "score": "0.0", "text": "def parse_time(time)\n if time.is_a? Time\n return Time.parse time.httpdate\n elsif time.is_a String\n return Time.parse(Time.parse(time).httpdate)\n else\n raise \"Argument Error, #{time} is not a valid time...
[ { "docid": "c37311dd114547719428505c9158837f", "score": "0.74388885", "text": "def update_time_formats!\n Time::DATE_FORMATS.update(\n :db => '%Y-%m-%d %H:%M:%S',\n :ui => '%d.%m.%Y %H:%M',\n :yaml => '%Y-%m-%d %H:%M:%S %:z', # For DateTimes\n :default => la...
442962ec2da8de42cc33946c188ce024
Get the underlying AWS::S3 instance, creating it using environment vars if necessary.
[ { "docid": "9b76b35142b5a088f1eaef26efab67f4", "score": "0.8057281", "text": "def s3\n @s3 ||= AWS::S3.new(\n :access_key_id => Config.env('AWS_ACCESS_KEY_ID'),\n :secret_access_key => Config.env('AWS_SECRET_ACCESS_KEY'),\n :use_ssl => true\n )\n end", "title": "" } ]
[ { "docid": "69492aa88fd880e31f46732024886b36", "score": "0.81568927", "text": "def s3\n @s3 ||= Aws::S3::Client.new(\n credentials: Aws::Credentials.new(Config.env('AWS_ACCESS_KEY_ID'),\n Config.env('AWS_SECRET_ACCESS_KEY')),\n region: Config.env('AWS_...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "b801070fc6fd1ce19b99beef1bff9255", "score": "0.0", "text": "def picks_ban_params\n params.require(:picks_ban).permit(:is_pick, :hero_id, :team, :order)\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...
fb9fb9c23d6dd55234068e955d8c5c5e
Add the link after us
[ { "docid": "d449e56eeae1c62865344dd35e30e012", "score": "0.0", "text": "def insert_right(link)\n unless link.is_detached?\n raise \"trying to insert a link that's not detached!\"\n end\n\n link.prev = self\n link.next = self.next\n self.next.prev = link if self.next\n self.next = ...
[ { "docid": "5b0f58cbf257953cda4b498ecacd855b", "score": "0.6512285", "text": "def append_url(url)\n click_link \"Add New\"\n\n fill_in \"shortener[main_domain]\", with: Faker::Internet.url(url)\n click_button \"Create Shortener\"\n end", "title": "" }, { "docid": "25a5cd2b4...
dab3d184c1f9a4ffa99af2d8b95da604
We use this to set the outgoing message type/exchange name Need this so that on the net side MT will map to our class I could not see an easy way to get the same on Ruby to be usable in .net
[ { "docid": "3c83ff066d1367bd91986a2b80bf3c7f", "score": "0.5754241", "text": "def messageType\n return \"myNamespace:PingResponse\" \n end", "title": "" } ]
[ { "docid": "12efb41fb0dd01972296cab70fa2c22c", "score": "0.62022346", "text": "def type; return :\"incoming_#{@type.to_s}\"; end", "title": "" }, { "docid": "4a90d18a1e145b64b8653da586072dd1", "score": "0.6068855", "text": "def type\n \"Sender\"\n end", "title": "" }, ...
90407c5cfb5d2aba1647e89c73d8b32b
PUT /caixas/1 PUT /caixas/1.json
[ { "docid": "b4060e7b669efb41617787caa900ddbc", "score": "0.6400815", "text": "def update\n @caixa = Caixa.find(params[:id])\n\n respond_to do |format|\n if @caixa.update_attributes(params[:caixa])\n format.html { redirect_to @caixa, notice: 'Caixa was successfully updated.' }\n ...
[ { "docid": "0bb5d49f5d39f2acdfca1e599f9dd80f", "score": "0.6400262", "text": "def update\n @csaa = Csaa.find(params[:id])\n\n respond_to do |format|\n if @csaa.update_attributes(params[:csaa])\n format.html { redirect_to @csaa, notice: 'Csaa was successfully updated.' }\n format...
214f248d42ee778d39e258eb0c5f6623
Build the underlying storage pool.
[ { "docid": "d0d30e50a29e784f5c4c2dcbff427015", "score": "0.65522885", "text": "def build\n FFI::Libvirt.virStoragePoolBuild(self, 0) == 0\n end", "title": "" } ]
[ { "docid": "4bd328b5b3d99e46d1b79f1b63172064", "score": "0.62264097", "text": "def pool\n @@pool ||= Jsus::Pool.new(settings[:packages_dir])\n end", "title": "" }, { "docid": "320429ac69e7dfeca6f9d4617a191034", "score": "0.62102395", "text": "def create_storages\n @s...
c4ade968f64f4a9d2abb49b6cbceb9d1
So to pass in a block to eachEven, all we had to do was stick the block after the method. You can pass a block into any method this way, though many methods will just ignore the block. In order to make your method not ignore the block, but grab it and turn it into a proc, put the name of the proc at the end of your met...
[ { "docid": "a9f79d3bbe2486ab12da78901e4240eb", "score": "0.5576143", "text": "def profile blockDescription, &block\n startTime = Time.now\n\n block.call\n \n duration = Time.now - startTime\n\n puts blockDescription + ': '+duration.to_s+' seconds'\n\nend", "title": "" } ]
[ { "docid": "cd013abe98f2ce8f3f1b4300c604d015", "score": "0.66789174", "text": "def timed_run(&block)\n time = Benchmark.measure do\n block.call\n end\n puts time\nend", "title": "" }, { "docid": "011a4c9ff081c3530c295614b695b525", "score": "0.64797574", "text": "def bench(&bloc...
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": "2f2d38eed6053bc8df9ec31ea4110b6a", "score": "0.0", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ListCommentsForRepoResultSet.new(resp)\n return results\n end", "title": "" } ]
[ { "docid": "c4ca32683e8ce75eb6a187d63df8fa77", "score": "0.7665963", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = DoneResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "6f7a7d9be674ad4cf17d6743eb1f7836", "score...
e7c5f5babaf8b3ecbd9da35b12d261fe
DELETE /price_medias/1 DELETE /price_medias/1.xml
[ { "docid": "71fbd61e46a2d5573e3c75886de34087", "score": "0.73864335", "text": "def destroy\n @price_media = PriceMedia.find(params[:id])\n @price_media.destroy\n\n respond_to do |format|\n format.html { redirect_to(@price_media.price_usage) }\n format.xml { head :ok }\n end\n end...
[ { "docid": "e374db3c5aa8f4b7dbbf7e2704806f43", "score": "0.7099223", "text": "def destroy\n @moto_price = MotoPrice.find(params[:id])\n @moto_price.destroy\n\n respond_to do |format|\n format.html { redirect_to(moto_prices_url) }\n format.xml { head :ok }\n end\n end", "title...
3e668d8ac523fcf2104b3e22858edf82
To delete the order
[ { "docid": "bbd3c663832c55694c29e4f4c1828510", "score": "0.0", "text": "def destroy\n @object=Spree::Order.find_by_id(params[:id])\n if !@object.nil?\n @object.destroy\n if @object.destroy\n error=error_response_method($e4)\n render:json=>error \n end\n else\n ...
[ { "docid": "6a0c5febc2e186db6b67007093ec38e8", "score": "0.81320155", "text": "def delete_order\n @data.order_id = ''\n @data.handler = :handle_delete\n @data.label = 'deleted'\n get_order\n end", "title": "" }, { "docid": "32eafad03179d69d2372a5222d112608", "score": "0.74...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "79967739488410bf3813b5fc0485850d", "score": "0.0", "text": "def block_params\n params.require(:block).permit(:inform_id, :user_id, :block_tag, :stored, :description, :slide_tag, :verified, :fragment)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7496205", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6957069", "text": "def strong_params\n params.require(:request).permit(param_white...
315e6e9aeb1b8abd81151cc43af68859
Build a hash map from broker id to number of partitions on it to facilitate finding the broker with lowest number of partitions to help balance brokers.
[ { "docid": "4ba51f98f5598616f3b40c01faf06348", "score": "0.7593254", "text": "def build_partitions_by_broker(topic, destination_brokers)\n partitions_by_broker = Hash.new(0)\n destination_brokers.each { |id| partitions_by_broker[id] = 0 }\n topic.partitions.each do |p|\n p....
[ { "docid": "4b541814855363667478b05a40fe54e2", "score": "0.64666945", "text": "def partition_ids\n consul_kv_data[partitions_key].value\n end", "title": "" }, { "docid": "fa79356082510ccc17f954698e19ce2c", "score": "0.626496", "text": "def get_part_hash(part_ids)\n part_ha...
736c6feef1b97b8496336a75a3f3651a
delete one or many documents by query solr.delete_by_query 'available:0' solr.delete_by_query ['quantity:0', 'manu:"FQ"']
[ { "docid": "4d89c93d0069a5f77139f21b961f2621", "score": "0.60300165", "text": "def delete_by_query(query)\n update message.delete_by_query(query)\n end", "title": "" } ]
[ { "docid": "f20bc83e230f5e1dd8956695891b6e42", "score": "0.7453041", "text": "def delete_by_query(query)\n response = send(Solr::Request::Delete.new(:query => query))\n commit if @autocommit\n response.ok?\n end", "title": "" }, { "docid": "387851e5fcfa7bd132ecb78d15c24d77", "s...
343b9c9baac96db45224697fc52b1bf8
Set the struct value
[ { "docid": "8453eeb11d6fb0b091ae1a6f46200ce0", "score": "0.0", "text": "def set(fbe_value)\n @_buffer.shift(fbe_offset)\n fbe_size = set_fields(fbe_value)\n @_buffer.unshift(fbe_offset)\n fbe_size\n end", "title": "" } ]
[ { "docid": "31cc6245260db3d07b0e5a6fa60f0536", "score": "0.74234724", "text": "def set(value); end", "title": "" }, { "docid": "b3d6919e1780a986d94f1aafbf3924bb", "score": "0.7197974", "text": "def set(new_value); end", "title": "" }, { "docid": "b3d6919e1780a986d94f1aafb...
b6f7a80afd0bd86379578819d430f809
used just for printing workspace node info
[ { "docid": "46e42cfe33c61bd64783d4758c6abccd", "score": "0.72016406", "text": "def render_workspace_node_info(type)\n info_list = \"\"\n if type.eql?(\"component\")\n info_list = [\"component_name\",\"component_id\",\"basic_type\",\"description\"]\n else\n info_lis...
[ { "docid": "e438b66a44ae2f1994283e8af13ae369", "score": "0.733693", "text": "def print_node\n puts \"-----------------------------------------------------\\n\"\n puts \"Node:#{@id} Host:#{@hostname} Port:#{@port} Typ:#{@node_type} \"\n puts \"----------------------------------------------------...
4f2eeaf71165e05cb50851b18862a1d0
Allow us to use authorize before_action at controller
[ { "docid": "e2c62ecbc3498ae481e9450d2a207da4", "score": "0.0", "text": "def authorize\n redirect_to root_path unless current_recruiter\n end", "title": "" } ]
[ { "docid": "7caa9471ba32307b58082bb8758438b5", "score": "0.7828796", "text": "def authorize_access\r\n # authorize!(action_name.to_sym, \"#{controller_name}_controller\".camelcase.constantize)\r\n end", "title": "" }, { "docid": "c88364f80c71e1fee801b48b4dfe42a0", "score": "0.7821073...
038854c46360df4a5860dc627000b0b5
Funcion para calcular la cadera de un individuo
[ { "docid": "f7e73e85c03d1c9f04db58d23b958ffb", "score": "0.70479834", "text": "def cadera\n\t\t(@cadera[0] + @cadera[1])/2\n\tend", "title": "" } ]
[ { "docid": "06bb651c7fa2c288890d95be3239a62a", "score": "0.7201646", "text": "def relacion_cc\n\t\t(ccintura / ccadera).round(2)\n\tend", "title": "" }, { "docid": "844f710cddf64cb924b9e5de6352d889", "score": "0.70900863", "text": "def calcular()\n lista_nombres=@individuos[0].get...
b8e69408fccb983dbae9e8dd56b769a5
Set the value of the ClientSearch input for this Choreo.
[ { "docid": "188acb022e0b5e3d830f18bef9b79ddf", "score": "0.7653798", "text": "def set_ClientSearch(value)\n set_input(\"ClientSearch\", value)\n end", "title": "" } ]
[ { "docid": "98e2c83f554f431c6238cde4d19cee86", "score": "0.66288686", "text": "def client_search(arg = nil)\n set_or_return_search_array(:client_search, arg)\n end", "title": "" }, { "docid": "aab18172a55da029b9a8738292e2d8f7", "score": "0.6171093", "text": "def search=(v...
5a58bd0ed01ba8ec59d8e2d82400e18f
Read status of transport nodes in a transport zone Read status of transport nodes in a transport zone
[ { "docid": "f4326547b17388571d235f0239bec032", "score": "0.6109663", "text": "def list_transport_node_status_for_transport_zone_with_http_info(zone_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiNetworkTransportTransportNode...
[ { "docid": "98b4df49ca5d1bc2381471315e784c75", "score": "0.6520997", "text": "def get_all_transport_zone_status_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiNetworkTransportTransportNodesApi.get_all_transport_zo...
ecd5dc8a3b9d9bc05c3a51c62c7977fc
Returns the next (or count'th) working day
[ { "docid": "0b5800f06d23715c1343282250cbdb26", "score": "0.7932579", "text": "def next_working_day(count = 1)\n return self if count == 0\n negative = count < 0\n count = count.abs\n date = negative ? yesterday : tomorrow\n \n loop do\n count -= 1 if date.working_day...
[ { "docid": "fb2087472c99c9b38a78b9b71f2e4c62", "score": "0.84505314", "text": "def next_working_day\r\n wd = self + 1\r\n return wd.is_free? ? wd.next_working_day : wd\r\n end", "title": "" }, { "docid": "09d1a78b51e8d9eeb0ea989ae28ce2cd", "score": "0.8420585", "text": "def ne...
b264def90cccd8310cb0e0be7b899d09
Niet duidelijk wat dit is.
[ { "docid": "c5922b4b24e5e9dff9543af0ad61dbcb", "score": "0.0", "text": "def authorization_id\n data[:authorisationId]\n end", "title": "" } ]
[ { "docid": "dc64ee59d540d3e6e6588bf3b2e75e43", "score": "0.65832967", "text": "def zeichnen()\n if sichtbar?() \n Leinwand.gib_einzige_instanz().zeichne_kreis(self)\n end\n end", "title": "" }, { "docid": "4fe655da88e61d28e8b9a9ed964af838", "score": "0.64650005", "text": ...
88b009ccd2609501a87afe3a32cc7fb0
Returns an array of MacroReflection objects for all validations in the class
[ { "docid": "0cdfe6e3363724e8222aabb8b86f9e7a", "score": "0.63995564", "text": "def reflect_on_all_validations\n self.read_inheritable_attribute(:validations) || []\n end", "title": "" } ]
[ { "docid": "713cd70c8ce0be6add69c3f463883564", "score": "0.69366443", "text": "def reflect_on_all_validations\n self.read_inheritable_attribute(:reflected_validations) || []\n end", "title": "" }, { "docid": "d2ded0cd53dde9e07ac5bf1491f23767", "score": "0.6307034", "text": "d...
8d0fee39ba844666671684bead58a7f8
======================================================== ==== LAYOUT ========================================================
[ { "docid": "6f5e105f67a39866593c6f30347e9a6e", "score": "0.0", "text": "def dynamic_fixed_header(target_table)\n attributes_string = html_tag_attribute(DYNAMIC_FIXED_HEADER, target_table)\n html = '<table ' + attributes_string + '>' + n\n html += '<thead>' + n\n\n html += '</thead>' + n\n\n ...
[ { "docid": "31e3c591a9d3a1aafdd145b4428711be", "score": "0.7938098", "text": "def layout()\n end", "title": "" }, { "docid": "74a63bfd550d41654fb51e2c0543037c", "score": "0.79222625", "text": "def _layout; end", "title": "" }, { "docid": "44026aac6459176b658a46a26482e8...
ecb96c0d8a3115da20c9f2024c4804aa
called (once) when the user logs in, insert any code your application needs to hand off from guest_user to current_user.
[ { "docid": "1ebbbc4a93c347f23bff28ec2daf0702", "score": "0.6961291", "text": "def logging_in\n # For example:\n # guest_comments = guest_user.comments.all\n # guest_comments.each do |comment|\n # comment.user_id = current_user.id\n # comment.save!\n # end\n end", "title": "" ...
[ { "docid": "85f9b8ef7b00b362315a712a80c23bc9", "score": "0.76544017", "text": "def logging_in\n logger.debug \"ApplicationController:logging_in >>> \"\n current_user.transfer_data(guest_user)\n end", "title": "" }, { "docid": "aaf7d1bd504ecebaca7a91ddcc18dcc1", "score": "0.756165"...
842bf603ec1e7fc8985668d6e1ab9e3c
total spent on items
[ { "docid": "b1e3d6b6c8583df80fbeab6f43aadcdc", "score": "0.8154914", "text": "def total_spent\n self.orders.sum{|order| order.item.price}\n end", "title": "" } ]
[ { "docid": "e1a2b86fd79a6a712935474f65e5fdb9", "score": "0.79808646", "text": "def total\n\t\tt = 0\n\t\tself.items.each do |item|\n\t\t\tt+=item.price\n\t\t\t\n\t\tend\n\t\tt\n\tend", "title": "" }, { "docid": "c383440aae58ef0dd9acc0b42d221f21", "score": "0.7948923", "text": "def to...
62eaa0465c7e6a8f43415e126d9901fa
=begin rdoc Adds another column to the spreadsheet by upating the sheets meta data. =end
[ { "docid": "2dc457123a53120f4bc5d770706f0bb5", "score": "0.65122885", "text": "def add_columns(num_of_columns)\n\t\tsheet||=self.sps_get_sheet\n sheet=sheet.root.elements['entry[1]']\n \n col_count=0 \n col_count=sheet.root.elements['entry[1]/gs:colCount'].text.to_i\n ...
[ { "docid": "0f3c8492d86c021ea6a1a7ae552aa2bd", "score": "0.68933254", "text": "def add_columns(sheet)\n ###### MODIFY THIS SECTION ###############\n # add columns\n #add_column(sheet, column_index, name, col_style, data_validation={})\n\n\n ######### END MODIFY THIS SECTION ##############\n ...
8afe7dbed209f50f45b4f5e2b054654c
TWILIO TEXT MESSAGE OPTION (COLLECT usrNumber)
[ { "docid": "f17c7bdbf398d17034ae4668dc073be4", "score": "0.0", "text": "def textMessage()\n answer_check = \"\"\n while answer_check != 'y' || answer_check != \"exit\"\n puts \"Before beginning, would you like to receive an alert on your phone when Fixit is done?\"\n puts \"'y' for y...
[ { "docid": "bb1b2b62ed395b810f31cecf6cf84fbe", "score": "0.62397635", "text": "def sms_consolevt; det.form(:name, 'configSmtpMsg').text_field(:id, 'eventLimitSmsConsolidation'); end", "title": "" }, { "docid": "25fe9b43c97b78b937eda35d4973de14", "score": "0.6113002", "text": "def tex...
2bb83320b412005cae508f43af93350d
PATCH/PUT /equipmeents/1 PATCH/PUT /equipmeents/1.json
[ { "docid": "4dd18cfe97120864423d75e35f2bdef5", "score": "0.702399", "text": "def update\n respond_to do |format|\n if @equipmeent.update(equipmeent_params)\n format.html { redirect_to @equipmeent, notice: 'Equipmeent was successfully updated.' }\n format.json { render :show, status...
[ { "docid": "75a0b0412ecef6861dd62b6e15f612ca", "score": "0.7036469", "text": "def update\n @equipo = Equipo.find(params[:id])\n\n respond_to do |format|\n if @equipo.update_attributes(params[:equipo])\n format.html { redirect_to @equipo, notice: 'Equipo was successfully updated.' }\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "b19185b4d5e5ae4a015a1fa30c87053a", "score": "0.0", "text": "def set_comments_lesson\n @comments_lesson = CommentsLesson.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;...
fed97705d54f16168a20a301c4debca0
=begin uint32_t r; / r = 0x05555555(j+16); r = ( ROTL32(((uint32_t)m)[j], ((j+0))+1 ) + ROTL32(((uint32_t)m)[(j+3)], ((j+3))+1 ) ROTL32(((uint32_t)m)[(j+10)], ((j+10))+1 ) + k_lut[j] ) ^ ((uint32_t)h)[(j+7)]; r += S32_1(q[j+ 0]) + S32_2(q[j+ 1]) + S32_3(q[j+ 2]) + S32_0(q[j+ 3]) + S32_1(q[j+ 4]) + S32_2(q[j+ 5]) + S32_...
[ { "docid": "1973499af01bf75bd1435d3efdd49270", "score": "0.5310298", "text": "def expand_1(j)\n s = sprintf(\"/* expand_1(%2d) */\\n\", j)\n s += sprintf(\"\\tq[%2d] = \\n\", j+16)\n s += sprintf(\"\\t\\t(( ROTL64(((uint64_t*)m)[%2d], %d) \\n\", j%16, (j%16)+1)\n s += sprintf(\"\\t\\t + ROTL6...
[ { "docid": "f18554bd5e07a413644451671e088dda", "score": "0.6090723", "text": "def randinit\n c = d = e = f = g = h = j = k = 0x9e3779b9\n r = @randrsl\n\n 4.times do\n c = c ^ (d << 11)\n f += c\n d += e\n d = d ^ (0x3fffffff & (e >> 2))\n g += d\n ...
1944f5d75db956571556e843e9f5fce6
Standard RESTful methods GET /users GET /users.xml
[ { "docid": "b30c1a1918b74217189ec2f52f7e25fb", "score": "0.0", "text": "def index\n if !params[:type].blank?\n case params[:type]\n when \"buyers\"\n respond_to do |format|\n format.html {\n @users = User.paginate :per_page => 500, \n ...
[ { "docid": "81f820aba49ac09ba424a3c44ecb4bf8", "score": "0.81980914", "text": "def account_users \n make_request(:get,\"#{account_url}/users.xml\")\n end", "title": "" }, { "docid": "7e8d258f13b5ac8306b7387d394a0f12", "score": "0.78237253", "text": "def get_users\n Resou...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "0d53a6c4dd13a0ff0aebbb44b1e2ff57", "score": "0.0", "text": "def product_summary_params\n params.require(:product_summary).permit(:product_code, :skull_id, :warehouse_id, :name, :merchant_account_id, :quality, :price)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69792545", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781151", "text": "def strong_params\n params.requ...
515ca8bf0ce8956820b45c62f6f5006c
DELETE /crm_contact_infos/1 DELETE /crm_contact_infos/1.json
[ { "docid": "79330a659d5fb486146eefcd436c4590", "score": "0.77850103", "text": "def destroy\n @crm_contact_info = CrmContactInfo.find(params[:id])\n @crm_contact_info.destroy\n @crm_contact=@crm_contact_info.crm_contact\n\n # respond_to do |format|\n # format.html { redirect_to crm_conta...
[ { "docid": "fae4748ddc238f18d10d4c1c36cba38c", "score": "0.76624477", "text": "def destroy\n @crm_contact = CrmContact.find(params[:id])\n @crm_contact.destroy\n\n respond_to do |format|\n format.html { redirect_to crm_contacts_url }\n format.json { head :no_content }\n end\n end"...
44f3cea448aaf364aee7f5d5813f4918
Generate a header from attribute definitions
[ { "docid": "57efbb79a3da153503b8a68a072d051d", "score": "0.6440561", "text": "def header\n Header.coerce(attributes, copy_keys: copy_keys, model: model, reject_keys: reject_keys)\n end", "title": "" } ]
[ { "docid": "ba5b79b673f09131c2751ae7741490de", "score": "0.78829813", "text": "def build_header\n attributes.each_with_object([]) do |attribute, header|\n header.concat(self.class.to_veritas_header_component(attribute))\n end\n end", "title": "" }, { "docid": "113...
23286b4da8f8d164ae646b6310eed71b
find all the items that belong to the list
[ { "docid": "fc51546c192726a7d7713ae3dabffc2f", "score": "0.6850323", "text": "def find_list_items(id)\n items = Item.where(list_id: id)\n return items\nend", "title": "" } ]
[ { "docid": "882d84d8d698173c2936925e5a97faf9", "score": "0.6710439", "text": "def find_all\n\tmatching_items = []\n\tself.each do |item|\n\t\tif yield (item)\n\t\t\tmatching_items << item\n\t\tend\n\tend\nend", "title": "" }, { "docid": "8ccae95ede719a830f27d2bbcdecc3ad", "score": "0.660...