query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
cf989b12a7005d1022a0749b1ef1a063
PUT /fabricantes/1 PUT /fabricantes/1.json
[ { "docid": "984c51b5a0d5d9aed9f0db63025f467c", "score": "0.701234", "text": "def update\n @fabricante = Fabricante.find(params[:id])\n\n respond_to do |format|\n if @fabricante.update_attributes(params[:fabricante])\n format.html { redirect_to @fabricante, notice: 'Fabricante was succe...
[ { "docid": "3cdef8c567479727871f990b868f2632", "score": "0.6897189", "text": "def update\n respond_to do |format|\n if @fabricante.update(fabricante_params)\n format.html { redirect_to @fabricante, notice: 'Fabricante was successfully updated.' }\n format.json { render :show, statu...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "2092bcf9331fdfe6473a3af811f5b751", "score": "0.0", "text": "def set_video\n @video = Video.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;...
b7315118b1db0821a55b946e75d024ef
Sets the isSealed property value. Specifies whether the column can be changed.
[ { "docid": "30133c380f2304aa6d0025eef16f9dcd", "score": "0.74595916", "text": "def is_sealed=(value)\n @is_sealed = value\n end", "title": "" } ]
[ { "docid": "857800e980bccba90f55c7d192e66739", "score": "0.67172027", "text": "def sealed=(value)\n @sealed = value\n end", "title": "" }, { "docid": "de208ee29d3c49f3b81467a73f4a31e9", "score": "0.6451217", "text": "def is_sealed\n return @is...
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "e01833fdca4f0db1f88be40f0eb10c79", "score": "0.0", "text": "def provider_params\n pp = params.require(:provider).permit(:unity, :value, :company, :adress, :state, :phone, :email, :website, :contact, :remark, :description, :status, :quotation_date)\n pp[:state] = params[:provider][:...
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74768823", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.71700543", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist...
a5dff7643416c833ce612d88c05f7081
POST /api/v2/usergroup Create a specific user group
[ { "docid": "a2840cb3c1ad58edabf7acf9b18aee68", "score": "0.0", "text": "def create(body)\n raise ArgumentError unless body.is_a?(Hash)\n\n api.post('', body, 'application/json')\n end", "title": "" } ]
[ { "docid": "6eed2b945d2fb94222ad0c68c64cfbc4", "score": "0.8413455", "text": "def create\n @user.create_group!(new_group_params[:group_user_ids], {name: new_group_params[:name]})\n end", "title": "" }, { "docid": "5df3e1d49bf16fdf51e3884a50bba1e3", "score": "0.81003666", "text": ...
b05e87114c8f727d5bad4625221caf87
compares current guess to previous guess
[ { "docid": "b2b642ba1c17a099cfcef6deb1caa1b0", "score": "0.79707074", "text": "def compare_guess(guess)\n # If previous guess exists, compare it to current guess\n # otherwise, set previous guess to current guess\n if previous_guess \n if match?(previous_guess, guess)\n # if it matc...
[ { "docid": "959ab5b1bcf88e17ecc7785794d1250e", "score": "0.7206256", "text": "def compare\n puts \"Make your first guess\"\n @previous_guess = self.prompt \n @board[@previous_guess].reveal\n @board.render \n puts\n\n puts \"Guess a different position\" \n ...
cc83535972e4eb7b3280ff1d1d47a9cc
send a signup email to the user, pass in the user object that contains the user's email address
[ { "docid": "7646da6e192fbaec6fdc59cf1263528a", "score": "0.8287957", "text": "def send_signup_email(user)\n @user = user\n mail(\n to: @user.email,\n subject: 'Thanks for signing up for our amazing app'\n )\n end", "title": "" } ]
[ { "docid": "8a17e19fcf5f535db4bb43c3900d2145", "score": "0.85454667", "text": "def signup_email(user)\n @user = user\n mail(to: @user.email, subject: 'Thanks for signing up for our amazing app')\n end", "title": "" }, { "docid": "9ed7cfc072d96431240fab52612b34de", "score": "0.8514...
e94fd3344327430fbb457614c7904153
O(h) time and O(1) space => h: height of the three
[ { "docid": "c9429fa9f6cae4028aa653c3cdf9e63b", "score": "0.0", "text": "def find_second_largest(root_node)\n current_node = root_node\n\n if !current_node || (!current_node.left && !current_node.right)\n raise \"We need at least two nodes.\"\n end\n\n while current_node\n if current_node.left ...
[ { "docid": "33714533e044657e54e652af88dc036a", "score": "0.63279325", "text": "def solution(h)\n\n\tstack = []\n\tmax_wall_height = 0\n\tstones_count = 0\n\n\t# loop over H\n\t(0..(h.length-1)).each do |i|\n\t if stack.length > 0 && max_wall_height == h[i]\n\t next\n\t\telsif stack.length > 0 && max...
e59db4c61e8319e61a340d45c18d8e27
Persists products and tags to the database
[ { "docid": "5589f02d5ecb5324d5795f0ae16028cc", "score": "0.72973835", "text": "def save_products_and_tags(product_pages)\n # We get multiple product pages, each of them have products\n\tif !product_pages.empty?\n\t\t\tproduct_pages.each do |product_page|\n\t\t\t\tproduct_page[\"products\"].each do |pro...
[ { "docid": "8723c6f312796e3d6aaef844481caf39", "score": "0.71227944", "text": "def save_product(product)\n \tproduct.save\n end", "title": "" }, { "docid": "a443ce35629c96d5519e1dd0dca76b95", "score": "0.6895331", "text": "def save\n \t# Persist the instance of a Product\n \ttrue...
8017e981eeda03614882df0f8cc85985
NOTE: earlier print_border was called only once in constructor, but when + a window is resized, and destroyed, then this was never called again, so the + border would not be seen in splitpane unless the width coincided exactly with + what is calculated in divider_location.
[ { "docid": "80f5fb360df1a3b83a906495b1fc3456", "score": "0.0", "text": "def paint #:nodoc:\n \n $log.debug \"XXX TEXTVIEW PAINT HAPPENING #{@current_index} \"\n #@left_margin ||= @row_selected_symbol.length\n @left_margin = 0\n @fieldbgcolor ||= get_color($datacolor,@bgcolor, 'cy...
[ { "docid": "6dca32bf3c6430e44aaa86247530ff5c", "score": "0.6408306", "text": "def border!\n @win.box(@vborder, @hborder)\n end", "title": "" }, { "docid": "336f6baa53f46686d90682ec40b24e5f", "score": "0.63727915", "text": "def OLDprint_borders #:nodoc:\n raise \"#{self.c...
c8ba267a244a6f0444278e3e5dccd17d
TODO move to zhdict
[ { "docid": "a6c7995e515be0f2c4627d9665270235", "score": "0.0", "text": "def slices_front_to_back\n slices = []\n idx = 0\n last = length - 1\n\n while idx <= last\n str = self[idx..-1]\n slices << str\n\n idx += 1\n end\n\n slices\n end", "title": "" } ]
[ { "docid": "46dd3225842620c571acfcf9f51c5e8b", "score": "0.6600806", "text": "def translations_hash; end", "title": "" }, { "docid": "acbf5c54df2092d985749a80b2098ac0", "score": "0.60940343", "text": "def browse_hash(h, curyaml)\n result = nil\n if h.is_a? Hash\n h.keys.each do ...
441a191d2760615a246b8bff956635e3
DELETE /driver_applications/1 DELETE /driver_applications/1.json
[ { "docid": "ad73c88dad662c6812fba3dfd8c69ae4", "score": "0.73549885", "text": "def destroy\n @driver_application.destroy\n respond_to do |format|\n format.html { redirect_to driver_applications_url, notice: 'Driver application was successfully destroyed.' }\n format.json { head :no_conte...
[ { "docid": "f35cfd6b358f2131ff1263972a0e6bdb", "score": "0.74388176", "text": "def destroy\n @client.app_destroy(params[:id])\n\n respond_to do |format|\n format.html { redirect_to apps_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6589...
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": "8b686e3e2249ab676cb2e4a094edddad", "score": "0.0", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = FinalizeOAuthResultSet.new(resp)\n return results\n end", "title": "" } ]
[ { "docid": "ea872306361fc864408e8279b0199bbe", "score": "0.75927764", "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....
cf4373cdeca76531df93146e18790d99
Collect process ID, name and arguments to notify the host agent.
[ { "docid": "4a8881a3beaeaf0f6b9c492d39294481", "score": "0.0", "text": "def announce_sensor\n unless @discovered\n ::Instana.logger.debug(\"#{__method__} called but discovery hasn't run yet!\")\n return false\n end\n\n # Always re-collect process info before announce in case...
[ { "docid": "a252cafea5f08bcc5eff4815e025f287", "score": "0.5829262", "text": "def messagified parameters\n %Q{#{[Process.pid, parameters]};;;}\n end", "title": "" }, { "docid": "4754f5145ed50f2c626d3cd8d1ee257a", "score": "0.56001014", "text": "def extract_process_spawn_arguments...
d758d02aecadd1e130731f20875b7636
take a screenshot png, save to ./screenshots/.png if no file name given, use time stamp as file name example: take_screenshot "a.png"
[ { "docid": "af1a9af0b38ac90df841fb651f2adc62", "score": "0.80427265", "text": "def take_screenshot(file_name=nil)\n # make sure screenshots folder exists\n FileUtils.mkdir_p './screenshots'\n\n # if file name given, use time stamp\n if file_name.nil?\n file_name = Time.now.strftime(\"%Y-%m-%d_%H-...
[ { "docid": "07abe6821d36b3d233b3a82e2031e13e", "score": "0.76834387", "text": "def screenshot(driver,sess_time,shot_num,descr)\n filename = \"shot-#{shot_num}-#{driver.current_url.sub(\"http://\",\"\").sub(\"admin:123@\",\"\").gsub(\"/\",\"-\")}-(#{descr})-#{sess_time}.png\"\n # driver.save_screen...
db47e801d921c7ae96d426dc6aa48bb5
Create a new WuParty object
[ { "docid": "716b503e942806e26f60b9121cb16d61", "score": "0.0", "text": "def initialize(account, api_key, domain: 'wufoo.com', account_prefix: nil)\n @account = account\n @api_key = api_key\n @domain = domain\n @account_prefix = account_prefix || @account\n @field_numbers = {}\n end", ...
[ { "docid": "120c97fef50d64dacde85156f03d2b05", "score": "0.6569517", "text": "def create_new_party\n # No language choice => default language\n if LANGUAGE_CHOICE_LIST.empty?\n $pokemon_party = PFM::Pokemon_Party.new(false, DEFAULT_GAME_LANGUAGE)\n else\n @all_window.each { ...
96753bef48f67620a4474bc168bdf895
private :store_mso_sp_container _store_mso_spgr() Write the Escher Spgr record that is part of MSODRAWING.
[ { "docid": "e572637dc41ee7f20a811fefad6d27b2", "score": "0.76141375", "text": "def store_mso_spgr #:nodoc:\n type = 0xF009\n version = 1\n instance = 0\n data = [0, 0, 0, 0].pack(\"VVVV\")\n length = 16\n\n return add_mso_generic(type, version, instance, dat...
[ { "docid": "918ad2f72068ec87569a4cc0be403fe2", "score": "0.6897953", "text": "def store_mso_dg(instance, num_shapes, max_spid) #:nodoc:\n type = 0xF008\n version = 0\n data = ''\n length = 8\n data = [num_shapes, max_spid].pack(\"VV\")\n\n return add_mso...
af6bd9d97b0e33dd43959acbff841f87
Indexes the document keywords
[ { "docid": "daba332cd8dd5729bd691a43dc8503df", "score": "0.8014922", "text": "def index_keywords!\n update_attribute(:_keywords, set_keywords)\n end", "title": "" } ]
[ { "docid": "137f857b3a54ec9eb0037d78108b0105", "score": "0.8398019", "text": "def index_keywords!\n all.each { |d| d.index_keywords! ? MongoidSearch::Log.green(\".\") : MongoidSearch::Log.red(\"F\") }\n end", "title": "" }, { "docid": "aa9e994e0a26d25a180e7f86aad67a69", "score": ...
6cdfd91c020d4ebc9807033ec7cb485a
Initialize the hook specifier.
[ { "docid": "22915e58e0e2faf4d5a39b937bc8139b", "score": "0.0", "text": "def initialize(object_name, method_prefix, method_name)\n @object_name = object_name\n @method_prefix = normalize_method_prefix(method_prefix)\n @method_name = method_name\n end", "title": "" } ]
[ { "docid": "433f67080373238853b82190661a3758", "score": "0.75625247", "text": "def initialize(hook)\n @hook = hook\n end", "title": "" }, { "docid": "3ca1beb60ea17929363d81f4df6b2b2d", "score": "0.75267446", "text": "def initialize_hook\n end", "title": "" }, { ...
8be97813af2ca66a7102b06e06547f9e
get thumbnail url for preview image of video
[ { "docid": "3c66a29f339fbfa1537e05d32a460527", "score": "0.7548195", "text": "def thumb_url\n # first see if we have a cached thumbnail\n if thumbnail_url\n return thumbnail_url\n else\n Rails.logger.debug(\"embed_url: #{embed_url}\")\n if self.youtube?\n thumbnail_url = \...
[ { "docid": "aa91e8f2467d6190df8c9b4f13df0e57", "score": "0.8065424", "text": "def thumbnail_url\n media_file(7).try(:media_file_link)\n end", "title": "" }, { "docid": "b61a5bd0e8e9044c07b9b27ac455fefc", "score": "0.7915892", "text": "def thumbnail_video(talk)\n video = ta...
c1301230d4113364bb84383c6de80b8c
Modifies a value if the cas key matches the cas key stored
[ { "docid": "3cc3920fc8b515f4f653c3f2702364d4", "score": "0.7052565", "text": "def cas(key, value, flag, expiration_time, bytes, cas)\n if @values.key? key\n case @values.get(key).cas\n when nil\n return Output::EXISTS\n when cas\n new_value = Value.new(value, flag, expira...
[ { "docid": "9705188dce108b50a72a14e472d29a46", "score": "0.6854066", "text": "def cas(key, flags, exptime, bytes, cas, data)\n @storage.purge_key(key) if @storage.key_is_expired(key)\n item = @storage.get(key)\n if !item.nil?\n if cas == item[4]\n set(key, flags, exptime, bytes, dat...
9024de553dfa268a3abc834952cca74e
Sets Default Token, stored as a class varible, so aviable accross threads.
[ { "docid": "0f35753e7ddaffc5c79def33fc2ca852", "score": "0.8269544", "text": "def default_token= value\n @@default_token = value\n end", "title": "" } ]
[ { "docid": "07e821cda6b7d64c4c68fe4542ea2fdd", "score": "0.7543217", "text": "def default_token\n @@default_token\n end", "title": "" }, { "docid": "57b49342cb9bcd51385332d8044bbb4b", "score": "0.6766108", "text": "def default_token\n self.admin_token || self.guest_tok...
053c600422f8f80ebedb2016e052cca3
New Method Create Header Window
[ { "docid": "57d6afa870914f2fe0744cf622df67a7", "score": "0.83770555", "text": "def create_header_window(text)\n @header_window = Window_MenuHeader.new(text)\n end", "title": "" } ]
[ { "docid": "518bb0c4d8e5d8629342b29d16e01d48", "score": "0.9246228", "text": "def create_header_window\n end", "title": "" }, { "docid": "3b5581b0902572cc04aeaa58fc84626d", "score": "0.84648985", "text": "def create_header_window\n @header_window = Window_MenuHeader.new(Vocab::SA...
9b1ac610d295f9307b7c35bdf0b7fae9
Gets the subscriptionId property value. Identifier of the Azure subscription for the logic app.
[ { "docid": "b6471cd1eb686915c9bf19c98d37f5d8", "score": "0.77809113", "text": "def subscription_id\n return @subscription_id\n end", "title": "" } ]
[ { "docid": "ab7a44ad343e122c82067b876c6b380d", "score": "0.80617875", "text": "def subscription_id\n ENV['AZURE_SUBSCRIPTION_ID']\n end", "title": "" }, { "docid": "87c73541eda973564d03a4a0dcfdab11", "score": "0.77603847", "text": "def azure_subscription_id\n ...
de24dbaba6b15555b15964bdd092a0d2
Return an Innodb::RecordDescriber object describing records for a given index by table name and index name.
[ { "docid": "19fa41131c4a1dc28cd6cfbad3f9a74f", "score": "0.7183611", "text": "def record_describer_by_index_name(table_name, index_name)\n if data_dictionary_index?(table_name, index_name)\n return data_dictionary_index_describer(table_name, index_name)\n end\n\n unless index = index_by_na...
[ { "docid": "949fe297824e1d70b86bbaf46b60b672", "score": "0.71073294", "text": "def record_describer_by_index_name(table_name, index_name)\n return data_dictionary_index_describer(table_name, index_name) if data_dictionary_index?(table_name, index_name)\n\n unless (index = index_by_name(table_n...
c5c5fd1e4b21072e72d156f05b071ce6
GET /telas GET /telas.json
[ { "docid": "eba9c0965dd15be7c63bd4894c9459a6", "score": "0.71414214", "text": "def index\n @telas = Tela.all\n end", "title": "" } ]
[ { "docid": "f5c923dab4affd41cf4331347db049b2", "score": "0.7040078", "text": "def index\n @tenures = Tenure.all\n render json: @tenures\n end", "title": "" }, { "docid": "58300dfe5a96e6ec25997320970f5526", "score": "0.7014175", "text": "def index\r\n @telas = Profile::Tela....
9b7c3a17844d16330194acffc05cdea8
Helper method to add target="_parent" to all external links in _file_ html.
[ { "docid": "140aa5273ae22cdaf389ce47ada608bd", "score": "0.7721696", "text": "def add_href_parent(file)\n lines = IO.readlines(file).collect do |line|\n if line =~ /(href=(?:'|\")https?:\\/\\/)/\n \"#{$`}target=\\\"_parent\\\" #{$1}#{$'}\"\n else\n line\n end\n end\n File.open(file...
[ { "docid": "4fb9e490325686cd2a57256c13e9f2a0", "score": "0.62673056", "text": "def frame_link(content)\n content.gsub(%r{<a href=\"http://[^>]*>}).each do |tag|\n a_tag, rest = tag.split(' ', 2)\n rest.gsub!(/target=\"[^\"]*\"/, '')\n a_tag + ' target=\"_top\" ' + rest\n end\n end"...
f3a3185cf8137c3dee2899c1c8485c0c
Load all fixtures from json file
[ { "docid": "e18bce8acd43d49a6a05575b46f1a8e5", "score": "0.0", "text": "def load!\n cleanup!\n\n data.each do |database_data|\n database = connection.db(database_data[\"name\"])\n\n (database_data[\"collections\"] || []).each do |collection_data|\n collection = database.create_col...
[ { "docid": "0f2f96c8457c957feefda71eabc8c223", "score": "0.7618074", "text": "def load_json(filename)\n File.read(File.dirname(__FILE__)+\"/fixtures/#{filename}.json\")\nend", "title": "" }, { "docid": "a9ea0a5ef6047630f8f265e0cd23ef2b", "score": "0.74847776", "text": "def load_json...
54080ef604a9f1c751365398a830f7f7
DELETE /user_requirement_items/1 DELETE /user_requirement_items/1.json
[ { "docid": "3fe48a2e0939ef108b5b8494bcef531b", "score": "0.8069194", "text": "def destroy\n \n @user_requirement_item.destroy\n respond_to do |format|\n format.html { redirect_to user_requirement_items_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "e5fdcf5465b42f6462a8a28e67d20656", "score": "0.75118655", "text": "def destroy \n @user_requirement = UserRequirement.find(params[:id]) \n @user_requirement.delete\n end", "title": "" }, { "docid": "089ebd3db99c0c001f24f8a616c019d3", "score": "0.6939414", "text":...
d09b4c4f6d95c2791a0e1d63bffe3dd4
Determines the winner character
[ { "docid": "3973b931e20b468a26fd6b298807b2c9", "score": "0.72232836", "text": "def winner\n token = nil\n if won? != nil\n win_combo = won?\n token = @board[win_combo[0]]\n end\n token\n end", "title": "" } ]
[ { "docid": "f629c017932009ca2bef510124ccce8c", "score": "0.8240809", "text": "def winner\n win_char = nil\n if won? != false\n win_char = @board[won?[0]]\n end\n return win_char\n end", "title": "" }, { "docid": "4a8bd3c5a4a3e28929d2587922d403a1", "score": "0.81630576",...
cc73e375219a9ea7db696a84773c8148
GET /frames GET /frames.json
[ { "docid": "c1c6fb2b69554b4ebf584f9b65cf3465", "score": "0.64505064", "text": "def index\n @frames = Frame.all\n if params[:frame_number]\n session[:frame_number] = params[:frame_number]\n end\n if params[:player_id]\n session[:player_id] = params[:player_id]\n end\n @player ...
[ { "docid": "56e4132e8c737e83551f3d89ce4de5b5", "score": "0.75537974", "text": "def frame\n @frame = @player.getCurrentFrame(@player.frames)\n json_response(@frame)\n end", "title": "" }, { "docid": "e786becaa6cec827ff1e6c3159567ef5", "score": "0.67564654", "text": "def get_fra...
439815871496114415d6ab941d20edfb
searchable do text :title end
[ { "docid": "f6ac21dde4f192eec2183cb3d3067bdd", "score": "0.0", "text": "def initialize(hash)\n @id = hash[\"id\"]\n @isbn = hash[\"isbn\"]\n @book_id = hash[\"book_id\"]\n @author = hash[\"author\"]\n @edition_num = hash[\"edition\"]\n @publisher = hash[\"publisher\"]\n @cover = has...
[ { "docid": "4a20f5df6aef7cac0b59accdb7f20f13", "score": "0.83737963", "text": "def searchtitle\n end", "title": "" }, { "docid": "1ab24267a437ceec78bec52f400a3c6e", "score": "0.78327376", "text": "def search_name_field\n \"title\"\n end", "title": "" }, { "docid": "7...
316454263c589444d3354c0443f8fcf7
failed attempt at 4th method def printer(attendees) puts batch_badge_creator(attendees) puts assign_rooms(attendees)
[ { "docid": "feffc060c9c539af8c03fd646d398ac8", "score": "0.87077624", "text": "def printer(attendees)\n batch_badge_creator(attendees).each do |id|\n puts id\nend\nassign_rooms(attendees).each do |id|\n puts id\nend\nend", "title": "" } ]
[ { "docid": "57044a1df4d0328d394e2a78a76ca032", "score": "0.91868883", "text": "def printer(attendees)\n batch_badge_creator(attendees).each { |x| puts x}\n assign_rooms(attendees).each { |x| puts x}\nend", "title": "" }, { "docid": "e20c91130d9e740bdf02e45aaa4bee01", "score": "0.91...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "b55bb0bcca931a39440a4c6a998be283", "score": "0.0", "text": "def set_order\n @order = Order.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.6031952", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6015048", "text": "def...
099e5783cff6c3a95cf4f0a87647ee00
Get all the members in a set.
[ { "docid": "dd125578b733014df847d54b1ef3059a", "score": "0.5287472", "text": "def smembers(key)\n node_for(key).smembers(key)\n end", "title": "" } ]
[ { "docid": "8cbb76120eac6de7e626dae152a33f11", "score": "0.6899141", "text": "def get_all(*names)\n set = Set.new\n names.each { |name| set.merge(get(name)) }\n set\n end", "title": "" }, { "docid": "c6c18db4877c6f08868ba33fa2b01c91", "score": "0.65655404", "text": "def mem...
72973fddb0d43724093f3326f0aef51f
GET /clients/1 GET /clients/1.json
[ { "docid": "fdc8808b9b8dd83ceb14324653aaf92d", "score": "0.7010252", "text": "def show\n @client = Client.find(params[:id])\n @contracts = Contract.where(:client_id => @client.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @client }\n e...
[ { "docid": "11367d36e4c90c8a0de89176b3b870a4", "score": "0.77168196", "text": "def index\n @clients = current_user.clients\n render json: @clients\n end", "title": "" }, { "docid": "c08f08851a4c0ff67e672bffd88bc989", "score": "0.7693582", "text": "def show\n client = Client...
d9353d7a0d79231856b5d4cd2e3204b5
Get the vector offset
[ { "docid": "13564fc6f084fffae7da9035483c1171", "score": "0.0", "text": "def offset\n if (@_buffer.offset + fbe_offset + fbe_size) > @_buffer.size\n return 0\n end\n\n read_uint32(fbe_offset)\n end", "title": "" } ]
[ { "docid": "8986b4fe37b75577257fe5a503d74e60", "score": "0.8228183", "text": "def offset(vector)\r\n end", "title": "" }, { "docid": "a7c81a3a4c930b4fd918f44c8f38a8d7", "score": "0.7518151", "text": "def offset(vector, length = vector.length)\n end", "title": "" }, { "d...
37e72875f604d078d518471e482749d7
Updates X, Y, Z coords
[ { "docid": "7d613528e3720545ed931d3a6597fd86", "score": "0.72630894", "text": "def update_location\n self.x = screen_x unless self.disposed?\n self.y = screen_y unless self.disposed?\n self.z = screen_z unless self.disposed?\n end", "title": "" } ]
[ { "docid": "64b78c1b179a97917434f5220a8eabb6", "score": "0.7758333", "text": "def update!(**args)\n @x = args[:x] if args.key?(:x)\n @y = args[:y] if args.key?(:y)\n @z = args[:z] if args.key?(:z)\n end", "title": "" }, { "docid": "64b78c1b179a97917434f5220a...
dd06f441a174e4743b22f0bf8d94155b
Step 2 (relies on Steps 1) Build the dimension scope objects supported by the grain AND slices. DegeneratesAndBottomLevels.granulate('genres.name', 'media_types.name').slice('customers.country', with: 'USA')
[ { "docid": "ddc68d1b705ae5b41e046121d5ab2427", "score": "0.59197646", "text": "def setup_context_dimension_scopes(context)\n relevant_dimensions = (default_grains + context.level_ids_in_grain + @data_slice.keys).map { |x| first_element_from_id(x) }\n context.dimension_scopes = cube.build_d...
[ { "docid": "c393b6e1f307b1dc9b6da24c1c575434", "score": "0.5434347", "text": "def scope_slice offset, limit\n iscope = itemscope\n oscope, sort_key = orderingscope iscope\n oscope = oscope.order sort_key if sort_key\n oscope = oscope.includes(:entity) if %w{ rcprefs taggings }.include? iscop...
996bc57fbbe5c7d149f151039e0eb5f6
Whether or not it's not possible to send any donations to the artist.
[ { "docid": "b05a5dbd8c3e110702ca8904bb48f691", "score": "0.5776761", "text": "def undonatable\n\t\tunknown? || donatable_status.to_s == \"\"\n\tend", "title": "" } ]
[ { "docid": "d1158697c1e1b410f68b894fb7142974", "score": "0.7064202", "text": "def do_not_send?\n !self.do_not_send.blank?\n end", "title": "" }, { "docid": "83ec748ba059eaef395c10192c1c4ddb", "score": "0.6982768", "text": "def donor_can_cancel?\n !received?\n end", ...
6a92a423b93d647db0aeacda2c88b0d6
Is this message a reply?
[ { "docid": "281e79d779aa2aa406d1743ebaeb51dd", "score": "0.8884014", "text": "def reply?\n self.message_kind.to_s == REPLY\n end", "title": "" } ]
[ { "docid": "8a94d2ecd891d1ecb69812166106d745", "score": "0.85349864", "text": "def is_reply?\n @is_reply\n end", "title": "" }, { "docid": "8be98382423642f764c2caffa1f143af", "score": "0.8368662", "text": "def has_reply?\n @has_reply\n end", "title": "" ...
d3a44245223b1ce74dcb8c97845a9a18
Get MAC table for tier1 segment port Returns MAC table for a segment port
[ { "docid": "7211626d0865991c26af01c7983c465c", "score": "0.6566352", "text": "def get_tier1_segment_port_mac_table_with_http_info(tier_1_id, segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentPo...
[ { "docid": "6849e4db9d5b88da5d0f1f9b01005a47", "score": "0.7334585", "text": "def get_tier1_segment_port_mac_table(tier_1_id, segment_id, port_id, opts = {})\n data, _status_code, _headers = get_tier1_segment_port_mac_table_with_http_info(tier_1_id, segment_id, port_id, opts)\n data\n end",...
0e176973b5a443bf2be0983dc6163697
POST /liquidos POST /liquidos.json
[ { "docid": "0c3317221134ce320e856c5e77a5ed03", "score": "0.5242166", "text": "def create\n @liquido = Liquido.new(liquido_params)\n\n respond_to do |format|\n if @liquido.save\n format.html { redirect_to @liquido, notice: 'Liquido was successfully created.' }\n format.json { ren...
[ { "docid": "d7820f6384adb1a23e614ac80cb89ea4", "score": "0.6911933", "text": "def create\n @liquid = Liquid.new(liquid_params)\n\n respond_to do |format|\n if @liquid.save\n format.html { redirect_to @liquid, notice: \"Liquid was successfully created.\" }\n format.json { render ...
a6527a2ee7f77ed7a93a4b65ae76ef25
Obtain an InputSet object, used to define inputs for an execution of this Choreo.
[ { "docid": "9351dfac485b9bdd07e4c046ccf23b6a", "score": "0.0", "text": "def new_input_set()\n return ListZonesInputSet.new()\n end", "title": "" } ]
[ { "docid": "d8eb34cfc5a1e737977f7023d4849c46", "score": "0.6741255", "text": "def new_input_set()\n return CreateObjectInputSet.new()\n end", "title": "" }, { "docid": "7c0d7c433cd4eb8e36bdc3a383e9ec33", "score": "0.65807736", "text": "def new_input_set()\n return Ru...
b81d89c6a633623bf26cf9a6e5637352
Add a new Recipe options Params for creating the recipe label label for the recipe description description for the recipe compatible_with recipe compatiblity (windows or unix) script_type specify script type for windows compatible (bat, vps, powershell) Returns a hash
[ { "docid": "19ba76f0f6ac7e2112dd9a4dea540063", "score": "0.54346275", "text": "def create(options = {})\n optional = [:description,\n \t\t\t :compatible_with,\n \t\t\t :script_type\n ]\n params.required(:label).accepts(optional).validate!(options)\n response = request(:po...
[ { "docid": "4f1906c299374822a0b93913b8101fcd", "score": "0.5260635", "text": "def script_params\n params.require(:script).permit(:id, :name, :description, :definition, :long_text, :platform, :industry, :solution_type_id, :script_file, :pdf_file, :complexity, :status_id, requirements_attributes: [:id,...
88837e5a6a110f330f133a2742eda5f4
print a specific line from the text file
[ { "docid": "61516f77f5282d2aa42ba83deabfdbdc", "score": "0.6047728", "text": "def print_a_line(line_count, f)\n\tputs \"#{line_count} #{f.readline()}\"\nend", "title": "" } ]
[ { "docid": "b86b2b1768554b52505134b1763f864e", "score": "0.67655647", "text": "def print_lines(file_name)\n File.open(file_name).each_line {|line| puts \"#{line}\" if line[0..6] == 'ADVISOR'}\nend", "title": "" }, { "docid": "76bed6f3180b122f25489ef985e749c6", "score": "0.6680892", ...
a72983f5e4a63773877e7ee9559b6f3f
GET /dota/1 GET /dota/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "f69717ad7fac0613e61b4b3a3c4cd905", "score": "0.70211124", "text": "def show\n @dotacion = Dotacion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dotacion }\n end\n end", "title": "" }, { "docid": "b3b3...
cc2fa47b4cdfe2d73525b73033bbca78
Generate HTML presentation. Return a string.
[ { "docid": "67a42a2dd59df2ffb9c4c76fbde9228b", "score": "0.5752795", "text": "def to_html \n PrettyDiff::HtmlGenerator.generate_diff(chunks)\n end", "title": "" } ]
[ { "docid": "42fa9c1cf5fadbe5378cc1747265ba20", "score": "0.70919806", "text": "def to_html \n generator.generate\n end", "title": "" }, { "docid": "7ee892fe4eb23e32dad497483d7b0ad1", "score": "0.70459455", "text": "def generate_html(individual_files=false)\n return self.to_...
21001d0eae9807d52ef481a1ac8ee53b
game play inputs: dice roll, batter, catcher, pitcher outputs: play, fielder, runner rating, batter rating,
[ { "docid": "1edc3d0eb12239638752bdea1e41df7d", "score": "0.68700546", "text": "def dice_roll\n\tcase\n\twhen $dice < 500 && $pitcherHand == 'left'\n\t\t$play = play_query($batter, $dice, 'vslh', 'play').join.to_s\n\t\t$field = play_query($batter, $dice, 'vslh', 'field_vslh').join.to_s\n\twhen $dice < 50...
[ { "docid": "35b7dec6b2d4977280d0e4a386da3210", "score": "0.68441033", "text": "def round(player)\n\tinput = \"\"\n\tround_score = 0\n\tnumber_of_dice = 6\n\tuntil input == \"b\" #\tyou input b to bank your score and stop rolling\t\n\t\tputs \"#{player} rolled:\" \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t...
4b739ef62f398e907c5610c75d014032
Name of the table to be imported
[ { "docid": "08a2282eb5d41ecc0fdb0c5fd7911877", "score": "0.7111866", "text": "def table_name\n must_be_defined_in_derived_class\n end", "title": "" } ]
[ { "docid": "beec572b53c371cc83fcbb94aa196a82", "score": "0.74218565", "text": "def table_name\n self.name.split('::').last\n end", "title": "" }, { "docid": "bbdd3321c57dc9aef5273add6ad9cfd5", "score": "0.7375305", "text": "def table_name\n if qualified? && meta[:q...
b87bd2741d614635c583e3b7bb62ed03
Returns an MD5 digest representing the current set of taggable organisations. This will change if any of the Topics should change or if a new organisation is added.
[ { "docid": "630644060a124afddab6ad3fa85dd69e", "score": "0.7132797", "text": "def taggable_organisations_cache_digest\n @taggable_organisations_cache_digest ||= calculate_digest(Organisation.order(:id), \"organisations\")\n end", "title": "" } ]
[ { "docid": "274409a82a01c4748dd67c716acbdfa2", "score": "0.6763861", "text": "def taggable_worldwide_organisations_cache_digest\n @taggable_worldwide_organisations_cache_digest ||= calculate_digest(WorldwideOrganisation.order(:id), \"worldwide-organisations\")\n end", "title": "" }, { "d...
349374e290a06619cad0f3e514f97253
Returns the classes and modules that are not constants aliasing another class or module. For use by formatters only (caches its result).
[ { "docid": "7c89d99903056f3bc4a549b7027af292", "score": "0.70476156", "text": "def non_aliases\n @non_aliases ||= classes_and_modules.reject { |cm| cm.is_alias_for }\n end", "title": "" } ]
[ { "docid": "a98e287d7fcba95d098556619b9c155c", "score": "0.66485494", "text": "def boring_classes\n return [::Class, *::Class.included_modules,\n ::Module, *::Module.included_modules,\n ::Kernel, *::Kernel.included_modules,\n ::Object, *::Object.included_modules,\n ...
fae510b893c36018cf34de3b80a09302
initalize should take in a word
[ { "docid": "da77592c9e186507e3dc69ba91f7d510", "score": "0.5762381", "text": "def initialize(word)\n\t\t@word = word\n\t\t@is_over = false\n\t\t@word_array = []\n\t\t@guess_array = []\n\t\t@new_array = []\n\n\tend", "title": "" } ]
[ { "docid": "6c72347c321edcb1888b8eb9ff6bfc0a", "score": "0.71826833", "text": "def intialize(word)\n @word = word\n @guess_count = 0\n @is_over = false\n @correct_letter = 0\n @word_length = @word.length\n @word_array = \"#{@word}\".split('')\n @reused_letter = false\n end", "t...
07d18a8ccb1cead72fc6c7c1831f1c7e
2.1.3 Write a method that received N and returns an array of N items that maximizes the number of times the test a[ j] = 3
[ { "docid": "29bf192d8ed75e2b0bf545335a313a0c", "score": "0.63983077", "text": "def test_e213_get_maximized_array\n verify_method :e213_get_maximized_array,\n :with => [\n param: 3,\n predicate: Proc.new { |arr| check_min_pass_...
[ { "docid": "7486486d145945704d265f4b9c09cdf9", "score": "0.74470854", "text": "def solution(n, a)\n result = Array.new(n, 0)\n max_value = 0\n max_value_used = false\n\n a.each do |elem|\n if elem <= n\n result[elem-1] += 1\n if max_value < result[elem-1]\n max_value = result[ele...
913affd1ee508819c99f0c2072302036
Specifies whether the policy version is set as the policy's default version.
[ { "docid": "baa6a712bb01a7ba72b0dfa7181070bd", "score": "0.6678314", "text": "def is_default_version\n data.is_default_version\n end", "title": "" } ]
[ { "docid": "31951b88d76bca01a2f254263db03ac6", "score": "0.7316247", "text": "def default_version(v)\n opt(:default_version, v)\n end", "title": "" }, { "docid": "eb0a76f2044642586aa214e34e57f750", "score": "0.71720123", "text": "def default_policy=(value)\n @default_pol...
fd6a682537e9bfe9c94be86437b6b1f6
def save File.open config_file do |f|
[ { "docid": "e7229c330fd2ecfba652356af70a767f", "score": "0.0", "text": "def check_if_directory_exists\n if not File.directory? config_directory\n puts \"You, don't have a ~/.hubspot directory, creating it\\n\" \n puts \"That probably also means that you haven't run './hs-static update-deps ...
[ { "docid": "afb7bbbe6b395ec404c7a5e14ac701a8", "score": "0.81549484", "text": "def save!\n File.open @config_file, 'w' do |file|\n file.write self\n end\n end", "title": "" }, { "docid": "afb7bbbe6b395ec404c7a5e14ac701a8", "score": "0.81549484", "text": "def save!...
7339b61a6daf449b4cd8b2ad39d7dd91
gene at the supplied index value
[ { "docid": "ecba01d4b969ce63696670da8eb94e33", "score": "0.7307105", "text": "def [](index)\n genes[index]\n end", "title": "" } ]
[ { "docid": "6404af2d5e95c11f473976642cf23dfa", "score": "0.6590914", "text": "def []=(index, value)\n genes[index] = value\n end", "title": "" }, { "docid": "56019203c3cae7769b49f8c86cee88d1", "score": "0.6437992", "text": "def set_gene\n @gene = Gene.find(params[:id])\n ...
66da84866d4afd98f6ab41e8d946c692
DELETE /v1/clients/:client_id/contacts/:contact_id Destroys a contact. See:
[ { "docid": "958baeefdd37d553d2e9731442510c6b", "score": "0.0", "text": "def delete_contact(id_able, for_client: nil)\n contact_id = resolve_contact_id_from(id_able)\n client_id = resolve_client_id_from(for_client, id_able)\n if contact_id.nil? || client_id.nil?\n raise Argu...
[ { "docid": "bbcdad3b5a7d124e1a5f75023588c45c", "score": "0.85312414", "text": "def delete_contact(contact_id)\n request :delete,\n \"/v3/contacts/#{contact_id}.json\"\n end", "title": "" }, { "docid": "d46f5b89f1af2ea6c62d86c0fd461e83", "score": "0.817223", "text": "de...
363c557a7056761df9110bdcc77aef7b
prepares statement to receive children of current document if :type option is given, only documents of this type will be fetched example: mydocument.children(:type => Folder) => [,] example: mydocument.children(:exec => false).where(:name => 'test').receive(:all) options: :type an exclusive class name, which should be ...
[ { "docid": "bc775c26fd78ebf424813787ff3725e0", "score": "0.72544336", "text": "def children(options={:type => nil, :get_dataset => false, :recursive => false, :keep_cache => true, :reload => false, :preconditions => {:hidden => false}})\n return @children_cache if @children_cache and !options[:get_...
[ { "docid": "3fa46f6e815f8d860b957f44b4a8a114", "score": "0.5624423", "text": "def find_children_of_type(type, matcher = nil)\n NodeCache.find_children_of_type(self, type, matcher)\n end", "title": "" }, { "docid": "4a6ad8b6b2f3f05ab0bbf76d073c5d8a", "score": "0.54798174", "te...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "bd54b7d8277b5327505da9cb46bb127c", "score": "0.0", "text": "def job_source_params\n params.require(:job_source).permit(:name)\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"...
7e303d058bf7714a3e2f17295dc18819
Returns true if +username+ has +password+ in +SYSTEM_USER_COLLECTION+. +name+ is username, +password+ is plaintext password.
[ { "docid": "7970115cef22394325d1ad719bb35714", "score": "0.0", "text": "def authenticate(username, password)\n doc = db_command(:getnonce => 1)\n raise \"error retrieving nonce: #{doc}\" unless ok?(doc)\n nonce = doc['nonce']\n\n auth = OrderedHash.new\n auth...
[ { "docid": "4963cab4fd615fdf0be016b33512f73d", "score": "0.6740661", "text": "def authorized?(name, password)\n return false unless record = Record.where(name: name).first\n BCrypt::Password.new(record.password_hash) == password\n end", "title": "" }, { "docid": "1b8703ca94531a0...
d00a8aee8b091a884306c85626d581b3
DELETE /problemas/1 DELETE /problemas/1.json
[ { "docid": "829f5c0bf8417dc9bc64ecd7597db809", "score": "0.6945384", "text": "def destroy\n @problema.destroy\n respond_to do |format|\n format.html { redirect_to problemas_url, notice: 'Problema was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "tit...
[ { "docid": "e59c72bb233ca9ec8438620a5f70c200", "score": "0.74655133", "text": "def destroy\n @problem.destroy\n\n respond_to do |format|\n format.html { redirect_to problems_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "b5def048103495befdf49ba4...
d0b38bc336e6dc82ee262f53afaede7b
Execute the recipe with given parameters TODO: mapset PATH
[ { "docid": "2cf17194fc6f61279ecba867b7677fc3", "score": "0.5794683", "text": "def cook(grass, parameters = {})\n # grass.g.mapsets '-p'\n # current_mapset = output.lines.last.split.first\n\n # Leave planning/checking if doable to the caller; not done here:\n # unless doable? GrassCoo...
[ { "docid": "485db2885762bb18eab470f2e9765933", "score": "0.6820404", "text": "def execute_recipes!\n config = SwitchTower::Configuration.new\n config.logger.level = options[:verbose]\n config.set :password, options[:password]\n config.set :pretend, options[:pretend]\n\n ...
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "c51847084cb7aa6b4bdd7829cbb1756f", "score": "0.0", "text": "def user_params\n params.require(:user).permit(:email, :username, :password)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74768823", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.71700543", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist...
a7e116fbedd3dbed920cb25e10dc441e
Blocks with args get passed the args they expect.
[ { "docid": "b4291964eca0cd5de35682c7c44be987", "score": "0.6311097", "text": "def test_allows_explicit_calls_to__verboten_method_with_args_and_block_with_args\n block_was_called = false\n arg_passed_to_block = nil\n assert_raises(VerbotenMethodCallReachedKernel) do\n assert_that(foo).verbo...
[ { "docid": "e5d1fe7d414dfa44bcccf78c56e33a27", "score": "0.71813107", "text": "def call *args\n case @block.arity\n when 1..Infinity # Normal arguments\n raise ArgumentError,\n \"Wrong number of arguments (#{args.size.to_s} for #{@block.arity.to_s})\" unless\n args.s...
b4d1dcd90c90e01bfc9c1d01714c0704
does the HTTP HEAD request to get the image bytes for this images
[ { "docid": "74515ddbf380c5575f967da829912ab5", "score": "0.6614911", "text": "def getBytesForImage(src)\n bytes = 0\n\n begin\n link = buildImagePath(src)\n link = link.gsub(\" \", \"%20\")\n\n uri = URI.parse(link)\n req = Net::HTTP.new(uri.host, 80)\n resp = req.request_...
[ { "docid": "9f18154d6fe6eeb234c9b90cf0bbf373", "score": "0.66735697", "text": "def head\n request_method('HEAD')\n end", "title": "" }, { "docid": "e174f272dfd30e92fde36f1ad4d6fab2", "score": "0.66239595", "text": "def get_image\n @image_data = Net::HTTP.get('www.bing....
ec98dfe3ee2ccce0a3b21479070bc04f
Adds an SSH Public Key to the user. Requires authentication.
[ { "docid": "193b73319634ab6f173d48998850c009", "score": "0.64929605", "text": "def add_key(title, key)\n raise APIError, \n \"To add a key, you must be authenticated\" if @api.read_only?\n\n result = @api.post(\"/user/key/add\", :title => title, :key => key)\n return if !result[\"p...
[ { "docid": "7ce5a841171e44d9ad7663028217c5be", "score": "0.7899473", "text": "def add_public_key username, key\n public_keys_resource(username).post key\n end", "title": "" }, { "docid": "d972bb7b137f2d4f9e1023f35d7b901b", "score": "0.7748772", "text": "def add_pub_key key = ...
71747448389e70759ffc5d0892b7d7f0
PUT /quartzs/1 PUT /quartzs/1.xml
[ { "docid": "36dc21d4ea1e4a0ff8f981715eb5a1c7", "score": "0.6736742", "text": "def update\n params.permit!\n @quartz = Quartz.find(params[:id])\n\n respond_to do |format|\n if @quartz.update_attributes(params[:quartz])\n format.html { redirect_to(@quartz, :notice => 'Quartz was succe...
[ { "docid": "34a652b1da3ec2914eaa7abf9c1a8ad3", "score": "0.61312336", "text": "def create\n \n params.permit!\n @quartz = Quartz.new(params[:quartz])\n\n respond_to do |format|\n if @quartz.save\n format.html { redirect_to(@quartz, :notice => 'Quartz was successfully created.') }...
bec62c66955ef5938a43104558572f59
set up a client to talk to the Twilio REST API
[ { "docid": "3e4289ba3faf702294071dcf72f9c320", "score": "0.0", "text": "def sending_message(to, msg)\n\t begin\n\t\t @client = Twilio::REST::Client.new @account_sid, @auth_token\n\t\t data = {\n\t\t\t\t:from => \"+\" + Rails.application.secrets.from_number.to_s, \n\t\t\t\t:to => to,\n\t\t\t\t:body =>...
[ { "docid": "25955ee6ea72d4576e8fc48814e08228", "score": "0.8194519", "text": "def client\n @client ||= Twilio::REST::Client.new(ENV[\"TWILIO_SID\"], ENV[\"TWILIO_AUTH\"])\n end", "title": "" }, { "docid": "2eea26a545bcecb528d7d5a5b0c5e86c", "score": "0.81747", "text": "def twilio...
93a4370269afb57926b7c9fecb88d18f
Internal use only. Call remote method as needed. This is where all the magick comes from: it call remote method instead of the local one, exactly like it is local.
[ { "docid": "ab60ef2ead83bc36c777e11847a7daae", "score": "0.0", "text": "def method_missing(method_name, *args, &block)\n if method_name[0] == '_'\n super\n else\n @umi.invoke self, method_name, *args\n end\n end", "title": "" } ]
[ { "docid": "bd1c59a510cb8370c0e6c1a45e4164b5", "score": "0.6625211", "text": "def call *args\n @remote_method.call *args\n end", "title": "" }, { "docid": "a1ec42ac5e55ffd087357ada3938b0c4", "score": "0.6169465", "text": "def method_missing( sym, *args, &block )\n call...
c38bf84dc1af5440b5268696900e0009
Defining the initalize method. Runs when a new instance is created
[ { "docid": "61a3d51434f964e6278bfafcd29b1ba0", "score": "0.0", "text": "def initialize(user_id, balance)\n # Setting the user_id instance variable to the first value passed in when a bank account is created\n @user_id = user_id\n # Setting the balance instance variable to the second...
[ { "docid": "07beb738cd852eebdd30951e53e91f0a", "score": "0.81680894", "text": "def post_initialize\n end", "title": "" }, { "docid": "dc90d29d71dcbecfbdd1751b07b0b039", "score": "0.8102142", "text": "def init\n end", "title": "" }, { "docid": "dc90d29d71dcbecfbdd1...
23d1f542a909a53c44e92a568b4d0c4a
Convert +value+ to text, then assign. TODO unimplemented
[ { "docid": "db6381fd43df172e2ea0562f4f424f92", "score": "0.0", "text": "def text=(text)\n end", "title": "" } ]
[ { "docid": "0ab5d508e3c39b14d71e323aa6ec4269", "score": "0.806282", "text": "def text_value(value)\n value(value)\n end", "title": "" }, { "docid": "0ab5d508e3c39b14d71e323aa6ec4269", "score": "0.806282", "text": "def text_value(value)\n value(value)\n end", ...
1da51cca70fce3373400500ef5e4e900
Login helpers return the user if login was successful, false if not
[ { "docid": "f8b072c11a1c60161af45e87834bff18", "score": "0.0", "text": "def login_bob\n user = new_bob\n login_user(user, 'Bob1234!')\n end", "title": "" } ]
[ { "docid": "b684321e23d82ccd3789198f832152b4", "score": "0.8242142", "text": "def login?(user)\n if login(user)\n return true\n else\n return nil\n end\n end", "title": "" }, { "docid": "6330a1aa995f85960fe606d9fb8c23e4", "score": "0.8155618", "text": "def login\n...
8418df38279a8938aa509a50aa28fccc
Performs the actual mapping or type casting by converting an object to a string or a symbol to a mapped string
[ { "docid": "aa7dd520ac496c9082e9892120fe1f78", "score": "0.6050255", "text": "def from_type(obj)\n if !obj.nil? && type && !mapping\n send(\"dump_#{type}\", obj)\n elsif !obj.nil? && mapping && mapping.key?(obj)\n mapping[obj]\n else\n obj\n end\n ...
[ { "docid": "d5dea108bb8cd66513fba4b72b3baa6b", "score": "0.6204143", "text": "def map_string(ident, &block) ; map_primitive(:string, ident, &block) ; end", "title": "" }, { "docid": "4bf784eda4ff2f7832e73c08f524ca9e", "score": "0.60416746", "text": "def __convert(key)\n case...
df16d86b7ffdb1c2f73a61768f4c41fd
Ask for users name, if ! is included then return all caps answer. If not, then return greeting and name. Set up your test cases Describe your inputs, outputs, and data structures string that will be a name. a sentence that will greet the user depending on the input including an exclamation mark. Describe your algorithm...
[ { "docid": "6d4a5aada1c6f90d271eb9bc8c59519d", "score": "0.7363267", "text": "def greeting_user(name)\n name.include?('!') ? puts(\"HELLO #{name.chop.upcase}. WHY ARE WE SCREAMING?\") : puts(\"Hello #{name.capitalize}\")\nend", "title": "" } ]
[ { "docid": "7a935c9d141bbc9a6e52001bf4074093", "score": "0.7853687", "text": "def greeting_user\n print \"What is your name? \"\n name = gets.chomp\n puts name.include?('!') ? \"HELLO #{name.upcase}. WHY ARE WE SCREAMING?\" : \"Hello #{name.capitalize}\"\nend", "title": "" }, { "docid": "...
3f79c78d9efca24808418720f90eac53
GET /mazemaps GET /mazemaps.json
[ { "docid": "742e212b44dfb63a370e5811718be49d", "score": "0.73171896", "text": "def index\n @mazemaps = Mazemap.all\n end", "title": "" } ]
[ { "docid": "fc3da3279974309ce1acc4887491c335", "score": "0.6138659", "text": "def index\n @maps = Map.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @maps }\n end\n end", "title": "" }, { "docid": "60ef9e3ba9a1e80305d006ccf485b6be...
44d97e6ee3c2343fdb24db53988e02ea
Pick random candidate from solution shapes. Accepts: Nothing Notes: TODO shape definitions should be added so user is able to apply this rule only to selected shapes. Returns: Random shape to which rule will be applied.
[ { "docid": "8b47cf7ccc820c150ff54b258a26227e", "score": "0.76432455", "text": "def collect_candidate_shapes\n\t\t\tif @shape_definitions.empty?\n\t\t\t\tshapes = Controller.solution_shapes\n\t\t\t\treturn shapes[rand(shapes.length)]\n\t\t\tend\n\t\tend", "title": "" } ]
[ { "docid": "5f7637ba60f42617ecbe46d27829a19f", "score": "0.62471026", "text": "def collect_candidate_shapes(all_candidates = @shape_definitions,\n\t\t\t\tdirection = nil, skip_random = false)\n\t\t\t# calculate random direction if needed, we start with x direction\n\t\t\tif direction == nil\n\t\t\t\tdir...
3766d0e59ec4215f421d6b83721981fb
Method returns the first pic.
[ { "docid": "81c8bea9c02b33773bf9273a1b83f6e7", "score": "0.73786813", "text": "def rep_image\n\t photos.first\n\tend", "title": "" } ]
[ { "docid": "bd15980a63883287a4eef1ed55ebdbdf", "score": "0.7640815", "text": "def image\n images.first\n end", "title": "" }, { "docid": "f37eec9a004f0d71a86ef38bb4ecdf15", "score": "0.7316417", "text": "def first_image_of product\n image_at_position(product, DisplayPictur...
e67c05acccd29cce0cce12a4a2bb4895
True if the given user is allowed to change or delete this survey.
[ { "docid": "f579b8b5f2fdb562e1ab959f117811a5", "score": "0.0", "text": "def can_edit?(user)\n course.can_edit? user\n end", "title": "" } ]
[ { "docid": "7b38787f2234da692fbfbe6d166e006e", "score": "0.7445014", "text": "def can_answer?(user)\n (!!user && survey.released?) || survey.can_edit?(user)\n end", "title": "" }, { "docid": "6474dcc1d142a76b97b6e2176795bfb9", "score": "0.7421124", "text": "def rbac_user_delete_r...
248bb9f0f0c65b1e7235016b563c6f7c
parse string representation of event
[ { "docid": "3ef917002f9791cfde411ddcc3caa6c0", "score": "0.5287419", "text": "def deserialize( eventdata )\n @data = YAML.load( Base64.decode64(eventdata) )\n return self\n end", "title": "" } ]
[ { "docid": "fdc7af88627e6659571b1f3bd2947b79", "score": "0.69913566", "text": "def parse_event!\n raise Dyno::MalformedInputError unless @raw.has_section?('Header')\n\n @event = Dyno::Event.new( :game => @raw['Header']['Game'] )\n @event.time = Time.parse( @raw['Header']['TimeString'] )\n...
5ebc228fc5e28285652db1e2c53e20a1
Executes the given command on the first server targetted by the current task, collects it's stdout into a string, and returns the string. The command is invoked via invoke_command.
[ { "docid": "f728fedc2942050cfb8bdaeb26254729", "score": "0.0", "text": "def capture(command, options={})\n output = \"\"\n invoke_command(command, options.merge(:once => true, :eof => !command.include?(sudo))) do |ch, stream, data|\n case stream\n when :out then o...
[ { "docid": "8e93d771e1901eb4714c6a90fe83cf5d", "score": "0.6864178", "text": "def exec(command)\n @mutex.synchronize do\n if command[0] == ?!\n exec_tasks(command[1..-1].split)\n else\n servers = connect(configuration.current_task)\n exec_command...
017e5a4016837a589e995654c276c021
Dumps the contents every model into prettyformatted JSON in the given directory. This lets us just make quick changes to the JSON structure and reimport the data (using load) directly into the database.
[ { "docid": "f89260b6fc7f51f7b3f0f97d37d7996c", "score": "0.70557874", "text": "def dump!(output_dir = MODEL_DIR)\n model_classes.each do |model_class|\n filename = \"#{ model_class.name.tableize }.#{ FILE_EXT }\".gsub(\"/\", \"-\")\n\n # Open the output file and replace its contents.\...
[ { "docid": "a03c20a68e24bac77f5306e160438ae6", "score": "0.6388451", "text": "def dump!\n MODEL_TO_OUTPUT_FILEMAPPING.each do |klass, filepath|\n write_table_to_file(klass, filepath, %w[created_at updated_at])\n end\n end", "title": "" }, { "docid": "ca4501067eaab39f46786...
ea4a70febb70942f88e676fcf6bd9e97
An array of public IP addresses for the server. They can be ipv4 or ipv6
[ { "docid": "20a3359ff2c03a61aed64f85cc88aae2", "score": "0.72074395", "text": "def public_addresses\n details['addresses']['public'].map { |i| i[\"addr\"] }\n end", "title": "" } ]
[ { "docid": "76fb8d546a10f3ae03ce389c06609eeb", "score": "0.8069705", "text": "def public_ip_addresses\n addresses = []\n if network_interfaces.respond_to? :flat_map\n addresses = network_interfaces.flat_map do |nic|\n if nic[:access_configs].respond_to? :each\n ...
f02f3ba2394f523a530416ba504f77d3
Returns the value of attribute vertical_offset. source://reline//lib/reline/line_editor.rb590
[ { "docid": "c54ab0ab070c0b2e5d972eb25a421264", "score": "0.775647", "text": "def vertical_offset; end", "title": "" } ]
[ { "docid": "70eb96cf27163dbf2e53e332c9c45dde", "score": "0.7328538", "text": "def vertical_offset=(_arg0); end", "title": "" }, { "docid": "70eb96cf27163dbf2e53e332c9c45dde", "score": "0.7328538", "text": "def vertical_offset=(_arg0); end", "title": "" }, { "docid": "653c...
5217538410ba8851ab255255f034c000
Randomly puts ships on the board.
[ { "docid": "1bdf501d6365076f263364d8e243eb4b", "score": "0.7333026", "text": "def populate_grid(count = 10)\n @number_of_ships.times do\n ship_placed = false\n until ship_placed\n random_position = random_pos\n if is_water?(random_position)\n place_ship(random_positio...
[ { "docid": "2915c6a3f754b52ece589c39754bed73", "score": "0.86177975", "text": "def place_random_ships()\n # check number on board bc random may place in same spot\n while num_ships() < (@size / 4) do\n @grid[rand(@board_length-1)][rand(@board_length-1)] = SHIP\n end\n ...
c1a44e1c09970c0ddf5a3e2ff2bd3cec
Method call for validating that a Broker instance successfully received the node
[ { "docid": "6de85b7b2c4830b7d636c34cabba7d24", "score": "0.0", "text": "def validate_hand_off(options = {})\n # Return true until we add validation\n true\n end", "title": "" } ]
[ { "docid": "0bcc6e6f6274623907ef9290eaa347a8", "score": "0.5802355", "text": "def broker_check\n unless ((Time.now - @hb_received_at) * 1_000) <= (@heartbeat_interval * @heartbeat_retries)\n @reactor.log(:warn, \"#{@klass_name}, Worker [#{@service_name}] has expiring broker, last saw a h...
95f60ec33a9f8fa918aed165222f471f
POST /statuses POST /statuses.json POST /statuses.xml
[ { "docid": "1e9131a82c5fe2ff454c84f43f5a520c", "score": "0.0", "text": "def create\n @status = Status.new(params[:status])\n @status.user = current_user\n\n respond_to do |format|\n if @status.save\n flash[:notice] = 'Status was successfully created.'\n format.html { redirect...
[ { "docid": "bd1782919e3c82d51420df4c3d5c180a", "score": "0.77089024", "text": "def post(content)\n post_to(\"/statuses/update.xml\", {:status => content})\n end", "title": "" }, { "docid": "489c0ebc678cccd84e822e177fdb11c2", "score": "0.7296776", "text": "def post(text)\n opti...
2d3f2f6291224ca401594a24c4ec21ba
GET /projects GET /projects.json
[ { "docid": "83ae75281dbf69a50d44f959f76054d5", "score": "0.71949095", "text": "def index\n @user = User.find_by_id(session[:userid])\n @projects = current_user_projects\n respond_to do |format|\n format.html # index.html.erb\n format.json\n end\n end", "title": "" } ]
[ { "docid": "723f580541bd41ab30bb2973cfdea294", "score": "0.85753775", "text": "def listprojects\n get('listprojects.json')['projects']\n end", "title": "" }, { "docid": "b2d778e1a6b6df24139d1f5864dedb0f", "score": "0.8387346", "text": "def list\n get 'projects'\n end", "t...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "724f29c4658e7c0c63d5b831f43ab231", "score": "0.0", "text": "def user_params\n attributes.permit(:email, :username, :role, :state)\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"...
0ffedde66d880bf8eda9be5eec0c6670
DELETE /barbearia/1 DELETE /barbearia/1.json
[ { "docid": "2584017585cc3820196a3a3ebfa7d942", "score": "0.66908306", "text": "def destroy\n @barbearium.destroy\n respond_to do |format|\n format.html { redirect_to barbearia_url, notice: 'Barbearium was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", ...
[ { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.72721434", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": ...
6c4e24272051d665e32a0674f2e47bc0
POST /generations POST /generations.json
[ { "docid": "785cbfbc6ffd67c70c0edec165d5fb22", "score": "0.6827705", "text": "def create\n @generation = Generation.new(generation_params)\n\n respond_to do |format|\n if @generation.save\n format.html { redirect_to ['admin', @generation], notice: 'Generación Creada' }\n format....
[ { "docid": "5695a3ae6ec4c3046970ab7efa3576c6", "score": "0.685122", "text": "def create\n @generation = Generation.new(generation_params)\n\n respond_to do |format|\n if @generation.save\n format.html { redirect_to [:admin, @generation], notice: 'Generation was successfully created.' }...
ee346da9dea389eea4ee5e5a00a63911
can update attributes such as name, email, and password reset in database; when accessing database must use authenticate? in user model
[ { "docid": "fd12464250e24931bde86720ff8787ce", "score": "0.0", "text": "def update\n @user = User.find(params[:id])\n if @user.update_attributes(user_params)\n flash[:success] = \"Profile updated\" # Handle a successful update.\n redirect_to @user #redirect to profile page\n else\n ...
[ { "docid": "6346e74254f4cc2fdce6ff218562633f", "score": "0.74360853", "text": "def update_user\n u = User.find_by_name self.code\n if !u\n User.create :name=>self.code,:email=>self.e_mail,\n :password=>'123456',:password_confirmation=>'123456'\n else\n u.update_attribute :email...
c4f321c658b5d82eaf274f5942e51dc2
POST /line_items POST /line_items.json
[ { "docid": "f2269eec1cce5a927e34718774f39dca", "score": "0.0", "text": "def create\n #stuff = Kid.find(params[:kid_id])\n kids=Kid.all\n puts params[\"Input1\"]\n kids.each do |k|\n puts k.name\n puts k.id\n if (k.name==(params[\"Input1\"]))\n @line_item = @cart.add_k...
[ { "docid": "e5ca2f3b5bf56738fc1956a808856b1f", "score": "0.80995685", "text": "def create\n @item_lines = ItemLine.new(item_line_params)\n\n if @item_lines.save\n render json: @item_lines, status: :created, location: @item_lines\n else\n render json: @item_lines.errors, status: :unpro...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "5c1f8eb5b3afb8fae07d65bb2af83d21", "score": "0.0", "text": "def set_repo\n @repo = Repo.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.6032574", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6015663", "text": "def...
d0d9193c7150c748711359f2a3c32649
GET /orcamentos GET /orcamentos.json
[ { "docid": "16882d5cb08351764bfaa29bda8d81bc", "score": "0.0", "text": "def index\n @orcamentos = Orcamento.all\n @orcamentos_grid = initialize_grid(Orcamento, \n :order => 'created_at',\n :order_direction => 'desc',\n :per_page => 10\n )\n end", "title": "" } ]
[ { "docid": "614c82f09aecf6f40de63facb9f8e87b", "score": "0.7373936", "text": "def index\n @orcamentos = Orcamento.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orcamentos }\n end\n end", "title": "" }, { "docid": "57148976f6e1...
a604a9dc3209eb8659cdd0bea0df6fb0
Creates a new instance of the JD Beacon competition.
[ { "docid": "d0e845032f44bfe5d5101d605ec05ce3", "score": "0.51340276", "text": "def initialize(competition = nil)\n\n #Create the core competition instance we're proxying.\n @competition = competition || JDBeacon::Competition.new\n\n #Create a thread object used to \n @thread ...
[ { "docid": "95de8007cd1114be097891d15f52a80c", "score": "0.60560393", "text": "def create\n @beacon = Beacon.new(params[:beacon])\n\n respond_to do |format|\n if @beacon.save\n format.html { redirect_to @beacon, notice: 'Beacon was successfully created.' }\n format.json { render...
bd2bc7540238ad411782d1bc369f421e
PUT /comparison_types/1 PUT /comparison_types/1.xml
[ { "docid": "a923a1f20a620cfc3e6ca3d0f5f52e53", "score": "0.6643297", "text": "def update\n @comparison_type = ComparisonType.find(params[:id])\n\n respond_to do |format|\n if @comparison_type.update_attributes(params[:comparison_type])\n flash[:notice] = 'ComparisonType was successfull...
[ { "docid": "c16e8da224c52c856a9283b7f7c163e0", "score": "0.5883052", "text": "def update\n @comptype = Comptype.find(params[:comptype][:id])\n\n respond_to do |format|\n if @comptype.update_attributes(params[:comptype])\n format.xml { head :ok }\n end\n end\n end", "title...
b2f0d49a0b5b0b41f608ac91f41de5dc
Odd Lists P choose every other element in the array input: => integer or strings or empty array output: => array selecting only the odd elements rules: => values should be the 1st, 3rd, 5th => array can be empty or nonempty questions: => is it a finite array or can it contain as many characters? => how to treat an empt...
[ { "docid": "4fcb46e2626e4445e1e98f776d730975", "score": "0.74006647", "text": "def oddities(array)\n count = 0\n odd_array = []\n\n loop do\n odd_array << array[count] unless array.empty?\n count += 2\n break if count > array.size - 1\n end\n\n odd_array\nend", "title": "" } ]
[ { "docid": "8336c55b530bd66ccbbc30a41519879e", "score": "0.76118135", "text": "def oddities(arr)\n return 'Invalid input' unless arr.is_a? Array\n\n odd_elements = []\n arr.each_with_index do |element, idx|\n odd_elements << element if idx.even?\n end\n odd_elements\nend", "title": "" }, ...
d14b79a5bf4d046cdde93aaa506d726b
This method displays the information about the Ruby Number Guessing Game
[ { "docid": "17a69153d1cf01d863165bf7de40ca4a", "score": "0.68653667", "text": "def display_credits\r\n\r\n Console_Screen.cls #Clear the display area\r\n\r\n #Thank the player and display game information\r\n puts \"\\t\\tThank you playing the Ruby Number Guessing Game.\\n\\n\\n\\n\"\r\n pu...
[ { "docid": "06f1032deb3ac15ba9f2f53c01a02fe7", "score": "0.79280627", "text": "def display\r\n puts \" Guesses\" + \" feedback\"\r\n puts \" _________\"\r\n for x in 0..11 do\r\n puts \"| \" + @guess[x][0].to_s + \" \" + @guess[x][1].to_s + \" \" +\r\n @guess[x][2].to_s + \" \" + ...
63488c9a4e7124ea22563ac578426df3
==== Parameters key:: The key to retrieve the parameter for. ==== Returns Object:: The value of the configuration parameter.
[ { "docid": "5109e8ce6fd358bd14280fb4665b577c", "score": "0.69710493", "text": "def [](key)\n (@configuration||={})[key]\n end", "title": "" } ]
[ { "docid": "8b57cd0c17e6fa6b865b67c22a3a1e41", "score": "0.79520893", "text": "def config key\n @config.get key\n end", "title": "" }, { "docid": "d6ee9a5d32325da0a2c9a9379b62dc6b", "score": "0.79483", "text": "def [](key)\n @config_params[key]\n end", "title": "" }...