query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
d6a012934e30f4b1265a4d42c6b85f57
Create a new job from config.xml. ==== Parameters: +config_xml+:: config.xml of new job as string. ==== Returns: True on success
[ { "docid": "a1c1ad1a191c26567a4e272387f6591f", "score": "0.68496937", "text": "def create(config_xml)\n\t\t\t\t\tpath = ::File.join(::File.dirname(@path), 'createItem')\n\t\t\t\t\tconnection.post(path, config_xml, name: id) do |req|\n\t\t\t\t\t\treq['Content-Type'] = 'text/xml'\n\t\t\t\t\tend.code == '2...
[ { "docid": "e3f08f5fc3b472baa093c2eca3fb35f6", "score": "0.6801908", "text": "def create(job_name, xml)\n @logger.info \"Creating job '#{job_name}'\"\n @client.post_config(\"/createItem?name=#{form_encode job_name}\", xml)\n end", "title": "" }, { "docid": "dce08fe3256f6ee...
607d4aa910c42053a6a753924485984a
will change to get weather to modify player stats
[ { "docid": "681e8f41ab6ab6498ee299ec7acda052", "score": "0.0", "text": "def current_game_week\n url = \"/service/weather/json/#{api_key}/\"\n response = conn.get(url)\n result = JSON.parse(response.body, symbolize_names: true)\n weather_data = result[:Games].map do |home_team, weathe...
[ { "docid": "416be39959e8fef97a5fefa9275c8c37", "score": "0.73510134", "text": "def update_weather\r\n # Update weather graphic\r\n @weather.type = $game_screen.weather_type\r\n @weather.max = $game_screen.weather_max\r\n @weather.update\r\n end", "title": "" }, { "docid": "1ae56...
77b2b0ac9e8befd0655b318b8804698a
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Example: Input: [ 1>4>5, 1>3>4, 2>6 ] Output: 1>1>2>3>4>4>5>6
[ { "docid": "a0119309a170a349d48a4fe622aefd68", "score": "0.0", "text": "def nodify(node_vals)\n return nil if node_vals.empty?\n head = ListNode.new(node_vals[0])\n node_vals = node_vals[1..-1]\n cur = head\n\n node_vals.each do |val|\n cur.next = ListNode.new(val)\n cur = cur.next\n end\n\n...
[ { "docid": "fa9f7fcc0b7a1a47ac88aed949a6125e", "score": "0.8297042", "text": "def merge_k_sorted_lists ll\n return [] if ll.length == 0\n return ll.first if ll.length == 1\n m = ll.length / 2 - 1\n l = merge_k_sorted_lists ll[0..m]\n r = merge_k_sorted_lists ll[m+1..-1]\n i = j = 0\n o = []\n wh...
1d2260596381e1d9531709858ebacb57
POSITION_TAKEN here try ternary format
[ { "docid": "d14790e6e0ed226a63a875ad21e929cc", "score": "0.0", "text": "def position_taken?(board, position)\n board[position] != \" \" && board[position] != \"\" && board[position] != nil\nend", "title": "" } ]
[ { "docid": "234055df176be8f56f1c85863f439b93", "score": "0.6715153", "text": "def position_taken?(index)\n\n end", "title": "" }, { "docid": "5c3d26dcf30d6dc5cd04ab1b2ee5fb3a", "score": "0.65829307", "text": "def check_position\n\t self.position = updated_position if self.position ...
af2e04ffcdb8eedc5c7ed301bd73d177
Maps the characters of the character set using the given _block_.
[ { "docid": "f8d19096253953c7d38d9af53b76434f", "score": "0.73151875", "text": "def map_chars(&block)\n chars.map(&block)\n end", "title": "" } ]
[ { "docid": "66a4d69effa775c9344376d7958c6c3f", "score": "0.67783266", "text": "def map_char(ident, &block) ; map_primitive(:char, ident, &block) ; end", "title": "" }, { "docid": "99c9bf876670271729dc40b5ee673496", "score": "0.6564342", "text": "def encode_block(state, block)\n\t\tbe...
a4f7ae3283936e83e41920ee8a49db1b
Checks equality by comparing each attribute.
[ { "docid": "70ea49be8098896feb4a1ac93e13ae9d", "score": "0.0", "text": "def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n to_company_id == o.to_company_id &&\n name == o.name &&\n identifier == o.identifier &&\n status == o.status &&\n ...
[ { "docid": "153b45ee9e17f104e42417688976c51c", "score": "0.768239", "text": "def compare_attributes(attrs)\n\t\t\t\tattrs.each do |name, value|\n\t\t\t\t\tnext true if compare_attribute(name, value)\n\t\t\t\t\tbreak false\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "6c59827132384193c...
c7d5f62e68cd6e89c2e4ad79821969f3
returns the rating that user u gave movie m in the training set, and 0 if user u did not rate movie m
[ { "docid": "5b960bc06b0eb9cc9eb7338b26117883", "score": "0.8169468", "text": "def rating(user, movie)\n\n\t u=@users[user]\n\t if u == nil\n\t \treturn 0\n\n\t else\n\n\t return u[movie]\n\t end\n\t end", "title": "" } ]
[ { "docid": "4946e90e694e338620cb078f8ca148b5", "score": "0.8707861", "text": "def rating(u,m)\n ratings = @training_hash[:users_ratings]\n movie_idx = movies(u).index(m)\n m_rating = ratings[u-1][movie_idx] unless movie_idx.nil? {\n m_rating = 0\n }\n return...
b091035c9eb76cc8be1d0932ad19ca44
converts a name and quote id into the desired format. (Ex: author: Noah Finberg quote_id: 1 => 'NF1')
[ { "docid": "284960851d2e38613a06aea59b04db8f", "score": "0.0", "text": "def unique_tag\n\n\t\t##collect transforms given array into the new array abbr\n\t\tabbr = self.author.split(\" \").collect do |sub_string|\n\t\t\tsub_string[0] #puts first letter of each substring into intials array\n\t\tend\n\n\t\...
[ { "docid": "f2abf51543d67b6092ba160239d8247d", "score": "0.66060776", "text": "def highwire_author_format(name)\n if name.include? ','\n name.split(',').reverse.join(' ').strip\n else\n name\n end\n end", "title": "" }, { "docid": "03332ab431da993c7d5b2e2ce08ab69a", "...
2a14cb17f13125a8876298a6c9ee56cf
PUT /harvest_trellos/1 PUT /harvest_trellos/1.json
[ { "docid": "203946a5866bce14a3198293b732970c", "score": "0.685578", "text": "def update\n @harvest_trello = HarvestTrello.find(params[:id])\n\n respond_to do |format|\n if @harvest_trello.update_attributes(harvest_trello_params)\n format.html { redirect_to @harvest_trello, notice: 'Har...
[ { "docid": "0043268a77da1426b12a70a9b29134d3", "score": "0.61292535", "text": "def update\n respond_to do |format|\n if @troop.update(troop_params)\n format.html { redirect_to @troop, notice: 'Tropa exitosamente actualizada.' }\n format.json { render :show, status: :ok, location: @...
4c07670a04275aa6746e9218e3b1fa19
GET /subsedes GET /subsedes.json
[ { "docid": "e5b70b25b37b846497b9993e775501e0", "score": "0.7671792", "text": "def index\n @subsedes = Subsede.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @subsedes }\n end\n end", "title": "" } ]
[ { "docid": "28d42bc3c97b196cab1b9c29a0e462e9", "score": "0.6672206", "text": "def trades\n Client.current.get(\"#{resource_url}/trades\")\n end", "title": "" }, { "docid": "cdb83c4ab076272f9c8fcbc916c20bfe", "score": "0.6159205", "text": "def subaccounts()\n get('subAccoun...
de4ce284c7792f29ba6683154479e675
Search for errors matching +attribute+, +type+, or +options+. Only supplied params will be matched. person.errors.where(:name) => all name errors. person.errors.where(:name, :too_short) => all name errors being too short person.errors.where(:name, :too_short, minimum: 2) => all name errors being too short and minimum i...
[ { "docid": "03007eae79975f9cde26164b0d52a629", "score": "0.0", "text": "def where(attribute, type = T.unsafe(nil), **options); end", "title": "" } ]
[ { "docid": "a8a58a3d3802faa027fd422031b883f9", "score": "0.61537546", "text": "def attribute_errors\n attributes.select { |_name, type| type.invalid? }\n end", "title": "" }, { "docid": "5c3a97e44c15dfd2c7c81ce7a0518871", "score": "0.5707654", "text": "def errors_on(attribute...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "07c6fc9e481c299067097727190c6568", "score": "0.0", "text": "def user_params_pub opts=Hash.new\n\n if params[:user][:password].blank? && params[:user][:password_confirmation].blank?\n params[:user].delete(:password)\n params[:user].delete(:password_confirmation)\n end\...
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whit...
27dd446e5b901d006abf61818b9a6697
list claims by page_no
[ { "docid": "30149c6967c4446eac50934116e7949d", "score": "0.720771", "text": "def list\n @claim_filter = ClaimFilter.new(params[:claim_filter])\n @claim_filter.organisation_id = nil # filter shared with organisation\n if params[:page_no].blank?\n # Just clicked on List, No specific...
[ { "docid": "762337b0b51f2259d9fd79c902cd1c07", "score": "0.64711773", "text": "def index\n if params[:search].blank?\n @claims = Claim.all.order('created_at DESC').page params[:page]\n else\n @claims = Claim.search(params[:search]).page params[:page]\n end\n end", "title": "" }...
ed604d76b93d650c89b25c699f612095
Return address which includes city, state & country == Examples >>> user.display_address => "Mysore, Karnataka, India"
[ { "docid": "bd1025140b489e4154650cbcfbced84b", "score": "0.0", "text": "def display_address\n address_list = []\n address_list << city unless city.blank?\n address_list << state unless state.blank?\n address_list << country unless country.blank?\n address_list.join(\", \")\n end", "t...
[ { "docid": "00d9ee9411f0fe44703bf8ef11b510d2", "score": "0.8258075", "text": "def full_address\n \"#{address}, #{suburb}, #{state}, Australia\"\n end", "title": "" }, { "docid": "8e1c2752b467b45326e2212297ab29bf", "score": "0.82477385", "text": "def full_address\n \"#{address}...
a0cd6d1a4f0816e63800c470ebb9221d
In this case, returns [[]]
[ { "docid": "779c6242a6ecb0702c89adfd9d244be4", "score": "0.0", "text": "def conditions\n [[]]\n end", "title": "" } ]
[ { "docid": "ebe7621bc3a197034d6b39acd5e82cb5", "score": "0.7302533", "text": "def to_a\n return []\n end", "title": "" }, { "docid": "d33aed3aeb48ab1ad1d09f86e0d91a71", "score": "0.7137919", "text": "def to_a\n []\n end", "title": "" }, { "docid": "2170e14166c...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "d30825639b8a347c1afbdd1f9c2c929f", "score": "0.0", "text": "def upload_params\n params.require(:upload).permit(:upload)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.6980629", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.67819995", "text": "def strong_params\n params.requ...
96b8c6723a63eb6863d16680b0365c01
Execute an RPC call to the remote service and return the raw response.
[ { "docid": "0a3f2068c0d1d8a521a999c8deff231e", "score": "0.73602265", "text": "def remote_call(rpc_method, request_args)\n rpc.execute(rpc_method, request_args)\n end", "title": "" } ]
[ { "docid": "a010be1fe037648d952ee547481caa45", "score": "0.7879999", "text": "def remote_call(rpc_method, request_args)\n self.execute(rpc_method, request_args)\n self.last_response\n end", "title": "" }, { "docid": "b3d2538290e337010d15e67d4d3b36a2", "score": "0.73712856", ...
846a59b1872f3f854ddaee09c3b755c1
POST /used_parts POST /used_parts.json
[ { "docid": "9230d1ba0dc431e5f8ce2507480b5937", "score": "0.6391268", "text": "def create\n @used_part = UsedPart.new(params.require(:used_part).permit(:store_id, :vehicle_id, :part_manufacturer_id, :part_name_id, :quantity))\n #savok = saveNewManufNam(@used_part)\n ok = validatePart...
[ { "docid": "9b3a0056a755c47ba2fe9d9d88511dc7", "score": "0.63930243", "text": "def index\n #@parts = Part.find(:all, :order => 'part_number')\n\t@used_parts = UsedPart.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @used_par...
13e3e7fe81908486d6e4aa428e65587d
The name of the syncer.
[ { "docid": "9fadb82dd7c3695dea06e190c0ac5537", "score": "0.6932761", "text": "def syncer_klass\n case syncer_name.to_s.downcase\n when 's3' then S3Syncer\n when 'ftp' then FTPSyncer\n when 'prepare' then PrepareSyncer\n end\n end", "title": "...
[ { "docid": "28b7f30bcecfcd11207b79bf93dde43b", "score": "0.68595994", "text": "def lockfile_basename\n \"sync-all-#{syncer_name}.lock\"\n end", "title": "" }, { "docid": "76ae84f29e2a360d152a5bfbf475819e", "score": "0.6670833", "text": "def notifier_name\n self.cla...
8f80335bad5e58c7ed605ce0cbd0d91f
Used in room message or presence
[ { "docid": "54ba06ca60ea4a88cf7c5efcf5529087", "score": "0.0", "text": "def sender_name\n @stanza.from.resource\n end", "title": "" } ]
[ { "docid": "279ba385deced2da523ea817a627ef4f", "score": "0.6363047", "text": "def messaging\n end", "title": "" }, { "docid": "34ce10022132088f68f7705d0941b07d", "score": "0.61922455", "text": "def room; end", "title": "" }, { "docid": "fa7d7b4e2d1aa4f4716c5281d9b5519f",...
9c91c084d94e43390c49a5763bf516cb
Adds Canvas User hash to SIS User Import CSV
[ { "docid": "a487f3a83304a6cc0297acd21edf7f39", "score": "0.69418114", "text": "def add_user_to_import(canvas_user)\n @sis_user_import << canvas_user\n end", "title": "" } ]
[ { "docid": "455a0f9c639d33f16d10bc3190c3a9d1", "score": "0.6357717", "text": "def user_csv_import(row)\n {\n 'user' => {\n 'content' => {\n 'email' => row[0],\n 'login' => row[1],\n 'firstname' => row[2],\n 'lastname' => row[...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "36aa580800be6b7aff4f4d376a9b7ee1", "score": "0.0", "text": "def update!(**args)\n @description = args[:description] if args.key?(:description)\n @expression = args[:expression] if args.key?(:expression)\n @location = args[:location] if args.key?(:location)\n ...
[ { "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...
8e74277f88361c6653ac2415782c3b31
PATCH/PUT /crawl_lists/1 PATCH/PUT /crawl_lists/1.json
[ { "docid": "1fb8b5b2ca1eda090517642804dd903f", "score": "0.670329", "text": "def update\n respond_to do |format|\n if @crawl_list.update(crawl_list_params)\n format.html { redirect_to (@post.present? ? [@crawl_list.post, @crawl_list] : @crawl_list), notice: '게시글이 수정되었습니다.' }\n form...
[ { "docid": "3bc8413505caf86f0b231bec70b6f220", "score": "0.69542867", "text": "def update_list(list_id, name)\n return base_uri('patch', 'lists/' + list_id, name)\n end", "title": "" }, { "docid": "d6774d2cbd0425f11a75116aba53e15b", "score": "0.6569288", "text": "def update!(**ar...
ec52fada710ac476ce729b86a3e55488
DELETE /foundation_calculators/1 DELETE /foundation_calculators/1.json
[ { "docid": "1b08459667e9666dc76e615a0c213220", "score": "0.79018253", "text": "def destroy\n @foundation_calculator = FoundationCalculator.find(params[:id])\n @foundation_calculator.destroy\n\n respond_to do |format|\n format.html { redirect_to foundation_calculators_url }\n format.js...
[ { "docid": "af78a4643d06dc3660775353471c8627", "score": "0.72912604", "text": "def destroy\n @calculator = Calculator.find(params[:id])\n @calculator.destroy\n\n respond_to do |format|\n format.html { redirect_to calculators_url }\n format.json { head :no_content }\n end\n end", ...
c42487d6a434bf644f76c3a69562de3d
PATCH/PUT /user_promises/1 PATCH/PUT /user_promises/1.json
[ { "docid": "344c558770b0ce04234d5c9b66f66fad", "score": "0.6920998", "text": "def update\n respond_to do |format|\n if @user_promise.update(user_promise_params)\n format.html { redirect_to @user_promise, notice: 'User promise was successfully updated.' }\n format.json { render :sho...
[ { "docid": "db0cf0e3f324558256f09fe46b79126e", "score": "0.6479816", "text": "def update *_\n @future = users_futures.find(params[:id])\n\n if @future.update_attributes(params[:future])\n render json: @future\n else\n render json: @future.errors, status: :unprocessable_entity\n end...
49da1f866ad149ad8015b219e795e3d7
Custom attribute writer method with validation
[ { "docid": "ecc132996edc2ccfbbd9e9eaadc02257", "score": "0.0", "text": "def notes=(notes)\n if !notes.nil? && notes.to_s.length > 255\n fail ArgumentError, 'invalid value for \"notes\", the character length must be smaller than or equal to 255.'\n end\n\n if !notes.nil? && notes.to...
[ { "docid": "5a0bcdaca95c21b13aacca36f9fad742", "score": "0.6955513", "text": "def _write_attribute(attr_name, value); end", "title": "" }, { "docid": "5812dd7a37c0eccc3d9481c23d74c649", "score": "0.69278884", "text": "def write_attribute(attr_name, value); end", "title": "" }, ...
abdaddb2515277d59463d4292f137563
fonction pour ajouter un noeud dans l'arbre
[ { "docid": "68463f021ecf6235a716cce00d3345dd", "score": "0.0", "text": "def insert(dataExtern)\n noeud = ABR.new(dataExtern)\n @noeudHash = noeud.hashIntern\n if @noeudHash == @hashIntern\n elsif @noeudHash > @hashIntern\n if self.droite == nil\n @dr...
[ { "docid": "4baeed4ac575a400af7bb0334effa88a", "score": "0.6319959", "text": "def add_new_dado\n\t\t@dado += 1\n\tend", "title": "" }, { "docid": "7d6d25b4b361f8193dc7695c34d5863e", "score": "0.6038083", "text": "def ajouter_etudiant(nom_param, prenom_param, niveau_param, cours_nom_p...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "bf48a9badc2670597635372ae2d7fd7e", "score": "0.0", "text": "def set_furniture_category\n @furniture_category = FurnitureCategory.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.61637366", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.60446453", "text": "def action_hoo...
c244c6ec1f349d04d34488620444905f
POST /authors POST /authors.json
[ { "docid": "66d16691ce638f10247e7aecf9540e55", "score": "0.60377717", "text": "def create\n @author = Author.new(params[:author])\n @author.user = @user\n @country = Country.find(params[:author][:country_id])\n respond_to do |format|\n if @author.save\n format.html { redirect_to ...
[ { "docid": "bd1f46e8174394efc3e72e5b6f5ae9f6", "score": "0.70524776", "text": "def add_authors\n text = params[:text]\n puts \"str:#{text}\"\n request = Net::HTTP::Post.new(\"/personality-api/1/add_authors.json\")\n request.basic_auth BmnPersonalityApiSkeletonRor::Application.config.user_nam...
ca9acb9f379ffbfb3e3ae72094a580e8
Sets the partnerState property value. Partner state of this tenant.
[ { "docid": "20bc728122c9e6f3a1f42ebb21e23922", "score": "0.84407425", "text": "def partner_state=(value)\n @partner_state = value\n end", "title": "" } ]
[ { "docid": "1a9d9ccb6fff0845e561136c549db4fc", "score": "0.7790782", "text": "def set_partner_state\n @partner_state = PartnerState.find(params[:id])\n end", "title": "" }, { "docid": "ec3c58fff20ae451f2f3774c4a88ff5f", "score": "0.6985809", "text": "def set_partner\n ...
50c8fc6966aef65791f4af31d3d219fe
This method: + knows to exclude timeseries Engagement Groupings from /totals requests. + knows that the /totals endpoint supports a subset of Engagement Types. +
[ { "docid": "3bdb962910119309e76bb44755196ef8", "score": "0.52582765", "text": "def assemble_request(tweets_of_interest)\n\n\t request = {}\n\n\t request['tweet_ids'] = tweets_of_interest\n\n\t if @endpoint == 'historical'\n\t\t request['start'] = @utils.get_ISO_date_string(@utils.get_date_object(@sta...
[ { "docid": "8cd9a242369182b16402d308c72f3609", "score": "0.5376635", "text": "def visits_by_organization group_by_disregarded: true, disregard_threshold: 5\n organizations_query = visits_by_organization_query\n\n if group_by_disregarded\n pertinent_organizations = Organization.find_by_sql(\n ...
6b7b4185b11f1f2a93eabdd868de87fa
GET /listings GET /listings.json
[ { "docid": "770eaf367145bb878f9900236cac7c8c", "score": "0.0", "text": "def index\n if user_signed_in?\n @listings = Listing.where(\n [\"location = :location or visibility = :visibility\",{\n location: current_user.zip_code.to_s.to_region(city: true),\n visibility: \"global\...
[ { "docid": "fdade8612915ba9d448ad640307de4ae", "score": "0.8407112", "text": "def index\n @listings = Listing.all\n render json: @listings\n end", "title": "" }, { "docid": "4a7530e5b675b2359bf65a6a2a518b61", "score": "0.823", "text": "def index\n @listings = Listing....
468789c945e80f2426fe6b7b050a8c29
merges the hash of headers into the current header set.
[ { "docid": "826372ae1587c7cbbabb1baa3386cdca", "score": "0.0", "text": "def call(env)\n req = Rack::Request.new(env)\n status, headers, response = @app.call(env)\n headers.merge!(SecureHeaders.header_hash_for(req))\n [status, headers, response]\n end", "title": "" } ]
[ { "docid": "ea29b4f3bb14d42a899c1fe8e2020d5a", "score": "0.7490277", "text": "def merge!(headers)\n @headers.merge!(normalize(headers))\n end", "title": "" }, { "docid": "dbd8dc992c1614764ca001b0e0a2c202", "score": "0.7482428", "text": "def merge(headers)\n @header...
c49728a28af87e4a037ede5f1668319c
Function to remove spaces in the link field
[ { "docid": "ad39ab2afdb0366d7bc4fbe9bcbb3871", "score": "0.7985348", "text": "def strip_blanks\n self.link = self.link.strip\n end", "title": "" } ]
[ { "docid": "b8013f0f4ecdad11c374f1ac2430673e", "score": "0.7104405", "text": "def escape_link(link)\n link.gsub(' ', '%20')\n end", "title": "" }, { "docid": "b35bda792a45f531d5f1c12bfab62ba2", "score": "0.691294", "text": "def permalink_with_spaces\n return self.perma...
85a3de067174d2442f5ba791415a0c39
Get a DHCP server's static binding with the specified binding ID Get a DHCP server's static binding with the specified binding ID
[ { "docid": "306bbaf501ebf2750b73165b96f484b7", "score": "0.79201084", "text": "def read_dhcp_static_binding(server_id, binding_id, opts = {})\n data, _status_code, _headers = read_dhcp_static_binding_with_http_info(server_id, binding_id, opts)\n return data\n end", "title": "" } ]
[ { "docid": "fbe13d4e345778ab4ffa362c1173b143", "score": "0.79634583", "text": "def read_dhcp_static_binding(server_id, binding_id, opts = {})\n data, _status_code, _headers = read_dhcp_static_binding_with_http_info(server_id, binding_id, opts)\n data\n end", "title": "" }, { "do...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "b68d26f500c52fc2be106c511da31507", "score": "0.0", "text": "def vtarnay_module7_params\n params[:vtarnay_module7]\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...
80e82205aaa72e71799aab88def57cc5
list information on a single file.
[ { "docid": "2c48bbeabbf0b3f8e1ac3eaeb76dd0ca", "score": "0.0", "text": "def get_file_status(file_path)\n response = HTTParty.get(\"https://#{accountName}.azuredatalakestore.net\" +\n \"/webhdfs/v1/#{file_path}?op=GETFILESTATUS\", {\n body: \"grant_type=client_cre...
[ { "docid": "e97493ec04d20ab4d7e63690c5034120", "score": "0.704534", "text": "def file_list\n end", "title": "" }, { "docid": "d739cbb1f7b659964883016cabd57f85", "score": "0.6737239", "text": "def file_info(path)\n info File.read(path)\n end", "title": "" }, { "do...
85c2547b43fa371d5e37cf70e2b66b98
reload (or load for the first time) the file from disk
[ { "docid": "be8aafc640b589d2f5533eb116721f2f", "score": "0.0", "text": "def reload\n raise(Mp3InfoError, \"empty file\") unless File.size?(@filename)\n\n @header = {}\n \n @tag1 = {}\n @tag1.extend(HashKeys)\n\n @tag2 = ID3v2.new(@id3v2_options)\n\n @file = File.new(filename, \"rb\"...
[ { "docid": "43ecb130806583f5b3e3fed5942bebd1", "score": "0.8520162", "text": "def reload\n load @filename\n end", "title": "" }, { "docid": "ded3d591b11d32cff250cbfd42d5c8a9", "score": "0.8217692", "text": "def reload\n @file = nil\n\n self.file\n end", "title": ...
c56095662f9005140d14bac2bf994fe4
Reloads the object from the database
[ { "docid": "5bba530cc4094e476608ba749d55b2cb", "score": "0.74422914", "text": "def reload\n\t\t\t\tself.load(_id)\n\t\t\tend", "title": "" } ]
[ { "docid": "276a784a714f8bfac35a54d7353faf02", "score": "0.75608194", "text": "def reload\n self.load(connector.instance(object_path))\n end", "title": "" }, { "docid": "cddb56e122d681bb922c93b79b689483", "score": "0.7535888", "text": "def reload()\n if persister.is_a?( ...
fe4f6d9a8fa2f363cc0c4e77ac4c8a29
forward has been renamed into forward_to
[ { "docid": "4b8a8babdf63b0c06c0b2013599ce97e", "score": "0.0", "text": "def test_deprecated_forward\n e1, e2 = EventGenerator.new, Roby::EventGenerator.new\n plan.add([e1, e2])\n\n deprecated_feature do\n e1.forward e2\n end\n\n assert(e1.child_object?(e2, E...
[ { "docid": "fa7546821a6660f7eab270b9eb96535a", "score": "0.8702355", "text": "def forward; end", "title": "" }, { "docid": "fa7546821a6660f7eab270b9eb96535a", "score": "0.8702355", "text": "def forward; end", "title": "" }, { "docid": "ee98217bae3b0f349c58dc0a1cbd2561", ...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "e3ae82eeab7920199557a1166efa36d9", "score": "0.0", "text": "def actor_params\n params.require(:actor).permit(:name)\n end", "title": "" } ]
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.71230334", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "b32229655ba2c32ebe754084ef912a1a", "score": "0.70530915", "text": "def expected_permitted_parameter_names; end", "title": ...
46978b1b5f6f312cd20ba9fd40642b97
All variants of sort_params as specified in clause 3 above.
[ { "docid": "1ed27073f07189528daa3e9e701662f8", "score": "0.0", "text": "def sort_values_variants(study, reverse)\n sort_params = sort_values(study, reverse)\n res = [sort_params]\n sort_params.reverse.each_with_index do |sort_value, i|\n next if sort_value != LLONG_MIN\n\n params = so...
[ { "docid": "e7b663fbb8195f18a964090afd1c04a0", "score": "0.806646", "text": "def sort_params; end", "title": "" }, { "docid": "e7b663fbb8195f18a964090afd1c04a0", "score": "0.806646", "text": "def sort_params; end", "title": "" }, { "docid": "bf6d26bfcd1a77b88c143e8d03a675...
e1733f3a1df3c829c08b0110fe174e2c
Load options from passed in hash or JSON on STDIN. Merges in defaults when applicable
[ { "docid": "b5e00535144b4c89dfde64f641e5b1ac", "score": "0.79494286", "text": "def load_options(options)\n options ||= get_json_input()\n options ||= {}\n if @config && @config[\"options\"] then\n defaults = {}\n @config[\"options\"].each{ |k,v| defaults[k] = v[\"default\"] ...
[ { "docid": "6d91143c698ad2f7f3b5e6d1fabdd2d8", "score": "0.66466326", "text": "def make_options(opts={})\n loading_options = opts.delete(:optsparse) || {}\n loading_options.merge!( opts || {})\n \n load_options!(loading_options) # Load command-line options\n config_fil...
c36b50199da8f5cb39d232e9deeca0c8
Set a window attribute
[ { "docid": "61b2a6c33ec52585c2fd267284ce0935", "score": "0.6271889", "text": "def set(opts)\n # Store new window attributes, or ignore if nil\n @title = opts[:title] || @title\n if Color.is_valid? opts[:background]\n @background = Color.new(opts[:background])...
[ { "docid": "51f0c2a29cbb5e4413138c60e1cd8a42", "score": "0.7134934", "text": "def change_window_attributes (*args)\n change_window_attributes!(*args).abandon\n end", "title": "" }, { "docid": "b9024a3c1e624daffd519237671afdcb", "score": "0.69088185", "text": "def set_window(w...
71f328dec7b87208c59bb03ed61b5de8
validates_uniqueness_of :number, :scope => [:area_code, :contact_id] add a self to a list
[ { "docid": "d6e641bfd5bae27e091c86fd2166464c", "score": "0.0", "text": "def add_to_list(list)\n\n end", "title": "" } ]
[ { "docid": "1c473f0a906645850dbfa1f6e996723e", "score": "0.61100054", "text": "def add_phone_number!(phone_number)\n clean_phone_number = Expect.clean_phone_number(phone_number)\n \n unless self.phone_numbers.where(clean_phone_number: clean_phone_number).any?\n self.phone_numbers.create(ph...
4e38a24e2beb498530c0359f5ae0d74d
The consumer secret if environmental variable is set
[ { "docid": "fca8bb6d4a420ae8463e4444657b14d2", "score": "0.81729865", "text": "def consumer_secret\n ENV['DESK_CONSUMER_SECRET']\n end", "title": "" } ]
[ { "docid": "155c5de87ef882fc3870c67372cf5c66", "score": "0.8207925", "text": "def consumer_secret\n ENV[CONSUMER_SECRET_NAME]\n end", "title": "" }, { "docid": "2788927ddb66976be8750a9201bff453", "score": "0.805402", "text": "def consumer_secret\n ENV['WHCC_CONSUME...
a2f2126320f0ba08c2ac2fb45dfec46b
Disconnects from the Source server.
[ { "docid": "8d6a9effda3586982a2d397ebcca6ef3", "score": "0.67814493", "text": "def disconnect\n if @socket\n @socket.close\n @socket = nil\n @authed = false\n end\n end", "title": "" } ]
[ { "docid": "c82ab38b79274cbdaeb9d892bc31e663", "score": "0.7240458", "text": "def disconnect\n @server = nil\n @status = :disconnected\n end", "title": "" }, { "docid": "71fb7645876973f6a4ccf281343b43b8", "score": "0.7146196", "text": "def disconnect\r\n @connecti...
f3a0b47ec2ab349e7343fae7db3981d0
Exits a clusterd state. Exiting happens bottom to top, so we recursively exit the current substate and then invoke the exit method on each state and stack unwinds
[ { "docid": "a09f19f9c2fb0ad836eb01349c9704f3", "score": "0.71360904", "text": "def exit_clustered(opts)\n cur = @substates.find {|substate| substate.__is_current__? }\n\n # if history: true for current state, set current states `__previous__` to active substate\n # NOTE: `cur` could potentially...
[ { "docid": "893f7385843f520940a88289b5863bb9", "score": "0.63447726", "text": "def exit!\n map = @transition_map\n map.each do |type, events_to_transition_arrays|\n events_to_transition_arrays.each do |event, transitions|\n transitions.each(&:unarm)\n end\n end\n\n ...
c7db462de26320d7b6d24f1e902db7c2
DELETE /pinturas/1 DELETE /pinturas/1.json
[ { "docid": "7be57472b4a95151c2d1b9ab510a1cc9", "score": "0.71922123", "text": "def destroy\n @pintura.destroy\n respond_to do |format|\n format.html { redirect_to pinturas_url, notice: 'Pintura was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title...
[ { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.74189657", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": ...
5d3d7d751c9333639f9d333f16edd5de
This will add a string of +text+ to the document, starting at the current drawing position. It will wrap to keep within the margins, including optional offsets from the left and the right. The text will go to the start of the next line when a return code "\n" is found. Possible +options+ are: :font_size:: The font size...
[ { "docid": "900145aa47514c93e5b433319166738b", "score": "0.7670097", "text": "def text(text, options = {})\n # Apply the filtering which will make underlining (and other items)\n # function.\n text = preprocess_text(text)\n\n options ||= {}\n\n new_page_required = false\n __y = @y\...
[ { "docid": "3084d7505cc6971f778198d454cd5fb9", "score": "0.66701037", "text": "def add_text_wrap(x, y, width, text, size = nil, justification = :left, angle = 0, test = false)\n if text.kind_of?(Numeric) and size.kind_of?(String)\n text, size = size, text\n warn PDF::Writer::Lang[:add_textw...
571bdc47f85f34e1ed1fd9977c9e51f7
A Reader for the environment in which the database will run under. Depending on the developer settings within their db.yml, it can be set to use different databases based on environments.
[ { "docid": "7c01d2c07f6523eac94ce6e1091ec6cc", "score": "0.0", "text": "def env\n @env || 'development'\n end", "title": "" } ]
[ { "docid": "6b7c5ac5c390dd52038ac862d830f3ac", "score": "0.75077033", "text": "def database_environment\n if configuration[:database]\n configuration[:database][rails_env.to_sym]\n else\n {}\n end\n end", "title": "" }, { "docid": "1b1759e335fa3ee3e818b7be02e78b00", "sc...
409a4a322d11bdb6b1226beb40200822
Sort Colum table Section Sort_default
[ { "docid": "d94740497813c8f29be416b2267cd7a5", "score": "0.0", "text": "def sort\n\t\t#User.order(sort_column + \" \" + sort_direction).page(params[:page])\n\t\tUser.paginate(\t:page => params[:page], per_page: 10, \n\t\t\t\t\t \torder: (sort_column + \" \" + sort_direction))\n\tend", "title": "" ...
[ { "docid": "13d387f46994a191f32a3e0bc0d0a86c", "score": "0.734696", "text": "def sort_by_default\n 1\n end", "title": "" }, { "docid": "3781c2387c9e9183a1ccfea5296822a3", "score": "0.7286085", "text": "def sort_column\n nil\n end", "title": "" }, { "docid": "b...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "f56414ed8f4d2c32d7fca712d980bbfd", "score": "0.0", "text": "def detalle_params\n params.require(:detalle).permit(:NroLinDet, :TpoCodigo, :VlrCodigo, :TpoDocLiq, :IndExe, :IndAgente, :MntBaseFaena, :MntMargComer, :PrcConsFinal, :NmbItem, :DscItem, :QtyRef, :UnmdRef, :PrcRef, :QtyItem, :F...
[ { "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...
70b3646141194c23e9f94ee622fa3aaf
I worked on this challenge [by myself, with: ]. Your Solution Below
[ { "docid": "dfc75f9cd6198a67934c045ec73b2990", "score": "0.0", "text": "def leap_year?(x)\n\tif x % 4 == 0\n\t\tif x % 100 == 0\n\t\t\tif x % 400 == 0\n\t\t\t\treturn true\n\t\t\telse\n\t\t\t\treturn false\n\t\t\tend\n\t\telse\n\t\t\treturn true\n\t\tend\n\telse\n\t\treturn false\n\tend\nend", "titl...
[ { "docid": "aa89b26c8848588848ff622b5d313173", "score": "0.64733064", "text": "def solution\n 31875000\nend", "title": "" }, { "docid": "b9960478999684c2b536f76e22f6fc63", "score": "0.62905127", "text": "def solution4(input)\n end", "title": "" }, { "docid": "7a007b87...
c7b6e1616e1e15de1f62e083732e7c0e
Calculate the signature, Base64 and URL encode it
[ { "docid": "845021c2a5012833d13d52b8c3c14552", "score": "0.68008935", "text": "def generate_signature(base_string)\n key = OpenSSL::HMAC.digest('sha1', client_secret, base_string)\n CGI::escape(Base64.encode64(key).chomp)\n end", "title": "" } ]
[ { "docid": "b843479191ea5fada012e763570f3420", "score": "0.7304333", "text": "def calculate_signature\n normalized_string = [\n request_header.timestamp,\n request_header.nonce,\n request_header.algorithm,\n method.upcase,\n host_with_port,\n ...
6f4833d484172d91ae03ec2e6af18cf7
POST /post381s POST /post381s.xml
[ { "docid": "4443559c229a5a3e2a1692fcf75589a1", "score": "0.65166134", "text": "def create\n @post381 = Post381.new(params[:post381])\n\n respond_to do |format|\n if @post381.save\n format.html { redirect_to(@post381, :notice => 'Post381 was successfully created.') }\n format.xml...
[ { "docid": "fa8fcc23911ab0c33dc007eceacc29f5", "score": "0.58542454", "text": "def post(uri, xml)\r\n req = Net::HTTP::Post.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end", "title": "" }, { "docid": "ae05e707eb9894a...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "c648e0879bdfae469874d522f6fc5408", "score": "0.0", "text": "def set_micropost\n @micropost = Micropost.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;...
e016f96129924dc4dbc0ed92ac70b414
I dont think this works was trying to update orders, need to refactor invoice/order system possibly rescaffold.
[ { "docid": "7702059cdd11741f31da6647632aa100", "score": "0.0", "text": "def update \n respond_to do |format|\n if @order.update(vehicle_params)\n format.html { redirect_to @order, notice: 'Vehicle was successfully updated.' }\n format.json { render :show, status: :ok, location: @ve...
[ { "docid": "b03b5b16846921cb07f303728b5fcaf5", "score": "0.6864427", "text": "def update\n\n respond_to do |format|\n if @order.update(order_params)\n if user_signed_in? && current_user.admin\n format.html { redirect_to @order, notice: 'Order was successfully updated.' }\n ...
d890fb767cedbb3e5d6efd484564251b
write a boolean function zero_sum? that takes an array of intergers and returns true if 2 elements in the array sum to zero.
[ { "docid": "a68734fab105d2f39fb0446ca6f880b5", "score": "0.8405102", "text": "def zero_sum?(arr)\nend", "title": "" } ]
[ { "docid": "5b5eba8e90ca99a9845a03c41fa5c6d9", "score": "0.8441492", "text": "def zero_sum?(array)\n (0...array.length).each do |index1|\n (index1 + 1...array.length).each do |index2|\n return true if array[index1] + array[index2] == 0\n end\n end\n false\nend", "title": "" }, { ...
7e682694520de0544516b3958394f4db
get a response body
[ { "docid": "0896d8a939cf56aca40d11dd427abdfb", "score": "0.0", "text": "def get_response\n @response.body.gsub(/xmlns=\".*\"/,'')\n end", "title": "" } ]
[ { "docid": "3914c04f955e87d5432b9d73b4ba7e12", "score": "0.8426401", "text": "def get_response_body\n uri = URI.parse(@url)\n reponse = Net::HTTP.get_response(uri)\n reponse.body\n end", "title": "" }, { "docid": "9143abc0497b22e3f3cd31421c20267c", "score": "0.825...
fa40c314ff694740cb8c1faaef06c275
NOTE: when using gmail to send; like we are doing this gets overridden
[ { "docid": "8ead4b6063674a0b344fb08ee3ea760b", "score": "0.0", "text": "def welcome_email(user)\n\t \t@user = user\n\t \tmail(to: @user.email, subject: 'Welcome to Projects')\n\t end", "title": "" } ]
[ { "docid": "c55eda673f931fca859c7e3658c76c21", "score": "0.66685", "text": "def send_email_to_townhall(townhall_name, townhall_email)\n email_content = write_nice_email(townhall_name)\n\n Gmail.connect!(\"yesouiskevin@gmail.com\", ENV[\"gm\"]) do |gmail|\n gmail.deliver do\n to townhall_email\...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "41da47b56b9c994ef612e802a6a0520f", "score": "0.0", "text": "def set_member_group\n @member_group = MemberGroup.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;...
30949fcbeb9e0e8f8dd1259f7e658765
Initializes the job with a job name (passed from GovernorBackground.run) and the original delayed_job job.
[ { "docid": "31ee600f37b58fb38553af33b8d4bba3", "score": "0.6197616", "text": "def initialize(name, job)\n @name = name\n @id = job.try(:id)\n @created_at = Time.now\n end", "title": "" } ]
[ { "docid": "0a3d65230a257d35bc3e93cb812a76e1", "score": "0.6591752", "text": "def initialize(name, job)\n @name = name\n @job = job\n end", "title": "" }, { "docid": "274dd152e9ab1d54418fc86601453372", "score": "0.628397", "text": "def job\n job_name.constantize.new({\n ...
8cc7e9065818de4a1a1e907466b7225c
A flag stating if the number of requests within the period has been met.
[ { "docid": "7e21701b7500b3ddf848719cf5fbb35a", "score": "0.6757772", "text": "def exceeded?\n return current_request_count >= count\n end", "title": "" } ]
[ { "docid": "42790010b89adad2f9469c3ce90e5a9c", "score": "0.6877384", "text": "def has_exceeded_reporting_threshold?\n pending? && times_reported > 0\n end", "title": "" }, { "docid": "be69ca765379b0ba0af3b065be99ca0c", "score": "0.67415583", "text": "def requests_remaining?\n ...
f7d4c6fbc5509a765b845170d3823385
:callseq: add_reader(reader) add_reader(munge) This method can be used to attach one or more Readers to this object. Input will be fetched from all Readers with each call to munge() and passed as arguments to the munge code. When all Readers are exhausted, this object will be marked finished?() as will all attached Wri...
[ { "docid": "87ff1c2b0dcd5a782ccea92b9f2f151c", "score": "0.7827389", "text": "def add_reader(reader_or_munge)\n fail \"Already reading from a Munge.\" if @readers.is_a? self.class\n case reader_or_munge\n when self.class\n if @readers.empty?\n fail \"A Munge used as a Read...
[ { "docid": "c99b339bc1dc488c6082257b2f150c45", "score": "0.69184846", "text": "def <<(reader_or_munge_or_writer)\n case reader_or_munge_or_writer\n when Reader\n @readers << reader_or_munge_or_writer\n when Munge\n @munges << reader_or_munge_or_writer\n when Writer\n ...
bfa20d5385712f42e007b8824065af61
The museum of incredible dull things wants to get rid of some exhibitions. Miriam, the interior architect, comes up with a plan to remove the most boring exhibitions. She gives them a rating, and then removes the one with the lowest rating. However, just as she finished rating all exhibitions, she's off to an important...
[ { "docid": "12dd06c5e615d11cc9bff5843020df92", "score": "0.8326935", "text": "def remove_smallest(numbers)\n return numbers if numbers.empty?\n \n idx = numbers.find_index(numbers.min)\n # idx = numbers.index(numbers.min)\n numbers.delete_at(idx)\n \n numbers\nend", "title": "" } ]
[ { "docid": "137f82bca00729daa4330d64d1594eda", "score": "0.868347", "text": "def remove_smallest(numbers)\n return [] if numbers == []\n worst_exhibition = numbers.min\n numbers.delete_at(numbers.index(worst_exhibition)) # but this mutates the array. had to look up delete at\n numbers\nend", "ti...
4a01085ed63ee1c7a8946797c3325ecc
:callseq: delete_element(index) > removed_element or nil delete_element(element) > removed_element or nil delete_element(xpath) > removed_element or nil Deletes a child element. When 1based integer argument +index+ is given, removes and returns the child element at that offset if it exists; indexing does not include te...
[ { "docid": "20517222a92ee63b03aa3eccf31e2e6a", "score": "0.7109289", "text": "def delete_element element\n @elements.delete element\n end", "title": "" } ]
[ { "docid": "21a3047df64eb1387ec73aab4fd6abc9", "score": "0.75605047", "text": "def delete(element)\n delete_child(element)\n delete_parent(element)\n end", "title": "" }, { "docid": "4bd8d37165060161577172f7b714cafa", "score": "0.7360265", "text": "def delete element\n ...
e6fb005b5e602a6bb774552507ab96a2
for each event adds id of event if attended or nil if not
[ { "docid": "38f435e376270ddde3c5267d99f9fdaf", "score": "0.6706457", "text": "def attendance_id_mapping(events)\n attended_ids = self.attended_events.pluck(:id)\n return events.map{|e| {'id'=>e.id,'attended'=> (attended_ids.include? e.id ) }}\n end", "title": "" } ]
[ { "docid": "13e3d261439ed13af66d516064a2403b", "score": "0.657615", "text": "def new_event_id\n\t\tnew_id = 1\n\t\tsucc = false\n\t\t\n\t\tuntil succ\n\t\t\tsucc = true\n\t\t\t\n\t\t\tall_events.each { |event|\n\t\t\t\tif event.id == new_id\n\t\t\t\t\tnew_id += 1\n\t\t\t\t\tbreak succ = false\n\t\t\t\te...
c83ce880d7c3a2ae864fa7e9564ac625
get employees vists per patient
[ { "docid": "3826b5cf9f20c16077c1b77b95690158", "score": "0.6363899", "text": "def show_employees_visits_per_patient\n visits = set_payroll_visits\n @grouped_visits = visits.group_by{|visit| [visit.assignee.try(:display_name), visit.patient.try(:display_name)]}.map do |k, v|\n no_user_patients...
[ { "docid": "cd9a1e2698fdf01595ea5a40999fc207", "score": "0.5993238", "text": "def sub_employees\n subordinates = []\n p @@employees\n @@employees.each do |employee|\n if employee.boss == self.name\n subordinates << employee\n end\n end\n\n return subordinates\n end", ...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "d220f79a2f18efa1408d940d80ef22ed", "score": "0.0", "text": "def update!(**args)\n @prefix_size = args[:prefix_size] if args.key?(:prefix_size)\n @raw_hashes = args[:raw_hashes] if args.key?(:raw_hashes)\n end", "title": "" } ]
[ { "docid": "150fa2bdc1fc43d28ac45e2278a1f797", "score": "0.7012263", "text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "t...
a4f7ae3283936e83e41920ee8a49db1b
Checks equality by comparing each attribute.
[ { "docid": "d1256bd06504951da51f281cf4fe0e3e", "score": "0.0", "text": "def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n charges == o.charges &&\n date == o.date &&\n org_name == o.org_name &&\n public_id == o.public_id &&\n re...
[ { "docid": "153b45ee9e17f104e42417688976c51c", "score": "0.768239", "text": "def compare_attributes(attrs)\n\t\t\t\tattrs.each do |name, value|\n\t\t\t\t\tnext true if compare_attribute(name, value)\n\t\t\t\t\tbreak false\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "6c59827132384193c...
430b887ee13b6994338312d6c28d4a8a
To avoid generating " we can't use this optimisation on routes without any segments
[ { "docid": "9bd5989f05d9bc51a777ba0df2db6fdc", "score": "0.54912406", "text": "def applicable?\n super && route.segment_keys.size > 0\n end", "title": "" } ]
[ { "docid": "5fa45d339da7ea243e6a37da1994251c", "score": "0.67837304", "text": "def map_dynamic_segments(route)\n segments = route.to_s.split('/')\n segments.map! do |segment|\n if segment =~ /:/\n '.*'\n else\n segment\n end\n end\n\n segments.j...
5887657c4f21923e1415dee97b40b9cc
TODO: rethink handling shadows cast by offscreen blocks
[ { "docid": "608a0a423814d878f6305b0205d5e162", "score": "0.64277893", "text": "def casts_shadow?(x,y,z)\n SHADOW_CASTERS.include?(get_block(x,y,z))\n end", "title": "" } ]
[ { "docid": "05f091071f1c5e677f86525c79312228", "score": "0.66766274", "text": "def no_shadows\r\n end", "title": "" }, { "docid": "2f50bc7ea68050da4de91340c86ac4ec", "score": "0.6540506", "text": "def shadows_face_sun?\n end", "title": "" }, { "docid": "54cfb36017...
85c24091fef575e6e0bb2f8556deb8f7
The following handles deleting the copied cmd.exe and payload exe!
[ { "docid": "83790245baa882ea69fafa64d0ee370c", "score": "0.69478214", "text": "def on_new_session(client)\r\n\r\n\t\tif client.type != \"meterpreter\"\r\n\t\t\tprint_error(\"NOTE: you must use a meterpreter payload in order to automatically cleanup.\")\r\n\t\t\tprint_error(\"The copied exe and the paylo...
[ { "docid": "917718ccd2418e5cd0fd4ff0bb86e167", "score": "0.70862603", "text": "def on_new_session(client)\n\n if client.type != \"meterpreter\"\n print_error(\"NOTE: you must use a meterpreter payload in order to automatically cleanup.\")\n print_error(\"The copied exe and the payload exe m...
7f044a64b5d9e32869f87a3cdc86b8aa
POST /marketshare/brands POST /marketshare/brands.json
[ { "docid": "c0e4db0d25c238f543ea866a6c74a952", "score": "0.7145288", "text": "def create\n @marketshare_brand = Marketshare::Brand.new(marketshare_brand_params)\n\n respond_to do |format|\n if @marketshare_brand.save\n format.html { redirect_to marketshare_brands_path, notice: 'Brand w...
[ { "docid": "86d9ecbf92bb30d55764d4c652ab64b4", "score": "0.641812", "text": "def init_brands\n response = @conn.get do |req|\n req.url \"/api/v1/brands\"\n req.headers = rest_headers\n end\n\n @brands = json(response.body)[:brands]\n end", "title": "" }, { "do...
a2eb09352bec0bdb471fc8d024a27a00
POST /collect_imports POST /collect_imports.json
[ { "docid": "86e4f7c8fec2b6bb67cca1707a916d93", "score": "0.6102949", "text": "def create\n @collect_import = CollectImport.new(collect_import_params)\n\n respond_to do |format|\n if @collect_import.save\n format.html { redirect_to @collect_import, notice: 'Collect import was successful...
[ { "docid": "422e03eab69cea2c3d2aceab3cfbdbc7", "score": "0.7306669", "text": "def member_imports\n imports = params[:imports].nil? ? [] : params[:imports]\n head :ok, format: :json if imports.empty?\n #\n # binding.pry\n # 1\n begin\n imports.each do |import|\n doc = Docume...
8211fe0c569a331406087923a2b56fcb
the largest multiplier of k such that the multiple is strictly less than n. e.g. last_multiplier(5, 100) = 19
[ { "docid": "c00012d52b44470a872d53c5b2bc80f4", "score": "0.85731536", "text": "def last_multiplier(k, n)\n (n - 1) / k\n end", "title": "" } ]
[ { "docid": "fb9225caa2c53f1bcb8f7b3b6e1bf4f7", "score": "0.73455876", "text": "def kStepMaximization(n, k)\n return n if k <= 0 # base case\n \n # available operations: 1) add '1', 2) multiply by 2, 3) 'rotate'\n [\n kStepMaximization(n+1,k-1),\n kStepMaximization(n*2,k-1),\n ...
1d7023f8e37206fc14e5f42525699342
GET /meats/1 GET /meats/1.json
[ { "docid": "aebb07c26dd030bcf1f7d7883ea9fea1", "score": "0.66783017", "text": "def show\n @meats = Meat.find(set_meat)\n end", "title": "" } ]
[ { "docid": "fdd46b75894ef1c67a91a95d929242cb", "score": "0.6939596", "text": "def index\n @goats = Goat.all\n\n render json: @goats\n end", "title": "" }, { "docid": "ec0b23afb9d9bc3fde2779a5d7f8959c", "score": "0.6802622", "text": "def index\n @chats = Chat.all\n render...
c8a84504cfbdeed98e8bc03630a1fcbf
DELETE /herencias/1 DELETE /herencias/1.json
[ { "docid": "647125ebb54c3d84beff3012d8a5a379", "score": "0.7229798", "text": "def destroy\n @herencia.destroy\n respond_to do |format|\n format.html { redirect_to herencias_url, notice: 'Herencia was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "tit...
[ { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.742922", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": "b...
cf25cf4b40737a9654ec807f453e7f05
human readable description of modeling approach
[ { "docid": "7a48e34acefc085f5032deb0f5adae71", "score": "0.0", "text": "def modeler_description\n return \"This energy efficiency measure (EEM) replaces all cooling tower objects in a model of the following types: (OS:CoolingTowerPerformanceCoolTools, OS:CoolingTowerPerformanceYorkCalc, OS:CoolingTo...
[ { "docid": "23c6c36d104147cc2f9b0bbe41f6db81", "score": "0.7360922", "text": "def modeler_description\r\n return \"This model is only applied to heating coil of water system\"\r\n end", "title": "" }, { "docid": "a042ed207268bf5f87441de34032850a", "score": "0.7314063", "text": "d...
2d08623bc73c85e080b97ce66615096e
build a multipart object expects a SwordClient::AtomEntry and a filepath
[ { "docid": "d6bd8eaec4d870249171b03fb3439946", "score": "0.7466306", "text": "def initialize(atom, filepath, headers={})\n # create an identifier in the atom object that points to the content part\n uniqueid = \"unique_\" + Time.now.to_i.to_s\n contenttype = \"\"\n atom.object.content = Atom...
[ { "docid": "185021b2bf1445b0753fea7c947a8818", "score": "0.65876275", "text": "def test_multipart\n atom = Deposit::SwordClient::AtomEntry.new\n multi = Deposit::SwordClient::MultiPart.new(atom, \"#{TEST_FIXTURES_DIR}/example.zip\")\n FileUtils.cp(multi.filepath,\"#{TEST_OUTPUT_DIR}/multi.dat\"...
b6ef5db6ae5545f1b3e7759a1b16322e
Makes data files array
[ { "docid": "1372c5be813d5980f8c4a0f0121b5fd5", "score": "0.7090316", "text": "def make_data_files_array(current_file)\n data_files = [\n ConfigData.real_path('default.yml')\n ]\n unless use_template_filename.nil?\n data_files.push use_template_filename\n end\n unle...
[ { "docid": "ea2f4bf6c046b58109868360426deeab", "score": "0.7481623", "text": "def data_files\n data_file_names.map! do |filename|\n Bitcask::DataFile.new filename\n end\n end", "title": "" }, { "docid": "15a0620d5548f18afd62e46458bb8270", "score": "0.69024926", "text": "d...
35112d9ebbc3912324a0900563df61b0
POST /televisions POST /televisions.json
[ { "docid": "4898fc4db897689a7af963f7166bd59e", "score": "0.6624683", "text": "def create\n @television = Television.new(params[:television])\n\n respond_to do |format|\n if @television.save\n format.html { redirect_to @television, notice: 'Television was successfully created.' }\n ...
[ { "docid": "b49133742fa3468e942eef1f3003013e", "score": "0.66540784", "text": "def index\n @televisions = Television.all\n end", "title": "" }, { "docid": "c0e4f2441efa70602b098446922bb2d2", "score": "0.6546961", "text": "def create\n @television = Television.new(television_pa...
84c9fe73878d0999c6b4c71022ed4283
show the embed chart if the id was provided and can be decoded and parsed into hash id base64 encoded string of a hash of parameters
[ { "docid": "4dcaf5317ed68b16b79e45f3cabddd58", "score": "0.6111621", "text": "def embed\n @missing = true\n\n pars = embed_params\n\n sid = pars[:id]\n type = pars[:type]\n is_static = type == \"static\"\n gon.tp = pars[:c]\n\n if sid.present?\n shr = ShortUri.by_sid(sid, is_st...
[ { "docid": "10fa7b183a34580c4d967484c59f6c8c", "score": "0.5884109", "text": "def show\n url = params[:url]\n width = params[:maxwidth] || '100%'\n height = params[:maxheight] || '100%'\n format = request.query_parameters[:format]\n\n if (width =~ /^[0-9]+(%|px)?$/) == nil\n raise Ac...
5759c7036ff8c71945b466d46f0a61f4
POST /rooms POST /rooms.json
[ { "docid": "73f742b4e86e794b698acb3b6b187ce9", "score": "0.0", "text": "def create\n @room = Room.new(:user_id => @user_id,\n :location => parse_location(room_params[:location]),\n :description => room_params[:description],\n :title => room_...
[ { "docid": "0a84b6b8e823caabc880e2a7d35e422c", "score": "0.72660154", "text": "def create\n begin\n url = URI(\"https://bookinn.ngrok.io/rooms\")\n\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n request = Net::HTTP::Post.new(url)\n request[\"Authorization\...
0b76901602c24cc4a1e3705f0f287506
Write a method that doubles each element in an array
[ { "docid": "a3367e8d3f46f89b749ef8a2172754ec", "score": "0.67940974", "text": "def doubler(array)\n array.map do |num|\n num *= 2\n end\n\nend", "title": "" } ]
[ { "docid": "62494d8ee3af7a7e6b06d997af4c9e5b", "score": "0.78794396", "text": "def calculate_doubles(arr)\n arr.map {|a|a*2}\n\nend", "title": "" }, { "docid": "41c4467cac401959398e90755ed13fff", "score": "0.78159004", "text": "def double_array(array)\n array*2\nend", "title"...
59e948d26bc0b47f10042901cb793ec6
Returns a single slide show with slides.
[ { "docid": "d2850286b2568ea97ba1567256f24efa", "score": "0.7037004", "text": "def slide_show(request)\n dashboard_request('GET', '/api/slide-shows/' + request[:slideShowId], request)\n end", "title": "" } ]
[ { "docid": "398e9ec4a2c194d538dc1024fc7afdfb", "score": "0.753674", "text": "def show\n @slideshow = Slideshow.find(params[:id])\n end", "title": "" }, { "docid": "f6d8dbf626d154b99e237d3b410a790e", "score": "0.7444153", "text": "def show\n @slide_show = SlideShow.find(params[...
3c0f75bf550881203d429975e2cf7b31
PUT /facultytitles/1 PUT /facultytitles/1.json
[ { "docid": "cdecbee101e2a81dd9c279447ce2c632", "score": "0.72561496", "text": "def update\n @facultytitle = Facultytitle.find(params[:id])\n\n respond_to do |format|\n if @facultytitle.update_attributes(params[:facultytitle])\n format.html { redirect_to facultytitles_path, notice: 'Fac...
[ { "docid": "ed5a015312c2d48fa62408da3996c599", "score": "0.6430122", "text": "def update\n respond_to do |format|\n if @teachers_title.update(teachers_title_params)\n format.html { redirect_to @teachers_title, notice: 'Teachers title was successfully updated.' }\n format.json { ren...
acd38e3dc664b9666f435236eec531e3
Revise the positioning of communication entry This is used to reorder a communictation entry within a communication map. This API is deprecated. Please use the following API instead. POST /infra/domains/domainid/securitypolicies/securitypolicyid/rules/ruleid?action&x3D;revise
[ { "docid": "ca584f7bbff9610ac5f841310ec25b15", "score": "0.6282433", "text": "def revise_communication_entry_revise_with_http_info(domain_id, communication_map_id, communication_entry_id, communication_entry, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Cal...
[ { "docid": "b34b40ca3c85c76783fd20e66cadd0fe", "score": "0.65115505", "text": "def revise_communication_entry_revise(domain_id, communication_map_id, communication_entry_id, communication_entry, opts = {})\n data, _status_code, _headers = revise_communication_entry_revise_with_http_info(domain_id, ...
0f26bcfaa45fb37dabe0878129c3f61d
courtesy of 'thomas' from the comments of _whys blog get in touch if you want a better credit!
[ { "docid": "6122442feeba8331b9b9a35cc2c0006a", "score": "0.0", "text": "def inner_text\n self.children.collect do |child|\n child.is_a?(Hpricot::Text) ? child.content : child.inner_text\n end.join.strip\n end", "title": "" } ]
[ { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.6208728", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.6208728", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",...
2aef334d82ab3f8e616043260a2921ab
GET /albums/new GET /albums/new.json
[ { "docid": "5d78e0d86922e24905eabf6446468104", "score": "0.78135204", "text": "def new\r\n\r\n @album = Album.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @album }\r\n end\r\n end", "title": "" } ]
[ { "docid": "40ba816c438aa98fe4f513957edd2ddc", "score": "0.8189476", "text": "def new\n @album = current_user.albums.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @album }\n end\n end", "title": "" }, { "docid": "e95275e29546b218...
d3a7f15103939af2a455ed2c07be15f5
GET /payment_forms GET /payment_forms.json
[ { "docid": "a76ae43a34e330149c3ba343500ea170", "score": "0.75574327", "text": "def index\n @payment_forms = @paymentService.all()\n end", "title": "" } ]
[ { "docid": "dfdde0858e16e5238314d38aa549ed02", "score": "0.67537254", "text": "def get_forms\n @course = Course.find(params[:course_id])\n @forms = @course.professor_forms\n render json: @forms\n end", "title": "" }, { "docid": "a67bc284a9c4e59e3451cdf010fd064b", "score": "0.66...
7ac6d1dc416b1924694a0df8fe18bf86
Test existence of the function
[ { "docid": "98c55ee3ef10fab0ca90da56bea76c74", "score": "0.0", "text": "def test_humanize_function_added_to_string\n\t\tassert_respond_to \"blah\", :humanize\n\tend", "title": "" } ]
[ { "docid": "a82d74eab5d13b4c1d74ea61f69e6e1f", "score": "0.794418", "text": "def has_function?(function)\n @available.has_function? function\n end", "title": "" }, { "docid": "fa3879634cfbb6e1d918f1f45604f133", "score": "0.76541317", "text": "def function?(name)\n functions....
f546b46a41dd58d56ca3b068aa08c526
Removes the file from medium.
[ { "docid": "2b15c55fc8d5e677423e3c2a6f51f30e", "score": "0.6935001", "text": "def remove!\n FileUtils.remove_file(@path)\n return @path\n end", "title": "" } ]
[ { "docid": "76a0012f6c0b83bc91e3a31d910831eb", "score": "0.78735566", "text": "def remove_file\n File.delete(@file) if File.exist?(@file)\n end", "title": "" }, { "docid": "6b42ad502bcd0042787477d580bfcff4", "score": "0.7804997", "text": "def remove_file\n @ph.remove_fil...
4c5d1b24b35056f5a6d6900e8f765f10
GET /liste_mariages/1 GET /liste_mariages/1.json
[ { "docid": "193f86a406b527c863fb9419a6bc25f1", "score": "0.79725987", "text": "def show\n @liste_mariage = ListeMariage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @liste_mariage }\n end\n end", "title": "" } ]
[ { "docid": "19367ee4ad8e4d4497880ddbb771c753", "score": "0.74895275", "text": "def new\n @liste_mariage = ListeMariage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @liste_mariage }\n end\n end", "title": "" }, { "docid": "4aeecc...
7aa5dfcc2f8257c67fea623dcc801d9b
GET /marriages GET /marriages.json
[ { "docid": "320da09a06b457bb79ae88311f07aac9", "score": "0.744887", "text": "def index\n @marriages = Marriage.all\n end", "title": "" } ]
[ { "docid": "4aeecc8dad109ffc3816ccece393d660", "score": "0.70373476", "text": "def index\n @mars = Mar.all\n render json: @mars\n end", "title": "" }, { "docid": "fdb4d34040885694194268aed7018e3a", "score": "0.6839115", "text": "def show\n render json: @mars\n end", "t...
f91c267cd897fecd3a5109244551f521
methods retreives ansible command
[ { "docid": "f32b50ddb5b0c221097b228dbbef3665", "score": "0.7587867", "text": "def command\n @command ||= begin\n start = ARGV.find_index { | value | value =~ /^ansible/ }\n Shellwords.join( ARGV[ start .. -1 ] )\n end\nend", "title": "" } ]
[ { "docid": "d0914051535d198acf55bf26e2326189", "score": "0.68728876", "text": "def ansible_bin\n @ansible_bin ||= which('ansible-playbook')\nend", "title": "" }, { "docid": "d0914051535d198acf55bf26e2326189", "score": "0.68728876", "text": "def ansible_bin\n @ansible_bin ||= which(...
823eadc23a1bc2d46166e70692ff259b
Is the notification unread?
[ { "docid": "cef49c92fe9c942acb188f9843255fc0", "score": "0.80530584", "text": "def unread?\n !read\n end", "title": "" } ]
[ { "docid": "95e0f0fb2644d4e4b439364cb4c8b703", "score": "0.84621584", "text": "def unread?\n (status == UNREAD)\n end", "title": "" }, { "docid": "5bba87dcdce8882be2581ad529921181", "score": "0.83317304", "text": "def is_unread?\n @is_unread == ISUNREAD_UNREAD\n end", ...
b23aa5dde697a8a9b6747e8039f30ae1
POST /photos POST /photos.json
[ { "docid": "3b3b208a743223f4c0f14cc375b5dd06", "score": "0.0", "text": "def create\n puts \"\\n******* create *******\"\n @photo = Photo.new(photo_params)\n\n if @photo.save\n flash[:success] = \"Your photo has been successfully added!\"\n @photo.update(user_id: current_user)\n ...
[ { "docid": "064d7e5aefffa183a4ade6bf3e3e955c", "score": "0.7361035", "text": "def create\n @photos = Photo.new(photos_params)\n if @photos.save\n render json: { id: @photos.id, url: @photos.gallery.url,\n size: @photos.gallery_file_size }\n else\n render json: { id...
4733cb37a29b80e2e7f16ba5f91e43e4
GET /episodes/1 GET /episodes/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "1f3760c83aceee6619f89577d0441e53", "score": "0.82000494", "text": "def show\n @episode = series.episodes.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @episode }\n end\n end", "title": "" }, { "docid": ...