query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
39d0bd2af13d3cf0f5119f81fe7c7354
Add Item from Inventory
[ { "docid": "1f22109127c5c8636791da59debc167e", "score": "0.0", "text": "def item_add item\n\t\t\t## Add Item by key of Item's classname as symbol\n\t\t\titem.belongs_to = self\n\t\t\treturn (@items[item.class.name.split('::').last.to_sym] = item)\n\t\tend", "title": "" } ]
[ { "docid": "9a93655d4fda6a92f3536d5668c5734b", "score": "0.83087474", "text": "def add_item(item)\n\t\t@inventory.push(item)\n\tend", "title": "" }, { "docid": "80b20dbe7295deecf0f6e45c7d1cb533", "score": "0.8246109", "text": "def pick_up_item(item)\n @inventory << item\n end", ...
1417fe1600604bfd12b37e62bca4becd
GET /broadcasts/1 GET /broadcasts/1.xml
[ { "docid": "01d6492bb91d24290365cfa91436ff33", "score": "0.6051761", "text": "def show\n @broadcast = Broadcast.find(params[:id])\n @broadcast.hits.create\n\n add_crumb(@broadcast.title)\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @broadc...
[ { "docid": "b026f10712ae0f0e1f069b3ee557585d", "score": "0.73084784", "text": "def get_broadcasts uri\n begin\n response = RestClient.get(uri)\n broadcasts = []\n JSON.parse(response)['schedule']['day']['broadcasts'].each do |json|\n broadcasts << Broadcast.new(json['programme']...
29075f856578f60d301bb17a7c13a89b
assign 0 if the input is nil or empty
[ { "docid": "03bffc3847e8852e2b52bc16fd8ec58a", "score": "0.0", "text": "def assign(match_string)\n !match_string.blank? ? match_string : 0\n end", "title": "" } ]
[ { "docid": "bdae7f1451845a364fcb575ce3233cb5", "score": "0.7258513", "text": "def zero?; end", "title": "" }, { "docid": "bdae7f1451845a364fcb575ce3233cb5", "score": "0.7258513", "text": "def zero?; end", "title": "" }, { "docid": "743c782288c1d151c2fcb75a040c50b2", "...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "c459d593ea59a599e5c41b3f3a4a25cf", "score": "0.0", "text": "def set_inventory\n @inventory = Inventory.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...
5e9c04165a7ad2284e32440d6d8e69db
GET /itinerary_types GET /itinerary_types.json
[ { "docid": "550947aa30f31e95380844a826f3cbcd", "score": "0.7525469", "text": "def index\n @itinerary_types = ItineraryType.all\n end", "title": "" } ]
[ { "docid": "1b77431c6d1997cf5f09ac97fbe60589", "score": "0.6857394", "text": "def types\n @types = Tournament.tournament_types.keys.to_a\n respond_to do |format|\n format.json { render json: @types }\n end\n end", "title": "" }, { "docid": "a0dce3ac5ebd1ca4bfb09f1f3f332f6d", ...
2c606174cf2b4381ce831aab46fca911
Iterate over all the files in the project and extract annotations from the those files. Returns the results as a hash for display.
[ { "docid": "375c2048cff94765d991e42e6bcf9d35", "score": "0.60053045", "text": "def find\n results = {}\n rgxp = %r/(#{tag}):?\\s*(.*?)(?:\\s*(?:-?%>|\\*+\\/))?$/o\n\n extensions = config.notes.extensions.dup\n exclude = if config.notes.exclude.empty? then nil\n else Regexp.new(c...
[ { "docid": "c0eb66b01713b052078585c43d6d332a", "score": "0.65606236", "text": "def extract_annotations_from(file, pattern); end", "title": "" }, { "docid": "83111bfb3f73eae6cc43c952839cf3bc", "score": "0.5905641", "text": "def annotations\n @occurrences.map(&:annotations).flatte...
39ad536ec489da391a927a3a827e5a11
Updates the Spotify access and refresh tokens for the given User. Returns true on success, false or nil on error.
[ { "docid": "4dfb539a8f48d4cbc83877d7ea4d124f", "score": "0.6851462", "text": "def update_spotify_tokens\n tokens = SpotifyApi.refresh_tokens(spotify_refresh_token)\n\n if tokens\n self.spotify_access_token = tokens['access_token']\n self.spotify_refresh_token = tokens['refresh_token']\n ...
[ { "docid": "cb04a26a599068cf976527f6be019bd5", "score": "0.6324862", "text": "def update_user_token\n if user_signed_in?\n Session.active_sessions.find_by(id: request.headers['sid'], utoken: request.headers['utoken']).update(last_used_at: Time.zone.now)\n end\n end", "title": "" }, {...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "dcb516bfa249012d05431156e3fad6a3", "score": "0.0", "text": "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\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...
d6ea6d5ad8c71bb58e29923d147f1816
puts encrypt(password) Decrypt Get the index of each letter of encrypted string
[ { "docid": "1b1c3a7af350ce8e09e1847cd82c82af", "score": "0.79390556", "text": "def decrypt(password)\r\n# Store letter at index - 1 from the alphabet\r\n index = 0\r\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\r\n decrypted = \"\"\r\n while index < password.length\r\n letter = password[index]\r\n...
[ { "docid": "cfa23d3101387b13e12db9e540fba398", "score": "0.8185025", "text": "def decrypt(password)\n index = 0\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n while index < password.length\n letters = password[index]\n number = alphabet.index(letters)\n new_number = number - 1\n password[index] = ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "fa1982e3d565b66a6976e09e82f5c167", "score": "0.0", "text": "def blog_params\n params.require(:blog).permit(:title, :category, :description, :body_text, :image, :slug, :bg_im_1, :bg_im_2, :bg_im_3, :bg_im_4, :bg_im_5, :bg_im_6, :bg_im_7, :bg_im_8, :im_1_des, :im_2_des, :im_3_des, :im_4_d...
[ { "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...
f98e18a5dcba93890947d055cb686122
DELETE /cached_results/1 DELETE /cached_results/1.json
[ { "docid": "086412b880a7ada1daef255fb8d7852d", "score": "0.7792201", "text": "def destroy\n @cached_result = CachedResult.find(params[:id])\n @cached_result.destroy\n\n respond_to do |format|\n format.html { redirect_to cached_results_url }\n format.json { head :no_content }\n end\...
[ { "docid": "286acf6ff5d2d691c14ae1cf3b2a0242", "score": "0.68276155", "text": "def destroy\n @cache = Cache.find(params[:id])\n @cache.destroy\n\n respond_to do |format|\n format.html { redirect_to(caches_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { ...
e0c321426dbda32f6c82e6f83e48cddb
Override default inspect for a more concise representation of the object
[ { "docid": "684993857cea46e4f95cec92c571289f", "score": "0.0", "text": "def inspect\n '#<JsonObj>'\n end", "title": "" } ]
[ { "docid": "c4b63c41fda1192a8e330e171732860b", "score": "0.7489821", "text": "def inspect; to_s; end", "title": "" }, { "docid": "c4b63c41fda1192a8e330e171732860b", "score": "0.7489821", "text": "def inspect; to_s; end", "title": "" }, { "docid": "c4b63c41fda1192a8e330e17...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "8da3e00dfd4ec2c8294db9ece2d59970", "score": "0.0", "text": "def set_book\n @book = Book.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;...
afa8a25cf2abccd6e8cf0bb08210f600
changes horizontal alignment of cell
[ { "docid": "bfc05aebc6706341c4b767a451d4c154", "score": "0.70323926", "text": "def change_horizontal_alignment(alignment='center')\n validate_worksheet\n validate_horizontal_alignment(alignment)\n @style_index = modify_alignment(@workbook,@style_index,true,alignment)\n end", "title...
[ { "docid": "000b884094aa540c0dcba203bdcbfbe2", "score": "0.7918561", "text": "def with_alignment(horizontal, vertical)\n @cell.change_horizontal_alignment horizontal\n @cell.change_vertical_alignment vertical\n self\n end", "title": "" }, { "docid": "ff83791c8af80bab07cea834b6ba09d...
db52de28b2dee5acdde9e079f157a023
Return a new height map, created by using the filter parameter on the current height map
[ { "docid": "468959cbc0dd6a321dbbabd418f612f8", "score": "0.83996326", "text": "def filter(filter)\n filtered_height_map = HeightMap.new\n filtered_height_map.load(filter.filter(@data), @size_x)\n filtered_height_map\n end", "title": "" } ]
[ { "docid": "449b59119bdb3dfa35a8b41323068a77", "score": "0.51976603", "text": "def height(pixels)\n filter << \"Size:Height:#{pixels}\"\n self\n end", "title": "" }, { "docid": "c1d73a001776196bfc15bc17afca073a", "score": "0.5108453", "text": "def filterhash\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "518b4fd6ab05bfdf31bf8932b6f7bb00", "score": "0.0", "text": "def set_user\n @user = User.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6164095", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6046031", "text": "def action_hook;...
ecf4725b18ef58885dff34efccc5cb06
PUT /vendor_questionnaire_groups/1 PUT /vendor_questionnaire_groups/1.json
[ { "docid": "ad7b0505c8b8d8f42e6cb7f6b9f5cc97", "score": "0.73032886", "text": "def update\n @vendor_questionnaire_group = VendorQuestionnaireGroup.find(params[:id])\n\n respond_to do |format|\n if @vendor_questionnaire_group.update_attributes(params[:vendor_questionnaire_group])\n form...
[ { "docid": "ef21ffc826361f5cb8d5007245b6a5d1", "score": "0.6568773", "text": "def create\n @vendor_questionnaire_group = VendorQuestionnaireGroup.new(params[:vendor_questionnaire_group])\n\n respond_to do |format|\n if @vendor_questionnaire_group.save\n format.html { redirect_to @vendo...
b7941f92993cad1016c562ccb60af2a0
calculate cost of a single machine only
[ { "docid": "b5e07a43e9821c19aa1c1ed090a1a4b9", "score": "0.7439515", "text": "def machine_cost(machine_id)\n\t\tmachine_ratio= VmType.find(machine_id).ratio\n\t\tunit_value = ServiceType.find_by_name('machine').unit_value\n\t\tif machine_ratio.present? && unit_value.present?\n\t\t\t{ret: \"OK\", data: ...
[ { "docid": "5ac433639ac25a3d1cf7009da4301bc8", "score": "0.7181312", "text": "def total_cost(machine_id, iso_id)\n\t\tmachine_cost = machine_cost(machine_id)\n\t\tiso_ratio = Iso.find(iso_id).ratio\n\t\tif machine_cost[:ret] == \"OK\" && iso_ratio.present?\n\t\t\t{ret: \"OK\", data: machine_cost[:data]*...
d8e2071c62c72f303c3abba6a42c413b
PATCH/PUT /contatti/1 PATCH/PUT /contatti/1.json
[ { "docid": "93fb72a0a906567f5a40322595cf7dae", "score": "0.64626616", "text": "def update\n respond_to do |format|\n if @contatto.update(contatto_params)\n format.html { redirect_to @contatto, notice: 'Contatto was successfully updated.' }\n format.json { render :show, status: :ok,...
[ { "docid": "768a6012c7d5ff856dec69d115bfafcc", "score": "0.68392813", "text": "def update\n @conta = Conta.find(params[:id])\n\n respond_to do |format|\n if @conta.update_attributes(params[:conta])\n format.html { redirect_to @conta, notice: 'Conta was successfully updated.' }\n ...
574ed5d386873517307feb4a2cbaf126
Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.user_mailer.guest_join.subject
[ { "docid": "8dbe4604db27a5010d6eff976181b6af", "score": "0.0", "text": "def guest_join(user)\n @user = user\n\n mail(to: @user.email, subject: 'Your challenge is ready!')\n end", "title": "" } ]
[ { "docid": "ea740e704e8f1173fb87b45dfcaaf989", "score": "0.7600442", "text": "def subject_for(key)\n I18n.t(:subject, scope: [:mailer, key])\n end", "title": "" }, { "docid": "8928fe4f050d7ebd3e9aa992b07e320a", "score": "0.753808", "text": "def subject_for\n ActiveSupport:...
bf553f0e54f4cd20fd39cdfb7dc0a04e
Mocks an invalid object with given error messages
[ { "docid": "94cfa97cec11e5457a1d94e3945461c6", "score": "0.7457593", "text": "def invalid_spy(messages = \"invalid\")\n object = spy\n error = InvalidError.new(object, messages)\n allow(object).to receive(:validate!) { fail error }\n allow(object).to receive(:validate) { Report.new...
[ { "docid": "c332becbce3cbe72c6cff020e1ddd278", "score": "0.6734263", "text": "def invalid(object, message)\n @failures << {\n :object => object,\n :message => message\n }\n end", "title": "" }, { "docid": "61648763f1341b3c8668836cce55c9e0", ...
e7494d1a2aa24e3bacfc6f7faf7ab6eb
Create new connection between BeaconCtrl and Client
[ { "docid": "cbe903536bc51982c9fec9ac86d22e33", "score": "0.6893542", "text": "def connect!(user=nil)\n @@client = ::BeaconClient::Client.new(user || BeaconClient.config.user)\n end", "title": "" } ]
[ { "docid": "c1666acf7f0a2c73b06cbe3409f68e8e", "score": "0.7154972", "text": "def create_bt_client_connect\n $testCaseID = \"VT229-0453\"\n $server_name = @params['device_name']\n Rho::BluetoothManager.create_client_connection_to_device($server_name, url_for(:action => :create_bt_callback1))\n ...
82c30b381d335d486b20f4641eb56a4a
In addition to the usual database options, the following options have an effect: :command_timeout :: Sets the time in seconds to wait while attempting to execute a command before cancelling the attempt and generating an error. Specifically, it sets the ADO CommandTimeout property. If this property is not set, the defau...
[ { "docid": "365e0b551d426ed687769affa0e6f5c7", "score": "0.5577227", "text": "def connect(server)\n opts = server_opts(server)\n s = opts[:conn_string] || \"driver=#{opts[:driver]};server=#{opts[:host]};database=#{opts[:database]}#{\";uid=#{opts[:user]};pwd=#{opts[:password]}\" if opts[:us...
[ { "docid": "0c9b067169538eed7e16b1b7a66cb632", "score": "0.6362218", "text": "def execute_command(sql_statement)\r\n # Create an instance of an ADO COmmand\r\n command = WIN32OLE.new('ADODB.Command')\r\n \r\n # Execute the SQL statement using the existing ADO connection\r\n command.Active...
fdcd2823c33e000560629ee95e17bd02
This is a nice little helper method I added to help with performance tests. The basic use is as follows: all test setup ... ... results = benchmark do trigger action you want to time (eg: post :visits) end results[:mean].should be <= your time restriction Optionally the you can specify a number of samples other than th...
[ { "docid": "c44220bb53a683581f5ece30a36b1404", "score": "0.618288", "text": "def benchmark(number_of_samples = 100, disable_garbage_collection = false, &blk)\n elapsed_realtime = nil\n begin\n sum_of_samples = 0\n samples = []\n sample_variance_sum = 0\n if disable_garbage_collection\n ...
[ { "docid": "171abde0e87275d4f5d6bb3e812da47b", "score": "0.74677914", "text": "def bench_performance\n if ENV['BENCH']\n validation = lambda { |ranges, times|\n count_per_second = ranges.last / times.last.to_f\n assert count_per_second > 100_000, 'Count per second: %.2f' % count_pe...
4ed7613d63f841705972b9689e7ac42a
delete collection of LimitRange
[ { "docid": "e4273c3f9e83cee4d147fa368a614201", "score": "0.5682244", "text": "def delete_collection_namespaced_limit_range_with_http_info(namespace, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CoreV1Api.delete_collection_namespaced_limit_rang...
[ { "docid": "9d540c850f82f6c88061b5ee1a9e3259", "score": "0.6984351", "text": "def remove(range); end", "title": "" }, { "docid": "9d540c850f82f6c88061b5ee1a9e3259", "score": "0.6984351", "text": "def remove(range); end", "title": "" }, { "docid": "10149fcd067541d4b83cf838...
c70fffdf12d341bcf1b29d000c3702df
GET /events/1 GET /events/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "aa321cb61c328d7641f0ffee4f6e0b70", "score": "0.75029767", "text": "def show\n @event = Event.find(params[:id])\n render json: @event\n end", "title": "" }, { "docid": "64b8f8ad44f7b6e6250a9fc54b79647c", "score": "0.74019474", "text": "def get(event_id)\n @clie...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "51fe33621f962c1a30227a061fde5a9d", "score": "0.0", "text": "def question_params\n params.require(:question).permit(:content, :answer)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74959", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6957448", "text": "def strong_params\n params.require(:request).permit(param_whiteli...
c9af1a440b2c4b45de5998c2744cc3c7
GET /leagues/fantasy GET /leagues/fantasy.json
[ { "docid": "9c083253341f9ee883a5d97ceef0d50a", "score": "0.7080213", "text": "def index\n\t\t@leagues = Fantasy.where(private_access: false, active: true, published: true, full:false, locked:false)\n\t\trender json: @leagues\n\tend", "title": "" } ]
[ { "docid": "bddab64516c5c5a635fd8631dfc3a195", "score": "0.6895869", "text": "def index\n @leagues = @sport.leagues\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @leagues }\n end\n end", "title": "" }, { "docid": "cabb737b7fb835c0c...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "2265e5537fbfd9bbc3e75e72a6278661", "score": "0.0", "text": "def upload_file_to_server_params\n params.require(:upload_file_to_server).permit(:email, :filename)\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...
99da035901b1bd314932952224717e78
Converts requester email to all lowercase.
[ { "docid": "09e2aa55a86468673705f647103a9cc1", "score": "0.8477988", "text": "def downcase_email\n self.requester_email = requester_email.downcase\n end", "title": "" } ]
[ { "docid": "2b2c0688ba3acfcff4c2f18ffcd0d792", "score": "0.8181086", "text": "def normalize_email\n self.email.downcase!\n end", "title": "" }, { "docid": "61c6f9455ec34c2acd15663a017f23dc", "score": "0.8074938", "text": "def downcase_email\n email.downcase!\n e...
5ff43a4e439664f209cf3cfaeac2fae4
GET /courses/new GET /courses/new.json
[ { "docid": "17e9f540fa738a14415716a1a154a921", "score": "0.0", "text": "def new\n @course = Course.new\n @mallas = CourseOutline.all\n @semesters = [\"Primer\", 1], [\"Segundo\", 2], [\"Tercer\", 3], [\"Cuarto\", 4], [\"Quinto\", 5], [\"Sexto\", 6], [\"Séptimo\", 7], [\"Octavo\", 8], [\"Noveno\...
[ { "docid": "1b50ac6e30de4bdfff2cc64c482eba43", "score": "0.8398613", "text": "def new\n track \"new course page\"\n @course = current_user.courses.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end", "title": "" }, ...
2a25a7544fbc8c1c105eb20cde9ba739
PUT /shopping_items/1 PUT /shopping_items/1.xml
[ { "docid": "86062b695963ddff54067c924df27a45", "score": "0.6843295", "text": "def update\n @shopping_item = ShoppingItem.find(params[:id])\n\n respond_to do |format|\n if @shopping_item.update_attributes(params[:shopping_item])\n format.html { redirect_to(@shopping_item, :notice => 'Sh...
[ { "docid": "4de8d067c151eda0c5d4fabee90dd31d", "score": "0.6731781", "text": "def update_rest\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n flash[:notice] = 'Item was successfully updated.'\n format.html { redirect_to(@...
268170efc0d51caaf4e680e6421e21ff
GET /datatable_dataelements/1 GET /datatable_dataelements/1.json
[ { "docid": "917d03d68e488611db757c437ddfdb88", "score": "0.7308272", "text": "def show\n @datatable_dataelement = DatatableDataelement.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @datatable_dataelement }\n end\n end", "t...
[ { "docid": "e788e42b7089e2c0ff8ba1ec3e72afb4", "score": "0.66902965", "text": "def index\n @data_tables = DataTable.all\n\n # respond_to do |format|\n # format.html # index.html.erb\n # format.json { render json: @data_tables.as_json(only: [:title, :username, :name, :email, :hometown]) }...
8eb64a3d7de87be4e20eb2de8237335b
Get XRP (Ripple) Address Details Through this endpoint the customer can receive basic information about a given XRP address based on confirmed/synced blocks only. In the case where there are any incoming or outgoing unconfirmed transactions for the specific address, they will not be counted or calculated here. Since XR...
[ { "docid": "3ec2bfc823fa9b802b19a2a7f1a82636", "score": "0.6565936", "text": "def get_xrp__ripple_address_details(network, address, opts = {})\n data, _status_code, _headers = get_xrp__ripple_address_details_with_http_info(network, address, opts)\n data\n end", "title": "" } ]
[ { "docid": "d8a800920bbce29f2c59cd28d15c72b8", "score": "0.6257039", "text": "def address\n self.response = self.class.get(\"#{patron_url}/patronInformation/address\")\n raise_error_if(\"Error getting patron address through Aleph REST APIs.\") {\n (response.parsed_response[\"get_p...
64b094a043452ebbb65282aa80446f03
Method Name: publisher_handset_model Purpose:this method to construct publisher handset chart Version: 1.0 Author:Md Shujauddeen A Last Modified: 07Oct2009 by Md Shujauddeen Notes: None.
[ { "docid": "3d98d8de2ee5ad06059f208dd96669ca", "score": "0.5059345", "text": "def publisher_handset_model\n begin\n @aes = AESSecurity.new() #creating an object for AES Security\n if (session[:user_id]==nil)\n flash[:notice]=\"Your session has expired....
[ { "docid": "906022a80d7d2b09b977e1d8f2f5b4a2", "score": "0.5505882", "text": "def as_hqmf_model\n json = {\n \"id\" => self.measure_id,\n \"title\" => self.title,\n \"description\" => self.description,\n \"population_criteria\" => self.population_criteria,\n \"data_criteria\"...
3d62191e6f41ff875fedb87153ff817c
Whether the host is unknown or not
[ { "docid": "cb2939f5c0b4f551d18c40187a506d0b", "score": "0.0", "text": "def true(argvs)\n return nil unless argvs\n return nil unless argvs.is_a? Sisimai::Data\n return true if argvs.reason == Sisimai::Reason::HostUnknown.text\n\n require 'sisimai/smtp/status'\n ...
[ { "docid": "fe4fadab58416202e7226a2bc0f6d7eb", "score": "0.89723593", "text": "def unknown?(host)\n host_state(host) == :unknown\n end", "title": "" }, { "docid": "2c94d74e4ef1e3b9fdc8345fe9e787bb", "score": "0.78519166", "text": "def valid_remote_host?(host)\n false\n end", ...
094813dc6f63b42bbf345885e49db63a
Creates a new Choice using all arguments. A block may be provided to specify semantic behavior (via ext).
[ { "docid": "4dfbb6965fc8a857a71822e9a6e94c58", "score": "0.62932485", "text": "def any(*args, &block)\n ext(Choice.new(args), block)\n end", "title": "" } ]
[ { "docid": "c82c0b7b078643e2edaaa267a45f0647", "score": "0.67086524", "text": "def choice_answer(*args, &block)\n if args.first.is_a?(Hash) # no question text\n q = MultipleChoice.new('',*args)\n else\n text = args.shift\n q = MultipleChoice.new(text, *args)\n end\n q.instance...
f6adc8757658187f2d284aece46e6a2f
If you pass old events OR users with old date attributes (i.e. create_date for an old users), leanplum will mark them 'anomalous' and exclude them from your data set. Calling this method after you pass old events will fix that for all events for the specified user_id For some reason this API feature requires the develo...
[ { "docid": "bc3f88a96863f97b95e6310a26293a56", "score": "0.61283964", "text": "def reset_anomalous_users(user_ids)\n user_ids = Array.wrap(user_ids)\n request_data = user_ids.map { |user_id| { action: 'setUserAttributes', resetAnomalies: true, userId: user_id } }\n development_connection....
[ { "docid": "5bbb5d08c959d30e400271589155376c", "score": "0.66971976", "text": "def force_anomalous_override(responses, events)\n user_ids_to_reset = []\n\n responses.each_with_index do |indicator, i|\n # This condition should be:\n # if indicator['warning'] && indicator['warning'...
d1164bbd9f2799b7a559e44cd5661a99
GET /order_books/1 GET /order_books/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "1db326bd77986e5e5e25a286752c1188", "score": "0.7884536", "text": "def order_book(params = {})\n request(:get, '/order_book', params)\n end", "title": "" }, { "docid": "61bc3948ed991bb9dddd1d8035760c2d", "score": "0.7788461", "text": "def getbooksjson\n\n @custo...
7aafd5f68a90377c0ab8b50974792888
PUT /category_assignments/1 PUT /category_assignments/1.xml
[ { "docid": "7780494d02176e9a6b627e3f5d5857d5", "score": "0.63938344", "text": "def update\n @category_assignment = CategoryAssignment.find(params[:id])\n\n respond_to do |format|\n if @category_assignment.update_attributes(params[:category_assignment])\n flash[:notice] = 'Category Assi...
[ { "docid": "a0583fa91962c6ab0f810092b49b36ad", "score": "0.6391567", "text": "def update\n @assignment = @question.assignments.find(params[:id])\n\n respond_to do |format|\n if @assignment.update_attributes(params[:assignment])\n format.html { redirect_to([@question, @assignment], :not...
abea672ea902291d75a97580f25092cc
Return the creation time.
[ { "docid": "767fa3f3e0ec936fc3f3782e6535650d", "score": "0.8371459", "text": "def creation_date\n puts 'creation_date'\n Time.now\n end", "title": "" } ]
[ { "docid": "dd5bdf42735c2aa3473c321276a82cf2", "score": "0.8974075", "text": "def creation_time\n @creation_time\n end", "title": "" }, { "docid": "dd5bdf42735c2aa3473c321276a82cf2", "score": "0.8973895", "text": "def creation_time\n @creation_time\n end", "title"...
560b6f8c9a12d573553a61f8b841edd2
display method will print out a "pretty" board to the console
[ { "docid": "b7049a40e713277f50e7fe875ae2774e", "score": "0.0", "text": "def display\n puts \"Random Call: #{@call_column}, #{@call_number}\"\n puts \"\\n\"\n p \"B I N G O\"\n puts self.check.map { |block| puts block.inspect }\n end", "title": "" } ]
[ { "docid": "9d163e95d37180ff97bc0d35aff5d290", "score": "0.85119766", "text": "def display_board\n puts \" #{@board[0]} | #{@board[1]} | #{@board[2]} \"\n puts \"-----------\"\n puts \" #{@board[3]} | #{@board[4]} | #{@board[5]} \"\n puts \"-----------\"\n puts \" #{@board[6]} |...
4e4c1fad8b3c3a6d2d9a3ceb88053146
Handles majority of input and output
[ { "docid": "e3bac329f5238ab17d3e0314af481ce6", "score": "0.0", "text": "def main_menu\n options = [\"Balance\", \"Deposit\", \"Withdraw\", \"History\", \"Quit\"]\n quit = false\n while !quit\n puts \"Welcome to the banking app. What would you like to do?\"...
[ { "docid": "5d771f0f337eb23e7092aaadb1e37999", "score": "0.6554255", "text": "def input; end", "title": "" }, { "docid": "5d771f0f337eb23e7092aaadb1e37999", "score": "0.6554255", "text": "def input; end", "title": "" }, { "docid": "5d771f0f337eb23e7092aaadb1e37999", "...
3d1b72cce69be31fcca9d12e4572d542
aruba defaults to using 'tmp/aruba'
[ { "docid": "78310a19825d344db32b8e77e1f35698", "score": "0.5827853", "text": "def in_aruba_dir(file_dir)\n dir = File.dirname(file_dir)\n working_dir = File.join(ARUBA_DIR, dir)\n\n Dir.chdir working_dir do\n yield\n end\nend", "title": "" } ]
[ { "docid": "6c8a2f02419f78ffe9ddb7c4fce09074", "score": "0.5511805", "text": "def whereami() [__FILE__] end", "title": "" }, { "docid": "447a14575c5907d1da11cb367bc87323", "score": "0.5475038", "text": "def pre_configure\n super\n @path ||= \"#{ENV['HOME']}/backups\"\n ...
c8f0a10f4bbf30e4c7bb0a51cd8297c1
a view of the maintenance page for development
[ { "docid": "3798ad4c4777ff911b87c83c61594ac5", "score": "0.7064023", "text": "def maintenance\n render action: \"maintenance\", layout: false\n end", "title": "" } ]
[ { "docid": "19422e1e3f8c67cf23e1a815e320b4af", "score": "0.7451078", "text": "def show_maintenance\n f = File.open MAINTENANCE_PAGE, 'wb'\n haml_maintenance = Haml::Engine.new File.read(\"#{RAILS_ROOT}/public/maintenance.haml\")\n f.write haml_maintenance.to_html\n f.close\n end", "titl...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "b55bb0bcca931a39440a4c6a998be283", "score": "0.0", "text": "def set_order\n @order = Order.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...
7a871e1c5c1b12aa04af7cdf934ed85c
PATCH/PUT /body_colors/1 PATCH/PUT /body_colors/1.json
[ { "docid": "cf13a1fd7c421b3939d6713efeb64b4a", "score": "0.7645686", "text": "def update\n respond_to do |format|\n if @body_color.update(body_color_params)\n format.html { redirect_to @body_color, notice: 'Body color was successfully updated.' }\n format.json { render :show, statu...
[ { "docid": "b3dd073938b8b5857cc5f4c138281107", "score": "0.7241953", "text": "def update\n respond_to do |format|\n require 'rest-client'\n response = RestClient.put('localhost:3001/colores/'+@color.id.to_s, color_params.as_json, {:Authorization => 'admin irizREhyoG6Ejwr4AcjsQME9'})\n ...
6fbb6c05ca0c6bdae5e8f1d8a19ba7f3
++ scan JSON file
[ { "docid": "435a42356029905de553ec5828737ea1", "score": "0.0", "text": "def test_c\n td = \n (TimeDuration.new(){\n map = Sumo::SumoMap.new() ;\n map.loadJsonFile(SampleJsonFile, :private) ;\n p [:mapLength, map.edgeTable.size, map.laneTable.size,\n ...
[ { "docid": "6f76f1ddfc895dd0eac7ae4b0b135530", "score": "0.8023693", "text": "def scanJsonFromFile(file)\n open(file,\"r\"){|strm| scanJsonFromStream(strm) ; }\n end", "title": "" }, { "docid": "d048d03b67db95184a14157c359bdb8a", "score": "0.74307287", "text": "def scanJson(json)...
4adf50c751dd51efc09af5a0da0b598c
Return => Array of player Hashes
[ { "docid": "e74a08b1fd3cd982eb80f8314717dfca", "score": "0.72774804", "text": "def all_players\n home_players = game_hash[:home][:players] # Array of player Hashes\n away_players = game_hash[:away][:players] # Array of player Hashes\n home_players + away_players # Array of player Hashes\nend", "t...
[ { "docid": "bfd5673a95440407394182f21a2316f0", "score": "0.75814635", "text": "def players\n # players_array = []\n # iterating through game hash and returning a list of all my players\n game_hash.map do |key, value|\n value[:players]\n end.flatten\n\nend", "title": "" }, { "docid": "...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "6721ee8c8fc7c68d7db5fd0ca8a5f826", "score": "0.0", "text": "def set_product\n @product = Product.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;...
3db3830607cba5c486bd3e9620248118
Allows calling of functions like is_arbitrary_role?
[ { "docid": "7a62c1b7857cf7b34f5ff6268ac517a6", "score": "0.7119197", "text": "def method_missing(method_id, *args)\n if match = matches_dynamic_role_check?(method_id)\n self.is? match.captures.first\n else\n super\n end\n end", "title": "" } ]
[ { "docid": "18e9f62d0aa3b3927754468135282c54", "score": "0.77433336", "text": "def role?\n true\n end", "title": "" }, { "docid": "3600ba6bde8d22421dd68aeda5e9373d", "score": "0.73785", "text": "def role?(role_arg)\n return role_arg.to_s == self.role.downcase\n end", "tit...
8e7b13129d57ae01323a796ac76f9e37
GET /complaints/1 GET /complaints/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "362dad29e24fddde02abc845e1f86569", "score": "0.7005425", "text": "def show\n @breadcrumb = 'read'\n @complaint_status = ComplaintStatus.find(params[:id])\n @complaints = @complaint_status.complaints.by_no\n\n respond_to do |format|\n format.html # show.html.erb\n ...
78a0be2bb96a7f9149360a2cb10da7e4
GET /patina GET /patina.json
[ { "docid": "9d5380bfd9f7e4f254f97bbebc74fd5f", "score": "0.7253157", "text": "def patina\n sectors = Sector.where(user: current_user).load\n subsectors = Subsector.where(sector_id: sectors.map(&:id)).group_by(&:sector_id)\n activities = Activity.where(subsector_id: subsectors.values.flatten.map...
[ { "docid": "dfb72f8d35b995f26b9db63e681ced73", "score": "0.689803", "text": "def show\n @patrocinio = Patrocinio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @patrocinio }\n end\n end", "title": "" }, { "docid": "...
abf2780d24de8ba9bd7de78882030975
GET /capital_projects GET /capital_projects.json
[ { "docid": "6f8a81019010c5d12ea107d9cd336fcb", "score": "0.0", "text": "def index\n weather_details\n @capital_project = CapitalProject.new\n @capital_projects = CapitalProject.all.order(id: :asc).paginate(page: params[:page],per_page: 15).includes(:departmental_sdbip,:mscore_classification,sub...
[ { "docid": "dc8505687156cb859adc07f1e0435407", "score": "0.79475397", "text": "def projects\n return get(\"/projects/list\")\n end", "title": "" }, { "docid": "e5cff083faf736771900db26645e7ffe", "score": "0.7786552", "text": "def get_projects\n self.class.get(\"/projects.jso...
45d7d9bf4cddb0b1c8c9c8f8b61c33e6
Commit hash File name First line Last line
[ { "docid": "81844a28bf238fdef0b0291e26f260c0", "score": "0.0", "text": "def create\n @repo = GitRepository.create(path: '/a/path')\n @commit = GitCommit.create(object_hash: params[:hash], git_repository: @repo)\n respond_to do |format|\n format.html { render html: @commit.object_hash }\n ...
[ { "docid": "c1e1724b7012a747b05e2dc0ddd8ed97", "score": "0.5995491", "text": "def git_commit\n init_structure\n sha = add_all_changes_to_git\n \n if self.attributes.has_key?(\"version\") \n self.version = sha\n self.connection.update(\"UPDATE #{self.class.ta...
99dff10018424cb6dc4bb6116cb03e47
Perform a HTTP GET request.
[ { "docid": "0e1b604371e864649f79ea1c2bf1ca4a", "score": "0.78356934", "text": "def get(opts = {})\n http_request(opts, :get)\n end", "title": "" } ]
[ { "docid": "20b4e8b9540e745812db41d5d6cfa0a0", "score": "0.8260999", "text": "def request_get(path)\n request(Net::HTTP::Get.new(path))\n end", "title": "" }, { "docid": "05a1e2ea8c7f5a0247a3adb18c9a6b39", "score": "0.81243056", "text": "def make_get_request\n\t\tpath = self....
2dbd4b1b5f7e87a7e4aed6fd89661265
send trial expiry reminder 1 day before expiry set trial_expiry_reminder_two_sent to Date.today
[ { "docid": "92617cfcf4a2596ccbf4cfcd3601a581", "score": "0.87674665", "text": "def send_trial_expiry_reminder_two\n BookingMailer.send_expiry_reminder_two(self).deliver_later\n # set date so email doesn't get send again\n self.trial_expiry_reminder_two_sent = Date.today\n save!\n end", ...
[ { "docid": "189cbe05eb2a306ce68eac4908ddc856", "score": "0.86253935", "text": "def send_trial_expiry_reminder_one\n BookingMailer.send_expiry_reminder_one(self).deliver_later\n # set date so email doesn't get send again\n self.trial_expiry_reminder_one_sent = Date.today\n save!\n end", ...
5d2ead85bb1449fe540ccbed90864ff2
Returns information about a specific subscription.
[ { "docid": "24a13064ce53cc520ccb86c62a472c4c", "score": "0.62435967", "text": "def get_by_guid(guid)\n HttpClient::Preconditions.assert_class('guid', guid, String)\n @client.request(\"/subscriptions/#{guid}\").get { |hash| Apidoc::Models::Subscription.new(hash) }\n end", "title": ...
[ { "docid": "a3b30bd85b54cdec5b65615e44c06f62", "score": "0.8531702", "text": "def subscription_info(subscription_id = @subscription_id)\n url = url_with_api_version(@base_url, 'subscriptions', subscription_id)\n resp = rest_get(url)\n JSON.parse(resp.body)\n end", "title": ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "c488614962b64e66332974bedb9dddbe", "score": "0.0", "text": "def set_uni\n @uni = Uni.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60310465", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60152966", "text": "d...
a99ce578b82ed09bfa6f747efb5e1c72
No more required encode return the field length for upper codec layer def get_length(field)
[ { "docid": "abd30f8965db6e1797358af56b2b7fa7", "score": "0.0", "text": "def check_length(buf,length)\n\t raise \"Length is nil\" if length.nil?\n if(length != 0)\n\t if buf.length < length\n\t raise BufferUnderflow, \"Not enough data for decoding (#{length}/#{buf.length})\"\n\t ...
[ { "docid": "819b5bd3b9cf8affda8dcfe33332c085", "score": "0.7762808", "text": "def get_len(field_info=nil)\r\n if field_info.nil?\r\n @raw_io.read(4).unpack('I')[0]\r\n else\r\n field_info[:max_length]\r\n end\r\n end", "title": "" }, { "docid": "1716a84a29f10e040631fe0173...
ff036e527dd5f72174256e6cb8031a68
confirms a loggedin product
[ { "docid": "f798621f096b4164d5f5a3e013408845", "score": "0.0", "text": "def logged_in_user\n unless logged_in?\n store_location\n flash[:danger] = 'Please log in.'\n redirect_to login_url\n end\n end", "title": "" } ]
[ { "docid": "ff9bbf3211799c97b5bcccc9cfaf442e", "score": "0.6942914", "text": "def confirm_purchase\n\t\tif current_user.nil? and params[:user_id] == '-1'\n\t\t\tputs 'User ID doesnt exists, routing to make user register'\n\t\t\tredirect_to :controller=>'users',:action=>'product_user_prompt', :layout=>fa...
dfff5351c76f64467e729272d6071645
Execute the file through the REPL loop, noninteractively.
[ { "docid": "dc0de63afaddd6c17804ff143ff246e1", "score": "0.0", "text": "def load_file_through_repl(file_name); end", "title": "" } ]
[ { "docid": "1c24a81737d4009146f3f728d6073244", "score": "0.67030925", "text": "def run(file)\n # ...\n end", "title": "" }, { "docid": "2d9d65f6bc54dc081737b787093eb43c", "score": "0.6689571", "text": "def run(filename)\n # This is possibly the most evil Ruby I've writte...
d4bd7417026962f72b070e283d781b45
by Daniel Shiffman. Mouse horizontal location controls size of dots. Creates a simple pointillist effect using ellipses colored according to pixels in an image.
[ { "docid": "f6c1fc69039685f29feceeda71ebb105", "score": "0.48247537", "text": "def setup\n size 400, 400\n @a = load_image 'eames.jpg'\n no_stroke\n background 255\n smooth\nend", "title": "" } ]
[ { "docid": "9a20f159e182e21282610a4474dc3e18", "score": "0.569501", "text": "def line_xiaolin_wu(x0, y0, x1, y1, color)\n y0, y1, x0, x1 = y1, y0, x1, x0 if y0 > y1\n dx = x1 - x0\n sx = dx < 0 ? -1 : 1\n dx *= sx\n dy = y1 - y0\n \n if dy == 0 # vertical...
926873e6cb8b80a972780d8f1239d557
Set the expiration for a key as a UNIX timestamp. source://redis//lib/redis/distributed.rb129
[ { "docid": "36b054dfd85413b82c39fa4ae29de056", "score": "0.7677277", "text": "def expireat(key, unix_time, **kwargs); end", "title": "" } ]
[ { "docid": "a064a8db7f580c7dcc3829b196fae85d", "score": "0.7313281", "text": "def expire(key, seconds, nx: T.unsafe(nil), xx: T.unsafe(nil), gt: T.unsafe(nil), lt: T.unsafe(nil)); end", "title": "" }, { "docid": "f007099d92475a370ad52ec5dd65a08e", "score": "0.73092705", "text": "def ...
8d07efde0887286cf790fab5cc887eda
Ensure the given argument is a valid external link template
[ { "docid": "63af7ab0d3ecfe9634f69bcb9f487b02", "score": "0.72696066", "text": "def wf_link_template?(template)\n if template.is_a?(String) &&\n template.start_with?('http://', 'https://')\n return true\n end\n\n raise Wavefront::Exception::InvalidLinkTemplate, template\n ...
[ { "docid": "508417ae6c622963a8a011147999fc64", "score": "0.6344986", "text": "def requires_link?\n @email.include?('{% link %}') ||\n @email.include?('{{ link.')\n end", "title": "" }, { "docid": "a8b2c988a0474eb5383b543a0ff54f2b", "score": "0.6292756", "text": "...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "08b882e74646d7b76225f2ccd9d262ff", "score": "0.0", "text": "def task_params\n params.require(:task).permit(:list_id, :content, :importance, :is_done, :deadline);\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...
9a9a24051e868149cc1dbb9a5134ce0b
Creates a new PrintNode::PrintJob instance.
[ { "docid": "314cb33795eccebdf8d02b77029c9d70", "score": "0.47859523", "text": "def initialize(connection=nil)\n @connection ||= connection || PrintNode::Client.connection\n end", "title": "" } ]
[ { "docid": "c6c373e0f2e6528577753219fd19289c", "score": "0.7534434", "text": "def create_printjob(printjob, options = {})\n hash = printjob.to_hash\n if options\n options.each do |(k, v)|\n hash[k] = v\n end\n end\n JSON.parse('[' + post('/printjobs/', hash).bo...
dd9421250ed0bd022e0fc90554f57f6b
Given hash of attributes, we assign them to InventoryObject object using its public writers
[ { "docid": "4eb422fa871cdcadf3cdb705e29fc216", "score": "0.0", "text": "def assign_attributes(attributes)\n attributes.each do |k, v|\n # We don't want timestamps or resource versions to be overwritten here, since those are driving the conditions\n next if %i[resource_timestamps resou...
[ { "docid": "34399cbfcee31535828d347740380fd2", "score": "0.66522044", "text": "def raw_inventories_attributes=(attributes)\n @raw_inventories ||= []\n attributes.each do |i, inventory_params|\n if inventory_params[\"_destroy\"] == '1' && !inventory_params[\"id\"].nil?\n # Delete record...
5d2303c772714082bfa6ec2736f530c7
Examine what a value actually is and proces it accordingly.
[ { "docid": "5c53e2cce77ef4ef7adc3558e084fcb1", "score": "0.0", "text": "def extract_properties(parent, key, value)\n if value.is_a?(Hash)\n process_hash(key, value)\n elsif value.is_a?(Array)\n process_array(key, value)\n ...
[ { "docid": "92f414a2463d8233c506970254b2c660", "score": "0.76402545", "text": "def process_value(value); end", "title": "" }, { "docid": "f8423f80cb2071b7213f3dc1be3a7e69", "score": "0.688223", "text": "def value_check\n \t@value\n end", "title": "" }, { "docid": "76a12...
5ce9674b9968975c4d3834c45a4b845f
The name of the parameter, with the resource included, suitable for use in a function signature.
[ { "docid": "27636349a0759c7a4e3ce535a34790e9", "score": "0.0", "text": "def name\n [@resource_name, @name].compact.join(\"_\")\n end", "title": "" } ]
[ { "docid": "e53574f466eb834cbdb96c0899386daa", "score": "0.8015689", "text": "def name(param)\n return param\n end", "title": "" }, { "docid": "b290cb6cd5ef1f9dd9193602afd494ac", "score": "0.76019865", "text": "def param_name; end", "title": "" }, { "docid": "97...
06686ced10690cf39004ce66ece9f2cb
Creates the S3Helper objects
[ { "docid": "8c6cda04772c061fc5563c796f5ab33d", "score": "0.0", "text": "def initialize(bucket, options = {})\n raise BlankBucketException.new unless bucket\n @options = options\n\n connect!(bucket)\n end", "title": "" } ]
[ { "docid": "faca202604ef453721ed56aff2a45b80", "score": "0.720363", "text": "def aws_instance_S3_files_create\n bucket = aws_call('aws_S3_bucket_get', name: Rails.configuration.x.aws['s3_bucket_name'])\n if not aws_call('aws_obj_exists?', obj: bucket)\n log \"AWS: creating S3 Bucket '#{Rails....
63e2297a962a92bed426c9bc7d2c7a8d
New method : Setup actions [:action,]
[ { "docid": "57dbfad5e2a0e32466bd9eb0836da323", "score": "0.0", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n ...
[ { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.8016081", "text": "def actions; end", "title": "" }, { "docid": "6c8e66d9523b9fed19975542132c6ee4", "score": "0.77568465", "text": "def add_actions; end", "title": "" }, { "docid": "0e7bdc54b0742aba847fd259af1e9f9...
fa3bcc4380b652aa55d7fb64f0f761c4
TODO find high scoring peers, use bootnodes as fallback
[ { "docid": "34d356511ebf5f149b897832dcf8e733", "score": "0.6219239", "text": "def find_bootnodes(count)\n nodes = @bootnodes.sample(count)\n nodes + find_attempt_peers(count - nodes.size)\n end", "title": "" } ]
[ { "docid": "d1e708a339031e001c412c470520e057", "score": "0.6457305", "text": "def boot(node)\n end", "title": "" }, { "docid": "606df04d80c10b32f0ca957d9803bf28", "score": "0.62406886", "text": "def update_peers; end", "title": "" }, { "docid": "527a18d62f9a0d75b72fe93...
5792d408a798c925601044ba2be16830
My attempt to get a second window going to place history info in a scrolled window widget.
[ { "docid": "0354f3edef1a96030d107a3db178c027", "score": "0.0", "text": "def childWindow\n $window = Gtk::Window.new\n $window.signal_connect(\"delete_event\") do\n false\n end\n\n $table2 = Gtk::Table.new(5,6,true)\n $window.add($table2)\n\n $buttonDelete ...
[ { "docid": "ab68afba9f6c8b29fe5a9cefcf3b2f2a", "score": "0.6044542", "text": "def info_window=(window); @info_window = window; end", "title": "" }, { "docid": "a560df37354365da18d042b96279be43", "score": "0.6001474", "text": "def window_handle; end", "title": "" }, { "doc...
6c774c3b04eac21a3862fb9975258045
OptionParser para parser de datos
[ { "docid": "65fea1a404042ad6e30816f7b0b2db8b", "score": "0.0", "text": "def get_opts\n pwd = Dir.pwd\n options = {}\n OptionParser.new do |opts|\n opts.banner = \"Uso: ./parse.rb [opciones] archivo.xlsx\"\n opts.on( '-h', '--help', 'Muestra esta pantalla' ) do\n puts opts\n exit\n ...
[ { "docid": "8fa23902514bb7740e67b5a7865b0b08", "score": "0.74426806", "text": "def opt_parser; end", "title": "" }, { "docid": "b5ce49b5a2c9556839d13856f49711d3", "score": "0.7334287", "text": "def parse_options(options); end", "title": "" }, { "docid": "29542d5d461129210...
ebc8e5a1e4543f4a43dad94ab55f5459
Search the Metabox indexes. query:: the query to perform. See XXXX for query syntax params:: additional query parameters (see below) The _params_ hash can contain the following values: max: The maximum number of results to return (default is 10) offset: Offset into the query results (for paging; default is 0) sort: ord...
[ { "docid": "2071fcbd143dcb663777fdeeedaa5401", "score": "0.6102985", "text": "def search(query, params=nil)\n u = self.build_uri(\"/items\")\n search_params = get_search_params(u, query, params)\n response = @client.get(u, search_params)\n return response\n \n end", "titl...
[ { "docid": "45af7eac2f36ae980caa9af1e35ff0f8", "score": "0.72410774", "text": "def search(query, params={})\n params = params.merge :Operation => :ItemSearch,\n :Keywords => query\n\n params[:SearchIndex] = configuration.default_search if params[:SearchIndex].nil?\n\...
d17d1df319e4d6981bd9473496b85830
Return all the models as relations to this playground
[ { "docid": "2e3e237463392643f2384a8974511d98", "score": "0.0", "text": "def as_json(request)\n {\n :links => [\n *models.map { |k,v| {:rel => k, :href => request.add_path(k).full_path } },\n {:rel => 'self', :href => request.full_path}\n ]\n }\n end", "title": "" } ]
[ { "docid": "8229fa84781654a15161685427175edf", "score": "0.7372265", "text": "def relations; end", "title": "" }, { "docid": "c819a62e2f2cc685f238e903145155da", "score": "0.7175243", "text": "def relations\n self.class.relations\n end", "title": "" }, { "docid": "...
747794a7a58cea9a04db31380c3fe448
Gets the assignee to the email specified
[ { "docid": "34b10d05f56543e26d47fad86597ad5a", "score": "0.7869046", "text": "def assignee_email\n \tself.assignee.email if self.assignee\n end", "title": "" } ]
[ { "docid": "436114e9149730e4cb2d37e54a3e8814", "score": "0.78331554", "text": "def assignee_email= email\n \tself.assigned_to = User.find_by_email(email).id\n end", "title": "" }, { "docid": "53b6145322b45cbff31f35c97fe7756a", "score": "0.70885277", "text": "def fetch_assignee\n ...
281dbfc0bf96020eea661231f1a3b537
Name of the value, e.g. "Title"
[ { "docid": "5f6ab8697a611924c30003051831a66e", "score": "0.0", "text": "def name()\n @type.name()\n end", "title": "" } ]
[ { "docid": "bdf3c7d1a75208e69583b726ef028ab2", "score": "0.7913238", "text": "def name\n @values['name']\n end", "title": "" }, { "docid": "bdf3c7d1a75208e69583b726ef028ab2", "score": "0.7913238", "text": "def name\n @values['name']\n end", "title"...
150aa23d865ed843ebbfd0ca59981c63
PATCH/PUT /faturas/1 PATCH/PUT /faturas/1.json
[ { "docid": "b7e1bf12fe761ecba7a0f752b33b0666", "score": "0.6532905", "text": "def update\n respond_to do |format|\n if @fatura.update(fatura_params)\n format.html { redirect_to @fatura, notice: 'Fatura was successfully updated.' }\n format.json { render :show, status: :ok, location...
[ { "docid": "84f2d68dc84d9c8be9bb908304afea8f", "score": "0.6458609", "text": "def update\n @servicio = Servicio.find(params[:id])\n\n respond_to do |format|\n if @servicio.update_attributes(params[:servicio])\n format.html { redirect_to @servicio, :notice => 'Servicio was successfully ...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "47fa913656f3a653c9ff8f2d1ec65a0a", "score": "0.0", "text": "def shmshmealattribute_params\n params.require(:shmshmealattribute).permit(:attributeName, :shmealAttribute, :shmealAtrbDate, :attributeDate, :shmealID, :menuItemID)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7943618", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.69572574", "text": "def permitted_params\n params.permit!\n end", "title"...
c2c397e20e7ddb8fa2db47f73e9b7352
method to create a new tree, and ask the user to "interact" with it
[ { "docid": "e843b7c4d7f578b2a2a2e0eb9c6b84ea", "score": "0.6174485", "text": "def init\n tree = OrangeTree.new\n\n input = \"\"\n\n while input != \"bye\"\n print \"what is your command? Chose from 'status', 'one year passes', 'pick', 'bye'. >> \"\n input = gets.chomp\n dispatch input, tree\...
[ { "docid": "864ee1fc06a984868a336c2658eb0216", "score": "0.6572372", "text": "def CreateTreeDialog\n OpenTreeNextBackDialog()\n nil\n end", "title": "" }, { "docid": "fb00eacd1e9b28f4e165a47382bece80", "score": "0.62324125", "text": "def create\n\t\t@tree = Tree.new\n\t\...
8346f6492e0f062384443ec87c67a160
Create a bank transfer Use the &x60;/bank_transfer/create&x60; endpoint to initiate a new bank transfer.
[ { "docid": "27400c142830c33b27dc5a270a4c2c16", "score": "0.7007458", "text": "def bank_transfer_create_with_http_info(bank_transfer_create_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PlaidApi.bank_transfer_create ...'\n end\n ...
[ { "docid": "5d51e32a12b255d2a878814d44d30664", "score": "0.80827", "text": "def create_bank_transfer\n bank_transfer_create_request = Plaid::BankTransferCreateRequest.new(\n {\n :idempotency_key => Random.rand(0..1_000_000_000).to_s,\n :access_token => access_token,\n :accou...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "70860102cebf3d0e53fc129aa9f128e8", "score": "0.0", "text": "def gateway_stat_params\n params.require(:gateway_stat).permit(:serial_num, :date, :onlineDev, :signal, :lqi, :rssi, :correlation, :rcvPkts, :sentPkts, :lastReboot, :temp, :battery, :vKl, :vZigbee, :errorsCount, :alerts, :acPwr...
[ { "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...
7b722c6d86ba086a36424ecd714d8874
Write a method that takes two numbers. It should print out all primes between the two numbers. Don't use Ruby's 'prime' class. find_primes(3, 10) => 3, 5, 7
[ { "docid": "3399314acda64dbe107efb4994df2d09", "score": "0.0", "text": "def is_prime?(num)\n (2..(num - 1)).each do |divisor|\n return false if num % divisor == 0\n end\n\n true\nend", "title": "" } ]
[ { "docid": "9472a406038cb9f1cd25dbcce89c5e90", "score": "0.83380294", "text": "def find_primes(int1, int2)\n nums = (int1..int2).to_a\n nums.select { |num| is_prime?(num) }\nend", "title": "" }, { "docid": "37f18c24271db4b11dd030b1555e951c", "score": "0.7932992", "text": "def ruby_...
ba31e0e23492934075d12a43ec18d44b
=begin def self.from_openssl openssl_cert unless openssl_cert.is_a? OpenSSL::X509::Certificate raise "Can only construct from an OpenSSL::X509::Certificate" end certificate = Certificate.new Only subject, key_material, and body are used for signing certificate.distinguished_name = DistinguishedName.from_openssl openssl...
[ { "docid": "299376120b7d45a6b3931d4e0656ea88", "score": "0.6966587", "text": "def sign!(signing_profile={})\n raise \"Invalid certificate #{self.errors.full_messages}\" unless valid?\n merge_profile_with_extensions(signing_profile)\n\n openssl_cert = OpenSSL::X509::Certificate.new\n ...
[ { "docid": "269e63bd47e81e58c35c684996f9fe68", "score": "0.7024349", "text": "def certificate; end", "title": "" }, { "docid": "269e63bd47e81e58c35c684996f9fe68", "score": "0.7024349", "text": "def certificate; end", "title": "" }, { "docid": "3daf35525b39222649b78c0883c8...
eb34a824bb69d0598f6cc74156ae1ac4
Return the response code.
[ { "docid": "fd3e01077f0b797f449d731c0201df38", "score": "0.0", "text": "def code\n @code\n end", "title": "" } ]
[ { "docid": "b9751edda8e7229698f9b9db8744e3ec", "score": "0.8740891", "text": "def response_code\n status_code\n end", "title": "" }, { "docid": "bb01f17dec9a2d360b04ebdea8956701", "score": "0.870844", "text": "def response_code\n @code\n end", "title": "" }, {...
176289defc2586b7cb851643874660db
DELETE /products/1 DELETE /products/1.json
[ { "docid": "17b1b084808853ff73a25c2733bcab53", "score": "0.0", "text": "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url, notice: 'Product was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" ...
[ { "docid": "2fa0a3656e86962ca1a10fa31aede189", "score": "0.7657799", "text": "def destroy\n @productos_json.destroy\n respond_to do |format|\n format.html { redirect_to productos_jsons_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "65950...
25f45501551180c553a4935c4316bb06
Writes results from the performance harness to a csv file in the specified directory
[ { "docid": "7e5f4444178f7e467674044c40f5166c", "score": "0.6394494", "text": "def write_to_csv (time, platform, browser_name, browser_version, build, counter, num_cases, delay, duration, rate, test_name)\n googledrive_path=\"Google Drive/CODAP @ Concord/Software Development/QA\"\n localdrive_path=\"Do...
[ { "docid": "60f4bb5d963720388c4d3485a269a4e6", "score": "0.72749317", "text": "def each_bench_to_csv\n @phoronix_dir.each do |phor_dir|\n @directories.each do |dir|\n end\n end\n end", "title": "" }, { "docid": "26b523749b2dd74389ddf7956269acff", "score": "0.71...
cfad0497c5d395a3cd83e011aafdf4ce
Returns the shortest path from from_x,from_y to to_x, to_y as an array of 2 element [x,y] arrays... or `nil` if no path can be found
[ { "docid": "477c8f3492c7d0e4cf4836969161fb37", "score": "0.724717", "text": "def shortest_path(from_x, from_y, to_x, to_y)\n @visited = Array.new(@matrix.size) { Array.new(@matrix.first.size) { false } }\n @farthest_node = nil\n queue = Queue.new\n queue << Node.new(from_x, from_y, 0)\n\n ...
[ { "docid": "869ac818a85922f3857a993fe9d829a6", "score": "0.68479306", "text": "def shortest_path\n initial_position_obj = { position: start_position, source: {} }\n\n knights_path = [initial_position_obj]\n\n while knights_path.present?\n current_position = knights_path.shift\n\n posi...
c02b732a06e87d9f29613489e8782ae3
Helper method for modifying JVM properties
[ { "docid": "b5f46695ec72d87e8954156fd035b967", "score": "0.7055062", "text": "def jvm_property(name,value)\n cmd = <<-END\nAdminTask.setJVMProperties('[-nodeName #{resource[:nodename]} -serverName #{resource[:name]} -#{name} #{value}]')\n END\n cmd\n end", "title": "" } ]
[ { "docid": "ce44a847dc871f3693b94b712af56026", "score": "0.6490017", "text": "def set_property(*args)\n return unless alive?\n\n command \"set_property\", *args\n end", "title": "" }, { "docid": "1448b35b0db13a734e4f8445c3ee2d0c", "score": "0.57991964", "text": "def set_...
5768d6a4594531fe780a5e907504dc80
GET /hats/1 GET /hats/1.xml
[ { "docid": "f5c90108fab09e5666134a1937e26ad9", "score": "0.6333693", "text": "def show\n @hat = Hat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @hat }\n end\n end", "title": "" } ]
[ { "docid": "9ed5321765652b0df9be52251ca61ca6", "score": "0.6711719", "text": "def index\n @hats = Hat.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n# format.xml { render :xml => @hats }\n end\n end", "title": "" }, { "docid": "d4fc9d9e7eb3698419e0...
26192092bc99cde5baf969cb2697708b
Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.user_mailer.password_reset.subject
[ { "docid": "79afb72bf56822d513a9c96df0b7ed6a", "score": "0.61936116", "text": "def password_reset(user)\n @user = user\n mail to: user.username, subject: \"Umedoc Password Reset\"\n end", "title": "" } ]
[ { "docid": "a4d71fab88f218109eb04432736a8fb8", "score": "0.6847792", "text": "def password_reset(user)\n @user = user\n mail :to => user.email, :subject => I18n.t(\"reset_password\")\n end", "title": "" }, { "docid": "5c49df176c0d8b63b317043e3510b06b", "score": "0.6811161", "t...
810ee16cf4f6d8803c2e50620476df5c
Scan takes a buffer and an offset of where this buffer starts in the source
[ { "docid": "51bf88165ff477f457836f196c2c1211", "score": "0.6495189", "text": "def scan(buffer, source_offset)\n\n buffer.scan(\n # Look for a DER record start (0x30), a length value, and a version marker. \n # This identifies RSA, DSA, and EC keys\n /\\x30.{1,5}\\x02\\x01(?:\\x00\\x02|...
[ { "docid": "3f34d86df2a9f9cb643b06081db43085", "score": "0.67316246", "text": "def scan(buffer, source_offset)\n buffer.scan(\n /-----BEGIN\\s*[^\\-]+-----+\\r?\\n[^\\-]*-----END\\s*[^\\-]+-----\\r?\\n?/m\n ).each do |m|\n # This may hit an earlier identical match, but thats ok\n la...
16044d9ea99499c41302e2e5185a4cb6
string end with word or not
[ { "docid": "3b5b3f8f90bb6a88a6ca6bbd1390b11f", "score": "0.73096555", "text": "def stringEndWith\n return $str.include?(\"hello\")\nend", "title": "" } ]
[ { "docid": "d1c32e6ae3bc10303a239d0ee33d798f", "score": "0.7761797", "text": "def custom_end_with?(string, substring)\n string[-substring.length..-1] == substring\n # taking everything from the negative whatever (all the characters the last\n # word has up to the last character)\nend", "title": "...
b4611d7206ad640373ef54875491ae09
Places them in a new array after pairing. Abandoned .map, could probably make it work in an unnecessarily long way. Using .zip found in ruby docs instead. Need to split array in half to use it.
[ { "docid": "4d821eb7d6041b91da04530b34d04ea7", "score": "0.67500275", "text": "def pairs(letters)\r\n\t#shuffle bang! shuffles letters in place permanently\r\n\tletters.shuffle!\r\n\t#Slicing array into 2 halves and assigning to one and two, while converting to array\r\n\t#.round places the uneven eleme...
[ { "docid": "7e6466348cceff44d42730315b2bc809", "score": "0.75940937", "text": "def zip(arr1, arr2)\n arr1.each_index.each_with_object([]) do |idx, result|\n result << [arr1[idx], arr2[idx]]\n end\nend", "title": "" }, { "docid": "7371b64518a35e1ee1fc04e11e98074c", "score": "0.759067...
1998a706bf6b818d19e22f6deec40301
Don't know if I like doing this, but we want the configuration to be lazyloaded so as to be sure and give users a chance to set up their configurations.
[ { "docid": "ec55e99539f78eb51846e5018c4a9abf", "score": "0.6843282", "text": "def initialize_if_necessary\n @config ||= Config.new\n end", "title": "" } ]
[ { "docid": "4a4b72ce84d6ae815792242a0cd76435", "score": "0.74756354", "text": "def load_configuration\n # TODO\n end", "title": "" }, { "docid": "49a3104004c715c1c0a6e1a3f9588b28", "score": "0.7345636", "text": "def load_config\n @@load_config ||= config_load_config\n end...
9b28ff7fd59135603e0ae3ce3b44908f
Set the User or UNIXUser logon script path. This corresponds to the LDAP scriptPath attribute and is the "Logon script" setting in the Profile tab of the Active Directory Users and Computers tool. === Parameter Types script_path [String]
[ { "docid": "1bf65cb028672a7074dbdebf0010309d", "score": "0.614726", "text": "def script_path=(script_path)\n @script_path = script_path\n @modified = true\n end", "title": "" } ]
[ { "docid": "1d168187aae9631442a39fe425541b3e", "score": "0.62755096", "text": "def set_script_path path\n script_processor.set_path path\n end", "title": "" }, { "docid": "2ce75169c1fc7274ee70d1446bd49a5c", "score": "0.5569717", "text": "def user_script_directory\n config_...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "9c59ceb0369f9398037ebebcfce66d37", "score": "0.0", "text": "def how_params\n params.require(:how).permit(:title, :description, :howcover, :videourl, :minutes, :hints_and_tips, :slug, \n :subtitle, :subtitle1, :subtitle2, :subtitle3, :howcategory_id, :subbody1, :subbody2, \n :references...
[ { "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...
f2c71e77f5778f718c8f5cf9fdcd3a68
Permit access to columns
[ { "docid": "1b6672e9f32efbbc8757e4f3d149b96c", "score": "0.0", "text": "def sport_params\n params.require(:sport).permit(:distance,\n :date,\n :duration,\n :populair_sport_id)\n end", "title": "" ...
[ { "docid": "ca43d5ed4812d8e27eb4264c8454ebca", "score": "0.6934601", "text": "def restrict_columns\n columns_whitelist = @user_key.columns.restrict_to(@resource).to_a.map{|c| c.name}\n for item in @items\n for column in item.keys\n item.delete(column) unless columns_whitelist.include?(...