query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
7ba3ed3bda65a36844c51029acc4770d
publish message to exchange using the specified routing key
[ { "docid": "c93259f9b49331cba9b53b4c0a89c106", "score": "0.672078", "text": "def request(exchange_name, value)\n key = value.delete(:routing_key)\n msg = YAML.dump(value)\n exchange = @amq.topic(exchange_name)\n exchange.publish(msg, :routing_key => key)\n end", "tit...
[ { "docid": "af175c73f707eb93e099820ed10e6924", "score": "0.7922754", "text": "def publish(message, routing_key, username)\n headers = { \"username\" => username }\n @exchange.publish(message, routing_key: routing_key, headers: headers)\n end", "title": "" }, { "docid": "a80e02ac851f9d...
42db375eaf24b4b90b24e4aa6ec25717
Process: With the initial start position add all possible next destinations Check if those destinations have the end position. If not, continue the whole process until you reach the end position.
[ { "docid": "88efe7102e753283fe4e2a447fe27276", "score": "0.0", "text": "def get_shortest_path\n start_knight_movement = { position: start_position, source: {} }\n\n knight_movements = [start_knight_movement]\n\n while knight_movements.present?\n knight_movement = knight_movements.shift\n\n...
[ { "docid": "04bf21827a7f0faf304fc136840a17d1", "score": "0.6293781", "text": "def plan_multi_startforwards(start_line, start_stop, end_line, end_stop)\n start_line_position = MTA[start_line].index(start_stop)\n end_line_position = MTA[end_line].index(end_stop)\n if start_line != end_line\n first_l...
68de2b10d05881878b532a920889105b
Reads a cached fragment from the location signified by +key+ (see +expire_fragment+ for acceptable formats). source://actionpack//lib/abstract_controller/caching/fragments.rb93
[ { "docid": "82c18c77137d59d74ad65470ac8522bd", "score": "0.66334444", "text": "def read_fragment(key, options = T.unsafe(nil)); end", "title": "" } ]
[ { "docid": "1b86fb0d4ca94042a664f476baed225d", "score": "0.8007335", "text": "def read_fragment(key, options = nil)\n return unless cache_configured?\n\n key = fragment_cache_key(key)\n instrument_fragment_cache :read_fragment, key do\n result = cache_store.read(key, option...
e661af0467008e1edc294db1305c0068
fetching user communities and associated community members
[ { "docid": "13ffc582fafaf7405c16b39b0fc42b4e", "score": "0.66360193", "text": "def index\n # @communities = current_user.communities\n # start change code- kandarp \n if params[:data].present?\n @communities = (current_user.communities.search(params[:data]) + current_user.community_memb...
[ { "docid": "3cda761330ed3568daeb02309fdc9310", "score": "0.7463532", "text": "def find_communities(access_level = nil)\n # need to know the user if there is an access level applied otherwise we are just doing public collections\n authenticate_user! unless access_level.blank?\n\n # run the solr ...
4249371e34791df3c185bfb22cf1aac5
recalculates components and calls repaint
[ { "docid": "e4bfc3ca0a2cb3372745426d6e36837d", "score": "0.67141354", "text": "def update_components # #:nodoc:\n @balance = 0\n @max_visible ||= @split_count\n @_first_column_print ||= 0\n @_last_column_print = @_first_column_print + @max_visible - 1\n $log.debug \"...
[ { "docid": "d01e223680d2f5baef76ed6657fe38ec", "score": "0.7443181", "text": "def repaint\n $log.debug \" form repaint:#{self}, #{@name} , r #{@row} c #{@col} \" if $log.debug? \n @widgets.each do |f|\n next if f.visible == false\n #f.repaint \n # changed on 2018-03-21 - so widgets ...
b7a07009db67c96a6a2b46b071a22d03
Decodes integer value from provided buffer.
[ { "docid": "376f910c7bb23d89382aaba47d10c819", "score": "0.574572", "text": "def read_integer(bits); end", "title": "" } ]
[ { "docid": "40487277e107d0e41a3a7f36c61aaa31", "score": "0.67411983", "text": "def test_decode_integer_octet\n i, data = decode_integer(\"\\002\\001\\042\")\n assert_equal(34, i)\n assert_equal(\"\", data)\n i, data = decode_integer(\"\\002\\001\\377\")\n assert_equal(-1, i)\n assert_e...
63b43a04bb92842213b567ab9261f5fe
Update an existing table Update an existing HubDB table. You can use this endpoint to add or remove columns to the table. Tables updated using the endpoint will only modify the `draft` verion of the table. Use `pushlive` endpoint to push all the changes to the `live` version. Note: You need to include all the columns i...
[ { "docid": "c9947e535158c9bf4c5ef1eb35cf0d29", "score": "0.5989064", "text": "def update_draft_table(table_id_or_name, hub_db_table_v3_input, opts = {})\n data, _status_code, _headers = update_draft_table_with_http_info(table_id_or_name, hub_db_table_v3_input, opts)\n data\n end...
[ { "docid": "f86e745ab652b52602ab44ce4933b584", "score": "0.6218473", "text": "def update!(**args)\n @automatic_column_names = args[:automatic_column_names] if args.key?(:automatic_column_names)\n @body = args[:body] if args.key?(:body)\n @kind = args[:kind] if args.key?(:kind)...
e4b2e03e9ef41dec3244222f73d813c9
undirected? method confirms whether a graph is undirected or not. Since this is the directed graph implementation, it always returns false.
[ { "docid": "af2d966aa9953f2568078500bbc09713", "score": "0.8619848", "text": "def undirected?\n false\n end", "title": "" } ]
[ { "docid": "d410a3a0d400816288242ff2e036285e", "score": "0.85991395", "text": "def undirected?\n !directed?\n end", "title": "" }, { "docid": "13bb3fc30cda045d0d92e56bccfe5341", "score": "0.80270964", "text": "def isConnectedUndirected()\n visited = Array.new(self.count){f...
841be628dcce0a5909dd140308ef8f48
=begin Pseudocode for bubble sort I. First compare index 0 and index 1. A. Determine which one is higher. Lower will remain at the left/lower index between these two while higher is at the right/high index. II. Pivot one space and compare values for index 1 and index 2.. A. Do same operation as I.A. III. Repeat for ent...
[ { "docid": "e044a0c98520ef84cf45966988dbbc85", "score": "0.0", "text": "def bubble_sort(array)\n n = array.length\n loop do\n swapped = false\n\n (n-1).times do |i|\n if array[i] > array[i+1]\n array[i], array[i+1] = array[i+1], array[i]\n swapped = true\n puts swapped\...
[ { "docid": "6d974f113dc802bf528bbc88ce53fc96", "score": "0.8521292", "text": "def bubble_sort(array)\n # compare two elements\n # if right is smaller than left, swap them out\n # continue until sorting does 0 swaps on the array\n\n array.length.times do |pass|\n (array.length - pass)....
935cb557b288252019ab77f8157d0b1c
The for date is because the reminder doesn't always have a date you can subscribe to every occurrence as well as a single recurrence.
[ { "docid": "867db1a8779e62e0d8995811a5e9fab0", "score": "0.0", "text": "def send_cancellation_notice(for_date)\n return if date.present? and date < Date.today\n ReminderMailer.cancellation(self, for_date).deliver\n mark_as_sent!\n end", "title": "" } ]
[ { "docid": "760ce0a7fc938a0343df9f761fc41d10", "score": "0.6597888", "text": "def add_recurrence_date(date)\n @rdates << date unless date.nil?\n end", "title": "" }, { "docid": "82f65d97d37242b0233eba0f26a1960a", "score": "0.6499059", "text": "def create_reminder_notification...
bbd5d0d1819aab9e253671d0760e30b1
after_validation :reset_password_attributes before_save :deliver_pw_change_notification before_save :deliver_email_change_notification
[ { "docid": "99be25f425389035fbfca001f44a2b0c", "score": "0.0", "text": "def password_changed?\n orig_pw_hash = self.instance_variable_get(:@old_password_hash)\n self.new_record? || (!orig_pw_hash.nil? && orig_pw_hash != self.password_hash)\n end", "title": "" } ]
[ { "docid": "25b9325c8cd2be9f2d593c188687c92f", "score": "0.7628138", "text": "def send_password_change_notification; end", "title": "" }, { "docid": "3196b8b5464de0de2fed0ab0caf0d17c", "score": "0.7490367", "text": "def after_password_reset; end", "title": "" }, { "docid"...
d151584519f0329c7c17ba0255eac037
Create MP Icon Number
[ { "docid": "389a5383ec3df272dc93d34a3130f3cc", "score": "0.8128623", "text": "def create_mp_icon_number\r\r\n return if !MP_ICON_NUMBER_VISIBLE\r\r\n @mp_icon_number_old = [-1,-1]\r\r\n @mp_icon_number = Sprite.new\r\r\n @mp_icon_number.bitmap = Bitmap.new(@mp_icon_number_cw * 4,@mp_...
[ { "docid": "aa5231095a5663568ad9c692e3af6883", "score": "0.7881445", "text": "def create_mp_icon_number(viewport)\n return if !MP_ICON_NUMBER_VISIBLE\n @mp_icon_number_old = [-1,-1]\n @mp_icon_number = Sprite.new\n @mp_icon_number.bitmap = Bitmap.new(@mp_icon_number_cw * 4,@mp_icon_n...
8aafde396bba6cccc73083a9ec69ba08
GET /employees/new GET /employees/new.json
[ { "docid": "8cb5eaf04899fc26f6a706bfc703daa7", "score": "0.7083794", "text": "def new\n @employee = Employee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json=> @employee }\n format.js \n end\n end", "title": "" } ]
[ { "docid": "f78a465e069b130afd94c21f887d8c9f", "score": "0.80085456", "text": "def new\n @employee = Employee.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employee }\n end\n end", "title": "" }, { "docid": "04b330...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "4f84f5ce61ee3e2c445afa143f5da8d9", "score": "0.0", "text": "def set_and_authorize_federal_state\n @federal_state = FederalState.friendly.find(params[:id])\n authorize @federal_state, \"#{action_name}?\".to_sym\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;...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "88b9846cbb3a09b17309b08c51f6e734", "score": "0.0", "text": "def set_pizza_cart\n @pizza_cart = PizzaCart.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60320485", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6013371", "text": "de...
b91a23ff542e92e68880315deba7b669
Processing all issues and putting data needed for changelog into an array where each element is a hash with the required data
[ { "docid": "5c0e2ae1f06f2823e4db2c8ea6814397", "score": "0.67179346", "text": "def process_issues(jira_issues)\n issues_array = Array.new\n jira_issues['issues'].each do |issue|\n issue_hash = Hash.new\n\n # type & key\n issue_hash['type'] = issue['fields']['issuetype']['name']\n issue_has...
[ { "docid": "f124bd1ef1cbc4174db4ab03faa06a0f", "score": "0.67875856", "text": "def issue_changes\n @details.map do |change|\n IssueChange.new(change)\n end\n end", "title": "" }, { "docid": "6ac7a899dfe77c9489ac5d49c7904743", "score": "0.6419976", "text": "def eac...
b724ca343c6b7c4c4a8206661d6dab70
GET /posts GET /posts.json
[ { "docid": "439214e1d8fce9c6670b3dd0126344bd", "score": "0.0", "text": "def index\n people_in_feed = current_user.feed_list\n @posts = Post.where(user: people_in_feed)\n end", "title": "" } ]
[ { "docid": "915c0178f9e4347098d8a463c2cbe6b0", "score": "0.7865315", "text": "def show\n @posts = Post.find(params[:id])\n render json: @posts\n end", "title": "" }, { "docid": "9e4bfaa87507d05255fbaeadc1ecb1d6", "score": "0.7494904", "text": "def index\n @posts = Post.all\...
c905bb18a5ce348c62456bb67b4c8417
new user start working with project
[ { "docid": "6a898cca8db85ca9aea646f7b6e9a05d", "score": "0.0", "text": "def join(conn, start_tag)\r\n @users << conn.user.id\r\n @waiting[conn.user.id] = conn\r\n # find state in log for new user\r\n idx = @log.rindex{|x| x[:tag] == start_tag} || -1\r\n cnt = @log.length - idx - 1\r\n ...
[ { "docid": "0b0923caa58e9b4ca0fbf5fa7461dab9", "score": "0.65708035", "text": "def run\n @user = \"\"\n welcome\n login_or_signup\n say_hi_to_user\n initial_menu \n end", "title": "" }, { "docid": "186a7348d3479536bc31e28c5aebd8dc", "score": "0.6315344", "text": "d...
758ec4c0b80af8ac5fff241c09c0b43b
shows the user information
[ { "docid": "70ec791e6e1860342e68217464adc5d7", "score": "0.0", "text": "def show\n @user = User.find(params[:id])\n end", "title": "" } ]
[ { "docid": "e3f2467b58957e4dd55097f06f9d2203", "score": "0.7945434", "text": "def show\n @user = User.get_user_info_by_id(session[:user_id])\n end", "title": "" }, { "docid": "37de1860d0a4ffc3be44f55ae4281acb", "score": "0.77140653", "text": "def show\n @user = User.find(param...
4c40e405168109848ae8037618a26ec3
Clears a page range from a previously uploaded document.
[ { "docid": "d409a67e8f23bfe03218263f01fab30f", "score": "0.0", "text": "def clear_page_with_http_info(pdf_clear_page_parameters, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PDFApi.clear_page ...'\n end\n # verify the required paramet...
[ { "docid": "61b3a126f398c89e94484c80b0d69ff2", "score": "0.74304515", "text": "def clear_blob_pages(container, blob, start_range, end_range, options = T.unsafe(nil)); end", "title": "" }, { "docid": "95c1e07e9a5b530e8f05398e56f8da71", "score": "0.7037215", "text": "def delete_range(r...
d46d22082834c869729087ef97114a2a
To find unavailable seats
[ { "docid": "8b6129e323de6e231f21fa8d5fc6f9d6", "score": "0.79041797", "text": "def check_for_unavailable_seats\n @unavailable_seats = (@seat_numbers - eval(\"$AUDI_#{@show_no}_SEATS\")).join(', ')\n end", "title": "" } ]
[ { "docid": "e3377dd379f81a23de67cf36dff2e144", "score": "0.75735134", "text": "def print_seats_unavailable\n puts \"#{@unavailable_seats} Not available, Please select different seats \"\n end", "title": "" }, { "docid": "ee6fff790079b32488101f25d0967890", "score": "0.7125857", ...
bc325203ad409a10695fdc810286a9f6
Sets the attribute data, and then saves to OneView
[ { "docid": "2de5bb5cfe3951abf262f5441f96cb8f", "score": "0.0", "text": "def update(resource, attributes = {})\n resource.client = self\n resource.update(attributes)\n end", "title": "" } ]
[ { "docid": "924d96a5b9ddfe7ccda7e48ee436ffb1", "score": "0.6371966", "text": "def set_attr\n @attr = Attr.find(params[:id])\n end", "title": "" }, { "docid": "924d96a5b9ddfe7ccda7e48ee436ffb1", "score": "0.6371966", "text": "def set_attr\n @attr = Attr.find(params[:id])\...
72973fddb0d43724093f3326f0aef51f
GET /clients/1 GET /clients/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "c0ffa931d98d5ce1e2041a93d545d9ea", "score": "0.77658874", "text": "def index\n @clients = Client.all\n\n render json: @clients\n end", "title": "" }, { "docid": "11367d36e4c90c8a0de89176b3b870a4", "score": "0.77151686", "text": "def index\n @clients = current_us...
e380a17a571de02779679262a22b7f5c
Returns the Order Number label
[ { "docid": "5ea53cb42a7d7d6060a42d95e098d6cb", "score": "0.7676612", "text": "def order_number_label\n\t\t$tracer.trace(__method__)\n return ToolTag.new(span.className(create_ats_regex_string(\"ats-ordnumlbl\")), __method__)\n\tend", "title": "" } ]
[ { "docid": "248bdb4d2cf51a2b04d66d0d40e0d304", "score": "0.7611427", "text": "def to_label\n \"Order ##{id}\"\n end", "title": "" }, { "docid": "29a47aad7d471c382e370885d8dcbaff", "score": "0.7304458", "text": "def to_s\n order_number\n end", "title": "" }, { "doc...
0071852e1584f14a186573c0055e4402
Simply runs 'cp'. It operates filebyfile instead of recursively because I like printing individual files (it looks cool)
[ { "docid": "b8c5b5f795b7ad284c7c2a734b69ff00", "score": "0.65871775", "text": "def copy_files(ext, source_dir, dest_dir)\n Dir.glob(\"#{ source_dir }/*.#{ ext }\") do |file|\n puts \"Copying #{ file }...\"\n command = \"cp #{ file } #{ dest_dir }/#{ file }\"\n system command\n ...
[ { "docid": "b0b422849bc222944d766362504418e6", "score": "0.7196231", "text": "def mass_copy(files, destination)\n output 'cp'\n files.each do |file|\n run_command \"cp #{file} #{destination}\", :output => false\n end\n end", "title": "" }, { "docid": "b6cee9ec872bdba...
b1f3724f9da19f07b5c1b427eeb2c146
The `Order` resource disappeared in STU3 def create_order(fixture_path, order_name, diag_order_name)
[ { "docid": "9037218f20e87fd8522ba8073e8c2ffe", "score": "0.62334543", "text": "def create_procedure_request(fixture_path, order_name, specimen_name = nil)\n diag_order = @resources.load_fixture(fixture_path, :xml)\n diag_order.subject = @records[:patient].to_reference\n diag_order.r...
[ { "docid": "a1ca5b7494980153917aedaad33a25d9", "score": "0.70833164", "text": "def create_order\n @order = Order.create\n end", "title": "" }, { "docid": "eba24f0a33763b7776cec141b0c94888", "score": "0.67847264", "text": "def create_order(order)\n build_persisted_order(\n ...
ebd5f88f5fcca78ecd007541efc57b47
take the GSS blob, extract the NTLM type 1 message and pass it to the process method to build the response which is then put back into a new GSS replyblob
[ { "docid": "4fc3b00857e2aa3be896d8a31b560c4c", "score": "0.58913505", "text": "def process_gss_type1(gss_api)\n unless Gss.asn1dig(gss_api, 1, 0, 0, 0, 0)&.value == Gss::OID_NTLMSSP.value\n return\n end\n\n raw_type1_msg = Gss.asn1dig(gss_api, 1, 0, 1, 0)&.v...
[ { "docid": "d11fae4e2eadb9e3308bc45481d45e7d", "score": "0.6769271", "text": "def process_ntlm_type1(type1_msg)\n type2_msg = Net::NTLM::Message::Type2.new.tap do |msg|\n msg.target_name = 'LOCALHOST'.encode('UTF-16LE').b\n msg.flag = 0\n %i{ KEY56 KEY12...
eb580d918bd46a48be1fdf019b200b68
sends a user a message and returns their response message String returns a string
[ { "docid": "21736621c4784c2e8eb308d031b8b20e", "score": "0.0", "text": "def get_user_input(message)\n puts message\n gets.chomp\n end", "title": "" } ]
[ { "docid": "a1bf79bd1b078a932f700b76daad1b65", "score": "0.72542065", "text": "def get_message(user = nil)\n return \"Happy birthday!!! (This was an automatically generated message)\\n\"\n end", "title": "" }, { "docid": "092cf5e98455c0041e7bc5e5985e66de", "score": "0.70558774", ...
e96edd4229a8ac698777e8e7430c1240
GET /message_trackers/new GET /message_trackers/new.xml
[ { "docid": "9f082894c774c1532f5d206df9cdb899", "score": "0.7603066", "text": "def new\n @message_tracker = MessageTracker.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @message_tracker }\n end\n end", "title": "" } ]
[ { "docid": "8ce27de4f04122ecaa2d3a0100f0afea", "score": "0.70316476", "text": "def new\n @tracker = Tracker.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tracker }\n end\n end", "title": "" }, { "docid": "148736ce984ed8574094d...
ab76a80e7a8f48270b0d492245cad181
GET /tempus/1 GET /tempus/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "f5c923dab4affd41cf4331347db049b2", "score": "0.6650403", "text": "def index\n @tenures = Tenure.all\n render json: @tenures\n end", "title": "" }, { "docid": "24836541fbc81f7c2c0aa9a94c052f69", "score": "0.66220266", "text": "def show\n @temperature = Temperatur...
eb1ff756fe9de6e7afad1a1a33282a95
setting attributes on the instance by invoking .name= , .latitude= , etc. expects a hash
[ { "docid": "f41dab6b0ca437470d33ee294075a80d", "score": "0.0", "text": "def mass_assign_attributes(attributes)\n attributes.each do |k, v|\n setter_method = \"#{k}=\"\n # .respond_to? Is it possible to call .{value} on this class instance?\n if self.respond_to?(setter_method)\n ...
[ { "docid": "75878b044b0c62a29357bf2f0a39aa32", "score": "0.7312869", "text": "def attributes=(h)\n if h.is_a?(Hash)\n h.symbolize_keys!\n @latitude = h[:latitude].to_f || h[:lat].to_f || @latitude\n @longitude = h[:longitude].to_f || h[:lng].to_f || @longitude\n elsif h.i...
33735cad616a43ad1185faaeb9dc15ce
POST /supplies_returns POST /supplies_returns.json
[ { "docid": "2944f0d4e4c99c44d3155d485034c73c", "score": "0.67777216", "text": "def create\n @supplies_return = SuppliesReturn.new(params[:supplies_return])\n @supply = Supply.find(@supplies_return.supply_id)\n @supply.stock_ini += @supplies_return.quantity\n @supplies_return.company_id = cur...
[ { "docid": "964ece287f5023f5cb4262dcdef534e6", "score": "0.6950873", "text": "def new\n @supplies_return = SuppliesReturn.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @supplies_return }\n end\n end", "title": "" }, { "docid": "3...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "3109c63f9a9bd83e0698c10772686585", "score": "0.0", "text": "def update!(**args)\n @keys = args[:keys] if args.key?(:keys)\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...
cdca9d5b2b45e60a619c715b1d3ecc64
Improve prev with group
[ { "docid": "d7c366fa2988abc6ad6c060ba9a7f102", "score": "0.75932777", "text": "def improve prev, group\n end", "title": "" } ]
[ { "docid": "3e441dd5e6d59f7ae5a582a4487e1a2e", "score": "0.62885505", "text": "def prev_by(field)\n \t\t\tstep_by(field, :prev) \n \t\tend", "title": "" }, { "docid": "aa3e6794fe210beed7293ad00ab1ddb7", "score": "0.615305", "text": "def prev_ranking\n Ranking.all(:jtop_...
76023edfe69c15dfe93064954418ce87
this is a database view
[ { "docid": "804db349fada8013716782976ff49056", "score": "0.0", "text": "def readonly?\n true\n end", "title": "" } ]
[ { "docid": "c538b60c4a650b5764f1cd533c79af83", "score": "0.71321815", "text": "def overview(db)\n\toverview = db.execute(\"CREATE VIEW [Your top books!] AS SELECT book_name, author FROM books where rating > 3\")\n\treturn overview\nend", "title": "" }, { "docid": "25fda758b86d92bccd0a807941d...
f07d29d2bfcac8b82c163933b06b12ad
reduce 334 omitted reduce 335 omitted reduce 336 omitted reduce 337 omitted reduce 338 omitted reduce 339 omitted reduce 340 omitted reduce 341 omitted reduce 342 omitted
[ { "docid": "99f3b261678f07011e4971e931b5c573", "score": "0.6936407", "text": "def _reduce_343(val, _values, result)\n result = []\n \n result\nend", "title": "" } ]
[ { "docid": "bcc77ea412992f9c87aad138efd40a40", "score": "0.73221904", "text": "def _reduce_236(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "a8bd851ea077dd5d3684a05c36012ebe", "score": "0.72777635", "text...
64ea2771901bfb1b2fd6768d41b27f55
def seed_players(data) players = data[:player_array] players.each do |p| Player.create( name: p[:name], shorthand: p[:shorthand], country_id: Country.find_by(name:p[:country]).id, birthday: p[:birthday], position_id: Position.find_by(name:p[:position]).id, club_id: Club.find_by(fs_club_id:p[:fs_club_id]).id, fs_player_...
[ { "docid": "e28d8f11140cafb87b2e2e6efc6c35e1", "score": "0.73865926", "text": "def seed_matches(data)\n matches = data[:matches_array]\n matches.each_with_index do |m, i|\n home_club = Club.find_by(id:m[:home_id])\n away_club = Club.find_by(id:m[:away_id])\n\n my_match = Match...
[ { "docid": "3d007579f618b9dba4700dfd154460a8", "score": "0.8130152", "text": "def seed_clubs(data)\n clubs = data[:club_array]\n stadiums = data[:stadium_hash]\n clubs.each do |c|\n Club.create(\n name: c[:name],\n shorthand: c[:shorthand],\n country: c[:...
064b07c5988e5718e85a5cff734a292d
Get the connection pool for this server.
[ { "docid": "4305d56935475df6a7ae6324b3f3d1c9", "score": "0.72079206", "text": "def pool\n if unknown?\n raise Error::ServerNotUsable, address\n end\n\n @pool_lock.synchronize do\n opts = connected? ? options : options.merge(populator_io: false)\n @pool ||= ConnectionP...
[ { "docid": "fa3f2ed913b4a6b7f0b74036aa02d2bc", "score": "0.78125787", "text": "def get_pool\n\t\tconnection = ConnectionsManager.instance\n\t\tconnection_hash = connection.get(@host.name)\n\t\t@conn = connection_hash[:conn]\n begin\n pool = @conn.lookup_storage_pool_by_name(self.name)\n rescu...
5072ed055a255f55b08b2d9ce49e7605
DELETE /page_usages/1 DELETE /page_usages/1.xml
[ { "docid": "cc993a4cdd9070288ed50c45d42d64a9", "score": "0.76089555", "text": "def destroy_rest\n @page_usage = PageUsage.find(params[:id])\n @page_usage.destroy\n\n respond_to do |format|\n format.html { redirect_to(page_usages_url) }\n format.xml { head :ok }\n end\n end", ...
[ { "docid": "e7f9bcf792ee8ac316d047c6de32f01a", "score": "0.750025", "text": "def destroy_rest\n @v1_page_usage = V1PageUsage.find(params[:id])\n @v1_page_usage.destroy\n\n respond_to do |format|\n format.html { redirect_to(v1_page_usages_url) }\n format.xml { head :ok }\n end\n e...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "e5a34fd30c195871593556885044ca51", "score": "0.0", "text": "def notification_receiver_params\n params.require(:notification_receiver).permit(:notification_id, :receiver_id, :status)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7497761", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6959097", "text": "def strong_params\n params.require(:request).permit(param_white...
86dabc3866f8cf948df862616ea35a03
Public: Get group id Return text
[ { "docid": "7f0bdc94fd6a7ab5846cbff68b7d8f8f", "score": "0.0", "text": "def group_id\n el = find(:css, \"div[id^=unassigned-resources-]\")\n el.id.delete('unassigned-resources-')\n end", "title": "" } ]
[ { "docid": "9880d174738840c3a1a38d7fcf108248", "score": "0.8055604", "text": "def group_id\n get_info[:groupID]\n end", "title": "" }, { "docid": "618812b7dfaabd65c306e20f1d00ae3c", "score": "0.7382354", "text": "def get group_identifier\n groups.fetch self.class.identifie...
070383f3aa9a6720a8c8e591ac189798
DELETE /experiments/1 DELETE /experiments/1.json
[ { "docid": "19eea7c0f0d00b2d6924d568dad97656", "score": "0.6596383", "text": "def destroy\n @experiment.destroy\n respond_to do |format|\n format.html {\n begin\n redirect_to :back, notice: 'Experiment was successfully destroyed.'\n rescue ActionController::RedirectBack...
[ { "docid": "731904651fdc6264bd0b05706a5888cc", "score": "0.7767225", "text": "def destroy\n set_experiments\n @experiment.destroy\n respond_to do |format|\n format.html { redirect_to experiments_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "d...
750ee9274d6904ad6d2690a4b837cce3
GET /chase_servers/1 GET /chase_servers/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "5470e53212426fc808d7cf3d24680747", "score": "0.7335477", "text": "def servers\n response = get \"server\"\n data = JSON.parse response.body\n data[\"servers\"][\"server\"]\n end", "title": "" }, { "docid": "9169d5bb8ca2efc7681814498e1c0242", "score": "...
93f9e9c7076290b21b758fc226b318cc
check_for_rmvx: Checks if rpgvp.exe is running and, if so, exits. Also returns true if RMVX was running. notify: A boolean for whether to print a notification if RMVX is running.
[ { "docid": "b9e4cf01afa4340730a3a99d3cf8f0fc", "score": "0.8658075", "text": "def check_for_rmvx( notify = false )\n if process_running?( \"rpgvx.exe\" )\n if notify\n\t puts \"RPG Maker VX is already running! Please close it and try again. :)\"\n puts \"Exiting...\"\n pause_prompt\n\t...
[ { "docid": "461126558b9a96a9211c58e1ecd7db74", "score": "0.807374", "text": "def check_for_rmvxa( notify = false )\n if process_running?( \"rpgvxace.exe\" )\n if notify\n\t puts \"RPG Maker VXA is already running! Please close it and try again. :)\"\n puts \"Exiting...\"\n pause_prompt...
09274f6283178477ae104c653528b844
GET /provide_users GET /provide_users.json
[ { "docid": "6caa18a952b435def7f4ed16d20aae07", "score": "0.6753981", "text": "def index\n @provide_users = ProvideUser.page\n end", "title": "" } ]
[ { "docid": "543509c6588e2f79a8dbcd1cdcdaf7b9", "score": "0.72136694", "text": "def users\n try_json get('/user')\n end", "title": "" }, { "docid": "017d848c9897540ea7bc67c9d5139cf4", "score": "0.7138318", "text": "def users(opts={})\n get(\"/api/users\", opts)\n end",...
04fb7db5a328c27a7a706fc7d5b959b6
I can create a block of rooms
[ { "docid": "cfae3f041b2cd945666875c3d4ce4c62", "score": "0.6558575", "text": "def reserve_block(reserved_for, check_in, check_out, num_of_rooms)\n valid?(reserved_for)\n check_room_input(num_of_rooms) # Raised to UI. Max of 5 rooms and no less than 1\n available_rooms = check_avail_rooms_...
[ { "docid": "e113eeb8a68f8bd20ebe6383ea6bada2", "score": "0.76414114", "text": "def create_block_rooms(data)\n start_date = Time.parse(data[:start_date])\n end_date = Time.parse(data[:end_date])\n e_date = end_date - 1\n range = (start_date..e_date)\n rooms = data[:rooms]\n raise Standa...
475bb57951948d37166142663cb73c22
Gets the association stack for a specific key.
[ { "docid": "494e43f1a620453726564f211721f34d", "score": "0.59428877", "text": "def association(key)\n @associations[key] ||= Association.children(@model, key)\n end", "title": "" } ]
[ { "docid": "d3884de614fe1fa5361c3fc7180d93f3", "score": "0.60430795", "text": "def key_stack\n @key_stack ||= []\n end", "title": "" }, { "docid": "b14ff29b2bac55441542c1bc57713ff7", "score": "0.59515536", "text": "def key_stack\n @key_stack ||= Array.new\n end", ...
626dd35f934b5b6027a141e9f5119f7b
Pulls any new updates for the repository down.
[ { "docid": "3a68e670fdcaf1f23f540ca331a88306", "score": "0.0", "text": "def update(uri=self.uri)\n scm_update(@path,uri)\n end", "title": "" } ]
[ { "docid": "1bdc80b2494902d4b39dc4b37f0b2599", "score": "0.66857827", "text": "def update\n print_log '* Checking ', @dir.green, \" (#{repo_url})\\n\"\n Open3.popen2e(\"git -C #{@dir} pull\") do |_stdin, stdout_err, _thread|\n stdout_err.each { |line| handle_output(line) }\n end\n ...
8e5f7dd1c4f03b43a0f21bc11c5d2111
returns the types of templates on the Mu argv = commandline arguments
[ { "docid": "74e1865d818e2a4843a571633c08f81f", "score": "0.6232683", "text": "def cmd_types argv\n setup argv\n response = @api.types\n msg response\n return response\n end", "title": "" } ]
[ { "docid": "ef3ee57db02129c5ad536d2424966f4a", "score": "0.6060384", "text": "def templates=(_arg0); end", "title": "" }, { "docid": "847b7862b3445e75a2138537170716c8", "score": "0.6057656", "text": "def typeOf _args\n \"typeOf _args;\" \n end", "title": "" }, { "...
31415561763394d39b90ec762d189596
Appends one node to the end of the list :api: public
[ { "docid": "a4a5d6a522f7d83dc3b2787b62929896", "score": "0.0", "text": "def <<(other)\n # does node have a relationship ?\n new_rel = []\n if (@node.rel?(@relationship_type))\n # get that relationship\n first = @node.rels.outgoing(@relationship_type).first\n\n ...
[ { "docid": "86438c993e76b970ee6c19d3f1e4a7c9", "score": "0.7377148", "text": "def add_last(node)\n end", "title": "" }, { "docid": "4f47add548f9635c598b1de4f4500397", "score": "0.73258543", "text": "def append(node); end", "title": "" }, { "docid": "4f47add548f9635c598b1...
f8ba5d044a0cf75d64b382337ae16b20
GET /chiens/1 GET /chiens/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "9fcf3b534ec4f13fe20dad3a069b646d", "score": "0.6712125", "text": "def index\n @chapitres = Chapitre.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @chapitres }\n end\n end", "title": "" }, { "docid": "3445e4c400181bd...
f56d2f28b274179c99abc8fcb119f10b
Return this +Duration+ in milliseconds.
[ { "docid": "4bf83497850cecdae799443a7d24087c", "score": "0.0", "text": "def to_millis\n to_nanos / 1_000_000.0\n end", "title": "" } ]
[ { "docid": "2b0f5773ee25961c08d1cf9cf0c253dc", "score": "0.8464999", "text": "def duration_in_milliseconds\n return @duration_in_milliseconds\n end", "title": "" }, { "docid": "1508ea0cadf2c66fa1765fc8f4b7138c", "score": "0.7720841", "text": "def duration_ms...
fff80e925c5551222f61bc1950899ba0
Swaps the positions of the given songs, specified by song ids.
[ { "docid": "5fede75ab3978b4314cb2f0e90cd5863", "score": "0.0", "text": "def swapid(first, second)\n send_request('swapid %s %s' % [first, second])\n end", "title": "" } ]
[ { "docid": "4b73cfe4e95acee2ec212e20b56beadb", "score": "0.6504129", "text": "def reorder_plans(ids)\n ids.each_with_index do |id, position|\n application_plans.find_by_id(id).update_attribute(:position, position)\n end\n end", "title": "" }, { "docid": "2f99da8135f2a8e5e08f5647c...
7ccef854570c2745e55c6da3d8f2921e
def ensure_worker_threads RsRails.ensure_worker_threads end
[ { "docid": "9c5f97578bc965b1cdd5e60c78cac395", "score": "0.0", "text": "def process_redeemed_cdkeys\n sign = params[:sign]\n\n if validate_sign(params, sign)\n total = Cdkey.process_redeemed_cdkeys\n success = true\n else\n success = false\n end\n\n logger.info \"[API] acti...
[ { "docid": "2ffa5c15db07f81811a6dde96c9b4d41", "score": "0.77907676", "text": "def worker_threads\n @worker_threads ||= DEFAULT_WORKER_THREADS\n end", "title": "" }, { "docid": "758cf583b7ccecfee79c21411b4d68a2", "score": "0.7428571", "text": "def ensure_background_worker; en...
0c75e5cd511c019667b7ef1bb0fdf918
Returns true if the offer has bids an therefore is immutable
[ { "docid": "6418c6863f960b15843c456e980169e5", "score": "0.79975516", "text": "def is_immutable\n self.bids.first.present?\n end", "title": "" } ]
[ { "docid": "999a38859f33418d3691e5b0676eb1e3", "score": "0.729314", "text": "def editable?\r\n @bids.size == 0\r\n end", "title": "" }, { "docid": "0cc997fd10ef47a73d38ac768d57c028", "score": "0.7150039", "text": "def immutable?\n return false if new_record?\n # false u...
579f8cd32c352a195874f547cb6150d7
GET /tifos/1 GET /tifos/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "62c41299f3dd7071176edde163ba7818", "score": "0.63540107", "text": "def list_floor_plans \n get(\"/files.json/floorplan/images\")\nend", "title": "" }, { "docid": "1e793a166473c1d90b3c049ef1b4961f", "score": "0.6005131", "text": "def get_json\n Net::HTTP.get_response('g...
9351ef9141b454836851df6e43bcfb77
Check if a VM exists by scanning the onevm list
[ { "docid": "c3956258e3147ae130f2b4dc5a91a778", "score": "0.0", "text": "def exists?\n @property_hash[:ensure] == :present\n end", "title": "" } ]
[ { "docid": "7577552ebb00603c47910eb69732c362", "score": "0.8347091", "text": "def exists?\n if self.class.onevm_list().include?(resource[:name])\n self.debug \"Found VM: #{resource[:name]}\"\n true\n end\n end", "title": "" }, { "docid": "6fd1439888c7128891c5e81624a15f99...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "fd4ef6bea42c7d3d9ec291fb5cd05852", "score": "0.0", "text": "def cube_params \n params.require(:cube).permit(:name, :password, :cards => [])\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...
1bf6bfaf80c0990370f5ed5aa15a84da
An array of names, from the oldest ancestor to the parent to self.
[ { "docid": "3a302801849dfddfee25585191a9deec", "score": "0.5932132", "text": "def history\n @parent ? @parent.history + [@name] : []\n end", "title": "" } ]
[ { "docid": "9b01f6f3de713dfd8ef090ac394026ef", "score": "0.67939466", "text": "def ancestors\n \tif parent_name.blank?\n\t \tancestors = [] \n \telse\n \t\tp = Category.where(name: parent_name).first\n \t\tancestors = p.ancestors\n \t\tancestors << parent_name\n \tend\n \tancestors\n end", ...
146829cb576464edac2e162d585ac021
Is this a 'PRE REVIEW' issue?
[ { "docid": "ab9a23e630990b31f8de3f09c63ece53", "score": "0.0", "text": "def pre_review?\n title.match(/\\[PRE REVIEW\\]/)\n end", "title": "" } ]
[ { "docid": "5928f8efe9c6c2d408ea21a4cdce83ad", "score": "0.75439024", "text": "def preliminary?; end", "title": "" }, { "docid": "8ef86a1189509bccd2cb3f913a5cbe81", "score": "0.6715395", "text": "def well_formed?()\n #This is a stub, used for indexing\n ...
94274fd7a832b1b709f13fa984176f16
Sets the select value. Calling again replaces the select value. Expects a string, else does nothing.
[ { "docid": "bb591413affe4d98e0289ee2a6da1b86", "score": "0.59890586", "text": "def select(select=nil)\n @options[:select] = select if select.kind_of?(String)\n end", "title": "" } ]
[ { "docid": "771333ba4e4a009018fb1121d1addf9c", "score": "0.73807234", "text": "def SetSelect(select)\n\t\t assert { select.instance_of? String }\n\t\t @select = select\n\t\tend", "title": "" }, { "docid": "19702817d10bc75d1ab1135d113542e2", "score": "0.73029244", "text": "def selec...
505c26142d9e5f712ab6f815c5ead926
evaluates if the key matches the matcher
[ { "docid": "9db8061c5ad04180bcab4d9869f79710", "score": "0.6637499", "text": "def match?(_args)\n @logger.log_if_debug('[AllKeysMatcher] is always -> true')\n true\n end", "title": "" } ]
[ { "docid": "510b86bbac37710eced980962f991725", "score": "0.77702755", "text": "def matches?(key)\n @key === key\n end", "title": "" }, { "docid": "8f50d96d2a3415b14454ddc3c080ec29", "score": "0.7431591", "text": "def key_matcher(pattern, options); end", "title": "" }, ...
db4f3242485d6773b3cb30814b0b15a4
Welcome, get user name
[ { "docid": "c4ca76f369317cf20f4c90bfad62c261", "score": "0.0", "text": "def welcome_menu\n puts \"\"\n puts \"\"\n puts \"Welcome to Gathered, a Magic the Gathering Deckbuilder\"\n puts \"\"\n puts \"Please tell us your full name:\"\n full_name = gets.chomp\n user = User.find_or_create_by(name: f...
[ { "docid": "38def7d073ddb5003a0e5029d7ea7a94", "score": "0.77442414", "text": "def display_user_name\n @username = name\n puts name\n end", "title": "" }, { "docid": "917fb24848dac096475291c750930adf", "score": "0.7720174", "text": "def home\n\t@name = @current_user ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "7e42c8ed1b0a5cd2622d8bc34fe8bc27", "score": "0.0", "text": "def column_params\n params.require(:column).permit(:name, :ident)\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...
e940b7d889b906eead74f85f4e3c14ec
Public: See `Pathnameglob`. Where both directories have a child with an identical path relative to the directory, only the entry belonging to the preferred directory is included. Returns an array of Pathnames.
[ { "docid": "3e88d579130ee540306686cde79b6ac5", "score": "0.5360446", "text": "def glob(pattern)\n paths = {}\n\n @fallback.glob(pattern).each do |entry|\n paths[entry.relative_path_from(@fallback).to_s] = entry\n end\n\n @preferred.glob(pattern).each do |entry|\n ...
[ { "docid": "50506098e442c862fb03b762ba938f10", "score": "0.65529424", "text": "def result_paths\n paths = Dir.glob( dir.join('*') ).map {|x|\n Pathname(x)\n }\n return paths\n end", "title": "" }, { "docid": "1dc4a3614077ba7f5aaa4bd4110c180f", "score": "0.6480487", "te...
57190484bf0b70426753fed71df5b682
Before filters confirms a loggedin user.
[ { "docid": "71d009d57c51186839d81582d2985073", "score": "0.0", "text": "def logged_in_user\n\tunless logged_in?\n\t\tflash[:danger] = \"please log in.\"\n\t\tredirect_to login_url\n\t\t\n\tend\n\t\nend", "title": "" } ]
[ { "docid": "d160c09a4f23b682b663a91f0eae42d4", "score": "0.7259845", "text": "def before_filter\n if current_user\n true\n end\n end", "title": "" }, { "docid": "60dfe3cd86044452707ee22115f2299c", "score": "0.70326555", "text": "def signed_in_user_filter\n if signed_in...
1e1fe8a1dd131042e16702c00da31996
def include(include_data_path, context, index, ped)
[ { "docid": "dc7ece6367484fbeda492752e47ee384", "score": "0.7358986", "text": "def include(context, index, ped)\n template_name = ped['_template']\n raise \"'_template' property not found in \\n#{ped.to_s}\" if template_name.nil?\n\n #liquid = Liquid::Template.parse(read_include(include_da...
[ { "docid": "ca2da6a1c101d95b000bfafe4419504e", "score": "0.70537573", "text": "def process_include! file, data, target_data\n data\n end", "title": "" }, { "docid": "c128974d6f477de7c718662574351ac2", "score": "0.6857731", "text": "def include; end", "title": "" }, { ...
d02ab61cbf889a6a0f51b6b771e1b2d9
GET /route_points/1 GET /route_points/1.xml
[ { "docid": "60005182e346858505489303d09d6d6b", "score": "0.7256042", "text": "def show\n @route_point = RoutePoint.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @route_point }\n end\n end", "title": "" } ]
[ { "docid": "e9458f66b65a3925bc6f2742b4031692", "score": "0.6861362", "text": "def route_xml(route_id, query_params = nil)\n get(\"/routes/#{route_id}/xml\", query_params)\n end", "title": "" }, { "docid": "87c5f473401c198cc4afdb165d45e12c", "score": "0.66131777", "text": ...
33a26442475bd94491a9a90d6f0b8d67
JWT authenticator instance. See peatiocore gem.
[ { "docid": "a7d8f558d1620db4f89c9862c213d8ff", "score": "0.8370744", "text": "def jwt_authenticator\n @jwt_authenticator ||=\n Peatio::Auth::JWTAuthenticator.new(Rails.configuration.x.jwt_public_key)\n end", "title": "" } ]
[ { "docid": "4bd05242f3051f45ed330873162d38fb", "score": "0.83461845", "text": "def jwt_authenticator\n @jwt_authenticator ||=\n Peatio::Auth::JWTAuthenticator.new(Rails.configuration.jwt_public_key)\n end", "title": "" }, { "docid": "2a2234f44b914e248a8045fa7cabd266", "score": "...
539a91a90bfe65ab0534618e93c5174b
A list of tags. For more information, see [Tagging Amazon RDS Resources][1] in the Amazon RDS User Guide. [1]:
[ { "docid": "30d06673100ce8a29edc49e6bd5d763a", "score": "0.0", "text": "def tag_list\n data[:tag_list]\n end", "title": "" } ]
[ { "docid": "2b8b25200382950b7be52fae7d3d90a0", "score": "0.7692301", "text": "def list_tags_for_resource(rds_id)\n resource_name = \"arn:aws:rds:#{@region}:#{owner_id}:db:#{rds_id}\"\n %w[us-gov-west-1 us-gov-east-1].include?(@region) ? resource_name.insert(7, '-us-gov') : resource_nam...
b0498c74f84050ac70b6ece3ba21f0ae
TODO: Use the asset compiler. We can't use it now because there is automatic digest support but currently no way to dynamically update all media links in views with digest path.
[ { "docid": "20802a84c034961914022235d53268b3", "score": "0.0", "text": "def run\n return unless setup_compilable\n\n @collection.files.values.each do |pointer|\n compiled_file = File.join(@collection.compiled_path, pointer['id'])\n FileUtils.mkdir_p File.dirname(compiled_file)\n ...
[ { "docid": "d8995f44ee01887044bff156f13955d4", "score": "0.61375314", "text": "def site_asset_media_url(src)\n rewrite_asset_path(DmCms::MediaUrlService.call(src))\n end", "title": "" }, { "docid": "1edc5c9a01fc2d6129e4b2c5211afb92", "score": "0.6044629", "text": "def site_as...
a25779f8d00d70093b4a61caf6963a11
POST /password_resets > trigger generating token and digest and sending email, send email w/ link to reset, redirect
[ { "docid": "f4ce7b26d23af858eb89f84e0182d6c9", "score": "0.0", "text": "def create\n @user = User.find_by(email: params[:password_reset][:email])\n if @user\n @user.create_pw_reset_digest\n @user.send_pw_reset_email\n flash[:info] = 'Check your email for reset link'\n redirect_...
[ { "docid": "9e693dae721b4c05501619d68b100bc0", "score": "0.80464745", "text": "def send_reset_password_token\n set_reset_password_token\n end", "title": "" }, { "docid": "4bf82e61c7d514146678ce22b13153e9", "score": "0.7954726", "text": "def request_password_reset\n end",...
d68e6ca65d6229a2f0228d704f169716
Test if the rdf_subject that would be generated using a specific URI is already in use in the triplestore.
[ { "docid": "555689148cdf81978725dff2c15abb41", "score": "0.666762", "text": "def uri_persisted?(test_uri)\n test_uri = RDF::URI.intern(test_uri) unless test_uri.is_a?(RDF::URI)\n\n ActiveTriples::Repositories.has_subject?(test_uri)\n end", "title": "" } ]
[ { "docid": "2c25f74439b82c90cc7c1b804cbb5922", "score": "0.6157756", "text": "def valid?\n li = subject\n list_nodes = []\n while li != RDF.nil do\n return false if list_nodes.include?(li)\n list_nodes << li\n rest = nil\n firsts = rests = 0\n @graph.que...
9e31d08cfd4a39001797a30dda7e7393
POST /add_investment_months POST /add_investment_months.json
[ { "docid": "bf12bdbb30072f7429588d2e6368a631", "score": "0.7249456", "text": "def create\n @add_investment_month = current_user.add_investment_months.build(add_investment_month_params)\n @add_investment_month.user_scenario = @user_scenario\n\n respond_to do |format|\n if @add_investment_mo...
[ { "docid": "873b5c64fb14e68b67c9278430675a9c", "score": "0.75993085", "text": "def set_add_investment_month\n @add_investment_month = AddInvestmentMonth.find(params[:id])\n end", "title": "" }, { "docid": "ab9fd5894d23c8aa23b89218f03953c3", "score": "0.70773494", "text": "def...
37fefd8836e6f4b562135d72d4a45b09
GET /maps/new GET /maps/new.xml
[ { "docid": "b8c31ce546aa914283ca9ab1c65c5646", "score": "0.7700167", "text": "def new\n @map = Map.new\n\n puts @saved_locations\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @map }\n end\n end", "title": "" } ]
[ { "docid": "3d4f9d1137910935d66f92299565c7d3", "score": "0.78073", "text": "def new\n #TODO\n @map = Map.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @map }\n end\n end", "title": "" }, { "docid": "242b08940ddec68d574b08dc4...
094cb62b4201147aa4e577aabf205a89
so let us make the templates for prepaid and postpaid orders and policy settings. OVERRIDES FROM FORM CONCERN > to show nested objects.
[ { "docid": "4609787c7275c66ed9b098cca1216b5a", "score": "0.0", "text": "def summary_row(args={})\n\t\t'\n\t\t\t<tr>\n\t\t\t\t<td>' + self.created_at.strftime(\"%b %-d_%Y\") + '</td>\n\t\t\t\t<td>' + (self.payable_to_organization_id || \"-\") + '</td>\n\t\t\t\t<td>' + (self.payable_from_organization_id |...
[ { "docid": "ca601c00ed52efad47306e6991179370", "score": "0.5877342", "text": "def show\n @ordereds=Ordered.all\n @preparats=Preparat.all\n @order.ordereds.build\n end", "title": "" }, { "docid": "bb2752d3b49059aa368cea10d861472d", "score": "0.56951207", "text": "def new_bas...
362656c4adf42c63818e69d3a58ad021
GET /at_strings GET /at_strings.json
[ { "docid": "56dbf8e451d289ade57c1db7442c4074", "score": "0.0", "text": "def index\n @user=User.find(session[:user_id])\n @app = @user.apps.find(params[:app_id])\n ApplicationHelper.readHeader params[:app_id]\n end", "title": "" } ]
[ { "docid": "ad6257b1de5234c96fffc1fd4e9c18b9", "score": "0.60274917", "text": "def test_sample_string\n get '/speakersats'\n\n assert last_response.ok?\n\n assert_includes last_response.body, '[\"speak\", \"ersats\"]'\n end", "title": "" }, { "docid": "aa1e627c0a0815a93136c395d806a...
2bca4411001aa204c415efdd6b0b2afd
This will generate a packet on proto to IP on port
[ { "docid": "78f64e27c2b520c4f35000a4be5bde66", "score": "0.5198394", "text": "def winapi_egress_to_port(proto, remote, dport, num)\n socket_handle = winapi_create_socket(proto)\n if socket_handle['return'] == 0\n vprint_status(\"[#{num}:WINAPI] Error setting up socket for #{remote}; Error: #{...
[ { "docid": "4e41e2f9a4b1630e06944a6d4f73ee5e", "score": "0.6701738", "text": "def makePacket(dest_ip, src_ip, type, seqNum, ackNum, data)\n\tpacket = Packet.new\n\n\tpacket.dest_ip = dest_ip\n\tpacket.src_ip = src_ip\n\tpacket.type = type\n\tpacket.seqNum = seqNum\n\tpacket.ackNum = ackNum\n\tpacket.dat...
691c31cc30f905d5080724051f08027f
approachbased: [generic] [a/an] [buzz2] approach
[ { "docid": "c862ebe2d69bb31ec32e115aab0b69b0", "score": "0.0", "text": "def approach_based\n buzz2 = gen_word :buzz2\n article = ResearchTopicGen.add_article( buzz2 )\n \"#{generic} - #{article} #{buzz2} approach\"\n end", "title": "" } ]
[ { "docid": "b54531b8acbe83da08913cdafbf2a7a5", "score": "0.6253213", "text": "def generic\n end", "title": "" }, { "docid": "37ce1d614df88bb64e8d4bc230337ecf", "score": "0.55396736", "text": "def test_genericAccess\r\n e1 = mm::OneClass.new\r\n e2 = mm::ManyClass.new\r\n e3...
53f049d462997bcc70c14c2901a559fb
Adds errors if course_is_is_valid? returns false
[ { "docid": "19170ee61f8e212137bb8be6712b0f65", "score": "0.78653777", "text": "def course_id_is_valid\n errors.add(:course_id, \"No valid class was selected.\") unless course_id_is_valid?\n end", "title": "" } ]
[ { "docid": "6378284b3069b2dba1e15e2332501268", "score": "0.7253244", "text": "def valid_course\n\t\tif not Course.find_by(courseID: courseID)\n\t\t\terrors.add(:courseID, 'is not valid. Please enter a valid ID (8 characters)')\n\t\tend\n\tend", "title": "" }, { "docid": "cf625b8961d16c469507...
7138140cd7c7aee32f1a124d95bbccd1
GET /checkouts GET /checkouts.json
[ { "docid": "d9a9f796af6200c0e729e64727e9edf9", "score": "0.74400604", "text": "def index\n @checkouts = Checkout.all\n end", "title": "" } ]
[ { "docid": "d60fe54e6e038282d7228474d441613d", "score": "0.78371465", "text": "def index\n @checkouts = Checkout.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @checkouts }\n end\n end", "title": "" }, { "docid": "7e0866729316b3...
ca2193e876d50f9337937c30d6dc48c4
Enables or disables server certificate verification by the client. Server certificate verification is enabled by default when style is set to CERTIFICATE. Hostname (CN) verification is always enabled during server certificate verification.
[ { "docid": "8a1e04a045520eb52276b00e4978922b", "score": "0.74996847", "text": "def set_server_cert_verification(enable)\n unless(enable.eql?(true) or enable.eql?(false))\n fail_response(13001, \"NaServer::set_server_cert_verification: invalid argument \" + enable + \"specified\");\n end\n ...
[ { "docid": "45cab224ccf5d6023aa814a5d1641cf8", "score": "0.73143", "text": "def server_cert_verification_enabled?\n @enable_server_cert_verification\n end", "title": "" }, { "docid": "0e0d3759f14cb0e078704f429975436f", "score": "0.6844127", "text": "def set_style(style)\n if(!...
ced2317425440b530b30af1e8c63677e
Bring a packed lunch on all weekdays
[ { "docid": "a4baad6fa7f3d70d5973b14e60de0454", "score": "0.75145555", "text": "def pack_lunch\n day_of_week = @attributes[:day_of_week]\n if weekday?\n @items << 'packed lunch'\n elsif\n @items << 'snacks'\n end\n end", "title": "" } ]
[ { "docid": "b3d5955b0dbf519a2f7d42e1df98ec79", "score": "0.68886983", "text": "def lunch(day)\n\tday = day.downcase\n\tcase day\n\twhen \"sunday\"\n\t\t\"steak\"\n\twhen \"monday\"\n\t\t\"hamburgers\"\n\twhen \"tuesday\"\n\t\t\"pasta salad\"\n\twhen \"wednesday\"\n\t\t\"eggplant parmesan\"\n\twhen \"thu...
94847ad17e21675369f0113892548303
Sends a POST request to the given address and returns a hash containing the parsed response body and the raw Patron response
[ { "docid": "32e87f2ac3cc0e97d9cc6e62f42ebb58", "score": "0.0", "text": "def request(endpoint, body, content_type, retry_limit: 0)\n http_rate_limiter.shift if rate_limit_enabled?\n\n request_options = {\n read_timeout: read_timeout,\n idempotent: true,\n retry_limit: retry...
[ { "docid": "5fa14584b352ade31254654c50a59ed6", "score": "0.6578528", "text": "def http_post(url, hash=nil, _port=nil, headers=nil)\n \n resp, data = http_request(url, \"post\", hash, _port, headers)\n\treturn [resp, data]\nend", "title": "" }, { "docid": "9a4d5e6a27d2602e9e98faca47147d5e"...
ce20f86275ca528ce2e13097d4982458
Reads the configuration file containing the google account (spare me the insecure bullshit, you should not be using your own google account/calendar. Just create a new one to use with this gem)
[ { "docid": "d2c7a3b5338fe92ce37f9c8efacbf1db", "score": "0.58987284", "text": "def read_config\n YAML.load_file(File.expand_path('~/.alvalaxiarc'))\n end", "title": "" } ]
[ { "docid": "7786b0802b9bfd5676549e7c26d68150", "score": "0.714599", "text": "def read_client_secrets\n file_path = Rails.root.join('config', 'client_secrets.json')\n Google::APIClient::ClientSecrets.load(file_path)\n end", "title": "" }, { "docid": "c9eed95f91d261b822f08238c458755a", ...
202e49890643958390cb5d848bd70c05
POST /leave_cards POST /leave_cards.xml
[ { "docid": "c257a82e21e94d145cc4a4eb0fb8f285", "score": "0.6194621", "text": "def create\n @leave_card = LeaveCard.create_card(params, @company.id)\n @user = @leave_card.user\n @leave_cards = LeaveCard.current_leave_card @leave_card.user_id\n respond_to do |format|\n @leave_card.save\n ...
[ { "docid": "26af55c7d56cce4161463f0b03182490", "score": "0.6143038", "text": "def destroy\n @leave_card = LeaveCard.find(params[:id])\n @leave_card.destroy unless @leave_card.utilized?\n\n respond_to do |format|\n format.html { redirect_to(\"/users/#{@leave_card.user_id}/#leaves\") }\n ...
f533632b36824adeb524a5a39c688ccb
Question 3 Alan wrote the following method, which was intended to show all of the factors of the input number:
[ { "docid": "ba627e5a97281692dc5420fbdb38c4be", "score": "0.0", "text": "def factors(number)\n dividend = number\n divisors = []\n begin\n divisors << number / dividend if number % dividend == 0\n dividend -= 1\n end until dividend == 0\n divisors\nend", "title": "" } ]
[ { "docid": "aeaa92e920adfc1bdfdb8456bf23f5f2", "score": "0.8396479", "text": "def factors(num)\nend", "title": "" }, { "docid": "aeaa92e920adfc1bdfdb8456bf23f5f2", "score": "0.8396479", "text": "def factors(num)\nend", "title": "" }, { "docid": "aeaa92e920adfc1bdfdb8456bf...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "5fe289f2c3668e06d99ce15aa04fe38f", "score": "0.0", "text": "def set_sushi_menu\n @sushi_menu = SushiMenu.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...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "1184161c62ff79a9a8c6a951ab5e6eee", "score": "0.0", "text": "def set_product\n @product = Product.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...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "0933e5622363b52ca8180cf2c64aef3b", "score": "0.0", "text": "def student_params\n params.require(:student).permit(:name, :student_number, :gpa)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.79428834", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.6957111", "text": "def permitted_params\n params.permit!\n end", "title"...
8bc295844bce46dbdcbe2e45198769de
GET /tests GET /tests.json
[ { "docid": "4d64cd2c00307ded89834caa604240f9", "score": "0.0", "text": "def index\n @configs = Config.all\n if @configs.count > 0\n @config=Config.first\n redirect_to edit_config_path(@config)\n else\n Config.create(title:'title',tel:'0877-1234567',mail:'examp@mail.com',address:'...
[ { "docid": "dd9894340d4cf16757baca74371f9f43", "score": "0.77281153", "text": "def test\n get(\"/help/test.json\")\n end", "title": "" }, { "docid": "dd9894340d4cf16757baca74371f9f43", "score": "0.77281153", "text": "def test\n get(\"/help/test.json\")\n end", "ti...
d0df87b1bea9b55706b1c7c4184cdaba
PATCH/PUT /posts/1 PATCH/PUT /posts/1.json
[ { "docid": "e69dc3174b63e29bdb2f11bc9f4504de", "score": "0.0", "text": "def update\n @comment = Comment.new\n if post_params[:condition_ids].present?\n if post_params[:condition_ids].delete('my_conditions')\n post_params[:condition_ids].concat(Array.wrap(current_user.main_condition_id)...
[ { "docid": "34c10c4557f689baa30ce671828a8692", "score": "0.7020792", "text": "def update\n @api_v1_post = Post.find(params[:id])\n params[:post].delete :created_at\n params[:post].delete :updated_at\n respond_to do |format|\n if @api_v1_post.update_attributes(params[:post])\n for...
673e83fc40cca2d73fd2a6aa089100af
Control the serialization of the model by specifying the relations, properties, methods, and other data to serialize with the model. Parameters take the same form as serializable_hash see active record/active model serialization for more details. If not serialized to an intermediate form before it reaches the AMF seria...
[ { "docid": "b50e92f79edcf5417f8d8f529d7b0388", "score": "0.0", "text": "def to_amf options=nil\n options ||= {}\n\n # Create props hash and serialize relations if supported method available\n props = serialize_properties(options)\n\n Rails3AMF::IntermediateModel.new(self, props)\n ...
[ { "docid": "47c2f40a65d7c985eb5c911d053bf24d", "score": "0.66082793", "text": "def serialize(options = {})\n @attribute_map.resolve! unless @attribute_map.resolved?\n serializable_record\n end", "title": "" }, { "docid": "928a998d88a5768d2b786abf83595009", "score": "0.653377...
619f276904f4c5df04a8e7dcd0dc4825
Chooses whether the file should be rendered from the repos +_view/+ or the one provided by Oy!
[ { "docid": "3e130e8acd8f50475df8c499cce2c344", "score": "0.7150574", "text": "def oy_render_file(file, opts = {})\n path_in_repos = File.join(\"_view\", file)\n if OY::Repos.exist?(path_in_repos)\n render_file(OY::Repos.expand_path(path_in_repos), opts)\n else\n render_file(File.join(...
[ { "docid": "04a115dafd36bf577ebf12354000959a", "score": "0.67450845", "text": "def view_file(type)\n if (type == :html)\n \"#{DirMap.html_views}/entries/gallery.html.erb\"\n else\n \"#{DirMap.html_views}/entries/gallery.html.erb\"\n end\n end", "title": "" }, { "docid": "...
19218dde8e3f789ea2d98c5558c27295
return a hash of the serialized credit card object
[ { "docid": "04e0269c097112f4008ade598ab9de34", "score": "0.9011937", "text": "def hash\n # TODO: Produce a hash (using default hash method) of the credit card's\n # serialized contents.\n # Credit cards with identical information should produce the same hash.\n to_s.hash\n end",...
[ { "docid": "5377deb89dce8b07f351220bbea9a28b", "score": "0.8983513", "text": "def hash\n # TODO: implement this method\n # - Produce a hash (using default hash method) of the credit card's\n # serialized contents.\n # - Credit cards with identical information should produce the same ...
39cabd9cc1deba2a9bd1f7e99606fc81
Returns the Github application client secret token
[ { "docid": "376963925b71fc5f9c478c1b5b6d36a7", "score": "0.8031789", "text": "def github_client_secret\n Rails.application.secrets.github_client_secret\n end", "title": "" } ]
[ { "docid": "a0e0a0a82268bae69b37ffb5d8d00f1a", "score": "0.78900313", "text": "def github_client_id\n Rails.application.secrets.github_client_id\n end", "title": "" }, { "docid": "064db6eb649438aa309b01937f0a5f9c", "score": "0.76030743", "text": "def github_access_token\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "2a0f836131560434f1c0a3476f0fabc8", "score": "0.0", "text": "def set_barcode\n @barcode = Barcode.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.6032574", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6015663", "text": "def...
5dcbeed2ab6624bc7ccf7dff18357e64
GET /eventos/1 GET /eventos/1.json
[ { "docid": "cc83a27e53dd15604bbbbf272b791cc4", "score": "0.0", "text": "def show\n @evento = Evento.find(params[:id])\n @disciplina = Disciplina.find(@evento.disciplina_id)\n\n\n if @disciplina.jugadoresPorEquipo == 1\n query = Jugadore.joins(' JOIN jugadores_eventos ON jugadores_eventos.j...
[ { "docid": "13bb342fa981d795a1de15164f7e08c9", "score": "0.7041549", "text": "def event\n domain, stream_id, event_name = options.resources.split('/')\n api.get(\"/#{domain}/stream/#{stream_id}/event/#{event_name}\")\n end", "title": "" }, { "docid": "cef849748b5112250f4c4175c23...
5acd92c2719921dd2694566b90a2c7cd
DELETE /versions/1 DELETE /versions/1.json
[ { "docid": "dedc8f75352c5c1686a7a56bbe22ebeb", "score": "0.68620384", "text": "def destroy\n @project = Project.find(params[:project_id])\n @version = Version.find(params[:id])\n @version.destroy\n\n respond_to do |format|\n format.html { redirect_to @project }\n format.json { head...
[ { "docid": "179ff0053e8f4f967cb3d92206094cf0", "score": "0.7976991", "text": "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "title": "" }, { "docid": "659dcbd8b16a45788e0377e5285a8edd", "score": "0.78395194", "text": "def destr...
06f3e9e68dc8a09bbef91d63931d3565
Abstract thread logic method which must be implemented by the subclass.
[ { "docid": "e65b3fda2bae51210d4df02455374d91", "score": "0.0", "text": "def go\n raise NotImplementedException\n end", "title": "" } ]
[ { "docid": "726c6755ed6d69c45e6dad965ba4002b", "score": "0.7447148", "text": "def thread; end", "title": "" }, { "docid": "726c6755ed6d69c45e6dad965ba4002b", "score": "0.7447148", "text": "def thread; end", "title": "" }, { "docid": "726c6755ed6d69c45e6dad965ba4002b", ...