query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "ef21af786b2f459707058be9f0d2139e", "score": "0.0", "text": "def set_rhizome\n @rhizome = Rhizome.find(params[:rhizome_id]) unless params[:rhizome_id].to_i.zero?\n @rhizome = Rhizome.find(params[:rhizome].to_i) unless params[:rhizome].nil?\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6165152", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.60463154", "text": "def action_hook...
7c0bb8448066d03f3cbf948836a3334e
Returns true if the user is logged in, false otherwise.
[ { "docid": "033122130f28187b8db4b9efdb092e8b", "score": "0.0", "text": "def logged_in?\n !current_user.nil?\n end", "title": "" } ]
[ { "docid": "31fb4132def094f5ed9925db932d58eb", "score": "0.89972186", "text": "def user_is_logged_in\n if session[:current_user] != nil\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "5e8797ab67adadcb571fb446716121fe", "score": "0.8901693"...
c6bbbda11448c89332640061539f7f89
GET /products/new GET /products/new.xml
[ { "docid": "e2e8b4cf8c3e2e3f98a40ca2ba27e4eb", "score": "0.0", "text": "def new\n @pagetitle = \"New product\"\n \n @product = Product.new\n @product[:cost] = 0\n @product[:quantity] = 0\n\n @product[:quantity_transit] = 0\n @product[:company_id] = params[:company_id]\n @product[...
[ { "docid": "31698ddacdfc4138f298bd484b3a0e5c", "score": "0.7649471", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @product }\n end\n end", "title": "" }, { "docid": "d617fd8e9581069ad5e58648d3e9b4aa", "score": "0.7...
f1bf90220d75a2bc280707d365025e2f
render a content tag with the collected contents rendered by &block for each item in collection.
[ { "docid": "2a8696cc56406f93897b0850c1e5182a", "score": "0.594434", "text": "def content_tag_nested(tag, collection, options = {}, &block)\n content_tag(tag, safe_join(collection, &block), options)\n end", "title": "" } ]
[ { "docid": "31bd0320240f39ed4fe1a19519007fe3", "score": "0.73668474", "text": "def content\n @blocks.map{|block| block.render}.join\n end", "title": "" }, { "docid": "a177ec4902818140666ba13e4b386931", "score": "0.72623014", "text": "def render_content_tag_for(items)\n @...
ab6b8d3acede911ffc0f818611a593dc
GET /premium_registration_settings GET /premium_registration_settings.json
[ { "docid": "2b754ec10274b8916bbb7e4ec0e570b6", "score": "0.75839996", "text": "def index\n @premium_registration_settings = PremiumRegistrationSetting.all\n end", "title": "" } ]
[ { "docid": "712304cfa90fc79cdfb6747b86663f73", "score": "0.720563", "text": "def set_premium_registration_setting\n @premium_registration_setting = PremiumRegistrationSetting.find(params[:id])\n end", "title": "" }, { "docid": "93971dd1ea4acde0145876949f041d31", "score": "0.68755...
685c7fd2a4b302d8ed7add4b637a3529
GET /climber_educations GET /climber_educations.json
[ { "docid": "a27e88454f1e148ad4ecec1655b766fb", "score": "0.686996", "text": "def index\n @climber_educations = ClimberEducation.all\n end", "title": "" } ]
[ { "docid": "2bc27759945a2a8fb9db4c6a2a6ac55a", "score": "0.6849909", "text": "def show\n render json: @educations\n end", "title": "" }, { "docid": "eba7d2fa63cd0100aed6da69e9e2088b", "score": "0.6491772", "text": "def index\n @educations = Education.all\n render json: @edu...
bb1050b9e327830fbefdd8ff45878c9c
int64 Desktop app session lifetime (in hours)
[ { "docid": "fdab41eb2c21c4027d384795454b2405", "score": "0.8635087", "text": "def desktop_app_session_lifetime\n @attributes[:desktop_app_session_lifetime]\n end", "title": "" } ]
[ { "docid": "5bb7cd44e78b81ba160184cfa0146af2", "score": "0.79066205", "text": "def mobile_app_session_lifetime\n @attributes[:mobile_app_session_lifetime]\n end", "title": "" }, { "docid": "66e8f909efd58dcf786e61359931ccee", "score": "0.69428307", "text": "def get_idle_time; ...
ce0b21cf5f7a401272308ee2316169b8
check if input is 14
[ { "docid": "d8632ceb6bc196b462a606e95cda9352", "score": "0.0", "text": "def valid_operation(num)\n [1,2,3,4].include?(num)\nend", "title": "" } ]
[ { "docid": "03994762298bbb37ab1e74023dbb0e47", "score": "0.6882196", "text": "def valid_input?(input)\n return false unless input =~ /\\A\\d+\\Z/\n return false unless input.to_i > 0 and input.to_i < 4000\n true\n end", "title": "" }, { "docid": "e1722531d5a2bfb217962c248defec07", ...
9d9d040fe179c52ca4068f6e5d455611
GET /taxfrees GET /taxfrees.json
[ { "docid": "7851fff34d13f5ce385cbd7494c8469f", "score": "0.72840375", "text": "def index\n @taxfrees = Taxfree.all\n end", "title": "" } ]
[ { "docid": "ca582d3bc1c05bf6eb2a82703c79cab4", "score": "0.6952305", "text": "def index\n @taxes = Tax.all\n\n render json: @taxes\n end", "title": "" }, { "docid": "f3cd11d5fb5c9ad94ca4b6d89f082e2a", "score": "0.6777846", "text": "def get_all_taxes\n self.class.get(\"/alde...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "0db14bd773322770105f1344b921659f", "score": "0.0", "text": "def task_progress_params\n params.require(:task_progress).permit(:task_id, :user_id, :done, :answer)\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...
fd9f608e91ae9e7963df1914627c226e
this is provided so that implementing application can override this behavior and map params to different attributes
[ { "docid": "643574f538affecc8bb6b9705321679e", "score": "0.0", "text": "def update_metadata\n file_attributes = form_class.model_attributes(attributes)\n actor.update_metadata(file_attributes)\n end", "title": "" } ]
[ { "docid": "2824d3cecaf24bae1e15940382b95a52", "score": "0.6902212", "text": "def make_params\r\n raise 'must be implemented in subclasses'\r\n end", "title": "" }, { "docid": "ec16b4da58d11b27a637089732d0dee7", "score": "0.6691221", "text": "def inherited_params\n ...
569a73998b81be0c4f18338bd60cea56
List the switch profiles for your switch template configuration
[ { "docid": "45c91088c29761c5ebec0704306f8a73", "score": "0.5677779", "text": "def get_organization_config_template_switch_profiles(options = {})\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'organization_id' => options['organization_id'],\r\n 'config_template_...
[ { "docid": "93edd2ba7f3c41892d9400fad4224664", "score": "0.67917913", "text": "def list_profiles\n # /profiles returns a list of profiles.\n end", "title": "" }, { "docid": "1bbe0245de03cad3fe9febd964f2b771", "score": "0.6454249", "text": "def list_switching_profiles(opts = {})\n...
5f9079997c54f96eb3f92ba4b981cc0d
GET /articles/new GET /articles/new.json
[ { "docid": "78be2b67b5142bf256e99b2aedf775ac", "score": "0.0", "text": "def new\n\t@formArticle = Article.new\n\t@type = @formArticle.get_type_by_id(params[:c])\n\tif userCanCreateArticle? and @type != nil\n\t\t@draft = current_user.article_draft\n if @draft.article_type_id != \tparams[:c].to_i\n ...
[ { "docid": "c1d5c9badc05675b78a2ada299d575f3", "score": "0.8205015", "text": "def new\n @article = Article.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @article }\n end\n end", "title": "" }, { "docid": "24445c0878...
a312add905cac9cd15b5fc9574e67be3
Asserts if the client is connected and raises an error if not.
[ { "docid": "dfb270fbaa0e7704b592bf5c848ecbe0", "score": "0.8326464", "text": "def assert_connected\n raise ConnectionError, 'not connected' unless @connected\n end", "title": "" } ]
[ { "docid": "1f7dd19d46c514a15ec937f23b9a92d3", "score": "0.75541145", "text": "def check\n begin\n unless @client.connected?\n self.logging \"[#{Time.now}]Disconnected! Try Reconnecting!\"\n @client.reconnect\n end\n @client.status(nil, \"\")\n rescue => e\n raise...
404c1d0a82d74ccfcc7e30cba562277b
the most important part
[ { "docid": "7850b17cdbc9f08b3130c76d02a525dc", "score": "0.0", "text": "def alias_class_method(new_name, old_name)\n #klass = self.to_s\n metaclass.instance_eval do\n alias_method new_name, old_name\n end\n end", "title": "" } ]
[ { "docid": "d88aeca0eb7d8aa34789deeabc5063cf", "score": "0.67971194", "text": "def offences_by; end", "title": "" }, { "docid": "18b70bef0b7cb44fc22c66bf7965c231", "score": "0.677613", "text": "def first; end", "title": "" }, { "docid": "18b70bef0b7cb44fc22c66bf7965c231",...
f6a131da1de76710c59334c5628cbb20
Deletes the last queen from the board
[ { "docid": "c7d33ebc48435bbdbe4a3abdf47ada54", "score": "0.86018586", "text": "def remove_last_queen\n\t\trow = ( @board.find_index( nil ) ? @board.find_index( nil ) : @board.length ) - 1\n\t\tif DEBUG\n\t\t\tstring = \"#{@board}\"\n\t\tend\n\t\t@board[ row ] = nil\n\t\tif DEBUG\n\t\t\tstring += \" => #...
[ { "docid": "6c6313ae418540ff06df5424df598f91", "score": "0.67106134", "text": "def delete_last\n deque.pop unless deque.empty?\n end", "title": "" }, { "docid": "fced84d35749c38afab14b1fbf88c67a", "score": "0.6254343", "text": "def delete_last_move\n if @moves_count > 0\n ...
c5f157682b09577ce86cef440b7cde12
Translate the coors into a human direction We are using a case statement as for now the directions are limited
[ { "docid": "2c88dbdef646d214a4cdc7cf2d8b4435", "score": "0.0", "text": "def grad_to_direction(grads) \n angle = to_quadrant(grads)\n case angle\n when 0, 360 then :north\n when 1..89 then :northeast\n when 90 then :east\n when 91..179 then :southeast\n ...
[ { "docid": "a3686aeb2be24436de8cb03b752858c1", "score": "0.66651917", "text": "def right_turn(e_direction)#use placeholder name e_direction\n case\n when e_direction == \"N\"\n @direction = \"E\"\n when e_direction == \"E\"\n @direction = \"S\"\n when e_direction == \"W\"\n @dir...
ab30d08bfe65188f51a065e693c6220c
delete_pool_members :: [String], [[[String,Integer]]] > undefined Note: At least one of delete_pool_member and delete_pool_members must be implemented.
[ { "docid": "9ab350e7015938cb6d7d7a5375a2b37f", "score": "0.8143951", "text": "def delete_pool_members pool_names, member_lists\n (pool_names.zip member_lists).map do |pool,members|\n members.map {|address,port| delete_pool_member pool, address, port}\n end.flatten 2\n end", "titl...
[ { "docid": "c8af2f8cfbc2d97bfc95ec0715e20cdc", "score": "0.7264127", "text": "def delete_pool_member pool_name, address, port\n delete_pool_members [pool_name], [[[address, port]]]\n end", "title": "" }, { "docid": "aaef3d219cec8f902bc6b8f4cbd6bc69", "score": "0.7164113", "te...
a26d42e858639651c823b5b1eb3d835a
Find the mean (average) of a list of numbers in an array. Information To find the mean (average) of a set of numbers add all of the numbers together and divide by the number of values in the list. For an example list of 1, 3, 5, 7 1. Add all of the numbers 1+3+5+7 = 16 2. Divide by the number of values in the list. In ...
[ { "docid": "da44366037286632b7abaa3c179e862a", "score": "0.0", "text": "def find_average(nums)\n nums.empty? ? 0 : nums.sum.to_f / nums.count\nend", "title": "" } ]
[ { "docid": "db69770c280b010ed18c0219b2551655", "score": "0.85282433", "text": "def mean(array_of_numbers)\n return sum(array_of_numbers) / array_of_numbers.length\n end", "title": "" }, { "docid": "02d40c38e86c7dffaaedeff8b2218af1", "score": "0.8261199", "text": "def mean(list_of...
8749a944ef960f537c39386d9e225909
Puts out an error. The error is written to STDERR and colored in the error color.
[ { "docid": "e6b222891c524525fdd3c51418b6957a", "score": "0.62000656", "text": "def error(message, backtrace=nil)\n STDERR.puts color(message, error_color)\n backtrace.each {|line| line_color = (line[0..1] == '/') ? backtrace_local_color : backtrace_gem_color; STDERR.puts color(line, line_color...
[ { "docid": "66bd73d5817dab5efa86e0e558fd364e", "score": "0.7852449", "text": "def error(message)\n $stderr.puts colorize(message, :error)\n end", "title": "" }, { "docid": "b9366fae5c65c778d27bc9129484e44e", "score": "0.78352594", "text": "def error(message)\n message = ...
5ba2e5f09ce4e86aaa29a7ac001453b8
Time complexity O(n) because you have to traverse the entire list to find the length so the time complexity will scale according to the length of the list Space complexity O(1) because we will never use more than one variable (memory) to traverse the linked list.
[ { "docid": "fff5a3f0ebfe96d749ef6c09762d05ac", "score": "0.7032455", "text": "def length\n \n current = @head\n\n count = 0\n\n while current != nil \n \n count += 1\n current = current.next\n end \n\n return count \n end", "title": "" } ]
[ { "docid": "6e27d7a92fb6cffe4188cf5bd41a6334", "score": "0.82071245", "text": "def list_size() #iterativ approch O(n) time compexity\n counter = 0 \n temp_node = @head #start traversing the list from first element(head)\n until temp_node == nil #traverse until loop reach end of the list\n ...
190a3dbf155edf528303d3b78f458b6c
POST /warehouses POST /warehouses.json
[ { "docid": "dabad06b4d6dbb0b4a53bd238ef5bf43", "score": "0.6820663", "text": "def create\n @warehouse = Warehouse.new(warehouse_params)\n if(!@warehouse.hub_id)\n @warehouse.hub_id=params[:hub_id]\n end\n @warehouse.modified_by = current_user.id\n respond_to do |format|\n if @wa...
[ { "docid": "c386e0fa32e12b512c9f08d183e06474", "score": "0.7563328", "text": "def create\n @warehouse = Warehouse.new(warehouse_params)\n\n respond_to do |format|\n if @warehouse.save\n format.html { redirect_to @warehouse, notice: 'Warehouse was successfully created.' }\n forma...
daf380e25ad4fe5fa96c5ce3367cfc6b
PUT /usuario/1 PUT /usuario/1.json
[ { "docid": "f71a615b7add1bdab048e0c2a69fff45", "score": "0.0", "text": "def update\n @usuario = User.find(params[:id])\n\n\n if current_user.tipo!=\"MASTER\"\n if @usuario.tipo\n if @usuario.tipo==\"LIDERANCA\"\n @entidade = current_user.entidade\n @superiores = @en...
[ { "docid": "b5edb8a9b2cad14c7874c5f42c5809e9", "score": "0.7059869", "text": "def test_put_user\n json_data = '{\"name\":\"test\", \"last_name\":\"test\", \"document\" : \"098\"}'\n put '/users/4', json_data\n assert_equal 204, last_response.status, 'Código de respuesta incorrecto'\n end", ...
a1d9c984d7978926bfc4c0a7da78a511
Disconnect a specific device
[ { "docid": "87f9bf91869d7bd4053af311a1baaab2", "score": "0.78880155", "text": "def disconnect(device)\n command = 'adb -s %s usb' % [device.id]\n error_message = \"Unable to disconnect '%s'.\" % [device.model]\n execute_shell_command(command, error_message)\n end", "title": "" } ...
[ { "docid": "167cfa4d26937230c70fb8149b2dedc1", "score": "0.7807237", "text": "def disconnect\n device.close\n end", "title": "" }, { "docid": "ed92aa5cbadd8172ed2a3f30804e28c1", "score": "0.7233888", "text": "def session_bt_disconnect\n $testCaseID = \"VT229-0456\"\n ...
894b80ee9d10ddf12d090bf2a0afff2e
GET /registrations/1 GET /registrations/1.xml
[ { "docid": "86032fcc213e1b366a83746435bbfa9f", "score": "0.65665704", "text": "def show\n @registration = Registration.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @registration }\n end\n end", "title": "" } ]
[ { "docid": "47390fbab590bbd125427c701a40c681", "score": "0.69325477", "text": "def new\n @registry = @user.registries.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @registry }\n end\n end", "title": "" }, { "docid": "0a99a9...
c3d686570a07055ef024deae86f5ae7e
GET /ratings/1 GET /ratings/1.json
[ { "docid": "76e90d3b34050ded0ac36e18b7b564ff", "score": "0.0", "text": "def show\r\n end", "title": "" } ]
[ { "docid": "22b94507799b4c83b9983d5b40541a99", "score": "0.79164475", "text": "def ratings\n Birdman::Requester.get(\"shows/#{id}/ratings\")\n end", "title": "" }, { "docid": "0dd820d98691a00a506dbb28de14389e", "score": "0.77982855", "text": "def show\n @rating = Rating.find(p...
bbccb4ae10765496bfad36068827172a
Returns num of potential pairs
[ { "docid": "4daefb0e0d88fc46c1933705b9e3bd92", "score": "0.90978825", "text": "def num_potential_pairs\n potential_pairs.size\n end", "title": "" } ]
[ { "docid": "306bcbb4d08b0d7701287e6bdabb5d57", "score": "0.72839385", "text": "def number_of_pairs(gloves)\n gloves.group_by { |glov| glov }.values.map { |group| group.count / 2 }.sum\nend", "title": "" }, { "docid": "5c01ca52f0d7ac1d6bbdd722a6a2bf42", "score": "0.7233718", "text": ...
b6b9cd199dfaed08c4c534812e0ac109
Check to see if the all the properties in the model are valid
[ { "docid": "e1e228a92b4efaa2ab3f22352d3f7431", "score": "0.0", "text": "def valid?\n return true\n end", "title": "" } ]
[ { "docid": "162d0e63d65b0cd6795543bab63498f2", "score": "0.78992486", "text": "def validate_properties\n true\n end", "title": "" }, { "docid": "162d0e63d65b0cd6795543bab63498f2", "score": "0.78992486", "text": "def validate_properties\n true\n end", "title": "" ...
3ed3049bd1966373eb1df9971e5df9ca
Malthusiast doublehearted yagnob whatness gweduc fundholder Snecker hafter undefrauded nonprofit thirtyish romulian Raphaelesque anan symbolaeography healthlessness mimmood celaeno Khuzi resuppression rhizome thelephoraceae pyramidwise marybud
[ { "docid": "1f36c306e3ef0236f35acd84af943d61", "score": "0.0", "text": "def pigeongram?()\n microreaction_glaked(fringilla, totemism, omnimeter_prologuizer)\n end", "title": "" } ]
[ { "docid": "b37290a50751816117e54322a6548bdd", "score": "0.6316231", "text": "def dishonorableness()\n ragwort_yellowrump_spearmanship(masurium_vulsinite, poco, renunciable)\n tchetnitsi()\n cognitive_dowser(underwave)\n end", "title": "" }, { "docid": "8d63a490a7b76b9b269f...
57d29265fe8d8e0880819b7913bf4656
DELETE /schematics/1 DELETE /schematics/1.json
[ { "docid": "355a010348f5dd3c6f481f4c452e0cc4", "score": "0.76201004", "text": "def destroy\n @schematic = Schematic.find(params[:id])\n @schematic.destroy\n\n respond_to do |format|\n format.html { redirect_to schematics_url }\n format.json { head :no_content }\n end\n end", "...
[ { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.7183071", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": "...
2b10abdba24b8e5d5778870917b71bd5
Call each before hook, and if they all succeed, yield. If they don't all succeed, call after_ for each one that succeeded.
[ { "docid": "a962ed30d6e0f1d9443fc3e96e34156a", "score": "0.6594932", "text": "def call_hooks(instrumenters, object, before_hook_name, after_hook_name, i = 0)\n if i >= instrumenters.length\n # We've reached the end of the instrumenters, so start exiting the call stack.\n #...
[ { "docid": "bfa827d4868925607ae236cd061161dd", "score": "0.6928272", "text": "def call\n hooks.run(self, :before, :all, it_scope)\n yield\n hooks.run(self, :after, :all, it_scope)\n end", "title": "" }, { "docid": "81ed79a74b7b197840ee28f36bbf0b87", "score": "0.6796243...
e6835503915264ebfecb0ee10ff39c35
POST /appliances POST /appliances.json
[ { "docid": "8e1534bd1b9a1cbf29baffa9f86128c1", "score": "0.74899566", "text": "def create\n @appliance = Appliance.new(appliance_params.merge(user_id: current_user.id))\n\n if @appliance.save\n redirect_to appliances_path, notice: 'Appliance was successfully created.'\n #format.jso...
[ { "docid": "1621bb3894cc50bdad17d6c164a6b894", "score": "0.73561823", "text": "def create\n @appliance = Appliance.new(appliance_params)\n @appliance.owner = current_user\n authorize @appliance\n respond_to do |format|\n if @appliance.save\n format.html { redirect_to @appliance, ...
37cacedb59a5e58ab9d8d077b7281494
debugger p multiply(3, 5) => 15 p multiply(5, 3) => 15 p multiply(2, 4) => 8 p multiply(0, 10) => 0 p multiply(2, 1) => 2 p multiply(3, 6) => 18 p multiply(3, 6) => 18 p multiply(3, 6) => 18
[ { "docid": "137718024f71825f97bb5bf358e8d9d1", "score": "0.0", "text": "def lucas_sequence(n)\n return [] if n == 0\n return [2] if n == 1\n return [2, 1] if n == 2\n lucas_sequence(n-1) + [(lucas_sequence(n-1)[-1] + lucas_sequence(n-1)[-2])]\nend", "title": "" } ]
[ { "docid": "ab1974df23853abd110cb0f29b7237ef", "score": "0.75620896", "text": "def multiply(*nums)\n total = 1\n nums.each { |x| \n total *= x\n }\n return total\nend", "title": "" }, { "docid": "d54fc9c0fb6349207dfe98779eba69bb", "score": "0.75378114", "text": "def mu...
8729703866c3ec0b83d7c9767234769f
required parameters: name: instance_id, type: String optional parameters: name: _method, type: String, optional values: GET|POST name: _region, type: String name: _scheme, type: String, optional values: http|https name: force_stop, type: Boolean name: owner_account, type: String name: owner_id, type: Long name: resourc...
[ { "docid": "f30a3b9d1740822ba0acfd4889a4fd80", "score": "0.0", "text": "def reboot_instance(instance_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'RebootInstance'\n\t\targs[:query]['InstanceId'] = instance_id\n\t\targs[:region] = optional[:_region] if (optional.key? :...
[ { "docid": "05b15feaae8b01d1ec17b03ab8a2eef6", "score": "0.63872087", "text": "def describe_instances(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeInstances'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\...
dde5677c40e874c3fe483ff262ff4a93
POST /rabotniks POST /rabotniks.json
[ { "docid": "72864cdeebce46aca8bd953878f1a433", "score": "0.68006533", "text": "def create\n @rabotnik = Rabotnik.new(params[:rabotnik])\n\n respond_to do |format|\n if @rabotnik.save\n format.html { redirect_to @rabotnik, notice: 'Rabotnik was successfully created.' }\n format.j...
[ { "docid": "44b0171949e3e1000cac78177666f18d", "score": "0.6280343", "text": "def post_criar_relatorio(body)\n self.class.post(\"/relatorios\", :body => body.to_json)\n end", "title": "" }, { "docid": "4e4182b50bb4dc4f90ad767606287046", "score": "0.58671707", "text": "def new\n ...
a8cf17b1587bdfca98a4df60027f019c
Retrieves the stat and builds a hash of hashes representing it
[ { "docid": "69c1f1e5bff8988414d060d2f5c45496", "score": "0.0", "text": "def parse(host)\n backends = {}\n\n new_backend = {:cgi => \"\", :connected => 0, :died => 0, :disabled => 0,\n :load => 0, :overloaded => 0, :processes => 0} \n\n get(host) do |stat|\n backend = st...
[ { "docid": "b587864d01e6087e255a086db068dd50", "score": "0.725382", "text": "def getstats\n\tret = {}\n\tlisttrackedfiles.each { |f|\n\t\tret[f] = Digest::MD5.file(f).hexdigest rescue next\n\t}\n\tret\nend", "title": "" }, { "docid": "11b5c383d58a39d93b08f603320f7f44", "score": "0.701619...
2202af306e80a7c56fe713f8e4b9231c
make sure unquiness for name validation is skipped on validate
[ { "docid": "0d84e1ba51d788ee15dbe196586f6d02", "score": "0.0", "text": "def skip_uniqueness_validation!\n @skip_uniqueness_validation = true\n end", "title": "" } ]
[ { "docid": "ad10dad0c4d78fda1f1f706f47777a5c", "score": "0.80211383", "text": "def name_is_valid\n errors.add(:name,\"Invalid empty string for name.\") unless name_is_valid?\n end", "title": "" }, { "docid": "6fb9722808d27be43167b4cdeee8831d", "score": "0.80076355", "text": "def ...
c83f1877409662b4bf9a0e5cacfe3a33
POST /work_plans POST /work_plans.json
[ { "docid": "55a284ae7a020e28801091939ad0eb81", "score": "0.7363965", "text": "def create\n\n @work_plan = WorkPlan.new(work_plan_params)\n\n sourceWorkPlan = WorkPlan.find_by(id: params[:source_work_plan])\n\n if sourceWorkPlan.present?\n sourceWorkPlan.work_steps.each do |ws|\n new...
[ { "docid": "a800dd709755d2885feebc66c05058ee", "score": "0.7590075", "text": "def create\n @plan_workout = @plan.plan_workouts.create(plan_workout_params)\n\n render json: @plan_workout\n end", "title": "" }, { "docid": "1ec47d076c922ee16e9c6d11519812b8", "score": "0.72347873", ...
fde835b23212c2734378108ad490f066
GET /seccos/1 GET /seccos/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "c3c11ed0e04079a462fc6e922f65286f", "score": "0.7441264", "text": "def index\n @seccos = @curso.seccos\n end", "title": "" }, { "docid": "0d7b74981876d6db29ddb3e3ee5fff9e", "score": "0.68425184", "text": "def index\n @curso = Curso.find(params[:curso_id])\n @secc...
a96b1d4c2ebe58d7f482aa1d806d687e
GET /wells/1 GET /wells/1.json
[ { "docid": "27665d1dbbcfbbef167b4b0dfd0a3066", "score": "0.7619426", "text": "def show\n @well = Well.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @well }\n end\n end", "title": "" } ]
[ { "docid": "6d5a931ed9c08b437872615557c464db", "score": "0.7080182", "text": "def index\n @wells = Well.find_for_web_map(params)\n respond_to do |format|\n# format.html # index.html.erb\n format.json { render json: @wells }\n end\n end", "title": "" }, { "docid": "58168fc...
a4633762609f5ac5060cec374d21aa8f
Make a DELETE request with the Access Token
[ { "docid": "b89afebf1ce3589ff70350633b64bb10", "score": "0.0", "text": "def delete(path, opts = {}, &block)\n request(:delete, path, opts, &block)\n end", "title": "" } ]
[ { "docid": "397adb4b1c5d59121a2c28917d86194b", "score": "0.7998595", "text": "def delete(url, params)\n params = convert_hash_keys(params)\n @access_token = params.delete('access_token') if params['access_token']\n return connection.delete(url)\n end", "title": "" }, { "doc...
65190eed651299d7c5c8c31de7517576
Provide a stable way to identify this view through attribute changes. By default views cannot make assumptions about the identity of our attributes, so we fall back on the view's `object_id`. If a viewmodel is backed by a model with a concept of identity, this method should be overridden to use it.
[ { "docid": "f9a4265dbaeb130fe064a505f162a947", "score": "0.5521894", "text": "def id\n object_id\n end", "title": "" } ]
[ { "docid": "c265bd89519928bb3593bf0d2a53f9d6", "score": "0.5983027", "text": "def identifier\n self.class.identifier_for(send(self.class.identifying_attribute))\n end", "title": "" }, { "docid": "a3fdf50a7d5e7a569c1fd83be30547e6", "score": "0.5918639", "text": "def object_id(...
f82b6a239d2a3162b46f5e8e79588898
Below Checks if current user owns given object for given passed in argument. Also checks for admin
[ { "docid": "f1f776ffc740a64ba1346489bf872785", "score": "0.0", "text": "def is_current_users?(resource)\n if current_admin && is_admin_resource?(resource)\n return true if resource.admin == current_admin\n else \n return true if resource.user == current_user\n end \n end", "title...
[ { "docid": "207c36f885a9568aeafc43d849f75e81", "score": "0.8132248", "text": "def owns?\n current_user && current_user == @user\n end", "title": "" }, { "docid": "fb491a3d8a9e5afc3fc7885b732f7f81", "score": "0.8060749", "text": "def is_owner?(obj)\n obj.user_id == current_user...
a972939f1bf099e0e79bd827d6773237
Target operation respond to process, process respond to parent_operation
[ { "docid": "e47fcca96927bca56ecf302c62b26368", "score": "0.6219187", "text": "def parent_methods\n [:parent_operation, :process]\n .select { |method_name| target.respond_to?(method_name) }\n end", "title": "" } ]
[ { "docid": "8c5df03ac07c8e1a86a824c0ec8cce72", "score": "0.6497379", "text": "def target\n @target ||= begin\n parent = context[:parent]\n if parent.is_a? RailsWorkflow::Operation\n parent.becomes(RailsWorkflow::Operation)\n elsif parent.is_a? RailsWorkflow::Process\n ...
9209aed55b96e310833d134e8d7971ed
Seeds the database with all teams and conferences. Your conferences should first be loaded using db:seed
[ { "docid": "746a9580427ae1135f3f7b263b476ddb", "score": "0.49405387", "text": "def get_teams\n doc = Nokogiri::HTML(open(\"http://www.espn.com/mens-college-basketball/teams\"))\n conferences = doc.css(\"div.mod-teams-list-medium\")\n \n # Cycle through conferences filling in the name of each...
[ { "docid": "871bad3cd8df2a222a56c274be770c4a", "score": "0.6307032", "text": "def init_teams\n init_org if @org.blank?\n @team = Team.where('name is NOT NULL').first_or_create(name: 'development', org_id: @org.id)\n end", "title": "" }, { "docid": "170626a99a64d7bacd2381ca1819e587", ...
9f91a3d0f7b1dfd0aa54b729714d377e
Assign a block of code to the onTouch event.
[ { "docid": "79a536c8d1a7727fa618d0a590e4bbb7", "score": "0.8491682", "text": "def onTouch(&block)\n set_event_proc(:onTouch, block)\n end", "title": "" } ]
[ { "docid": "e6aa4574badf06aa8e3bd08bc26ba99b", "score": "0.8632072", "text": "def onTouch(&block)\n set_proc(:onTouch, block)\n end", "title": "" }, { "docid": "3c7208d71851b7374b3e4d34508ac7ce", "score": "0.8237918", "text": "def onTouching(&block)\n set_proc(:onTouchin...
484281e7bd27272c4297c8d322e216e6
since real answers require real values, it is assumed that new answers (and only new answers) will have new values
[ { "docid": "f24b4ff157c39eef066cfb6e61ec7e9a", "score": "0.0", "text": "def fetch_value_card\n fetch :value, new: new_value_card_args\nend", "title": "" } ]
[ { "docid": "76d779f6324737cad19d9822e691a9aa", "score": "0.60341", "text": "def solved(ans)\n\n end", "title": "" }, { "docid": "288f4178f2fb545720e18e760b9fb304", "score": "0.5957627", "text": "def optimal_answer?\n \tanswer_value == optimal_value\n end", "title": "" }, ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "4552da237546428de0480e9bc34e4c23", "score": "0.0", "text": "def set_scent\n @scent = Scent.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...
4ebe30b98f317ecacfa3e717dd82c1b9
should puts the list of badges and room_assignments (FAILED 4)
[ { "docid": "0adcb27c91522067862d90b847fa2700", "score": "0.51598024", "text": "def printer(array)\n one = batch_badge_creator(array)\n two = assign_rooms(array)\n count = 0\n while count < array.length\n puts one[count]\n puts two[count]\n count += 1\n end\nend", "title": "" } ]
[ { "docid": "2170c1b699ad336e634a3f64b62f6a56", "score": "0.7133129", "text": "def printer(attendees)\n\n assign_rooms(attendees).each do |room_assignment|\n # .push(\"#{attendees}\")\n\n puts room_assignment\n end\n batch_badge_creator(attendees).each do |badge|\n\n puts badge\n en...
6c5ac2085aa1bd86bb830aee8621708d
DELETE /comments/1 or /comments/1.json
[ { "docid": "c6c4417698d5ae48f24ea502f62ba856", "score": "0.681584", "text": "def destroy\n @comment = Comment.find(params[:id])\n @comment.destroy\n respond_to do |format|\n format.html { redirect_to post_comments_url, notice: \"Comment was successfully destroyed.\" }\n format.json { ...
[ { "docid": "752ed216e7d9e361230d41d00e4c06d8", "score": "0.7401427", "text": "def destroy\n @comment.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fb3e14995faf2086fd7aec232f171872", "score": "0.72442245", "...
376b080feb31ee87966e90e14229efcf
Constructor Parameters +client_id+ :: client_id, as part of the OAuth 2.0 client credentials issued to this web app +client_secret+ :: client_secret, as part of the OAuth 2.0 client credentials issued to this web app +redirect_url+ :: the URL endpoint at which this web application listens for the idQ TaaS backend to re...
[ { "docid": "faed4c60a36ed19b2a20ca3265cd691c", "score": "0.73744017", "text": "def initialize(client_id, client_secret, redirect_uri)\n # Instance variables\n @client_id = client_id\n @client_secret = client_secret\n @redirect_uri = redirect_uri\n end", "title": "" } ]
[ { "docid": "f464a7714c88b13e5f3126482f52419e", "score": "0.72632813", "text": "def initialize(client_id, client_secret, redirect_uri='', state='')\n @client_id = client_id\n @client_secret = client_secret\n @redirect_uri = \"http://localhost\"\n @access_plan = :read_only\n @stat...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "fec64286b4f0bfdfcdef4dac2278e1d8", "score": "0.0", "text": "def form_item_params\n params.require(type.underscore.to_sym).permit(:type, :order, :label, :value)\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...
d38f8f7dc6aa288547c26adc641b33a3
test functions these will be used to see where the error in the code arose from
[ { "docid": "4643be661ea441837c0c681c91f195dd", "score": "0.0", "text": "def test_input_groups\r\n\tfor group in $group_list\r\n\t group.output_attr\r\n\tend\r\nend", "title": "" } ]
[ { "docid": "deca5e01605df7655cd433763b5329db", "score": "0.76146704", "text": "def non_example_failure; end", "title": "" }, { "docid": "16a6d5e8eabd975007f205c109c50890", "score": "0.7132091", "text": "def testing; end", "title": "" }, { "docid": "998a325d9d8e25bf1a5f618...
6ce1bd294abfd82fe07dd95ba79f45cb
Method for converting the data structure to JSON Recursively calls itself until it runs out of child nodes to get JSON from Accepts a string called tab that helps produce proper indenting in the json
[ { "docid": "9cd26c97c3dbf2623a88409b259652ef", "score": "0.75288343", "text": "def getJSON(tab)\n\n # All nodes get a name. Native support for to_json in Ruby is awesome, btw\n json = \"#{tab}{\\t\\\"name\\\" : #{name.to_json},\\n\"\n \n if (missione_id.to_json != \"null\") \n json += \"...
[ { "docid": "46c719ce153ffa560c4ed25b1c55f6a4", "score": "0.59943014", "text": "def json(indent=0)\n Oj.dump(@root, mode: :wab, indent: indent)\n end", "title": "" }, { "docid": "433d1fe4a89b828f9c0b20df7278ca2a", "score": "0.59039026", "text": "def to_json(chunk = nil)\n ...
55484c3ecb805a500e6bdcb800e1c114
GET /courses/:id/sessions GET /courses/:id/sessions.json
[ { "docid": "2547f646d1c626bef6691db4f7fd11fd", "score": "0.6510021", "text": "def index\n redirect_to '/', alert: 'Forbidden. Course belongs to a different teacher' and return unless @course.teacher == current_teacher\n @sessions = @course.sessions.all\n end", "title": "" } ]
[ { "docid": "c047f17bcf8054edf1e4cbe185731f98", "score": "0.76746434", "text": "def index\n @course = Course.by_account(@current_account).find(params[:course_id])\n @course_sessions = CourseSession.by_course(@course)\n\n respond_to do |format|\n format.html # index.html.erb\n format.js...
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "b896d2c792031b36908d69b21c5b0f6d", "score": "0.0", "text": "def favorite_template_params\n params.permit(:user_id, :template_id)\n end", "title": "" } ]
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.69497335", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6812623", "text": "def strong_params\n params.require(:listing_member).permi...
c418e58300c5192ca94482390c3c3aed
Get config store metadata Retrieve metadata for a single config store.
[ { "docid": "0ebc50fa778417910973375cfb1c48cb", "score": "0.54288846", "text": "def get_config_store_info_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ConfigStoreApi.get_config_store_info ...'\n end\n # unbox the paramet...
[ { "docid": "1f42256002b317b5792562eed4011f21", "score": "0.74297476", "text": "def get_config_store_info(opts = {})\n data, _status_code, _headers = get_config_store_info_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "fd6b5806547df97109203367f1795ffc", "score...
c445ab027231b3729049e61894735ba6
DELETE /admin/specials/1 DELETE /admin/specials/1.json
[ { "docid": "110166f91e5d899813fa381ab6ad7584", "score": "0.7700217", "text": "def destroy\n @admin_special.destroy\n respond_to do |format|\n format.html { redirect_to admin_specials_url, notice: 'Special was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",...
[ { "docid": "bdb7226a25cc2abdd662eb2b96a6cc5c", "score": "0.8001174", "text": "def destroy\n @admin_special = Admin::Special.find(params[:id])\n @admin_special.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_specials_url }\n format.json { head :no_content }\n en...
5a1fa91ba45f4bac3c07e112ec4ae546
Return instance id by node name.
[ { "docid": "54ddda48bf84a5089f7993a360a9f59f", "score": "0.7896987", "text": "def get_aws_instance_id_by_node_name(node_name)\n return nil unless configured?\n\n found_instance = instances_list.find { |instance| instance[:node_name] == node_name }\n found_instance.nil? ? nil : found_instance[:i...
[ { "docid": "24d7f79b0b21206f0779054922b6f838", "score": "0.6567273", "text": "def node_id(r)\n r.send(data_class.primary_key)\n end", "title": "" }, { "docid": "2c790b43bcc63d4356013bceb2e04afa", "score": "0.63233966", "text": "def get_node_id_by_name(name, keyname, secret)\n\tge...
6511a18af481bb93cd757e03db548271
Cancelled Exchange Fiat Deposits Gets a List of Cancelled Exchange Fiat Deposits. The value and fees are in paisa.
[ { "docid": "bac3992f806267f84fb40c1067a49561", "score": "0.0", "text": "def v1userexchangebankfiatdepositcancelled_with_http_info(authorization, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ExchangeBankFiatDataApi.v1userexchangebankfiatdeposit...
[ { "docid": "3600140a797b986e4377cd07c67f486f", "score": "0.5649771", "text": "def cajas_de_efectivo\n tipos = @factura.tipo_valido? ? Cp::Application.config.tipos_validos : Factura.tipos_invalidos\n\n cajas = @factura.obra.cajas.de_efectivo.\n where(tipo_factura: tipos)\n\n if @factura.pag...
4e4443035627d0e4cb4e3b84533bc4cf
just to test action cable
[ { "docid": "6141c593759072114d0937729f2435d3", "score": "0.0", "text": "def broadcast\n ActionCable.server.broadcast('SensorDataChannel', {soilMoisture:'can' , temperature: '23' , humidity: '65'})\n\n head :ok\n end", "title": "" } ]
[ { "docid": "89f2af5e0e68371eaab0bc193e0c99d6", "score": "0.6574012", "text": "def socket_actions\n []\n end", "title": "" }, { "docid": "d3d4b4c106e1f850b6d48da293a508a3", "score": "0.63665366", "text": "def action(target, msg)\n ctcp(target, \"ACTION #{msg}\")\n self\n en...
b1a3b88d1c3578d4cd2657392320d0df
def store_location session[:return_to] = request.request_uri end
[ { "docid": "c1440374e14198e293439c7321702864", "score": "0.0", "text": "def user_not_found\n flash[:alert] = \"Incorrect login or password\"\n redirect_to new_user_sessions_path\n end", "title": "" } ]
[ { "docid": "f3c6b68a3d82e4e9ab4ba02c8ed17718", "score": "0.9777215", "text": "def store_location\r\n session[:return_to] = request.request_uri\r\n end", "title": "" }, { "docid": "a7f3f813339919afa867afdd0fe826ad", "score": "0.9774717", "text": "def store_location\r\n sessio...
257c3edac1521189d7f59dd11504149b
before_filter :authenticate_user, except: [:index, :show] authorize_actions_for Comment, except: [:index, :show, :vote, :unvote]
[ { "docid": "0dd6ec8be626a3ebe8b0acea3fae0670", "score": "0.0", "text": "def index\n\t\t\t\tlimit = (params[:limit] && params[:limit] != '') ? params[:limit].to_i : 10\n\t\t\t\tif params[:offset] && params[:offset] != '' && params[:offset].to_i > 0\n\t\t\t\t\toffset = params[:offset].to_i\n\t\t\t\telsif ...
[ { "docid": "f5fb1ffec8c87234a8dc7a0a3514d8fe", "score": "0.7091079", "text": "def authorize\n if current_user.nil?\n redirect_to login_url, alert: \"Please Log in or Sign Up to comment!\"\n \tend\n end", "title": "" }, { "docid": "bfc8c06e3be1f8d8a9e5501c9df9aa26", ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "35650df6a29e7254a3ddebd7368d53f3", "score": "0.0", "text": "def my_resource_params\n params.require(:my_resource).permit(:title, :description, :status, :uploaded_file).merge(user_id: current_user.id)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whit...
066599c97b4b275d9c1fe4d4213bb271
Returns the User object that represents the loggedinuser for this proxy. If we don't already have the information about the user, perform an API request to retrieve it.
[ { "docid": "3e0a291b731accd02b5966b9860555e9", "score": "0.68678427", "text": "def user\n return false unless logged_in?\n @user ||= RedditApi::Reddit.new(:proxy => self).get_reddit_user(@username)\n end", "title": "" } ]
[ { "docid": "fb2adaa196c390cba3f364f0ebacae7b", "score": "0.7783004", "text": "def user\n\t\tguid = session[:user_guid]\n\t\tif guid.nil? and !request.headers[\"X-Authenticated-By-Proxy\"].nil?\n\t\t\t# X-Authenticated-By-Proxy is valid for a request\n\t\t\t# coming in from the event proxy. Make sure thi...
8fc2d9169b9f580b6df4d7ab9667e029
Check if path is a highrisk or vulnerable server administration path Check if the input URL or relative path is a server Administration Path, and therefore a risk or vulnerability for remote access.
[ { "docid": "9199d19e7d5f9568ab7f510af19cdba3", "score": "0.56134623", "text": "def domain_is_admin_path_with_http_info(value, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DomainApi.domain_is_admin_path ...'\n end\n # verify the requir...
[ { "docid": "e348a3a7f5931ffd6c78fc0dc0d6751d", "score": "0.6381915", "text": "def _remote_path?(path)\n # not exactly foolproof, but it will do for now\n path.include? ':'\n end", "title": "" }, { "docid": "107bdee458d8fdc9d29466a7b4809c76", "score": "0.6286277", "text":...
92dc740aab324213abf7564fbe7ddaf6
PATCH/PUT /applications/1 PATCH/PUT /applications/1.json
[ { "docid": "660e391d5f9027defe80786bfeb6f280", "score": "0.0", "text": "def update\n respond_to do |format|\n if @application.update(params[:name] => params[:value])\n format.js\n format.json { render :show, status: :ok, location: @application }\n else\n format.js { ren...
[ { "docid": "fa9b25fc88fe47caede8d93d908f16e9", "score": "0.7709362", "text": "def patch_application(application_id, request)\n start.uri('/api/application')\n .url_segment(application_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .patch()\n .go(...
a256a72a5a6281a5fcba7bae7f6b74c6
Returns a list of metrics and a corresponding list of granularities for each metric. ==== Returns response: body: 'ResponseMetadata': 'RequestId' Id of request 'DescribeMetricCollectionTypesResult': 'Granularities': 'Granularity' The granularity of a Metric. 'Metrics': 'Metric' The name of a Metric. ==== See Also
[ { "docid": "6f6680ebb538e4eb3708fcdf6256b50b", "score": "0.7075791", "text": "def describe_metric_collection_types()\n request({\n 'Action' => 'DescribeMetricCollectionTypes',\n :idempotent => true,\n :parser => Fog::Parsers::AWS::AutoScaling::DescribeMet...
[ { "docid": "4af79ce3657598fad5e38f601c7b5b33", "score": "0.6320153", "text": "def list(provider, resource_type, resource_name, resource_group = nil, options = {})\n resource_group ||= configuration.resource_group\n\n raise ArgumentError, \"no resource group provided\" unless resource_g...
de2bd0dcfc5c43137e5cf2377059fcca
DELETE /future_planes/1 DELETE /future_planes/1.json
[ { "docid": "3eda3258b0197c81e272a413b562fd79", "score": "0.740832", "text": "def destroy\n @future_plane.destroy\n respond_to do |format|\n format.html { redirect_to future_planes_url, notice: 'Future plane was successfully destroyed.' }\n format.json { head :no_content }\n end\n end...
[ { "docid": "0b24cbc6495df3923ea7679acbcd8deb", "score": "0.74764854", "text": "def delete_floor_plan(args = {}) \n delete(\"/files.json/floorplan/images\", args)\nend", "title": "" }, { "docid": "7ec28fca19606405b1a13c8ab0ad6bb4", "score": "0.7147132", "text": "def destroy\n @plan...
26c188da030b0bc06303a8e6f68158fd
Created on: 16/02/2012 Purpose: load discussion photos on scrolling page(ajax) ++
[ { "docid": "a4d4aeb97b991dde7e7c904d80a9e355", "score": "0.7194985", "text": "def load_pictures\n page = params[:page].to_i\n per_page = 20\n off = (page-1)*per_page\n @discussion_group = DiscussionGroup.find(params[:id])\n @pictures = @discussion_group.images.offset(off).limit(10).order(...
[ { "docid": "4d1a4d7881034750b5ae0b4abd94e20e", "score": "0.71251214", "text": "def load_photos_discussions\n @page = params[:page] ? params[:page].to_i : 1\n from = case params[:time_span]\n when \"30min\" then Time.now - 30.minutes\n when \"day\" then Time.now - 1.day\n when \"week\" the...
b9a4d5be2b018e9d30e384bd47fa7215
(optional) set to nonzero value to use as a fixed interval for angle + shrink calculations
[ { "docid": "43298e35d36a4ad5b8d53336ed5920d2", "score": "0.0", "text": "def initialize\n super($w, $h, false, 20)\n self.caption = 'recursion trees'\n @image = Gosu::Image.new(self, \"black_sq_512.png\")\n @color = Gosu::Color.new(0xff000000)\n @color.red = 128\n @color.green = 96\n ...
[ { "docid": "1df2a41c5a9d1d80fbaa402d68d7aa56", "score": "0.65318894", "text": "def angle=(value)\n if(0..120).include?(value)\n @angle = value\n else\n @angle = value > 0 ? max_servo_angle : min_servo_angle\n end\n end", "title": "" }, { "docid": "f835f7619a179795e4b95d3d...
861cac5ad27f6df09f91c5cbc18e488b
If name changes to match existing alias, destroy the alias
[ { "docid": "46b101efd316ed5952fd54106904c208", "score": "0.7968489", "text": "def destroy_shadowed_aliases\n Alias.destroy_all(['name = ?', name]) if first_name_changed? || last_name_changed?\n end", "title": "" } ]
[ { "docid": "700aa593d270bfabdd37e8a10ccf877f", "score": "0.81838864", "text": "def del_alias(name, a)\n canonical_name = canonicalize(name)\n \n if !canonical_name\n return '' \n end\n \n @quotes[canonical_name][:aliases].delete(a)\n end", "title": "" }, { "docid": "407...
bc18e10bfde1f953e5490f8a9eacfc1a
Internal: Initialize and return a Faye::WebSocket::Client url The String url that the WebSocket should try to connect to :methods The Hash which contains the event handler methods to pass to the WebSocket client :open The Proc called when a stream is opened (optional) :message The Proc called when a stream receives a m...
[ { "docid": "20edd270b916ab221519ad172d694a14", "score": "0.7492161", "text": "def create_stream(url, methods:)\n Faye::WebSocket::Client.new(url)\n .tap { |ws| attach_methods(url, ws, methods) }\n end", "title": "" } ]
[ { "docid": "8053c47c60b6c8cc5223d80040561b5c", "score": "0.6927296", "text": "def initialize url, native: `new WebSocket(url)`\n @url = url\n @native = native\n @handlers ||= Hash.new { |h, k| h[k] = [] }\n add_handlers\n\n on(:open) { @connected = true }\n on(:close) { @co...
057d5434626cb3cc7493655591870d95
Removes +records+ from this association calling +before_remove+ and +after_remove+ callbacks. This method is abstract in the sense that +delete_records+ has to be provided by descendants. Note this method does not imply the records are actually removed from the database, that depends precisely on +delete_records+. They...
[ { "docid": "f675ca5ffe01d5771429a700177430ad", "score": "0.6925391", "text": "def delete(*records)\n return if records.empty?\n _options = records.extract_options!\n dependent = _options[:dependent] || options[:dependent]\n\n records = find(records) if records.any? { |record|...
[ { "docid": "3a32ba5885394661ad30f44e78044fb5", "score": "0.77039534", "text": "def remove(*records)\n raise 'No records to remove' if records.empty?\n raise 'Invalid record class' if records.any? {|r| !r.is_a?(@associated_class)}\n raise 'Record(s) must have been saved' unless recor...
7ed7d03f84a8ebe82aa528f5d6242f7b
Public: Replace a tag by a string content into the template. This method not only returns the modified template, it also really replace the template in place. css_rule The String css rule to identify the tag to replace. string The String replacement. Returns the template as a Nokogiri::XML::Document
[ { "docid": "02f8da9d7dbb2e8ef68aad34a493e700", "score": "0.85517555", "text": "def replace_tag_into_template! css_rule, string\n builder = Builder.new(@template)\n @template = builder.replace(css_rule, string)\n end", "title": "" } ]
[ { "docid": "ea1733bbad69c668b39845211be9a531", "score": "0.6206169", "text": "def replace_tag(tag, html_string)\n links = generate_document(html_string).css(tag)\n links.each { |a| html_string.sub!(a.to_s, a.text) }\n return html_string\nend", "title": "" }, { "docid": "8a8b26cbb2a5...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "091f9e6aba5f694984ed724040ade2cd", "score": "0.0", "text": "def update!(**args)\n @document = args[:document] if args.key?(:document)\n @qa_result = args[:qa_result] if args.key?(:qa_result)\n @search_text_snippet = args[:search_text_snippet] if args.key?(:search_t...
[ { "docid": "150fa2bdc1fc43d28ac45e2278a1f797", "score": "0.7012677", "text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "t...
13a25936c2741d8f5701758f15cd1777
State transition tables end reduce 0 omitted
[ { "docid": "a99068f7be295a226c12197165f7ebc0", "score": "0.0", "text": "def _reduce_1(val, _values, result)\n self.lexer.lex_state = :expr_beg\n \n result\nend", "title": "" } ]
[ { "docid": "4a7c9864b4f194fb7c65c825195e6ada", "score": "0.64042956", "text": "def transitions; end", "title": "" }, { "docid": "0d2e863a19c863a84c1d98b365e36bbf", "score": "0.6064393", "text": "def closure! \n cstart = new_state\n cend = new_state\n\n add_transition(c...
54de3756148e22af3b6e95ea39594254
Initiates a refund for a previously charged tender. You must issue a refund within 120 days of the associated payment. See [this article]( for more information on refund behavior. NOTE: Cardpresent transactions with Interac credit cards cannot be refunded using the Connect API. Interac transactions must refunded inpers...
[ { "docid": "cd4f5d8cc87676841704d48e17a64915", "score": "0.0", "text": "def create_refund(location_id:,\n transaction_id:,\n body:)\n warn 'Endpoint create_refund in TransactionsApi is deprecated'\n # Prepare query url.\n _query_builder = config.g...
[ { "docid": "28dea60966215505eae1b3761f2e67b8", "score": "0.8119551", "text": "def refund\n # TODO: Create ActiveMerchant refund integration \n return\n end", "title": "" }, { "docid": "e6b408ef2e9cabb9cc64ac4ad6a8ad4e", "score": "0.7870593", "text": "def refund\n ...
463e39a72c3e905f2227c8a74951c5ae
Sets the includeNestedFolders property value. Indicates how the mailbox folder hierarchy should be traversed in the search. true means that a deep search should be done to include child folders in the hierarchy of each folder explicitly specified in sourceFolderIds. false means a shallow search of only each of the fold...
[ { "docid": "5b7ccaeda8fdd0a280cc293e26a59181", "score": "0.6936559", "text": "def include_nested_folders=(value)\n @include_nested_folders = value\n end", "title": "" } ]
[ { "docid": "65474fede41ea36ebb52cfef407f37f7", "score": "0.61146456", "text": "def source_folder_ids=(value)\n @source_folder_ids = value\n end", "title": "" }, { "docid": "323dfdb3d53df04b03a8f6469b3db93b", "score": "0.6088443", "text": "def include_nested_...
78fdde467d9ee6c429db510e9dfeeb21
If we have a format that is too big to fit on a page, even the first time we will print it out along with a top and bottom and continue on. Returns if it printed or not.
[ { "docid": "675619275e4b4660814aa33f353a1f99", "score": "0.7676558", "text": "def tryPartialFullPage (io)\n # If we can't even fit one print all we can.\n if (!@printed_a_body && (@buffered_lines.size() + getBottomSize() == @@lines_left))\n tryOutputFormat(io)\n tryPrintBottom(io...
[ { "docid": "32f08ab2fecb1ce3d77a57028ea92daf", "score": "0.73747784", "text": "def tryPrintPartialPage (io)\n if (!@printed_a_body)\n bottom_size = 0\n printBufferedLines(io)\n @print_bottom = true\n return true\n end\n return false\n end", "title": "" ...
1df6bacf0038f4811f854b59ae4df81d
check if address is populated
[ { "docid": "f6883193ad25c1285d29b64a7d21f2e1", "score": "0.78567904", "text": "def has_address?\n !address.blank? && !city.blank? && !state.blank? && !zip.blank? && !home_phone.blank?\n end", "title": "" } ]
[ { "docid": "9909ad66494f9b3821e63f6ea0eb58d2", "score": "0.80403197", "text": "def has_address_information?\n return !(building.blank? and po_box.blank? and suburb.blank? and local.blank? and postcode.blank?)\n end", "title": "" }, { "docid": "9909ad66494f9b3821e63f6ea0eb58d2", "scor...
e2df10da64ed43b76e24ba6f49028a65
for error messages, give the rightmost directory name along with the filename
[ { "docid": "b79fa358600769fb2b9b8aa4a7c876eb", "score": "0.0", "text": "def short_filename\n return $1 if @filename =~ %r{.*/(.*/[^/]+)$}\n return @filename\n end", "title": "" } ]
[ { "docid": "ac8b09a64bef7ff94db5d38f85868592", "score": "0.6347745", "text": "def filename\n folder? ? nil : @pathname.basename.to_s\n end", "title": "" }, { "docid": "a9b9b4fbcb77e0b367afbc6347c316a8", "score": "0.62401474", "text": "def name\n folder? ? @pathname.basen...
881aec80a3db2226150b71fb4aaefa06
A method to end the game if the user has guessed all the letters and if the user has no more guesses.
[ { "docid": "8d147a0ac6ee186655ff00477f2eb8e6", "score": "0.668239", "text": "def game_end?\n\t\tif guess_limit == 0 \n\t\t\t@game_end = true \t\n\t\telsif hidden_word == word\n\t\t\t@game_end = true\t\n\t\telse\n\t\t\tgame_end \n\t\tend\t\t\n\tend", "title": "" } ]
[ { "docid": "824033bef57b04a64d9ef53e049d5f92", "score": "0.7636211", "text": "def end_game\n if @guess_count == 0 && @blanks != @new_word\n puts \"The game is over, Better luck next time :(\"\n @is_over = true\n elsif @blanks == @new_word\n puts \"Congrats you guessed the secret wor...
959e68d98a736956d5764a78436662bd
get rsync bin (attempt to locate if it does not exist or is not accessible)
[ { "docid": "c3cee9dd69c314a00e77a2188baaf011", "score": "0.8323944", "text": "def rsync\n return @rsync_bin if File.readable? @rsync_bin\n `which rsync | head -n 1`.chomp.gsub(\"\\\\n\",\"\") # Bug: won't work on windows\n end", "title": "" } ]
[ { "docid": "da73bbcd214675d11ae3ce6e72ed6545", "score": "0.78791183", "text": "def rrsync_location\n '/usr/local/bin/rrsync'\n end", "title": "" }, { "docid": "b74592b96621d893459bf85900fa9c7a", "score": "0.7682509", "text": "def rsync_executable\n rsync = `which rsync`.chomp\...
8b275199bad6aa2d4a38367e05571d6a
I'd like it if I could use the fill_in command, but as these are div contenteditable and not fields This isn't possible. I'd also like it if they had some sort of identifier that I could use, but They do not. As with the comment I made on the homepage, using XPath is not ideal.
[ { "docid": "2d8806465550af609ee70f9af86c85ca", "score": "0.0", "text": "def writeNote\n\t\tpage.find(:xpath, \"/html/body/div[2]/div[2]/div[2]/div[1]\").click\n\t\tpage.find(:xpath, \"/html/body/div[2]/div[2]/div[2]/div[1]/div[2]/div[1]/div[5]\").set(\"Hello World\")\n\t\tpage.find(:xpath, \"/html/body/...
[ { "docid": "0554dbc41f800f9a3a7b1dde3cd3c0ca", "score": "0.72909975", "text": "def text_fill_in(locator, options = {})\n id = find_field(locator).native[:id]\n evaluate_script \"document.getElementById('#{id}').type = 'text'\"\n fill_in locator, options\nend", "title": "" }, { "docid": "c...
af18d7aae46f86432fa5b398af18551a
GET /absence_requests/1 GET /absence_requests/1.xml
[ { "docid": "e6cd5f766c24f2e971005d94ac285fbd", "score": "0.67617005", "text": "def show\n @step = TaskrequestsStep.find(params[:taskrequests_step_id])\n @absence_request = @step.absence_requests.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml {...
[ { "docid": "6b4155cd13d15e7169ff587cbbe00314", "score": "0.62123424", "text": "def request_xml(scope, name, opts, cache_only = false)\n opts = EAAL.additional_request_parameters.merge(opts)\n xml = EAAL.cache.load(self.keyid, self.vcode, scope, name,opts)\n\n if (not xml) && (not cache_only)\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "eb3c9aee0a59e205604ba4b02c481cfc", "score": "0.0", "text": "def set_ssh_key\n @ssh_key = current_user.ssh_keys.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163754", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045816", "text": "def action_hook;...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "454e66c7e6490b7728ad3543b35bfb17", "score": "0.0", "text": "def update!(**args)\n @account_id = args[:account_id] if args.key?(:account_id)\n @role = args[:role] if args.key?(:role)\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...
f31a5b5fa119e32577281ca6f6182ae2
it displays whatever we insert and click INSERT
[ { "docid": "e2db192a5e5f8d83128b857da4e0fb4b", "score": "0.0", "text": "def create\n @article = Article.new(article_params)\n if @article.save\n #do something\n flash[:notice] = \"Article was successfully created\"\n redirect_to article_path(@article)\n \n else\n ...
[ { "docid": "c65b6f51228f8f0d6a601f8be17ef380", "score": "0.7086233", "text": "def insert\n end", "title": "" }, { "docid": "518d63458e152adbdba71d70b39f2e46", "score": "0.6966003", "text": "def inserts; end", "title": "" }, { "docid": "eab6528e46d1f2c6ced74465f2bc71ee"...
5dc9c7f9a4efe1bf55c8ecc9e55bfccc
GET /property_service_types/1 GET /property_service_types/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "2af23a440c7d8464ec56f36bdf3f4711", "score": "0.6917363", "text": "def set_property_service_type\n @property_service_type = PropertyServiceType.find(params[:id])\n end", "title": "" }, { "docid": "e92c55181b116c64546578ca15647185", "score": "0.68681127", "text": "d...
b9f4ad0860366dea4fc1c8eea09c8e03
TODO: use given eppn, extract netid, then pass to /identity API
[ { "docid": "5ce7b7bde5e7ef7521f1918e6525cda6", "score": "0.0", "text": "def raw_info\n # puts \"=\"*50\n # puts access_token.get(\"https://oauth.oit.duke.edu//oidc/userinfo\").parsed\n # puts \"+\"*50\n @raw_info ||= access_token.get(\"https://oauth.oit.duke.edu//oidc...
[ { "docid": "0506f1521ab2740330d5392fd1053eb6", "score": "0.59869325", "text": "def netid\n username, scope = user_key.split('@')\n username if scope == INSTITUTION_PRINCIPAL_NAME_SCOPE\n end", "title": "" }, { "docid": "aebcc76e3d926496b44f426fc2355c79", "score": "0.5920544", ...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "aaa2a7c5eba77a6f939a2c34c45354f7", "score": "0.0", "text": "def dining_params\n params.require(:dining).permit(:name, :land_id)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7943618", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.69572574", "text": "def permitted_params\n params.permit!\n end", "title"...
e96a2bd53033e9ce5bb20f01773fe236
Assign a unit as commander of a vehicle. ==== Description Used together with orderGetIn to order subordinate units to get in as commander of a specific vehicle. Before usage of this command a subordinate unit hasn't got the option to get into the commander place of the vehicle ==== Syntax unitName assignAsCommander veh...
[ { "docid": "44b41e151236e7ecc938deebf4f9b8f2", "score": "0.5718143", "text": "def assignAsCommander _obj, _args\n \"_obj assignAsCommander _args;\" \n end", "title": "" } ]
[ { "docid": "8398946c49d96a0d29abb74b7c79739d", "score": "0.54646873", "text": "def moveInCommander _obj, _args\n \"_obj moveInCommander _args;\" \n end", "title": "" }, { "docid": "ca2b123d64fa6f9717ca7f06ec3f417f", "score": "0.4708373", "text": "def move_unit args\n $...
22d6ae3df52b55f39b41ab7aa4e96d2c
Typographyes the string and returns a result See Typogrowth::Parserparse
[ { "docid": "ad9c815df6a9ff2fa6762f2dc81b3880", "score": "0.0", "text": "def typo lang: nil, sections: nil, shadows: nil\n Typogrowth.parse(\n self,\n lang: lang ? lang : is_ru? ? \"ru\" : I18n.locale,\n shadows: shadows,\n sections: sections\n )\n end", "title": "" } ]
[ { "docid": "57a0870d643300906d0724e23e3c3d5f", "score": "0.74513805", "text": "def parse(str); end", "title": "" }, { "docid": "57a0870d643300906d0724e23e3c3d5f", "score": "0.74513805", "text": "def parse(str); end", "title": "" }, { "docid": "7948ade6bb71d5666aa51601829a...
c161ca7cc5d15aa8af031418bb139b1c
Takes and ID and either a TravelObj (as long as it is a valid top level Request type), or a full XML Request. Equivalent to a delete and a create, but they happen atomically.
[ { "docid": "bdaa64da8f2822e94be2cfaac1bd2405", "score": "0.0", "text": "def replace\n @replace ||= Verb.new do |verb|\n verb.entity :trip, :air, :lodging, :car, :profile, :rail, \\\n :transport, :cruise, :restaurant, :activity, :note, :map, \\\n :direction...
[ { "docid": "d4672083425c04d8f22f4e8fcc789131", "score": "0.59027064", "text": "def make_xml_request_object( opts={} )\n\t\tdata = make_xml_request( opts )\n\t\treturn Mongrel2::Request.parse( data )\n\tend", "title": "" }, { "docid": "58fab67deee38207c670f87a12ac689e", "score": "0.575465...
acad342614989cb77c69d0eba1d15c88
Public: Calculates the substract of one set to another timespan: Another BitOperations enabled class
[ { "docid": "e5a442b3dd5b62fa05b76560a67e48ca", "score": "0.70106107", "text": "def -(timespan)\n self ^ (self & timespan)\n end", "title": "" } ]
[ { "docid": "7d4753b28ff4d9283fc2062704d83ff9", "score": "0.78907186", "text": "def minus_operation\n puts \"minus\"\n timespan ^ (timespan & other)\n end", "title": "" }, { "docid": "5c7c8e1d6345b358f3c2cf200e2a1b7e", "score": "0.71462965", "text": "def set_subtrac...
7fda7c0acd546025cf7b6f1f8a9cc194
move a line item to the top of the queue
[ { "docid": "b70500e1b8976e45a2ab4bc3f81f169e", "score": "0.6224827", "text": "def ajax_univ_move_to_top\n\n begin\n li_id = params[:id].to_i\n @li = LineItem[li_id]\n raise \"invalid line item\" unless @li.customer == @customer\n \n @old_position = @li.queue_position\n\n ...
[ { "docid": "6463441b5858e41bb56ca87ffe775a85", "score": "0.76659966", "text": "def move_to_top()\n modify = order.line_items_pending.select { |li| li.queue_position < queue_position }\n modify.each { |li|\n li.update_attributes(:queue_position => li.queue_position + 1)\n }\n\n update_a...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "55ececa2097ae8f6b8a6eda4b6f046ed", "score": "0.0", "text": "def update!(**args)\n @binary_family = args[:binary_family] if args.key?(:binary_family)\n @detections = args[:detections] if args.key?(:detections)\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...
42e27c1d876d0ad56865f0a5174c2690
GET /educational_backgrounds/1 GET /educational_backgrounds/1.json
[ { "docid": "1ab9ea10ee30c64cf5e821ad05150040", "score": "0.7652221", "text": "def show\n @educational_background = EducationalBackground.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @educational_background }\n end\n end", ...
[ { "docid": "8727c6873a2e768e39c8c550ee26c4d3", "score": "0.7320036", "text": "def index\n @backgrounds = Background.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @backgrounds }\n end\n end", "title": "" }, { "docid": "5b33ecfe8...
a1ce9669b034391d0057353e8d39c21c
DFS Stack (LIFO) Recursive call stack Linear in depth (memory) Just hold one path through the tree in memory Lends its self to recursive definition (check everything in left, check everything in the right) must see whole tree anyway you know d, the level of the answer don't care if the answer is closest to root possibl...
[ { "docid": "992512600c80ee01fb73dd5ec7e6f95d", "score": "0.7265943", "text": "def dfs_iterative(target)\n stack = [self]\n\n until stack.empty?\n node = stack.pop\n\n return node if node.value == target\n\n node.children.each do |child|\n stack << child\n e...
[ { "docid": "6d256af01030948637d8cfcf6ee232d7", "score": "0.79344094", "text": "def DFS(root, target)\n ## base case: \n return nil if root.nil?\n return root if root.value == target\n ##indecutive step: \n ## DFS on the left side then DFS on the right side \n root.children.each do |chi...