query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
02e6f1c98a8be362da78645e12136a69
ClassMethods Process XML documents from VM scans
[ { "docid": "d377e0d22c50c47296cacef392e0fa27", "score": "0.0", "text": "def add_elements(xml_node)\n return if xml_node.nil?\n _log.info(\"Adding XML elements for [#{id}] from [#{xml_node.root.name}]\")\n updated = false\n\n # Find out what XML file document we are being passed.\n case xm...
[ { "docid": "226afdbb83dea4fac02bae53b5a1d3cb", "score": "0.60786915", "text": "def process_xml(string)\n xml_processor_helper(create_document(string))\nend", "title": "" }, { "docid": "cbd8f4e0fdfb52bd46eb05de39280380", "score": "0.60447717", "text": "def run\n @xml.xpath(@obje...
e8697989daf7567bdc50196131210372
=> ["i", "o", "d", "t"] Reflection What parts of your strategy worked? What problems did you face? Once I decided to take the liberty of adding another parameter to the methods things went smoothly. What questions did you have while coding? What resources did you find to help you answer them? No questions on this one. ...
[ { "docid": "fec3cc75f0efbf6eff498b670932ad2e", "score": "0.58690894", "text": "def get_col(col, board)\n board.map{ |board| board[col] } \nend", "title": "" } ]
[ { "docid": "e57664b633040d84340358e7343cac0e", "score": "0.589998", "text": "def create_word(board, *coords) # this is defining the method that will accept a board argument, and an indefinite (splat) amount of arguments.\n coords.map { |coord| board[coord.first][coord.last]}.join(\"\") # this will cr...
9e583e6f1cef83e712bb674a282aceee
Run this deployment process. It will loop through all nodes running task until the deployment will be considered finished. Deployment is finished if all the nodes have all tasks finished successfully, or finished with other statuses. Actually, it's enough to check only for finished nodes.
[ { "docid": "6fe4a47407587e8e16f3ab0b104a827f", "score": "0.8556251", "text": "def run\n info 'Starting the deployment process'\n loop do\n if all_nodes_are_successful?\n info 'All nodes are deployed successfully. Stopping the deployment process'\n break true\n e...
[ { "docid": "80b28632b6b3beb7bce971c5d8a2f681", "score": "0.8722818", "text": "def run\n ready_nodes = each_ready_task.to_a.join ', '\n info \"Starting the deployment process. Starting tasks: #{ready_nodes}\"\n hook 'internal_pre_run'\n hook 'pre_run'\n topology_sort\n resul...
8ee72932ef69df11e88b53564d853e59
Returns the object in the form of hash
[ { "docid": "7f2e5dd34e628cb49304452d2dd73178", "score": "0.0", "text": "def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n next if value.nil?\n hash[param] = _to_hash(value)\n end\n hash\n end", "title...
[ { "docid": "027facb8b195665ceeb78f2c171e2881", "score": "0.8270299", "text": "def to_hash\n object\n end", "title": "" }, { "docid": "d730a9ea60df6695b2c6a153d7d3a8b7", "score": "0.794916", "text": "def hash\n as_hash.hash\n end", "title": "" }, { "docid":...
00d7f7f8f5bf775e1a68b36dee99050a
GET /operator_allocations GET /operator_allocations.json
[ { "docid": "62a27358d1937746bb8a3b95b4299218", "score": "0.76112336", "text": "def index\n @operator_allocations = OperatorAllocation.all\n end", "title": "" } ]
[ { "docid": "b8671dcb59ec6a3928543899f669f65f", "score": "0.6598622", "text": "def list_resource_allocations; end", "title": "" }, { "docid": "ce12a43903ad995e7fe17b6e5fd013d8", "score": "0.65836763", "text": "def allocations\n network = Network.find_key params[:id]\n raise \"Mu...
873cad270d62e6d1d6caa2b1fe4a0ce6
Check if this pitch class set is more tightly packed to the left than the comparison pitch class set. Returns false if less tightly packed or if is the same set
[ { "docid": "c3e8f5c5b4169fc63c98f58b7f111f91", "score": "0.75398165", "text": "def is_more_packed_than?(pitch_class_set)\n\t\t\treturn false if (@pitch_classes.size != pitch_class_set.pitch_classes.size || @pitch_classes.size == 0) || eql?(pitch_class_set)\n\n\t\t\trpcs = pitch_class_set.pitch_classes.r...
[ { "docid": "e75e406e9e8e8a810d73e79d98bfb444", "score": "0.5774204", "text": "def most_left_compact(pcset_array)\n if !pcset_array.all? {|pcs| pcs.length == pcset_array[0].length}\n raise ArgumentError, \"PCSet.most_left_compact: All PCSets must be of same cardinality\", caller\n end\n zer...
c2064f4e55237009a6002e0697e9379b
to retrive the text of given element
[ { "docid": "7d88fada1475a2b467f21c7ebe44264c", "score": "0.73246044", "text": "def get_text(type,ele)\n ref=$array[\"#{ele}\"]\n path=ele.split(\"_\").last\n if type == \"button\"\n return $browser.button(:\"#{path}\", \"#{ref}\").text\n elsif type == \"div\"\n return $bro...
[ { "docid": "d928222c81c81fa51f56234213681b85", "score": "0.9028492", "text": "def get_text(element)\n element.text\n end", "title": "" }, { "docid": "092a748840d65ec3613b61cd526c42e5", "score": "0.8517634", "text": "def user_get_text(element)\r\n begin\r\n key_processor(e...
58b64ce9746d173d290e6293f1c513b2
POST /operarios or /operarios.json
[ { "docid": "696a471d4e66a9b393a4938559480f61", "score": "0.68187755", "text": "def create\n @operario = Operario.new(operario_params)\n\n respond_to do |format|\n if @operario.save\n format.html { redirect_to @operario, notice: \"Operario was successfully created.\" }\n format.j...
[ { "docid": "75d5604574ba25787806d79bdbb981c5", "score": "0.6617358", "text": "def create\n @operador = Operador.new(params[:operador])\n\n respond_to do |format|\n if @operador.save\n format.html { redirect_to @operador, notice: 'Operador was successfully created.' }\n format.js...
90c989303c5d84cf956815e846dc19f3
resident '/residents' where you go after new: the form displayed in "new.html.erb" is submitted to '/residents' using verb method="resident" which is routed to residentscreate.
[ { "docid": "1634755cd4d52bd24f1ce78779b6d3a0", "score": "0.7491978", "text": "def create \n # the form displayed in \"new.html.erb\" is submitted to '/residents' \n # using verb method=\"resident\" which is routed to residents#create.\n # @resident, is populated with values submitted from the f...
[ { "docid": "0e2e09402118ab8872e80434b4ed8674", "score": "0.7290012", "text": "def create\n @resident = Resident.create(resident_params)\n redirect_to '/residents'\n end", "title": "" }, { "docid": "06547aa840dbc11af7703cd5b2e8ac60", "score": "0.7087783", "text": "def new\n ...
548d6ed9eeffa876560b575d903b9879
This method adds all new runs (creating instances where required) in the list provided AND removes any runs no longer in the list.
[ { "docid": "550ae12047ba30e2e8e84ec33f675faf", "score": "0.61578006", "text": "def refresh_all!(run_list, credentials = nil)\n cache = user_cache(credentials)\n\n # Add new runs to the user cache.\n run_list.each_key do |id|\n if !cache.has_key? id\n cache[id] = ...
[ { "docid": "fb38f446acd591196a44cd5e5a60dc9e", "score": "0.6291329", "text": "def set_run_list(node, entries)\n node.run_list.run_list_items.clear\n entries.each { |e| node.run_list << e }\n end", "title": "" }, { "docid": "2e58dc9563a9eebe3cd0d78ada07085c", "score": "...
5d75e88cc1763568eaf815dc54977d1c
find all Authors (Author, Screenplay and Story)
[ { "docid": "07a06ffd06d0e3c52e6d29be2b15efe0", "score": "0.7076026", "text": "def test_movie_authors\n movie = Movie.find( movies(:the_39_steps).id )\n authors = movie.authors.collect{ |c| c.person }\n\n assert authors.include?( people(:john_buchan) )\n assert authors.include?( people(:cha...
[ { "docid": "afdfd5607ab3b08a4fd634fb32673a64", "score": "0.7605901", "text": "def authors()\n authors_or_editors(@text[:author].to_names) if @text[:author]\n end", "title": "" }, { "docid": "f673d78ddc2cfd86e11b67afee5adc04", "score": "0.7458618", "text": "def authors\n ...
6b644ffcdccdac53c33f791b56747a9e
End of decrement function Function: display Description: Displays the current karma level of the requested element. If the element does not exist in the DB, it has neutral (0) karma.
[ { "docid": "6fb7d3ad48e8fddbe26c22fa2ea0a03a", "score": "0.6182638", "text": "def display(m,arg)\n arg.downcase!\n if @@karma_db.has_key?(\"#{arg}\")\n m.reply \"#{arg} has karma of #{@@karma_db[arg]}.\"\n else\n m.reply \"#{arg} has neutral karma.\"\n e...
[ { "docid": "05e8c2bfb20845a43834156543c655e9", "score": "0.69248456", "text": "def display_karma(m, element)\n karma_value = @karma_db[element.downcase.strip]\n if karma_value.nil?\n m.reply(\"#{element.strip} has neutral karma.\")\n else\n m.reply(\"#{element.strip} has karma of #{ka...
594b5a3d8e46c408026a05afe3c32505
POST /people POST /people.xml
[ { "docid": "ffd0958bd6afa49d2562d31ab4c245da", "score": "0.0", "text": "def create\n @person = Person.new(params[:person])\n current_user.confirm(@person)\n\n #Atribui a filial do usuário corrente, caso o mesmo não seja administrador ou diretor\n @person.subsidiary = current_user.person.sub...
[ { "docid": "9cf96f38dc025371acec30fef5762fc2", "score": "0.7055851", "text": "def create(name=\"Default Name\", age=\"50\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <person>\r\n <name>#{name}</name>\r\n <age>#{age}</age>\r\n </person>\"\r\n \r\n request = N...
8e499422dc06e4321566d5e3b358f5f9
GET /devices/new GET /devices/new.xml
[ { "docid": "1909304ce57b10fd2a7fa59c6e3651c6", "score": "0.0", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n end\n end", "title": "" } ]
[ { "docid": "d1bbe9edcc50de99daad6ee51e2f1191", "score": "0.7328918", "text": "def new\n @device = Device.new\n\n respond_to do |format|\n format.html { render :template => 'devices/new', :layout => false}\n format.xml { render :xml => @device }\n end\n end", "title": "" }, {...
d8147824c53f7e91393d7271b9601f51
Checks whether the game is currently being destroyed.
[ { "docid": "dfd9a54b63bd98a3c5247c4a22b49421", "score": "0.71508515", "text": "def being_destroyed?\n @being_destroyed\n end", "title": "" } ]
[ { "docid": "201417c5ec0ae386572883deed86b459", "score": "0.7470011", "text": "def destroyed?\n @destroyed == true\n end", "title": "" }, { "docid": "201417c5ec0ae386572883deed86b459", "score": "0.7470011", "text": "def destroyed?\n @destroyed == true\n ...
4b43643c089c18d1687cdc25219ac0c5
Sum an array by the first (n) numbers
[ { "docid": "f13990a7182f7a871f5a0b41b35e46ca", "score": "0.6937435", "text": "def sum_numbers(arr, n)\n sum = 0\n index = 0\n\n arr.each do |i|\n if index != n \n sum += i\n else\n return sum\n end\n\n index += 1\n end\nend", "title": ...
[ { "docid": "e99e609b777402b7faa9343af1859640", "score": "0.793868", "text": "def sum_of_sums(array)\n new_array = []\n array.size.times do |n|\n new_array << array[0..n]\n end\n new_array.flatten.reduce(:+)\nend", "title": "" }, { "docid": "30589317cddee4f73114efb33f00f248", "scor...
517c882520e9a0bd8adeb9e4a28fa50c
GET /imported_ma_news/1 GET /imported_ma_news/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "40c322358ca120db718cfa5af1db0134", "score": "0.733623", "text": "def index\n @imported_ma_news = ImportedMaNew.all\n end", "title": "" }, { "docid": "6851840c0232c348519cf831055efcfd", "score": "0.7006783", "text": "def index\n @import_fa_news = ImportFaNew.all\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "bbed037d17f55c13261eff88418d1289", "score": "0.0", "text": "def set_anlage\n @anlage = Anlage.find(params[:id])\n @kategorie_options = {}\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...
979d830caf96bb4916f2d29d9e7249b4
resource decorators will use this method if they define :member_of_collections in self.display_attributes
[ { "docid": "0eb4b95799b5c136ea7e901c677485a0", "score": "0.57867396", "text": "def member_of_collections\n return [] unless model.respond_to?(:member_of_collection_ids)\n @member_of_collections ||=\n begin\n query_service.find_references_by(resource: model, property: :member_of_collect...
[ { "docid": "69156c193034f46cb24e5193cdcb3e27", "score": "0.64159304", "text": "def view_collection\n collection unless @target.is_a? Model::Discipline\n end", "title": "" }, { "docid": "318b4aca0693ff1994e4d7dbc817e38f", "score": "0.6396886", "text": "def show_obj\n @c...
ea8537c4cde314566c89a51b2d752f13
def while_iterator(number_of_times) counter = 0 while counter < 8 phrase = "Welcome to Flatiron School's Web Development Course!" puts phrase counter += 1 end end
[ { "docid": "fad6a7efa4c23fd24170648082541cf2", "score": "0.9113535", "text": "def until_iterator(number_of_times)\n counter = 0 \n until counter == 7 \n phrase = \"Welcome to Flatiron School's Web Development Course!\"\n puts phrase\n counter +=1 \nend\nend", "title": "" } ]
[ { "docid": "b419c1fcd560e41812c4b2d865b5759a", "score": "0.89022255", "text": "def while_iterator(number_of_times)\n number_of_times = 7\n while number_of_times > 0 \n puts phrase = \"Welcome to Flatiron School's Web Development Course!\"\n number_of_times -= 1\n end\n \nend", "title": "" ...
8a21f650e57b4652e4951dbe5274a6b0
GET /zamowienias GET /zamowienias.json
[ { "docid": "ea776b57058af114fc355fc196a6dc45", "score": "0.74904424", "text": "def index\n @zamowienias = Zamowienia.all\n end", "title": "" } ]
[ { "docid": "4aa61ee932131617a1ba16f32badb56a", "score": "0.7092681", "text": "def index\n @zamowienia = Zamowienium.all\n end", "title": "" }, { "docid": "082fdbe07fbab798cf58e51109ad38b6", "score": "0.6942317", "text": "def index\n @zones = Zone.all\n render json: @zones\n...
53ba2e044d9c47e16fc263e645c28988
PUT /validators/1 PUT /validators/1.json
[ { "docid": "aff647c54dccaa0b6a76c2106d78ad49", "score": "0.63129747", "text": "def update\n @validator = Validator.find(params[:id])\n\n respond_to do |format|\n if @validator.update_attributes(params[:validator])\n format.html { redirect_to @validator, notice: 'Validacion fue modifica...
[ { "docid": "afd2dcb9ad81d09c509de4db753c4f70", "score": "0.59493124", "text": "def update\n @validator = Validator.find(params[:id])\n\n respond_to do |format|\n if @validator.update_attributes(params[:validator])\n format.html { redirect_to(@validator, :notice => 'Validator was succes...
7ea28d421ff964a0361ec26d7120acdc
Return the default behavior corresponding to the response code: the response itself for code in 200..206, redirection for 301 and 302 in get and head cases, redirection for 303 and an exception in other cases
[ { "docid": "dbffca7448fd608abbf7bd89b8de8cae", "score": "0.7310246", "text": "def return! &block\n if (200..206).include? code\n self\n elsif [301, 302].include? code\n unless [:get, :head].include? args[:method]\n raise Exceptions::EXCEPTIONS_MAP[code], self\n el...
[ { "docid": "daa213dbce82caa4663be78a514f9e8a", "score": "0.7364652", "text": "def return! request = nil, result = nil, & block\n if (200..207).include? code\n self\n elsif [301, 302, 307].include? code\n unless [:get, :head].include? args[:method]\n raise Exceptions::EXC...
54af75d0a0b8cda8d91e917c7d519b17
Creates a Lazy Enumerator for the KeyValue list. If called inside the app's `in_parallel` block, will prefetch results.
[ { "docid": "802288a2776481c5a3771ad7a02c6828", "score": "0.53541774", "text": "def lazy\n return each.lazy if collection.app.inside_parallel?\n super\n end", "title": "" } ]
[ { "docid": "7d89772cf331a9f1f9e6a48631edd42d", "score": "0.7088053", "text": "def lazy\n KeyValueList.new(self).lazy\n end", "title": "" }, { "docid": "d026cb263ad986b8147c7c06dbf2c855", "score": "0.6626731", "text": "def lazy\n return each.lazy if key_value.collection...
94c6ecafa9fe7d882b44397e738ba2e4
processes the job received and registers itself inside the manager
[ { "docid": "495f0996bd859750b41d2666422f3b5d", "score": "0.0", "text": "def initialize(*args)\n job = args[0]\n @processor = args[1]\n job = job.stringify_keys\n @job = job\n process_job(job)\n processor.register_worker_for_job(job, self)\n end", "title": "" } ]
[ { "docid": "e7498299f04226d63442c09035bb957d", "score": "0.7368175", "text": "def process(job)\n\n end", "title": "" }, { "docid": "58e685248f9df92ace53c78f0afe2d41", "score": "0.67429906", "text": "def handle_messages(&block)\n self.class.each_file(@new_dir, Chore.config...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "7348948073e0fa81aac027b746c3f88d", "score": "0.0", "text": "def update!(**args)\n @display_name = args[:display_name] if args.key?(:display_name)\n @etag = args[:etag] if args.key?(:etag)\n @field_id = args[:field_id] if args.key?(:field_id)\n @field_name ...
[ { "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...
5273913fcf4d2598c1f35c26a46854a6
give me all the songs where Beyonce is wearing a bodysuit or a bodysuit is part of the video theme
[ { "docid": "510f561305f00f85c5a7397dabfc2dce", "score": "0.0", "text": "def bodysuit_list(beyonce)\n bodysuits = []\n beyonce[:hits].each do |hit|\n if hit[:signatureLook].include?(\"bodysuit\")\n bodysuits.push(hit[:title])\n end\n end\n puts bodysuits\nend", "title": "" } ]
[ { "docid": "18870756df5a11d89952319f91548cd7", "score": "0.6620661", "text": "def if_guest_fav_song_played(room)\n room_song_title_list =room.title_of_songs()\n guest_fav_song_list = room.guests_fav_song_list()\n for song in guest_fav_song_list\n room_song_title_list.find{|room_song| room...
e845171364278cb2c1cfc06ff73ab4d6
TODO Implement baselines on x and y axis ~ def test_baseline_larger_than_data ~ g = setup_basic_graph(400) ~ g.title = "Baseline Larger Than Data" ~ g.baseline_value = 150 ~ g.write("test/output/scatter_large_baseline.png") ~ end Done
[ { "docid": "4a39401de5570f462ff804ed1d0252f2", "score": "0.56658685", "text": "def test_wide_graph\n g = setup_basic_graph('800x400')\n g.title = \"Wide Graph\"\n g.write(\"test/output/scatter_wide_graph.png\") \n\n g = setup_basic_graph('400x200')\n g.title = \"Wide Graph Small\"\n ...
[ { "docid": "2515c8062fac054fedb90d6efe397d03", "score": "0.56197155", "text": "def baseline_value=(new_value)\n @reference_lines[:baseline] ||= Hash.new\n @reference_lines[:baseline][:value] = new_value\n end", "title": "" }, { "docid": "af458ba2c237e6be5f74637a72135afc", "score":...
5fc97ff8ef4e6709fb5d85e80f57116d
Delete row from database.
[ { "docid": "2e82c7af02988f805f832952c4834515", "score": "0.6733606", "text": "def destroy\n DB.execute(\"DELETE FROM #{self.class.table} WHERE id = ?\", id)\n puts(\"\\s #{self.class} SQL Statement: \".cyan.bold + \"DELETE FROM #{self.class.table} WHERE id = #{id}\".red.bold)\n end", "t...
[ { "docid": "43212ac21c0c72978343aed41120b79e", "score": "0.8350731", "text": "def delete_row\n DATABASE.execute(\"DELETE FROM #{get_table_name} WHERE id = #{@id};\")\n end", "title": "" }, { "docid": "5b157fd631991950cebf22f6fd55482a", "score": "0.7909644", "text": "def delete\n ...
7bc786ced0f3dc09227174eb03605fbf
Initializes an instance of an auxiliary module that uses RealPort
[ { "docid": "70f228192c8e7c23eba9b40121c73a5f", "score": "0.6281776", "text": "def initialize(info = {})\n super\n register_options( [\n Opt::RPORT(771)\n ], Msf::Exploit::Remote::RealPort )\n end", "title": "" } ]
[ { "docid": "3d68b3e460867716ddcf878fa87caf14", "score": "0.6778754", "text": "def initialize_abstraction\n self.lsock, self.rsock = Rex::Socket.udp_socket_pair\n end", "title": "" }, { "docid": "3764903916f799489add1d8f84a082c8", "score": "0.6517071", "text": "def initialize(host...
5f543f26d623af43b33bb6b2010996d8
fetches a single record, updates the iterator index
[ { "docid": "2b56d4348dcd25c261c6c362f5a6896f", "score": "0.67948616", "text": "def fetch\n\t\treturn false if @index >= @query['rows'].to_i\n\n\t\tresult = parse_tuple(@record_set[@index])\n\t\t@index += 1\n\n\t\treturn result\n\tend", "title": "" } ]
[ { "docid": "06296d5dc59535cd7e3adf00585f7171", "score": "0.81538665", "text": "def fetch\n @fetched_record = nil\n return nil if @index >= @records.size\n rec = @records[@index]\n @index += 1\n @fetched_record = rec\n return rec\n end", "title": "" }, { "doci...
f59622f579f1e3ddf08d31734679a40c
Returns error log of index loading.
[ { "docid": "5c07d88a4d977761768cc7150160e664", "score": "0.65394986", "text": "def error_log\n end", "title": "" } ]
[ { "docid": "3efc02322e7efc325df6ddd927bf324b", "score": "0.66191345", "text": "def index\n @daw_log_errors = DawLogError.all\n end", "title": "" }, { "docid": "a3602d9530da463f60f88089f38e869a", "score": "0.6181893", "text": "def idx_log_file\n\t\t\"#{pre}/genome_idx/log\" #Bowt...
54bd8374dfcfa89cbc4f3a95e79c2852
Provides access to the Twitter rate limit status API. You can find out information about your account status. Currently the only supported type of account status is the :rate_limit_status which returns a Twitter::RateLimitStatus object. Example: account_status = client.account_info puts account_status.remaining_hits
[ { "docid": "5be763155da9da453562607225c81ce0", "score": "0.77159774", "text": "def account_info(type = :rate_limit_status)\n connection = create_http_connection\n connection.start do |connection|\n response = http_connect do |conn|\n create_http_get_request(@@ACCOUNT_URIS[type])\n ...
[ { "docid": "16b8b13f48c09bbe765ee2336004523d", "score": "0.78982437", "text": "def rate_limit_status(options={})\n rate_limit_status = get(\"/1/account/rate_limit_status.json\", options)\n Twitter::RateLimitStatus.new(rate_limit_status)\n end", "title": "" }, { "docid": "234b0a7...
9992e354df782d906ddff8e98f1b1f72
POST /pages POST /pages.json
[ { "docid": "85880f0c0c4bececa59826d3e65ca805", "score": "0.66122115", "text": "def create\n @page = Page.new(params[:page])\n\n respond_to do |format|\n if @page.save\n format.html { redirect_to @page, notice: \"\\\"#{@page.title}\\\" was successfully created.\" }\n format.json ...
[ { "docid": "64808f4537c5e34ea99a48cbfcb7da26", "score": "0.7101859", "text": "def create\n @page = Page.new(page_params)\n respond_to do |format|\n if @page.save\n format.html { render json: @page }\n format.json { render json: @page, status: :created}\n else\n forma...
9b071c05335ceb1d49a95d15a6663b4a
this is preferred, since you can actually pass around a builder
[ { "docid": "f4e8c236d11617f720b966590a428be4", "score": "0.0", "text": "def initialize(list=nil, &block)\n @list = list || [RPG::EventCommand.new]\n @indent = 0\n EventCommands.new(@list, @indent).instance_eval(&block)\n end", "title": "" } ]
[ { "docid": "2d17bbcafdde6a081ffaa5d4c4912037", "score": "0.81322676", "text": "def builder; end", "title": "" }, { "docid": "068c00a8ac69ca075a24addc11c6b9c5", "score": "0.794672", "text": "def build(builder); end", "title": "" }, { "docid": "9d50e30e9c3f41717d670523d00ee...
198cc4e23e0bb0facebcb002f69cee58
Populate podcast info not supplied by iTunes from its RSS feed
[ { "docid": "10b707b3a4548cc31643c851c64d24ac", "score": "0.7076197", "text": "def get_info\n URI.open(self.rss_feed) { |rss|\n feed = RSS::Parser.parse(rss, false)\n\n self.update(podcast_home_url: feed.channel.link)\n \n if feed.channel.description\n ...
[ { "docid": "d6e62e337916ab4384dc734e7ef168cf", "score": "0.74469495", "text": "def parse_rss_all(podcast)\n feed = nil\n URI.open(podcast.feed_url) do |rss|\n rss = RSS::Parser.parse(rss)\n channel = rss.channel\n image = {\n link: channel.image.link,\n title: channel....
c3d80732afcf83a45b4bf627e29fe822
Get NIST document by reference
[ { "docid": "830673f7b3ffa59bf5b95000517db636", "score": "0.0", "text": "def get(code, year = nil, opts = {}) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity\n return fetch_ref_err(code, year, []) if code.match?(/\\sEP$/)\n\n ...
[ { "docid": "d1b3e4187bc4cf5012374ab7e69be3ae", "score": "0.6619074", "text": "def document; parent.get_document_by_unid(universal_id); end", "title": "" }, { "docid": "d1b3e4187bc4cf5012374ab7e69be3ae", "score": "0.6619074", "text": "def document; parent.get_document_by_unid(universa...
e5b6719617a96a6bb48d4aca75844b31
start a game with given board size and players hash: :sym => :player_type
[ { "docid": "caeb8e0113d7843fb43f355d25f4667a", "score": "0.735989", "text": "def initialize(size, win_size, players={:x => :h, :o => :h})\n @board = Board.new(size)\n @moves_left = size ** 2\n @game_over = false\n\n if win_size > size\n puts '==================================...
[ { "docid": "7f6f8297f223fd22c5a6cbb76ef525ec", "score": "0.647871", "text": "def pbStartScreen(opponentName,minLevel,maxLevel,rules=nil,oppdeck=nil,prize=nil)\r\n raise _INTL(\"Minimum level must be 0 through 9.\") if minLevel<0 || minLevel>9\r\n raise _INTL(\"Maximum level must be 0 through 9.\")...
62d8ac427480f56ae45791712fa9120d
friend/'mentor' helped with refactoring overlap code she explained the single '&' is 'bitwise' code and is used more often in lowerlevel languages. It is comparing the object's date range array with the inputted object's date range array and pushes those similarities into an array. If they have no similarities (e.g. th...
[ { "docid": "07dfaccb2c0871323fd4e5457d669c01", "score": "0.77378255", "text": "def overlap?(input)\n if self.createDateArray & input.createDateArray != []\n return true\n else\n return false\n end\n end", "title": "" } ]
[ { "docid": "f1019d06443a768f102fec509bc1d058", "score": "0.6914165", "text": "def findOverlap(dateRange1, dateRange2)\n return nil\nend", "title": "" }, { "docid": "a335671d46e4a5fe0ab9d017203d340d", "score": "0.67896765", "text": "def overlaps_with_another?(start_date, end_date, ...
2a9446973a532da3982988d1075c3464
Set the response status code and header
[ { "docid": "c808ceb37f4725d6c49e92627211e3f5", "score": "0.0", "text": "def redirect_to(url)\n raise \"Double rendering/redirecting\" if already_built_response?\n\n res.header[\"location\"] = url\n res.status = 302\n @already_built_response = true\n\n store_token_in_cookies\n session.s...
[ { "docid": "5b205fcca8fe25a2f6a443b078cd3b39", "score": "0.79176086", "text": "def set_http_status_code(response)\n if response.respond_to?(:status_code)\n @http_status_code = response.status_code if response.has_status_code?\n else\n NewRelic::Agent.logger.warn(\...
02a289e660e8544c42d4572b6dd70683
POST /facilitators POST /facilitators.json
[ { "docid": "69065864dec96e6009db6d6d0631e75c", "score": "0.6935984", "text": "def create\n @facilitator = Facilitator.new(facilitator_params)\n\n respond_to do |format|\n if @facilitator.save\n format.html { redirect_to @facilitator, notice: 'Facilitator was successfully created.' }\n ...
[ { "docid": "d8cfe20b82eb69e3c3c1ba6b431fa84a", "score": "0.6625417", "text": "def create\n @facilitator = Facilitator.new(params[:facilitator])\n\n respond_to do |format|\n if @facilitator.save\n format.html { redirect_to :action=>:new, :notice => 'Facilitator was successfully created....
60252b85fb1edc4b3974b0eeb327346e
Show Charge Show details of a specific Charge using a given `:id`.
[ { "docid": "87257214ae09c569a8f57fbfec84d721", "score": "0.7834915", "text": "def show_charge(id, opts = {})\n data, _status_code, _headers = show_charge_with_http_info(id, opts)\n data\n end", "title": "" } ]
[ { "docid": "59f8fa2d6ee08c11ec97b4c1abed8b0b", "score": "0.7374075", "text": "def show\n @charge = Charge.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @charge }\n end\n end", "title": "" }, { "docid": "59d2d53a1...
e8a30af28a72974cf27c07fbe15cd9f1
PUT /industry_types/1 PUT /industry_types/1.xml
[ { "docid": "2a370140186a1c9785c382ef2bcf7b25", "score": "0.7417745", "text": "def update\n @industry_type = IndustryType.find(params[:id])\n\n respond_to do |format|\n if @industry_type.update_attributes(params[:industry_type])\n flash[:notice] = 'Industry Type was successfully...
[ { "docid": "1b38a44192d4d2a94adcafa78d03be3a", "score": "0.710882", "text": "def set_industry_type\n @industry_type = IndustryType.find(params[:id])\n end", "title": "" }, { "docid": "4e94d0b682557c2e014e9f4c966d32e1", "score": "0.6806595", "text": "def update\n respond_to...
ffd30ae0d360e97a89d468d3203da046
Each Car is identified by it"s ID as a hash key inside each production line
[ { "docid": "219a8fd1b07e0517d112a4497919b175", "score": "0.51837575", "text": "def initialize()\n @assembly_lines = { \n :basic_structure => {},\n :electronic_devices => {},\n :painting_and_final_details => {}\n }\n @completed_cars...
[ { "docid": "775a0209f9ebbb422b2628b35b736977", "score": "0.6448356", "text": "def cars_by_id\n @cars_by_id ||= json['cars'].reduce({}) do |hash, car|\n hash.update(\n car['id'] => Car.new(\n car['id'], car['price_per_day'], car['price_per_km']\n )\n )\n end\n end"...
fdd26858e49d619ce6be97b526c6891a
Creates a new event object Takes: The key or button we're working with The code to be run when the event happens The object that owns the event Whether it is active (i.e. for a while_key_down event)
[ { "docid": "89c620d6af7fccd02e779c927471bfa8", "score": "0.0", "text": "def initialize type, code, owner\n\t@type = type\n\t@code = code\n\t@owner = owner\n end", "title": "" } ]
[ { "docid": "cabd7bb6e9efa38f96c4cb58f2344ad7", "score": "0.7100134", "text": "def create_key_event\n\t\t\tke = XKeyEvent.malloc\n\t\t\tke.serial = 0\n\t\t\tke.send_event = 1\n\t\t\tke.display = @xdisplay\n\t\t\tke.window = @xid\n\t\t\tke.subwindow = 0\n\t\t\tke.root = tree[:root]\n\t\t\tke.time = Time.n...
b083f82e1b44bc05823687dbeead86e0
Perform a single turn
[ { "docid": "46431d6f1744b1a498ae1d7a0eb1c96d", "score": "0.0", "text": "def doTurn()\n $turn += 1\n flog(\"\\nTurn:\" + $turn.to_s)\n $d.execute if($d.orders.length > 0)\n\n # If enemy has more ships but I have more growth do nothing\n eShips = fShips = eGrowth = fGrowth = 0\n $pw.enemyFleets.each...
[ { "docid": "f6812881456bc3ecd4789fb0ace30d83", "score": "0.77313715", "text": "def turn\n\n end", "title": "" }, { "docid": "f6812881456bc3ecd4789fb0ace30d83", "score": "0.77313715", "text": "def turn\n\n end", "title": "" }, { "docid": "c18478e60f596fd82d61f8ac9d652346...
69d2190fe76c99ebd985cf30945b44b6
List all the cloud providers declared by resources in our deploy.
[ { "docid": "a0387a99dc57c9aa44ca01ba16fd0f23", "score": "0.61755633", "text": "def cloudsUsed\n seen = []\n seen << @original_config['cloud'] if @original_config['cloud']\n MU::Cloud.resource_types.each_value { |attrs|\n type = attrs[:cfg_plural]\n if @original_config[type]\...
[ { "docid": "0417c20eca5ad25fa1c215cf46af7360", "score": "0.7623859", "text": "def list_all(options = {})\n url = File.join(configuration.environment.resource_url, 'providers')\n url << \"?api-version=#{@api_version}\"\n\n url << \"&$top=#{options[:top]}\" if options[:top]\n u...
620931acfd1a89a00e1482378541e55f
Outputs nonarray value in the form of hash For object, use to_hash. Otherwise, just return the value
[ { "docid": "25a8636255f6e4c5e0c6eac38d3fe98c", "score": "0.0", "text": "def _to_hash(value)\n if value.is_a?(Array)\n value.compact.map { |v| _to_hash(v) }\n elsif value.is_a?(Hash)\n {}.tap do |hash|\n value.each { |k, v| hash[k] = _to_hash(v) }\n end\n elsi...
[ { "docid": "a34f3dad821ba9744bc8d807b65489ad", "score": "0.6719518", "text": "def hash\n [value].hash\n end", "title": "" }, { "docid": "a34f3dad821ba9744bc8d807b65489ad", "score": "0.6719518", "text": "def hash\n [value].hash\n end", "title": "" }, { "doc...
b625897701eb978593454b8da5f32cb9
PUT /insurance_cos/1 PUT /insurance_cos/1.xml
[ { "docid": "8e13ed7cc729b517636c0300fa7c3e2f", "score": "0.63772506", "text": "def update\n @insurance_co = InsuranceCo.find(params[:id])\n\n respond_to do |format|\n if @insurance_co.update_attributes(params[:insurance_co])\n format.html { redirect_to(@insurance_co, :notice => 'Insura...
[ { "docid": "99d24a74bc96db3bd84b0451ef3afb5f", "score": "0.6313006", "text": "def test_put_invoices_1_xml\n @parameters = {:invoice => {:number => 'NewNumber'}}\n \n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/invoices/1.xml',\n ...
a286e66baa5af18b1456bcca5702ac03
Make a phone call Make a phone call. See Calls for more details and how to setup caller id's. Note: This API is for users with Account Owner scope access token. Users with Extension User scope token should invoke the Calls API with the following definition: POST
[ { "docid": "83a92218d4861faed57888739d7cc8c1", "score": "0.0", "text": "def create_account_call(account_id, opts = {})\n data, _status_code, _headers = create_account_call_with_http_info(account_id, opts)\n data\n end", "title": "" } ]
[ { "docid": "134c4fbf5f65e01d4b508950fbc788d2", "score": "0.7768865", "text": "def place_call\n client = Twilio::REST::Client.new(Settings.twilio.account_sid, Settings.twilio.auth_token)\n params = {\n from: call.caller_id,\n to: call.member_phone_number,\n url: call_start_url(call),...
3260c26a8b581e0f41a6d48053d4946e
POST /matter_statuses POST /matter_statuses.json
[ { "docid": "fff77ee6e78bec4a1a4d5766d6adca62", "score": "0.69098306", "text": "def create\n @matter_status = MatterStatus.new(matter_status_params)\n\n respond_to do |format|\n if @matter_status.save\n format.html { redirect_to @matter_status, notice: 'Matter status was successfully cr...
[ { "docid": "bd1782919e3c82d51420df4c3d5c180a", "score": "0.69346815", "text": "def post(content)\n post_to(\"/statuses/update.xml\", {:status => content})\n end", "title": "" }, { "docid": "981b7360678bb44bea71f5632e6464a8", "score": "0.6826068", "text": "def create\n json_dat...
f50940b832c46731f234a456cc862bde
How could we do this more efficiently?
[ { "docid": "8e8e11aa64ba46571798f4045b1a2c2f", "score": "0.0", "text": "def size\n i = 0\n current_item = @first_item\n until current_item.nil?\n i += 1\n current_item = current_item.next_item\n end\n i\n end", "title": "" } ]
[ { "docid": "2b13149a04241d9c0bca7ee67a4811a3", "score": "0.5381172", "text": "def newest_union()\n and_query = %w(amenity:cats_allowed amenity:hoa)\n or_queries = %w(amenity:dogs_allowed amenity:parking_garage amenity:ski_resort)\n Benchmark.bm(55) do |x|\n x.report(\"Create set cache\") {\n ...
8992c5045168525529d8595d1bdb6a9c
using an assert method to test my code. Essentially, all the assert method does is throw an error if my expectation evaluates to false an even simpler way to test would be by just using puts. for example: puts fizzbuzz(5) == buzz will print out true to my terminal if something prints false that means its a failing case
[ { "docid": "fb26b88ad699efabb2a28381aacb8f6a", "score": "0.0", "text": "def fizzbuzz(number)\n\n\t(number % 3 == 0) && (number % 5 == 0) ? \"fizzbuzz\"\n\t: (number % 3) == 0 ? \"fizz\"\n\t: (number % 5) == 0 ? \"buzz\"\n\t: number\n\nend", "title": "" } ]
[ { "docid": "567103f6d989496c072ab81c5849684e", "score": "0.8271301", "text": "def assert(actual)\n if actual\n print \".\"\n else\n raise \"I expected something truthy, but I got #{actual}\"\n end\nend", "title": "" }, { "docid": "fd0cd8bcef2c1fa47972da8de93c6982", "score": "0.8...
e9a506765fff8b2e578e675c41813a99
Executes the GetAuthorizeAnswer methodf
[ { "docid": "a7e56734aeb87cd22cb335e7c07d74d0", "score": "0.72403634", "text": "def execute_get_authorize_answer(parameters, connector)\n request = self.fill_dictionary(parameters, [SECURITY, MERCHANT, ANSWER_KEY])\n request[:RequestKey] = parameters[REQUEST_KEY]\n\n connector.getAuthorize...
[ { "docid": "b800eab7845084e33d45a3b5dfc392b3", "score": "0.6528855", "text": "def show\n authorize! :show, @submitted_answer\n end", "title": "" }, { "docid": "2382c68d165cce11620ddf94c4ba2a4b", "score": "0.63614774", "text": "def getAuthorizeRequest(optionsAnwser)\n message =...
7876cd7c8d8e338408e54d8ecf73a88a
PATCH/PUT /sub_cats/1 PATCH/PUT /sub_cats/1.json
[ { "docid": "51c536cc16b6892f574bc34bd5b5812b", "score": "0.6862076", "text": "def update\n respond_to do |format|\n if @sub_cat.update(sub_cat_params)\n format.html { redirect_to @sub_cat, notice: 'Sub cat was successfully updated.' }\n format.json { render :show, status: :ok, loca...
[ { "docid": "0e368f3f3ea5d905ef00a62df47f2fb5", "score": "0.68255174", "text": "def update\n @cat.update(cat_params)\n render json: @cat\n end", "title": "" }, { "docid": "f2f309764577e5bfb346516fa58f052b", "score": "0.6821535", "text": "def update\n @subcat = Subc...
e61f8d4a14ec766d097028fa5ed2da5d
Read the template file
[ { "docid": "6c3ef8e7b120d16909263cc3fb8f7dd7", "score": "0.8273642", "text": "def read_file(template)\n File.read(template)\nend", "title": "" } ]
[ { "docid": "ca5410ff651438768f5d5f1fd5d154aa", "score": "0.84656554", "text": "def read_template(filename)\n\t\tfile = File.open(filename, \"rb\")\n\t\tcontents = file.read\n\t\tfile.close\n\t\tcontents\n\tend", "title": "" }, { "docid": "3d9af11e8db882f2c4c08752983ff274", "score": "0.84...
ef1b50be7e9b0a07ee84b70943e8b699
Perform XOR of two hex strings
[ { "docid": "e27c518a99fec74759954fe9f81cfff6", "score": "0.8383744", "text": "def hex_XOR(hex1, hex2)\n bin1 = hexToBin(hex1)\n bin2 = hexToBin(hex2)\n \n #XOR result in binary\n xorBin = \"\"\n \n for i in 0..bin1.length-1 do\n xorBitResult = bin1[i].to_i ^ bin2[i].to_i\n ...
[ { "docid": "84ade1995def5a3d3e101b09ae7c1910", "score": "0.8537982", "text": "def xor(first, second)\n first.bytes.zip(second.bytes).map{ |(a,b)| (a ^ b).chr }.join('')\n end", "title": "" }, { "docid": "692290b1416223659b1fedd106a11027", "score": "0.84764683", "text"...
8fbff52c1f3b3335b89e2079f5d8dca6
GET /promotions/1 GET /promotions/1.json
[ { "docid": "e9c50908679d315ad0eb42f848a439c1", "score": "0.0", "text": "def show\n @books = @promotion.books.order(:sort_title)\n @subjects = @promotion.books.map{ |book| book.subjects }\n # binding.pry\n\n unless params[:subject].nil?\n @books = @promotion.books.where('subjects LIKE ?...
[ { "docid": "ffb1081fdfc4e1f8b7c2909def8909c9", "score": "0.7495955", "text": "def index\n if params[:product_id]\n @promotions = Product.find(params[:product_id]).promotions\n else\n @promotions = Promotion.all\n end\n\n render json: @promotions\n end", "title": "" }, { ...
1dbdcfda855ddca71a63761b8439a183
INPUT emulation through jQuery
[ { "docid": "c65e9be2e2e129c8d13eb0ddcda5ad91", "score": "0.0", "text": "def trigger(player, selector, event)\n\tplayer.execute_script('$(\"'+ selector +'\").trigger(\"' + event + '\");')\nend", "title": "" } ]
[ { "docid": "03413af7b7fd0efecfdad4312378cc34", "score": "0.5968004", "text": "def input\n element = Input.new(@driver, @action, @params)\n case @action\n when 'textInput'\n element.text_input\n when 'menuInput'\n element.menu_input\n when 'checkerInput'\n element.checker_in...
62c2d7ace1befded51e808d6423621d6
Expires the cache under tmp/cache. We do that in two steps: first we move tmp/cache into a new directory, and then we remove that one. It is done that way because if we rm rf tmp/cache directly and at the same time requests come and create new cache files a black hole can be created and handling that is beyond the lege...
[ { "docid": "32a1d3270f6018a7ae5c3d0c2c066607", "score": "0.751355", "text": "def expire_caches\n expired_cache = \"expired_cache.#{Time.now.to_f}\"\n Dir.chdir(\"#{Rails.root}/tmp\") do\n FileUtils.mv('cache', expired_cache, :force => true)\n FileUtils.rm_rf(expired_cache)\n end\n en...
[ { "docid": "7aa875a14c68c1324ea03fb3ce755831", "score": "0.6740085", "text": "def expire_cache\n filename = name_changed? ? name_was : name\n FileUtils.rm_rf(File.join(Shapes.cache_dir_path, filename))\n FileUtils.rm_f(File.join(Shapes.cache_dir_path, \"#{filename}.xml\"))\n end", "title":...
4a9e7412ca737ab043ace52929be682d
GET /sivic_alunoaulas GET /sivic_alunoaulas.json
[ { "docid": "20a2256582d7f50db5ef2ddaeb3657e8", "score": "0.0", "text": "def index\r\n @sivic_alunoaulas = SivicAlunoaula.all\r\n @sivic_turmamoduloprofessors = SivicTurmamoduloprofessor.find :all, :conditions => {:sivic_professor_id => current_user.sivic_pessoa.sivic_professor}\r\n end", "tit...
[ { "docid": "519198608870334ec6a6d2e8eca03bec", "score": "0.70960826", "text": "def index\n @interno_unidads = InternoUnidad.all\n render json: @interno_unidads\n end", "title": "" }, { "docid": "795bdb10ccc0ba72ac9ce844efafbc6d", "score": "0.68441015", "text": "def index\n ...
95c2e3ebdcf8c1a14bc41c2825134408
flattest distro 1..N in range
[ { "docid": "6c93f78c7636aa5b6561f6d666623fa7", "score": "0.0", "text": "def widest(value, free)\n ask_value = value\n histo = histo_init\n found_dice = 0\n die_count = 1\n addr = free\n if value == value.floor\n addr -= 1\n die_count += 1\n end\n value -= addr \n\n start_value = value\n\n...
[ { "docid": "e0e884bce705fc14da6953ca594d1acc", "score": "0.5995087", "text": "def fittests(n)\n @generation.sort{ |x,y| y.fitness <=> x.fitness }[0...n] # Ordinamento inverso con i primi n numeri \n end", "title": "" }, { "docid": "e2938a023f9bd3fdb7795d3d6897b0...
767a3e77ed4382eeec74f2d852fe559f
Get the published variables
[ { "docid": "0ca78956288b33d0e7a0eae0dd10550b", "score": "0.0", "text": "def get_scripts_published_script_id_variables(script_id, opts = {})\n data, _status_code, _headers = get_scripts_published_script_id_variables_with_http_info(script_id, opts)\n return data\n end", "title": "" } ]
[ { "docid": "6dec327814c4077e97ea39d54419b641", "score": "0.8322859", "text": "def published_variables\n @__published_variables ||= {}\n end", "title": "" }, { "docid": "1a935fd6bceea62c24efecc3cfa08da2", "score": "0.7229721", "text": "def get_variables\n\t\treturn @variables\...
1dd9a0bc8cd54066d4f66f24729a2236
Return the Time of the last frame from the client associated with the given +request+.
[ { "docid": "eeb42c5d7910aa8284af108975353948", "score": "0.7108993", "text": "def last_connection_time( request )\n\t\ttable = self.connection_times[ request.sender_id ] or return nil\n\t\treturn table[ request.conn_id ]\n\tend", "title": "" } ]
[ { "docid": "2601876e3389b3941f2559e9b8e7fc90", "score": "0.6796862", "text": "def last_request\n @client.last_request\n end", "title": "" }, { "docid": "181430d0c098f9fbe8bef3004c812aba", "score": "0.6496864", "text": "def last_request; end", "title": "" }, { "doc...
b3499b151d2428aff2322b6d6fac8574
creates a times table with top row_1 of 1..n and column_1 of 1..n
[ { "docid": "c58ce21142cbb2b91b51234f05b8aa8a", "score": "0.6201138", "text": "def times_table(n)\n [*1..n].product([*1..n]).map { |x, y| \"#{x} * #{y} = #{x*y}\" }.join(\"\\t\")\nend", "title": "" } ]
[ { "docid": "5a69973b0cf7422478c08838d78f205e", "score": "0.6873463", "text": "def times_table(rows)\n\t if rows == 0\n\t else\n\t \ta = 1\n\t \tb = 1\n\t \twhile b <= rows\n\t \t\twhile a <= rows\n\t \t\t\tb.upto(rows){ |i| print \"#{i*a} \"}\n\t \t\t\tputs \"\\n\"\n\t \t\t\ta+=1\n\t \t\tend\n\t \t\tb+=...
eb15a4600e6f375a79c45d3f7470e2cd
Quick sort in Ruby
[ { "docid": "598f37e26a1a4c85451fb7a6b4250b0c", "score": "0.7589085", "text": "def quick_sort(f, a)\n return [] if a.empty?\n pivot = a[0]\n before = quick_sort(f, a[1..-1].delete_if { |x| not f.call(x, pivot) })\n after = quick_sort(f, a[1..-1].delete_if { |x| f.call(x, pivot) })\n return (before...
[ { "docid": "11bc893b8569d36cd31bcda41f39fa80", "score": "0.8185858", "text": "def quicksort\n ->(xs) {\n if empty?.(xs)\n empty\n else\n pivot = head.(xs)\n partitions = (F.map.(self.quicksort) * partition_by.(F.is_lte.(pivot)) << tail.(xs)).to_a...
a0c3dfebbf0d18c1daca6878c2e57377
POST /appreciations POST /appreciations.xml
[ { "docid": "cbc9c17f7b4164c6bafeb6150e2f0bb0", "score": "0.6651284", "text": "def create\n @appreciation = Appreciation.new(params[:appreciation])\n\n respond_to do |format|\n if @appreciation.save\n format.html { redirect_to(@appreciation, :notice => 'Appreciation was successfully cre...
[ { "docid": "4216757bba2855fec90a1c9565fddcf2", "score": "0.59973764", "text": "def create\n @appreciation = Appreciation.new(appreciation_params)\n\n if @appreciation.save\n render json: @appreciation, status: :created#, location: @appreciation\n else\n render json...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "a1817cbef0873ac6b67f3caa09de054c", "score": "0.0", "text": "def demanda_params\n params.require(:demanda).permit(:pessoa_id, :endereco_id, :estado, :data_fim, :descricao, endereco_attributes: [:id, :cidade_id, :logradouro, :complemento, :cep, :numero])\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.6981606", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6784227", "text": "def strong_params\n params.requi...
2f1625aa2f0cd4a82c3dc440ee1524f7
This or something like it should probably be added upstream in Msf::Exploit::Remote
[ { "docid": "96a0dc121bc72232bf335a51e4e639e5", "score": "0.0", "text": "def get_target_arch(cli)\n\t\tif framework.db.active\n\t\t\thost = framework.db.get_host(nil, cli.peerhost)\n\t\t\tres = host.arch\n\t\telsif @targetcache[cli.peerhost][:arch]\n\t\t\tres = @targetcache[cli.peerhost][:arch]\n\t\telse...
[ { "docid": "27731668925368941d8db1de16f59032", "score": "0.6724928", "text": "def exploit\r\n print_status(\"#{peer} - Exploting the vulnerable service...\")\r\n\r\n @payload_url = ''\r\n @dropped_elf = rand_text_alpha(rand(5) + 3)\r\n\r\n wget_payload\r\n chmod_payload\r\n exec_payloa...
cb6d107fad279f7924363f85f306b0fb
Extracts system's GCC version Returns as
[ { "docid": "649f2171c4acdef67913990602a1755a", "score": "0.85707426", "text": "def get_system_gcc_ver(system_gcc='gcc')\n o = `echo $(#{system_gcc} --version | grep ^gcc )`\n gcc_txt_ary = o.split(' ')\n gcc_ver_txt = ''\n gcc_txt_ary.each do |txt|\n if txt.split('.').length() == 3\n ...
[ { "docid": "30b4b81c445c69a7e0d080b281822f29", "score": "0.7434291", "text": "def gcc_version(gcc_binary)\n return nil unless run_gcc(gcc_binary, \"-v\")\n\n @last_err\n end", "title": "" }, { "docid": "4f9909b646217c607961ddca36555a2a", "score": "0.696102", "text": "def...
c9e1bd5cdea401b850809d0c8ffd97b9
Retrieve S3 credentials and information from the Framed API
[ { "docid": "a00b513333ac53442785d9a926b02ba9", "score": "0.0", "text": "def get_credentials!\n uri = URI(CREDS_ENDPOINT)\n req = Net::HTTP::Post.new(uri.request_uri)\n req.basic_auth(@api_key, \"\")\n resp = Net::HTTP.start(uri.host, uri.port, :use_ssl => true) do |https|\n ht...
[ { "docid": "4fd4b34e07fe5d3db95e9aea639f1c13", "score": "0.7699016", "text": "def s3_credentials\n {:bucket => \"calw-assets/avatars\", :access_key_id => ENV['CW_AWS_ACCESS_KEY'], :secret_access_key => ENV['CW_AWS_SECRET_ACCESS_KEY']}\n end", "title": "" }, { "docid": "4542e7c892e07e1ef9...
e9307a697492e777ee8444ab4c73c15a
Kolya Venturi Turing Cohort 1801 Backend Module 1
[ { "docid": "2cb8d92587117b66f0a62266ff18f939", "score": "0.0", "text": "def check(num) # Method to test number\n if(num === 0) then return 0 end\n\n value = \"\" # Initialize output variable\n\n # Use modulo to add Super|Fizz|Buzz to final value\n\n if(num % 7 == 0) then value += \"Super\" end # If ...
[ { "docid": "71e593b67436a4ee7820a63405493d0f", "score": "0.6169554", "text": "def engine; app.plan.engine end", "title": "" }, { "docid": "9fcc08ec654b61c1b78432be01134bd2", "score": "0.6093817", "text": "def backend; end", "title": "" }, { "docid": "9fcc08ec654b61c1b7843...
2afd614f466489f9410176d6cd78e92d
=begin DefName: calculation_setting Description: calculation setting ParameterList: Return: Author: LiuJingsen CreatedDate: 20111229 History: Date Changer Reason 20111229 LiuJingsen create =end
[ { "docid": "c30bfce2c1df9c9a54c74e7498483c28", "score": "0.5422532", "text": "def calculation_setting\n\t@browser.frame(:name, \"content\").frame(:name, \"frame_reportsummary\").div(:id, 'generateFrame').select_list(:id, 'selCalSet').set('1-1')\nend", "title": "" } ]
[ { "docid": "0d41d950a68c8ce953d5e33cd594dc9d", "score": "0.5824093", "text": "def definition()\n\t\t\n\t\t\tdefinitionLines ||= []\n\t\t\tdefinitionLines << 'renderengine.type = '+ @type\n\t\t\t\n\t\t\t@@commonParameters.each { |parameter|\n\n\t\t\t\tparameter = convertPeriodToUppercase(parameter)\n\n\t...
4f23d5ce50432f04b69c41d23af72ff6
convenience evt_handler to listen to all mouse events
[ { "docid": "5c617bb83ab9445c5f0e422da9b9e02d", "score": "0.72349006", "text": "def evt_mouse_events(&block)\n evt_left_down(&block)\n evt_left_up(&block)\n evt_middle_down(&block)\n evt_middle_up(&block)\n evt_right_down(&block)\n evt_right_up(&block)\n evt_motion(&block)\n evt_l...
[ { "docid": "e9f484b37979085422657078746a07a0", "score": "0.6694313", "text": "def handle_mouse_down mouse_x, mouse_y\n # empty base implementation\n end", "title": "" }, { "docid": "e6893ba2232fbcbcab6e31e2b782c99a", "score": "0.65262425", "text": "def handle_mouse_...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "86ebeb11af12c2bed85d0003904f52ed", "score": "0.0", "text": "def set_cake\n @cake = Cake.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...
b3903474371ca0710a7bdd75ecc0afc2
Remove transaction rule The `/transactions/rules/v1/remove` endpoint is used to remove a transaction rule.
[ { "docid": "9f7413fe8112656ecfd9faa623b2d6d2", "score": "0.6810518", "text": "def transactions_rules_remove(transactions_rules_remove_request, opts = {})\n data, _status_code, _headers = transactions_rules_remove_with_http_info(transactions_rules_remove_request, opts)\n data\n end", "ti...
[ { "docid": "95b1c93f51511c0c9dc58d1aaea95257", "score": "0.7503976", "text": "def delete_rule(rule)\n delete_rules(rule)\n end", "title": "" }, { "docid": "c5b85fe4a2690737293f54b6c7247076", "score": "0.69079417", "text": "def remove_rule(id)\n @rules.delete_if { |rule| ...
b32c69d3bb9ca068f824aef6dc8a19de
given a command type, expand any erb in it with exposed values type is one of [:check, :commit]
[ { "docid": "1cc57a3ba9777cbe226c67481ee4f453", "score": "0.6777223", "text": "def template_command type, template_vars\n # ignore missing commands\n command = case type\n when :check\n @check_cmd\n when :commit\n @commit_cmd\n else\n raise \"I dont know what...
[ { "docid": "c86a3ff09fba79757cd7a91bc705fc47", "score": "0.5612221", "text": "def command(type)\n end", "title": "" }, { "docid": "2d62d24afe5b061ccbd8e6f329f4344a", "score": "0.5460299", "text": "def add_options(type, cmd, default_template: 'default')\n cmd_name = cmd.name.to_s\...
b618b331911997be6185de5e3ce5b790
Sends a message to the output in a form of a string eg "904040". This method does not do type checking
[ { "docid": "5a4aaaeadf15181afc25d2e144502483", "score": "0.63436127", "text": "def puts_s(*messages)\n @device.puts_s(*messages)\n messages.count < 2 ? messages[0] : messages\n end", "title": "" } ]
[ { "docid": "e746a7ba90dbfefe97fe7c14fcf938b4", "score": "0.72541517", "text": "def write msg\n @output << msg\n end", "title": "" }, { "docid": "7b1082573f16e0cf464c6a0fa09dd3aa", "score": "0.70742923", "text": "def send_puts( message, no_newline = false, message_type: :main, int...
80e7db52198c65f8314f7fdbd5b54ae5
GET /forgotten_users/new GET /forgotten_users/new.json
[ { "docid": "175e39b6ea880f532509c2efed825f69", "score": "0.8245292", "text": "def new\n @forgotten_user = ForgottenUser.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @forgotten_user }\n end\n end", "title": "" } ]
[ { "docid": "10579c3d3cc989fec15a1ace9f9c505e", "score": "0.7729486", "text": "def new\n @newuser = Newuser.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newuser }\n end\n end", "title": "" }, { "docid": "f3f319fcf72bd9d0050a0e7b...
e76c229b5ce0cb12497df89831a11b89
PUT /consults/1 PUT /consults/1.json
[ { "docid": "2f0a60320fbdbcfcb21db85fda27ecd1", "score": "0.72705483", "text": "def update\n @consult = Consult.find(params[:id])\n\n respond_to do |format|\n if @consult.update_attributes(params[:consult])\n format.html { redirect_to @consult, notice: 'Consult was successfully updated....
[ { "docid": "2fe991bdc99e005d892b88a799f3de22", "score": "0.7135798", "text": "def update\n respond_to do |format|\n if @consult.update(consult_params)\n format.html { redirect_to @consult, notice: 'Consult was successfully updated.' }\n format.json { render :show, status: :ok, loca...
a94e7075725b64480a4b81a9125546c0
DELETE /hr/subcompanies/1 DELETE /hr/subcompanies/1.xml
[ { "docid": "3c47de9387ac64048ac7fb62abfe8e7c", "score": "0.7507356", "text": "def destroy\n @hr_subcompany = Hr::Subcompany.find(params[:id])\n @hr_subcompany.destroy\n\n respond_to do |format|\n format.html { redirect_to(hr_subcompanies_url) }\n format.xml { head :ok }\n end\n e...
[ { "docid": "8dc4ab31224f9f686d434060b99f7c6f", "score": "0.68352175", "text": "def destroy\n @seo_company = SeoCompany.find(params[:id])\n @seo_company.destroy\n\n respond_to do |format|\n format.html { redirect_to(companies_url) }\n format.xml { head :ok }\n end\n end", "tit...
7f80c20af6fb30bf0442fdedc2aaf79d
Sets the value of this piece of content. The appropriate field will be populated depending on the type of the content
[ { "docid": "1d4da0e7a87748870e054166a7c5da7c", "score": "0.8176348", "text": "def set_content(value)\n self.send(\"#{self.content_type.input_field}=\", value)\n end", "title": "" } ]
[ { "docid": "fe1e49ba3b75e8b4acc1d15774b54207", "score": "0.7684976", "text": "def value=(content)\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "81a7cfc62342c53bba9c1d17260f8cee", "score": "0.7506088", "text": "def set_Content(value)...
c2a5a5446cbe769d179d8299cdb827b5
Shows the individual recipe page
[ { "docid": "3282c4f37c7781a0e0091a99182991c0", "score": "0.0", "text": "def show\n begin\n @recipe = Recipe.find(params[:ID])\n @inputs = @recipe.input\n @outputs = @recipe.output\n @feats = @recipe.feat\n @skills = @recipe.skill\n res...
[ { "docid": "ce97b63f78d529612242519383785424", "score": "0.804817", "text": "def show\n @recipe = Recipe.find(params[:id])\n render('/recipes/show.html.erb')\n end", "title": "" }, { "docid": "e22bba2e2c3a6c511a6e3c62580aa086", "score": "0.7995946", "text": "def show\n #ren...
a8dd69ed33b6d8c796019f307572b60d
POST /add_location_to_users POST /add_location_to_users.json
[ { "docid": "82f8a1aea39f8e9e3a57080abaddc016", "score": "0.79595524", "text": "def create\n @add_location_to_user = AddLocationToUser.new(params[:add_location_to_user])\n\n respond_to do |format|\n if @add_location_to_user.save\n format.html { redirect_to @add_location_to_user, notice:...
[ { "docid": "43e4fef5202878dcf10497c630b38e5d", "score": "0.7608361", "text": "def add_new_location\n begin\n if address && city && state && country && latitude & longitude\n requested_user.locations.push(Location.create!(:address => address,\n ...
e51607b0ed6bb1a2560ff5c97576a7ac
I'm going to want to _get_ information out of my instances, so I'll set up _getter_ methods! A getter method returns the current value of an instance variable.
[ { "docid": "aa8a7365053938d160caed7d3a1d5709", "score": "0.0", "text": "def term\n @term\n end", "title": "" } ]
[ { "docid": "5a3dc0e6482d536f380828c82e0f7fb7", "score": "0.75054497", "text": "def getters; end", "title": "" }, { "docid": "66f796af0ce4a5738b4e818c8413f7c3", "score": "0.70555186", "text": "def getter\r\n @getter ||= Field.getter(@name)\r\n end", "title": "" }, { "d...
2bc37ce08416396b0183bf3322bfb1b8
Create an private app by submitting a github repo address. Steps are: 'private' tab > 'paste .git repo'
[ { "docid": "1b626b300a12b09c7e0069ca0acb9744", "score": "0.80538416", "text": "def new_private_app_with_repo\r\n puts \"+ <action> New a private app with github repo --- begin\" \r\n make_sure_apps_page unless @driver.current_url =~ /.*apps.*/\r\n if new_app_btn_display?\r\n ...
[ { "docid": "42c5d7fcadf4437bbaddf316d3f4a219", "score": "0.7195762", "text": "def new_public_app_with_repo ( type=\"repo\")\r\n puts \"+<repo_type> is #{type.upcase}\"\r\n puts \"+ <action> New public app with github repo --- begin\"\r\n make_sure_apps_page unless @driver.current_ur...
a812a0c77c30024def44136892f8725e
remembers which submission the user scored in (depends on contest highest or latest)
[ { "docid": "b0d23a21233e45d61ba077a677ed740e", "score": "0.0", "text": "def contest\n contest_relation.contest\n end", "title": "" } ]
[ { "docid": "f48ab413eb0519200135cd823c394249", "score": "0.6833279", "text": "def submissions_for(user)\n partition = assignment.team_partition\n author = (partition && partition.team_for_user(user)) || user\n submissions.where(subject: author).order(updated_at: :desc)\n end", "title": "" ...
f514d247c95a1767e7a539a097c318ee
given an array words, don't process anything just search the document tokens for the words
[ { "docid": "451c5d33bed4a6f26fdc1ac554111bc9", "score": "0.79411376", "text": "def search_of_many_words(words, doc_tokens)\n words.collect { |word| grep_doc(doc_tokens, word).first }.compact\n end", "title": "" } ]
[ { "docid": "7ba84bc1af931c7f3e882dfb338a745c", "score": "0.70297307", "text": "def search_for_word(word, doc_tokens)\n s_res = grep_doc(doc_tokens, word) \n s_res_singularize = grep_doc(doc_tokens, word.singularize)\n search_res = s_res.size >= s_res_singularize.size ? s_res : s_res_singularize...
4fbf6d062de40095ab33524602ae6f32
Gets a list of the event keys for events this team has competed at in the given year.
[ { "docid": "a5619830f770ef1c83236e56a5ef582a", "score": "0.5336095", "text": "def get_team_events_by_year_keys_with_http_info(team_key, year, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TeamApi.get_team_events_by_year_keys ...'\n end\n ...
[ { "docid": "8bf5d1080b63ad48aa848a586f108662", "score": "0.71071446", "text": "def get_team_events_by_year_keys(team_key, year, opts = {})\n data, _status_code, _headers = get_team_events_by_year_keys_with_http_info(team_key, year, opts)\n data\n end", "title": "" }, { "docid": ...
6294e73cb14851787ddf3c77d9380273
A total method which will calculate the total cost of the order by: Summing up the products Adding a 7.5% tax Rounding the result to two decimal places
[ { "docid": "c0f517ae500b112252d1254fe463e82a", "score": "0.0", "text": "def total\n if @products == {}\n return 0 \n else\n m = 0\n @products.values.each do |v|\n m += v\n end\n\n sum = (m + (m * 0.075)).round(2)\n return sum\n end\n e...
[ { "docid": "e6f0919f2887cb875cc8364c84889c22", "score": "0.9046074", "text": "def total\n total_cost = 0\n \n # Summing up the product cost\n @products.each do |item, cost|\n total_cost += cost\n end\n \n # Calculate a 7.5% tax\n total_order_cost = total_cost * 1.075\n \n...
cfeaf223e03f93aa06057523ed20f77f
decrypts the token recieved from the authorization header & gets user's ID
[ { "docid": "0737c62117a1268471eca93561a46dfc", "score": "0.67316157", "text": "def decrypted_token\n @decrypted_token ||= JsonWebToken.decrypt(received_token)\n end", "title": "" } ]
[ { "docid": "57f5038ad5fe7f2f464bc8110f57968b", "score": "0.78287977", "text": "def decode_token\n # byebug\n begin\n JWT.decode(get_auth_headers, \"userSecret\")[0][\"user_id\"]\n rescue\n nil\n end\n end", "title": "" }, { "docid": "bed40a33730efdc9394683ed2b067afd", ...
d699aaa90064333fbb239be9bd751b42
Returns the first 8 characters of itself (the digest). e.g. "kimmy".gibbler => c8027100ecc54945ab15ddac529230e38b1ba6a1 "kimmy".gibbler.short => c8027100
[ { "docid": "e283b300fd56deaf6b1bf2ca76180617", "score": "0.61413836", "text": "def short\n shorten(8)\n end", "title": "" } ]
[ { "docid": "bb3ba21c40d4f147999062d6ae3001be", "score": "0.7453372", "text": "def digest_short_name(name)\n Digest::SHA2.hexdigest(name)[0..24]\n end", "title": "" }, { "docid": "e69b71848014710199bb53ee5b1a9549", "score": "0.72504556", "text": "def short_sha\n self.sha[...
3fa02e99d376f016a964796476118d15
Get the serializer 'options' whether from root or association.
[ { "docid": "60df53e864d6b6867574f26058d474c1", "score": "0.84619534", "text": "def get_serializer_options(serializer)\n return root_serializer_options if root_serializer?(serializer)\n get_association_options(serializer.class.totem_root_name)\n end", "title": "" } ]
[ { "docid": "cf8f4bdd5812e648e6e27b12a4595260", "score": "0.72446835", "text": "def default_serializer_options\n options = {}\n if params[:root] == \"false\"\n options.merge! root: false\n elsif params[:root] and params[:root] != \"true\"\n options.merge! root: params[:root]\n end\n...
d34f2c0c072622618e2fc37b27b942a0
Get the products (or categories) that where booked in a year
[ { "docid": "a9761ccda7f103c23df07d07921fbc42", "score": "0.69586974", "text": "def historic_products(year)\n\n query = <<-QUERY\n select distinct(bookds_bookings_lines.item_id) \n FROM bookds_bookings_lines \n JOIN bookds_bookings on bookds_bookings.id = bookds_...
[ { "docid": "915d841463d9a54a2b2534eaa9105a6d", "score": "0.6965781", "text": "def historic_products(year)\n\n query = <<-QUERY\n select distinct(bookds_bookings_lines.item_id) \n FROM bookds_bookings_lines \n JOIN bookds_bookings on bookds_bookings.id = bookds_b...
3e0f80f72f66860851b9ea68251ffe43
To see if the template can be found, make list of possible cells paths, according to: If Engines loaded: then append paths in order so that more recently started plugins will take priority and RAILS_ROOT/app/cells with highest prio. Engines notloaded: then only RAILS_ROOT/app/cells
[ { "docid": "6769c669e7b5aa94ce85b157c189bdfe", "score": "0.6854457", "text": "def possible_cell_paths\n if Cell.engines_available?\n Rails.plugins.by_precedence.map {|plugin| plugin.directory + '/app/cells'}.unshift(RAILS_ROOT + '/app/cells')\n else\n RAILS_ROOT + '/app/cells'\n ...
[ { "docid": "8d5d84419ec2cba422fe802b34c315db", "score": "0.62752986", "text": "def check_for_template?(path)\n @page.templates[path]\n end", "title": "" }, { "docid": "314c3405a2628ccf3bdc6b3acc59c1c8", "score": "0.62501526", "text": "def check_for_template?(path)\n @page.te...
3bb0b9a3e2e7a05563a62ecc15b03ecc
=begin NodeappendChild(newChild) [DOM] adds the node newChild to the end of the list of children of this node. =end [DOM]
[ { "docid": "00a0e930453fe6b6c4d13e89e3ed4909", "score": "0.82222503", "text": "def appendChild(newChild)\n @children = NodeList.new if !@children\n _insertNodes(-1, newChild)\n end", "title": "" } ]
[ { "docid": "c230b74f88f9b3c1af8a66e60f7a4764", "score": "0.73615706", "text": "def appendChild(node)\n raise NotImplementedError\n end", "title": "" }, { "docid": "fae31c0a6fd4a897da0c84f5aa09c6c4", "score": "0.73382515", "text": "def safe_append_child(new_node)\n ...
cb316b05ffebe8f81f877506561cb051
Cookbook Name:: clisp Recipe:: default Copyright 2013, YOUR_COMPANY_NAME All rights reserved Do Not Redistribute
[ { "docid": "cf316dc404de28ff6c131472d745a8b4", "score": "0.0", "text": "def install_libsigsegv(source, file, build_dir, prefix)\n remote_file \"#{Chef::Config[:file_cache_path]}/#{file}\" do\n source source + file\n mode '0644'\n action :create_if_missing\n not_if \"test -e #{prefix}/lib/li...
[ { "docid": "088b3acd3463c911d43ed2b9f18ebaeb", "score": "0.6568213", "text": "def cookbook_with_maintainer(name, email)\n write_recipe %q{\n #\n # Cookbook Name:: example\n # Recipe:: default\n #\n # Copyright 2011, YOUR_COMPANY_NAME\n #\n # All righ...
d8e30020bd38bb9fa3ecb712194d253d
GET /investigators GET /investigators.json
[ { "docid": "2f6733aefa6f62b33803b6520e7073c2", "score": "0.74246466", "text": "def index\n @investigators = Investigator.all\n end", "title": "" } ]
[ { "docid": "c652963ba9ec6c332230395293e47eb4", "score": "0.69348764", "text": "def index\n if request.format.to_sym == :html\n @investors = Investor.page(params[:page]).order(\"LOWER(name)\")\n else\n @investors = Investor.all\n end\n respond_with(@investors)\n end", "title": ...
b415790294ce689aed12a1dc0fd23664
Simulates one clock signal. First this Bus reads from each component (the component writes to the bus) then this Bus writes to each component (the component reads from the bus) so ist on the component site to eccept the read or write
[ { "docid": "4a25d100535222dfd969002184f2124b", "score": "0.7156273", "text": "def clk\n write = nil\n \n # clear all pipes\n @pipes.map!{ 0 }\n\n # read from components\n @components.each do |c|\n c.bus_write.each_with_index do |pipe, i|\n if pipe == 1\n ...
[ { "docid": "0478f2d7644c0379d489d52f6b90c519", "score": "0.6645181", "text": "def do_clock(*a)\n clock = MIDIMessage::SystemRealtime[\"Clock\"].new\n emit(clock)\n !@devices.empty?\n end", "title": "" }, { "docid": "b271f845168885ce95d5c3054a7eedbf", "score": "0.6048868...
3efbc41c928482835e7bf06f5413275d
PATCH/PUT /rotations/1 PATCH/PUT /rotations/1.json
[ { "docid": "7e9a6e99addc1cfbd9d784c37bb71693", "score": "0.6045251", "text": "def update\n if @rotation.update(rotation_params)\n redirect_to @rotation, notice: 'Rotation was successfully updated.'\n else\n render :edit\n end\n end", "title": "" } ]
[ { "docid": "c7b1ade4bcf70c028d646ac8669edf8a", "score": "0.6921945", "text": "def update\n respond_to do |format|\n if @rot.update(rot_params)\n format.html { redirect_to @rot, notice: 'Rot was successfully updated.' }\n format.json { head :no_content }\n else\n format....