query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
3e316c872c0a5773f15cb94f49ecb157
Postgres COPY format is NOT CSV. >
[ { "docid": "a24b41ebc409c096720857da8a074280", "score": "0.0", "text": "def parse(line)\n row = line.split(DELIMITER)\n faked = row.map.with_index do |cell, i|\n if cell.blank? || cell == '\\N'\n # Don't acknowledge null cells\n cell\n else\n ...
[ { "docid": "049a9014830d3bfc123271108acbe8a5", "score": "0.7164884", "text": "def export_db_to_csv\n $conn.exec(\"COPY (SELECT * FROM orgs) TO '/Users/appacademy/Desktop/healthify-coding-challenge/updated_csv_file.csv' DELIMITER ',' CSV HEADER\")\n puts \"\\nProcessing complete! Exported to updated_cs...
446b4865468fe5215dc859d2a3bb654d
Return internal data in yaml format
[ { "docid": "2e8ecd440b3695f911c3a36c73d62f6a", "score": "0.67767096", "text": "def saveData\n YAML.dump @data\n end", "title": "" } ]
[ { "docid": "9b6e5a24e60fddc78b85b027607bf999", "score": "0.78134197", "text": "def get_data_yml\r\n hash = {}\r\n self.instance_variables.each {|key| hash[key.to_s.delete(\"@\")] = self.instance_variable_get(key).to_s }\r\n hash.to_yaml\r\n end", "title": "" }, { "docid": "...
edbb0754cfcd0b37c8a173a86dbb7b92
from an ajax call
[ { "docid": "dd3b74c21f90f7f78221b0eb38f396db", "score": "0.0", "text": "def mark_as_read\n ##find or create post in db. add relation so future searches won't include this\n post = Post.find_or_create_by(tweet_id: params[\"tweetId\"])\n PostsUsers.create(post_id: post.id, user_id: current_user.i...
[ { "docid": "ea62777f9b1fda6fe066f197c1329e4f", "score": "0.6310433", "text": "def read_ajax(json_data)\r\n\r\n puts \"json_data: #{json_data}\"\r\n\r\nend", "title": "" }, { "docid": "56ca2e40a6819412dafb0868fc793bf0", "score": "0.6114742", "text": "def get_ajax\n render json:{\n...
17665e4a12769af7b4262412c2944165
"OR" memory with Accumulator Status Register: 7N 6V 51 41 3D 2I 1Z 0C N, , , , , , Z,
[ { "docid": "4b92ffdf3c951d1c8cff9a555249e473", "score": "0.0", "text": "def ora(mode)\n # 01: (zp,x), Zero Page Indexed Indirect\n # 05: zp, Zero Page\n # 09: #, Immediate\n # 0d: a, Absolute\n # 11: (zp),y, Zero Page Indirect Indexed with Y\n # 12: (zp), Zero Page Indirect\n # 15: ...
[ { "docid": "6409983a8b6ab8dd2d22cb995ed7f85e", "score": "0.6342953", "text": "def EOR addr, op\n raise \"TODO\"\n # TODO: set_status_flags\n end", "title": "" }, { "docid": "4556dbf7591d9f622633ab080211cef5", "score": "0.6212547", "text": "def test_EOR_immediate\n res...
0687c663dd66b00d87b7d7fc09f7baab
GET /blabs/1 GET /blabs/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "22964602fb3c6e77bab5bd9c6a46d3b2", "score": "0.69173187", "text": "def index\n\t\t@search = Blab.search(params[:q])\n\t\t@blabs = @search.result\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @blabs }\n end\n end", "title": "" },...
066675d4dedb4f6f6bebce652b9d552f
Execute the Choreo using the specified InputSet as parameters, wait for the Choreo to complete and return a ResultSet containing the execution results.
[ { "docid": "e4a810b7bca22ec9c15e8cdf298a9bba", "score": "0.0", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetNewReleasesResultSet.new(resp)\n return results\n end", "title": "" } ]
[ { "docid": "c4ca32683e8ce75eb6a187d63df8fa77", "score": "0.76639634", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = DoneResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "6f7a7d9be674ad4cf17d6743eb1f7836", "scor...
162ecd510e05c2b1336642361bcebb88
Renders a list of products
[ { "docid": "02d3e1c0460ad4c8bfce6428e7318ac8", "score": "0.0", "text": "def index\n # Get all the order seasons, active season first, then sort alphibetically\n @order_seasons = OrderSeason.all.order(current_season: :desc).order(:order_season_name)\n end", "title": "" } ]
[ { "docid": "4e649604e7e9e7bb1997661006bbc0ff", "score": "0.7959784", "text": "def products_list\n\t\t@view.products_list\n\t\tproducts = @store.products\n\t\tproducts.each do |product|\n\t\t\tputs \"Name: #{product.name} ---> Price: #{product.price}\"\n\t\tend\n\t\t@view.second_view(@current_user, @curr...
4502a79a7b6ea3b89fe84a1ce5de5c94
test save does not submit to Exceptional if deliveries are disabled
[ { "docid": "c06eb9ed7e9e6f0d93192aad8163123a", "score": "0.66002536", "text": "def test_do_not_submit_if_deliveries_are_disabled\n with_api_key '27810b263f0e11eef2f1d29be75d2f39' do\n # turn off delivery.\n Resque::Failure::Exceptional.configure { |c| c.deliver = false }\n @failure.sav...
[ { "docid": "37340c200ef1f2c90c140de2b8cf54b7", "score": "0.6259665", "text": "def handle_testing\n if self.for_testing?\n self.mark_as_paid\n end\n end", "title": "" }, { "docid": "996dc3c193f9483fc054d33ed2826769", "score": "0.6247659", "text": "def save\n return fals...
8c189d07f8cdd02c1449e32cb5004c74
Spec helper methods Return a hash of valid attributes for a certain model.
[ { "docid": "68687770914eea8f8e1523883c9e1b70", "score": "0.0", "text": "def valid(model, options={})\n self.send(\"valid_#{model}\").merge(options)\nend", "title": "" } ]
[ { "docid": "d6cb0a9c402ccd4437b41b5c8823882b", "score": "0.7149959", "text": "def valid_attributes_for(model, attributes = {})\n name = model.to_s.underscore\n send(\"#{name}_attributes\", attributes)\n attributes.stringify_keys!\n attributes\n end", "title": "" }, { "docid": "a...
01af4406df9a80ad755ba404171ab50d
if output.nil? puts op exit end
[ { "docid": "f92370657fe287f7becfb1a0aff8b224", "score": "0.0", "text": "def error(message)\n puts message\n exit\nend", "title": "" } ]
[ { "docid": "187c39b76eecaeddef4de94dd3a7d7d5", "score": "0.7576529", "text": "def check_the_output\n if output.empty?\n puts num\n else\n puts output\n end\n\n end", "title": "" }, { "docid": "54a72e5ae44783bd7112d3167f545c07", "score": "0.715282", "text": "def ra...
010290b842b41f6b0a83cad4690dec78
Returns whether or not there is a next page for the current scope.
[ { "docid": "924661be3351fda0a274e09880f90265", "score": "0.8448584", "text": "def has_next_page?\n @current_page < page_count\n end", "title": "" } ]
[ { "docid": "01b290d7b62de2f3fb073d1a2048bcfe", "score": "0.8511053", "text": "def next_page?\n @page.next_page_token?\n end", "title": "" }, { "docid": "01b290d7b62de2f3fb073d1a2048bcfe", "score": "0.8511053", "text": "def next_page?\n @page.next_page_token?\n ...
70f6e9264232b787a0edac8e03ede50f
A method to print a beautiful usage message.
[ { "docid": "ea75ebd45d9b300eafbc5fac3a53b601", "score": "0.0", "text": "def usage\n $stderr.puts <<EOF\n#{File.basename($0)} [options] [filters]\n\n OPTIONS\n\n -c, --config Override default configuration paths. Requires one\n argument. Can contain globs (escape them in some...
[ { "docid": "2ba20a9e62d278690364d8cab6b55996", "score": "0.8150628", "text": "def usage\n puts @usage_text\n end", "title": "" }, { "docid": "2ba20a9e62d278690364d8cab6b55996", "score": "0.8150628", "text": "def usage\n puts @usage_text\n end", "title": "" }, { "d...
86525f0e3f2d6af745a1e29d3323af59
Setup for a game of Mastermind
[ { "docid": "7d013924f965ed84ad2237fd2b2badb3", "score": "0.6580738", "text": "def setup player_name\n\t\t@rounds = get_rounds\n\t\tinitial_role = get_role(player_name)\n\t\tset_roles(initial_role, player_name)\n\t\t@board = Board.new\n\tend", "title": "" } ]
[ { "docid": "e2c94c97f19c6ca7f9158c63b23f30a1", "score": "0.7444702", "text": "def set_up_game\n\t\tsystem 'clear'\n\t\t@human_player.get_players_name\n\t\tchoose_mode\n\t\tif @mode == 1\n\t\t\tplay_as_codebreaker\n\t\telsif @mode == 2\n\t\t\tplay_as_codemaker\n\t\tend\n\tend", "title": "" }, { ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "77de4ff90e4990b9cf00e8a616fdc589", "score": "0.0", "text": "def set_btoe_bloc\n @btoe_bloc = authorize Btoe::Bloc.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...
ed5125314d1c8ada4707ae3a22a439ae
Every game is a process. A game will contain limited number of players. A new score board, new state manager and new decision maker will be created for this game instance.
[ { "docid": "7ce6b7ba925fe0f2fa83ff2841f2ad66", "score": "0.0", "text": "def initialize session_id\n @session_id = session_id\n\n # The command will be passed to the game instance first\n # and the game instance should notify the decision manager.\n @decision_manager = DecisionManager.new\n\n...
[ { "docid": "bc38e8603bdd9afcf8cb93b3942760c1", "score": "0.62958807", "text": "def create_new_pg_game\n @log.debug \"bot create_new_pg_game on state #{@state_pg_create}, supported games num: #{@supported_games.size}\"\n if @state_pg_create != :submitted\n #p @supported_games\n @supported...
66a6230b122f7047c8180e191a7f2653
`Subscriptionending?` True if this customer has request their account be canceled but there is still time before the end of their billing cycle.
[ { "docid": "5c453cfcdacf92b5edb5cdfd7f8d1065", "score": "0.73926675", "text": "def ending?\n active? && !canceled_at.nil?\n end", "title": "" } ]
[ { "docid": "18bf3a9e84ac1427cbed30416e01278d", "score": "0.6955794", "text": "def can_cancel_current_product_subscription?\n if (cancel_date = self.last_active_recurring_product_subscription_term_cancel_on) &&\n (term_end_date = self.last_active_recurring_product_subscription_term_period_end_o...
a711fc7da50853d13bfc6e01f208c0a4
school? True if school is not ojt.
[ { "docid": "12d889894b17b1a0200ac1328c7312ec", "score": "0.81464624", "text": "def school?\n !institution_type.name.casecmp('ojt').zero?\n end", "title": "" } ]
[ { "docid": "aefa04a27fd30c44f0e07853c6be8961", "score": "0.75390136", "text": "def is_school?\n return self.has_tag?('school')\n end", "title": "" }, { "docid": "53d1a2e50dd16f63e5e1585520302691", "score": "0.7260532", "text": "def is_school?\n \treturn false unless is_log...
4b8ad9ebb94f46e560c97910ed4ec28c
GET /users/:user_id/emails GET /users/:user_id/emails.xml
[ { "docid": "ceb1965c67ea2f30ac8866b6e28d8c07", "score": "0.6797682", "text": "def index\n @emails = @user.emails.sort { |a,b| a.address <=> b.address }\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @emails }\n end\n end", "title": "" } ]
[ { "docid": "df2098f6fe76b92a1943af92f7873c49", "score": "0.76952094", "text": "def emails\n get '/user/emails'\n end", "title": "" }, { "docid": "0e1cdedb6e55e1f0dc3073ff21029f52", "score": "0.7323991", "text": "def show\n @email = @user.emails.find(params[:id])\n\n ...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "dfd4f3251654f460cd605e2c95784ede", "score": "0.0", "text": "def piechart_params\n params.require(:piechart).permit(:angle0, :angle, :opacity, :radius, :radius0)\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"...
be31ddeb8e0a89efe0830409e3e3e9e9
POST /ronda/1/visita_diarias POST /ronda/1/visita_diarias.json
[ { "docid": "bcb97eb5a98398dafd13bbf420578fbd", "score": "0.69283205", "text": "def create\n seleccionarMenu(:rondas)\n @ronda = Ronda.find(params[:ronda_id])\n @visita_diaria = @ronda.visita_diarias.build(params[:visita_diaria])\n\n respond_to do |format|\n if @visita_diaria.save\n ...
[ { "docid": "2dcbe0ebe945d66ef63ff107a944a83e", "score": "0.6664651", "text": "def new\n seleccionarMenu(:rondas)\n @ronda = Ronda.find(params[:ronda_id])\n @visita_diaria = @ronda.visita_diarias.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render js...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "0a3cfc94744cc3acbc5646e0dcc48757", "score": "0.0", "text": "def set_nino\n @nino = Nino.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;...
752cd1c52e13581fdd395ea49e31920c
Quote a copy of the given string and return it.
[ { "docid": "0aa3f7ec9145a4942205e7b568ab5062", "score": "0.5960397", "text": "def quote( val )\n\t\treturn %q{\"%s\"} % [ val.to_s.gsub(/\"/, '\\\\\"') ]\n\tend", "title": "" } ]
[ { "docid": "5d7aac1194b8e47d67ea7624b020a24d", "score": "0.6844084", "text": "def wrap_in_quotes(str)\n unless str\n return str\n end\n\n %Q(\"#{str}\")\n end", "title": "" }, { "docid": "df5f48c521a1aa8fb30e426f20746a08", "score": "0.6694441", "text": "def quote(s)\n ...
3d3854eaf91b897a613f5551ab6e56e7
GET /prescriptions/new prepare for new prescription
[ { "docid": "e5033e25d52529d8eee582aaa3d1081b", "score": "0.74492395", "text": "def new\n @prescription = Prescription.new\n end", "title": "" } ]
[ { "docid": "34b90bc2fffadcbc8e208c5dc20d86e6", "score": "0.78610027", "text": "def create\n\t\tnew_prescription = current_user.prescriptions.create!(rx_params)\n\t\trender json: new_prescription\n\tend", "title": "" }, { "docid": "5e0863e5b6c8130369259aa327c230d5", "score": "0.7614535", ...
10f24a042cf266e31d5341be073404af
Returns the current + i'th character in the string TODO: Find a better place to make this check. Having to check each query is expensive
[ { "docid": "dc2d8ab1f38577847968b4ea0ae4e4cd", "score": "0.6287021", "text": "def nxt(i)\n if @index + i > @eof_index\n raise OutOfBoundsError, \"Index #{@index+i} out of bounds\"\n return nil\n end\n @content[@index+i].chr\n end", "title": "" } ]
[ { "docid": "a9d4fd0e5ffe2ffa28fb4ee7c7c2dfce", "score": "0.7151872", "text": "def get_character(full_string, index)\n full_string[index]\nend", "title": "" }, { "docid": "5c7dbc93485b62e4d2c0f354179269c3", "score": "0.71342164", "text": "def last_index(str, char)\n i = str.length...
ac16507a005e8bd4e1a59d2b23e9d3bd
Delete documents by a given query. Per:
[ { "docid": "f386b26afd3e5491cc39ceb961651901", "score": "0.76858044", "text": "def delete_query(query)\n do_delete_query(query)\n end", "title": "" } ]
[ { "docid": "ff2d7afe7308a03f445d782fd15b0e43", "score": "0.8253531", "text": "def delete_by_query index, query, conflicts_proceed\n conflicts = conflicts_proceed ? 'conflicts=proceed' : ''\n uri = URI(\"http://#{@host}:#{@port_s}/#{index}/_doc/_delete_by_query?#{conflicts}\")\n\n req = Net::HTT...
bac7d38bff2e58690300e020ce2f38fe
R8 Ray3dLength method Ray3dLength Ray3d arg0 Ray [IN]
[ { "docid": "238c179390795ebd5cc9ae2e9ec5f2a7", "score": "0.8383911", "text": "def Ray3dLength(arg0)\n ret = _invoke(1610744244, [arg0], [VT_BYREF | VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end", "title": "" } ]
[ { "docid": "f37623e66b921a3c8c229bcc40137ea6", "score": "0.7666476", "text": "def Ray3dLengthSquared(arg0)\n ret = _invoke(1610744245, [arg0], [VT_BYREF | VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end", "title": "" }, { "docid": "b8859bac39116650e3fd9e8bd89914e2", "sco...
8eca52c190bb77ad8c0078a3668b2934
Use the neuralnet to score results
[ { "docid": "1e9fb535117eb82e75a681246187ea14", "score": "0.57791346", "text": "def nn_score(rows, word_ids)\n url_ids = rows.map { |row| row[0] }.uniq\n nn_res = @net.get_result(word_ids, url_ids)\n scores = {}\n url_ids.size.times do |i|\n scores[url_ids[i]] = nn_res[i]\n ...
[ { "docid": "9a239483f4b60653c58f2b2b29ffd7aa", "score": "0.65590537", "text": "def test_network\n @test_result = @neural_network.output_round(params[:test_data].split(',').map(&:to_i))\n end", "title": "" }, { "docid": "6134307f6ad6a9f6e2fecef80fc284e7", "score": "0.6419801", "te...
d8a6c5bc8797fd086ab48129864de8b8
return all strings accepted by FA with length <= strLen
[ { "docid": "c6c432a94ed7112ab77b2e258e2d96fe", "score": "0.50432056", "text": "def genStr strLen\nsortedAlphabet = @alphabet.sort\nresultStrs = [ ]\ntestStrings = [ ]\ntestStrings[0] = []\ntestStrings[0].push \"\"\n1.upto(strLen.to_i) { |x|\ntestStrings[x] = []\ntestStrings[x-1].each { |s|\nsortedAlphab...
[ { "docid": "209456dd2c21f14ab746b19e1bb0dc84", "score": "0.64731044", "text": "def filter_lengths(strings, length=5)\n big_words = []\n strings.each { |ele| big_words << ele if ele.length >= length }\n return big_words\nend", "title": "" }, { "docid": "1338a67d80f8d6ac6f73508746771e...
a6d053f2425a2b6019d5dfd1f29b87fa
half of the original array's values. Arrays with odd number of values will be split so that the middle value goes into the first half array. Divide array size by 2, if odd adjust accordingly, set index variable for end of first array, add 1 for start of second array.
[ { "docid": "25908d7904d4a3c2e55329cc19763131", "score": "0.715859", "text": "def halvsies(arr)\n index = arr.size / 2\n index -= 1 if arr.size.even?\n [arr[0..index],arr[index+1..-1]]\nend", "title": "" } ]
[ { "docid": "8b22c2279c7626474ee388ac3cf0c390", "score": "0.8197941", "text": "def half_it(array)\n if array.size.even?\n first_length = array.size / 2\n second_length = first_length\n else \n first_length = (array.size + 1) / 2\n second_length = (array.size - 1) / 2\n end\n first_array =...
066675d4dedb4f6f6bebce652b9d552f
Execute the Choreo using the specified InputSet as parameters, wait for the Choreo to complete and return a ResultSet containing the execution results.
[ { "docid": "da3f5d234f32e5ab49ce3fd14f608c97", "score": "0.0", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetLoanDetailsResultSet.new(resp)\n return results\n end", "title": "" } ]
[ { "docid": "ea872306361fc864408e8279b0199bbe", "score": "0.7595022", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = QueryResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "bf6609d69b18cbe3a5f620c672c2cbbf", "score": "0.7...
9e61736be9b693d1d17d2009521682e7
Return the new photos for a user for this occasion, since the user last viewed this occasion
[ { "docid": "6be4fcafa0fd17e1b0b2889c9b22fdac", "score": "0.5611777", "text": "def new_photos_for(user)\n new_content_for(user,:photo) \n end", "title": "" } ]
[ { "docid": "6b33050b15f501693156c3c20f58cc9b", "score": "0.7152659", "text": "def recent_photos(user_id_or_url, options = {})\n options = make_options(:user_id, user_id_or_url, options)\n options[:recent_photos] = true\n get(options)\n end", "title": "" }, { "docid": "0d4f62f027083...
48d6a6f2c72c0a636a7056a723136ab2
method_missing is used to respond to the model callback
[ { "docid": "6455f53ab75370d9c10334d575596bc2", "score": "0.0", "text": "def method_missing(method, *args)\n if method.to_s =~ /recreate_(\\S{1,})_versions/\n crop_image(method.to_s.scan(/recreate_(\\S{1,})_versions/).flatten.first.to_sym)\n else\n super\n ...
[ { "docid": "7e8813571ee40a4a627d9639fcd3475a", "score": "0.7843961", "text": "def method_missing(method, *args)\n @model.send(method)\n end", "title": "" }, { "docid": "31c7d01ede4050370f1c6f98c89594b9", "score": "0.7455808", "text": "def method_missing(method, *attributes, &...
1c8e544a3c61663c7bbc0aa8f28288bc
DELETE /nomes/1 DELETE /nomes/1.xml
[ { "docid": "9d8591baf5e90d93f3b5f2e220c5f89d", "score": "0.66861147", "text": "def destroy\n @nome = Nome.find(params[:id])\n @nome.destroy\n\n respond_to do |format|\n format.html { redirect_to(nomes_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
[ { "docid": "c9c96ac6266b8235998b8c54fb0e1c47", "score": "0.6666782", "text": "def destroy\n @me = Me.find(params[:id])\n @me.destroy\n\n respond_to do |format|\n format.html { redirect_to(mes_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "82...
3ebe03c63f7522db450b9fa9594ae1d0
Stop the manager. Terminates the listeners and stops all processing in the pool.
[ { "docid": "47353df635c4334f2aad143e7055f0c9", "score": "0.0", "text": "def terminate(deadline = DEADLINE)\n return if done\n\n stop_listeners\n\n return if pool.shutdown?\n\n stop_processing(deadline)\n\n @done = true\n end", "title": "" } ]
[ { "docid": "87a2a23dbf1d8b075900a8495adf5b2c", "score": "0.7791141", "text": "def stop\n @stopped = true\n stop_managers\n end", "title": "" }, { "docid": "b3c13d05e92a6df0612878ba1b43e8f9", "score": "0.77231526", "text": "def stop!\n return if @stopped\n\n ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "05a944104c9bfa1ae12fa1ca2591a266", "score": "0.0", "text": "def question_params\n params.require(:question).permit(:topic, :text, :likes, :answered, :category_ids, :image)\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...
db514bb379496c1be9eca6aaaed74db4
GET /worldreach_segments/1 GET /worldreach_segments/1.xml
[ { "docid": "2952a432365444b2a70818b8c9763216", "score": "0.5183768", "text": "def show\n \t@segments = @organization.segments\n session[:current_segment] = @segment = Segment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @segme...
[ { "docid": "610b70dc3bd2b2041f61ecf2733800da", "score": "0.65651166", "text": "def get_segments\n return make_request(\"#{self.endpoint}/list/segments\")\n end", "title": "" }, { "docid": "0cbe012f682239559b2eebee422262cd", "score": "0.61176515", "text": "def lists_...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "dbd71fb3b9eacab9cac54e21f1fa25db", "score": "0.0", "text": "def splunk_user_params\n\t\t\tparams.require(:splunk_user).permit(:user_name, :group_name, :app_team_name, :serviceid, :rpaas_user_flg, :memo)\n\t\tend", "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...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "754ccfd9cb8cfccc5767f62a9885c319", "score": "0.0", "text": "def set_question\n @question = Question.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;...
dbcbfa2ac0a669da1f8f6c939225cb4c
simply send it all over to the model
[ { "docid": "d8a5d1e59c0590935dff2dddc4f57725", "score": "0.0", "text": "def method_missing(*args)\n model.send(*args)\n end", "title": "" } ]
[ { "docid": "46f6cdbcb5ff50316648ca7784309ef8", "score": "0.64389473", "text": "def save\n end", "title": "" }, { "docid": "6178eb829655be277ac8eff5039a8c63", "score": "0.631949", "text": "def save\n\t\tend", "title": "" }, { "docid": "e8af8e216821b936b27fe4e3e2d106...
a486829e1675b0ddae4021f15f836170
Verify that we pass all of the checks. The argument determines whether we skip the :refreshonly check, which is necessary because we now check within refresh
[ { "docid": "46013535392008166ec9f1c7f19931ff", "score": "0.6926123", "text": "def check(refreshing = false)\n self.class.checks.each do |check|\n next if refreshing and check == :refreshonly\n if @parameters.include?(check)\n val = @parameters[check].value\n val = [val] unless...
[ { "docid": "4864e32e2cedbb6e21c02e175672aff6", "score": "0.66649276", "text": "def check_all_attributes(refreshing = false)\n self.class.checks.each { |check|\n next if refreshing and check == :refreshonly\n if @parameters.include?(check)\n val = @parameters[check].value\n ...
767e145af25ed7496d77035caf3d881e
Sets the attribute current_document
[ { "docid": "741ed8745c75f43e03772ac6017201cd", "score": "0.8241313", "text": "def current_document=(_arg0); end", "title": "" } ]
[ { "docid": "3049aaefdc2e93f694217cf5c716de50", "score": "0.8517073", "text": "def assign_current_document!; end", "title": "" }, { "docid": "dc40108fedaf5538630a908cbfbb554c", "score": "0.7879434", "text": "def assign_current_document!\n payload[\"site\"].current_document = docu...
f28ed14cf45f282c4e1ec759fef0e974
Handle all types of errors
[ { "docid": "0a45cc39580295ac25d5f1c65662579e", "score": "0.0", "text": "def server_error!(err)\n render_error(error: err.message)\n end", "title": "" } ]
[ { "docid": "4c40be68f2979600b9fe99a32b310eb3", "score": "0.7420544", "text": "def handle_error()\n end", "title": "" }, { "docid": "3c6ca4b4a29a574ecb6c91611dc7f95e", "score": "0.7311195", "text": "def handle_generic_error(exception)\n end", "title": "" }, { "docid": ...
4ab49339fc374d501ff0e279cf4a87c6
I can use a hash as a parameter like in the example in this way I can create options parameters for the same routine to do different things depending on this last ones.
[ { "docid": "92074313f3e475600c7052434579d4ce", "score": "0.0", "text": "def add(a_number, another_number, options = {})\n sum = a_number + another_number\n sum = sum.abs if options[:absolute]\n sum = sum.round(options[:precision]) if options[:round]\n sum\nend", "title": "" } ]
[ { "docid": "edcb513e47a7bf7d45b142840309051c", "score": "0.6799046", "text": "def takes_hash(opts = {})\n c = opts[:c]\nend", "title": "" }, { "docid": "d1552dd86393ba2e02834f98fa046f65", "score": "0.67530566", "text": "def initialize(optHash)\n @optHash=optHash\n setParameter...
2d7cee952542b7a971d6bfba2353baaa
Method to add extra items Input take new food item and new quantity Steps: Insert food item into hash with new quantity End Method
[ { "docid": "752653b29f27a611198a15a4670a5231", "score": "0.7022022", "text": "def add(grocery_list, food, quantity)\n\tgrocery_list[food] = quantity\nend", "title": "" } ]
[ { "docid": "696fe971e0bdcc1f38337fbe86a57508", "score": "0.7923913", "text": "def add_item(list, add_item, add_quantity=1)\n# steps:\n # Add item as key and quantity as value to final_list hash(item and quantity will be user inputs)\n list[add_item] = add_quantity\n # Return updated hash\n list\nend...
d03ce69516d578ff14cad2e2b7840062
Draw Text args : list of all arguments passed, including nondefault additions
[ { "docid": "d5f3bb1b40b3c209f46f80bb0d3d1d2f", "score": "0.76721597", "text": "def draw_text(*args)\n # Reformat arguments for use (handles rectangles and nil alignments)\n args_2 = reformat_arguments(*args)\n x,y,w,h,t,a = args_2[0],args_2[1],args_2[2],args_2[3],args_2[4],args_2[5]\n #...
[ { "docid": "832590e21ab991f3ff17b0e302d367dc", "score": "0.78613466", "text": "def parse_draw_text_args(args)\n return args if args.first.is_a? Rect\n return Rect.new(args[0], args[1], args[2], args[3]), args[4], args[5]\n end", "title": "" }, { "docid": "832590e21ab991f3ff17b0e302d36...
ef0ac3121b7b43b164e2dbc282f7ad62
Get root nodes count/array for explorer tree
[ { "docid": "00cf0835fc173e983cb9af4f7a852dc6", "score": "0.70053226", "text": "def x_get_tree_roots\n region = MiqRegion.my_region\n objects = region.zones.visible.sort_by { |z| z.name.downcase }\n count_only_or_objects(false, objects)\n end", "title": "" } ]
[ { "docid": "c7c3fb1400c35f43eb8e682f404a641e", "score": "0.7872526", "text": "def count\n @root.count\n end", "title": "" }, { "docid": "dc472a79f13118c1f918114d8fc780d2", "score": "0.7669126", "text": "def num_nodes\n tree.length\n end", "title": "" }, { ...
1149adb1d868b3a604aa97fe9347660e
Write a method reverse_words that takes in a sentence string and returns the sentence with the order of the characters in each word reversed. Note that we need to reverse the order of characters in the words, do not reverse the order of words in the sentence.
[ { "docid": "f0e670c43c04e1ad4cceb5f45590f64a", "score": "0.0", "text": "def reverse_words(sent)\n\n\n revArr = sent.split(\" \")\n returnArr = []\n\n revArr.each_with_index do |ele1, idx1|\n setupArr = []\n ele1.each_char.with_index do |ele2, idx2|\n setupArr.unshift(el...
[ { "docid": "cdd54eedcac2f8f88b3b5ebe668e905e", "score": "0.8540155", "text": "def reverse_words(sentence)\n\tto_reverse = sentence.split()\n\treversed_string = []\n\n\tto_reverse.each do |word|\n\t\treversed_string << word.reverse\n\tend\n\treturn reversed_string.join(\" \")\n\nend", "title": "" }...
170083d39a584bc5ad92a362e9543ec3
Returns the value at the x,y position
[ { "docid": "f6beaab2ae56ae86faa7bacbe95fbde4", "score": "0.0", "text": "def [](x,y)\n @my_matrix[x][y]\n end", "title": "" } ]
[ { "docid": "2576613b6005e985979e9e7267b4fc34", "score": "0.83957356", "text": "def coordinate_value(x,y)\n @datapoints[y][x] \n end", "title": "" }, { "docid": "82f53de8a3dd5c77629180fafa312840", "score": "0.8070712", "text": "def value(x, y)\n @grid[x][y].value\n end", "...
da2fe46689c3935eaa688b3e2da41a18
The support include needs to unexpand (pop the first type out of sequences) if the given node does not expand the matrix. This is true for all nodes except the root node. E.g. `ruby` accepts a sequence of scalars on `root`, but a scalar on `matrix.include`.
[ { "docid": "6d859791e97a0ec90c91c28563d40f12", "score": "0.0", "text": "def unexpand(spec)\n return spec unless seq?(spec)\n spec = dup(spec)\n seq = spec[:types].first\n type = seq.merge(seq[:types].first)\n spec.merge(types: [type])\n end", "tit...
[ { "docid": "78e81ee7fe0512abe15a41bb25e04c7b", "score": "0.6425344", "text": "def includes(node)\n all = node.shapeshift(:all)\n all.unset :prefix, :aliases, :changes, :includes, :normal, :required, :unique\n all.types = [node, *node.includes].map(&:dup)\n\n ...
7f455fba4d33287d89adcda4a27766f7
GET /apn/devices/1 GET /apn/devices/1.xml
[ { "docid": "29f6fcc13231aac6036941a8fbb792fe", "score": "0.69891584", "text": "def show\n @apn_device = APN::Device.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @apn_device }\n end\n end", "title": "" } ]
[ { "docid": "edf996dbe2aecaff1221c26007b9e88e", "score": "0.72805345", "text": "def get_devices\n request(:get, client_api_latest, '/devices')\n end", "title": "" }, { "docid": "3ef0d21a81b068525041fedbd652a2ad", "score": "0.69029915", "text": "def show\r\n @devices = Device.fi...
a447ec9f30405832cbf859194ff3503b
return checkbox values for slots (if any)
[ { "docid": "bb12621ef98365c88c6163dc305c414f", "score": "0.8039226", "text": "def slots\n if !@slot_checkboxes.empty?\n @slot_checkboxes.keys.map do |k|\n k if Native(@slot_checkboxes[k]).elm.checked\n end.compact\n elsif @slot_dropdown\n [Native(@slot...
[ { "docid": "aa4d333506d8ad112628d30515f42128", "score": "0.6082036", "text": "def get_checked_items\n find_all { | i | checked?(i) } \n end", "title": "" }, { "docid": "fc310fa717a699067d9bd6ae9c649465", "score": "0.5852395", "text": "def box_set_results_for(set_of_boxes)\n s...
69beaa3e957d1fc356539d0314d703e1
Custom attribute writer method checking allowed values (enum).
[ { "docid": "6345adf217a1d977e2e4f4601368ff51", "score": "0.0", "text": "def document_split_criteria=(document_split_criteria)\n validator = EnumAttributeValidator.new('String', [\"None\", \"PageBreak\", \"ColumnBreak\", \"SectionBreak\", \"HeadingParagraph\"])\n if document_split_criteria.to_i...
[ { "docid": "af6d0e33773bc681443214ce777b13e1", "score": "0.7088127", "text": "def write_attribute_with_enum(attr, value)\n write_attribute_without_enum attr, converted_enum(attr, value)\n end", "title": "" }, { "docid": "85eec95603dc239e3d18923b2c672b31", "score": "0.6482...
e40079fe4b1d5529ef7d906d00587910
GET /freelancers/1 GET /freelancers/1.json
[ { "docid": "b3a860ae64ff71905936eddc900ddcfa", "score": "0.64368427", "text": "def show\n if params[:search]\n @freelancers = Freelancer.search(params[:search]).order(\"created_at DESC\")\n else\n @freelancers = Freelancer.all.order(\"created_at DESC\")\n end\n end", "title": "" ...
[ { "docid": "8db5675e6e73fe1bd19cca156e4db3f2", "score": "0.67043895", "text": "def index\n @freelancers = Freelancer.all\n end", "title": "" }, { "docid": "c31d3c144b1baffe7b0436795478499a", "score": "0.6539973", "text": "def get_by_freelancer_full(freelancer_id, params)\n ...
d7066fdcdb9cb5cc303cc4e2f1b33cf4
returns the default answer to Item for noninteractive operations
[ { "docid": "639cc3f4eef9412e1caa2bd0bfe5cec6", "score": "0.0", "text": "def default_value_noninteractive\n case @generate_option\n when :never_generate, :no_generate_as_default, :generate_as_default\n value = nil\n when :generate_no_query\n password = Simp::Cli::Utils.genera...
[ { "docid": "16f64da1e43353266d3689f4f2282724", "score": "0.6526731", "text": "def get_item\n\t\tputs \"\"\n \t\tputs \"What would you like to do?\"\n \t\tputs \"\"\n\t\tputs \"(a)dd item, (d)elete item, (m)odify quantity, (p)rint list, or e(x)it?\"\n\t\tresponse = gets.chomp\n\t\tresponse.downcase!\n\t\...
a15990a92dab059b26f30a0df3b121ac
Was this run skipped? See passed? for more information.
[ { "docid": "2ce582ff25b038394425b12ffac5ca1b", "score": "0.8176217", "text": "def skipped?; end", "title": "" } ]
[ { "docid": "2866440cdf296e3d37d5050bb51f2d08", "score": "0.8218671", "text": "def skipped!\n @skipped = true\n end", "title": "" }, { "docid": "860725edc3de47b1acaeaa7f34bd71d8", "score": "0.802099", "text": "def skipped?\n @skipped\n end", "title": "" }, ...
8918703f0d8e969cceffc5221d5cda3d
Manage Data operation builder
[ { "docid": "6e8ad03cd4d4a7b20b37ff1fbdf3fc24", "score": "0.0", "text": "def manage_data(name:, value: nil, source_account: nil)\n raise ArgumentError, \"Invalid :name\" unless name.is_a?(String)\n raise ArgumentError, \":name too long\" if name.bytesize > 64\n raise ArgumentError, \...
[ { "docid": "f974dd869c7702031dc9082d7548ab03", "score": "0.65664744", "text": "def create_builder\n \n end", "title": "" }, { "docid": "788dda7d853f2d68717bbb7e262c6782", "score": "0.654358", "text": "def build_object(builder, type, data)\n if data\n build...
43a3ba9ec54d47bd27f8309258132280
paramaters for a todolist item (name and status boolean)
[ { "docid": "050033d9d159eb648dc934be909e6a3c", "score": "0.0", "text": "def todo_params\n params.require(:todo).permit(:name, :done)\n end", "title": "" } ]
[ { "docid": "3b5f23621f91a061c3535b9527ceefe7", "score": "0.7047526", "text": "def todo_list_item_params\n params.require(:todo_list_item).permit(:label, :status, :todo_list_id)\n end", "title": "" }, { "docid": "a445e1d8d5f2b94e77c7ee38089497a2", "score": "0.67054254", "text"...
7a2d1601fdd6a94ef8cadc5eafb6b4f2
POST /hour_exceptions POST /hour_exceptions.json
[ { "docid": "cd4fc785cde6836e174bbf2b06c23d90", "score": "0.7112908", "text": "def create\n @hour_exception = HourException.new(hour_exception_params)\n\n respond_to do |format|\n if @hour_exception.save\n format.html { redirect_to @hour_exception, notice: 'Hour exception was successful...
[ { "docid": "a2732eff928a153c3bba2a1c54c90c5c", "score": "0.6964416", "text": "def hour_exception_params\n params.require(:hour_exception).permit(:time_beginning, :time_ending, :person_id)\n end", "title": "" }, { "docid": "5adad4c0d7a17a17d6302777bcf40388", "score": "0.65207314",...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "8667d603dbedabd704f5d08e8b81ed6d", "score": "0.0", "text": "def grantsub_params\n params.require(:grantsub).permit(:name)\n end", "title": "" } ]
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.71217275", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "b32229655ba2c32ebe754084ef912a1a", "score": "0.7052942", "text": "def expected_permitted_parameter_names; end", "title": "...
1882c2aa6f9ffd691045fecf73050b64
Test missing comment parameter
[ { "docid": "1becb8820194e773cb394b23bcf4d073", "score": "0.6383159", "text": "def testMissingComment\n setupTest do |iTasksFileName, iTicketsFileName|\n executeProcess(\n [\n '--user', 'ReleaseUser',\n '--branch', 'BranchName',\n ...
[ { "docid": "6b4c1a45f8a72b6d15b5dfb20c3ec50f", "score": "0.74795413", "text": "def verify_comment(line) \n end", "title": "" }, { "docid": "d10bd274967f091a3f81a4eb569ba131", "score": "0.73220414", "text": "def ignore_comment\n\traise 'Expected #' if gets[ 0 ] != '#'\nend", "t...
36b5088ddd8839e5844dbc6882c8e903
returns a Hash of tags for a database instance ==== Parameters rds_id name of the RDS instance whose tags are to be retrieved ==== Returns response: body:
[ { "docid": "2b8b25200382950b7be52fae7d3d90a0", "score": "0.72092205", "text": "def list_tags_for_resource(rds_id)\n resource_name = \"arn:aws:rds:#{@region}:#{owner_id}:db:#{rds_id}\"\n %w[us-gov-west-1 us-gov-east-1].include?(@region) ? resource_name.insert(7, '-us-gov') : resource_na...
[ { "docid": "d44e73371e957214d2b2003188c7cfd5", "score": "0.6529694", "text": "def get_rds_details(options = {})\n stack_resources = resources(options)\n rds_resource_ids = get_resource_ids(stack_resources, \"AWS::RDS::DBInstance\")\n rds = Fog::AWS::RDS.new(:aws_access_key_id => @access_k...
2b5de20e25c6935d9f1792b8a692cd47
Get a duplicate of the underlying table.
[ { "docid": "7dfb096a87c94303dd24a44573f1ad64", "score": "0.5966058", "text": "def to_h\n @table.dup\n end", "title": "" } ]
[ { "docid": "275afbc42ce3173444eaa0abb4408bba", "score": "0.74288404", "text": "def copy\n result = HashTablet.new(@table.size)\n each {|element| result.insert(element) }\n return result\n end", "title": "" }, { "docid": "9180a5b0948dc0429941342f9b93c4e0", "score": "0.73790216",...
61a711687e5c2b57bbbfe5de354c4b93
Turn the password into an hashed one, using PBKDF2 with HMACSHA1 and 160 bit output.
[ { "docid": "f29dedd31ac9faec2fba240a5785b063", "score": "0.80609536", "text": "def hash_password(password,salt)\n p = PBKDF2.new do |p|\n p.iterations = PBKDF2Iterations\n p.password = password\n p.salt = salt\n p.key_length = 160/8\n end\n p.hex_string\nend", "t...
[ { "docid": "2b9207cfb6d069acdbf7f5e3dc9f7ce4", "score": "0.79554677", "text": "def hash_password(password,salt)\n p = PBKDF2.new do |p|\n p.iterations = PBKDF2Iterations\n p.password = password\n p.salt = salt\n p.key_length = 160/8\n end\n ...
8fbcc02bdb7545a0fd5ac624a426a664
Add an entry to the values tables
[ { "docid": "61ab00109c481e514995e2f173a3be28", "score": "0.7975154", "text": "def add(entry)\n if exists?(entry)\n @values_table[entry.keys.first].merge!(entry.values.first)\n else\n @values_table.merge!(entry)\n end\n end", "title": "" } ]
[ { "docid": "fbfab275e4245675a17e0c6406212758", "score": "0.70067847", "text": "def newEntry(table, entry)\n\t\t@conn.exec(\"INSERT INTO #{table} \" + insertQuery(entry) + \";\")\n\tend", "title": "" }, { "docid": "9ef40e38ac195cb3cfb9d1678e7677d4", "score": "0.6967011", "text": "def ...
a2225c227802784480ffc79885a99f0a
Replace Sales Team Member
[ { "docid": "146fb1420ece3474632101562a77c59e", "score": "0.0", "text": "def system_sales_teams_id_members_sales_team_member_id_put_with_http_info(id, sales_team_member_id, sales_team_member, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: SalesTe...
[ { "docid": "72ebda76733431e3a80cc05e277de8eb", "score": "0.6486116", "text": "def update_team\n \n end", "title": "" }, { "docid": "16e60501dd73e15e1ba30575a683c0f7", "score": "0.6180693", "text": "def set_team\n @team = current_team\n end", "title": "" }, { "...
bc4b5a64686256e62930ba3ae90cd0e8
returns true if position taken, false if position is free
[ { "docid": "a70340607cba32360f72bb218a858b32", "score": "0.0", "text": "def position_taken?(board, index)\n !(board[index] == \"\" || board[index] == \" \" || board[index] == nil)\nend", "title": "" } ]
[ { "docid": "40a61536f35b2f171a2838f305658ad5", "score": "0.7723521", "text": "def free?(position)\n @dogs.each { |dog| return false if dog.position == position }\n return true\n end", "title": "" }, { "docid": "f538ccd0086e12c4692039eec236a6d3", "score": "0.7542588", "text": "...
dd1c580777781681909c69eba071ff94
The Spanner database connected to.
[ { "docid": "c6e1a2b6e55b66a8c5f993f4f3d3f35d", "score": "0.0", "text": "def database\n @project.database instance_id, database_id\n end", "title": "" } ]
[ { "docid": "a1ecc467b641ebc24fa04e879e9b23d5", "score": "0.7477649", "text": "def connection\n @db || connect\n end", "title": "" }, { "docid": "37c8e05bec94499d33816389a108f108", "score": "0.7450815", "text": "def db\n @db ||= connection.database\n end", "tit...
e266f2c7b126fa6920b2157c63202204
Get mac address from defined interface
[ { "docid": "2f5f509d40551ddb08ffe87d64bd9b67", "score": "0.8103943", "text": "def get_mac(interface_name = nil)\n if interface_name.nil?\n interfaces[interfaces.keys[0]]['mac']\n else\n interfaces[interface_name]['mac']\n end\n end", "title": "" } ]
[ { "docid": "a582a1149fc8142c5c8f7f70f3e19c44", "score": "0.86058795", "text": "def getMAC(interface='en0')\n addrMAC = `ifconfig #{interface} ether`.split(\"\\n\")[1]\n addrMAC ? addrMAC.strip.split[1].gsub(':','').to_i(16) : 0\n end", "title": "" }, { "docid": "...
c8d5f2ed256464a3230caf976b938f1b
Return unit for rack
[ { "docid": "304b03d0ae600ee25bd982649d746fd2", "score": "0.65490866", "text": "def unit\n self.server_model.unit\n end", "title": "" } ]
[ { "docid": "4c97da8aa243d274f2ea0075ff8a05e9", "score": "0.7195544", "text": "def unit\n @unit\n end", "title": "" }, { "docid": "92eb85d7eb018388917605d31eaae190", "score": "0.7097666", "text": "def get_unit\n return @unit\n end", "title": "" }, { "docid": "f...
e7635a8ba7036f3d5940eb89b5c362bb
GET /editor/projects/:project_id/medication_variables/:id/edit def edit end POST /editor/projects/:project_id/medication_variables
[ { "docid": "65f5e92e78751871797417bed7e78e5b", "score": "0.69610494", "text": "def create\n @medication_variable = @project.medication_variables.new(medication_variable_params)\n if @medication_variable.save\n redirect_to editor_project_medication_variable_path(@project, @medication_variable)...
[ { "docid": "2a2eaddb3cc29faaba1ed2085ca953bc", "score": "0.6359698", "text": "def update_project_variable\n @variable = \"\"\n begin\n if !params[:id].empty?\n parent.managed_repository do\n @variable = Voeis::Variable.get(params[:id].to_i)\n Voeis::Variable.pro...
10f311153ba27702ed58f6eb34dcfb6c
put the app into maintenance mode
[ { "docid": "2acf65eb94dd7664dc6b0371e6fc4c33", "score": "0.7122393", "text": "def on\n heroku 'maintenance:on'\n end", "title": "" } ]
[ { "docid": "eec929aa9006c1494b69bf25ee42fba9", "score": "0.7406392", "text": "def maintenance\n end", "title": "" }, { "docid": "7e844864eebbe2cd709ec072e118f4f6", "score": "0.72475207", "text": "def activate_maintenance_mode\n return unless maintenance && pending_migrations?\n...
f0b45512d58ff4163b6d78f5ed6bfab1
Send a request from a passenger inside the elevator to the controller
[ { "docid": "53da642444c389591d3f554176bb355f", "score": "0.5430301", "text": "def request(id, floor)\n send_message(\"r#{floor}\\r\")\n js = {:id => id, :flr => floor}\n publish_event(\"request\", js)\n end", "title": "" } ]
[ { "docid": "32f5994b3ff5f81194b2d95215a38edb", "score": "0.6757482", "text": "def request_elevator(floor_number, direction)\n sleep(0.5)\n puts(\"####################################\")\n puts(\">>> User request an elevator at floor #{floor_number} to go #{direction} <<<\")\n sleep(0.5)\n ...
5300e93cfb665159abe774a6b4507e6d
Returns true if this site is the root site
[ { "docid": "5a7025a1bccb3760fb624652a3d36015", "score": "0.87478215", "text": "def is_root_site?\n @depth == 0\n end", "title": "" } ]
[ { "docid": "f553982988c616401db4d46673357ecd", "score": "0.78301775", "text": "def root?\n self.path == '/'\n end", "title": "" }, { "docid": "1c057527e2fc1f634e15eb7b1859418d", "score": "0.77227676", "text": "def root?\n !!@root || app_file?\n end", "...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "637a51191e5b5438e070dd7a857b7e1a", "score": "0.0", "text": "def set_organization\n @organization = Organization.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...
9645881f378b4bd63a873a6cf8da7926
Handles all proxy calls to apachectl. When sudo fails
[ { "docid": "bd192baf532c947af450c525f9f62a3a", "score": "0.63643396", "text": "def ctl_proxy(cmd, msg='Ok')\n\n require_cmd('apachectl')\n\n result = `echo \"#{self.password}\" | sudo -S apachectl #{cmd} 2>&1; sudo -k`.sub(\"Password:\\n\",\"\")\n result = msg if result.empty?\n\n if...
[ { "docid": "9e5db3b69ae8b0db778831b2ad27fa5e", "score": "0.607378", "text": "def graceful\n ctl_proxy('graceful','httpd gracefully restarted')\n end", "title": "" }, { "docid": "4b4b99260b3515bae3bf5f97e79af12a", "score": "0.57519805", "text": "def restart\n ctl_prox...
9853d9bc49f22317b00986288c9b693e
Rename a list of keys to the given map.
[ { "docid": "e437ba471341f7ffa7e0d719d915b919", "score": "0.71881706", "text": "def rename_keys(options, map = {})\n Hash[options.map { |k, v| [map[k] || k, v] }]\n end", "title": "" } ]
[ { "docid": "2449493ae0f804653d79fbae24e9881d", "score": "0.70627344", "text": "def rename_keys(*pairs)\n pairs.each { |p| rename_key(p[0], p[1]) }\n end", "title": "" }, { "docid": "1df4a0da5bd53628ac1ef0f1770d23f6", "score": "0.69911706", "text": "def rename_keys(renames, ha...
0cd1c40e4441895d38329f9ecde2488d
GET /giving_groups/1 GET /giving_groups/1.xml
[ { "docid": "b5471a49f2b984122734e3635bf24a89", "score": "0.7042541", "text": "def show\n @giving_group = GivingGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @giving_group }\n end\n end", "title": "" } ]
[ { "docid": "534220631823b5bf34e2b3b1acdef180", "score": "0.73142105", "text": "def index\n respond_to do |format|\n format.html { @groups = Group.get_groups(current_user, params) }\n format.xml { render :xml => Group.get_groups(params.merge({:show => 'all'})) }\n end\n end", "title...
512543f0dd13fce903194ef061d6e4ab
Returns the line number (starting from 1) for the current position in the scanned text (at the end of the last produced, but not necessarily consumed.
[ { "docid": "77fec7b35a7732fd21e8e5c4d9c75b31", "score": "0.76708955", "text": "def line\n return 1 unless lexing_context && locator\n locator.line_for_offset(lexing_context[:end_offset])\n end", "title": "" } ]
[ { "docid": "d2e31126bd4c90791079d7f6524bfdba", "score": "0.8203528", "text": "def current_line_number\n # Not using string[@previous_pos..best_pos].count('\\n') because it is slower\n strscan = ::StringScanner.new(string)\n strscan.pos = @previous_pos\n old_pos = pos + 1\n ...
7273f070ada881bc70ec89b3e3c81a0f
GET /data_templates/new GET /data_templates/new.xml
[ { "docid": "549a52dfcf91b388e815ebffab8861ca", "score": "0.76998204", "text": "def new\n @data_template = DataTemplate.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @data_template }\n end\n end", "title": "" } ]
[ { "docid": "ff5635e08d1bfafb57aedcb88026f254", "score": "0.77508795", "text": "def new\n @tmplt = Template.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tmplt }\n end\n end", "title": "" }, { "docid": "87ad022337915e3df6577ead...
57481a71fb5ec41b23c69fa1cc6080ce
Updates a member in sfdc Args : access_token > the oauth token to use membername > the member to update params > hash of values to be updated Returns : a hash containing the following keys: success, message Raises : ++ >
[ { "docid": "6d9179b65f02d48640f9d1f2066460a5", "score": "0.8054682", "text": "def update\n expose Member.update(@oauth_token, params[:membername], params)\n end", "title": "" } ]
[ { "docid": "a4b65ec23f2f11debed769b85518dae5", "score": "0.7239746", "text": "def update\n if name_exists(params[:member][:name])\n if @member.update(member_params)\n render 'update_success'\n return\n end\n end\n render 'update_failure'\n end", "title": "" }, {...
5543ff298f50004e521c3dfc1ad04d4d
GET /study_years/1 GET /study_years/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "679f318477e9b55b1101ae0b0580c835", "score": "0.7017101", "text": "def index\n @years = Year.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @years }\n end\n end", "title": "" }, { "docid": "da49975ba6495eab4ac0018afc9...
a111a1dea791ef659dfb391ceb1ae4e7
a method to simply list out the Teams in our Array
[ { "docid": "1c425e358fa9304725de694115f0129d", "score": "0.64039856", "text": "def list_teams\n\tputs \"Here are the Teams...\"\n\t# new thing! sleep() tells your program\n\t# to wait a certain amount of seconds\n\t# (passed as argument) before continuing\n\tsleep(1)\n\tputs \"---------------------\"\n\...
[ { "docid": "11647272383ad3c0423f493a0cac6560", "score": "0.7089326", "text": "def all_teams_in_league\n \treturnArray = []\n\t\tbase_uri = 'https://www.thesportsdb.com/api/v1/json/1/search_all_teams.php?l=' + @league_name.to_s\n\t\tresponse = RestClient.get(base_uri)\n\t\tjson_response = JSON.parse(...
5861869e7b9cf82aa918bf19522681c5
comprobar que el departamento se corresponde al del usuario logeado, si no es administrador. Si es adm se debera corresponder a la empresa.
[ { "docid": "76be712e5f3d586c696466d23c55780b", "score": "0.6475799", "text": "def correct_dpto\n if current_user.role<3 && !params[:department].nil?\n unless current_user.department_id==params[:department].to_i\n flash[:danger] = \"ERROR: No tiene acceso al recurso solicitado\"\n ...
[ { "docid": "fdf23aae03cf51b8e0b4fadc2e0144bd", "score": "0.63323087", "text": "def user_departments(user=current_user)\n if user.role? :superadmin\n @departments = Department.active\n else\n @departments = @department || user.department\n end\n end", "title": "" }, { "doc...
6aa49ee7b755082cffda39fc2026cdc5
PUT /check_deposits/1 PUT /check_deposits/1.json
[ { "docid": "38c4653aa28c2057ce81f07d6f3d460e", "score": "0.5570306", "text": "def update\n # ici on n'utilise pas @bank_account.check_deposits car\n # la modification peut avoir pour objet de changer de compte\n @check_deposit = CheckDeposit.find(params[:id])\n fill_author(@check_deposit)\n ...
[ { "docid": "4e19226896c3dcbcad1b33ff07e84216", "score": "0.6062223", "text": "def update\n @deposit_check = DepositCheck.find(params[:id])\n\n respond_to do |format|\n if @deposit_check.update_attributes(deposit_check_params)\n format.html { redirect_to @deposit_check, notice: 'Deposit...
9456cbdb30aba26147e475917de5334b
GET /securities/new GET /securities/new.json
[ { "docid": "1da782dfccd64962a15d32337d27d045", "score": "0.67051065", "text": "def new\n @security = Security.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @security }\n end\n end", "title": "" } ]
[ { "docid": "12f6b274a1aa8d0cfe4e337d761d776d", "score": "0.6401434", "text": "def new\n @secry = Secry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @secry }\n end\n end", "title": "" }, { "docid": "ab1b4aac2a3266556000188e66f7cf...
d0fb14267bcad0b2ca17ae8e9b2c3600
FIXME copied from Microsoft demo
[ { "docid": "4ce1dc0ddd5e9147de69d384c65a073f", "score": "0.0", "text": "def decode_token(token, cryptkey)\n if (cryptkey.nil? or cryptkey.empty?)\n return false\n end\n token = Base64.decode64(CGI.unescape(token))\n if (token.nil? or (token.size <= 16) or !(token.size % 16).zero?)\n ...
[ { "docid": "a9dd648a5d0d2e7d56223e7c753f5e2e", "score": "0.57288873", "text": "def telegraphical()\n end", "title": "" }, { "docid": "48ebb8fe84b09d91caf79f3bebd39723", "score": "0.52972645", "text": "def get_windows\n \n end", "title": "" }, { "docid": "9c014c4a21...
481ea0757cf2fca24e1785462807621b
Find or fetch previous tweets Creates the conversation history for the given tweet Returns an array of tweet records
[ { "docid": "d06943449e096b41c3eac712e3b04dca", "score": "0.78335637", "text": "def fetch_previous_tweets\n return [] unless tweet.reply?\n working_tweet = tweet\n\n while working_tweet.previous_tweet\n begin\n tweet.previous_tweets |= [working_tweet.previous_tweet]\n rescue Act...
[ { "docid": "6beab53b85a7dbce09509a0635c22183", "score": "0.787597", "text": "def previous_tweets\n return [] unless tweet.reply?\n tweet.previous_tweets.presence || fetch_previous_tweets\n end", "title": "" }, { "docid": "bc74b7645054a5cb32e9338c23c45e60", "score": "0.7153918", ...
7e3b40622c10362a83613958f806381f
Set the specified header key to the specified value, replacing any existing header keys with the same name.
[ { "docid": "d49a7256948ce963ae8fb80c71a6966e", "score": "0.0", "text": "def set(key, value); end", "title": "" } ]
[ { "docid": "1cf2dc44d9581fcbafea2e36a7d0d117", "score": "0.87588847", "text": "def change_key_value(key, value)\n @header[key.to_sym] = value\n end", "title": "" }, { "docid": "2babc0294ae977ea57bc345bd5130e75", "score": "0.8667998", "text": "def set_header(key, value)\n r...
b30115969a9b05954bd6719206792d34
vi: set ft=ruby :
[ { "docid": "ba3986d0e62db1508292dc14dda59012", "score": "0.0", "text": "def ensure_plugins(plugins)\n logger = Vagrant::UI::Colored.new\n result = false\n plugins.each do |p|\n pm = Vagrant::Plugin::Manager.new(\n Vagrant::Plugin::Manager.user_plugins_file\n )\n plugin_hash = pm.install...
[ { "docid": "e3b5aa7fb9019ba714796fec13e3bb5f", "score": "0.5853188", "text": "def enable_indent\n \tVim.command(\"set filetype=#{@filetype}\")\n end", "title": "" }, { "docid": "7aa8cf3a94ceb07fde09c2dbbb1bb333", "score": "0.56426823", "text": "def default_vimrc\n <<-EOS.uni...
43a02a3435e14d81fcb865df325cd897
sets name attribute based on size and db id
[ { "docid": "bdc4ca531b20327c364f93823b067840", "score": "0.69764906", "text": "def set_name\n self.update(name: \"Small Washer ##{self.id}\" ) unless self.name\n end", "title": "" } ]
[ { "docid": "e44177549f8ab66f5d101b6382430f95", "score": "0.70936835", "text": "def set_name\n self.update(name: \"Xtra-Large Washer ##{self.id}\") unless self.name\n end", "title": "" }, { "docid": "348411a74b0f95b833aeac5a06513098", "score": "0.6789426", "text": "def set_name\n ...
db0d014c982ef76b0dd3d1bfb3b66c6a
Source ==== DESCRIPTION The source that contains this playlist. ==== RETURNS IITSource
[ { "docid": "aa89445f8dcf14b6baf5dd8a5a3d9f34", "score": "0.70852464", "text": "def source\n IITSource.new(@ole.Source)\n end", "title": "" } ]
[ { "docid": "8a38be9679a5ec06eb6825119df100dd", "score": "0.67391276", "text": "def source\n @source ||= begin\n source = ::Sources::Strategies::Nijie.new(url)\n source.get\n\n source\n end\n end", "title": "" }, { "docid": "4cdb68fa9c29b185b415e2...
b6b9cd199dfaed08c4c534812e0ac109
Check to see if the all the properties in the model are valid
[ { "docid": "d358a53ac273c8e6f19f7b4a905329b0", "score": "0.0", "text": "def valid?\n return false if @name.nil?\n return false if @name.to_s.length > 256\n return false if @status.nil?\n return false if @currency.nil?\n return false if @payment_term.nil?\n return false if @...
[ { "docid": "162d0e63d65b0cd6795543bab63498f2", "score": "0.7898101", "text": "def validate_properties\n true\n end", "title": "" }, { "docid": "162d0e63d65b0cd6795543bab63498f2", "score": "0.7898101", "text": "def validate_properties\n true\n end", "title": "" }...
5fde95f1765630ba1b924c5e2587f57a
process ipn request POST is sent from paypal and will create transaction GET is a redirect from paypal and will redirect back to return_path
[ { "docid": "72a3e00f7d5a416c4305be9175a57a70", "score": "0.73195106", "text": "def answer\n if request.post?\n if ipn_notify.acknowledge\n LolitaPaypal::Transaction.create_transaction(ipn_notify, payment_from_ipn, request)\n end\n render nothing: true\n else\n ...
[ { "docid": "8ba106c39d90ba6cc98f73a055544276", "score": "0.7648157", "text": "def paypal_ipn\n # use the POSTed information to create a call back URL to PayPal\n query = 'cmd=_notify-validate'\n request.params.each_pair {|key, value| query = query + '&' + key + '=' + \n value if key != 're...
cf261adbf4a2a0bfc70487252497e702
Private: Drops any data that has already been loaded to salesforce. Note that this doesn't work for created data since the initial data wont have a salesforce id. Sometimes batches can fail completely and won't give anything in the result set. Therefore, the only way to be able to drop data that's already been created ...
[ { "docid": "a8b9079d54ed1d951f89bde4d5ac7cf7", "score": "0.6551288", "text": "def drop_successfully_updated_data\n lkp_result_by_id = as_lookup(key: 'id', duplicates: true)\n @data.reject! do |row|\n sf_bulk_result = lkp_result_by_id[row['Id'] || row[:Id]]\n sf_bulk_resul...
[ { "docid": "da2edcf7ab8df50b676b743200905718", "score": "0.63406837", "text": "def remove_old_import_data\n\n DailyciousPlan.connection.execute(\"\n delete from dailycious_plans\n where dailycious_plans.restaurant_id in (\n select restaurants.id as restid from restaurants\n ...
4a8b23c85fea236afa3c44d83c618954
POST /category_reports POST /category_reports.json
[ { "docid": "97777b34289af026e1e97a51cc4938ab", "score": "0.5976909", "text": "def create\n @category_report = CategoryReport.new(category_report_params)\n set_exam_and_category\n @category_report.category = @category \n @value_max = @category.find_value_max\n\n if @category_report.save\n ...
[ { "docid": "7c4ec6dc0485ebd1aa43ebcc3138dc22", "score": "0.7552486", "text": "def create\n add_parent_categories (params[:report][:category_ids])\n @report = Report.create(report_params)\n respond_to do |format|\n if @report.save\n format.html { redirect_to @report, notice: 'Report ...
e26fd91429473aa574c250f4e1836e29
post to my broker app
[ { "docid": "07278f4ec4d4124ec6eb7a29dc24cea4", "score": "0.0", "text": "def newpost\n \n uri = URI.parse(\"https://127.0.0.1/cis-broker/test.php\")\n\thttp = Net::HTTP.new(uri.host, uri.port)\n\thttp.use_ssl = true\n\thttp.verify_mode = OpenSSL::SSL::VERIFY_NONE\nrequest = Net::HTTP::Post.new(uri.requ...
[ { "docid": "124492f02909c4635d113089d88c3999", "score": "0.71209055", "text": "def post_message\n end", "title": "" }, { "docid": "8c279ceca7e6097c3ce44050b45aa60e", "score": "0.69880307", "text": "def submit_to_gateway!(post_args)\n #send SMS via post_args\n @client.account.s...
665d23731a290653e618062187236e41
this reusable code is called a Proc. the only difference between blocks and Procs is that a block is a Proc that cannot be saved,and is one time use solution
[ { "docid": "598eb82241e3afdf06ac7d1baf05ea37", "score": "0.0", "text": "def what_am_i(&block)\n block.class\nend", "title": "" } ]
[ { "docid": "3abcf397d44d426cd1a1c04f580f817c", "score": "0.7752857", "text": "def block; end", "title": "" }, { "docid": "3abcf397d44d426cd1a1c04f580f817c", "score": "0.7752857", "text": "def block; end", "title": "" }, { "docid": "3abcf397d44d426cd1a1c04f580f817c", "...
66e4898cfac9085a45260928775bb5b6
Constructor for the Resource
[ { "docid": "4201b5f5e7aa5477ca3fb537ad217fb5", "score": "0.0", "text": "def initialize(attrs)\n @session = attrs.delete(:session)\n @prefix = attrs.delete(:prefix) || ''\n @attributes = {}\n load(attrs)\n end", "title": "" } ]
[ { "docid": "c3581afe3aab7f5e6e0493aa1d7aa979", "score": "0.84938914", "text": "def initialize( resource )\n \t@resource = resource\n end", "title": "" }, { "docid": "13bb2fa8de48587d696e50bb552d6a2b", "score": "0.8467125", "text": "def initialize( resource )\n @resource = ...
557de1eb43eaeee926cd1db3222fb107
Agents have stopped checking for new apps when actionable_past_due? Send message to reactivate them
[ { "docid": "98d9480773c1e201a5ebc47b8aafe247", "score": "0.0", "text": "def broadcast_check_for_apps!\n @provider.self_and_all_descendant_customers.each do |customer|\n ServiceRunnerJob.perform_later(\n \"DeviceBroadcasts::Customer\",\n customer,\n { type: \"apps\", payload:...
[ { "docid": "9dfb30d901622537d4b741cb9c4f8669", "score": "0.621366", "text": "def h_branding_fee_past_due\n approved_app = ShfApplication.where(state: :accepted).first\n approved_user = approved_app.user\n past_due_co = approved_app.companies.first\n past_due_co.update(name: '')\n past_due...
27893e429032969c18303fffb4e83ccb
optional parameters: name: _method, type: String, optional values: GET|POST name: _region, type: String name: _scheme, type: String, optional values: http|https name: connection_domain, type: String name: owner_account, type: String name: owner_id, type: Long name: resource_owner_account, type: String name: resource_ow...
[ { "docid": "1c3d3f223578f0bc923bfa1e388da8e9", "score": "0.0", "text": "def describe_connection_domain(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeConnectionDomain'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_metho...
[ { "docid": "bb2df68a57484635162da1621d60413c", "score": "0.6064959", "text": "def related(params={})\n self.request(__method__, params, https=true)\n end", "title": "" }, { "docid": "0a5c7f45b334df58bd0c41cc090ef393", "score": "0.6015984", "text": "def endpoint_params...