query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
97f54b3163e1c8140b17b448656464b4
Ask the application name
[ { "docid": "5e982b272608d4526e594cc8c2de9e51", "score": "0.8258298", "text": "def ask_name\n question = I18n.t :application_name, scope: :negroku\n Ask.input question, default: File.basename(Dir.getwd)\n end", "title": "" } ]
[ { "docid": "e814afd13793971c7f1935fbd577ab44", "score": "0.7439529", "text": "def appname(new_name = None)\n Tk.execute(:tk, :appname, new_name)\n end", "title": "" }, { "docid": "14ec831412c539e6b21f353240d3b33f", "score": "0.68565595", "text": "def getAppname()\n\t\tquery =...
814a84492d7cacc6e6a4d85ba44c8b04
Iterates for each entry in +db+
[ { "docid": "383594a5aafca9ee7e44794cec9e7455", "score": "0.67954636", "text": "def foreach_in_db(db, metric, &blk)\n SQLite3::Database.new(db) do |conn|\n conn.execute(\"select * from #{metric}\").each { |r| blk[r] }\n end\n end", "title": "" } ]
[ { "docid": "da07168b9b307eb5fc7f9884d086a35d", "score": "0.82840717", "text": "def db_each(db)\n dbc = db.cursor(nil, 0)\n k, v = dbc.get(nil, nil, Bdb::DB_FIRST)\n while k\n break if yield(k, v) == false\n k, v = dbc.get(nil, nil, Bdb::DB_NEXT)\n end\n dbc.close\n end", "t...
c3be59300366685da4587584fa396db3
convert back to params
[ { "docid": "ee8330fe9f585087b3c5f881e8c37490", "score": "0.0", "text": "def to_list_params\n {\n 't' => @t || '',\n 'from' => @from || '',\n 'to' => @to || '',\n 'size' => @list_size || '',\n }\n end", "title": "" } ]
[ { "docid": "66f7022d0989aab71c3bc8e9565f965e", "score": "0.79376924", "text": "def transform_params(params)\n params\n end", "title": "" }, { "docid": "bf6cf74625306a91ffe748dcd6dca712", "score": "0.74676895", "text": "def pagy_massage_params(params)\n params\n en...
1b46dba25b22523c8ea70bcb3a469130
Rails is awkward and calls to_json with a context argument NOTE: Rails only method Hashto_json
[ { "docid": "84b72959e6b4878be5a170aa0360751d", "score": "0.7500297", "text": "def to_json(_context = nil)\n to_h.to_json\n end", "title": "" } ]
[ { "docid": "17c46ce7cff7cab686d13aa479e529d7", "score": "0.7524764", "text": "def to_json(context=nil)\n to_h.to_json(context)\n end", "title": "" }, { "docid": "43d3c1aa617fddc3404ec6737c968d8e", "score": "0.71031785", "text": "def prepare_json; end", "title": "" }, ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "0a61e861d52933156ab74cc0d53daf6d", "score": "0.0", "text": "def set_walk_raport\n @walk_raport = WalkRaport.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...
88fa2026b252f37e58b617ab7772976d
POST /shift_rotations POST /shift_rotations.json
[ { "docid": "fe811905bb95bae49696f40c671083d8", "score": "0.62465715", "text": "def create\n @shift_rotation = ShiftRotation.new(shift_rotation_params)\n @shift_rotations = ShiftRotation.all\n respond_to do |format|\n if @shift_rotation.save\n @shift_rotations = ShiftRotation.all\n ...
[ { "docid": "324cf0ee4c331a391899a47b5f8ab20f", "score": "0.69267404", "text": "def set_shift_rotation\n @shift_rotation = ShiftRotation.find(params[:id])\n end", "title": "" }, { "docid": "350be031fbc07d11a4185ae189352a65", "score": "0.68205947", "text": "def update\n @shift_r...
f261ed1d3ad849966c2cb7a65ad7213c
Sending an input to the first Neuron We should do something better to track multiple inputs
[ { "docid": "23d219a625715fb31411f869bdd2bd93", "score": "0.63069355", "text": "def feedforward(input1, input2)\n n1 = neurons[0]\n n1.feedforward(input1)\n n2 = neurons[1]\n n2.feedforward(input2)\n end", "title": "" } ]
[ { "docid": "926f2765a74b4b282e4798648ebef9a4", "score": "0.6260617", "text": "def send_input(input)\n EM.connect('127.0.0.1', RightScale::CommandConstants::SOCKET_PORT, OutputHandler, input)\n end", "title": "" }, { "docid": "63ca29af55cd2fddba1e81ed3f3148ff", "score": "0.5976738", ...
c4b3744f40c8090f31c9073945d9f97b
Mon Feb 7 23:53:43 IST 2011, ramonrails Fri Mar 4 03:20:57 IST 2011, ramonrails
[ { "docid": "d9421e2bb71f48ba8087d7714cc6f763", "score": "0.0", "text": "def pro_rated_amount\n _start = user_intake.pro_rata_start_date\n _stop = user_intake.subscription_start_date\n _amount = 0 # default\n\n unless _start.blank? || _stop.blank?\n # \n # Thu May 26 19:30:00 IS...
[ { "docid": "9820c19b285a847dd29fbb19f8509a75", "score": "0.65811765", "text": "def server_built\n\t\treturn \"Mar 20 2006 14:30:49\"\n\tend", "title": "" }, { "docid": "13e60d46db74556209469ed95939efc7", "score": "0.62693894", "text": "def rezm_sent_at(email)\n h(email.created_at....
ba762bbfa1c2426e6ee1a4c7f2088926
The Vedeu default options, which of course are influenced by environment variables also.
[ { "docid": "a7e31b1e696500b4b7f71fd1f9572dfa", "score": "0.0", "text": "def defaults\n {\n background: Vedeu::Colours::Background.coerce(:default),\n base_path: base_path,\n colour_mode: detect_colour_mode,\n compression: true,\n debug: false,\n...
[ { "docid": "5f72500ac17217046843c79053a57cb3", "score": "0.6976486", "text": "def options\n @env || @default_options\n end", "title": "" }, { "docid": "7c59c404311348791bfbc4560d3d0c59", "score": "0.6547804", "text": "def default_options; end", "title": "" }, { "d...
1938b0bcb7f512cbe0c17f1cdb38304b
Get the keys for serializeable attributes
[ { "docid": "bdd7671b61025c925e92f605b36b6d67", "score": "0.80534595", "text": "def attribute_keys\n self.class.attribute_keys\n end", "title": "" } ]
[ { "docid": "88083286d18a955087c22ab4d6080fe1", "score": "0.8319316", "text": "def keys\n attributes.keys\n end", "title": "" }, { "docid": "353b9d541d67810498ec55c1c8cc051f", "score": "0.8278306", "text": "def attribute_keys\n return [] unless self[:attributes]\n ...
a8d05ce66829d8ff8f8c5810140c63a9
POST /spotify_artists POST /spotify_artists.xml
[ { "docid": "f51bd1745a029e3846013b046920da6d", "score": "0.7187698", "text": "def create\n @spotify_artist = SpotifyArtist.new(params[:spotify_artist])\n\n respond_to do |format|\n if @spotify_artist.save\n format.html { redirect_to(@spotify_artist, :notice => 'SpotifyArtist was succes...
[ { "docid": "d7efa9e109481fc033c3b7a0a966f09c", "score": "0.68205833", "text": "def create\n @artist = Artist.new(artist_params)\n\n respond_to do |format|\n if @artist.save\n @artist.send :seed_from_spotify\n @artist.reload\n format.html { redirect_to @artist, notice: 'Ar...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "b4fe8b2a8a34b40098bdcc0104588705", "score": "0.0", "text": "def update!(**args)\n @address = args[:address] if args.key?(:address)\n @partition = args[:partition] if args.key?(:partition)\n @snat_pool = args[:snat_pool] if args.key?(:snat_pool)\n end", "...
[ { "docid": "150fa2bdc1fc43d28ac45e2278a1f797", "score": "0.7012263", "text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "t...
bc6f6c7e8177266cc002ab70527b8f6a
Path of archive file to be downloaded on servers
[ { "docid": "0ce39b8a17b7c40434e40aa7efe7f941", "score": "0.73853546", "text": "def archive_path\n @archive_path ||= pathname(fetch(:net_storage_archive_path))\n @archive_path ||= begin\n # Set release_timestamp if not set\n fetch(:release_path, set_release_path)\n ...
[ { "docid": "4f76d2ff585b75ad19f5e853a1181a42", "score": "0.8311119", "text": "def remote_archive_path\n File.join remote_tmp_dir, archive_filename\n end", "title": "" }, { "docid": "85d0a57f04f39fde8b86f45da7174e6a", "score": "0.80770916", "text": "def remote_archive_path\n ...
201193cc146f3a5a9a969b4e284c8242
TODO : to be made dynamic
[ { "docid": "1cb0830dcb5c43953a599ca4d358c82d", "score": "0.0", "text": "def category\n \"flight, hotel\"\n end", "title": "" } ]
[ { "docid": "ccae8533bfaa6c980bf5d0eac73a41ca", "score": "0.6222237", "text": "def dynamic; end", "title": "" }, { "docid": "b6b2bcc0062aeb115edab7b10cbe6930", "score": "0.6212498", "text": "def desired; end", "title": "" }, { "docid": "54ce71ccc2ab871977a41fd36a307f73", ...
50f9f185a7e0a4b735aeced6110bd841
Calculates hash code according to all attributes.
[ { "docid": "5821965fb63d4b389007e42d9eb1b44f", "score": "0.0", "text": "def hash\n [target_id, coupon_code, date_initialised, valid_till, created, changed_by, updated, id, crm_id, organization_id, book_id, coupon_definition_id, target, periods_valid_for, total_periods, remaining_uses, instance_disc...
[ { "docid": "08105588814074a5aed46dbb236c8d02", "score": "0.791457", "text": "def hash_code; Digest::SHA256.hexdigest(@attributes.values.join); end", "title": "" }, { "docid": "706cbdb4c78e6b67e29589df0a4b1b5c", "score": "0.73099273", "text": "def attr_hash\n md5 = Digest::MD5.ne...
0b5e6849892082dbeb07ecc7fbee45f6
PATCH/PUT /tasks/1 PATCH/PUT /tasks/1.json
[ { "docid": "4f992fa6ba973a4453176c879b8affff", "score": "0.0", "text": "def update\n respond_to do |format|\n #new_name = { :name => params.require(:name) }\n # @task.update_attributes(task_params)\n @task_list = @task.task_list\n if @task.update(task_params)\n format.html ...
[ { "docid": "cac9c96d9b119273d80222fef2554029", "score": "0.7552423", "text": "def update\n @task.update!(task_params)\n json_response(@task)\n end", "title": "" }, { "docid": "099e7266a80d49d1d0e30816e04aff39", "score": "0.7479203", "text": "def update\n task = Task.find(pa...
df8b356a05c8b2a3b69d1ae3a006f1e2
the set of domains that the server should accept the connection from. If the list is empty, the server will accept all connections
[ { "docid": "c192d52773557b69e2ce96d267653fac", "score": "0.79518", "text": "def accept_domains\n @accepted || []\n end", "title": "" } ]
[ { "docid": "b7f8dbc7a5f6c11b2a813043752ef6b7", "score": "0.74168205", "text": "def domains\n @domains || []\n end", "title": "" }, { "docid": "736e378e8048396a58da15b03f31942a", "score": "0.729658", "text": "def domains\n domain_settings.select do |domain|\n optio...
78f1dc85a798f579e60ed59db04af43f
GET /food_trucks GET /food_trucks.json
[ { "docid": "00c707f5c70c5c25ac617c0ac7b22353", "score": "0.0", "text": "def index\n search_keywords = params[:keywords] ? params[:keywords] : \"\" \n limit = params[:limit] ? params[:limit].to_i : DEFAULT_LIMIT\n range = params[:range] ? params[:range].to_f : DEFAULT_RANGE\n street_address =...
[ { "docid": "a51dd6b7fa61b6c5a59fbf47776d8745", "score": "0.7465819", "text": "def index\n @trucks = Truck.all\n render json: @trucks\n end", "title": "" }, { "docid": "729d5c408084de7f9aeddbf652246ca1", "score": "0.732606", "text": "def show\n @truck = FoodTruck.find(params...
bcc7f521b78be4fcf6e8b9c6c4445467
The Unit Separator character Constructors Splits the words, and treats whitespace correctly.
[ { "docid": "1f799cb6e232c01ce3dd242b8b9e3dec", "score": "0.0", "text": "def initialize(text)\n old_end = 0\n # splits for html-tags, for any non-word-characters & for SEPARATORs\n treated = text.scan(/<\\/?\\w+>|[^\\w<\\/>#{SEPARATOR}]+|#{SEPARATOR}/) do |literal|\n match = $~\n if ma...
[ { "docid": "35d5e9efed0ba72e22e5ae174cb5ce03", "score": "0.63818526", "text": "def whitespace_to!(separator)\n substitute!(/[[:space:]]+/, separator)\n end", "title": "" }, { "docid": "815cb5905cb141d8ed0d2e1233010f96", "score": "0.6186272", "text": "def seperate(word, seperator=...
ca3b431008741d1b2c5ae830312e4ce7
PATCH/PUT /detail_movements/1 PATCH/PUT /detail_movements/1.json
[ { "docid": "49463d3b26cab8020804506fd96368e4", "score": "0.70748556", "text": "def update\n respond_to do |format|\n if @detail_movement.update(detail_movement_params)\n format.html { redirect_to @detail_movement, notice: 'Detail movement was successfully updated.' }\n format.json ...
[ { "docid": "bd50a43f3ff7cfc3da97fa683da21685", "score": "0.6568818", "text": "def set_detail_movement\n @detail_movement = DetailMovement.find(params[:id])\n end", "title": "" }, { "docid": "298f5ff794bd571704a67a3b74ab8adf", "score": "0.64629966", "text": "def update\n re...
79293608f9802463af09da2f2bf001fc
POST /editorial_spaces POST /editorial_spaces.xml
[ { "docid": "21d2df9e3b9f94cee782498dc98c56ec", "score": "0.60948557", "text": "def create\n opts = params[:editorial_space] || {}\n\n # set page type & id params to nil if they are blank. Otherwise, will crash.\n params[:page_type] = nil if params[:page_type].blank?\n params[:page_id] = nil...
[ { "docid": "4f2aeea6b3f5a65d214941a14367ed4e", "score": "0.6219923", "text": "def editable_spaces\n spaces = Space.editable_by(@context).order(:name, :space_type).map do |space|\n { scope: space.uid, title: space.title }\n end\n\n render json: spaces\n end", "title": "" },...
0b57cac14099b6517166dedede39775a
CRM OBJECT_ = "Branch_Loan_Product__c"
[ { "docid": "ac97bbf8757b79df26bc7fdc50528db1", "score": "0.8006427", "text": "def getBranchLoanProductObjName\r\n\t\t\treturn \"Branch_Loan_Product__c\"\r\n\t\tend", "title": "" } ]
[ { "docid": "0eb6cabbb2ecb1a1ac45a41c87a84fbd", "score": "0.7550884", "text": "def getLoanProductObjName\r\n\t\t return \"loan_product__c\"\r\n\t\tend", "title": "" }, { "docid": "c76b2545e9b588757c5eca69f0876526", "score": "0.71331644", "text": "def getBranchSavingsProductObjName\r\...
0014965b57138d3b63913d24a865ec80
validate do errors.add(:holder, :invalid) end after_initialize do |item| puts item.holder.inspect.red end
[ { "docid": "cb95a34a10041804a20315eab164e1ec", "score": "0.0", "text": "def to_item_kinds\n TemplateKind.joins(:to_conditions)\n .where(cloud_computing_conditions: { from_id: item.item_kind.self_and_ancestors,\n from_type: TemplateKind.to_s })\...
[ { "docid": "59100d67197ae57cf03bae2efffb0862", "score": "0.62173593", "text": "def validate!\n @errors = {}\n validate\n self\n end", "title": "" }, { "docid": "a8410764c3a5a5a871e0d3660518a703", "score": "0.61738", "text": "def after_validation() end", "title": "" },...
8fb11717e2d602352f6769ec0f3e2a4a
Sets the attribute measure
[ { "docid": "13b5a61b24409f671a1b39a8a7599881", "score": "0.0", "text": "def measure=(_arg0); end", "title": "" } ]
[ { "docid": "1b0b5cd6a86d2d2b5cecad1dea317aed", "score": "0.7408468", "text": "def measure=(measure)\n if measure.nil?\n fail ArgumentError, 'invalid value for \"measure\", measure cannot be nil.'\n end\n @measure = measure\n end", "title": "" }, { "docid": "cf8f10bf5...
ec10150e0069999e5755f72b5c895007
Public: Build a query from params. A new query is instantiated with attributes from params and stored in the session as a Hash. Returns nothing.
[ { "docid": "d67da04c2a096f9d6822fff5678d2157", "score": "0.75908166", "text": "def find_query_by_params\n find_query_class\n @query = find_query_new\n if params[:fields] || params[:f]\n @query.filters = {}\n @query.add_filters(params[:fields] || params[:f], params[:operators] || param...
[ { "docid": "00bc0a4c81d404dbbaf81c2490315779", "score": "0.71194464", "text": "def query(params)\n @method = params[:method] if params.has_key?(:method)\n @query_url = params[:query_url] if params.has_key?(:query_url)\n\n @params = parse_params(params)\n\n self\n end", ...
1cf962a19b693865eb668c52b0dfdd66
getter da ip do vps
[ { "docid": "0391b2b60a7e158f2cc49332f13e8f46", "score": "0.8284056", "text": "def ip\n @vps.ip \n end", "title": "" } ]
[ { "docid": "3a61ef74d8d9f3ad9a8f91774024c99c", "score": "0.7239975", "text": "def read_guest_ip_prlctl\n vm_info = json { execute_prlctl('list', @uuid, '--full', '--json') }\n ip = vm_info.first.fetch('ip_configured', '')\n ip == '-' ? '' : ip\n end", "title": "" ...
044ef1b285b5da73ef0d5b37e5a287db
Specs in this file have access to a helper object that includes the QuoteHelper. For example: describe QuoteHelper do describe "string concat" do it "concats two strings with spaces" do helper.concat_strings("this","that").should == "this that" end end end
[ { "docid": "d2766f873d72b7cffbb151cf3e26c125", "score": "0.0", "text": "def login(user)\n post user_session_path, 'user[email]' => user.email, 'user[password]' => user.password, 'user[password_confirmation]' => user.password\nend", "title": "" } ]
[ { "docid": "265987cf204d0cc1da8192c0ab07b302", "score": "0.6794639", "text": "def test_convert_declarations_when_helper_in_the_name\n rspec_in = <<~IT_SPEC\n RSpec.describe Admin::TestableHelper do\n RSpec.describe 'Admin::QuotedTestableHelper' do\n IT_SPEC\n\n minitest_exp ...
e6c7f33c9c15af6583229051c87aa0e2
will move the board piece
[ { "docid": "e47bef6e905565618154f2c896ff0cc1", "score": "0.0", "text": "def input_to_index(input)\n position = input.to_i - 1\nend", "title": "" } ]
[ { "docid": "e19c92af93f76f3bb28150772c7cee1f", "score": "0.8339146", "text": "def move_piece(from,to)\n @board.position[to] = @board.position[from]\n @board.position[from] = nil\n end", "title": "" }, { "docid": "e1c527eda2416d709e5dff2c63880d27", "score": "0.8138316", "text":...
b3e3cfb576e46377c420bb458755780f
DELETE /entry_notes/1 DELETE /entry_notes/1.json
[ { "docid": "8f79d6198cff69d6f6dd14494157e9c0", "score": "0.0", "text": "def destroy\n authorize @entry_note\n\n @number = @entry_note.note_number\n @order_type = @entry_note.order_type\n @entry_note.destroy\n respond_to do |format|\n flash[:success] = @order_type.humanize+\" entrante...
[ { "docid": "7ebe23c6fa8b3649035ebd7cb0ee6d5e", "score": "0.7759806", "text": "def destroy\n return if new_record?\n \n @api.delete \"/notes/#{shortcode_url}.json\"\n end", "title": "" }, { "docid": "de377ba803576ce98e0e3345ef0588dc", "score": "0.72792596", "text": "def dest...
ba7b481d9260f4b2e27aa78d764581f9
For Recurring Plans Flo2Cash manages charging and retries on defined intervals For a tokenised card, merchant can upload a batch of payments with retry information in the batch file. Flo2Cash will retry at the specified intervals ==== Parameters options A hash of Options ==== Options retry_perform true | false retry_fr...
[ { "docid": "bb233c4557c1b870002510b693166680", "score": "0.58166397", "text": "def add_retry_preferences(post, options)\n post[:retryPreferences] = {\n 'perform' => options[:retry_perform] || false,\n 'frequencyInDays' => options[:retry_frequency_in_days] || 1,\n 'maxAt...
[ { "docid": "0ad1926989b04ffe681b897f6e6f2798", "score": "0.6053361", "text": "def retry_interval\n options[:retry_interval]\n end", "title": "" }, { "docid": "6bfdd56098a2e10f8fb55c425f1a7bd5", "score": "0.6023697", "text": "def retry_interval\n options[:retry_interval...
290433a1c81d3ffdcafe296ca39d6442
Executes a shell command on the device, and receives the result.
[ { "docid": "d499648fd3c28dbafb03f276b508a70f", "score": "0.7431475", "text": "def shell(command, &block)\n capture = CommandCapture.new(block_given? ? block : nil)\n receiver = Rjb::bind(capture, 'com.android.ddmlib.IShellOutputReceiver')\n @device.executeShellCommand(command.to_s, receiv...
[ { "docid": "1a90401fe660dbaa49b7131beb6abe6e", "score": "0.6979939", "text": "def shell_command(cmd)\n\t\t# Send the command to the session's stdin.\n\t\tshell_write(cmd + \"\\n\")\n\n\t\t# wait up to 5 seconds for some data to appear\n\t\tif (not (::IO.select([rstream], nil, nil, 5)))\n\t\t\treturn nil...
f25389436c238e940ff9f4bfc4b54e53
Get exercise summary Retrieve training session summary data
[ { "docid": "65cf6e843823a546eae407f4d55d5a58", "score": "0.5891708", "text": "def get_exercise_summary_with_http_info(user_id, transaction_id, exercise_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TrainingDataApi.get_exercise_summary ...'\n...
[ { "docid": "93fdb6e1cc7e0122821d0298db9e0b7e", "score": "0.62425405", "text": "def get_exercise_summary(user_id, transaction_id, exercise_id, opts = {})\n data, _status_code, _headers = get_exercise_summary_with_http_info(user_id, transaction_id, exercise_id, opts)\n data\n end", "title...
af4dc575539d0f636f8118e9765adc50
returns the number of items in this loopbag
[ { "docid": "2d569ab68bc66adac66de77d06c92d20", "score": "0.0", "text": "def size\n\t\t@a.size\n\tend", "title": "" } ]
[ { "docid": "694a1ab86a3155a3c69e85a260b1f323", "score": "0.84367585", "text": "def item_count\n @items.length\n end", "title": "" }, { "docid": "6b9af555ab96439c278a956f34d2e658", "score": "0.8357402", "text": "def count_items\n @items.size\n end", "title": ""...
a16f525354e01dd1199972d9c788f9a5
Render the _pending_requests partial in response to an AJAX call
[ { "docid": "cc35c47d11adb1c2ebbcb4fb2414372a", "score": "0.8230749", "text": "def ajax_illiad_pending\n @pending_requests = params['requests']&.values.to_a\n render json: { record: render_to_string('_pending_requests', layout: false), locals: { pending_requests: @pending_requests } }\n end"...
[ { "docid": "9d5634b1ac199b8be60814a990cd87bf", "score": "0.70976025", "text": "def pending\n @title = \"Pending Contact Requests\".t\n @invitations = do_search_people(@person.received_invitations.pending)\n respond_to do |format|\n format.html { render :template => 'contacts/pending' }\n ...
d1a53c2d369e6c5ff411114c26079946
Validates that the `height` metadata is in the given range. validate_height 100..5000
[ { "docid": "aa67f0c0973f6756b443d1449fc37509", "score": "0.7977508", "text": "def validate_height(height_range)\n min_height, max_height = height_range.begin, height_range.end\n\n validate_min_height(min_height) && validate_max_height(max_height)\n end", "title": "" } ]
[ { "docid": "bb6bb3c78f54f0428d572a44f675bf27", "score": "0.7665613", "text": "def valid_height?\n height = attributes[\"hgt\"]\n if (match = height.match(/\\A(\\d+)(cm|in)\\z/))\n value, unit = match.captures\n case unit\n when \"cm\"\n within_range?(number: value, min: 150, ...
a4a9505a2ccd97251392eb633dad4c3c
If the array is full, an error is returned. Otherwise, the bike is added to the docking station array.
[ { "docid": "2beab78155c9dfbbed7fa20dbd11e48c", "score": "0.6917473", "text": "def return_bike(bike)\n full? ? (raise \"Docking Station full\") : @docking_station << bike\n end", "title": "" } ]
[ { "docid": "f1e4b2a591ccf757ad3d9059909982a7", "score": "0.69209796", "text": "def dock_broken_bike\n full? ? fail(\"I do apologise, this station is full\") : @bikes << Bike.new(false)\n end", "title": "" }, { "docid": "7bb5c24dbf81b1895e86ba6043a5ba1a", "score": "0.68660593", ...
3098ef9580894aaabb7e0593eb129c92
Returns the value of attribute proxy_addr. source://webdrivers//lib/webdrivers/common.rb27
[ { "docid": "348e23e257440908baccbc00ecb6459f", "score": "0.7930705", "text": "def proxy_addr; end", "title": "" } ]
[ { "docid": "b181b2b78bffcb38d7427812edae1398", "score": "0.750106", "text": "def proxy_address\n self.class.proxy_address\n end", "title": "" }, { "docid": "f1c136aba2f0d33532d8cbef8b71be86", "score": "0.73675436", "text": "def proxy\n @data['proxy']\n end", "titl...
b7c20406864ea8914b64e5054a17917e
Notify new user with email after creation
[ { "docid": "2d5db3bc9a50f9c7c58d4027084edb47", "score": "0.7648646", "text": "def new_user(user)\n # Dont email omniauth created users\n Notify.delay.new_user_email(user.id, user.password) unless user.extern_uid?\n end", "title": "" } ]
[ { "docid": "8e0b3aea14318d623ab45095103117de", "score": "0.812275", "text": "def new_user_notification(user)\n @email = user.email\n @name = user.name\n\n mail to: @email, subject: \"Your registration at polyglt.com was successfull\"\n end", "title": "" }, { "docid": "56e0751116dc3...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "d438905d1c6ecba3ecef247e224b841d", "score": "0.0", "text": "def update!(**args)\n @contains_lowercase_character = args[:contains_lowercase_character] if args.key?(:contains_lowercase_character)\n @contains_non_alphanumeric_character = args[:contains_non_alphanumeric_charact...
[ { "docid": "150fa2bdc1fc43d28ac45e2278a1f797", "score": "0.7012263", "text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "t...
a6d3d724b1d0ebbe7d0e67134f26d57a
DELETE /lesson_learneds/1 DELETE /lesson_learneds/1.json
[ { "docid": "cab364e3d4147458694ad25c258cb936", "score": "0.7204886", "text": "def destroy\n @lesson_learned = LessonLearned.find(params[:id])\n @lesson_learned.destroy\n\n # Now remove it from Solr\n @rsolr.delete_by_id(@lesson_learned.id)\n @rsolr.commit\n\n respond_to do |format|\n ...
[ { "docid": "872d8f7c51e800d229129c56e6cafb2d", "score": "0.76921916", "text": "def destroy\n @lesson = Lesson.find(params[:id])\n @lesson.destroy\n\n respond_to do |format|\n format.html { redirect_to lessons_url }\n format.json { head :no_content }\n end\n end", "title": "" ...
3ee458cacea3a901b29a8c1095153723
Funcion que permite a un ciudadano apuntarse a un proyecto
[ { "docid": "61f9edd46875755c7aa74854cb80543a", "score": "0.68827987", "text": "def apuntarseAProyectoCiudadano(c, conjuntoColectivos, conjuntoProyectos)\n auxArray = Array.new\n\n for pro in conjuntoProyectos\n if pro.buscarIndividuo(c) == 0\n auxArray.push(pro)\n end\n end\n\n...
[ { "docid": "ee30af67560d055273e50763d0452dcd", "score": "0.69598365", "text": "def funcioncita procedimiento\n\tprocedimiento.call\nend", "title": "" }, { "docid": "734ad6c36a1ed58c610047ce43e5adb0", "score": "0.6931334", "text": "def procesar\n \n end", "title": "" }, ...
26e95674e266fadd9e99589bee413304
reacts if the two chars are the same but different case
[ { "docid": "78221fb8647d6f8c054fdc0efadc4b41", "score": "0.6443946", "text": "def reacts?(left, right)\n return false if left.nil? || right.nil?\n if left != right \n # case insensitive compare\n left.casecmp(right) == 0\n else\n false\n end\n end", "title": "" } ]
[ { "docid": "6744ffa65a0c0fd67f664101d0b50aad", "score": "0.72327125", "text": "def one_char_different?(word_1, word_2)\n unless !same_length?(word_1, word_2)\n (0...word_1.length).one? { |i| word_1[i] != word_2[i] }\n end\n end", "title": "" }, { "docid": "977fec9b8e229adadcb3191...
5f0960a4db0cc5aa8db4197a02174256
Called by the engine when the whole process instance (or just the segment of it that sports this participant) is cancelled. Will removed the workitem with the same fei as the cancelitem from the database. No expression will be raised if there is no corresponding workitem.
[ { "docid": "d54a0ce693139cff12099dd56d916a02", "score": "0.7678285", "text": "def cancel (cancelitem)\n\n Workitem.destroy_all([ 'fei = ?', cancelitem.fei.to_s ])\n # note that delete_all was not removing workitem fields\n # probably my fault (bad :has_many setting)\n end", "ti...
[ { "docid": "c1f5a04853b13e4ddd81a2cd9cd94ab2", "score": "0.73172724", "text": "def cancel(_fei, flavour)\n # flavour will have 'kill' value if kill_process is invoked instead of cancel_process\n return if flavour\n\n wi = workitem\n params = get_params(wi)\n ...
e2175b94d0b6ef4b29fef8bc94e937db
Pubic: The name of the month it starts Returns a String
[ { "docid": "5eebcadeb76f0269fd9aa1e84ba14f03", "score": "0.77320653", "text": "def month\n start_on.strftime(MONTH_NAME)\n end", "title": "" } ]
[ { "docid": "ac9dd3a0d9f0a9e36fe65b018ea45efb", "score": "0.84919286", "text": "def month_name(number); end", "title": "" }, { "docid": "98eaa11eabad06eba87d9d964dfcfb6e", "score": "0.7943181", "text": "def name\n MONTH_NAMES[month_number]\n end", "title": "" }, { ...
d80528adb7371c38f21d4d41197e9d84
Do All the Maths! Create a program that will take two numbers and then gives the user a choice of what kind of arthimetic they'd like done to the two numbers. Include at least: add, subtract, multiply and divide. This time you really gotta use methods!
[ { "docid": "22f41164e812c32c032cd36db32b656e", "score": "0.0", "text": "def add(x,y)\n\tputs \"Your answer is: #{x+y}\"\nend", "title": "" } ]
[ { "docid": "0d6b4c58ec3eac6c0858827134e83250", "score": "0.7999995", "text": "def basic_calc\n print Rainbow(\"\\n(a)dd, (s)ubtract, (m)ultiply, (d)ivide: \\n\").yellow\n basic_choice = gets.chomp.downcase\n\n\tprint \"\\nEnter your first number: \" \n first_number = gets.to_f\n print \"\\nEnter you...
43517934d8cd1d36ce6b928f7e4d4706
reduce 610 omitted reduce 611 omitted reduce 612 omitted
[ { "docid": "d21a2fc250d33edd62aefd7e41eca691", "score": "0.0", "text": "def _reduce_613(val, _values, result)\n _, (id, line) = val\n\n lexer.lex_state = EXPR_END\n result = s(:lit, id.to_sym).line line\n\n result\nend", "title": "" ...
[ { "docid": "dd458ee5bd7f974c08686357ef463ece", "score": "0.7296575", "text": "def _reduce_608(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "4a284296788ba625eeb1e1f152a2c293", "score": "0.7286739", "text": "de...
af8df816c776c027bc1324041d31318d
DELETE /motogps/1 DELETE /motogps/1.json
[ { "docid": "deead0e018188d7c8f1cfa71c710f3bc", "score": "0.7177502", "text": "def destroy\n @motogp.destroy\n respond_to do |format|\n format.html { redirect_to motogps_url, notice: 'Motogp was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "...
[ { "docid": "ca1385d09c47100ac1861e01fdbb8d5a", "score": "0.69240004", "text": "def destroy\n @motive.destroy\n respond_to do |format|\n format.html { redirect_to motives_url, notice: I18n.t('motives.controller.destroy') }\n format.json { head :no_content }\n end\n end", "title": ...
f95c1d85461b4e7c23a361a50d7239f0
The name of the dependency that the build_version will be determined from.
[ { "docid": "fe26c2ca5c2110a7d4e7f3314b0da616", "score": "0.669936", "text": "def version_dependency\n source_options[:from_dependency]\n end", "title": "" } ]
[ { "docid": "1dcbcce5643d135c784e71bbf7a3c04e", "score": "0.7989543", "text": "def name_for(dependency)\n dependency.name\n end", "title": "" }, { "docid": "1dcbcce5643d135c784e71bbf7a3c04e", "score": "0.7989543", "text": "def name_for(dependency)\n dependency.name\n e...
aae476fb13f66ed36b411d7b9e11a853
POST /schools POST /schools.json
[ { "docid": "6378cd42dbdc82943b1c2b08e287b54e", "score": "0.6530096", "text": "def create\r\n @school = School.new(school_params)\r\n respond_to do |format|\r\n if @school.save\r\n format.html { redirect_to @school, notice: 'Skolan har skapats!' }\r\n format.json { render action:...
[ { "docid": "e911faac6bc1bf0166cbaab300c25926", "score": "0.6951527", "text": "def create\n @school = School.new(school_params)\n respond_to do |format|\n if @school.save\n format.html { redirect_to schools_path }\n format.json { render :show, status: :created, location: @school ...
ff9e80bac7a758475ff8dcc53b5cd4d3
POST /lcb_menus POST /lcb_menus.json
[ { "docid": "ef58a46b1f11ce64fbd11f52397d1fc0", "score": "0.72537553", "text": "def create\n @lcb_menu = LcbMenu.new(lcb_menu_params)\n\n respond_to do |format|\n if @lcb_menu.save\n format.html { redirect_to @lcb_menu, notice: 'Lcb menu was successfully created.' }\n format.json...
[ { "docid": "f96d1037cb46fca55b78d2bba278e48e", "score": "0.7348357", "text": "def create_menu(menu_body)\n res = post(\"menu/create\",{},menu_body)\n return MultiJson.load(res.body)\n end", "title": "" }, { "docid": "1c361648d43b60a8c93c60c95740f1e1", "score": "0.716841", ...
d6bd84a91523da370cd04a3a491b7e4f
GET /donations/1 GET /donations/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "f8268b52813e5a438d44faa662e8cc63", "score": "0.7194823", "text": "def show\n @donation = Donation.find(params[:id])\n\n # return json object\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @donation.to_json }\n end\n end", "title...
b9dd3d11eeb0d3f6d87e6af8bb27c0ef
POST /post476s POST /post476s.xml
[ { "docid": "f229d94b415b1a3146c8ae4be4668622", "score": "0.6238784", "text": "def create\n @post476 = Post476.new(params[:post476])\n\n respond_to do |format|\n if @post476.save\n format.html { redirect_to(@post476, :notice => 'Post476 was successfully created.') }\n format.xml ...
[ { "docid": "adbd4063f9795c23205a346f6dfd3f22", "score": "0.6000956", "text": "def post uri, args = {}; Request.new(POST, uri, args).execute; end", "title": "" }, { "docid": "cbe6500a6c4a615eb91cd77d6de2788c", "score": "0.58623785", "text": "def post(data, tags_in = {}) ; post_to nil...
01f5e2206e87183e8866da5a9e5ef3fa
get city names from the Hash
[ { "docid": "fe5a957d4b511f2de3c1dc984bd0528f", "score": "0.7530287", "text": "def get_city_names(city_names)\n city_names.keys\n end", "title": "" } ]
[ { "docid": "6a56f42736e77489e4935f0aeba43043", "score": "0.82078624", "text": "def get_city_names(city_hash)\n city_hash.keys\nend", "title": "" }, { "docid": "06b5aade61d3fe6707b9d4677a39b211", "score": "0.8089926", "text": "def get_city_names(somehash)\n somehash.each {|city| p...
40f7633ef64289132d30ead9fcb044d1
GET /pathfinders GET /pathfinders.json
[ { "docid": "8f470d1eb54164c0cfbfc46040d386e1", "score": "0.5792432", "text": "def index\n @pathfinders = Pathfinder.all\n @pathfinders = @pathfinders.where(:unit_id => params[:unit_id]) if params[:unit_id]\n if params[:search]\n @pathfinders = @pathfinders.where('name like ?', '%' + params...
[ { "docid": "63e8ccc48f3291cedc701c25d269e784", "score": "0.6888011", "text": "def index\n @paths = current_user.paths.all.page(params[:page]).per(15)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @paths }\n end\n end", "title": "" }, { ...
d08357d28fefbdb4143936e6c185f077
Update service insertion exclusion list Update the exclusion list for service insertion policy
[ { "docid": "b56594d378ac5a0c0edd6f15e6c3b4f5", "score": "0.5078286", "text": "def update_si_exclude_list(policy_si_exclude_list, opts = {})\n data, _status_code, _headers = update_si_exclude_list_with_http_info(policy_si_exclude_list, opts)\n data\n end", "title": "" } ]
[ { "docid": "2b27e4797783a0d542e02a22e9ab59c4", "score": "0.68273556", "text": "def update_service_insertion_exclude_list(si_exclude_list, opts = {})\n data, _status_code, _headers = update_service_insertion_exclude_list_with_http_info(si_exclude_list, opts)\n data\n end", "title": "" ...
be4182b59f0118ce2fde190a24385da1
Get an Unsplash Category.
[ { "docid": "ac0ce61f12a56d4bdfc148d2d014216e", "score": "0.0", "text": "def find(id)\n new JSON.parse(connection.get(\"/categories/#{id}\").body)\n end", "title": "" } ]
[ { "docid": "1595b5d2b6a8b97322ae9fe95291defe", "score": "0.68337387", "text": "def fetch_category category_id\n category = \"\"\n data.site.categories.each do |id, c|\n if category_id == c.id\n category = c\n break\n end\n end\n category\n end", "title": "" }, ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "876251f05b6820ad36fd2e18d629a3d5", "score": "0.0", "text": "def ability_params\n params.require(:ability).permit(:name, :value, :notice)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7497917", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69572496", "text": "def strong_params\n params.require(:request).permit(param_whit...
9ea0d444bea2ea11018139e98701bdad
iterate over array of spaces and see if they are all X's or O's (have a winner)
[ { "docid": "bd068fff882b68dfe0489330e75561d5", "score": "0.71146303", "text": "def token_match?(array)\n winner = false\n # if all spaces in the array == 'X' then we have a winner for 'X'\n if array.all? { |space| space == 'X' }\n winner = array[0]\n # elsif all spaces in the array == '...
[ { "docid": "c7cfd3cd04eb33b91959e8e36a57af09", "score": "0.7546162", "text": "def won?(array)\n # assign a variable to the constant WIN_COMBINATIONS to work with\n win_combination = WIN_COMBINATIONS\n #iterate through untill we find a winning combo\n win_combination.find do |index|\n #check on th...
0e5136e3f06dd6f05040adba819069a9
sets the state of a given query
[ { "docid": "0a3c3bf235420812ce881bcf670609e5", "score": "0.7123258", "text": "def update_query(query,state)\n @sqlitedbh.execute(\"update queue set state = '#{state}' where query = '#{query}'\")\n end", "title": "" } ]
[ { "docid": "1935cb4687f99ff9c76b6fa2732726a6", "score": "0.7888752", "text": "def set_query(query); end", "title": "" }, { "docid": "811584f0eda83cc5266e561b378c9672", "score": "0.74749684", "text": "def update_query(query,state)\n @queue.each do |q|\n if q.query == query...
672290a3d96c4b1578df77df10a76627
DELETE /acupuncture/points/1 DELETE /acupuncture/points/1.json
[ { "docid": "9193efd064f01127a2fd6aff4b22ac57", "score": "0.7779581", "text": "def destroy\n @acupuncture_point.destroy\n respond_to do |format|\n format.html { redirect_to acupuncture_points_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "e50c3873a22c8af4cb02e221369fba71", "score": "0.73052514", "text": "def destroy\n @recycling_point.destroy\n render json: @recycling_point, status: :ok\n end", "title": "" }, { "docid": "323e2c3a327abbfed6cdc62148c71448", "score": "0.7279072", "text": "def destroy\n...
0f14be04fe72e0a219f83b6db7b3c6a1
Initializes using custom server URL or configuration's one
[ { "docid": "6b43bf943d3ab29f6fc2ea030085a21d", "score": "0.66267896", "text": "def initialize(server_uri = nil, api_key = nil)\n config = Shacip::Client.configuration\n @server_uri = URI.parse(server_uri&.to_s || config.server_uri.to_s)\n @api_key = api_key || config.api_key\n ...
[ { "docid": "7b5dc737446e74d6e08b0d15d1ee1e5b", "score": "0.7898216", "text": "def initialize(url=\"\")\n @serverURL = url\n end", "title": "" }, { "docid": "dca37b1df59d90179cb61149cc8ad738", "score": "0.7379898", "text": "def initialize(server_url)\n uri = URI.parse(se...
be47f0074d0613873074d3504be18f4a
Ajoute une Fac/Lab/Pu/Ven/toparcelle si celleci n'existe pas encore pour ce Labour/Pulve/Facture/...
[ { "docid": "e542a8971d094623189f091256f7e9fe", "score": "0.0", "text": "def add_parcelle!(parcelle)\n add = true\n self.parcelles.each do |p|\n if parcelle.id.eql?(p.id)\n add = false\n end\n end\n if add.eql?(true)\n self.parcelles << parcelle\n end\n end", "ti...
[ { "docid": "b6f3b2bf7004bf1ddd4bed1565cb7a91", "score": "0.5670904", "text": "def create\n if !@current_user || (@current_user.admin != 1 && @current_user.admin != 2 && @current_user.admin != 3)\n return head :forbidden\n end\n if params[:commit] == \"Ajouter l'élève\"\n nompren = par...
375c01835d7cafc0c15e52fbcb68f038
Opens an ADO connection to the SQL Server database
[ { "docid": "be207bdf76d2be99ecfd313914caa766", "score": "0.78369313", "text": "def open\n @connection = WIN32OLE.new 'ADODB.Connection'\n @connection.Open <<-CONNECTION_STRING\n Provider=SQLOLEDB.1;\n Persist Security Info=False;\n Data Source=#{@source};\n Initial Catalog=#{@d...
[ { "docid": "365e0b551d426ed687769affa0e6f5c7", "score": "0.69776595", "text": "def connect(server)\n opts = server_opts(server)\n s = opts[:conn_string] || \"driver=#{opts[:driver]};server=#{opts[:host]};database=#{opts[:database]}#{\";uid=#{opts[:user]};pwd=#{opts[:password]}\" if opts[:u...
890929748c551d99c3848bdfc434851f
reject this job and notify owner
[ { "docid": "484b3644d6afa85227dfb84ad53a7c7c", "score": "0.66182107", "text": "def reject(current_member, reason='', send_mail=true)\n General::ChangeStatusService.new(self, StatusLancer::REJECTED, current_member, reason).change\n\n if self.save\n if send_mail == true\n if self.private...
[ { "docid": "319ccde55644600f6b032adbf736daec", "score": "0.7083779", "text": "def reject_job(job)\n rejections.create(job_id: job.id)\n end", "title": "" }, { "docid": "419df6cb6ba17bab6a7123ff5e9c7724", "score": "0.7066975", "text": "def reject\n General::ChangeStatusService....
07031a43f709e1777692aa3defefde1f
Returns `true` if this is a blank pattern, with all terms being `nil`.
[ { "docid": "a3fa46eac539738fe4d91265c28fc5d9", "score": "0.6732977", "text": "def blank?\n subject.nil? && predicate.nil? && object.nil? && graph_name.nil?\n end", "title": "" } ]
[ { "docid": "a743dd14a3ffb8be18f4a7d6f974edec", "score": "0.790819", "text": "def blank?\n BLANK_REGEX === self\n end", "title": "" }, { "docid": "99a29c8ac02e7b26ba1b48c6a2329e0b", "score": "0.7731541", "text": "def blank?\n BLANK_RE === self\n end", "title": "" }, ...
66920709dc7b2db4f22e6ec6fdeba8f9
users belong to an application of a remote system. this class stores the credentials for such systems in memory.
[ { "docid": "9f9c0115c63cd65a252620b10f065caa", "score": "0.543706", "text": "def initialize(username, password, application)\n @name = username\n @application = application\n @password = password\n end", "title": "" } ]
[ { "docid": "620c473b25a3b22d8616f135fd78e7d1", "score": "0.6704218", "text": "def app_credentials\n {user: @config['mysql_app_user'], pass: @config['mysql_app_password']}\n end", "title": "" }, { "docid": "a3354ce98ad80cee40d945bf493fc883", "score": "0.6196814", "text": "def ...
0f5fa6d19552aa490f7df6ab4d3b3e93
GET /orgs GET /orgs.xml
[ { "docid": "9ac882a2328ef694dfcc1bec3a9c2a13", "score": "0.0", "text": "def index\n @units = OrganizationalUnit.find(:all, :order => \"sort_order, lower(abbreviation)\", :include => [:members,:organization_abstracts, :primary_faculty, :joint_faculty, :secondary_faculty])\n @heading = \"Current Org...
[ { "docid": "29e6bc42cd7d97b3ed9e9465515aa86a", "score": "0.8292496", "text": "def list_orgs()\n route = \"/user/orgs\"\n request(route, \"GET\", {})\n end", "title": "" }, { "docid": "818f8e632f99a9d19ef5e4c7f9d3f231", "score": "0.8210304", "text": "def get_organizations\n ...
e812d885a321c044cceb32e0ade6a8ce
Creates a 1G volume with the description "Fogtest volume" and returns it
[ { "docid": "b8c52beb501cd4acff9279237d129b76", "score": "0.82550377", "text": "def create_volume name\n puts \"Creating volume\"\n @conn.create_volume name, 'Fogtest volume', 1\n for vol in self.list_volumes\n if vol.name == name\n return vol\n end\n end\n end", "title"...
[ { "docid": "76fc3a9b2834c1cb837cfa5848bd6d6c", "score": "0.7313521", "text": "def create_volume\n # Creating the volume is part of the server creation\n end", "title": "" }, { "docid": "e2d8bff63b7cd39c5e45dcd4cca2decf", "score": "0.7243087", "text": "def create_volum...
90fe91ce6ac88c7f22a396af1b368808
def generate_token self.token = SecureRandom.base64[0...2] end
[ { "docid": "f41689696c6a4ea73a52f0e0e709656c", "score": "0.0", "text": "def messages_count=(*)\n end", "title": "" } ]
[ { "docid": "891ed5381d64f519095b690deed00aa2", "score": "0.9403946", "text": "def generate_token\n self.token = SecureRandom.urlsafe_base64\n end", "title": "" }, { "docid": "3a409624352e0171d5ccdcd528f1b35f", "score": "0.931389", "text": "def generate_token\n self.token ||= S...
1c18fbdeaadc02386742c8dff4461f22
POST /slh_hosts POST /slh_hosts.json
[ { "docid": "5f47866ba76d6ff3671a003f457c8374", "score": "0.68676335", "text": "def create\n @slh_host = SlhHost.new(params[:slh_host])\n\n respond_to do |format|\n if @slh_host.save\n format.html { redirect_to @slh_host, :notice => 'Slh host was successfully created.' }\n format...
[ { "docid": "5b730f1bece25dd124625c9bb35cf247", "score": "0.70492053", "text": "def remap_dns_hosts(hash)\n @resource['hosts'].post hash.to_json, :content_type => 'application/json'\n end", "title": "" }, { "docid": "0511f3bc51e9fdca860c146320cb190a", "score": "0.637311", ...
a0e2a201dcb2ef9bc3549a2f7bd2c231
GET /american_navy_vessels GET /american_navy_vessels.json
[ { "docid": "f07a036149ec55843d20aa1d5b374571", "score": "0.7034338", "text": "def index\n @american_navy_vessels = AmericanNavyVessel.all\n end", "title": "" } ]
[ { "docid": "f8a195966808d10306c2bffb572fb0f5", "score": "0.6881453", "text": "def index\n @german_navy_vessels = GermanNavyVessel.all\n end", "title": "" }, { "docid": "8a4e830d4351e49ce484a85088f294b9", "score": "0.67335117", "text": "def index\n @navy_vessels = NavyVessel.al...
b14fd8d1fc38816ba649118816314471
GET /items GET /items.json
[ { "docid": "3db3d13eb2e4b34404730e8e76d57ea2", "score": "0.0", "text": "def index\n @items = Item.order(:location).paginated(params[:page])\n end", "title": "" } ]
[ { "docid": "54748291efc0ecbbc050090a2600e1b8", "score": "0.79562956", "text": "def show\n @items = Item.find(params[:id])\n render json: @items\n end", "title": "" }, { "docid": "6edd436821e076697f9a71344cdd724b", "score": "0.7546286", "text": "def items\n\t\tresponse = self.g...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "4a4819e5c0b05448901c869307eae4c6", "score": "0.0", "text": "def set_event\n @event = Event.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...
fc5c751124a817fed127b59dd0cbe3a0
Validates the presence of all the associated objects
[ { "docid": "ad13e167a895ff111ced34dca892098e", "score": "0.664276", "text": "def validate_associations\n errors.add(:user_id, :doesnt_exist) if @user.nil?\n end", "title": "" } ]
[ { "docid": "58e970f12ba9027188166afa45f0fd40", "score": "0.69682145", "text": "def validate_associations\n errors.add(:user_id, :doesnt_exist) if @user.nil?\n errors.add(:lesson_id, :doesnt_exist) if @lesson.nil?\n end", "title": "" }, { "docid": "2fb1e2ff862a6498ee4a73bab7c95235", ...
5964700a89c33db144c304dcad0bf45e
Clones repository specified for application.
[ { "docid": "47386f2550fd308858d9b72556a85913", "score": "0.6895339", "text": "def clone_repository\n Executor.execute \"git clone --depth 1 #{Config.git_url} #{repository_path} --branch #{Config.branch}\"\n end", "title": "" } ]
[ { "docid": "6a509eff6de535a752f92ba8d0b397a0", "score": "0.77486587", "text": "def git_clone(app)\n rest_domain = rest_client.find_domain(options.namespace)\n rest_app = rest_domain.find_application(app)\n run_git_clone(rest_app)\n 0\n end", "title": "" }, { "docid": "...
bcded3098480ca363e92b971ac5e7e5f
GET /to_dos GET /to_dos.json
[ { "docid": "3adca32ee36ba2d86fdc225129cfec05", "score": "0.7327073", "text": "def index\n @to_dos = ToDo.all\n\n render json: @to_dos\n end", "title": "" } ]
[ { "docid": "26185bdecfa4289a30ccb0cb23cd7b88", "score": "0.74428546", "text": "def index\n @project = Project.find(params[:project_id])\n @to_dos = @project.to_dos.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @to_dos }\n end\n ...
505049007029cdbaf26a6bc14c3649c0
In tickers view we can get 1k of tickers per request. It is hardcoded be finviz
[ { "docid": "96ef3e35300ec1aaddf3eb120fa156a1", "score": "0.5546125", "text": "def per_page\n 1_000\n end", "title": "" } ]
[ { "docid": "059ef0d768325dd868e1dc3571c29e4f", "score": "0.6418238", "text": "def all_book_tickers\n request :public, :get, :bookTicker\n end", "title": "" }, { "docid": "6b0979c649e9d306b0d838fd7fe2f254", "score": "0.60263413", "text": "def index\n #@future_ticker...
e7faf2b2abf468ab55132ccbab0a7e16
Generate Financial Reports for an owned Account Arguments: freelancer_reference: (String) params: (Hash)
[ { "docid": "3f6aa6546718b53c24bb12e094bd5e84", "score": "0.65969616", "text": "def get_owned(freelancer_reference, params)\n $LOG.i \"running \" + __method__.to_s\n @client.get '/finreports/v2/financial_account_owner/' + freelancer_reference, params\n end", "titl...
[ { "docid": "82359f395e1d454dd5cbcf2af2df37c5", "score": "0.65110904", "text": "def get_by_freelancers_company(freelancer_company_reference, params)\n $LOG.i \"running \" + __method__.to_s\n @client.get '/finreports/v2/provider_companies/' + freelancer_company_reference + '/bill...
cc74b704591f87bfa7c1a782d9a60ea7
GET /kishangarh_marbles/1 GET /kishangarh_marbles/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "e066a63c81b5d7b4f6c09bc5e8b5fc29", "score": "0.67435074", "text": "def index\n @kishangarh_marbles = KishangarhMarble.all\n end", "title": "" }, { "docid": "261c15f3e74eca202e2e7c1db8b5ba40", "score": "0.64716953", "text": "def show\n @monit = Monit.find(params[:id...
4000d05bfeb52aaf31157a87d061cb60
POST /dropreasons POST /dropreasons.json
[ { "docid": "37cf00c80596de3cf4a35499428b52b2", "score": "0.68112606", "text": "def create\n @curpg = :admintools\n @dropreason = Dropreason.new(params[:dropreason])\n\n respond_to do |format|\n if @dropreason.save\n format.html { redirect_to :action => \"index\" }\n format.js...
[ { "docid": "e9d0913ae7a631948940122a0936d32e", "score": "0.58802885", "text": "def create\n\n request = RestClient.post File.join(API_SERVER,\"rest-api/departments\"), { \n 'name' => params['department']['name'], \n 'description' => params['department']['description'] }.to_json,...
7bb4588feb904e7a982a9a38b77b9e0d
PATCH/PUT /site_surveys/1 PATCH/PUT /site_surveys/1.json
[ { "docid": "b68a833d87a733f394ede6f1eafee1c3", "score": "0.7250814", "text": "def update\n respond_to do |format|\n if @site_survey.update(site_survey_params)\n format.html { redirect_to @site_survey, notice: 'Site survey was successfully updated.' }\n format.json { head :no_conten...
[ { "docid": "5429babedb6c82b6a013205f341d9f91", "score": "0.7065373", "text": "def update\n# @survey = Survey.find(params[:id])\n respond_to do |format|\n if @survey.update_attributes(params[:survey])\n format.html { redirect_to @survey, notice: 'Survey was successfully updated.' }\n ...
61f4210be7dbf82c35b76c5bf9e4cbd2
PUT /post425s/1 PUT /post425s/1.xml
[ { "docid": "0976c1842197b0ce11dce616a8e41f8d", "score": "0.6166182", "text": "def update\n @post425 = Post425.find(params[:id])\n\n respond_to do |format|\n if @post425.update_attributes(params[:post425])\n format.html { redirect_to(@post425, :notice => 'Post425 was successfully update...
[ { "docid": "e631b376ae2ccb776680432bf94b01cc", "score": "0.65632534", "text": "def put(uri, xml)\r\n req = Net::HTTP::Put.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end", "title": "" }, { "docid": "c2c0b673628fdc28b...
ee939037d04911db246722885ad15449
Find vehicle by ID Returns a single vehicle
[ { "docid": "518e7183df72b7f2df3c941f8dc2a67d", "score": "0.0", "text": "def get_vehicle_by_id(vehicle_id, opts = {})\n data, _status_code, _headers = get_vehicle_by_id_with_http_info(vehicle_id, opts)\n return data\n end", "title": "" } ]
[ { "docid": "a43d7c784159f0f4e01bf75c62c59a51", "score": "0.7599343", "text": "def vehicle()\n sql = \"SELECT * FROM vehicles INNER JOIN rentals ON rentals.vehicle_id\n = vehicles.id WHERE rentals.id = $1\"\n values = [@id]\n result = SqlRunner.run(sql, values)[0]\n return Vehicle.ne...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "785fec7ad7bcfc4930706bda504130dc", "score": "0.0", "text": "def set_goal\n @goal = Goal.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...
8540d31e965b9c3b5a68903cd6376a5c
POST /shared_projects POST /shared_projects.json
[ { "docid": "80d96860121a23991f2ac650d282eeb6", "score": "0.738145", "text": "def create\n @shared_project = SharedProject.new(shared_project_params)\n\n respond_to do |format|\n if @shared_project.save\n format.html { redirect_to @shared_project, notice: 'Shared project was successfull...
[ { "docid": "1c3ad7e014391626bba4a9ddf462d70d", "score": "0.6478833", "text": "def create\n @projects = params[:projects].map do |project_hash|\n Project.new(project_params(project_hash))\n end\n\n @projects.each do |project|\n project.take_app_screenshot!\n end\n \n projects_...
06f80ac453e83937ff18b67f32ae080d
Forks a worker child
[ { "docid": "93368c3338bb29a17c4031e5aa11bda3", "score": "0.7109261", "text": "def fork_child\n Thread.start do\n pid = fork do\n DRb.stop_service\n\n DRb.start_service\n\n processor\n end\n\n Process.wait pid\n end\n end", "title": "" } ]
[ { "docid": "021bbe599784ec7ec8afadc43b739339", "score": "0.8863683", "text": "def fork_worker\n fork { worker }\n end", "title": "" }, { "docid": "fd76ebc285ab8d949cce1c59932ec9ab", "score": "0.7636376", "text": "def fork_and_work\n cpid = fork {setup_child; work}\n ...
e3058f5adb5e7a02d542438b16bb58be
POST /treasures POST /treasures.xml
[ { "docid": "d5a05646771093e7fa6ea0ad0f1bb465", "score": "0.49029136", "text": "def create\n @treasure = Treasure.new(params[:treasure])\n\n respond_to do |format|\n if @treasure.save\n flash[:notice] = 'Treasure was successfully created.'\n format.html { \n if request.x...
[ { "docid": "6c10f73f32fa236a862029377de8a90a", "score": "0.53973687", "text": "def create\n @measure = current_user.account.measures.new(params[:measure])\n\n respond_to do |format|\n if @measure.save\n flash[:notice] = 'Measure was successfully created.'\n format.html { redirec...
baf8a53bb706c143bf9d0af98fe28daa
Whether the stream has been closed.
[ { "docid": "66b08d29fa7a21dd74583c5f2c809396", "score": "0.7893062", "text": "def closed?\n\t\t\t\t\t@closed\n\t\t\t\tend", "title": "" } ]
[ { "docid": "703386c0f0718c2f782a001cf83dc5f8", "score": "0.8729756", "text": "def closed?\n advance!\n @stream.closed?\n end", "title": "" }, { "docid": "2c86c8b4d5503e3687924505d7b3071e", "score": "0.8400165", "text": "def closed?\n return @io.closed?\n end", ...
16b5f637d67b3354f18609b5b1436791
Logs a message used when you want to log both incoming and outgoing messages
[ { "docid": "cc03d6b57e23e7a979277bdc099babf9", "score": "0.6670548", "text": "def log_message(server, nick, target, message)\n end", "title": "" } ]
[ { "docid": "7a45887febdfb31bafbeb92fbebec69c", "score": "0.76266575", "text": "def outgoing(message)\n log(message, :outgoing, :log)\n end", "title": "" }, { "docid": "20c422b40dc88fb82a87457197dc2814", "score": "0.7406096", "text": "def log(message); end", "title": "" ...
c339d23f896c39585267b028f91f43c5
4 points Modify the previous method with the following change: grandfather_clock(str, &block) Accepts a String and a block. Calls the block, passing in the string, once for each hour that's passed today. grandfather_clock("GONGGGGGGG!") do |sound| puts sound end Output: The hour is 2 GONGGGGGGG! GONGGGGGGG! your code h...
[ { "docid": "16a753fd53c52f441c87de60b261293f", "score": "0.859803", "text": "def grandfather_clock(str, &block)\n now = Time.new\n hour = now.hour\n hour = hour - 12 if hour > 12\n puts \"The hour is #{hour}\"\n hour.times {block.call str}\nend", "title": "" } ]
[ { "docid": "6c9c3e2163f3d0ac0f6941fa13c4293f", "score": "0.8738034", "text": "def grandfather_clock(str, &block)\n now_hour = Time.new.hour\n\n if now_hour == 0\n now_hour += 12\n elsif now_hour > 12\n now_hour -= 12\n end\n\n puts \"The hour is #{now_hour}\"\n now_hour.times do\n block.c...
ed23a60d19d1d8e3a8317022da97f57c
Returns a 2D array of all documents in the collection And all tokens of the documents
[ { "docid": "b5fa463f944cce65cd309b6e7bcc9496", "score": "0.79816145", "text": "def tokenize_documents\r\n\t\tdocuments = []\r\n\t\t@collection.each do |document|\r\n\t\t\tdocument = TfIdf::Document.new(document)\r\n\t\t\tdocuments.push(document.tokens)\r\n\t\tend\r\n\t\treturn documents\r\n\tend", "...
[ { "docid": "111ffa6d9f341ed441a58de928f02b3f", "score": "0.81603014", "text": "def tokenize_documents\r\n\t\t# An array to store all tokenized documents\r\n\t\t@documents = Array.new\r\n\t\t@collection.each do |document|\r\n\t\t\t# An object of the sub-document in the collection\r\n\t\t\t@document = TfI...
197d89c178dc7f36aaa84b2d49b2e499
GET /serach_words/new GET /serach_words/new.json
[ { "docid": "0bc0d061102a08fb3b7e20e82ea3ad65", "score": "0.77339476", "text": "def new\n @serach_word = SerachWord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @serach_word }\n end\n end", "title": "" } ]
[ { "docid": "0fa3f89bd06127b3509883b96c7c1af5", "score": "0.7502496", "text": "def new\n @word = Word.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @word }\n end\n end", "title": "" }, { "docid": "0fa3f89bd06127b3509883b96c7c1af5"...
536eec09c8d89a530cad6c37ef0b185f
this method contacts the API server to gather all the required information for the video page. info is put into member variables that are accessed by the layout and template
[ { "docid": "6f6e13a772924505057b0a5ceaf7cd59", "score": "0.64647603", "text": "def show\n @seo_video = true # let app header know this is an seo page\n # Consider errors and render seovideo page\n @auth_failure = params[:auth_failure] == '1'\n @auth_strategy = params[:auth_strategy]\n @a...
[ { "docid": "58f1d1f68c18c4501a42654ed8e6b6d7", "score": "0.6721148", "text": "def show\n @video = Video.find_by_permalink(params[:id])\n \n previous_video = Video.previous(@video)\n if previous_video.empty?\n @previous = Video.last.permalink\n else\n @previous = previous_video.p...
c9e7c54413e264e2fb15f9b273b4b2ca
Returns new Map builded from hash
[ { "docid": "8cc739e0b8754a13ca174621b395a1ca", "score": "0.0", "text": "def map(hash_ = nil, **hash__)\n hash_ = hash__ if hash_.nil?\n _hash_to_object(hash_, newObject('Map'))\n end", "title": "" } ]
[ { "docid": "6df2798bb0d979d20214799349c70202", "score": "0.6794376", "text": "def to_h\n\t\t@hash.dup\n\tend", "title": "" }, { "docid": "6df2798bb0d979d20214799349c70202", "score": "0.6794376", "text": "def to_h\n\t\t@hash.dup\n\tend", "title": "" }, { "docid": "a4d099a6...
ce1c53845a6e35e27d660f552cef4469
`Renderermethod_missing(name, args, &block)` Implement Ruby 'magic' method to allow access to `data` properties by using a dot notation. If backing `data` doesn't include a value for method `name` invoke `super`.
[ { "docid": "4a58ffc490d4633042a42bf76450d3e4", "score": "0.5716112", "text": "def method_missing(name, *args, &block)\n if args.size == 0 && block.nil? && (@data.include?(name.to_s) || @data.include?(name.to_sym))\n @data[name.to_s] || @data[name.to_sym]\n else\n super\n end...
[ { "docid": "337efa8119e023158ccaab4c750cf1a7", "score": "0.7201708", "text": "def method_missing(method, *args)\n data.send(method, *args)\n end", "title": "" }, { "docid": "0e36e2585a1ac864a4d3d40414518c8e", "score": "0.71341246", "text": "def method_missing(name, *args, &block)...
a7338e134df884a353efabc04a2e7569
Copy the settings from source index to destination index and wait for the task to complete
[ { "docid": "c74aa8e07e3074ab9d474e30910cdbf3", "score": "0.6499571", "text": "def copy_settings!(src_index_name, dest_index_name, opts = {})\n request_options = symbolize_hash(opts)\n request_options[:scope] = ['settings']\n copy_index!(src_index_name, dest_index_name, reque...
[ { "docid": "48cc953445b13671d65bef757de4474c", "score": "0.655833", "text": "def copy_index!(src_index_name, dest_index_name, opts = {})\n response = copy_index(src_index_name, dest_index_name, opts)\n\n response.wait(opts)\n end", "title": "" }, { "docid": "fc2c689afd...
e67310e028583d985203689ce9aae461
DELETE /events/1 DELETE /events/1.xml
[ { "docid": "2e63c59890fa188cc0462c07702f1745", "score": "0.0", "text": "def destroy\n unless @event = Event.find(params[:id])\n flash[:failure] = \"Couldn't find event: #{params[:id]}\"\n return redirect_to(manage_events_path)\n end\n\n @event.destroy\n flash[:success] = \"Destroye...
[ { "docid": "ec97fe041915de0db875875b05c1d323", "score": "0.7211856", "text": "def destroy\n @event1 = Event1.find(params[:id])\n @event1.destroy\n\n respond_to do |format|\n format.html { redirect_to(event1s_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { ...
b9ca817db656c1a5d4b924a8a578433e
POST /email_types POST /email_types.xml
[ { "docid": "7d41610211f43bd5ad5b5fbcba8081cb", "score": "0.6379059", "text": "def create\n @email_type = EmailType.new(params[:email_type])\n\n respond_to do |format|\n if @email_type.save\n format.html { redirect_to(@email_type, :notice => 'Email type was successfully created.') }\n ...
[ { "docid": "2f78b9efa5b922748b64014cb7f1ab3d", "score": "0.645237", "text": "def sell_payment_types_create (email, params={})\r\n url = api_url \"/sell/payment_types​/new\"\r\n load = MultiJson.dump email: email\r\n req = request_params(params)\r\n\r\n feed_or_retry do\r\n Res...
64210c56a0f6356f4a15100f36d39975
This method takes in two parameters, an Array and a String and adds that string to the front of the array using the .unshift method.
[ { "docid": "e1a795615a643ec2bbc5773c24571b3a", "score": "0.9005965", "text": "def using_unshift(array,string)\n array.unshift(string)\nend", "title": "" } ]
[ { "docid": "823325119e516b92c2da8c70bd0de23e", "score": "0.9144749", "text": "def using_unshift (array,str)\n\tarray.unshift (str)\nend", "title": "" }, { "docid": "8ceaa36fa559e228bb2f7b1af1f1bb6d", "score": "0.9021038", "text": "def using_unshift(array, string)\n array.unshift(str...
5063eeb858a0ed957b0a1d503d70c3f7
POST /action_custom_factors POST /action_custom_factors.xml
[ { "docid": "cb7d6606c8246d2c00eb0e8074511592", "score": "0.6936649", "text": "def create\n @action_custom_factor = ActionCustomFactor.new(params[:action_custom_factor])\n\n respond_to do |format|\n if @action_custom_factor.save\n format.html { redirect_to(@action_custom_factor, :notice...
[ { "docid": "1ead2627d181452bb8ca5ffa05efd2a8", "score": "0.62615675", "text": "def new\n @action_custom_factor = ActionCustomFactor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @action_custom_factor }\n end\n end", "title": "" }, ...