query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
66a906023f357b16bcd57dd58d5091c8
Gets the sections property value. The sections in the section group. Readonly. Nullable.
[ { "docid": "3a220b780a0e4a73baad4ba1f60e42ef", "score": "0.7309389", "text": "def sections\n return @sections\n end", "title": "" } ]
[ { "docid": "a7e3c0f31e8853887333b70e3621aa4e", "score": "0.7417971", "text": "def sections\n @sections.values\n end", "title": "" }, { "docid": "a86a52845e450c618d17c8c884f5150f", "score": "0.71682847", "text": "def sections=(value)\n @sections = value\n ...
b7fd8c2a164f57cbde0a1b4da57c4d22
GET /author_posts/1 GET /author_posts/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "b1e37b4ad686ceaa0f270ad3b7fa286c", "score": "0.75923955", "text": "def show\n post = Post.find(params[:id])\n render json:post, include: [:author]\n end", "title": "" }, { "docid": "8238843d0b13a18fcfde5d56dced68f2", "score": "0.7298451", "text": "def index\n @a...
657d60a123c8e973be00e70703d35596
Returns true if the outputs of the task are out of date w.r.t. the inputs. Currently, does not take into account if the input is a glob and files have been added.
[ { "docid": "f803098aeba3ebe969b8d3a0b39e11b1", "score": "0.56616837", "text": "def dirty?\n\t\t\t\tif @outputs\n\t\t\t\t\t@outputs.dirty?(@inputs)\n\t\t\t\telse\n\t\t\t\t\ttrue\n\t\t\t\tend\n\t\t\tend", "title": "" } ]
[ { "docid": "57e5a7ac7837d7bdd2d61ea8878a5a52", "score": "0.66494167", "text": "def out_of_date?(stamp)\n all_prerequisite_tasks.any? { |prereq|\n prereq_task = application[prereq, @scope]\n if prereq_task.instance_of?(Rake::FileTask)\n prereq_task.timestamp > stamp || @applic...
f065df61fea273a8117a37ee9558e1b3
List servers from capistrano roles
[ { "docid": "52b8ebbd3230f9f9ea396c25fbf757cc", "score": "0.8105622", "text": "def serversForCapRoles(roles)\n find_servers(:roles => roles).collect { |x| x.host }\nend", "title": "" } ]
[ { "docid": "78f4ac6f32b587cb44a20571b9f0cbe5", "score": "0.74989325", "text": "def servers(role_list)\n @roles ||={}\n ra=[]\n if role_list && !role_list.empty?\n if role_list.class==String\n ra = role_list.split(',').collect{|r| r.to_sym}\n else\n ra=role_list\n en...
0a6ba0d3a4200b9266da47a7216275aa
If the intrflush option is enabled, when an interrupt key is pressed on the keyboard (interrupt, break, quit) all output in the tty driver queue will be flushed, giving the effect of faster response to the interrupt, but causing curses to have the wrong idea of what is on the screen. Disabling the option prevents the f...
[ { "docid": "4951d1849c14076f4024e8008aa00420", "score": "0.79493475", "text": "def intrflush(bool = false)\n Ncurses.intrflush(pointer, bool ? 1 : 0)\n end", "title": "" } ]
[ { "docid": "4a8928c4ad8b694f694c20abfd3006ca", "score": "0.6622039", "text": "def flush_input\n Ncurses.flushinp\n end", "title": "" }, { "docid": "674bfa004e5baa5d19db411e44100f40", "score": "0.6014985", "text": "def _interrupt\n\t\tbegin\n\t\t\tuser_want_abort?\n\t\trescue Inte...
b724ca343c6b7c4c4a8206661d6dab70
GET /posts GET /posts.json
[ { "docid": "221eee20077260db35081540bb4ec812", "score": "0.7295742", "text": "def index\n @posts = Post.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end", "title": "" } ]
[ { "docid": "fb578f587fdfe1b0a8d3ac27001f9611", "score": "0.7635181", "text": "def index\n render json: @posts\n end", "title": "" }, { "docid": "4e694f9f0a0313f64d4c0582953f2972", "score": "0.75439054", "text": "def show\r\n @posts = Post.find(:all)\r\n\r\n respond_to d...
e654e6c930d827169af8efde6fe86a98
prints out the current board
[ { "docid": "613edc3331c1791ceee3d9f2a846a9e7", "score": "0.0", "text": "def printBoard(board)\n\t#creates individual square\n\tdef makeSquare(value)\n\t\tif value == 0\n\t\t\treturn \"| \"\n\t\telsif value == 2048\n\t\t\treturn \"|2048!\"\n\t\telse\n\t\t\thalfSpaces = (5.0 - value.to_s.length)/2.0\n...
[ { "docid": "f30331b6c28b0c394462ed4c5eca85bb", "score": "0.9059315", "text": "def print_board\n puts\n puts \"=\" * 70\n puts\n puts \"CURRENT BOARD:\"\n puts\n puts @board_display\n puts\n end", "title": "" }, { "docid": "e6fa22bf6a8423b4bccf22010420c90...
5315bd6ae0ae7b870519188364144941
Handles the custom status command (displays status of "sonneries")
[ { "docid": "3411bb32051d5b12aae22a5e97223d52", "score": "0.70034087", "text": "def cmd_status?(cmd)\n update_sonneries\n return false unless cmd == 'status'\n\n puts <<~TXT\n La sonnerie de cours sonnera toutes les #{@sonneries[:break].bold.pink} minutes.\n L'alarme incendie...
[ { "docid": "e93c3b4d023d053cf5bc7d7fdadb82a4", "score": "0.7021599", "text": "def handle_status_command( client, * )\n\t\tstatus = { version: Assemblage::VERSION, uptime: self.uptime }\n\t\tself.queue_output_message( client.make_response(:status, status) )\n\tend", "title": "" }, { "docid": ...
12e2c260b72879addef9c1b92c81a048
include filters into the query to only include the admin_set members (regardless of status)
[ { "docid": "4d154578271a6d277a0f20798c8c4300", "score": "0.0", "text": "def in_admin_set(solr_parameters)\n solr_parameters[:fq] ||= []\n solr_parameters[:fq] << \"{!term f=#{Solrizer.solr_name(Hyrax.config.admin_set_predicate.qname.last, :symbol)}}#{blacklight_params.fetch('id')}\"\n end",...
[ { "docid": "c76c1ad73730698bb610ff7e2e495cf2", "score": "0.7080902", "text": "def conditions_for_collection\n Status.filter_condition_for_group('members', session[:filter])\n end", "title": "" }, { "docid": "1ac08ab10b16341eb343994458932449", "score": "0.7061072", "text": "def ...
1afef5eadafe6a710a39dc79786f203e
_Do not use_. Creates a new MemoryPointer from the String.
[ { "docid": "f5571b02bffc87da4fcf0a0053de045a", "score": "0.6486275", "text": "def dptr=(str)\n @dptr = FFI::MemoryPointer.from_string(str)\n self[:dptr] = @dptr\n end", "title": "" } ]
[ { "docid": "ebf8e86a702c7af27a83d44f97ebf6f1", "score": "0.7499075", "text": "def raptor_new_string(str)\n ptr = V2.raptor_alloc_memory(str.bytesize + 1)\n ptr.put_string(0, str)\n ptr\n end", "title": "" }, { "docid": "8009077304b53ff6a1575b48108592c6", "score": "0.719...
f0a19bc02d108cbbd10851f76c80f012
PUT /recipes/1 PUT /recipes/1.xml
[ { "docid": "6ce1fc3151862fef8bed795fb88770c4", "score": "0.5971813", "text": "def update\n @recipe = Recipe.find(params[:id])\n\n respond_to do |format|\n if @recipe.update_attributes((params[:recipe] || {}).merge(user_id: current_user.id))\n flash[:notice] = 'Recipe was successfully u...
[ { "docid": "9ab5381c58ce08b8f41787a71ea4d8dc", "score": "0.650334", "text": "def recipes\n @stage = current_project.stages.find(params[:id])\n if request.put?\n @stage.recipe_ids = params[:stage][:recipe_ids] rescue []\n flash[:notice] = \"Stage recipes successfully updated.\"\n red...
f71a7dd895937ecc08cfbc8cbdec6063
Allows a phone object to be reduced in confidence
[ { "docid": "50d63608822fd38dfffdb5d29a8888e7", "score": "0.0", "text": "def deleteEntityPhone( entity_id, gen_id)\n params = Hash.new\n params['entity_id'] = entity_id\n params['gen_id'] = gen_id\n return doCurl(\"delete\",\"/entity/phone\",params)\n end", "title": "" } ]
[ { "docid": "ff8fd3a2ab513594bb431fd53379a8d1", "score": "0.5568403", "text": "def normalize_phone_number\n # stretch\n end", "title": "" }, { "docid": "ff8fd3a2ab513594bb431fd53379a8d1", "score": "0.5568403", "text": "def normalize_phone_number\n # stretch\n end", "title"...
b9431a28a49945af4d474acf27820740
create a lowercase array of all the words (no empty)
[ { "docid": "742dc127c22805f372e80fa59415282b", "score": "0.72235215", "text": "def make_array\n @phrase_string.downcase.split(WORD_SPLIT).reject(&:empty?)\n end", "title": "" } ]
[ { "docid": "24835c6f7580a02a52655298b6cd3854", "score": "0.7269587", "text": "def make_word_array(input)\n input = input.upcase.split(\"\")\n return input\nend", "title": "" }, { "docid": "4cb07026a67970bc3fb4c58c6f136bcb", "score": "0.721565", "text": "def init_word_array(plaintex...
d32bc6952d77a29343635bd80741cfc6
In place version of grayscale
[ { "docid": "585f7414bea5147a872554faaf3387c2", "score": "0.666562", "text": "def grayscale!\n set(grayscale)\n end", "title": "" } ]
[ { "docid": "1aee47e72a46f19b0ccefa4c9b006e38", "score": "0.70365864", "text": "def to_grayscale\n l = luminosity\n self.class.new(l, l, l)\n end", "title": "" }, { "docid": "9c8de07ef5351c8e50e436c26bc778ca", "score": "0.69838434", "text": "def monochrome! \n\t\treturn @image ...
486802d0e0ab27a298fda6caa27c9bb3
logic for player turns
[ { "docid": "561d757d69828ba5d415bb0616bcf1ae", "score": "0.0", "text": "def get_turn\n turn = @current_player.play_turn\n return @board.validate_turn(turn)\n end", "title": "" } ]
[ { "docid": "16d500f6ea2d4a49d21e945a4ba3fa29", "score": "0.7666496", "text": "def take_turns\n @current_turn.even? ? turn(@player_o) : turn(@player_x)\n end", "title": "" }, { "docid": "8c3e4496358cc0d936934716d99b70d5", "score": "0.76065403", "text": "def player_turn\n ...
89812a8eb2437f78f49ed7ae2adfcfbe
PATCH/PUT /category_maps/1 PATCH/PUT /category_maps/1.json
[ { "docid": "e137f019339941e3a262f6d5ad92d46a", "score": "0.7460467", "text": "def update\n respond_to do |format|\n if @category_map.update(category_map_params)\n format.html { redirect_to @category_map, notice: 'Category map was successfully updated.' }\n format.json { render :sho...
[ { "docid": "64342e33d137990e24b5fa224c350bd3", "score": "0.6996288", "text": "def update\n json_update(category,category_params, Category)\n end", "title": "" }, { "docid": "b7f150a2e8c2082b13a0149f2d56959c", "score": "0.64068866", "text": "def update\n respond_to do |format|\...
178b5bc88631461e1e53d7ca5feb6038
Send a message to a batch of rooms Arguments: company: (String) params: (Hash)
[ { "docid": "acb9cf1b398785dfcf4b7a8f567a397f", "score": "0.8653344", "text": "def send_message_to_rooms(company, params = {})\n $LOG.i \"running \" + __method__.to_s\n @client.post '/messages/v3/' + company + '/stories/batch', params\n end", "title": "" } ]
[ { "docid": "623ed861ab73cb3fd7c9041024a13360", "score": "0.74911064", "text": "def send_message_to_room(company, room_id, params = {})\n $LOG.i \"running \" + __method__.to_s\n @client.post '/messages/v3/' + company + '/rooms/' + room_id + '/stories', params\n end", "title":...
9f387da3cc9c0b3a17b58618fbe61c8b
Password is required if crypted_password is blank or if the "password" virtual attribute is not blank
[ { "docid": "c20d7cd80bf64c8411d46afdee6ba7b6", "score": "0.8029803", "text": "def password_required?\n crypted_password.blank? || !password.blank?\n end", "title": "" } ]
[ { "docid": "1b44e7157189411c91e0b6f5f9dd8574", "score": "0.79599166", "text": "def password_required?\n self.encrypted_password.blank?\n end", "title": "" }, { "docid": "16438358ed740edb65cf96084c28c798", "score": "0.79250234", "text": "def password_required?\n\n crypted_passw...
60d7027d79f357af5bf15298b15349a4
Ensure that serialization of projects into URLs uses the permalink instead of database ids.
[ { "docid": "0e2f137cde7945a76a7308bd5026f535", "score": "0.5513693", "text": "def to_param\n permalink\n end", "title": "" } ]
[ { "docid": "53320f9a0852b9835bafb33e05d67ec3", "score": "0.6436442", "text": "def project_url\n id = self.id.to_s\n Rails.application.config.app_hostname + 'projects/' + id\n end", "title": "" }, { "docid": "7ea724edbf874c931760a10a13a248ff", "score": "0.64158016", "text": "de...
50654ffbb6f6f99fe3937068cdacf38c
GET /player_answers GET /player_answers.json
[ { "docid": "825d58867feaed79eccd536897f801e4", "score": "0.7167889", "text": "def index\n authorize! :read, PlayerAnswer\n @player_answers = PlayerAnswer.all\n end", "title": "" } ]
[ { "docid": "76f42775fcac0d3b8ec06a789300e16d", "score": "0.7054635", "text": "def index\r\n @answers = @question.answers\r\n render json: @answers\r\n end", "title": "" }, { "docid": "6933473e1841e6979bac2edee1f2c7a0", "score": "0.6949692", "text": "def index # http:...
d157cdd5f8470e2c1b822d5906be13ef
Finds the correct ActiveRecord class for the current scope, based on the 'type' param which is specified in =routes.rb=.
[ { "docid": "330a817ca36ccf2ee0b80dd24044b268", "score": "0.0", "text": "def klass\n params[:type].nil? ? Tag : params[:type].classify.constantize\n end", "title": "" } ]
[ { "docid": "f3c5611694d3f287b1e8af4e1827a349", "score": "0.66603446", "text": "def model_klass\n Object.const_get(\"::#{name.split('::')[0..-3].last}\")\n end", "title": "" }, { "docid": "2b3d3cc3a8f60929d7d00dc716de248e", "score": "0.6628385", "text": "def activereco...
4ac6f436849081c759aeddb03db5228b
def authenticate! if !current_admin.nil? :authenticate_admin! elsif !current_librarian.nil? :authenticate_librarian! end end GET /librarians GET /librarians.json
[ { "docid": "b0a0499075baadfadf2398bb5759a44b", "score": "0.65775687", "text": "def index\n if admin_signed_in?\n sign_out :librarian\n redirect_to admins_path\n\t elsif student_signed_in?\n sign_out :librarian\n redirect_to students_path, notice: 'Action not allowed.'\n else\n...
[ { "docid": "c78c5e9a5e02ecc6b53ae17935fc0926", "score": "0.66656077", "text": "def index\n if admin_signed_in?\n sign_out :librarian\n redirect_to root_path\n end\n @librarians = Librarian.all\n end", "title": "" }, { "docid": "3f9bf62f03c14b9b1491db66f96f94a6", "scor...
3d3d98d308e9f276876b97e235d9a59c
Public: All available tags returns array of Hashtag
[ { "docid": "094817d4f1688b4962c0d6cfdc8efbc7", "score": "0.0", "text": "def all\n values\n end", "title": "" } ]
[ { "docid": "e99e59c3f0956d291b8df03cf9b5a80c", "score": "0.78615016", "text": "def all_tags\n request(:get,\"/tags\")\n end", "title": "" }, { "docid": "466bc3faa461b646f1a7c5a7d86727be", "score": "0.7811187", "text": "def get_all_tags; end", "title": "" }, { "doc...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "992757ede3d7583cb12544c047832f5b", "score": "0.0", "text": "def update!(**args)\n @key = args[:key] if args.key?(:key)\n @value = args[:value] if args.key?(:value)\n end", "title": "" } ]
[ { "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...
5952fb75f9af0193dd9b4c3482e14606
Reads the gems manifest file and returns the gems to be installed.
[ { "docid": "c5e3d9867f98afd054fae50ad0656401", "score": "0.73673934", "text": "def gems_from_manifest(manifest='.gems')\n gems = File.read(manifest).split(\"\\n\")\n gems.reject { |name| name =~ /^\\s*(#|$)/ }\n end", "title": "" } ]
[ { "docid": "60134787926d0f24684593f9b5c8e9e8", "score": "0.7005491", "text": "def installed_gems\n gems = []\n\n cmd = [attributes.gem_binary, 'list', '-l']\n cmd << '--prerelease' if attributes.prerelease\n\n run_command(cmd).stdout.each_line do |line|\n next unless...
15a2f9f3211327e0a7799b5cfcf55c48
PATCH/PUT /boards/1 PATCH/PUT /boards/1.json
[ { "docid": "41458b42a29954fc4865ad65bb9dff91", "score": "0.68101853", "text": "def update\n respond_to do |format|\n if @board.update(board_params)\n format.html { redirect_to @board, notice: 'Board was successfully updated.' }\n format.json { head :no_content }\n else\n ...
[ { "docid": "c7da9feae20ef25b3e4c8537e53f1283", "score": "0.701086", "text": "def update\n @board = Board.find(params[:id])\n\n respond_to do |format|\n if @board.update_attributes(params[:board])\n format.html { redirect_to @board, notice: 'Board was successfully updated.' }\n f...
a8eaf908bcb4cd382c9b1c2f8bfdadf9
Serialize frame for transmission on wire
[ { "docid": "d1c3c9b069b6072e6cc095eb06f1f693", "score": "0.0", "text": "def to_s\n @headers[\"content-length\"] = @body.size.to_s if @body.include?(NULL)\n @headers.keys.sort.inject(\"#{@command}\\n\") { |r, key| r << \"#{key}:#{@headers[key]}\\n\" } + \"\\n#{@body}#{NULL}\\n\"\n end", ...
[ { "docid": "259f203a7b9647ff11a20c954c29190b", "score": "0.69353163", "text": "def write frame\n @socket.write frame\n end", "title": "" }, { "docid": "0b8e520827ce99b7bf04ada9353fa2b5", "score": "0.6885335", "text": "def write_frame_nonblock frame\n ser = serializer.frame_to_...
330d95e498e0b0e8163baa97e17bd257
GET /charts/1 GET /charts/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "a3a908aed11991d23e4329789dd2cf97", "score": "0.7152072", "text": "def show\n respond_to do |format|\n format.html # show.html.haml\n format.json { render json: @chart }\n end\n end", "title": "" }, { "docid": "f20bb942c44b04cdff853056d850664d", "score": "0.69...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "8c45619b33b0397dedb543630a07e4c1", "score": "0.0", "text": "def my_template_params\n params.require(:my_template).permit(:name, :desc)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69792545", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781151", "text": "def strong_params\n params.requ...
fb1f3abdc7ed577097c8e78bff625511
anagram?("elvis", "lives") => true
[ { "docid": "b193226b31dd5517e2e276a87435cfc1", "score": "0.0", "text": "def first_anagrams(string1, string2)\n anagrams = []\n\n array = string1.split(\"\").permutation.to_a\n \n array.each { |stringed_array| anagrams << stringed_array.join(\"\") }\n \n anagrams.include?(string2)\n ...
[ { "docid": "5063cb3afbb917585ca583522da871fc", "score": "0.84771055", "text": "def anagram?(word1, word2)\n \nend", "title": "" }, { "docid": "b835e2d5f390b9abb34ac7d786b6354f", "score": "0.842455", "text": "def is_anagram(s, t)\n s.chars.sort == t.chars.sort ? true : false \nend",...
cfbf596dd501c16b4df72eaf0721d73c
DELETE /cards/1 DELETE /cards/1.xml
[ { "docid": "9331c25417de61d5a7be4bc11761300a", "score": "0.73923284", "text": "def destroy\n @card = Card.find(params[:id])\n @card.destroy\n\n respond_to do |format|\n format.html { redirect_to(cards_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
[ { "docid": "85a8f9f4a78375cdf794cb10cde5ced4", "score": "0.81878686", "text": "def delete(name)\r\n id = name_to_id(name)\r\n self.class.delete(\"/cards/#{id}.xml\")\r\n end", "title": "" }, { "docid": "057b84da857a96c4164be774dce8a9e4", "score": "0.8089064", "text": "def dele...
82392b4afb45940380f72123e5097584
archive and strip out the subfolder
[ { "docid": "26b4f2022d1d68055d5c1b73ab044406", "score": "0.0", "text": "def release\n git :archive, fetch(:branch), fetch(:project_root), '| tar -x -C', release_path, \"--strip=#{fetch(:project_root).count('/')+1}\"\n end", "title": "" } ]
[ { "docid": "b2c1d30fe14010926610b391170d662f", "score": "0.6509888", "text": "def sub_dir\n dir_name = \"Archive #{@t.month}-#{@t.day}-#{@t.year}\"\n sub_dir_name = \"#{@archive_folder}/#{dir_name}\"\n\n Dir.mkdir(sub_dir_name) unless Dir.exist?(sub_dir_name)\n return sub_dir_name\nend", "title"...
b448dea338e693445b3454896515c2a2
REVIEW: THIS IS NOT DYNAMIC AT ALL
[ { "docid": "156359f80742764ac1d0faaf16331453", "score": "0.0", "text": "def url\n \"http://#{ENV['DISPLAY_SUBDOMAIN']}.boomerangproof.com/#{user.url_name}/#{name}\"\n end", "title": "" } ]
[ { "docid": "b6b2bcc0062aeb115edab7b10cbe6930", "score": "0.62172824", "text": "def desired; end", "title": "" }, { "docid": "3caf4c824a6d6a4a5616c13fcab418da", "score": "0.60892594", "text": "def applied; end", "title": "" }, { "docid": "ccae8533bfaa6c980bf5d0eac73a41ca",...
e603bf1a99cf5cd5a207f012a1a438c3
CompactIndex::VersionsFilecreate expects that all versions of a gem are in same array
[ { "docid": "b7d661f1fbc4a52523cdf7c4e9760dda", "score": "0.6466375", "text": "def parse_gems_for_versions_file(gems)\n gems_hash = {}\n gems.each do |entry|\n gems_hash[entry['name']] ||= []\n gems_hash[entry['name']] << CompactIndex::GemVersion.new(\n entry['number'],\n en...
[ { "docid": "7d49040be6e05c75063807f81d76a85b", "score": "0.629048", "text": "def target_version_array\n @target_version_array ||=\n begin\n target_version_array = []\n each_package do |package_name, new_version, current_version, candidate_version, magic_version|\n ...
9b7f39f3a7224ee130d3a70cc897a4e5
DELETE /users_cards/1 DELETE /users_cards/1.json
[ { "docid": "506b755217298741d3e5be59597a9a95", "score": "0.74755675", "text": "def destroy\n @users_card.destroy\n respond_to do |format|\n format.html { redirect_to users_cards_url, notice: 'Users card was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", ...
[ { "docid": "27f165312ca9d32a7ac8257d8bb8504e", "score": "0.7610322", "text": "def delete_cards\n params[:_json].each do |card|\n if card[:id].nil?\n Card.destroy(card[:id])\n end\n end\n end", "title": "" }, { "docid": "fd728092dba2effebaa3f77dc22ff22b", ...
be5d3f6bd9fd09c56b98982e166a3f79
Register all the observers def register(observers, interval) TODO : rename
[ { "docid": "1beafba9b2d04a4832e8630d5a7bd9cb", "score": "0.0", "text": "def register_users(female_users, male_users)\n return if @prepared\n\n if !female_users.nil?\n female_users.each do |user_id|\n register_user user_id, Gender.female\n end\n end\n\n if !male...
[ { "docid": "400b511724de57ac4c9f76ba88ac0327", "score": "0.84330326", "text": "def register_observers(*observers); end", "title": "" }, { "docid": "34b8572d83293f05e3d1b1cd0e442a45", "score": "0.8006142", "text": "def register_observers(*observers)\n observers.flatten.compact....
87cf6ad1cd5ba9bfbe8d01a17c7e462c
a list of the contextual methods for a CI::File
[ { "docid": "9a2931a1eb39af8173db5b8f694897aa", "score": "0.67005074", "text": "def contextual_methods(file)\n @client.get(path_for(file) + '/contextualmethod')\n end", "title": "" } ]
[ { "docid": "236e3f766b207db064781c2ffd9728f4", "score": "0.64491373", "text": "def methods_for(file=nil, return_ary=false)\n \n unless file.nil?\n types_to_look_for = [\"controller\",\n \"helper\",\n \"model\",\n \"...
47a7d4a54b7fa04b0d226fa4d06068a3
Prepends input with a url fragment input An absolute url, e.g., /images/awesome.gif url The fragment to prepend the input, e.g., /blog Returns the modified url, e.g /blog
[ { "docid": "e82f0930a33b083bf9d4bc265b6a1474", "score": "0.7212571", "text": "def expand_url(input, url=nil)\n url ||= root\n\n url = if input.start_with?(\"http\", url)\n input\n else\n File.join(url, input)\n end\n\n smart_slash(url)\n end", "title": "" ...
[ { "docid": "33cf0dd8ef728b05cb0582cd4789453e", "score": "0.7972338", "text": "def prepend_url(input, path='')\n path += '/' unless path.match /\\/$/\n if input.match /^!/\n input.gsub(/^(!)(.+)/, '\\2')\n else\n input.gsub(/^(\\/)?([^:]+?)$/, \"#{path}\"+'\\2')\n end\n end", "...
1015badd107198211f3eba06a3ab33f7
PATCH/PUT /injuries/1 PATCH/PUT /injuries/1.json
[ { "docid": "a66095354a6492a9b97b4493e81caf3d", "score": "0.6822883", "text": "def update\n respond_to do |format|\n if @injury.update(injury_params)\n format.html { redirect_to @injury, notice: 'Injury was successfully updated.' }\n format.json { render :show, status: :ok, location...
[ { "docid": "b1bc0ed516d6c6eba3121f68413c4f11", "score": "0.69233626", "text": "def update\n respond_to do |format|\n if @injury.update(injury_params)\n format.html { redirect_to injuries_url, notice: 'Injury was successfully updated.' }\n # format.json { render :show, status: :ok, l...
affb461b2071fb8d006df35aaa9cd7c1
Method that test the jankenpon game
[ { "docid": "cd13a959ae2b0050c17e1c9f18c9d9a9", "score": "0.0", "text": "def test_simple_cases_minus\n assert_equal Paper, (Scissors - Paper)\n assert_equal Paper, (Paper - Scissors)\n assert_equal Rock, (Paper - Rock)\n assert_equal Rock, (Rock - Paper)\n assert_equal Lizard...
[ { "docid": "a31f83c8a0a2e0d9c966ab9b2014bf03", "score": "0.7294488", "text": "def test_gameplay()\n\n while !@game.finished?()\n @game.next()\n end\n # Entweder wurde das Spiel gewonnen mit mindestens einem Zug, oder 10 zuege gebraucht bei einer Niederlage\n assert_true(( (@game.won?() ...
e4ff9e5433f9a795a38c9cb278ff17ad
GET /followships/1 GET /followships/1.json
[ { "docid": "76e90d3b34050ded0ac36e18b7b564ff", "score": "0.0", "text": "def show\r\n end", "title": "" } ]
[ { "docid": "7411bf9c5c2c87bf05c2f76fa56976b3", "score": "0.7734268", "text": "def all_followships\n followships = User.find(params[:user_id]).followships\n render :json => followships\n end", "title": "" }, { "docid": "b757e791b71d86fdffc156311a272877", "score": "0.7267963", "...
b7c15799455b9d9d6587bb81768f181f
This should return the minimal set of values that should be in the session in order to pass any filters (e.g. authentication) defined in RetailShelvesController. Be sure to keep this updated too.
[ { "docid": "fc1692d3bf6e1e78818f41b7c4555988", "score": "0.0", "text": "def valid_session\n allow(controller).to receive_messages(:signed_in? => true)\n end", "title": "" } ]
[ { "docid": "bb0cb7bbd2da4eb4b2c93c794fd1bc42", "score": "0.61066186", "text": "def get_session_variables_from_authenticated_system\n @return_to_query = session[:return_to_query] || params[:return_to_query]\n @return_to = session[:return_to] || params[:return_to]\n @previous_protocol = session[:...
34389df360707708c73a7c0532697a10
Perform a union between this Range and the passed in Range. There are three potential situations that can happen: disjoint, equivalent, or overlapping.
[ { "docid": "39b8790c300e258c28ff809f640396f9", "score": "0.71657145", "text": "def union(range)\n # Return self if nil (nothing new to add) or if it matches the other range (they are equivalent)\n return self.clone if range.nil?\n return self.clone if eql?(range)\n\n # Figure out whi...
[ { "docid": "7bcac36745c3f7f049c9c75b67a0432f", "score": "0.7125608", "text": "def union(rect)\n self.dup.union!(rect)\n end", "title": "" }, { "docid": "986c00fe73665eb4c524f9d40a0162a5", "score": "0.69021475", "text": "def union!(rect)\n self.normalize!\n rleft, rtop = sel...
c96ea3a71f848dd47fe62c379bb72591
PUT /cargos/1 PUT /cargos/1.json
[ { "docid": "c50c05783bf596d6fc6943b05611c96e", "score": "0.5850842", "text": "def update\n @cargo = Cargo.find(params[:id])\n\n respond_to do |format|\n if @cargo.update_attributes(params[:cargo])\n format.html { redirect_to cargos_path, notice: 'Cargo atualizado com sucesso.' }\n ...
[ { "docid": "fbd7c46b15ae2792fd842ba0d764b7d0", "score": "0.63915396", "text": "def put uri, args = {}; Request.new(PUT, uri, args).execute; end", "title": "" }, { "docid": "8e18db431964c254de53caa41795b702", "score": "0.637745", "text": "def put *args\n make_request :put, *args\n ...
508460cb35cf8c909fe59f149f3da7a0
Sends target method the total array what it needs to search in and arr which needs to be searched with. The result will be a hash, gets sorted by value in a descending order. Then prints out.
[ { "docid": "4bc25692d537de7e74c3983c35824adc", "score": "0.0", "text": "def popular_hours(all_hours)\n\tprint target((0..23), all_hours).sort_by { |_key, value| value }.reverse\n\tputs \"\"\nend", "title": "" } ]
[ { "docid": "75cdcc18e0bb0bcd6eb483898fba68dc", "score": "0.61035454", "text": "def bsearch(arr, target)\n \nend", "title": "" }, { "docid": "1f28fc238411dcc4aa7858b741d03355", "score": "0.6097577", "text": "def bsearch(array, target)\n\nend", "title": "" }, { "docid": "7...
50071436fd5c6f45352a07b4d74914c7
Formats a number into a ninedigit US Federal Entity Identification Number string (nnnnnnnnn)
[ { "docid": "7c751a27c365e116f1c277fe1282c725", "score": "0.68325466", "text": "def number_to_fein(number)\n return unless number\n delimiter = \"-\"\n number.to_s.gsub!(/(\\d{0,2})(\\d{7})$/,\"\\\\1#{delimiter}\\\\2\")\n end", "title": "" } ]
[ { "docid": "e6ecfc8466e4d5d0bd95d58cb6d67710", "score": "0.68646556", "text": "def fnd(n, number)\n\t\t\"%0#{n}d\" % number\n\tend", "title": "" }, { "docid": "86c03df464321eef06615c0642327e3f", "score": "0.6709089", "text": "def siren\n base = FFaker.numerify('########')\n ...
2b7843e283cd4549133ce0a7f50d9a46
Returns the allowed parameters for pagination
[ { "docid": "41689b5d9a7686f9333a59aeb16d2d40", "score": "0.69563514", "text": "def page_params\n params.permit(:page, :per_page)\n end", "title": "" } ]
[ { "docid": "85d0dc822f66b63514eaadb1c71ead08", "score": "0.7550187", "text": "def page_params\n [ :per_page, :page ]\n end", "title": "" }, { "docid": "7363f0c2673caa77bc0eddf2e1b44d60", "score": "0.746651", "text": "def resource_filter_permitted_params\n %i[page per_page]...
a094a25d9d69a78f2c1fe556a2187212
1) Mark Janzer 2) Jamar Gibbs We spent 2.25 hours on this challenge. Bakery Serving Size portion calculator.
[ { "docid": "6acf4a958ee79ef18efec8d99386737d", "score": "0.0", "text": "def serving_size_calc(item_to_make, ing_quantity)\n library = {\"cookie\" => 1, \"cake\" => 5, \"pie\" => 7}\n\n if library.has_key?(item_to_make) == false\n raise ArgumentError.new(\"This food is not a valid input\")\n end\n...
[ { "docid": "04cbfbb702aa9620695a7cca6a7ab31a", "score": "0.7164764", "text": "def calculate_sizes\n @big_blocks = (@book_size.to_f/BlockDiv.to_f).ceil\n @list_blocks = (@big_blocks / ListBlocks) + 1\n @root_start = @big_blocks\n end", "title": "" }, { "docid": "e6e963840648dec998...
81965866cc23ecbedd52fc64668c358b
TODO need Mspec test...ran into problems with this one
[ { "docid": "249931ee89ef3d0d56d85b8aa935c5f8", "score": "0.0", "text": "def sample arg = nil\n return IterableArray.new(@array.sample arg) unless arg.nil?\n @array.sample\n end", "title": "" } ]
[ { "docid": "072514f3348fe62556dcdfd4b06e3d08", "score": "0.7123117", "text": "def spec; end", "title": "" }, { "docid": "072514f3348fe62556dcdfd4b06e3d08", "score": "0.7123117", "text": "def spec; end", "title": "" }, { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "sc...
93797df80dca2ab1fe8f9e27412db8d9
Internal: Set the user if not present else create the user based on ip address Returns user object
[ { "docid": "d7a845b9d7ea7975b609ecf42329fe23", "score": "0.71816474", "text": "def set_username\n user = User.where(ipaddress: request.remote_ip).last\n if user.present?\n @user = user\n else\n username = \"User #{User.count+1}-#{DateTime.now.to_i}\"\n @user = User.cr...
[ { "docid": "ae46a46c0fa427c4cf692fce3b0b407d", "score": "0.75515336", "text": "def assign_user\n #If @user is already assigned (by multi_authenticate), stop here and don't create a user\n return @user if @user.present?\n\n #Otherwise, generates a user with IP & user_agent\n user_ip_a...
6efe7f1ac0d0703522caa17801e9fbb6
display word with guessed items
[ { "docid": "20351016b67ce24e801d513fe54032f4", "score": "0.67024887", "text": "def word_with_guesses\n if (word.empty?)\n word_guesses = \"-\"\n else \n word_guesses = \"\"\n end\n \n @word.chars do |myg| \n if !(@guesses =~ /([#{myg}])/)\n word_guesses += \"-\"\n ...
[ { "docid": "c89eb290e13d4645b7374dba48d9066c", "score": "0.7635911", "text": "def display()\n # The string to return\n displayString = \"\"\n # An easy variable to hold the length of the word\n length = @word.length\n\n # Check to see if lettersGuessed has anything\n if @lettersGuessed...
188ac998ed4dc2f62b0f52793f5fccd0
Starts the consumer service and enters the subscribe loop.
[ { "docid": "808ad965053e681254586fe856c48f51", "score": "0.5831212", "text": "def run\n logger.debug \"[Cottontail] Connecting to client\"\n @client = Bunny.new( *settings(:client) )\n @client.start\n\n logger.debug \"[Cottontail] Declaring exchange\"\n exchange = @client.exchan...
[ { "docid": "bfd4e833b6c5793fa535f86f9b82289e", "score": "0.75635713", "text": "def start\n # subscribe is like a callback\n @server_queue.subscribe(block: @block) do |delivery_info, properties, payload|\n consume(delivery_info, properties, payload)\n end\n end", "title": "" }, { ...
f25156b2cd55465acaf5bf82f862f707
Ensures that the amount can be converted without throwing error
[ { "docid": "4c60fb3afbf25ed326e4fbc933930baa", "score": "0.0", "text": "def get_amount_conversion\n convert_to_float\n end", "title": "" } ]
[ { "docid": "1a66be4dab9224ecd2823b828773bfe1", "score": "0.73854256", "text": "def validate_amount\n raise InvalidAmount unless @price.amount.is_a? Numeric\n end", "title": "" }, { "docid": "fb70a0745f48885c781daa0f4436f797", "score": "0.69357896", "text": "def valid_loan_amount?...
cc09b704d3a016e7e4ad17c08d6ea005
Creates a leave setup for a specific employee. This is required before viewing, configuring and requesting leave for an employee
[ { "docid": "af603f761a3401efb673059426686110", "score": "0.780619", "text": "def create_employee_leave_setup(xero_tenant_id, employee_id, employee_leave_setup, opts = {})\n data, _status_code, _headers = create_employee_leave_setup_with_http_info(xero_tenant_id, employee_id, employee_leave_setup, o...
[ { "docid": "4522bd49d0165c3a7a3ce87735b05199", "score": "0.76788473", "text": "def setup_employee_leave\n leave_type = EmployeeLeaveType.all\n leave_type.each do |e|\n EmployeeLeave.create( :employee_id => id, :employee_leave_type_id => e.id, :leave_count => e.max_leave_count, :reset_date =>...
afcd4524da0842ddf90ac01c9b000042
Creates a new client with an api key. Optionally, you can also pass an array of processes.
[ { "docid": "06ccdfef6f914fc26a964b92a8051244", "score": "0.59151524", "text": "def initialize(args = {})\n @api_key = args[:api_key]\n args[:processes].nil? ?\n @processes = [] :\n @processes = args[:processes]\n @return_type = args[:return_type] || :json\n end", "tit...
[ { "docid": "84186d209e6b5dca2e0c8146b546a058", "score": "0.6258672", "text": "def create_client(params={})\n post('/clients', params)\n end", "title": "" }, { "docid": "06986e029d311faf170955b808eb6d55", "score": "0.61149937", "text": "def create_client(options)\n PulsarAdmin:...
178390d725b4483467242e9b6174f021
Returns the maximum length of an index name.
[ { "docid": "308306a51a5993bf2f89402ab4f99b59", "score": "0.8649485", "text": "def index_name_length\n max_identifier_length\n end", "title": "" } ]
[ { "docid": "dd4c971c54b46f597f762e42ce11a248", "score": "0.8207613", "text": "def index_name_length\n IDENTIFIER_MAX_LENGTH\n end", "title": "" }, { "docid": "e6a2d049a594a99c7c66eb18dca89bff", "score": "0.7894039", "text": "def allowed_index_name_length\n inde...
23cfb24a63ee7d9800f000039ee612b5
addr (add register) stores into register C the result of adding register A and register B.
[ { "docid": "e88b00869199153288dace193f8ac6c6", "score": "0.77726394", "text": "def addr(a, b, c)\n @registers[c] = @registers[a] + @registers[b]\n end", "title": "" } ]
[ { "docid": "d75141657b0971ff9cdcf50a51ed4dfa", "score": "0.5755771", "text": "def jp_v0_addr(addr)\n @pc = @v[0] + addr\n end", "title": "" }, { "docid": "0eb412e21cb6d92b08baa2c0a1721fa6", "score": "0.570346", "text": "def ret_address_store_addr; @offset + length; end", "tit...
89be89f9dea544a2fd1c5fd1b23b5709
Returns an object tag with the provided src used as src attribute. Additional options on the image tag can be passed as a hash with attrs. width and height attributes are transformed to the appropriate MCS parameters. caption attribute is transformed to a nested element. Examples (call, result): xf_image_tag " "This is...
[ { "docid": "a1264f19570d673cbee240b9c62778df", "score": "0.8106561", "text": "def xf_image_tag (src, attrs = {})\n attrs = attrs.symbolize_keys()\n content = \"\"\n caption = attrs.delete(:caption)\n unless caption.nil?\n content += typeWithAttr...
[ { "docid": "39f7b9d98609663e9b84a966cf7cbf6a", "score": "0.6859572", "text": "def image_tag(source, options = {})\n options.symbolize_keys!\n\n options[:src] = path_to_image(source)\n options[:alt] ||= File.basename(options[:src], '.*').split('.').first.to_s.capitalize\n\n if...
6953d4d4422a67bb08edfe10c97b8bee
Outputs all the data from the article table and tag table
[ { "docid": "a31cbcfdfaf410ebda4f361d1aa2e782", "score": "0.6371947", "text": "def select_all_article_info()\n return get_db_as_hash().execute(\"SELECT * FROM article JOIN tags ON article.tag_id=tags.tag_id\")\n end", "title": "" } ]
[ { "docid": "35b83d2b5a43a826593b414c69939901", "score": "0.6243369", "text": "def to_table\n mortadella = Mortadella::Horizontal.new headers: %w[NAME LOCATION]\n @tags.keys.sort.each do |tag_name|\n mortadella << [tag_name, @tags[tag_name].to_sentence]\n end\n mortadella.table\n end", ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "37bb09a2c2bce6738a820f65220e2d39", "score": "0.0", "text": "def set_fraude\n @fraude = Fraude.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...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "8372f45b408a33e421d21de954d5fa1a", "score": "0.0", "text": "def yelp_params\n params.require(:yelp).permit(:name, :starts_month_day_year, :starts_time, :ends_month_day_year, :ends_time, :venue_name, :venue_street, :venue_city_state_zip, :event_site_url, :tickets_url, :cost, :description...
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whit...
e1b57ef8c8fe79f13d7b405ea68dbf9e
Validates the body data returned in the response in case there is an embed error it will fail with the dessired error and message
[ { "docid": "9320e077d52ef2c7201a9ad1cb1da3b3", "score": "0.6250606", "text": "def validate_response_data\n if response.data.is_a?(Hash)\n if response.data['error']\n handle_api_error(response.data['error']['code'], response.data['error']['message'])\n elsif response.d...
[ { "docid": "7bee307132ca25e893c3f3716802fa7c", "score": "0.6748872", "text": "def validate!\n raise RequestError.new error_message unless errors.empty?\n body\n end", "title": "" }, { "docid": "08220ac162bbfbf3dbe8b5f1a81ec652", "score": "0.6594051", "text": "def error_f...
afe3d8ccf5e2856709333bc7786807c6
return auth token once user is authenticated
[ { "docid": "59b613025f44e2d257d9a5c0edf8009f", "score": "0.0", "text": "def user_authenticate\n auth_token =\n AuthenticateUser.new(\n auth_params[:email],\n auth_params[:password]\n ).call\n if auth_params[:email]\n user = User.find_by(email: auth_params...
[ { "docid": "be7f0848da811d8593cdd0df66f18b5a", "score": "0.8222713", "text": "def auth_token\n generate_auth_token if @auth_token.nil?\n return @auth_token\n end", "title": "" }, { "docid": "be7f0848da811d8593cdd0df66f18b5a", "score": "0.8222713", "text": "def auth_token...
e76b98f96caf2e71e5bab957225e13dc
Defines an infix expression parser with the provided precedence. This method is used for registering operators. The first argument is a proc or lambda that takes in a token and returns whether the parsing block should be executed. The block argument is ran as the parser (using instance_exec) with a single argument, the...
[ { "docid": "a54578c27669e34702c2d1305a831734", "score": "0.7927144", "text": "def infix(precedence, matcher, &block)\n @infix_parsers[matcher] = [precedence, block]\n end", "title": "" } ]
[ { "docid": "cbe4cc64c8a3bb71c4179d57cc688232", "score": "0.7160798", "text": "def parse_expression(precedence = 0)\n ret, line = nil, current_token.line_num\n @expression_parsers.each do |matcher, parser|\n next unless matcher.call(current_token) && ret.nil?\n\n ...
da7a01c5b3ed5559e12c58af155fd642
Returns a hash containing details from the User's me tile
[ { "docid": "b75cb63f808e132d271d868d1a043dcd", "score": "0.6946032", "text": "def get_user_profile(client)\n items = client.tile_items\n profile_tile = items['tile_items'].find {|data| data['me'] == true }\n\n profile = {\n 'user_id' => client.id,\n }\n\n ...
[ { "docid": "0c3a9afab76758c8962d9a36cf07740f", "score": "0.6780548", "text": "def user_hash\n @user_hash ||= MultiJson.decode(@access_token.get('/get_user_info').body)\n end", "title": "" }, { "docid": "5cabd37136c34dcd6459416aa5ef9eb8", "score": "0.6664679", "text": "def...
a71f1200b48eb932edb097fb62d0f80f
Return array of headers that match given pattern
[ { "docid": "f0e45a3651057ef1dda12a26425f443b", "score": "0.83740777", "text": "def select_by_pattern(headers, pattern)\n return headers.select {|h| h.match(pattern)}\n end", "title": "" } ]
[ { "docid": "bf63306cbc9935f331723b664d35617c", "score": "0.830741", "text": "def select_by_pattern(headers, pattern)\n return headers.select {|h| h.match(pattern)}\nend", "title": "" }, { "docid": "fc057b5f529eeed5e825632b6f7727f4", "score": "0.8038787", "text": "def collect_by_patt...
10f8b620b816c3ed1312282f2144e697
PATCH/PUT /delivery_letters/1 PATCH/PUT /delivery_letters/1.json
[ { "docid": "92a0a61539ed16fed222cfa1d47be15e", "score": "0.6991909", "text": "def update\n authorize @delivery_letter\n respond_to do |format|\n if @delivery_letter.update(delivery_letter_params)\n format.html { redirect_to @delivery_letter, notice: 'Delivery letter was successfully up...
[ { "docid": "1097c467d428628a0892a684dce76665", "score": "0.65921855", "text": "def update\n respond_to do |format|\n if @letter_request.update(letter_request_params)\n format.html { redirect_to @letter_request, notice: 'Letter request was successfully updated.' }\n format.json { re...
c5a017e57e8ebbe2b6eed9cc27c34bf7
DELETE /onposts/1 DELETE /onposts/1.xml
[ { "docid": "89993f0ca197a2a55e139eea4528c269", "score": "0.63317084", "text": "def destroy\n @installation = Installation.find(params[:installation_id]) \n @onpost = Onpost.find(params[:id])\n @onpost.destroy\n\n respond_to do |format|\n format.html { redirect_to :back }\n format.x...
[ { "docid": "31de51e421ae61eff2015881d5c43f64", "score": "0.69632316", "text": "def destroy\n @offpost = Offpost.find(params[:id])\n @offpost.destroy\n\n respond_to do |format|\n format.html { redirect_to(offposts_url) }\n format.xml { head :ok }\n end\n end", "title": "" },...
db7d1b0ebb612f04dbe5e878ff543c0d
PATCH/PUT /surveys/1 PATCH/PUT /surveys/1.json
[ { "docid": "45ef41fe005a5f8ead8b051f2286032b", "score": "0.69322914", "text": "def update\n respond_to do |format|\n if @survey.update(survey_params)\n format.html { redirect_to @survey, notice: 'Survey was successfully updated.' }\n format.json { head :no_content }\n else\n ...
[ { "docid": "29fd4b965be1cf47624ba4497990cee6", "score": "0.73462975", "text": "def update\n survey = Survey.find(params[:id])\n survey.update(JSON.parse(params[:survey]))\n render :json => survey.to_json\n end", "title": "" }, { "docid": "5429babedb6c82b6a013205f341d9f91", "sco...
d5e2dd169788a22aa65a4e0b389a904b
Tell winner he/she has won Returns nil
[ { "docid": "c4f8ce1cab9b4cedc3d9b58e9f28a216", "score": "0.7691119", "text": "def alert_winner(winner)\n if winner == 0\n puts \"That's a draw!\"\n elsif winner == 1\n puts \"Player 1 wins set number #{@set_number}!\"\n elsif winner == 2\n puts \"Player 2 wins set number #{@set_n...
[ { "docid": "1d36f4b377c7155e4716b7b79b1b8070", "score": "0.81594247", "text": "def winner\n won?\n @winner\n end", "title": "" }, { "docid": "c3e16da3ffce87acbff3b5bc5e24c3ec", "score": "0.81218606", "text": "def winning_message(won:) \n puts won != false ? \"-----#{won.n...
e696b35abb7341e08238e0acb0fda1c0
Override methods in Devise::Controllers::Helpers
[ { "docid": "d844d56dc933943809e72e726bf33100", "score": "0.0", "text": "def after_sign_out_path_for resource_or_scope\n redirect_uri = params[:redirect_uri]\n redirect_uri ? redirect_uri : super\n end", "title": "" } ]
[ { "docid": "fdb1369e2e9bc24fff98b4c06a2f1a22", "score": "0.75212437", "text": "def devise_controller?; end", "title": "" }, { "docid": "8091c3e7b94c717c25d9ecbc5a2855b5", "score": "0.6996327", "text": "def devise_parameter_sanitizer; end", "title": "" }, { "docid": "45030...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "a06a63322c54de4af9780d5ebaed2bf9", "score": "0.0", "text": "def set_year\n @year = Year.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...
9f434938ada4a3f6d5a1771732d7d31d
Builds next build request in queue
[ { "docid": "4b372894bf1a8c234498db5a7da3e6a8", "score": "0.8095827", "text": "def build_next\n request = @build_queue.pop(self)\n revision = request.revision\n project = revision.project\n latest_revision = project.latest_revision\n build = revision.build!(request.reasons)\n ...
[ { "docid": "3ab17e9fcd51889f102e390fdd6829db", "score": "0.6767883", "text": "def build_requested\n \n end", "title": "" }, { "docid": "ba072ca29552d01227996311c69f52f3", "score": "0.6686846", "text": "def build_requested\n end", "title": "" }, { "docid": "ba072ca29552...
d7679e7d796edda93f111ad38a4bc133
DELETE /pravites/1 DELETE /pravites/1.json
[ { "docid": "b4e7c0760f2dafaddebd442088ec5ac5", "score": "0.74602544", "text": "def destroy\n @pravite.destroy\n respond_to do |format|\n format.html { redirect_to pravites_url, notice: 'Pravite was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title...
[ { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.7062457", "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": "...
c82f99c72dc6b283d6157384bc17538b
DELETE /books/1 DELETE /books/1.json
[ { "docid": "bdca3a81dfc069c154b888a50769d941", "score": "0.0", "text": "def destroy\n \t@note = @book.notes.find(params[:id])\n @note.destroy\n\n redirect_to @book, notice:\"Note deleted\"\n\n end", "title": "" } ]
[ { "docid": "f20a59ceb31d39f7c2e3a92cdb0d0d0c", "score": "0.75893277", "text": "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to deleted_books_path }\n format.json { head :no_content }\n end\n end", "title": "" ...
8c053dffca7cd2e665de43541790e736
next Monday 10am in Sydney
[ { "docid": "f84d815429e2a6ac6ffdfb35bddd5135", "score": "0.69914186", "text": "def next_time(day_of_week, hour, tz)\n now = Time.now.localtime(tz)\n at_hour = Time.new(now.year, now.month, now.day, hour, 0, 0, tz)\n at_day_at_hour = at_hour + ((day_of_week - at_hour.wday) % 7) * 60*60*24\n\n if at_d...
[ { "docid": "da07c1f756a400e8e2f155f555994bb8", "score": "0.75947225", "text": "def next_occurring(day_of_week); end", "title": "" }, { "docid": "da07c1f756a400e8e2f155f555994bb8", "score": "0.75947225", "text": "def next_occurring(day_of_week); end", "title": "" }, { "doc...
8c83505a26dfa95cc92000a8bd62acdd
Using the Ruby language, have the function Superincreasing(arr) take the array of numbers stored in arr and determine if the array forms a superincreasing sequence where each element in the array is greater than the sum of all previous elements. For example: if arr is [1, 3, 6, 13, 54] then your program should return t...
[ { "docid": "c6c7296f27f25eff0e444b1048c73d28", "score": "0.85963786", "text": "def Superincreasing(arr)\n sum = 0\n arr.each do |num|\n return false if num <= sum\n sum += num\n end\n return true\nend", "title": "" } ]
[ { "docid": "216c3061543e73e09df44b68ca7d26b1", "score": "0.8328362", "text": "def Superincreasing(arr)\n arr.each_with_index do |num, idx|\n next if idx == 0\n return 'false' unless arr[0...idx].sum < num\n end\n 'true'\nend", "title": "" }, { "docid": "090e198918544c46b424c35a1e7fc...
81a12c7051c2d53cc32d64c9369b6aa0
Make preapproved payments to receivers
[ { "docid": "dec8f192db1ee5cc1cca00f2e843df81", "score": "0.7523093", "text": "def make_preapproved_payments(preapproval_key)\n api.execute :Pay, payment_options(preapproval_key)\nend", "title": "" } ]
[ { "docid": "c60a90ddde22a510795c1772d9c04649", "score": "0.6771037", "text": "def setup_preapproval\n api.execute :Preapproval, preapproval_payment_options\nend", "title": "" }, { "docid": "9aceb2d07b30bdf60e477ed61ec2347d", "score": "0.660657", "text": "def paid\r\n #if @notific...
4bad93e658f1e71649b85e57de73bb8e
GET /pets/1 GET /pets/1.json
[ { "docid": "87991dd893281f8cd11b515f554bd191", "score": "0.6858466", "text": "def show\n\n if !params[:id].nil?\n pet = Pet.find_by_id(params[:id])\n if pet\n render json: pet, include: :user, status: :ok\n else\n render json: {message: 'Pet doesn\\'t exist'}, status: :ba...
[ { "docid": "51b78fbe76579145bc96610db2e4ea39", "score": "0.75733095", "text": "def show\n @pet = Pet.find_by(id: params[:id])\n if @pet\n render json: @pet\n else\n render json: {}, status: 404\n end\n end", "title": "" }, { "docid": "18c7be2974052e9d0fa115effe73e2ee",...
7bdbea0ecc5cd8afb9241dff8b10e539
Lists all the iSCSI target groups available on a Tegile array.
[ { "docid": "44a26d0c62d1eef76d4f014d61f965fa", "score": "0.57502335", "text": "def list_iscsi_target_groups_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: SANApi.list_iscsi_target_groups_get ...\"\n end\n # resource ...
[ { "docid": "16e8de978bfd506fbf9a8721da4a43a6", "score": "0.77836215", "text": "def list_target_groups\n api_instance = IFClient::SANApi.new\n begin\n #*List all target groups available on IntelliFlash Array\n result = api_instance.list_target_groups_get\n # puts result.inspect\n ...
f249decadf6a376384b0dd813124824b
grammes, centilitres ou piece
[ { "docid": "fbafd9828b4b03f2bb3f84b81565b2c6", "score": "0.0", "text": "def quantity\n self[:quantity]\n end", "title": "" } ]
[ { "docid": "f4808efb434de24615e61104148ebc20", "score": "0.6231368", "text": "def impacto_hombre(gramos)\n alimento1 = Alimentos.new(\"Carne vaca\",21.1,0.0,3.1,50.0,164.0)\n alimento2 = Alimentos.new(\"Salmon\",19.9,0.0,13.6,6.0,3.7)\n alimento3 = Alimentos....
a6527a2ee7f77ed7a93a4b65ae76ef25
Obtain an InputSet object, used to define inputs for an execution of this Choreo.
[ { "docid": "46c47eee498e5af05587b6f9c61a0bcc", "score": "0.0", "text": "def new_input_set()\n return AutomobileTripInputSet.new()\n end", "title": "" } ]
[ { "docid": "64c57f88a4eac6079f885b7b88602378", "score": "0.66497", "text": "def execute(input_set = nil)\n # If the inputs are not configured, create a blank set.\n if input_set == nil\n input_set = InputSet.new()\n end\n param_map = {\"source_id\" => TembooSession.get_identifier()}\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "e888e787e6d7ceff12cac3811ff9a44b", "score": "0.0", "text": "def set_news\n @news = News.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...
c6bbbda11448c89332640061539f7f89
GET /products/new GET /products/new.xml
[ { "docid": "548a554cdffd85cb3d3fd24e6f107db0", "score": "0.0", "text": "def new\n @product = Product.new\n @product.photo = Photo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @product }\n end\n end", "title": "" } ]
[ { "docid": "31698ddacdfc4138f298bd484b3a0e5c", "score": "0.7649102", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @product }\n end\n end", "title": "" }, { "docid": "d617fd8e9581069ad5e58648d3e9b4aa", "score": "0.7...
bb77237fb36a828fd65e5733de46d4a1
Icons should be body text color by default and should not have a theme set by default.
[ { "docid": "c47d06e90e9ea218a668c7ada54b2b31", "score": "0.5246545", "text": "def default_theme\n nil\n end", "title": "" } ]
[ { "docid": "3a2793e7188338618ac63db65e4c7787", "score": "0.6673486", "text": "def icon_chooser\n \"red\"\n end", "title": "" }, { "docid": "a97cc6d8a885b21430d67a77dbf1a9d1", "score": "0.61416775", "text": "def randomize_icon_color\n self.icon = \"a\".concat(rand(0..9).to_...
c0668d2323de8e58b4dd1a259af3e5b2
DELETE /post321s/1 DELETE /post321s/1.xml
[ { "docid": "1c10efa29eaa2241814713f2360fa5a5", "score": "0.68468106", "text": "def destroy\n @post321 = Post321.find(params[:id])\n @post321.destroy\n\n respond_to do |format|\n format.html { redirect_to(post321s_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ...
[ { "docid": "e1d6f603cb5ea1e475ea71422432aeae", "score": "0.6882177", "text": "def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end", "title": "" }, { "docid": "275349bb6fd88d8cefabbfeb43df8930", "score": "0.68320835", "text": "def destroy\n @...
9a6549bd4d9d891cb72b714d4bfcf394
Set the value of the ResponseFormat input for this Choreo.
[ { "docid": "d2924c65a8ac0e53548242b0da6d7f41", "score": "0.0", "text": "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "title": "" } ]
[ { "docid": "77cc15d6d890482d623539da5f52a542", "score": "0.8194744", "text": "def set_ResponseFormat(value)\n set_input(\"ResponseFormat\", value)\n end", "title": "" }, { "docid": "77cc15d6d890482d623539da5f52a542", "score": "0.8194744", "text": "def set_ResponseFormat(v...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "78bb0207c24d8966ae7160b823ef4c9a", "score": "0.0", "text": "def result_params\n params.require(:result).permit(:team_id, :event_id, :round, :result_info , params[:r_id], params[:result_info])\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whit...
ac95289d068581d39a917a7730d15326
Lookup Data Tag Returns the Data Tag with the given `identifier`
[ { "docid": "d2affc5c358896c1e7a4cb4cee2a771d", "score": "0.67653304", "text": "def get_data_tag_by_id(identifier, opts = {})\n data, _status_code, _headers = get_data_tag_by_id_with_http_info(identifier, opts)\n return data\n end", "title": "" } ]
[ { "docid": "80be7997cff2ac9b08e79dd521fea1a6", "score": "0.64413154", "text": "def _tag name\n\t\tname = name.to_s.strip\n\t\tds\t = Sdb[:data_tag].filter(:name => name)\n\t\tif ds.empty?\n\t\t\tSdb[:data_tag].insert(:name => name) \n\t\t\tSdb[:data_tag].filter(:name => name).get(:dtid)\n\t\telse\n\t\t\...
389290d7dd9bb702e92e9474b7572be9
POST /orders POST /orders.json
[ { "docid": "3e8096d9e0777793e656ebdd6309891a", "score": "0.0", "text": "def create\n\t\tname = params[\"name\"]\n\t\temail_address = params[\"email_address\"]\n\t\tshipping_address = params[\"shipping_address\"]\n\t\torder_details = params[\"order_details\"]\n\t\treferred_by_id = params[\"referred_by_id...
[ { "docid": "e351d40efb5569993155750656dc7979", "score": "0.75886714", "text": "def orders\n authenticated_post(\"orders\").body\n end", "title": "" }, { "docid": "4e46e5bc223a332a8352fa259adf12e8", "score": "0.7490972", "text": "def orders\n authenticated_post(\"auth/r/o...
7be628c03d1a3837fe8199dfc6603236
GET /office_types GET /office_types.json
[ { "docid": "84eda0a4e85f11a3cacab25a7efd5633", "score": "0.7375133", "text": "def index\n @office_types = OfficeType.all\n end", "title": "" } ]
[ { "docid": "7b9bb8185478a9ce4fcfd8f5edf04f68", "score": "0.6634677", "text": "def index\n @poi_types = PoiType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @poi_types }\n end\n end", "title": "" }, { "docid": "c918...
c9952927f5fe897f7b6057ad98cc7321
checks to see if a given email is already in the database
[ { "docid": "16444c4adb69b9fe6ec057398e517969", "score": "0.78228104", "text": "def email_exists?(email)\n if self.find_by_email(email).nil?\n false\n else\n true\n end\n end", "title": "" } ]
[ { "docid": "2261db40c067fedb2b2d48a6683150ef", "score": "0.7898581", "text": "def email_exists?(email)\n emails.include?(email)\n end", "title": "" }, { "docid": "2261db40c067fedb2b2d48a6683150ef", "score": "0.7898581", "text": "def email_exists?(email)\n emails.in...
2227e4e9e9846bbd2883622576102586
POST /recipients POST /recipients.json
[ { "docid": "3c86287d3c089876a5115a2f5f58fcf7", "score": "0.62973017", "text": "def create\n @recipient = Recipient.new(recipient_params)\n\n respond_to do |format|\n if @recipient.save\n format.html { redirect_to @recipient, notice: '送付先情報を作成しました。' }\n format.json { render :show...
[ { "docid": "2ecde2c07672d7f3c955be30f43113a2", "score": "0.7065382", "text": "def create\n @recipient = @user.recipients.build(params[:recipient])\n\n respond_to do |format|\n if @recipient.save\n format.html { redirect_to(user_recipients_path(@user), :notice => 'Recipient was successf...
97e837161b8e583018ce572f044420db
Outputs nicely formated 2D location (no altitude)
[ { "docid": "104cf0eb933017ba9e0425241d2db989", "score": "0.0", "text": "def to_s\n prec = error_defined? ? \" +-#{@error.round()} m\" : ''\n valid? ? \"#{format(@latitude, 'NS')} #{format(@longitude, 'EW')}#{prec}\" : ''\n end", "title": "" } ]
[ { "docid": "c84ff4b770d6897950eb635d5d628836", "score": "0.7176899", "text": "def inspect\n strfcoord(%{#<#{self.class.name} %latd°%latm'%lats\"%lath %lngd°%lngm'%lngs\"%lngh>})\n end", "title": "" }, { "docid": "71ae34978573e4e5c15173a4b322f1c3", "score": "0.70121485", "text...
40f8ee24071bf5bb2c7d3257a0820405
Destroy a Synonym Set
[ { "docid": "b170e80b028c681c06ca39f823bc5780", "score": "0.0", "text": "def destroy_synonym_with_http_info(id, engine_name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: SynonymsApi.destroy_synonym ...\"\n end\n # verify the required ...
[ { "docid": "4dfa736aa40f97152f1da5ef11cce029", "score": "0.7040095", "text": "def clear_synonym\n return unless synonym\n\n names = synonyms\n\n # Get rid of the synonym if only one's going to be left in it.\n if names.count <= 2\n synonym&.destroy\n names.each do |n|\n n.sy...
1036a6c24e863f96c46cb0c2bcfde7a4
Wait a sec because tests will fail if a channel is not subscribed yet
[ { "docid": "3c018db1c3cdff022a5f87a2466c0f95", "score": "0.7479479", "text": "def wait_action_cable_subscription\n sleep 1\n end", "title": "" } ]
[ { "docid": "949d4b702055b1b7220ef36bacbcd628", "score": "0.69200253", "text": "def psubscribe_with_timeout(timeout, *channels, &block); end", "title": "" }, { "docid": "a04d533e137d9c91ef5e4029ffc52f96", "score": "0.68888694", "text": "def subscribe_with_timeout(timeout, *channels, &...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "04be9bebc8c55d902fae2bf8b2576e28", "score": "0.0", "text": "def update!(**args)\n @altitude = args[:altitude] if args.key?(:altitude)\n @aperture = args[:aperture] if args.key?(:aperture)\n @author = args[:author] if args.key?(:author)\n @author2 = args[:a...
[ { "docid": "150fa2bdc1fc43d28ac45e2278a1f797", "score": "0.7012677", "text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "t...
27b5279c3f25542c4858ee3150c0ced3
DELETE /login_details/1 DELETE /login_details/1.xml
[ { "docid": "ecd16e77ec4470d9ca16cf7706754d66", "score": "0.696979", "text": "def destroy\n @login_detail = LoginDetail.find(params[:id])\n @login_detail.destroy\n\n respond_to do |format|\n format.html { redirect_to(login_details_url) }\n format.xml { head :ok }\n end\n end", ...
[ { "docid": "34c0316d0413c0308c5f3e341e0cf3c8", "score": "0.6613351", "text": "def destroy\n @login = Login.find(params[:id])\n @login.destroy\n\n respond_to do |format|\n format.html { redirect_to(logins_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { ...
ee8fe701e29dd4249553fc6f12497aa6
Turns on blinking attribute for this text (not well supported by terminal emulators).
[ { "docid": "3dff11c70e82730b97a0a37e53aefd9e", "score": "0.69610435", "text": "def blink; end", "title": "" } ]
[ { "docid": "f863b3930ff53dd047158347fcac341c", "score": "0.7133665", "text": "def blink_on\n unless @_blink\n @_blink = true\n @_blink_count = 0\n end\n end", "title": "" }, { "docid": "fa329102355d500f633941d1800fcef8", "score": "0.689091", "text": "def bl...
7d566e028bec5cbc16a007dbc6129e28
POST /bill_reciepts POST /bill_reciepts.json
[ { "docid": "caaa8162dc6036de4e68174417473bb7", "score": "0.6957735", "text": "def create\n @bill_reciept = BillReciept.new(bill_reciept_params)\n\n respond_to do |format|\n if @bill_reciept.save\n format.html { redirect_to @bill_reciept, notice: 'Bill reciept was successfully created.'...
[ { "docid": "8f2c2972a7f1f831acb7d7e7dda119d1", "score": "0.68186563", "text": "def bill_reciept_params\n params.require(:bill_reciept).permit(:Title, :description, :amount)\n end", "title": "" }, { "docid": "23d71fa31c1c869be29658401b86bde6", "score": "0.6380373", "text": "de...