query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
3abdaec51dca4ce2d86ce4d153a4bc31
POST /lic_periods POST /lic_periods.json
[ { "docid": "80b2cf489f66111b5b28e0888caa6ae1", "score": "0.6297337", "text": "def create\n @lic_period = LicPeriod.new(lic_period_params)\n\n respond_to do |format|\n if @lic_period.save\n format.html { redirect_to @lic_period, notice: 'Lic period was successfully created.' }\n ...
[ { "docid": "4562b0d2c5512c67ed299a7f473b9795", "score": "0.65626085", "text": "def create\n @period = @company.periods.new(period_params)\n\n respond_to do |format|\n if @period.save\n format.html { redirect_to company_period_path(@company, @period), notice: 'Period was successfully cr...
bf952cc6ed4416ec9e1c696b2e794a2f
Sets the attribute account_name
[ { "docid": "4a15fe8571dda9e8bf3d3885a12b5de4", "score": "0.7202652", "text": "def account_name=(_arg0); end", "title": "" } ]
[ { "docid": "97415880554e3ee5b2c1cb1cd2699663", "score": "0.90128154", "text": "def account_name=(value)\n @account_name = value\n end", "title": "" }, { "docid": "97415880554e3ee5b2c1cb1cd2699663", "score": "0.90128154", "text": "def account_name=(value)\n ...
9669c2167700095cea24af0f573ae24e
optional filters for defining usage according to Casein::AdminUser access_levels before_filter :needs_admin, :except => [:action1, :action2] before_filter :needs_admin_or_current_user, :only => [:action1, :action2]
[ { "docid": "478afb93edaae0dfd11e6394e85ed92e", "score": "0.0", "text": "def index\n @casein_page_title = 'Menus'\n @menus = Menu.all\n @menu = Menu.new\n @pages = Page.published_now.order(:title)\n @course_formats = Courseformat.published_now\n end", "title": "" } ]
[ { "docid": "d589784ff97efd71f864cbda9981189e", "score": "0.6799583", "text": "def require_admin\n require_login unless current_user\n restrict_access unless current_user.is_admin\n end", "title": "" }, { "docid": "6ed1c29affa731e2a6c1c92afd2b0bde", "score": "0.67167586", "text...
c848a8b6764d96f27f6fa300d62787f9
Rolls the dice and advances +player+ accordingly
[ { "docid": "1c7c3419a313271bbe2b29187d1c4843", "score": "0.0", "text": "def advance_player!(player)\n \n\n player\n end", "title": "" } ]
[ { "docid": "7c141df254eea9cfef37d9b185ab410c", "score": "0.7947105", "text": "def advance_player!(player)\n dice = Die.new\n dice.roll\n @players_hash[player] += dice.roll\n end", "title": "" }, { "docid": "77899c9b7812abda5444488a7ccbcfc1", "score": "0.79237425", "text": "...
8ec1db9b93c783bd34d6bf7c324f2c8a
GET /admin/academy/workshops GET /admin/academy/workshops.json
[ { "docid": "8e91584533113e8d708064cea16745b8", "score": "0.67448354", "text": "def index\n @admin_academy_workshops = Academy::Workshop.all\n @aproved_workshops = Academy::Workshop.aproved_workshops\n @unaproved_workshops = Academy::Workshop.unaproved_workshops\n\n end", "title": "" } ]
[ { "docid": "d4e0ea1f652fc99b8823b20dc3e2214f", "score": "0.7243903", "text": "def index\n @shops = current_user.shops\n\n respond_to do |format|\n format.html\n format.json { render json: @shops }\n end\n end", "title": "" }, { "docid": "99fe22b1f8c60a40cc5cfebd0d9c62dd",...
455a898b8fe2961533d447fd5c056e99
POST /file_lists POST /file_lists.xml
[ { "docid": "5a9cacdf32c16191febdec5f2fc76e80", "score": "0.0", "text": "def create\n @file_list = UploadedFileList.new(params[:file_list])\n @page_section = @file_list.build_page_section(params[:page_section])\n @page = @page_section.page\n @site_section = @page.site_section\n\n\n respond...
[ { "docid": "397c2d49393f624d26a852b85260771b", "score": "0.67434293", "text": "def create\n @file_list = FileList.new(file_list_params)\n\n respond_to do |format|\n if @file_list.save\n format.html { redirect_to @file_list, notice: 'File list was successfully created.' }\n forma...
302fec1e7800a8953f57b8c58d59213f
Retrieve the scrollbar params from the content
[ { "docid": "bb799ec145e0279567b565edd509b7a6", "score": "0.76113135", "text": "def retrieve_scrollbar_param(hash)\n if hash\n hash[:max] = @content.max_origin\n hash[:min] = @content.min_origin\n hash[:direction] = @direction\n end\n return hash\n end", "title"...
[ { "docid": "9d22328d38161ea37d8e6c375e968bfc", "score": "0.638049", "text": "def get_scrollbarwidth\n @v_scroll.width\n end", "title": "" }, { "docid": "cd4a586fc7f845c8768e4fb1a01484d3", "score": "0.60465306", "text": "def scroll\n @scroll\n end", "title": "" }, { ...
9e6c04936ab8bb9319dd052a8dc78345
Gets status of the task. See +RTask::TaskStatus+ for all possible statuses.
[ { "docid": "ddcafa5aae38927389af733bd08b4d08", "score": "0.62398535", "text": "def status\n @__status\n end", "title": "" } ]
[ { "docid": "06c296c58376e95faa0628b699b9d6e6", "score": "0.79408467", "text": "def get_task_status(taskID, request_options = {})\n client.get_task_status(name, taskID, request_options)\n end", "title": "" }, { "docid": "fe872ee4c79d0933dd673b350f3def9a", "score": "0.73957086", ...
a06c8622eabf420fc654b8849fab156c
Function that returns a hashed list of items
[ { "docid": "0c61a4e6e47d6624c76700108ed5236b", "score": "0.0", "text": "def make_result_list(items)\r\n items.map do |item|\r\n {\r\n 'Question' => item['Question'],\r\n 'Options' => item['Options'].split(',').collect(&:strip),\r\n 'Answer' => item['Answer'].to_i,\r\n }\r\n ...
[ { "docid": "1689c75117c52098bdbb83425340bd7b", "score": "0.74587727", "text": "def hash; @items.hash end", "title": "" }, { "docid": "e3d91423c06ed3a08409d7c0fc591820", "score": "0.7241546", "text": "def items_hash()\n return @items\n end", "title": "" }, { "docid": "...
689399f4f8b955bd55cd76e924cc18ca
This method is used to check the user guess against the game answer It not only compares the guess and game arrays but if necessary compares the characters aswell, for this reason the core of the checks is run as a for loop and not a foreach, so that i can keep track of the index numbers of the individual characters.
[ { "docid": "9120a3a430aa4e8f2a01e504f461ba61", "score": "0.8056363", "text": "def check_answer(player_guess)\n\n #Split the players guess into an array of chars\n player_chars = player_guess.split('')\n\n # First see if the player list equals the game list\n # If it does the player has won a...
[ { "docid": "651f36a2a131688c43f7bc41cf418ea0", "score": "0.74866945", "text": "def check_letter(guess)\n if @word.include? guess\n puts \"You chose wisely!\"\n #find which position(s) the guess is in the word array\n correct_index_arr = @word.each_index.select { |i| @word[i] == guess }...
c3070a3e0c6e37e3c5b40b10663db481
Will search eMIS for the provided form subject and return `true` if the subject is a verteran. The result will be cached and subsequent calls will return the cached value, preventing additional api requests.
[ { "docid": "e0535489466de222feccf49115131a25", "score": "0.73067546", "text": "def is_veteran(form_subject) # rubocop:disable Naming/PredicateName\n cached_veteran_status = @cache[:veteran_statuses][form_subject]\n return cached_veteran_status unless cached_veteran_status.nil?\n\n icn = i...
[ { "docid": "a77cecf3d2487d7a00f8e51e1c124958", "score": "0.73737246", "text": "def is_veteran(form_subject) # rubocop:disable Naming/PredicateName\n cached_veteran_status = @cache[:veteran_statuses][form_subject]\n return cached_veteran_status unless cached_veteran_status.nil?\n\n icn = i...
1d50cec53c8ef8a1e223eceddf345722
Previews the entire cookbook
[ { "docid": "4ff2e605aefdee1745257772bebf56ff", "score": "0.65824974", "text": "def add_cookbook(cookbook)\n\n # Use high-def template image for this cookbook if it's not a preview\n cookbook.template.image_version = 'original' if ! is_preview?\n\n add_cover(cookbook)\n add_blank_page\n ad...
[ { "docid": "317c7bbe296ad778a12663a3d0ccdf45", "score": "0.6360445", "text": "def render_cookbook\n\n # Use high-def template image for this cookbook if it's not a preview\n @cookbook.template.image_version = 'original' if !is_preview?\n\n render_cover\n render_blank_page\n render_inner_c...
0640350db973fd7236f1462733da4349
Needs to block for a period of seconds.
[ { "docid": "437310febf5316a31e91f713b92db600", "score": "0.0", "text": "def shift(a)\n @client.sendmsg(\"SHIFT #{a.to_s}\\n\")\n r = decode(read_response)\n\n # Should probably improve error-handline.\n if r.starts_with?(\"Error:\")\n nil\n else\n r\n end\n end", "title"...
[ { "docid": "e663055cebbecee35735b233000168a4", "score": "0.7171288", "text": "def implicit_wait=(seconds); end", "title": "" }, { "docid": "0cc31f28862e071383b50dfab8efb457", "score": "0.71482116", "text": "def waiting; end", "title": "" }, { "docid": "0cc31f28862e071383b...
75b8a2b842dde70f2530a4150b8aa20f
Returns a specific item.
[ { "docid": "b637e6b4fd81915beedc714e8d77e852", "score": "0.0", "text": "def item(item, options={})\n params = { :klass => Invoicexpress::Models::Item }\n\n get(\"items/#{id_from_item(item)}.xml\", params.merge(options))\n end", "title": "" } ]
[ { "docid": "36bdcbba5d7710b978b110d15d4e0688", "score": "0.81764543", "text": "def item\n Item.find(id)\n end", "title": "" }, { "docid": "f1082b9d415682dd50c0a3cf4f8b12f4", "score": "0.81397444", "text": "def item(id)\r\n get(\"item/#{id}\")\r\n end", "title": ""...
bdef8ac31cf4cb2091882dfeb1099fc7
PUT /itemmasters/1 PUT /itemmasters/1.xml
[ { "docid": "baa58f59bb45a8f07dce21cc4a1e5552", "score": "0.6415158", "text": "def update\n @itemmaster = Itemmaster.find(params[:id])\n\n respond_to do |format|\n if @itemmaster.update_attributes(params[:itemmaster])\n format.html { redirect_to(@itemmaster, :notice => 'Itemmaster was s...
[ { "docid": "c6e9ee82f9f0918f23a043eea93c63eb", "score": "0.65097684", "text": "def update\n @master_item = Master::Item.find(params[:id])\n\n respond_to do |format|\n if @master_item.update_attributes(params[:master_item])\n format.html { redirect_to(@master_item, :notice => 'Item was ...
ffb290018be3315306d6976ca0385dd3
GET /mashups/1 GET /mashups/1.json
[ { "docid": "0789437479c148f88a6636113ab8c97f", "score": "0.66295266", "text": "def show\n @mashup = Mashup.find(params[:id]) \n \n # if params[:user_id] || params[:login]\n # authenticate\n # if @user.temporal.id != @mashup.id \n # @user.regenerate_temporal @mashup\n ...
[ { "docid": "1e7bed4f4a7000e8c795c366cd77cbac", "score": "0.7383035", "text": "def index\n @mashups = @user.mashups\n respond_to do |format|\n format.json { render json: @mashups.as_json(include: {:keywords => {}, :links => {include: {:link_source => {}}} })}\n end\n end", "title": "" ...
0e9cb9793b968178b696a6179787a2bc
Sets request headers for specific _browser_. Available browsers can be obtained with Futile::Headers::REQUEST.keys.
[ { "docid": "0fbb3526a904fe0d2ee0a3ca91c7d57b", "score": "0.6953144", "text": "def browser=(browser)\n clear\n @_current_browser = browser\n headers = REQUEST[current_browser]\n unless headers\n msg = \"Browser '%s' not found. Available browsers: %s\" % [current_browser, REQUEST.keys.joi...
[ { "docid": "c877e920b81ec3a37ad624ae151cd508", "score": "0.6662929", "text": "def request_headers= request_headers\n @agent.request_headers = request_headers\n end", "title": "" }, { "docid": "82d1304355e81599e915d9c6d217c824", "score": "0.6647328", "text": "def headers=(headers)...
fabca22c4b088d1363e58b4526197730
Array, urls of the post's craigslisthosted images
[ { "docid": "0fe04839dee6e3c1dde77a1fbedebc10", "score": "0.7683265", "text": "def pics\n unless @pics\n @pics = []\n \n if html and craigslist_body\n # Now let's find the craigslist hosted images:\n img_table = (craigslist_body / 'table').find{|e| e.name == 'table' and e[...
[ { "docid": "4516c39d2866463b6fad63700abd0615", "score": "0.74556863", "text": "def image_urls\n []\n end", "title": "" }, { "docid": "33f90c4859426ab5575efffb382c5b12", "score": "0.7402152", "text": "def image_urls\n self.images.map do |image|\n image.url\n end\n ...
a5837a34cb076638d36d53f9bb412348
Does this permission template require a specific date of release for all works NOTE: date will be in release_date
[ { "docid": "c66b1ab83b5e46b39be12202ac7e0365", "score": "0.5667325", "text": "def release_fixed_date?\n release_period == RELEASE_TEXT_VALUE_FIXED\n end", "title": "" } ]
[ { "docid": "369697f66e49bb3bc228e0a01b9ee993", "score": "0.752014", "text": "def release_before_date?\n # All PermissionTemplate embargoes are dynamically determined release before dates\n release_period == RELEASE_TEXT_VALUE_BEFORE_DATE || release_max_embargo?\n end", "title": "" }, ...
d40c785c612b93362175dd81f5355a14
Get method name for printing instance's alt attribute
[ { "docid": "a51a03136fc49ae40a7dc41fbdfb18b9", "score": "0.6548383", "text": "def image_tag_alt(instance)\n\t\tsend(instance.class.to_s.underscore + \"_alt_attribute\", instance)\n\tend", "title": "" } ]
[ { "docid": "0bca5e6242ad1bb87f8a730a02eb21d7", "score": "0.69433135", "text": "def image_alt_attribute_name\r\n return \"#{self.name}\"\r\n end", "title": "" }, { "docid": "0bca5e6242ad1bb87f8a730a02eb21d7", "score": "0.69433135", "text": "def image_alt_attribute_name\r\n ...
f305977fd056224c0e307c3fd59dfbed
Exam versions can specify their own start, end and durations, which override the examwide settings. The effective_start_time is either the exam_version's start time, if defined, or else the exam's start time.
[ { "docid": "459205a9f58c05017d9fcc6ec3dabc8e", "score": "0.6625318", "text": "def effective_start_time\n start_time || exam.start_time\n end", "title": "" } ]
[ { "docid": "3efd7148a6fca8b6e12c9570598395c2", "score": "0.5702697", "text": "def effective_end_time\n end_time || exam.end_time\n end", "title": "" }, { "docid": "3f26150823ee41520b72de512bfbc8be", "score": "0.5599505", "text": "def effective_duration\n duration || exam.durat...
266d6a4d4f1aca1346da351a2e301496
PATCH/PUT /car_requests/1 PATCH/PUT /car_requests/1.json
[ { "docid": "faf483df6f64f12a9943f8eca2898680", "score": "0.56728023", "text": "def update\n redirect_to :root and return unless @car_request.aasm.events.map(&:name).map(&:to_s).include? params[:form_action]\n @car_request.send(params[:form_action], nil, current_user)\n @car_request.save!\n r...
[ { "docid": "256494593f6b47f3826c4e47c65276ac", "score": "0.65896136", "text": "def update\n @request.assign_json_attributes(params) if @request.resume?\n respond_to do |format|\n if @request.update(request_params)\n format.html { redirect_to @request, notice: 'Request was successfully ...
bd6057e166be2813ab660b6b0b0ec063
Execute the specified hook.
[ { "docid": "ca04b4845ba6d6e8eed60235be686fb8", "score": "0.6571717", "text": "def exec_hook(name, *args, &block)\n e_before = hooks.errors.size\n hooks.exec_hook(name, *args, &block).tap do\n hooks.errors[e_before..-1].each do |e|\n output.puts \"#{name} hook failed: #{e.class}: #{e.me...
[ { "docid": "6173afd1b1144ca65d14887f6d4701d6", "score": "0.75183576", "text": "def fire(hook, *args); end", "title": "" }, { "docid": "60cc46b3ded3b34968b29e9d64db373e", "score": "0.74035513", "text": "def execute_hook(event_name, args)\n @hook_manager.exec_hook(event_name, args...
0639907624c3a4ae4e3c9213447bf7f4
Return a range of members in a sorted set, by score, with scores ordered from high to low.
[ { "docid": "48f1788e1355d120e1c16e95196fe56d", "score": "0.5411602", "text": "def zrevrangebyscore(key, max, min, withscores: T.unsafe(nil), with_scores: T.unsafe(nil), limit: T.unsafe(nil)); end", "title": "" } ]
[ { "docid": "10b65254962ec2234c8a72eafba2b12c", "score": "0.6702339", "text": "def range(rng)\n start = rng.first\n stop = rng.last\n ##\n # Build up a list of pairs: [id, score]\n pairs = @redis.zrevrange(@store, start, stop, withscores: true)\n ##\n # Get rid of nils,...
eadc46b6e5290f4c35ba77af82b7a905
PATCH/PUT /face_sets/1 PATCH/PUT /face_sets/1.json
[ { "docid": "df75d95c32457bf3d66867556f10d997", "score": "0.74791294", "text": "def update\n respond_to do |format|\n if @face_set.update(face_set_params)\n format.html { redirect_to @face_set, notice: 'Face set was successfully updated.' }\n format.json { render :show, status: :ok,...
[ { "docid": "ac9e75061a9746d56fdfa0af891d9253", "score": "0.6472714", "text": "def set_face_set\n @face_set = FaceSet.find(params[:id])\n end", "title": "" }, { "docid": "b7ae2305630fcedc29f870cea4069b0e", "score": "0.63684523", "text": "def update\n respond_to do |format|\...
7bbe9ee791874633bc014c5a74f0d2d6
Test was flagged as being ignored so format the output
[ { "docid": "be6b4092eaa7582897156f208567a62c", "score": "0.6598222", "text": "def test_ignored(array)\n last_item = array.length - 1\n test_name = array[last_item - 2]\n reason = array[last_item].chomp.lstrip\n class_name = array[@class_name_idx]\n\n if test_name.start_with? 'TEST('\n ...
[ { "docid": "02ea3e23c3e9face7fe854c56c642869", "score": "0.66733104", "text": "def not_ok(test, i)\n message = \"not ok #{i + 1}\"\n message += ' - ' + test.name if test.name\n message += \"\\n \" + test.errors.join(\"\\n \") if test.errors\n puts message\n end", "title": ""...
c3dc3159fd491f9d3bc2a5ee9544045d
GET /coupons GET /coupons.xml
[ { "docid": "5d896925ad88b701754633a0e6e65ffd", "score": "0.69053453", "text": "def index\n @coupons = Coupon.find(:all)\n\n if @coupons.empty?\n @coupons << Coupon.new({\n :id => 999,\n :name => \"Test coupon\",\n ...
[ { "docid": "8e308980ac4f5d54a941a0956e4d1b38", "score": "0.7465595", "text": "def show\n @coupons = Coupon.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @coupons }\n end\n end", "title": "" }, { "docid": "8434b0a...
dfda2362e469384b401ccf98f5d4520c
GET /projects/search GET /projects/search.xml
[ { "docid": "3391b6f95c5e95fd4b273b36c125fe83", "score": "0.616408", "text": "def search()\n @countries = Country.partners.order('name').all()\n \n if params.has_key?('country') && !params[:country].empty?\n if params[:query].empty?\n @results= Project.\n select('p.id, p.tit...
[ { "docid": "519eaabca537b907502bad87cf21d88a", "score": "0.73162717", "text": "def index\n @projects = Project.search(params[:search])\n end", "title": "" }, { "docid": "519eaabca537b907502bad87cf21d88a", "score": "0.73162717", "text": "def index\n @projects = Project.search(p...
04c9eda00f780c4062d60a758085b373
Return changes on indivual key
[ { "docid": "c73bbe610d059328473b0656ca9548d0", "score": "0.0", "text": "def single_diffs(value, reference)\n value != reference ? [reference, value] : nil\n end", "title": "" } ]
[ { "docid": "36edadb35b0203aae9da2a8aae769894", "score": "0.7933824", "text": "def change_key_changes\n Array( change_key ).inject( [] ) do |m,k|\n c = state[ k ]\n if c\n m + c\n else\n m\n end\n end\n end", "title": "" }, { "docid":...
2b107c64768187610247f40572824100
the two strings, and then returns the result of concatenating the shorter string, the longer string, and the shorter string once again. You may assume that the strings are of different lengths. input: two strings output: input strings conacat (short, long, short) to one string assume: inputs are different lengths logic...
[ { "docid": "1a1092ee1032b95e83cf5b0d00cea0e1", "score": "0.8428661", "text": "def short_long_short(str1, str2)\n short = ''\n long = ''\n if str1.length > str2.length\n short = str2\n long = str1\n else\n short = str1\n long = str2\n end\n short + long + short\nend", "title": "" ...
[ { "docid": "ecae235548c7078fcc69872e50c88fbc", "score": "0.85221887", "text": "def short_long_short(string1, string2)\n newstring = \"\"\n if string1.length > string2.length\n newstring = string2.concat(string1, string2)\n else\n newstring = string1.concat(string2, string1)\n end\nend", "t...
491d7e1cf7074b9adffcad04839d0929
calculs de synthese somme des cout de tout les produits pulverises sur la parcelle
[ { "docid": "3132a5d68268d0c448eb6a52c832eda1", "score": "0.6164884", "text": "def get_cout_ha_produits\n\t sum = 0\n\t self.putoparcelles.each do |putoparcelle|\n \t\tputoparcelle.pulve.putoproduits.each do |putoproduit|\n \t\t\tsum += putoproduit.get_cout_ha_parcelle(self)\n end\n end\n ...
[ { "docid": "4b2db9be450dd8011213f86748b89f2b", "score": "0.646982", "text": "def promedios\n promedio = (@nota1.to_f + @nota2.to_f + @nota3.to_f) / 3\n promedio\n end", "title": "" }, { "docid": "8eb58c6ebfc859a3edfc50c739fadbc1", "score": "0.6062019", "text": "def get_protein...
c76a42c128b6aa480443b19983236648
Return the attributes needed for the LDAP search. It will only include the user attributes if onthefly registration is enabled
[ { "docid": "5b04c64a64b6bcc77ed870898743b1f5", "score": "0.7706118", "text": "def search_attributes\n\t\t['dn', self.attr_firstname, self.attr_lastname, self.attr_mail, self.attr_member]\n\tend", "title": "" } ]
[ { "docid": "76246e8557a85f0ba37f59980d16afa3", "score": "0.7675993", "text": "def get_ldap_allusers_attributes(upi:, attributes:)\n response = {}\n @treebase = 'dc=UoA,dc=auckland,dc=ac,dc=nz'\n filter = Net::LDAP::Filter.eq( 'objectCategory', 'user' ) & Net::LDAP::Filter.eq('cn', \"#{upi}\")\n...
de4b366637c9c46289fcb7a287ed61ca
dump table migration creation and its index(es) add two spacing
[ { "docid": "0e8c836aa17a3d535df0d8684ed4edfe", "score": "0.0", "text": "def individual_table(table, stream)\n dump = StringIO.new\n table(table, dump)\n dump.rewind\n dump.each_line {|t|stream.puts \" #{t}\"}\n end", "title": "" } ]
[ { "docid": "edbd66473b979ed9b6f809606932bb9d", "score": "0.7404079", "text": "def table_migration( table )\n src_db.dump_table_schema table, indexes: true, :same_db => same_db\n end", "title": "" }, { "docid": "6afa2e762ffc5b1b3b8ab6f3b09b1c53", "score": "0.66946036", "text":...
ad162222c6245b8513c49243fe3f68f7
GET /user_guesses/1 GET /user_guesses/1.json
[ { "docid": "6649591a338ba7011f1f1a6b369766fe", "score": "0.6456017", "text": "def show\n @user_guess = UserGuess.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_guess }\n end\n end", "title": "" } ]
[ { "docid": "50d3296118c62a30740b154e02e8b7ba", "score": "0.7693383", "text": "def popular_guesses\n about_user = User.find_by(id: params[:about_user_id].to_i)\n return render json: { error: 'User cannot be found.' }, status: 403 if about_user.nil?\n\n popular_guesses = get_popular_guesses_about...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.0", "text": "def set_team\n @team = Team.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...
a53bdfdafe63a649e1638a8e0933cefd
Display Connections Buttons Logic The purpose of this helper is to display connection buttons in connections page, right next to connection's name. According to current profile's friendship with current_user, this helper will display proper connection button. Besides, if current_user sees his/her own name, in someone's...
[ { "docid": "8c56a55d9215072076e04dda56ad701a", "score": "0.8470177", "text": "def display_connections_buttons(friend)\n if current_user.friends.include?(friend)\n render 'profiles/connections/connections_buttons', locals: {button: 'dropdown', path: disconnect_path(friend.id), modal_id: friend.id...
[ { "docid": "99b01c586f15734a04168b0467b4a561", "score": "0.60907495", "text": "def follow_buttons\n current_user_following_ids = h.current_user.following_ids\n following = current_user_following_ids.include?(object.id)\n state = following ? \"following\" : \"follow\"\n container_class_names ...
b143700b9273c728e5e4024d93b4ca80
set the default attributes
[ { "docid": "955434333b7d779b377b891b0838ad3d", "score": "0.0", "text": "def set_defaults\n self.rate ||= 0\n end", "title": "" } ]
[ { "docid": "3f6468cb1499ece0dbd23fadfce67f46", "score": "0.7793746", "text": "def set_default_attributes\n self.attributes = default_attributes\n self.attributes.each do |key, value|\n # Scrub the attributes if there's no value\n attr_clean!(key) unless value\n end...
bf11a68ae35b3a2f241ae24660de5265
Bruteforce the login page
[ { "docid": "7d7f239baa4813fcfce442c9cb9746fa", "score": "0.0", "text": "def do_login(user, pass)\n vprint_status(\"#{rhost}:#{rport} - Trying username:#{user.inspect} with password:#{pass.inspect}\")\n begin\n res = send_request_cgi(\n {\n 'uri' => '/index.html',\n 'm...
[ { "docid": "75f2d1f8259b0fab724b7f5bbe899a49", "score": "0.7556048", "text": "def login ; end", "title": "" }, { "docid": "096656013ed38b7b1dbeeac711e44c18", "score": "0.734068", "text": "def login; end", "title": "" }, { "docid": "096656013ed38b7b1dbeeac711e44c18", "...
1e38ea2fc8679e79a648eea803d2b6e8
initializes this RestSememeLogicGraphVersion with a json hash
[ { "docid": "61670357f912ca678ccf84e7319ac1be", "score": "0.56550163", "text": "def init_jaxb_json_hash(_o)\n super _o\n if !_o['referencedConceptDescription'].nil?\n _oa = _o['referencedConceptDescription']\n if(_oa.is_a? Hash)\n @referencedConceptDescription...
[ { "docid": "44efb9947ee65e8b20979ffadd3a0854", "score": "0.66827136", "text": "def initialize(hash={})\n update_from_json(hash)\n end", "title": "" }, { "docid": "058a5b609dae4c2c4b051fcad81f32d0", "score": "0.6516938", "text": "def initialize(json)\n super\n end", ...
c214df1ba4a5d312a4333af19fd7ff82
def calendar_resource(parent, resource, collection) rest_resource(parent, (resource || collection.to_sym), :calendar, :view => :month, :type => (collection || :appointments)) end page banner
[ { "docid": "2c324ae4733e4f610c94a3f39c6b80bb", "score": "0.0", "text": "def site_banner\n \"<h1>#{APPLICATION_NAME}</h1>\"\n end", "title": "" } ]
[ { "docid": "18c6cbe561851bde9f9905ab448600b3", "score": "0.68730134", "text": "def calendar\n render \"calendar\"\n end", "title": "" }, { "docid": "d9045f9102eab661610858a0b11aa3c8", "score": "0.67745936", "text": "def generate_calendar_resource\n raise NotImplementedError\n ...
4a23ad5a0d27fbf64e2e78c4d0022e98
converts a Gosu::button_down id into a key object
[ { "docid": "1547e8079b57f423c49cb2999de988bf", "score": "0.74481374", "text": "def get_key(id)\n if id == Gosu::KbUp then Key.new(:up, nil, :north)\n elsif id == Gosu::KbLeft then Key.new(:left, nil, :west)\n elsif id == Gosu::KbDown then Key.new(:down, nil, :south)\n elsif id == Gos...
[ { "docid": "4f1dd2a4d769c13ad22538a043a66b83", "score": "0.7238467", "text": "def button_down(id)\n if id == Gosu::KbQ\n close\n elsif id == Gosu::KbEscape\n if @state == :menu\n close\n elsif @state == :instructions\n @state = :menu\n else\n @state = :menu...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "ef6ef3b96089d0c4ea35c6694d231de1", "score": "0.0", "text": "def set_person\n @person = Person.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;...
15cf3ced5529b62ad1294387a503f6db
We need both the preceding and the next key
[ { "docid": "c4cbbadf668a42f2eef4f1c6b843d64b", "score": "0.0", "text": "def key_pair_to_segment(key, next_key)\n case key.interpolation\n when :bezier\n BezierSegment.new(key.frame, next_key.frame,\n key.value, next_key.value, \n key.r_handle_x, \n key.r_handle_...
[ { "docid": "8c9f3004668d6b5ffb973354eac609d5", "score": "0.74059856", "text": "def next_key\n @next && @next.key\n end", "title": "" }, { "docid": "251b4df0b3149f4d727915fd0cdc6b0d", "score": "0.671848", "text": "def each_key\n\t record = @head\r\n\t while r...
2757fb68eecc7d9e8eddedd9418400ee
Review Generation Settings: Update Updates any generation settings specified in a specified account. Call may include any/all settings available to the account. Settings not included will remain unchanged.
[ { "docid": "80e2ace640ce5c80cceb9ce9beffb9ff", "score": "0.65484625", "text": "def update_review_generation_settings_with_http_info(account_id, v, review_generation_settings_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ReviewsApi.upda...
[ { "docid": "6abd11afb42184be11a0023e2f5050e0", "score": "0.68449295", "text": "def update_review_generation_settings(account_id, v, review_generation_settings_request, opts = {})\n data, _status_code, _headers = update_review_generation_settings_with_http_info(account_id, v, review_generation_setti...
faacde5f9388bfe40ec03d54377915f5
PATCH/PUT /grupopermissaousers/1 PATCH/PUT /grupopermissaousers/1.json
[ { "docid": "a84811ada5bc0c2e1a75222d7b1193e5", "score": "0.66177124", "text": "def update\n respond_to do |format|\n if @grupopermissaouser.update(grupopermissaouser_params)\n format.html { redirect_to @grupopermissaouser, notice: 'Grupopermissaouser was successfully updated.' }\n ...
[ { "docid": "7093cf31d15554c3ac88a37d85a83e98", "score": "0.6858122", "text": "def update\n precisa_ser_super_admin\n return if performed?\n\n adicionar_breadcrumb @grupo.nome, @grupo, \"editar\"\n\n @pessoa = Pessoa.new if @pessoa.nil?\n\n respond_to do |format|\n if @grupo.update(gr...
9f47d8acac522c1d5df9f7593ee1e079
todo: move to somewhere the rails model can use it as well?
[ { "docid": "16ec95563be4ecfe5416196487b4877c", "score": "0.0", "text": "def ensure_relation(remote_node, attributes = nil)\n if rel = @storage.to_other(remote_node).first\n rel.attributes= attributes if attributes\n rel\n else\n relate(remote_node, attr...
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.71253455", "text": "def private; end", "title": "" }, { "docid": "19d9764a2c7f930b2a464848744cafcd", "score": "0.66141737", "text": "def model_class; end", "title": "" }, { "docid": "afc4151049de4a403982da492f69b3...
f4b77d3681957a9d038dead5f5bcacae
POST /capacitycodes POST /capacitycodes.json
[ { "docid": "0a1f0d18cffddec4394ec66b8ccb6a0b", "score": "0.73603195", "text": "def create\n @capacitycode = Capacitycode.new(capacitycode_params)\n @capacitycode.save\n redirect_to capacitycodes_path\n end", "title": "" } ]
[ { "docid": "c26f5b964efb7b7a6e4319a4d1837dfd", "score": "0.70913297", "text": "def capacitycode_params\n params.require(:capacitycode).permit(:text, :capacity_number, :alert)\n end", "title": "" }, { "docid": "a7c210944d14cbbd630fd2787fa310a7", "score": "0.654021", "text": "d...
04cb1b3b6993a870739fe8ed136b5962
Update the current value with the result of the given block fast, block can do blocking calls
[ { "docid": "5278ccdbc3177eb2db321b7a7529f6d5", "score": "0.0", "text": "def post_off(&block)\n post_on(@io_executor, &block)\n end", "title": "" } ]
[ { "docid": "fd8e4f3eed70111c055431f38d7aa46e", "score": "0.71426815", "text": "def update(block)\n render_basics\n render_progress(remaining_percentage)\n @current_value = block.call(current_value)\n end", "title": "" }, { "docid": "581efef9c2edb5428f48ce257277b75a", "score": "...
43f9a5366a9d7427459d56ef25d20325
Return the nesting depth of the current heading level with respect to the base heading level. This is a onebased number.
[ { "docid": "ead54b8208be676d21464bf846eb9345", "score": "0.7533414", "text": "def depth\n @cur_level - @base_level + 1\n end", "title": "" } ]
[ { "docid": "a1f785a79997d89efe88692006b17ae8", "score": "0.69542795", "text": "def level\n root? ? 0 : ancestors.count\n end", "title": "" }, { "docid": "48be39f7fe151cc7c2f8044f5e63b866", "score": "0.6943853", "text": "def level\n return 0 if root?\n\n @par...
556b7d353cf8479132dc0feecbb8b901
(payment) required to fully amortize a loan of "loan" dollars over a term of "duration" months at a monthly interest rate of "interest". [If the quoted rate is 6%, for example, "interest" is .06/12 or .005]
[ { "docid": "7f41e10ecd0e27ff4df7348ea5745be7", "score": "0.0", "text": "def loan_type_checker?(type)\n if type == \"1\" || type == \"2\"\n type\n end\nend", "title": "" } ]
[ { "docid": "d2886d02a3e3fb713c4683d6b58e57c5", "score": "0.8156028", "text": "def monthly_payment(amount, monthly_interest, duration_in_months)\n amount * (monthly_interest /\n (1 - (1 + monthly_interest)**-duration_in_months))\nend", "title": "" }, { "docid": "3eabb24336075c811b0...
a7a817661c0faa5c863dfc7d8fa829b2
Returns the string representation of the object
[ { "docid": "fec7805191a4770d142d624c5b92a77f", "score": "0.0", "text": "def to_s\n to_hash.to_s\n end", "title": "" } ]
[ { "docid": "fbdd4f858146598aaabf84003282a8d1", "score": "0.901777", "text": "def to_s\n @object.to_s\n end", "title": "" }, { "docid": "d69be2e09bbb16dc0e9df0ec2905d3f4", "score": "0.88380826", "text": "def to_s\n\t\treturn self.obj.to_s\n\tend", "title": "" }, ...
2a16ee8c6271d3c490b0573a1cd7fe54
Function that checks if the HTTP referer comes from one of the domains listed in the config file.
[ { "docid": "c91e67ef05bb8eab99e21bc541113bc3", "score": "0.7157304", "text": "def check_trusted_domain\n options.domains.any? do |domain|\n request.referer =~ create_escaped_regexp(domain)\n end\n end", "title": "" } ]
[ { "docid": "a7647743670f70d375566a41c496c1ab", "score": "0.74020547", "text": "def is_referer_domain_allowed? (referer_host)\n GlobalConstant::WebDomain.allowed_referer_domains.include?(referer_host.split(\".\").last(2).join(\".\"))\n end", "title": "" }, { "docid": "92d2ec570a14dce46782...
eb4e1a686d568c49ba613cdda5c29b71
INDEX is responsible to show all actors. == Returns
[ { "docid": "5964fd73a4b65579c37cb3dc08502291", "score": "0.82861406", "text": "def index\n # The variable @actors receive all actors.\n @actors = Actor.all\n end", "title": "" } ]
[ { "docid": "ef66418ac065e2591a9ac738199ea0ac", "score": "0.81862795", "text": "def index\n @actors = Actor.all\n end", "title": "" }, { "docid": "ef66418ac065e2591a9ac738199ea0ac", "score": "0.81862795", "text": "def index\n @actors = Actor.all\n end", "title": "" }, ...
ac3a92d27448fb1f476a3e8fcb0f7ac3
Singleton access to diseases controller
[ { "docid": "fd9c6e63e64c8814c1a3f192e02829f3", "score": "0.79036206", "text": "def diseases\r\n DiseasesController.instance\r\n end", "title": "" } ]
[ { "docid": "a8306102cf8792f5b2103e781efba55c", "score": "0.6476986", "text": "def instance\n self[:instance] ||= controller.new\n end", "title": "" }, { "docid": "1120d39c88ca653bfef01afdfcc1d03e", "score": "0.62521374", "text": "def liability_doctor_insurance\r\n Liabil...
c321029753c8f233033437b95eae94d5
Renders a dropdown list that can be used for filtering a data table. This works in conjunction with the 'filter_column()' JS function. The Incline scaffold generates this function for you, so this helper can be used with generated lists. The +label+ is the text to display for the header. The +column+ is the column numb...
[ { "docid": "22b1c844b13aa2e979715a8960af8140", "score": "0.7831731", "text": "def dt_header_filter(label, column, list)\n column = CGI::escape_html(column.to_s)\n label = CGI::escape_html(label.to_s)\n\n list =\n if list.is_a?(::Array) && list.any?\n list\n ...
[ { "docid": "274c2cd6c0a3548b55eea717db2e13c0", "score": "0.6374802", "text": "def list_nav_filter(list)\n s = '<table class=\"axial\"><tr>'\n s += '<th>Filter</th><td>'\n if list.length == 1\n s += list.first.first\n s += '&nbsp;<input type=\"hidden\" name=\"filter_field\" value=\"' ...
b629a2539bc16a027983b76ea4fa2bb0
POST /macro_indicator_options POST /macro_indicator_options.xml
[ { "docid": "355259b3b2c8838491d172f1f94f2bc1", "score": "0.67522216", "text": "def create\n @macro_indicator_option = MacroIndicatorOption.new(params[:macro_indicator_option])\n\n respond_to do |format|\n if @macro_indicator_option.save\n format.html { redirect_to(@macro_indicator_opti...
[ { "docid": "e95bf61990d6459d1936b04b33c4a3d9", "score": "0.5859501", "text": "def new\n @macro_indicator_option = MacroIndicatorOption.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @macro_indicator_option }\n end\n end", "title": "" ...
ed2e2768578aed3b3b863d8309f35125
POST /park_spaces POST /park_spaces.json
[ { "docid": "2c50252e7e555723c5b5bfe9ed04e208", "score": "0.74176013", "text": "def create\r\n @park_space = ParkSpace.new(park_space_params)\r\n\r\n respond_to do |format|\r\n if @park_space.save\r\n format.html { redirect_to @park_space, notice: 'Park space was successfully created.' ...
[ { "docid": "b3a822704ad1981499271f2454ed6b16", "score": "0.738354", "text": "def create\n @parking_space = current_user.parking_space.new(post_params)\n\n respond_to do |format|\n if @parking_space.save\n format.html { redirect_to @parking_space, notice: 'Parking space was successfully...
0062fde009422b16328edeb2532865cd
Return if a child should fork every time that a job will process. This option is overwrited by job options and fork_every This is used by Worker::Child
[ { "docid": "1e1eb605ac17735d222b744ed92db927", "score": "0.7538903", "text": "def default_fork_every\n defined?(@@default_fork_every) ? @@default_fork_every : true\n end", "title": "" } ]
[ { "docid": "f0ed1d99991c986e2c2ff99fcb00bb94", "score": "0.7396547", "text": "def forked?\n Process.pid != @fork_pid\n end", "title": "" }, { "docid": "e85220873344b1aa3dd9255818736b85", "score": "0.719137", "text": "def forking?\n app_server_integration.forking? || ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "3c0dacc17144383e7a47993dac9c6cce", "score": "0.0", "text": "def comment_params\n params.require(:comment).permit(:comment, :task_id, :creator_email)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7497917", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69572496", "text": "def strong_params\n params.require(:request).permit(param_whit...
f4921b443916778480d76ca1b6338d9d
The Patient class needs an instance method, doctors, that iterates over that patient's Appointments and collects the doctor that belongs to each Appointment.
[ { "docid": "43cd14b7823997148221c44c73b59231", "score": "0.81014097", "text": "def doctors\n appointments.map do |appointment|\n appointment.doctor\n end\nend", "title": "" } ]
[ { "docid": "b1db537ac6cd73fa9912f5ac4e21b2f1", "score": "0.84694827", "text": "def patients\n self.appointments.map do |doctors_appts|\n doctors_appts.patient\n end\n end", "title": "" }, { "docid": "a7a0308504c0d1f8234f0bc2d49104f6", "score": "0.8359257", ...
874919f488166d67f1924e277b14fb44
remove all nodes that are not relevant to target
[ { "docid": "77a7375f0e081d7177e68e1dceb8358c", "score": "0.0", "text": "def ancestors(target)\n ancestors = []\n until target == \"COM\"\n target = parent(target)\n ancestors.append(target)\n end\n ancestors\n end", "title": "" } ]
[ { "docid": "26df7742448a3b8643ab46b8e6432855", "score": "0.6885499", "text": "def remove_subtree targets\n t = targets.to_set\n t.delete self.parent\n (t-accessible_locations).to_a\n end", "title": "" }, { "docid": "7df121e563201e574bb41cc07459e732", "score": "0.67174387", ...
dfec685500ebad0a827fefaf0a645bb6
Returns an array of the pattern compiler instance ids for the currently selected tester platform.
[ { "docid": "a96da2404b0385e94de62ae52d53364d", "score": "0.7325215", "text": "def pattern_compiler_instances(p = platform)\n # Check if nil which means no tester is defined so ask user to supply it\n fail \"No tester platform defined so supply one of the following as an argument: #{PLATFORMS.j...
[ { "docid": "00bb8dfcc3021db6e178ee138a60d400", "score": "0.73088086", "text": "def pattern_compiler_instances(p = platform)\n # Check if nil which means no tester is defined so ask user to supply it\n if p.nil?\n fail \"No tester platform defined, supply one of the following as an argum...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "2dee7add51e1b6ef82f7d7354cd2f012", "score": "0.0", "text": "def set_annonce\n @annonce = Annonce.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...
076afa4a3087050cf5c53ccb57ff23d5
Check that fixed header flags are valid for types that don't use the flags
[ { "docid": "a3ff22d8dd1db01fda22435bf397e989", "score": "0.74108386", "text": "def validate_flags\n return if flags == [false, false, false, false]\n\n raise ProtocolException, \"Invalid flags in #{type_name} packet header\"\n end", "title": "" } ]
[ { "docid": "428efd43634bdadd0980080bd66f53b1", "score": "0.735093", "text": "def validate_flags\n if @flags != [false, true, false, false]\n raise PahoMqtt::PacketFormatException.new(\n \"Invalid flags in #{type_name} packet header\")\n end\n end", "title...
4e08af21b1f29f979d1e3a735bc72f59
Converts this object to a representation directly serializable to Extended JSON (
[ { "docid": "f438752358cd58108111abc7128f825b", "score": "0.0", "text": "def as_extended_json(**_options)\n { \"$code\" => javascript }\n end", "title": "" } ]
[ { "docid": "5a5615315675a270b46625a9e25f31c6", "score": "0.7720179", "text": "def to_json\n restore\n\n Synaptical::Serializer::JSON.as_json(self)\n end", "title": "" }, { "docid": "b55304c454583ca15062adfeb226daf8", "score": "0.76739025", "text": "def json_encoded\n ...
b8c4ac1086c73d8305f4e102bef69dc2
GET /shots/1 GET /shots/1.xml
[ { "docid": "4efbc45d9f151f3b80a5ab286d1fe5c4", "score": "0.72211355", "text": "def show\n @shot = Shot.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @shot }\n end\n end", "title": "" } ]
[ { "docid": "917d192faf7c44e5e86594439abbfa35", "score": "0.6924274", "text": "def show\n res = open(\"http://api.dribbble.com/shots/#{params[:id]}\")\n code, message = res.status # res.status => [\"200\", \"OK\"]\n\n if code == '200'\n result = ActiveSupport::JSON.decode res.read\n @s...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "7674fc7551df73e4ea1a29d4ed906c9e", "score": "0.0", "text": "def set_entity\n @record = @entity_model.find_by!(gid: 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...
fbc712e2f2975eae7b130aca2f257c4d
Setting a nil values causes a segfaults and other errors in the talib library so we must be careful not to set nil values in tags in setter methods.
[ { "docid": "45bb9719133e8f786c4928fbedef8320", "score": "0.0", "text": "def set_artwork(filename)\n return unless filename\n\n apic = TagLib::ID3v2::AttachedPictureFrame.new\n apic.mime_type = \"image/jpeg\"\n apic.description = \"Cover\"\n apic.type = TagLib::ID3v2::AttachedPic...
[ { "docid": "febc10c9b9b4d14a889510a8f4d8b6a5", "score": "0.6540718", "text": "def nil_blank_values\n\t\tself.description = nil if !self.description.nil? && self.description.blank?\n\t\tself.creator = nil if !self.creator.nil? && self.creator.blank?\n\tend", "title": "" }, { "docid": "21e083e...
9d550820cf3446e1da225450145a910f
Get the hexagon at (x,y) coordinate. Returns : the Hex::Axial object at x, y pos.
[ { "docid": "aa95c9cda4bd5eddd0d0681644a2ea4c", "score": "0.7279435", "text": "def hex_at_xy(x, y)\n q = (x * Math.sqrt(3)/3.0 - y/3.0) / @hex_ray\n r = y * 2.0/3.0 / @hex_ray\n hex = AxialHex.new(q, r).round\n cget( hex.q, hex.r )\n end", "title": "" } ]
[ { "docid": "d79988e60e3d3c619253e736715e4dfb", "score": "0.6406933", "text": "def to_xy( hex )\n tmp_q = hex.q\n x = @hex_ray * Math.sqrt(3) * ( tmp_q + hex.r/2.0 )\n y = @hex_ray * 3.0/2.0 * hex.r\n [ x, y ]\n end", "title": "" }, { "docid": "6a51fd3997c31276d1e102940d8043ef", ...
10f2ae762371e9ebb97f61b82b28c716
POST /old_systems POST /old_systems.json
[ { "docid": "c962fa8691a08cc8f0c6baab3c95e3d0", "score": "0.75000226", "text": "def create\n @old_system = OldSystem.new(old_system_params)\n\n respond_to do |format|\n if @old_system.save\n format.html { redirect_to @old_system, notice: 'Old system was successfully created.' }\n ...
[ { "docid": "8cfbe064cea81ad4cc4602173b25efc2", "score": "0.65086085", "text": "def update\n respond_to do |format|\n if @old_system.update(old_system_params)\n format.html { redirect_to @old_system, notice: 'Old system was successfully updated.' }\n format.json { render :show, stat...
c2502c7c714f84b39771c70a80d83ebd
Parameters: :statistics Capture statistics on how many messages have been read true : This method will capture statistics on the number of messages received and the time it took to process them. The timer starts when the listener instance is created and finishes when either the last message was received, or when Destin...
[ { "docid": "38de05912100ddad8d3ff2f5665da1cf", "score": "0.55959624", "text": "def initialize(params={}, &proc)\n @proc = proc\n\n if params[:statistics]\n @message_count = 0\n @start_time = Time.now\n end\n end", "title": "" } ]
[ { "docid": "9a7de86946a54b7a2e58f5d2e0fa961b", "score": "0.7478943", "text": "def on_message_statistics\n stats = @listener.statistics if @listener\n raise \"First call Consumer::on_message with :statistics=>true before calling Consumer::statistics()\" unless stats\n stats\n end", "title":...
6cad5769430162d5b3fe091073df4885
summary: Indicates whether some of the things were filtered. remarks: Thing may be filtered because of security settings on the record. value is a String
[ { "docid": "be9574e947b2924bfeef52026827f51d", "score": "0.58000994", "text": "def filtered=(value)\n @children['filtered'][:value] = value\n end", "title": "" } ]
[ { "docid": "80ed6301f4112f47c56ed59ee7435423", "score": "0.73758", "text": "def filter(value)\n true\n end", "title": "" }, { "docid": "feea68cf9c76babaef54779c551124a0", "score": "0.6856674", "text": "def filterable?; @filterable; end", "title": "" }, { "doci...
196f8241bced61e01d66051b1e769271
The value of "rhost" is listed in $RhostClass or not
[ { "docid": "b65f417342afaa20e0214fb6bb9d1308", "score": "0.6158499", "text": "def match(host)\n return false unless host.is_a? ::String\n return true if RhostClass.key?(host.downcase)\n return false\n end", "title": "" } ]
[ { "docid": "97c5740b0126ccd5e5c7beaf2d0b0f41", "score": "0.66510946", "text": "def rhost\n\tself.target_host\nend", "title": "" }, { "docid": "d725a7d80263ba6b8eaa159119f71af9", "score": "0.65346986", "text": "def rhost\n\t\tdatastore['RHOST']\n\tend", "title": "" }, { "d...
303dcde63ab68b4881011b08318d695c
Public: prints a summary of mismatches seen so far to STDOUT (see `summary` above). Returns nil.
[ { "docid": "daaa4375a1bfa9d6fc79c367febcfb0e", "score": "0.5389742", "text": "def summarize\n puts summary\n end", "title": "" } ]
[ { "docid": "118d526b7993d6e63d9f8be2775391a8", "score": "0.6096807", "text": "def dump_failed_examples_summary\n if @write_to_file\n $stdout.puts(@failed_examples)\n else\n @output.puts(@failed_examples)\n end\n end", "title": "" }, { "...
393e4dac197a633590c9a810f873fc6b
POST /deployments POST /deployments.json
[ { "docid": "fe569076d8b17e0521461078326bc164", "score": "0.62369245", "text": "def create\n @deployment = DeploymentMongo.new(deployment_params)\n\n respond_to do |format|\n if @deployment.save\n format.json { render json: { status: :created, mongo_id: @deployment.mongo_id } }\...
[ { "docid": "a065469c5bb1faa449ba7e9ca75c6206", "score": "0.67218053", "text": "def create\n @app_deployment = @application.app_deployments.new(params[:app_deployment])\n\n respond_to do |format|\n if @app_deployment.save\n format.html { redirect_to @app_deployment, notice: 'App deploym...
7b9d99dd2988a3534ef0a32479b5377e
serialize model and set it to model_data
[ { "docid": "9e4eae59dc47ec04ba973199f817e2ea", "score": "0.0", "text": "def record=(record)\n self.record_data = Base64.encode64(Marshal.dump(record))\n end", "title": "" } ]
[ { "docid": "d4ba872cacd2b27e00e4a3de44a9f5b9", "score": "0.74930185", "text": "def serialize(model)\n end", "title": "" }, { "docid": "8cc3bfb68089c2a887519ff4672a94d2", "score": "0.6495159", "text": "def before_save\n deserialized_values.each{|k,v| @values[k] = serialize_v...
cfad8baf52f4c047ee632658f46af161
PUT /roles/1 PUT /roles/1.json
[ { "docid": "d3de044c4b64663e6d0a95e234e291c7", "score": "0.6913143", "text": "def update\n @role = Role.find(params[:id])\n\n respond_to do |format|\n if @role.update_attributes(params[:role])\n format.html { redirect_to admin_role_path(@role), notice: 'Role was successfully updated.' ...
[ { "docid": "6d47fbe9f1779b599c7f435b630dc2b2", "score": "0.74504143", "text": "def update\n role = Role.find(params[:id])\n if role.update(role_params)\n render json: role, status: 200, location: [:api, role]\n else\n failed_to_update(role, \"role\")\n end\n end", "title": "" ...
764f71a3fbb9686c3b8d2877dad08894
Sends XTYP_REQUEST transaction to server if conversation was already established. item:: item witch data is requestet
[ { "docid": "2f3631ce4b907320bd267733c2e3436f", "score": "0.56590205", "text": "def request_data( item )\n handle, trans_id = start_transaction(XTYP_REQUEST, nil, 0, CF_TEXT, item)\n buffer, size = dde_get_data(handle)\n return [buffer.read_string_to_null,size]\n end", "title": "" ...
[ { "docid": "64f114c9f21a9d18a8ba769beab45d5b", "score": "0.62760323", "text": "def request(type:, input_transaction: false)\n\n self.requests.reload\n self.donations.reload\n system(\"clear\")\n\n case type\n\n when \"create\"\n\n active_donation = i...
e0f482f6492bda9402c7aef2d63fcc75
DELETE /goals/1 DELETE /goals/1.json
[ { "docid": "7d34a4a0905ec438c0e902a66996f566", "score": "0.6838503", "text": "def destroy\n @goal.destroy\n all_goals = Goal.all.where(user_id: current_user.id)\n\n c_goal = all_goals.where(current_goal: true)\n c_goal.each do |c|\n c.current_goal = false\n c.save\n end\n\n l...
[ { "docid": "7115691780a30d726d21900cbaa529d7", "score": "0.7850001", "text": "def destroy\n @goal = Goal.find(params[:id])\n @goal.destroy\n\n respond_to do |format|\n format.html { redirect_to list_goals_path }\n format.json { head :no_content }\n end\n end", "title": "" },...
34b25991533491ab50d1fabe393934d7
This method accepts a block and using the puppet resource 'host' will setup host aliases before and after that block on the default host
[ { "docid": "9d8f4376d318da81a04d2ca0329469c6", "score": "0.5665767", "text": "def stub_hosts(ip_spec)\n stub_hosts_on(default, ip_spec)\n end", "title": "" } ]
[ { "docid": "68184190c0c1f77b3389e536b933eb95", "score": "0.6677902", "text": "def each_host(&block)\n\t\thosts.each do |host|\n\t\t\tblock.call(host)\n\t\tend\n\tend", "title": "" }, { "docid": "09b4ddb6f2dc798eb2e54d641f8edd43", "score": "0.6369536", "text": "def each_host(&block)\n...
c06e1c400340202a5515015b091cc50b
designed to receive DayTypes already covered by rules in a Ruleset, and returns an array of days NOT covered by rules
[ { "docid": "9281bdce8d2ad377042dc5fceefe4d2a", "score": "0.61989087", "text": "def find_default_schedule_days(known_days)\n covered_days = []\n available_days = [\"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\", \"Sunday\"]\n weekday_days = [\"Monday\", \"Tuesday\"...
[ { "docid": "aff50cf0961721166eac90ed83420427", "score": "0.62479836", "text": "def filter_non_availability_days(start_date, end_date)\n business_days = []\n current_day = start_date\n\n while current_day <= end_date\n business_days << current_day unless\n weekend?(current_day) || ho...
d9684310dc3573aa5564aa4427da2adb
for speed up partial, create these helpers instead of partial
[ { "docid": "771be0112fb22b11f941e2f6a5d7da11", "score": "0.0", "text": "def partial_editor( editor, param_values)\n #local_params: editor, param_values\n @param_category_ids = [] \n <<-EOS\n <div id=\"editor_#{editor.id}\" class=\"block param_value_editor\">\n #{ para...
[ { "docid": "50551315a24035ff3681735b9054de19", "score": "0.72592974", "text": "def render_partial(*args, **kwargs); end", "title": "" }, { "docid": "4dfc8b6f64f51aac14f47810fbad3d0d", "score": "0.72325385", "text": "def show_partial; ''; end", "title": "" }, { "docid": ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "3a220ee3a89ae6ab088c2603890daf11", "score": "0.0", "text": "def college_employee_params\n params.require(:college_employee).permit(:name, :company, :location, :phone_no)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7498391", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6958937", "text": "def strong_params\n params.require(:request).permit(param_white...
9cd32412e364fcac2e6475cfba73c4a6
Test that callbacks are assigned to a link
[ { "docid": "655d53db92f9b596e689b48d8317232e", "score": "0.80382913", "text": "def test_linklist_callbacks\r\n assert(@linklist.callbacks.size == 2)\r\n \r\n assert(@linklist.callbacks.include?('link_added'))\r\n assert(@linklist.callbacks.include?('link_removed')) \r\n end",...
[ { "docid": "02e0667c615ff2f13bf701ab6ba76a5e", "score": "0.65283066", "text": "def click(link); end", "title": "" }, { "docid": "0b0c0cebd317a184ca9391149644512f", "score": "0.6167166", "text": "def test_link\n authenticated_client.link test_link_full_name\nend", "title": "" }...
4a51eb0c5ac277ece7f75bfc4301e708
metodi palindromi, joka testaa on lause palindromi
[ { "docid": "8e105c9e9f549f2faf064ae9eef17cc1", "score": "0.7784719", "text": "def palindromi()\n print \"Kirjoita testattava lause: \"\n lause = gets.chomp\n # muutetaan lause pieniksi kirjaimiksi ja siivotaan lauseesta välilyönnit\n testattava_lause = lause.downcase.delete(\" \")\n # ilmoitetaan ...
[ { "docid": "94131704f7ba2cb073d36538a45e09db", "score": "0.78363645", "text": "def es_palindromo(texto_a_analizar)\n\t# Texto a analizar, sin espacios, ni numeros\n\ttexto = solo_letras(texto_a_analizar)\n\t# Redondeo para arriba por si la cantidad de letras es impar\n\tcantidad = (texto.length / 2).cei...
67b6fcc66eb2025959daa6f207c558d3
Kill query. === Argument pid :: [Integer] thread id === Return self
[ { "docid": "7f6ee4ce137f083b9164bd940e68d092", "score": "0.71068555", "text": "def kill(pid)\n check_connection\n @protocol.kill_command pid\n self\n end", "title": "" } ]
[ { "docid": "6da3894ea39e99b5cdabf9e5b4d0c2d0", "score": "0.6323751", "text": "def kill\n unless pid.nil?\n WITH_PBS ? `qdel #{pid}` : Process.kill(\"TERM\", -pid.to_i)\n set_status! :m\n end\n end", "title": "" }, { "docid": "127ee2d01106030569d6af66c07f5262", "score": "...
8d2ac637fedef8cd4442c6c4e0904b65
End moved from UserDecorator Devise automatically downcases and strips any attribute defined in config.case_insensitive_keys and config.strip_whitespace_keys via before_validation callbacks. Email is included by default, which means that every time the User model is saved, even if the email wasn't updated, a DB call wi...
[ { "docid": "11697d6675d9bade43fe8da80729d832", "score": "0.0", "text": "def downcase_keys\n # no-op\n end", "title": "" } ]
[ { "docid": "36f3cee62504ba875c2bc083c0598be3", "score": "0.737236", "text": "def normalize_user\n \tself.email.downcase! if self.email\n end", "title": "" }, { "docid": "290f7a742883af196f24f2e7a64f1675", "score": "0.72436017", "text": "def strip_and_downcase_email\n if self...
60251d5949acb6365da7a175b06b3f83
DELETE /shopping_carts/1 DELETE /shopping_carts/1.json
[ { "docid": "543fc77ba898ff06bf2a93a084f9775c", "score": "0.7370409", "text": "def destroy\n @shopping_cart.destroy\n\n respond_to do |format|\n format.html do\n redirect_to(\n shopping_carts_url,\n notice: \"Shopping cart was successfully destroyed.\"\n )\n ...
[ { "docid": "6c292ce38180ac9cd9c926891409a461", "score": "0.8086587", "text": "def destroy\n @cart.destroy\n format.json { head :no_content }\n end", "title": "" }, { "docid": "ba07b58d69d14330b9a2a9ef355e6f7c", "score": "0.7788294", "text": "def destroy\n @cart.cart_items.f...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "a70a37b535809c1e68519d4a3f26d075", "score": "0.0", "text": "def set_buzzword\n @buzzword = Buzzword.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;...
7f92ada58052a61da2530c13c6d34a67
introspect on available scopes
[ { "docid": "bf075114e4dfa9dab5990521210ae60f", "score": "0.6874352", "text": "def scopes\n @scopes ||= {}\n end", "title": "" } ]
[ { "docid": "f3c13a1a81915ee7e7acb15e84307ded", "score": "0.7488025", "text": "def scopes; end", "title": "" }, { "docid": "369a080182e9b475620053bb6ac7ff5a", "score": "0.6821775", "text": "def scopes\n @scope.scopes\n end", "title": "" }, { "docid": "70987fabbf223...
ab88c2b4a6561cf9888051dad2390be8
This helper method takes the list of checked usernames and then adds them as members to the specified group
[ { "docid": "7636edcb1e2334626f7bb9593ffc5579", "score": "0.655067", "text": "def add_users(api,users)\n # Adds the usernames to the specified group. Throws an exception if the given\n # group id does not exist\n users.each do |user|\n user = user.strip\n api.add_member_to_group(user,@...
[ { "docid": "ec43c60c45e821c84d31d50787c40cd2", "score": "0.7189616", "text": "def add_user_2group(username,group)\n defaults = {\"group\" => group, \"members\" => \"[\"+username+\"]\"}\n result = @gesm.add_term_to_record_array(group, \"members\", username, defaults)\n end", "title": "" }, ...
96b109bf98ffa646c679afc807b87d9f
Define a method for calculating possible scores given a set of cards
[ { "docid": "6671398a1113e514a30047255c53f8b1", "score": "0.77857345", "text": "def possible_scores(cards)\n scores = [0]\n\n cards.each do |card|\n if card.face != 'Ace'\n scores.map! {|score| score + card.value} \n else\n new_scores = Array.new\n scores.each do |score|\n n...
[ { "docid": "5b928fba202a43f9371747ec5d5fa331", "score": "0.7849427", "text": "def get_score (cards)\n\t\tscore = 0\n\t\tcards.each do |card|\n\t\t\tmeasure = card[0]\n\t\t\tscore += @score[measure]\n\t\tend\n\t\tscore\n\tend", "title": "" }, { "docid": "34324f1a61d003232371eeccf5c16f88", ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "a64db6f3c0f00387eba140ea68b16882", "score": "0.0", "text": "def indoor_activity_params\n params.require(:indoor_activity).permit(:name, :description, :release_date)\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...
9c15ddc431443ac670c1f4e7328222bb
Saves a users financial profile
[ { "docid": "be7b807b7fde0b45c9cc15c194446f01", "score": "0.619149", "text": "def save_financials\n current_user.update(assets: params[:assets], average_annual_income: params[:average_annual_income], credit_score: params[:credit_score], total_debt: params[:total_debt])\n user_listings = current_use...
[ { "docid": "01f684fdee41fe946c563baae1daff02", "score": "0.70133495", "text": "def save\n\t\tbegin\n\t\t\tuser_profile = self.profile\n\t\t\tUser.create(\n\t\t\t\t:user_id => id,\n\t\t\t\t:login_name => username,\n\t\t\t\t:email => email,\n\t\t\t\t:join_tsz => created,\n\t\t\t\t:transaction_buy_count =>...
773ff8460baee2b501aec9a732daff57
only valid for types BITMAP, ICON & CURSOR
[ { "docid": "8ea2c1f0f858e3d2a660b994883801f9", "score": "0.0", "text": "def bitmap_mask src_fname\n File.open(src_fname, \"rb\") do |f|\n parse f\n bmp_info_hdr = bitmap_hdr\n bitmap_size = BITMAPINFOHEADER::SIZE + @palette_size + @imgdata_size\n return nil if bitmap_siz...
[ { "docid": "405b0eb50d01ee19d519b525549b6990", "score": "0.57210326", "text": "def is_bitmap?\r\n return @bitmapFile.is_a?(BitmapWrapper) || @bitmapFile.is_a?(Bitmap)\r\n end", "title": "" }, { "docid": "aacb68c24a515ddc5dfa06df90c367b3", "score": "0.567602", "text": "def validat...
b67551a1b5cac29774478fde7755a105
Getter for the IndividualRecord for the specified key. Returns nil when not found.
[ { "docid": "a77317c2a18cb18c0ec4e19eb77b0041", "score": "0.64338446", "text": "def get_record_with_key(encoded_key)\n @list[encoded_key]\n end", "title": "" } ]
[ { "docid": "1b609b6d13351afd825fd4ccfd5a4357", "score": "0.66555077", "text": "def fetch_individual_record\n # FIXME: We should raise an error instead of returning nil if the id param is missing\n return nil unless params.key?(:id) || @individual_record\n @individual_record ||= model_scop...
c0a3c5a2bd3e0c5eb2e6462a63f8fe42
Returns +true+ if +url+ is a valid 0mq transport specification.
[ { "docid": "53f7ef6031c63dd91bc06f3776d942b5", "score": "0.82557374", "text": "def check_0mq_spec( url )\n\t\treturn \"must not be nil\" unless url\n\n\t\tu = URI( url )\n\t\treturn \"invalid 0mq transport #{u.scheme}\" unless VALID_SPEC_SCHEMES.include?( u.scheme )\n\n\t\treturn nil\n\trescue URI::Inva...
[ { "docid": "9b3f37991198f18a1f551f7f4fc87ebb", "score": "0.6831177", "text": "def valid_url?(url)\n uri = URI(url)\n uri.is_a?(URI::FTP) or uri.is_a?(URI::HTTP)\n end", "title": "" }, { "docid": "dc7f1048ec38a2fe84329e42c5581a57", "score": "0.6645415", "text": "def url_valid?(...
acb743975f21bcdd7297ddec041441cd
Cleanup after a command.
[ { "docid": "b5d38d8a393d2a1d65f77f2f060ee74a", "score": "0.0", "text": "def cleanup_command(shell_id, command_id)\n s = Savon::SOAP::XML.new\n s.version = 2\n s.namespaces.merge!(namespaces)\n s.header.merge!(merge_headers(header,resource_uri_cmd,action_signal,selector_shell_id(shell...
[ { "docid": "8cd42ba18d34c1a0c7b22a0459aaf181", "score": "0.76356727", "text": "def mina_cleanup!\n run! if commands.any?\n end", "title": "" }, { "docid": "7705e08d4501ef81f30660d1f44cc5f7", "score": "0.7408708", "text": "def cleanup_after(cmd, text, bat)\n\t\tbegin\n\t\t\t# ...
b989a8d8165c3ef9e90646377f7d1685
GET /department_masters/new GET /department_masters/new.xml
[ { "docid": "1cdeed56c4cf144e9e6505b5efc0ab7c", "score": "0.0", "text": "def new\n @department_master = DepartmentMaster.new\n@session_id=session[:id]\n\t@session = Session.find(session[:id])\n\t@person = Person.find(@session.person_id)\n\t@org_code = @person.org_code\n\t@org_location = @person.org_lo...
[ { "docid": "0c4e19661a681bd89a407ec9915535d5", "score": "0.7596582", "text": "def new\n @departmentmaster = Departmentmaster.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @departmentmaster }\n end\n end", "title": "" }, { "doci...
cc8295030f25dcdffa8149821523156f
This method mean that an item is truly optional. One vendor may choose to include the item because a particular marketplace requires it or because the vendor feels that it enhances the product while another vendor may omit the same item. An implementation which does not include a particular option must be prepared to i...
[ { "docid": "693f89e7c19292fb0129d60955c71f1a", "score": "0.0", "text": "def MAY(matcher)\n ::Spectus::Requirement::Optional.new(\n isolate: false,\n negate: false,\n matcher: matcher\n )\n end", "title": "" } ]
[ { "docid": "cf81759220e8865d78a84f7d46326ed2", "score": "0.66620266", "text": "def extra_item?\n false\n end", "title": "" }, { "docid": "63e3cac7882121d90b98dba6e4580da6", "score": "0.6487683", "text": "def extend_item(item)\n item.is_a?(Hash) && item[:excluded] ? nil : ite...