query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
9fb3c3b6eadd38fce4c8522f9c653964
Perform the timer function
[ { "docid": "d39f10599d88470fe2d643bd8718e0b4", "score": "0.0", "text": "def perform\n dispatch \n advance\n true\n end", "title": "" } ]
[ { "docid": "df6f2e6975d4474e508e6dd37a9a81b7", "score": "0.80649626", "text": "def timer; end", "title": "" }, { "docid": "df6f2e6975d4474e508e6dd37a9a81b7", "score": "0.80649626", "text": "def timer; end", "title": "" }, { "docid": "df6f2e6975d4474e508e6dd37a9a81b7", ...
7eaeae19d1fb5086d854b66ff988d1da
Retrieve a registered plugin
[ { "docid": "60f7ce1b69a95f5e4ebe7ec0874a533e", "score": "0.0", "text": "def [](name)\n elements[name]\n end", "title": "" } ]
[ { "docid": "64028420a985dc7a3d47f4f0486f56f7", "score": "0.8104809", "text": "def plugin \n if (!defined? @plugin) then \n @plugin = Plugin.find_by_name(@plugin_name); \n end \n return @plugin; \n end", "title": "" }, { "docid": "978d5a2f838d128dbb13caa0588e0ca3", "score"...
a4c698c42107c105563ae6ce8d502402
:startdoc: ===== Presentation This method initializes the helper with all the helpers he needs to know, and the helps' levels. ===== Attributes helplvl Help level at the start of the helps. lvlmin Minimal help level of the helper. lvlmax Maximal help level of the helper. ===== How to use To get a help : Helper.new(help...
[ { "docid": "bdd4ae759a8039949dcc61fb50e4f474", "score": "0.7605025", "text": "def initialize(lvlmin = 1, lvlmax = 3)\n # :nodoc:\n\n @helpLevel = lvlmin\n helpLevelSetMinMax(lvlmin, lvlmax)\n\n @lastHelp = HelpNotFound.new\n\n #initialize with all helpers\n @helps = Array.new\n\n @hel...
[ { "docid": "d7b5963b5fbc4fb21beb82d00d34b4c6", "score": "0.7070182", "text": "def help\n Helper.instance\n end", "title": "" }, { "docid": "93a3e6203216887038eb3ec08632ac73", "score": "0.70678556", "text": "def init_help( )\n return if @items.include?(:help)\n\n topi...
dce90fcdda69dcd5185e3d22649af69f
Calls the given block for every line in the Grid, with the indexes. Yields : an Array of Cell of every lines in the Grid the index of the array in the Grid Returns : the Grid itself
[ { "docid": "7da6dc43eac0d873fb03e5d88c3487a6", "score": "0.7838262", "text": "def each_line_with_index()\n\t\t@grid.each_index do |i|\n\t\t\tyield @grid[i], i\n\t\tend\n\t\treturn self\n\tend", "title": "" } ]
[ { "docid": "7520da4583c617c445a1034273a0ba74", "score": "0.7721659", "text": "def each_cell_with_index()\n\t\tself.each_line_with_index do |line, j|\n\t\t\tline.each_index do |i|\n\t\t\t\tyield @grid[j][i], j, i\n\t\t\tend\n\t\tend\n\t\treturn self\n\tend", "title": "" }, { "docid": "09d8e4c...
7a3d6da68d97423cac0923201eeb4341
Resolve abbrev and return command name symbol.
[ { "docid": "4cd227e1532623ce9e78ca479e583830", "score": "0.60367", "text": "def command_sym\n commands = Hash.new { |h, k| k }\n commands.merge!(\n :up => :update,\n :sv => :server,\n :au => :auto\n )\n\n name = @argv.shift.to_s.strip\n return nil if name.empty?\n comman...
[ { "docid": "27ca087da083d5c362b515b981b7e0b5", "score": "0.6604946", "text": "def abbreviation\n parse('compass.abbreviation')\n end", "title": "" }, { "docid": "cbfbbb5b5d9df66f60fc694c583c69de", "score": "0.6564512", "text": "def get_abbreviation(abbreviation)\n re...
6caebe7e42ad7e4840fef4ac939b5936
method to set and test proxy connection if present
[ { "docid": "1710967c2006990af188d5dba60b0ba8", "score": "0.7349719", "text": "def setTestProxy proxy\n \n begin\n @@proxy_addr, @@proxy_port = proxy.split(':', 2) unless proxy.nil?\n @@proxy_port = @@proxy_port.nil? ? 3128 : @@proxy_port.to_i\n \n proxy_class = Net::HTTP::Proxy(@@proxy_add...
[ { "docid": "c55cf67b4e9adf334d8d03c4b571e321", "score": "0.8353929", "text": "def connect_proxy?; http_proxy? && (@options[:proxy][:use_connect] == true); end", "title": "" }, { "docid": "6c41a09750fc4efd2e5aafa2bcee58a4", "score": "0.7859807", "text": "def use_proxy?\n @host !=...
a6527a2ee7f77ed7a93a4b65ae76ef25
Obtain an InputSet object, used to define inputs for an execution of this Choreo.
[ { "docid": "b587e2827db4557a7c98ce0593f05d19", "score": "0.0", "text": "def new_input_set()\n return GetContactsInputSet.new()\n end", "title": "" } ]
[ { "docid": "d8eb34cfc5a1e737977f7023d4849c46", "score": "0.6741255", "text": "def new_input_set()\n return CreateObjectInputSet.new()\n end", "title": "" }, { "docid": "7c0d7c433cd4eb8e36bdc3a383e9ec33", "score": "0.65807736", "text": "def new_input_set()\n return Ru...
2dfded89a3d6dee4ca64c663eecf8c45
POST /phases POST /phases.json
[ { "docid": "3b3702bfeab9f8de68c0f4d51c4b2d63", "score": "0.6859975", "text": "def create\n @phase = Phase.new(phase_params)\n\n respond_to do |format|\n if @phase.save\n format.html { redirect_to project_phase_path(@project.id, @phase), notice: 'Phase was successfully created.' }\n ...
[ { "docid": "751bf147b1fc141622e861ba836a660f", "score": "0.7085166", "text": "def create\n @phase = Phase.new(phase_params)\n\n respond_to do |format|\n if @phase.save\n format.html { redirect_to @phase, notice: \"Phase was successfully created.\" }\n format.json { render :show,...
17b047c4de4ffdd7034ce8f274622181
Remove point from curve at index.
[ { "docid": "11129519352ff2f021eb1225d98c0dec", "score": "0.8250012", "text": "def remove_point(index)\n MSPhysics::Newton::CurvyPiston.remove_point(@address, index)\n end", "title": "" } ]
[ { "docid": "f091c9978fe52e0205c0e956d58d483c", "score": "0.76156914", "text": "def remove_point_at(idx)\n @cells[idx]&.yield_self { |c|\n remove_cell(c)\n }\n end", "title": "" }, { "docid": "4cc6bb3810c5559246c467da0c43144e", "score": "0.70854485", "text": "def r...
190d32a33149bba2a481d3b2eb6557d3
Renders an XHTML comment.
[ { "docid": "85c9b46846ce5a53e6dfe289dae68c08", "score": "0.6480621", "text": "def render_comment(line)\n conditional, content = line.scan(COMMENT_REGEX)[0]\n content.strip!\n\n if @block_opened && !content.empty?\n raise SyntaxError.new('Illegal Nesting: Nesting within a tag that a...
[ { "docid": "15c13b3dbb8ff87a2c269f3130f496ab", "score": "0.6972211", "text": "def comment(text)\n @xml << \"<!-- #{text} -->\"\n nil\n end", "title": "" }, { "docid": "d886e19fde6cdf2de1c31de38fb78d2d", "score": "0.68353784", "text": "def comment(text)\n @out << \"<!-- #{te...
27243d27db6b15454a87f97192e4d57f
Map `row` into `EventNote` attributes
[ { "docid": "bcb3927727fd11b96bd590c2df455e5d", "score": "0.53768456", "text": "def process_row_or_nil(row)\n # match student by id\n local_id_text = row['LASID']\n student_id = @matcher.find_student_id(local_id_text)\n return nil if student_id.nil?\n\n # timestamp, just used import time s...
[ { "docid": "1352e5c11fff7160ea8d43e409a26e37", "score": "0.660147", "text": "def row_to_attributes(row)\n row.to_a.inject({}) do |hash, row|\n name, value = row.first.downcase.gsub(' ', '_'), row.last\n hash[name] = case name\n when /(_at|_on)$/ then Time.parse value\n...
ad443bad36636434c6cf7df18f1198e9
=> "iting ode is allenging" Teacher's solution
[ { "docid": "c745e58e34569adfed41be51f394662d", "score": "0.0", "text": "def consonant_cancel(sentence)\n words = sentence.split\n new_words = words.map { |word| remove_first_consonant(word) }\n return new_words.join(\" \")\nend", "title": "" } ]
[ { "docid": "07819e3afdf5a27c3cfb64e3e0f2ce3a", "score": "0.6450781", "text": "def problem33\n num, den = 1, 1\n 10.upto(98) do |x|\n (x+1).upto(99) do |y|\n if (((simplestTerms(x,y)<=>simplestTerms((n = (a = x.to_s)[0].to_i), (d = (b = y.to_s)[1].to_i))) == 0 && a[1] == b[0]) ||\...
2734cb6fecf0aaa9bb489a5b4f58a011
In order for user to end the game, they must click in the predefined boundaries of the end game image. Boundaries arise of region on the window the end game button covers.
[ { "docid": "76fbbd2c8b04824237f1bc0a6c4d3b47", "score": "0.6465736", "text": "def end_game_bounds?(x, y)\n\t\tx < 129 && y < 54\n\tend", "title": "" } ]
[ { "docid": "a896204e6fc7d101dfb17449574c8f3c", "score": "0.69841176", "text": "def button_down_end (id)\n case id\n when Gosu::MS_LEFT\n if area_clicked(290, 290, 390, 390)\n initialize_game\n @scene = :game\n elsif area_clicked(410, 290,...
46fc702d8cba8cd8c4c9b8a06e73bcef
Your Integration API Key
[ { "docid": "a212508eaa90efbf4c066321cc7dff72", "score": "0.8260638", "text": "def api_key; end", "title": "" } ]
[ { "docid": "0ec7cb9d8f761f43bff2287f6acd11ce", "score": "0.85828453", "text": "def api_key; \"055a1100-a84d-4064-84d7-bce46f7b80c8\"; end", "title": "" }, { "docid": "e614179cfb2b632d613962dd941cf5df", "score": "0.8243251", "text": "def api_key\n \"ba2ec180e6ca6e6c6a542255453b2...
74b36fdd6b01c518db2867a1749dfeec
Returns the player who returns most points scored
[ { "docid": "617056e26edd1b866daf57a88d147a08", "score": "0.7781882", "text": "def most_points_scored\n most_points_person = \"\"\n most_points = 0\n game_hash.each do |a,b|\n b[:players].each do |c,d|\n if d[:points] > most_points\n most_points = d[:points]\n most_points_person ...
[ { "docid": "ff252462d0c94056af2175ffe0791528", "score": "0.8867996", "text": "def most_points_scored\n points = players_points(return_players_info)\n name = who_has_most_points(points.max)\nend", "title": "" }, { "docid": "166cf9200810566b9be21e5ff33aa9d0", "score": "0.87689286", "...
f0b65649ce2b75a0ca311b4080dc20b8
Allow this communicator to retry sending when it failed to send a message Failed messages are put in a queue, which is processed by a separate thread This is because sending of messages can occur from different threads (e.g. a ExecApp thread running a user app) and we should not block that thread, while we try to resen...
[ { "docid": "4bb3cf3d80f19025e725094f610be1d9", "score": "0.76191664", "text": "def allow_retry\n @@retrySending = true\n @@retryQueue = Queue.new\n @@retryThread = Thread.new {\n while element = @@retryQueue.pop do\n success = false\n while !success do\n success = pa...
[ { "docid": "d90f1ea853f06d96195b180f943e41ab", "score": "0.63520336", "text": "def fail_queued_messages(error)\n error = Ably::Exceptions::MessageDeliveryFailed.new(\"Queued messages on channel '#{channel.name}' in state '#{channel.state}' will never be delivered\") unless error\n fail_mes...
d38e24dada23a1eea02e394c35660db9
Relationship data in data.relationships block for remote create/update
[ { "docid": "1181829226ff6eaf64044929eff511dc", "score": "0.71016127", "text": "def relationships_for_remote\n {\n inviter: UserHandler.relationship_data(@entity.inviter),\n native: UserHandler.relationship_data(User.find_by(id: @entity.native_id))\n }\n end", "title": "" } ]
[ { "docid": "ef698277ecc25597f0767d9876e9c7d7", "score": "0.69685304", "text": "def attach_relationship(data) #FIXME: Method doesn't work, RelationshipManager cannot access to id attribute.\n return @client.raw(\"post\", \"/config/relationships/attach\", nil, data)\n end", "title": "" }, ...
aa4004a726afaac7d66cdb8f6cc0af57
==================================================================================== use method_missing to add support for fetching the value on a given path through an arbitrary method name
[ { "docid": "214a33cf4b5ee2249832dad02c8cfc4b", "score": "0.0", "text": "def method_missing(m)\n \tnode_array = m.to_s.split(\"_\")\n \tleft.left.value\n end", "title": "" } ]
[ { "docid": "bdd6bce351956d102ec9dda785cc041e", "score": "0.7409275", "text": "def method_missing(method, args)\n path_method method, args\n end", "title": "" }, { "docid": "0d36283f5f9eebbfcf4777bd0a331f06", "score": "0.72567", "text": "def method_missing(method, *args, &bloc...
87e20faa36f2f38b0da549d2b8b29551
Returns all physical storages from the api.
[ { "docid": "b31724fbd67d3df254f753441998125e", "score": "0.80117077", "text": "def get_plain_physical_storages\n @connection.discover_storages\n end", "title": "" } ]
[ { "docid": "522fe98296686d4e7e4900c9cd4650dc", "score": "0.7345135", "text": "def storages\n @storages\n end", "title": "" }, { "docid": "f3085cec09f0d8634a7e8c209d715b8a", "score": "0.7329822", "text": "def all\n storage\n end", "title": "" }, { "doci...
361fe285ecce970077ba687412e78561
PUT /companies/1 PUT /companies/1.json
[ { "docid": "e6d4d5f65cbb502f378e2ab7a88556d3", "score": "0.0", "text": "def update\n @company = current_user.companies.find_by_slug(params[:id])\n\n render :not_found, layout: true, text: 'Could not find the company you requested' and return if @company.blank?\n\n ActsAsTenant.with_tenant(@comp...
[ { "docid": "1c35f89f4e93251128bbf53c08021b3d", "score": "0.79837877", "text": "def update\n @company_id = company_params[:company_id]\n @reponse = HTTParty.put(\"https://rails-api-ipo.herokuapp.com/api/v1/companies/#{@company_id}.json\",\n :body => {:company_name => company_params[:company_name...
7da4438c6b389b663da88bdc0207bae5
sets all actions to respond to .json requests
[ { "docid": "b03236199b45f095f147d61913d60b43", "score": "0.0", "text": "def index\n @users = User.all #\n end", "title": "" } ]
[ { "docid": "990dff8e942d781de35aa859e9301b20", "score": "0.6619063", "text": "def json_route\n response['Content-Type'] = 'application/json'\n end", "title": "" }, { "docid": "990dff8e942d781de35aa859e9301b20", "score": "0.6619063", "text": "def json_route\n response['Content-...
c4fdb5172044f93cc4d02ba4169e828f
Get historical cost across your account.
[ { "docid": "7ac5c68080370ea15e2f22d3d81aa304", "score": "0.5539348", "text": "def get_historical_cost_by_org(start_month, opts = {})\n data, _status_code, _headers = get_historical_cost_by_org_with_http_info(start_month, opts)\n data\n end", "title": "" } ]
[ { "docid": "00137165010a1b9dc8cf9ce9de0ee8f8", "score": "0.656546", "text": "def cost\n Money.new(dated_costs.sum(:cost))\n end", "title": "" }, { "docid": "de49cabc5bc57301a0901a9bafb08a5d", "score": "0.6362014", "text": "def historical_prices(crypto, fiat, period)\n url = \"#{...
16dbac53f034460c1bf507689ad5c88c
Return results ldpaths or predicates
[ { "docid": "62cd79fe4252122bb44d427fb5ab6a62", "score": "0.0", "text": "def term_results\n Config.config_value(term_config, :results)\n end", "title": "" } ]
[ { "docid": "1bc06ffd3b9c343d16744dd22c70dadb", "score": "0.628797", "text": "def rpaths; end", "title": "" }, { "docid": "1bc06ffd3b9c343d16744dd22c70dadb", "score": "0.628797", "text": "def rpaths; end", "title": "" }, { "docid": "e4e407f3e435b2685d06a4454a4cac20", "...
769ac01e9e4a38ec011eaed2cfda4a9d
Add a new value to the tree.
[ { "docid": "a2aa07ce543e9f22b1de493fe8c325a7", "score": "0.8179181", "text": "def add(value)\n @root = add_to_node(@root, value)\n end", "title": "" } ]
[ { "docid": "c39d3a8852d04e8036aed429b41b6d96", "score": "0.8575669", "text": "def add(value)\n add_tree Tree.new(self, value)\n end", "title": "" }, { "docid": "614dbb94f2d5e0ffbd1b3ba1cdbd2e90", "score": "0.81215185", "text": "def add_value(value) #private\n\t\tnode = Binary...
f821ef93172450f39d06ed5e41acf2d9
DELETE /employees/1 DELETE /employees/1.json
[ { "docid": "6e0dffe09f5c0b51a42c9314885e5498", "score": "0.75836736", "text": "def destroy\n @employee = Employee.find(params[:id])\n @employee.destroy\n\n respond_to do |format|\n format.html { redirect_to employees_url }\n format.json { head :ok }\n end\n end", "title": "" ...
[ { "docid": "48428d1c8d23132a457a8b1d82417540", "score": "0.77220386", "text": "def destroy\n @v1_employee = V1::Employee.find(params[:id])\n @v1_employee.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "a1cc667ae1606e87437f2c6821fd719e", "score": "0.7693917", ...
5b64f0be4a2cf5eb8d80a717fc08c45b
Find maximum of three
[ { "docid": "1bbabf691f74e91d08206fbbbb1a2bfb", "score": "0.7275763", "text": "def max(a, b, c)\r\n if a >= b and a >= c\r\n return a\r\n elsif b >= a and b >= c\r\n return b\r\n else\r\n return c\r\n end\r\nend", "title": "" } ]
[ { "docid": "a83d6db1c3cf5cd92fc97f615fe94d9a", "score": "0.8602725", "text": "def max_of_three a, b, c\n\t[a, b, c].max\nend", "title": "" }, { "docid": "ca54de8dcc2c6dd66120fbfac99da68f", "score": "0.85378385", "text": "def max_of_three n1, n2, n3\n\t[n1,n2,n3].max.to_i\nend", "...
4469fa47b08e413d45f08730c42f0edf
Change vertical resolution to 1
[ { "docid": "ff9d428a208f2e864f98275bd7ec9079", "score": "0.61639106", "text": "def change_res_vert\n Kernel.raise NotImplementedError\n end", "title": "" } ]
[ { "docid": "fba15681251767a54a105e080351c223", "score": "0.65471655", "text": "def set_screen_resolution(width, height)\n @standard_nv_pairs['res'] = \"#{width}x#{height}\"\n self\n end", "title": "" }, { "docid": "c78a39a072e7d2a381a73a19d100835d", "score": "0.6300495", ...
31dbf4dec2cdaa05c7a0036bedb6f931
This should return the minimal set of values that should be in the session in order to pass any filters (e.g. authentication) defined in ProjecttypesController. Be sure to keep this updated too.
[ { "docid": "23b1bf7256275cc74d99350f6b7b19a3", "score": "0.0", "text": "def valid_session\n {\"return_to\" => \"/\"}\n end", "title": "" } ]
[ { "docid": "9f92d47af33622105e6a21e1b3c1961c", "score": "0.67518115", "text": "def get_session_vals\n if logged_in?\n user = User.find_by(id: session[:user_id])\n session_values = {\n 'user_id' => session[:user_id],\n 'User Name' => user.name,\n 'User Email' => user.ema...
78b6331cc9465a145c376b4788c71325
POST /your_tips POST /your_tips.json
[ { "docid": "7eac594e29f7d3c696eadf7681e7e1f9", "score": "0.6747331", "text": "def create\n @your_tip = @user.your_tips.create(your_tip_params) \n redirect_to @user\n end", "title": "" } ]
[ { "docid": "9eefc01b54c2c3f1aa50982af0b38eba", "score": "0.7017393", "text": "def create\n tip = Tip.new(tips_params)\n tip.created_by_id = @current_user.id\n \n if tip.save\n json_response(tip)\n else\n json_response({ message: tip.errors }, :unprocessable_entity)...
8fb3257056f0b7ec4c5a245bef37d6a9
PUT /answers/1 PUT /answers/1.json
[ { "docid": "971d00f01f715767209fd0988964ed04", "score": "0.71423775", "text": "def update\n @answer = @question.answers.find(params[:id])\n\n respond_to do |format|\n if @answer.update_attributes(params[:answer])\n format.html { redirect_to exam_questions_path(@exam), notice: 'Answer w...
[ { "docid": "50572c97f564b0e2fa713be71abda11d", "score": "0.74410856", "text": "def update\n answer = @answer.update(answer_params)\n if answer.save\n render json: answer\n else\n render json: answer.errors, status: 447\n end\n end", "title": "" }, { "docid": "e27b5fc8d...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "ab1a5335ede78b9caf5a6ea7e47863cf", "score": "0.0", "text": "def match_params\n if request.format.json?\n params.permit(:competition_id, :number, :team_number, :time_defending, :time_dead, :start, :human_player_notes, :general_notes, :scout, :device_id,\n events: [:objectiv...
[ { "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...
3b907eac2943051f36873c84ddb1c73a
Publishes a message passed to the route specified.
[ { "docid": "19bb1ff4e8a3a13beff2b39b89414dc2", "score": "0.63105464", "text": "def publish(message)\n encoded = Baler::Message::Encoder::MsgPack.new(message)\n @hopper.publish(encoded)\n end", "title": "" } ]
[ { "docid": "bfe6fb29c721cc4e4373c076ae245002", "score": "0.7182604", "text": "def publish(message)\n if @subsystem_routes.has_key?(message.system_name)\n route_message(message, delivery_type: :publish)\n else\n publish_message(message)\n end\n\n ...
fdf2116f4250764cca493ff86b167f05
Update Order Update attributes of Order
[ { "docid": "637ed8691ecdaaa60419aa8016cff022", "score": "0.0", "text": "def update\n self.class.update_order_by_id(self.id, self)\n end", "title": "" } ]
[ { "docid": "4b3c4c390153ecb2017e8ca5be56a8a0", "score": "0.8080419", "text": "def update(options={})\n self.attributes = put(\"/orders/#{id}\", :order => options)[\"order\"]\n end", "title": "" }, { "docid": "c3c8caeaef449fdb4778ae1d08ee8789", "score": "0.8070347", "text": "d...
cfc94fee85ac073ea8433322461be9a6
Confirms the correct user.
[ { "docid": "652a47b7e21a9803b25ed27aa18825d0", "score": "0.0", "text": "def correct_user\n @userStudente = UserStudente.find(params[:id])\n unless current_user?(@userStudente)\n flash[:danger] = \"You don't have the rights for this page/action.\"\n redirect_to(root_ur...
[ { "docid": "c96f27a6347be3bc55a20e8450db1ec9", "score": "0.72449994", "text": "def correct_user\n @user = User.find(params[:id])\n unless current_user == @user\n flash[:warning] = \"You are not authorized to do that.\"\n redirect_to root_path\n end\n end", "title": ""...
807de0f9a42a0400f0ed4de284ee0078
Whether the element is a node on the left
[ { "docid": "665f8c460106efeaddd5a5ddf5d18395", "score": "0.6421223", "text": "def left?\n position.even?\n end", "title": "" } ]
[ { "docid": "f6caabab50ecebfab438bd69e991b33e", "score": "0.77586484", "text": "def is_left_child?(node)\n # return 1 if this node was the left child of it's parent\n # return 2 if this node was the right child of it's parent\n return false if !node.parent\n node.value <= node.parent.value\n ...
aaf48ec2082d4e80d3f11c0b237ca5c9
GET /messages GET /messages.json
[ { "docid": "d398b893ba6ccca711a70731e131938c", "score": "0.0", "text": "def index\n @messages = Message.roots.order('created_at DESC')\n end", "title": "" } ]
[ { "docid": "dbc96cdcfe96d0a5cfff134d321e521f", "score": "0.7986006", "text": "def messages\n get_data('/messages')\n end", "title": "" }, { "docid": "ea7086ff90058b90c171a0d36a56b3ff", "score": "0.7679086", "text": "def show\n @message = User.find(params[:id]).messages\n\n ...
a4c2e9d323eb6b805b4768ca7b5e9210
Checks if the incrementor is persisted
[ { "docid": "7dcfd5ea25f8408d6de7a26a736d0c39", "score": "0.0", "text": "def exists?\n find.count > 0\n end", "title": "" } ]
[ { "docid": "ec189ef2c4f772c8bcf27d0fec5eac2c", "score": "0.7328425", "text": "def persisted?\n !id.nil?\n end", "title": "" }, { "docid": "d9f10d44d71ca2ffc2f50e39fed4f90a", "score": "0.7248395", "text": "def persisted?\n\t\t!@id.nil?\n\tend", "title": "" }, { "do...
f6505a905b802b5d3f85235299e90af9
will not need it because it is all handled in devise edit def edit
[ { "docid": "e45dcb76dbbc27e722f44ac37ebcaf03", "score": "0.0", "text": "def update\n @user.update(user_params)\n authorize @user\n redirect_to user_path(@user)\n end", "title": "" } ]
[ { "docid": "c1dc00c910996c9c5da94ecc9ba0137b", "score": "0.75882435", "text": "def edit_user\n end", "title": "" }, { "docid": "6296d9d6098e3792e1476a23071ba8fb", "score": "0.7502253", "text": "def edit\n\t\n end", "title": "" }, { "docid": "d973dee5e2611edcb977a10fb0c8...
53cb5261cf6eaa902018d839cd9e55c6
POST /lista_de_actividades POST /lista_de_actividades.json
[ { "docid": "71564618c3d18d5e0663f2d84557839f", "score": "0.6903174", "text": "def create\n @lista_de_actividade = ListaDeActividade.new(lista_de_actividade_params)\n\n respond_to do |format|\n if @lista_de_actividade.save\n format.html { redirect_to @lista_de_actividade, notice: 'Lista...
[ { "docid": "f3846a8b31724e0b45129fe1c8145c10", "score": "0.68211156", "text": "def index\n @lista_de_actividades = ListaDeActividade.all\n end", "title": "" }, { "docid": "3c10bcac12749a72efd163c2935189e5", "score": "0.6721373", "text": "def set_lista_de_actividade\n @lista_...
9a1a6420d38df3edfcbaefea2075e839
This should sort of be private except magic constants use same system: start title_holders_until
[ { "docid": "6d8a7da1f20b892488fc3cd9f385f7ba", "score": "0.0", "text": "def resolve_date(date)\n ModernTimesDatabase::Dates[date]\n end", "title": "" } ]
[ { "docid": "be32efe44bba73e43bda309ca37f0ed2", "score": "0.6405405", "text": "def wait_for_title(exit)\n waited = 0\n [0.25, 0.5, 1, 2, 4, 8, 16].each do |delay|\n if page_title =~ /-/\n title = page_title.gsub(/[-].+/, '').strip\n unless title.empty?\n puts \"Waited fo...
393b6b65e70edf4c9be7315b8de7c3ba
GET /showings GET /showings.json
[ { "docid": "df78137ecd85427ec6778e022e1b15f0", "score": "0.759349", "text": "def index\n @showings = Showing.all\n end", "title": "" } ]
[ { "docid": "33e2ff430fe0d1d2105b115214c458e8", "score": "0.7529646", "text": "def index\n @showings = Showing.all\n \n \n\n end", "title": "" }, { "docid": "e0cd9e8423e6b1ebbaad2a2b5f7e9d95", "score": "0.7305869", "text": "def show\n render json: @listing\n end", "ti...
ffba5c124756b0827b1914279e1a0ff4
Main way to show how all parameters can be used
[ { "docid": "464fcb336364d6280626e22344bbacc2", "score": "0.0", "text": "def banner(value = (not_set = true))\n if not_set\n @properties[:banner]\n else\n @properties[:banner] = value\n end\n end", "title": "" } ]
[ { "docid": "d776711817bf6bc1f145594060bfb5e1", "score": "0.79337615", "text": "def parameters; end", "title": "" }, { "docid": "d776711817bf6bc1f145594060bfb5e1", "score": "0.79337615", "text": "def parameters; end", "title": "" }, { "docid": "d776711817bf6bc1f145594060bf...
c7e2ffd30bb48e446bfdc70dc45762f0
POST /silicons POST /silicons.xml
[ { "docid": "369b0df07778d7a4def8f29c3f3bcbc5", "score": "0.69880944", "text": "def create\n params.permit!\n @silicon = Silicon.new(params[:silicon])\n\n respond_to do |format|\n if @silicon.save\n format.html { redirect_to(@silicon, :notice => 'Silicon was successfully created.') }...
[ { "docid": "88aa28e7778218f515baf946763c614c", "score": "0.6424479", "text": "def set_silicon\r\n @silicon = Silicon.find(params[:id])\r\n end", "title": "" }, { "docid": "a1cabbbd58feed94089a57e96bf4ca22", "score": "0.62729776", "text": "def silicon_params\r\n params.re...
e7d215f7eae36cb2d81e36aa8db2be58
of the argument with the first character of every word capitalized and all other letters lowercase. Input: String Output: String with the first character of each word capitalized and all other characters lowercase. Explicit Requirements: Method must take a single string as an argument. Must return a string with first l...
[ { "docid": "e75c2ab2c1fb37f11e6767dd37dd321e", "score": "0.81225055", "text": "def word_cap(string)\n (string.split.each {|word| word.capitalize!}).join(' ')\nend", "title": "" } ]
[ { "docid": "a85cfc904a338e76b5b956cc6acabce6", "score": "0.8320033", "text": "def word_cap(string)\n capitalized_string = []\n string.split.each do |word|\n word.chars.each_with_index do |letter, index|\n index == 0 ? capitalized_string << letter.swapcase : capitalized_string << letter.downcas...
2f1932973ceeaa5f534f4195908121ff
not required due to the way associations are set up?
[ { "docid": "355e89e6b959b884897c659a35e24fef", "score": "0.0", "text": "def ensure_seat_is_free\n\t\tseat=Seat.find(seat_id)\n\t \tunless(seat.reservation==nil)\n\t \t\tself.errors.add(:alert, \"Seat is already taken!\")\n\t \tend\n\tend", "title": "" } ]
[ { "docid": "c229df37684da68ba5756d2237cb4b06", "score": "0.7350604", "text": "def setup_associations; end", "title": "" }, { "docid": "d5c0f6af0214f5ac7c23f5054fe8d5ba", "score": "0.7335977", "text": "def associations; end", "title": "" }, { "docid": "02e41ff0dea12775c1a0...
578b4d9a4d71a0b24d8fd5bea5e67c66
Initialise item to be reviewed
[ { "docid": "26b519a81a2ea8a5baf4e7a117dc69eb", "score": "0.0", "text": "def show\n @item = Item.find(params[:id])\n @reviews = @item.reviews\n end", "title": "" } ]
[ { "docid": "eedceaeb25987af28a343ae0f4cb98bc", "score": "0.68519497", "text": "def set_item_review\n @item_review = ItemReview.find(params[:id])\n end", "title": "" }, { "docid": "eedceaeb25987af28a343ae0f4cb98bc", "score": "0.68519497", "text": "def set_item_review\n @i...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "88725e4141c47455fd5200027218e8cc", "score": "0.0", "text": "def set_accountfinancial\n @accountfinancial = Accountfinancial.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook;...
9f8f8d69e7dd0afb069e5e8d5f619a40
Method that is used to print to a stream . If the stream is already closed will return nil otherwise will append the response to the stream and close the stream
[ { "docid": "9e79c6d7864c2875ba984b61cc6a3849", "score": "0.6409605", "text": "def print_to_output_buffer(response, output_buffer)\n return if output_buffer.closed?\n output_buffer << response\n output_buffer.close\n end", "title": "" } ]
[ { "docid": "d9fd4faa87fdea0a7ab493013a89fb76", "score": "0.6982797", "text": "def stream\n 10_000_000.times do |i|\n response.stream.write \"This is line#{i}\\n\"\n end\n ensure\n response.stream.close\n end", "title": "" }, { "docid": "ee77cbafba28227449404c714b71907a", ...
78bf47613c0cdfcc3da2676921d4b6d8
GET /condition_immunities GET /condition_immunities.json
[ { "docid": "3fc76f5dd7e91dc1484207b48f47170b", "score": "0.6946801", "text": "def index\n @condition_immunities = ConditionImmunity.all\n end", "title": "" } ]
[ { "docid": "ff7a426aba47bd778b6df0dffbc48884", "score": "0.6182742", "text": "def set_condition_immunity\n @condition_immunity = ConditionImmunity.find(params[:id])\n end", "title": "" }, { "docid": "6ca7680267e79c5b8be85e89e29b1d82", "score": "0.6073524", "text": "def condit...
29fd8f6bb1d6a8470c327ba1174d23c6
course_lessons GET /courses/:course_id/lessons(.:format) lessonsindex POST /courses/:course_id/lessons(.:format) lessonscreate new_course_lesson GET /courses/:course_id/lessons/new(.:format) lessonsnew edit_course_lesson GET /courses/:course_id/lessons/:id/edit(.:format) lessonsedit course_lesson GET /courses/:course_i...
[ { "docid": "60c50a5cf7c5095fa18c79eabea803c8", "score": "0.70524096", "text": "def index\n # @lessons = Course.all\n # @lessons = @course.lessons.paginate(page: params[:page] )\n redirect_to @course\n end", "title": "" } ]
[ { "docid": "fd218cd92b045477aa3284537366f4eb", "score": "0.77874744", "text": "def create\n \t@course = Course.find(params[:course_id])\n @lesson = @course.lessons.build(lesson_params)\n \n respond_to do |format|\n if @lesson.save\n format.html { redirect_to @course, notice: 'lesso...
75c6f79b942cc28742e3cb7037d86262
provides quick access to the first (and sometimes only) clause
[ { "docid": "ff77c82ddb0777b8c3cd49ba41af4e75", "score": "0.7578696", "text": "def first\n @clauses.first\n end", "title": "" } ]
[ { "docid": "a578e66239afdcb07609d7d4a7b643cf", "score": "0.6950418", "text": "def select_first(*query)\n select(*query).first\n end", "title": "" }, { "docid": "4af054664649edf023b4ca6c9d7ef04c", "score": "0.68690133", "text": "def first\n query = to_query\n execute(query)....
ff167d3c973715a5b2a011ad2c3bec1d
Returns a Association object from storage that matches the srv_url. Returns nil if no such association is found or if the one matching association is expired. (Is allowed to GC expired associations when found.)
[ { "docid": "275df3fbee2ebca56fc78fedb28996c5", "score": "0.6907365", "text": "def get_association(server_url, handle=nil)\n assocs = if handle.nil?\n MyAssociation.all(:srv_url => server_url)\n else\n MyAssociation.all(:srv_url => server_url, :handle => handle)\n end\n\n ...
[ { "docid": "80137666551f1d702b52736e821759c5", "score": "0.64687824", "text": "def get_association(server_url, handle=nil)\n if document = Association.load(server_url, handle)\n if document.expired?\n document.destroy\n nil\n else\n document.asso...
0b6ac59f18a4ba8bbc689057cddd1780
Story: As a developer with a ToDoList, I can show all the not completed items.
[ { "docid": "34284fe14185051ea9d679fa94ea4cdf", "score": "0.6174532", "text": "def incomplete\n @list_items.select do |list_item|\n !list_item.is_complete?\n end\n end", "title": "" } ]
[ { "docid": "5a6ac795fdb8402cf8454b1ea54bcca8", "score": "0.73122567", "text": "def list\n @all.filter { |item| not item.completed }\n end", "title": "" }, { "docid": "9a04ddc4e190aab35950efb00df76cdb", "score": "0.7114029", "text": "def show_uncompleted\n uncompleted=[]\n @...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "e2201ef69f5b2ad48a5b7c5cf6505469", "score": "0.0", "text": "def set_invoice\n @invoice = Invoice.find(params[:id])\n session[:invoice_id] = @invoice.id\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook;...
f4c440fb85e200c819c83f0443114a4e
Extend the string class by defining a Stringmap! method that accepts a block. The method should modify the existing string by replacing every character with the result of calling the block, passing in the original character and it's index. Do not use the builtin Arraymap or Arraymap! in your solution.
[ { "docid": "e51fa81b92fb19dd30e53c28b73a148a", "score": "0.74147844", "text": "def map!(&prc)\n self.each_char.with_index do |char, idx|\n self[idx] = prc.call(char, idx)\n end\nend", "title": "" } ]
[ { "docid": "497d51baf3e6a8846727f7d6f8f7d443", "score": "0.7231459", "text": "def map!(&proc)\n self.each_char.with_index do |char, i|\n self[i] = proc.call(char, i) if proc.call(char, i)\n end\n self\n end", "title": "" }, { "docid": "39e16d82ae764422b2ce4...
16366f5ccfb27613a98cacf05b41c352
Get Payment By Id
[ { "docid": "982d1851f0cebf69cf8c8f50789431fb", "score": "0.0", "text": "def finance_invoices_id_payments_payment_id_get_with_http_info(id, payment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: InvoicePaymentsApi.finance_invoices_id_payments...
[ { "docid": "5dc4fbbc8a8d39a9c512d25cd77f4518", "score": "0.843209", "text": "def lookup_payment(id)\n @payments.select { |p| p.id == id }.first\n end", "title": "" }, { "docid": "65c9a3f64dbffa5f9851f230192e43b8", "score": "0.8341305", "text": "def get_payment(payment_id)\n pa...
ad9d04fc76ce734ccde657c191e2a640
Renders this field as a text area.
[ { "docid": "9af145863913e4661f92a31341736f02", "score": "0.6969594", "text": "def as_textarea(attrs=nil, only_initial=false)\n as_widget(Widgets::Textarea.new, attrs, only_initial)\n end", "title": "" } ]
[ { "docid": "3dcb02b3f2d0e636c0edc061352a77e9", "score": "0.79605645", "text": "def text_area; end", "title": "" }, { "docid": "3fd772ac9908586408f7e9d7f07784d7", "score": "0.7362833", "text": "def format_textarea\n text = @attr[:value]\n case text\n when nil, Forme::Ra...
ed5e2d19c9c2bad83cc0bc65d183bc8d
DELETE /api/activities/comments/1 DELETE /api/activities/comments/1.json
[ { "docid": "a625efe822e23940c9cc0b767ae0a692", "score": "0.71116155", "text": "def destroy\n @comment.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "c0a3f570bf0b1cb6a0f98763e6cb52af", "score": "0.7535938", "text": "def destroy\n @comment = @posting.comments.find(params[:id])\n @comment.destroy\n\n respond_to do |format|\n #@comment.create_activity :destroy, owner: current_user\n format.html { redirect_to root_url }\n ...
db364d5c6a55223b9b341a0f7dcbe828
points is an array of values to plot on the number line
[ { "docid": "cc8f1884cb09310b48c441606afd8d11", "score": "0.5344678", "text": "def plot(points = [])\n Gnuplot.open do |gp|\n Gnuplot::Plot.new(gp) do |plot|\n plot.terminal \"pngcairo size 460,460\"\n plot.output @parameters[:fn]\n plot.key \"off\"\n x = []\n y...
[ { "docid": "6db6c866684312443d5812fde37df1eb", "score": "0.6985227", "text": "def plot_points(points = [])\n x = []\n y = []\n points << [(@parameters[:xhigh]-@parameters[:xlow])*2 + @parameters[:xhigh],\n (@parameters[:yhigh]-@parameters[:xlow])*2 + @parameters[:xhigh]] if points...
1e61ad14cc6286fada4b8e01422da19a
Return a particular message
[ { "docid": "4497eea756b652a30710c62a890acc73", "score": "0.0", "text": "def message_content(name)\n SupportMessage.from_file(File.join(@dir_name, name))\n end", "title": "" } ]
[ { "docid": "f4c64ef8dbee89c73b8234a8efa0aa6b", "score": "0.75804716", "text": "def message(*args)\n Message.find_one(self, *args)\n end", "title": "" }, { "docid": "0cfb2db2a9ea125325c26dea6930440f", "score": "0.75677747", "text": "def get_message\n message_text.text...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "100c42910c2772b7e4a9fb3141782ec1", "score": "0.0", "text": "def set_advertisment\n @advertisment = Advertisment.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "d...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "5e34e72a48b31f0887265e5220b1bacd", "score": "0.0", "text": "def current_resource\n @current_resource ||= @wage\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"...
4267bb7c70d0d8b0cd67a3178207e517
Conf needed because ElectoralAlliance != Alliance. Without ":parent => false" authorization is not effective.
[ { "docid": "69196d1d551dc7b17e1153184a5c8ada", "score": "0.0", "text": "def index\n @advocate_team = current_advocate_user&.advocate_team\n @team_alliances = @advocate_team&.electoral_coalition&.electoral_alliances&.by_numbering_order || []\n @alliances_without_coalition = current_advocate_user...
[ { "docid": "81659acff84696625e92d8d8ecd59b9c", "score": "0.5848788", "text": "def inherit_restricted_status\n self.restricted = parent.restricted?\n end", "title": "" }, { "docid": "49103c7d251a53a62007a9727f70a61d", "score": "0.5668978", "text": "def conf_acl\n ace = $ts.dut....
818017c4b2f9ac4919361f2cefc81b5d
Adding open and read timeouts open timeout the amount of time you are willing to wait for 'opening a connection' (read) timeout the amount of time you are willing to wait for some data to be received from the connected party.
[ { "docid": "01a940d9f852385df4dec7daff738e91", "score": "0.63527894", "text": "def add_timeouts(conn, options)\n if !options[:ignore_timeout]\n conn.options.timeout = Expedia.timeout.to_i if Expedia.timeout.present?\n conn.options.open_timeout = Expedia.open_timeout.to_i if Expe...
[ { "docid": "56b779756f2355bf1f13be00450e8952", "score": "0.72760653", "text": "def open_timeout=(timeout); end", "title": "" }, { "docid": "6f2be1b04d041b3e616aecc6ce96ae0c", "score": "0.71262574", "text": "def read_timeout=(timeout); end", "title": "" }, { "docid": "b249...
b5ffbcf01970b367652fab5b37133fcb
Exclude private fields from JSON response Avoids a bug in overriding as_json
[ { "docid": "1d92eb77a133e2652f65cd1b00f09c7c", "score": "0.0", "text": "def serializable_hash(*)\n\n excludes = ['id', 'created_at', 'updated_at', 'from_searcher', 'searcher_key']\n output = super.except(*excludes)\n output.merge!(search_data) if search_data\n\n # Flatten the extra data fiel...
[ { "docid": "6dc962d21790c322bc18b7589688fb35", "score": "0.7547529", "text": "def as_json(options={})\n options[:except] ||= @@secure_fields\n super(options)\n end", "title": "" }, { "docid": "6dc962d21790c322bc18b7589688fb35", "score": "0.7547529", "text": "def as_json(option...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "b55bb0bcca931a39440a4c6a998be283", "score": "0.0", "text": "def set_order\n @order = Order.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "d...
d860d988f7c0813f11cd8429b6d4779c
Checks that all the keys needed were given
[ { "docid": "34f27ccfa7e56a61e1bdd4a606e7bc06", "score": "0.0", "text": "def check_api_keys\n if configuration.nil? || !configuration.valid?\n @configuration = nil\n raise Error::MissingAPIKeys\n else\n # Freeze the configuration so it cannot be modified once the gem is\n ...
[ { "docid": "0c68302d3f1139c3e96c42b2cfd093a6", "score": "0.7583648", "text": "def validate_keys(*valid_keys); end", "title": "" }, { "docid": "0c68302d3f1139c3e96c42b2cfd093a6", "score": "0.7582929", "text": "def validate_keys(*valid_keys); end", "title": "" }, { "docid":...
8e8979296707534a0b3b621e1fd1f34e
Calculator Explanation You will be building a calculator. A calculator can perform multiple arithmetic operations. Your function should allow the user to choose which operation is expected, enter in the values to perform the operation on, and ultimately view the result. Specification: A user should be given a menu of o...
[ { "docid": "e5446070fc339a19e53047e2354e8cd2", "score": "0.0", "text": "def main_menu #Doesn't need anything passed into it, so no arguments. \n\n puts \"[a] - addition\"\n puts \"[s] - subtraction\"\n puts \"[m] - multiplication\"\n puts \"[d] - division\"\n puts \"[r] - square root\"\n put...
[ { "docid": "66a80af8f788aa09a1ea8d2c06266de8", "score": "0.7904058", "text": "def menu\n ...
d340e3a22ccb5879e5befa067fb3dae6
MERGE SORT this will require a tmp array into which sorting is made then the sorted array is inserted into the original array
[ { "docid": "6f4cf49c94c271c77cb92e0e81747ea6", "score": "0.6655965", "text": "def merge numbers, si, mi1, ei\n mi2 = mi1+1\n verboser \"Merging: #{numbers[si..mi1].inspect} and #{numbers[mi2..ei]}\"\n\n tmp = [] # this is ugly. in real life a single tmp array is used that is the size of original arra...
[ { "docid": "159bc4d733fabfb3e2a4030d1a47a913", "score": "0.75808984", "text": "def merge_sort array\nend", "title": "" }, { "docid": "31c71bbb0470574fa7d573c043d2f42a", "score": "0.7536006", "text": "def merge_sort(array)\n merge_into(array.dup, array, 0, array.size)\n array\n ...
fdc0636c923f94aab2b5565eb0ffc630
DELETE /candies/1 DELETE /candies/1.json
[ { "docid": "c33389ebfdb5b96bc3b4164d8d615b73", "score": "0.73060846", "text": "def destroy\n @candy = Candy.find(params[:id])\n @candy.destroy\n\n respond_to do |format|\n format.html { redirect_to candies_url }\n format.json { head :ok }\n end\n end", "title": "" } ]
[ { "docid": "283e508cab2888f4afc64a7682972ab6", "score": "0.7244314", "text": "def destroy\n @candy.destroy\n respond_to do |format|\n format.html { redirect_to candies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a8d458a16d5089c3b2d8f7...
84d4c006065ef264f3bce5e97ac5e267
The following methods are utility methods for SeleniumStandaloneDslDSL. You can easily handle driver with this DSL.
[ { "docid": "70cedd58dcd7a28d6dcaa9ce34184a62", "score": "0.0", "text": "def click(selector, find_by: :link_text)\n sleep Random.new.rand(1..2)\n with_frame do\n @driver.find_element(find_by, selector).click\n end\n sleep Random.new.rand(1..2)\n end", "title": "" } ]
[ { "docid": "b7123bee10a58eefb9f282ab78f978a8", "score": "0.66862607", "text": "def driver\n respond_to?(:selenium) ? send(:selenium) : self\n end", "title": "" }, { "docid": "f37c1931484d315f1799d286a5e3191a", "score": "0.63812065", "text": "def using_driver(driver); end", "t...
f48db0b87bcdcd4cca6cc0511d150c21
mengembalikan nilai ( return )
[ { "docid": "30ec68a2049fa03e4c7a0d1c8726afd0", "score": "0.6590856", "text": "def mengembalikanReturn()\n return \"\\nReturn Ahmad Rosid Ganteng\"\nend", "title": "" } ]
[ { "docid": "d3cd7045d81236f80b2241964baa2ac5", "score": "0.73389924", "text": "def konversiMenit(menit) \n # =================================\n # Area Kode Kode di sini\n \n \n \n # =================================\n end", "title": "" }, { "docid": "07f4aba74008200310213b63a5f...
226ba05a8076bd2c15864a4d641d4277
Three modes: :switch switch if there are not changes. Otherwise halt! :switch! clobber all files before switching :move move files with switch
[ { "docid": "362d8b63fe27fc87b897d3fcd94c56d4", "score": "0.57691824", "text": "def switch!(mode, args)\n return puts \"Please specify a branch name.\".yellow.bold if args.count < 1\n return puts \"Invalid number of arguments. Please specify only a branch name.\".yellow.bold if args.count > 1\n ...
[ { "docid": "de4743ffdcca1c73572720dfaacb02ea", "score": "0.65876794", "text": "def move_instant\n # FIXME: cannot be in target directory and do auto update\n # should we have a key for specifying move_target ?\n\n # for the mo, lets not move if nothing selected\n if @selected_files.empty?\n targe...
3ef95c022e27ef65b9160fe2807a3a78
should download code to the release_path
[ { "docid": "7b9541c5de5cf521a403416ef9635d12", "score": "0.0", "text": "def deploy\n raise \"Must implement deploy method\"\n end", "title": "" } ]
[ { "docid": "be0fa052e66175a79a18265c37a38dc6", "score": "0.66119003", "text": "def tailor_package_resource_to_platform\n @package.source(download_path)\n end", "title": "" }, { "docid": "be0fa052e66175a79a18265c37a38dc6", "score": "0.66119003", "text": "def tailor_pac...
91c38ed5df4cd140ce59a477baff40da
Used for looping through a multi_array and merge all the sub_arrays until there is only one array left in the form of [[elements]]
[ { "docid": "6d913f78f313b1aa2e8f6cfae37097de", "score": "0.70654845", "text": "def merging(multi_array)\n multi_array.sort_by! { |x| x.length } # Sorting: E.g. arrays of lengths 7, 8, 9, 10: in the next step (15,9,10) we want to merge 9 and 10!\n temp = merge(multi_array[0], multi_array[1])\n 2.times...
[ { "docid": "202c5b9d0b552a7fa7265b89a62cf755", "score": "0.6828738", "text": "def flatten_array(array, result = [])\n array.each do |element|\n if element.is_a? Array\n flatten_array(element, result)\n else\n result << element\n end\n end\n result\nend", "title": "" }, { ...
44fa7f8f7809fd30f21d7a49eaa5f123
=begin === Byte swap NArrayMissswap_byte swap byte order. NArrayMisshton convert to network byte order. NArrayMissntoh convert from network byte order. NArrayMisshtov convert to VAX byte order. NArrayMissvtoh convert from VAX byte order. =end
[ { "docid": "c916ab7ada5abeee9e86653d45a756d6", "score": "0.6376232", "text": "def swap_byte\n obj = self.dup\n obj.set_without_validation(@array.swap_byte)\n obj\n end", "title": "" } ]
[ { "docid": "629d7c9be71a12e9d92c62ed6e80d4a5", "score": "0.6073384", "text": "def bswap(arr)\nend", "title": "" }, { "docid": "377166134e615393243276dbf7d232f0", "score": "0.60067904", "text": "def ppc_byteswap(addr)\r\n\t\tdata = [addr].pack('N')\r\n\t\t(data[1,1] + data[0,1] + data...
5d7430ac66b65254b09765ba3075753d
Metodo ayudante de Santiago Ponce
[ { "docid": "163f58a35168168a534fe4b4493691ab", "score": "0.0", "text": "def enlace_a(nombre, url, ops = {})\n link_to(nombre, url, ops)\n end", "title": "" } ]
[ { "docid": "da32862891e2ebc3c8d71f65524bb4c1", "score": "0.69232404", "text": "def prosa\n end", "title": "" }, { "docid": "da32862891e2ebc3c8d71f65524bb4c1", "score": "0.69232404", "text": "def prosa\n end", "title": "" }, { "docid": "871ec6288b069a405aae843577...
8496d918cb02d1f15aa2da3cf6c14a3c
Loads and merges multiple toml files.
[ { "docid": "dbf7699dcd3ffc13c296e2387662c190", "score": "0.6240623", "text": "def load_tomls(default, secondary)\n load_toml(default).deep_merge(load_toml(secondary))\n end", "title": "" } ]
[ { "docid": "0513c72d52a4695e30ce20ccbdaa63d8", "score": "0.6320319", "text": "def merge\n @mergeit.merge_data(@input_files)\n end", "title": "" }, { "docid": "ba15597b910999377142a79dab18c05c", "score": "0.60342854", "text": "def load_data_infile_multiple(files, options = {})...
b57a35c68a2b147cdef37ef7cc9899c3
Closes the Appium instance
[ { "docid": "ac946205db737631e2a3985ef1140807", "score": "0.0", "text": "def teardown\n driver_quit\n end", "title": "" } ]
[ { "docid": "eaeffa88b12ad6c8993087551676bcc2", "score": "0.70722276", "text": "def close \n\t @app.close\n verify_true(5){@sut.application.name=='homescreen'}\n end", "title": "" }, { "docid": "a4c9d946003baec31e82b143902834f7", "score": "0.69292206", "text": "def stop_app\n...
a709f919cd54ef20410cca96767a43fa
POST /christmasevenings POST /christmasevenings.json
[ { "docid": "db7415382ed81676aef670df37f73fb9", "score": "0.6610923", "text": "def create\n @christmasevening = Christmasevening.new(christmasevening_params)\n\n respond_to do |format|\n if @christmasevening.save\n format.html { redirect_to @christmasevening, notice: 'Christmasevening w...
[ { "docid": "7ce03431e1f9b495c38e1837bf4a634f", "score": "0.6018034", "text": "def create\n @sighting = Sighting.new(sighting_params)\n\n if @sighting.save\n render json: @sighting, status: :created, location: @sighting\n else\n render json: @sighting.errors, status: :unprocessable_ent...
706433e1736dd81938c19146fbb71920
Generating a filename hash allows for clean filenames in the temp directory
[ { "docid": "941034a41f74ba5c8337eb6f335f6b90", "score": "0.77797204", "text": "def file_name_hash\n Digest::MD5.hexdigest(file_name)\n end", "title": "" } ]
[ { "docid": "f757ff28166d072018d3fa6a7a50bcda", "score": "0.7919242", "text": "def get_hashed_filename(filename)\n Digest::MD5.hexdigest(filename)\n end", "title": "" }, { "docid": "99a61bee6d2dc9299b11ea3c325275d0", "score": "0.76779187", "text": "def hashed_filename\n \"#...
fb310600e5010eef202987cd682bd3c0
ROBOT TRANSLATOR IF a letter is capitalized AND it's in the first half of the alphabet, it becomes "bloop". OTHERWISE, IF a letter is capitalized OR it's the letter "e", it becomes "buzz". IF it's not a letter at all (ie. punctuation) it becomes "boing". OTHERWISE, it becomes "bleep". Example input: "Happy Halloween!" ...
[ { "docid": "23c31f7084d25623ceb1ade1d186a26e", "score": "0.7984873", "text": "def translate_char(char)\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n halfway = alphabet.length / 2\n is_capitalized = (char.upcase == char)\n\n if !alphabet.index(char.downcase)\n \"boing\"\n elsif is_capitalized && ...
[ { "docid": "e966a5db26fde1e6964ee709a6fbeb12", "score": "0.81278086", "text": "def translate_char(char)\r\n\talpabet = \"abcdefghijklmopqrstuvwxyz\"\r\n\thalfway = alpabet.length / 2\r\n\tis_capitalized = (char.upcase == char)\r\n\r\n\tif !alpabet.index(char.downcase)\r\n\t\t\"boing\"\r\n\telsif is_capi...
11844b9025c184bedec59451ac87f6a9
================================ = Data Type Conversion Methods = ================================
[ { "docid": "ffd2b9145e2e4fb7bdc8f83e5e4fee49", "score": "0.0", "text": "def complex_data_structure_to_bytecode(data)\n\t\t\tbytecode = []\n\t\t\t\n\t\t\t# Keeps track of bytecode when recursing into nested data structures\n\t\t\tstack = []\n\n\t\t\t# Add the bytecode to initialize the data structure\n\t...
[ { "docid": "b1d87e1c86f6a2bed2994f3e1432e137", "score": "0.77395123", "text": "def typecast(value); end", "title": "" }, { "docid": "b1d87e1c86f6a2bed2994f3e1432e137", "score": "0.77395123", "text": "def typecast(value); end", "title": "" }, { "docid": "b4d0567e99e2fda14d...
7dcc71112ec22506e6372b900a6b873f
Returns the value of attribute tokens.
[ { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.0", "text": "def tokens; end", "title": "" } ]
[ { "docid": "2e4b52e125b062ec4c8f3f3f765b4b99", "score": "0.7114073", "text": "def token\n attributes.fetch(:token)\n end", "title": "" }, { "docid": "2e4b52e125b062ec4c8f3f3f765b4b99", "score": "0.7114073", "text": "def token\n attributes.fetch(:token)\n ...
a02209eaf57078e7818f46fffe925dbd
Convenience method to allow configuration options to be set in a block
[ { "docid": "7a36302cbd8da1967abc149ba9dcc820", "score": "0.0", "text": "def configure\n yield self\n self\n end", "title": "" } ]
[ { "docid": "12eb3c1de3837dece778b97ab4fe0547", "score": "0.81598663", "text": "def configure(&block)\n Config.set(&block)\n end", "title": "" }, { "docid": "f0e2b9a13ce7f82f28690ef26fc1ed97", "score": "0.8129695", "text": "def configure(&block)\n block.call(@config)\n ...
ee5fb6334aa434dca0ef3bf9fb733a6b
Force releases all of the permits in the semaphore, even if not owned.
[ { "docid": "aeff6b74130e0c9a818783e4f548cb46", "score": "0.7437226", "text": "def release_all!\n mutexes = @count.times.map { |index| mutex_object(index: index) }\n mutexes.each do |mut|\n mut.unlock!\n rescue LockNotFoundError\n nil\n end\n\n @permits = []\n\n ...
[ { "docid": "ed7d5a457319db0c80fcb10e2a220a4b", "score": "0.70762026", "text": "def reacquire\n @mutex.synchronize do\n raise Error, 'can not reacquire a permit, no permits released right now' if @permits_used == 0\n @permits_used -= 1\n @condition_variable.signal if permit_avai...
4383cdc3d3d7b531a8c8e90a86efa29e
unidirectional connections only. node1 > node2
[ { "docid": "bd85495161fb64a95fed3788c3b5d76d", "score": "0.64493364", "text": "def connect_nodes(node1, node2)\n # node1.connect(node2)\n end", "title": "" } ]
[ { "docid": "a01c85bab25eae7d01d5979de51e01f9", "score": "0.68321097", "text": "def connect(node0, node1)\n @connections << [node0, node1] unless @connections.include? [node0, node1]\n @connections << [node1, node0] unless @connections.include? [node1, node0]\n end", "title": "" }, { "...
6dde90bcc7a26aa2c63ae269d269bb96
The constructor is used by the create factory method. You should not use it, but use the create method instead.
[ { "docid": "1b14a7a60ad8e425466c2167ace123b2", "score": "0.0", "text": "def initialize(text, public_path, style)\n @content = text\n @public_path = public_path\n @style = style\n end", "title": "" } ]
[ { "docid": "700c042555d8ebc7c4de252bf9ffc0af", "score": "0.84668034", "text": "def constructor; end", "title": "" }, { "docid": "4b47ff77d50fd89449b4aee569683d2b", "score": "0.8218979", "text": "def initialize()\n raise \"#{self.class.to_s} should not be instantiated directly.\"...
f17aa22bf78fa1319716145fc4cce0c6
Sets up the callbacks for the dialogs. To add additional callbacks override this method and remember to call `super`
[ { "docid": "b55641826598ba6ed0490474e1554b02", "score": "0.6908073", "text": "def register_callbacks(dialog)\n dialog.register_callback('ready') { |dialog|\n Log.trace :callback, \"ready(...)\"\n event_window_ready\n }\n dialog.register_callback('js_error') { |dialog, error|...
[ { "docid": "54fac66b9874942ad1db1fa48015aece", "score": "0.60585546", "text": "def initialize_callbacks\r\n\r\n # help\r\n add_callback(:help) do |arg|\r\n commandlist()\r\n end\r\n\r\n # exit\r\n add_callback(:exit) do |arg|\r\n finalize()\r\n end\r\n\r\n # quit\r\n ad...
7b4b5afbe9216d5b59565da970fe32ca
this is a reader method
[ { "docid": "8803d8d1a890f5a26cb6e93483395bf2", "score": "0.0", "text": "def name\n\t@name\nend", "title": "" } ]
[ { "docid": "fe900079bfa38fcd41e732d9b6343c7e", "score": "0.83169574", "text": "def reader; end", "title": "" }, { "docid": "fe900079bfa38fcd41e732d9b6343c7e", "score": "0.83169574", "text": "def reader; end", "title": "" }, { "docid": "fe900079bfa38fcd41e732d9b6343c7e", ...
750e8812956f9495f29e1e6cf184c6f8
Returns an array of names for the attributes available on this object sorted alphabetically.
[ { "docid": "9a4719374357426089c2c157dcd2a43a", "score": "0.8886536", "text": "def attribute_names\n attributes.keys.sort\n end", "title": "" } ]
[ { "docid": "fed911c1ca0264a8741fc6a244e19c65", "score": "0.89087117", "text": "def attribute_names\n @attributes.keys.sort\n end", "title": "" }, { "docid": "bb4be73d9ad2a70773744292740efacb", "score": "0.88895375", "text": "def attribute_names\n @attributes.keys.sort\...
e6980cf709d40f37b9735605d73405fb
GET /configs/new GET /configs/new.json
[ { "docid": "3e47736fb14e2e55562d45516dc91187", "score": "0.70819104", "text": "def new\n @global_config = AppConfig.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @global_config }\n end\n end", "title": "" } ]
[ { "docid": "c5929c45fe233ddc1b8fe2d1cb20e383", "score": "0.7331915", "text": "def new\n @config_file = ConfigFile.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @config_file }\n end\n end", "title": "" }, { "docid": "d6a85c1613f1d...
458f04b13aa654647122b837158936c3
redefine your position_taken? method here, so that you can use it in the valid_move? method above.
[ { "docid": "c11b2f575e8f1f50f56faa473596ab9b", "score": "0.0", "text": "def position_taken?(board, position)\n my_play = board[position.to_i]\n if my_play == \" \" || my_play == \"\" || my_play == nil\n return false\n elsif my_play == \"X\" || \"O\"\n return true\n end\nend", "title": "" ...
[ { "docid": "f1b5882b1e94341642347a5613e1d1a2", "score": "0.8491583", "text": "def valid_move?(position)\n end", "title": "" }, { "docid": "d2a173acad26f0c45b2c44cf63a2b56e", "score": "0.8038389", "text": "def valid_move?(board, index)\n return !position_taken?(board, index)\nend", ...
a5eabfa0dfbbc4c7606c7b1af8fa47f3
Prune logged request counts to save memory. Requests outside the max period are safe to prune. Otherwise, keep all logs since the period can change. NOTE: Even with pruning, our logs could grow quite large since we're potentially inserting a key per second. We could save space if our rate limits were always measured in...
[ { "docid": "84a3e852d6ab7500418614f582dbdf09", "score": "0.6880569", "text": "def prune_request_counts(request_counts, now)\n max_period_start_timestamp = (now - MAX_PERIOD).to_i + 1\n\n request_counts.keys.each do |timestamp|\n # Ruby hashes are enumerated in order of insertion\n # (see...
[ { "docid": "e44fb0642c0b471217833f3ef075765a", "score": "0.6741777", "text": "def rate_limit!(namespace, limit: 5, minutes: 5)\n request_time = DateTime.now\n log_path = Rails.root.join(\"tmp/rate_limits/#{namespace}.log\")\n\n unless File.exist?(log_path)\n FileUtils.mkdir_p(File....
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "a6f710734bb29a5db8820a66a926e3b0", "score": "0.0", "text": "def source_keyword_params\n params.require(:source_keyword).permit(:source_id, :keyword_id)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7496205", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6957069", "text": "def strong_params\n params.require(:request).permit(param_white...
f0a359c31b5d747609cdb25f5608cf9e
GET /sprayers/1 GET /sprayers/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "0b0ea6e9beee885cb3009f7f0d5e0af3", "score": "0.7415033", "text": "def index\n @sprayers = Sprayer.all\n end", "title": "" }, { "docid": "1a094a385a776e3eb83bed05dc087c7f", "score": "0.6751113", "text": "def index\n @singers = Singer.all\n render :json => @singer...
f260b0743e3635ff851ba1fb8f391b00
GET /users/1 GET /users/1.json
[ { "docid": "4037de18f65110a15ec5493d829df0bb", "score": "0.0", "text": "def show\n x = params[:id].to_i\n if x == session[:user_id]\n @user = User.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n else\n r...
[ { "docid": "9f7c735ace683c5c2b12c914cc9ad8a8", "score": "0.771752", "text": "def get\n users = User.all.as_json\n render(json: users.as_json, status: :ok)\n end", "title": "" }, { "docid": "a95dfe28d6b386aafc5fb53749e84258", "score": "0.75107867", "text": "def user\n...
29ab4ba272c78a8c0c542bc070871a8b
method to mark student absent
[ { "docid": "0496aba591244b5610fc6a0c61e17e93", "score": "0.0", "text": "def update_attendance(db, update_item_cmd, id)\n\tdb.execute(update_item_cmd, id)\nend", "title": "" } ]
[ { "docid": "b54e32472238569ce18a896da5cc9af9", "score": "0.6523197", "text": "def fail_student\n end", "title": "" }, { "docid": "c56c29380cc365852fea0b5d6384a78a", "score": "0.6358495", "text": "def we_miss_you(student)\n\t@attendance_records = Attendance.find_all_by_student_id(s...
ac0b34f3c2bfa9667e329970a4e442e7
generates the correct wallet path in the groupsshow page avoids to disclose the actual path of the wallet for QR enabled currencies
[ { "docid": "e5267e00084aba2e1adc70843899802b", "score": "0.6658857", "text": "def get_wallet_path_for_group_show(wallet, commoner)\n return wallet_short_path(wallet.hash_id) if current_ability.can?(:short_view, wallet)\n get_wallet_path(wallet, commoner)\n end", "title": "" } ]
[ { "docid": "a7b99011e462db943f4af064fc700902", "score": "0.6025271", "text": "def set_wallet_path(path)\n @config.set_wallet_path(path, @wallet)\n\n puts I18n.t('form.set_wallet_path.valid').to_s.green\n rescue => e\n puts \"#{I18n.t('display.error')} #19: #{e}\".red\n exit 2\n ...
f68a97cb078e1131c94f6e0f0305a972
Gets the level or skills of the actors from before battle.
[ { "docid": "0e92932e91ea9c4eefb8b9e9ba4c1a6f", "score": "0.0", "text": "def old_levels(id); return @old_levels[id]; end", "title": "" } ]
[ { "docid": "d1ac62dff020c64695a8bb8dbfbe7b7e", "score": "0.67338985", "text": "def get_actor_skills(actor)\n return actor.skills.clone\n end", "title": "" }, { "docid": "3e4b79eb50c97ea16b0e5f9b437ab6df", "score": "0.62805915", "text": "def getOponentLevel(m)\n m.getComb...