query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
b9258ba94ef3b475c3ebf61b1fb81e41
Joins a channel. This does so by lodging a callback listening for the channel on any JOIN messages, and then tells the bot to request joining a channel.
[ { "docid": "493832fbf443c0c35898bd3c3f0874c0", "score": "0.7545498", "text": "def join_channel( bot, chan )\n # Join the channel\n bot.join( chan )\n\n return if @config[:connect_only]\n me = self\n\n # Hook for when we have successfully joined\n register_hook(\"chan_join_#{chan}\".to_...
[ { "docid": "aaceb615581c44176d2be05935eafece", "score": "0.7216067", "text": "def join(channel)\n send \"JOIN #{channel}\"\n end", "title": "" }, { "docid": "1f067154ee581517cf73b95a8234491a", "score": "0.71331763", "text": "def handle_join!(message, channel_name)\n @k...
cad573349f8e26c55cefcc054beb7dfe
Out of borders movement PLACE 0,0,SOUTH MOVE REPORT Output: 0,0,SOUTH RIGHT REPORT Output: 0,0, WEST MOVE REPORT Output: 0,0, WEST PLACE 4,4,NORTH MOVE REPORT Output: 4,4,NORTH RIGHT REPORT Output: 4,4,EAST MOVE REPORT Output: 4,4,EAST
[ { "docid": "b660ca0bed91eab5f10fe0d53d803709", "score": "0.8135311", "text": "def test_out_of_borders_movement\r\n actual_test([\"PLACE 0,0,SOUTH\",\r\n \"MOVE\",\r\n \"REPORT\"],\"0,0,SOUTH\")\r\n $stdout.clear\r\n actual_test([\"RIGHT\",\r\n \"R...
[ { "docid": "5d95d432699e7e4e24c1d90a88409df2", "score": "0.72301453", "text": "def test_out_of_borders_placement\r\n actual_test([\"PLACE 0,0,NORTH\",\r\n \"PLACE -1,-1,NORTH\",\r\n \"REPORT\"],\"0,0,NORTH\")\r\n $stdout.clear\r\n actual_test([\"PLACE 5,5,NORTH\"...
bf0f215969d78e7186a8e003b6462e69
Transforms the prefix into a string of bits representing the netmask prefix = IPAddress::Prefix128.new 64 prefix.bits => "1111111111111111111111111111111111111111111111111111111111111111" "0000000000000000000000000000000000000000000000000000000000000000"
[ { "docid": "3db9f8dd4ed07aaff43bf479d6fca2bf", "score": "0.643939", "text": "def bits()\n return netmask().toString(2)\n end", "title": "" } ]
[ { "docid": "853b239229a9309e8c3a4908a42386a6", "score": "0.79777104", "text": "def prefix\n return(0) if (@mask_addr == 0)\n length=32\n if (ipv6?)\n length=128\n end\n\n mask = nil\n netmask_int = @mask_addr\n if (netmask_int < 2**length)\n mask = length\n else\n ...
c0c400f4ba8b25e64b3f2132ea54b94f
perform all conversation and cleanup steps def process_gfm()
[ { "docid": "d2c0e5f9c81dd85951941b3f52057ebc", "score": "0.0", "text": "def process_markdown()\n docx_2_markdown(@options[:file])\n cleanup_content_markdown()\n create_ref_style_links() if @options[:ref_style_links]\n add_frontmatter() if @options[:jekyll]\n end", "title": "" } ]
[ { "docid": "164e78ab9693ba935bf88d470f7ce1de", "score": "0.58378744", "text": "def process_leftovers\n #puts \"Processing leftovers\"\n\n @context.storage.get_many('msgs').each do |msg|\n #puts \"Processing #{msg.inspect}\"\n\n process msg\n end\n\n #puts \"...
8838172c768f283ab6380fe00060c59d
=begin The Stringto_i method converts a string of numeric characters (including an optional plus or minus sign) to an Integer. Stringto_i and the Integer constructor (Integer()) behave similarly. In this exercise, you will create a method that does the same thing. Write a method that takes a String of digits, and retur...
[ { "docid": "181430760a55b0cc4ebce6ce374d980d", "score": "0.772887", "text": "def string_to_integer(input)\n hash = {\"0\"=>0, \"1\"=>1, \"2\"=>2, \"3\"=>3, \"4\"=>4, \"5\"=>5, \"6\"=>6, \"7\"=>7, \"8\"=>8, \"9\"=>9}\n split_input = input.split('')\n int_array = split_input.map { |digit| hash[digit] }...
[ { "docid": "e7f8a0e2b431fd8f5cd43c063622ce23", "score": "0.8312808", "text": "def string_to_integer(string)\n digits_string = string.chars\n\n digits_num = []\n\n digits_string.each do |digit|\n (0..9).each do |num|\n if digit == num.to_s\n digits_num << num\n end\n end\n ...
07a1b3cccb722c134ac09271e6dd5daa
Recebe o login do usuario e senha Testa se o arquivo de lista de usuarios existe testa se o usuario esta presente na lista Se o usuario e a senha forem encontrados, os dados do usuario sao lidos do arquivo do usuario para a memoria do programa e retorna true Caso contrario, retorna false
[ { "docid": "fb9cd3df319a1d61927c30b34510f12a", "score": "0.71579665", "text": "def logar(log, pass)\n if File.exist?('usuarios.txt')\n lines = File.readlines('usuarios.txt')\n lines.each do |line|\n info = line.split\n if log == info[1] && pass == info[2]\n self.id = ...
[ { "docid": "cd180e984d4b764afdaf6bc88354cd3d", "score": "0.69505966", "text": "def login_exists?(ff_username = @user_login)\n enc_username = @tools.encrypt_user_login(ff_username)\n rsp = ff_user_api_proceed_get_request(enc_username,'')\n raise IOError, \"HTTP return code: #{rsp.code}\" unless ...
3db0d0cf07fa16e8f5521196997f09a8
Example: Marconi.inbound.purge_q('foo_q') Use judiciously this tosses all messages in the Q!
[ { "docid": "8d45912d9fe0293816a2e8ec81403d26", "score": "0.76475155", "text": "def purge_q(q_name)\n connect\n unless q_name.blank?\n if o = exists?(:queue, q_name)\n o.purge\n end\n end\n rescue Bunny::ForcedChannelCloseError\n connect(true) # Connection is...
[ { "docid": "4c62a3af8db8095399ea2b1bd23f1629", "score": "0.7302701", "text": "def purge opts = {}\n @mq.callback{\n @mq.send Protocol::Queue::Purge.new({ :queue => name,\n :nowait => true }.merge(opts))\n }\n nil\n end", "title": ...
4712ef167b989b8d774df1db7df61306
Returns the name of the author of this news
[ { "docid": "2b001dc7c88609b101030262fc27938d", "score": "0.0", "text": "def author; end", "title": "" } ]
[ { "docid": "53f00addfe5d22cd1499121a043af173", "score": "0.8619", "text": "def author_name\n author.author_name\n end", "title": "" }, { "docid": "433b8ee6288798cb29a9bc60068372bc", "score": "0.8454695", "text": "def getAuthorName\n\t\treturn User.find(self.user_id).usern...
787963251246c9584e179e9d9145b4f3
0%..100% (1: not measured)
[ { "docid": "a0c2fb5f976244a4cdbf97ddee8d6a9c", "score": "0.0", "text": "def battery_remaining\n @battery_remaining ||= uint8_t(18)\n end", "title": "" } ]
[ { "docid": "fd3382e33d8a4aaa8c0d524d06e213f7", "score": "0.7753062", "text": "def percent\n advanced(0)\n end", "title": "" }, { "docid": "38a5684b74299938244f36ba9235bb1c", "score": "0.7654355", "text": "def percentage; end", "title": "" }, { "docid": "38a5684b742999...
a54f4b851cd5c1e980593155ec64b860
Example: `%%_set(my_favourite_planet,'Saturn')` Calling $$_my_favourite_planet will now return "Saturn".
[ { "docid": "ee9d0f8a02a2716f07a694c595aea0b9", "score": "0.0", "text": "def __if function_array\n if get_value(function_array.shift)\n if function_array[0]\n get_value(function_array[0])\n else\n return true\n end\n else\n if function_array[1]\n get_value(f...
[ { "docid": "6ce504a737bac159afe3c7a27f4d7979", "score": "0.60816926", "text": "def set(var,val) $USER.send(\"#{var}=#{val}\"); nil; end", "title": "" }, { "docid": "b3d6919e1780a986d94f1aafbf3924bb", "score": "0.58014077", "text": "def set(new_value); end", "title": "" }, { ...
1404242a66f7d1eeeceef127524c9b0c
3. Save and Load external files
[ { "docid": "fadc715bc49e67ac26e20375e5633c27", "score": "0.0", "text": "def save_file(students) #open the file for writing\n\tputs students\n\tFile.open(\"students.csv\", \"w\") do |file|\n\t\tstudents.each do |student|\n\t\t\tstudent_data = [student[:name], student[:cohort]]\n\t\t\tcsv_line = student_d...
[ { "docid": "ade955ec2193e822159137cc64ed6994", "score": "0.7071422", "text": "def save files\n end", "title": "" }, { "docid": "fda76f8f3d952fe9d58d83e1be28f698", "score": "0.6683669", "text": "def save(filename); end", "title": "" }, { "docid": "fda76f8f3d952fe9d58d83e1...
fef388ecfcc515965b987705331c4f38
takes in array of string and replaces the 3rd character in each string with '$'
[ { "docid": "57c1db433dbd0f121e1fab0d4ef77df8", "score": "0.71939445", "text": "def kesha_maker(array)\n array.each { |element|\n element[2] = \"$\"\n }\nend", "title": "" } ]
[ { "docid": "d988e6adcbe3dc80b4fb89dddae973bf", "score": "0.7620013", "text": "def kesha_maker(array_of_strings)\n array_of_strings.each { |item| item[2] = \"$\" }\nend", "title": "" }, { "docid": "b2c05ab77d46ffaf6ed18b8438a7eb3a", "score": "0.7606901", "text": "def kesha_maker(arr...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "9cc745267c66fa7a1bdb30266491cffe", "score": "0.0", "text": "def set_temp\n prms = params[:temp_kbn].nil? ? params[:id] : params[:temp_kbn]\n @temp = Temp.find_for_available_id(prms)\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;...
6935f38d602c8c064389316db2d762d7
This assumes that the content is from a trusted source
[ { "docid": "8a4fc92fda6838ffa56945275f8a3fbd", "score": "0.0", "text": "def liquidize_html(content, arguments = {})\n doc = Liquid::Template.parse(content).render(arguments, filters: [LiquidFilters],\n registers: { controller: controller, vie...
[ { "docid": "0ef8f1d68dbd5a5a4b6f6b5f6eb042bf", "score": "0.659446", "text": "def unsafe_content; self.unsafe_data.first; end", "title": "" }, { "docid": "37c88402e5923e4d7f577e122677ef16", "score": "0.6395226", "text": "def sanitized_content\n if raw_content.nil?\n raw_conten...
a26218aa5b6291c29b13c750dcc7c087
setup Grand Central Dispatch concurrent Queue and Group
[ { "docid": "33252c1ae0e953609d8dd649c8af0a27", "score": "0.58836013", "text": "def initialization(block)\n init\n @computation = block\n # Groups are just simple layers on top of semaphores.\n @group = ::Dispatch::Group.new\n # Each thread gets its own FIFO queue upon which we w...
[ { "docid": "feb66912a1f42aaaf11b0971e07c869a", "score": "0.6598958", "text": "def create_thread(run_for_once: false, queue_tag: :default, init_task: nil)\n begin\n thread_pool << Thread.new do\n Thread.current.report_on_exception = false\n begin\n shoul...
c2ac95807ba0210caa6e50ca23cae878
Creates a new instance and sets values formatted to work with Mandrill's API ==== Attributes +args+ A hash containing the keys 'to', 'to_name', 'from', 'from_name', 'subject', and 'body' ==== Examples Adapter::Mailgun.new(
[ { "docid": "0019993e70426a3d31e11dd014a5e052", "score": "0.7212338", "text": "def initialize(args)\n @to = [{\n email: args['to'],\n name: args['to_name'],\n type: 'to'\n }]\n\n @from_email = args['from']\n @from_name = args['from_name']\n @subject = arg...
[ { "docid": "34100142a99051cb7741659e0e022ef8", "score": "0.7148154", "text": "def initialize(args)\n @to = \"#{args['to_name']} <#{args['to']}>\"\n @from = \"#{args['from_name']} <#{args['from']}>\"\n @subject = args['subject']\n @text = args['body']\n end", "title"...
50f8a8bc74ca41f5197cabbc53fa85a2
DELETE /subjects_teachers/1 DELETE /subjects_teachers/1.json
[ { "docid": "2e239279e44e91ff891c58898273a66e", "score": "0.7771081", "text": "def destroy\n @subjects_teacher = SubjectsTeacher.find(params[:id])\n @subjects_teacher.destroy\n\n respond_to do |format|\n format.html { redirect_to subjects_teachers_url }\n format.json { head :ok }\n ...
[ { "docid": "b05640122e4550516b2fbc2c807fd74a", "score": "0.7587869", "text": "def destroy\n #@teacher_subject = TeacherSubject.find(params[:id])\n #@teacher_subject.destroy\n\n respond_to do |format|\n format.html { redirect_to teacher_subjects_url }\n format.json { head :no_content }...
a272b1afa408b9cf1a3d3535499b970b
oh yeah, I want to use the value to do something in the UI to indicate this streak is in progress or not but I am not currently doing that
[ { "docid": "4fb9667af9898b6c0a9b6399772e7e64", "score": "0.0", "text": "def status\n return BROKEN if streak_duration == \"\"\n latest = @marks_by_date.last\n latest.mark_date == Time.current.to_date ? TODAY : YESTERDAY\n end", "title": "" } ]
[ { "docid": "c1f31fc49492570f2791f2f6a74bd1bd", "score": "0.63316846", "text": "def success\n streak = player.streak.to_i + 1\n\n if streak < 5\n play \"https://www.khanacademy.org/sounds/question-correct.ogg\"\n say \"#{streak} in a row!\" unless streak == 1\n\n player.streak = streak\n re...
12e30a2737376ad44907304c6c79a7cb
4 Largest palindromic 3 digit number
[ { "docid": "536ffd077ad8936f63459b7535d25b38", "score": "0.0", "text": "def palindrome?(num)\n num.to_s == num.to_s.reverse\nend", "title": "" } ]
[ { "docid": "d53f62bb775a741b0881458f8853f723", "score": "0.76105994", "text": "def problem_four\n max = 0\n\n 100.upto(999).each do |a|\n a.upto(999).each do |b|\n max = a * b if palindrome?(a * b) && (a * b) > max\n end\n end\n\n max\n end", "title": "" }, { "d...
b2c871ef7c384297779f415d8e1aa1e1
Set the businessdefined user ID for a user
[ { "docid": "931bfd6981c413ff80ad0b9a96467e54", "score": "0.0", "text": "def set_user_id(user_id)\n @standard_nv_pairs['uid'] = user_id\n self\n end", "title": "" } ]
[ { "docid": "2cc74a88ae2b38555bc0b84d41c4494a", "score": "0.8136336", "text": "def user_id=(value)\n @user_id = value\n end", "title": "" }, { "docid": "2cc74a88ae2b38555bc0b84d41c4494a", "score": "0.8136336", "text": "def user_id=(value)\n @us...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "c7f49c2e7b4e9f65bb9275c99fe895f8", "score": "0.0", "text": "def set_support_institutions4\n @support_institutions4 = SupportInstitutions4.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...
d6e603f51116d5002ea0f236c2b82104
This will include "lichen", "lichenicolous" and "lichenally" the usual set of taxa lichenologists are interested in.
[ { "docid": "fd0fd43a65decea3a7a80c78051d762f", "score": "0.0", "text": "def is_lichen?\n lifeform.include?(\"lichen\")\n end", "title": "" } ]
[ { "docid": "597dc71c1abc507020fa08d0b52ee9c2", "score": "0.64255613", "text": "def primary_terms\n super + %i[license]\n end", "title": "" }, { "docid": "371af6ceda991ff6544027f2c55ac90f", "score": "0.6058847", "text": "def above_fold_terms\n [:identifier,\n :maker,\n ...
9b4625e1ce90da9902c9044273028430
Manages the redirect path after a user signs in
[ { "docid": "2d18bbdd64b05969de2bd30b6477ee86", "score": "0.7419071", "text": "def after_sign_in_path_for(resource)\n\n # This tests whether the resque workers are working properly\n # test_resque_workers\n\n # A case-switch statement that sets the appropriate session info and\n # returns the...
[ { "docid": "f3269c4d6e3812c051ab9aef7ed428e9", "score": "0.77453595", "text": "def after_sign_in_path_for(_resource)\n user_path(current_user.id) # ログイン後に遷移するpathを設定\n end", "title": "" }, { "docid": "5a18fd6ee4e6e97c8fd71cdb36aaadbc", "score": "0.771652", "text": "def after_sign...
d76a15d37204387491571cd9bb0c4ee8
Returns the source lines, line break characters removed, excluding a possible __END__ and everything that comes after.
[ { "docid": "e246845b1829cdcefba7acc65948cda6", "score": "0.56329703", "text": "def lines; end", "title": "" } ]
[ { "docid": "5a5bb40858c5e34d670366b16129f800", "score": "0.75610495", "text": "def source_lines\n @lines ||= begin\n lines = @source.lines.to_a\n lines << ''.dup if @source.end_with?(\"\\n\".freeze)\n\n lines.each do |line|\n line.chomp!(\"\\n\".freeze)\n ...
1b276247d117d63b4f21dc71a44f03be
Code blocks are usually enclosed in + for monospace text, e.g.: cat:: Small domestic animal +cat+:: Command to copy stdin to stdout Headings are entered on lines starting with equals signs = Level one heading == Level two heading etc... For horizontal lines use three or more hyphens (like markdown) next section... if a...
[ { "docid": "00b05f0cf877685cdb831d1398d01e02", "score": "0.0", "text": "def fred\n # ...\n yield line, address\nend", "title": "" } ]
[ { "docid": "a35030d3843f8790661a6cc8d73f3ce7", "score": "0.69848794", "text": "def block_code(code, language)\n # Keep the first example (if any)\n @cmd.cli ||= cli(code) if @header == \"Examples\"\n \"<pre><code>%s</code></pre>\" % CGI.escapeHTML(code)\n end", "title": "" }, { "do...
01ef36e548d998219ee8614b9710b9da
2 Create a local variable at an inner scope (within a do/end block) and try to reference it in the outer scope. What happens when you have nested do/end blocks? Nothing is changed on the object when it is nested, However when I modify the object outside of the nested block it is changed.
[ { "docid": "700316dcaa4c97186b4e124232e947d5", "score": "0.0", "text": "def create_var \n b = 12\n return b \n end", "title": "" } ]
[ { "docid": "005c333c2a7da3a5c29a70192becf336", "score": "0.6738929", "text": "def fun_with_ids\n a_outer = 42\n b_outer = \"forty two\"\n c_outer = [42]\n d_outer = c_outer[0]\n\n a_outer_id = a_outer.object_id # 1\n b_outer_id = b_outer.object_id # 2\n c_outer_i...
7e209acff4bd6b56f61ea7918d0470de
DELETE /establishment_types/1 DELETE /establishment_types/1.json
[ { "docid": "c1dd1368eefefc8f48c3c5a30f56465f", "score": "0.73635685", "text": "def destroy\n @establishment_type.destroy\n respond_to do |format|\n format.html { redirect_to establishment_types_url, notice: 'Establishment type was successfully destroyed.' }\n format.json { head :no_conte...
[ { "docid": "dfacc0c0b5bee336632b2db7f0575d87", "score": "0.7320258", "text": "def destroy\n @adjustment_type = AdjustmentType.find(params[:id])\n @adjustment_type.destroy\n\n respond_to do |format|\n format.html { redirect_to adjustment_types_url }\n format.json { head :no_content }\n...
d48ba0c859c5b9b0e362547b5268ee5d
TODO is used for checking ability
[ { "docid": "245e25a67f28e9419cebbcc5c8dd7045", "score": "0.0", "text": "def friends_ids\n [self.id]\n # ADD FRIENDSHIP\n end", "title": "" } ]
[ { "docid": "77f516df9e9ebe1bfec96f5de84dfe63", "score": "0.7608473", "text": "def checkAccess\n end", "title": "" }, { "docid": "c3b1a50237451210ac644f61a91c8ba3", "score": "0.74649364", "text": "def can_access?(authorizable); true end", "title": "" }, { "docid": "75cf...
a91a5a91214c57b125863fe8c4dd01b0
returns the least common word count or nil if there are no recorded words yet public only for testing
[ { "docid": "556b6d2fd940e84930b6ac56fb418e17", "score": "0.85190636", "text": "def least_common_word\n sz = word_counts.size\n if sz > 0\n sort_word_counts\n word_counts.to_a[sz-1]\n else\n nil\n end\n end", "title": "" } ]
[ { "docid": "a7d9b979659b227e321ab7f086fc0712", "score": "0.78583676", "text": "def most_common_word\n if word_counts.size == 0\n WordCount.new(:word=>'n/a',:count=>0)\n else\n sort_word_counts\n word_counts.to_a[0]\n end\n end", "title": "" }, { "docid": "1d6bd1fb456...
cea1fc4c7fed43eac3c882a9f5cbbe3b
the viewport size where we place the portrait into the image_part graphic
[ { "docid": "82b7b6d60caf46d72c956bc9eb41d314", "score": "0.7961821", "text": "def viewport_size\n @viewport_size ||= {w: part_layout.w.to_i, h: part_layout.h.to_i}\n end", "title": "" } ]
[ { "docid": "c363646c31370bcd242720e0359edaaa", "score": "0.6927135", "text": "def viewport_size(viewport)\n return viewport.rect.height\n end", "title": "" }, { "docid": "a5eba194b5a5c1f8bd790d68d39714b1", "score": "0.69088185", "text": "def viewport\n return @viewport...
badd39ce885c482a1cb020345208c59b
Deletes row in worksheet.
[ { "docid": "1c49622c18dc66751f9be4c40f95d290", "score": "0.74035907", "text": "def delete_worksheet_row( delete_worksheet_row_request, opts = {})\n\n data, _status_code, _headers = delete_worksheet_row_request.create_http_request(@api_client,opts )\n return data\n end", "title": "" ...
[ { "docid": "2469c9b70d6a0d6231ba4337060f4ba3", "score": "0.7053152", "text": "def delete_row row_index\n die \"invalid index #{row_index}\" unless row_index > 0\n row = get_row row_index + 1\n delete_row_above row\n end", "title": "" }, { "docid": "d925a440bd9d64eac452c662...
815df985a5eb5be5d66156344800c597
Check whether admin is allowed to manage achievements.
[ { "docid": "17db1f4b24e37ee512b4e0113a44de7a", "score": "0.807664", "text": "def authorize_admin_manage_achievements\n unless current_user.permission.manage_achievements\n redirect_back fallback_location: root_path\n end\n end", "title": "" } ]
[ { "docid": "1fb4464c9ef3f060413677facd3b0f10", "score": "0.749362", "text": "def has_admin_access?\n admin? || moderator?\n end", "title": "" }, { "docid": "ac6a6b8ef5afb13eb0056c6b8a09d20e", "score": "0.7386801", "text": "def has_admin?\n has_auth? && current_person.is_ad...
b4e9e4776201ceefe453ffed4ff79705
POST /categories POST /categories.json
[ { "docid": "d24daa80cb1877ae44c15286af91bc83", "score": "0.61596483", "text": "def create\n @category = Category.new(category_params)\n\n\n begin\n Category.transaction do # un ActiveRecord\n #@full_category.each do |f|\n #Category.create(f)\n #f.save!\n #end\n...
[ { "docid": "2e413155a54df8bd90ccd162b27efc30", "score": "0.7738549", "text": "def CreateCategory params = {}\n \n APICall(path: 'categories.json',method: 'POST',payload: params.to_json)\n \n end", "title": "" }, { "docid": "58f100bd42ad2dfd121248de83b2fbc9", "sc...
1ce5accee5a3a61e5816d94613033abb
Proportion in Strongly Connected Component in Unreciprocated Graph
[ { "docid": "ae3fdd7095b70e1960eca323435f72b1", "score": "0.0", "text": "def scc_of_unreciprocated(eye=@k, &block)\n base_n_k(\"unr_scc\",eye, &block)\n end", "title": "" } ]
[ { "docid": "2251dfebea80392f130057330a9b1959", "score": "0.6586775", "text": "def calculate_density(graph)\n node_amount = graph.vertices.length\n potential_connections = (node_amount * (node_amount - 1)) / 2.0\n actual_connections = graph.edges.length\n density = (actual_connections+0.0) / ...
e65d83253a1a86dcdc8f20c7e9f858e2
PUT /recipes/1 PUT /recipes/1.json
[ { "docid": "99de1ee51639b741650413b6ad94732a", "score": "0.66983527", "text": "def update\n @recipe = Recipe.find(params[:id])\n\n respond_to do |format|\n if @recipe.update_attributes(params[:recipe])\n format.html { redirect_to @recipe, notice: 'Recipe was successfully updated.' }\n ...
[ { "docid": "939213d9663059bf0d64fe1ce04983ed", "score": "0.74094033", "text": "def update\n recipe.update(recipe_params)\n render json: recipe\n end", "title": "" }, { "docid": "fa4c1560a9c3cec2334b9e549b81747a", "score": "0.7145533", "text": "def edit(id, options = ...
940eeacc4b074d625cbf4e9794990518
Determine if the current node is SuSE.
[ { "docid": "14aa35582854e4a8027d508e7c29566d", "score": "0.6272326", "text": "def suse_platform?(node = __getnode)\n node[\"platform\"] == \"suse\"\n end", "title": "" } ]
[ { "docid": "37be38d8fb9dcff496f230e3996b2455", "score": "0.6413385", "text": "def suse?(node = __getnode)\n node[\"platform_family\"] == \"suse\"\n end", "title": "" }, { "docid": "915c8c5f227c86a98836f96a7e4bee08", "score": "0.6299112", "text": "def sea?\n return $g...
808c9cb966d8be908c5a60cf9de5077d
Checks if user inputs the correct answer
[ { "docid": "0feb2e50eaa60a7e9ca7a8b6985376d5", "score": "0.70928484", "text": "def check_answer(answer)\n result = @num_1 + @num_2\n if answer == result\n return true\n end\n return false\n end", "title": "" } ]
[ { "docid": "459c549b6ab71dbc80bbe6f7cf66a821", "score": "0.79622847", "text": "def check_answer?(input)\n if @answer == input\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "c4d939889f205944f97e9b135e65ec9a", "score": "0.7821896", "tex...
c10eded5b2a63856842f0b3f69c3eb34
Created on: 11/02/2012 Purpose: load all groups of login user ++
[ { "docid": "7508ca4c74b5c9a3071bb67b37a21d16", "score": "0.6787656", "text": "def load_my_groups\n @groups = Group.find(:all,:conditions=>[\"user_id=?\",@login_user.id])\n flash[:notice] = \"Groups are not Created.\" if @groups.nil?\n render :partial=> \"load_my_groups\", :locals=>{:groups=>@gr...
[ { "docid": "af26cfdc6aafef9ebd8250a8b0b3eb8e", "score": "0.731187", "text": "def retrieve_groups_from_ldap\n LdapUser.retrieve_groups self.login\n end", "title": "" }, { "docid": "5bfe177a991e41e552f6ac3f20bc3894", "score": "0.70156467", "text": "def load_users\n user_set = Se...
f18bd4a739c6c3addec15c0988dfc8fe
find the last file added in directory
[ { "docid": "e1d6b786b92ac273078b8871d94b0a8b", "score": "0.74820244", "text": "def last_added(path)\n path += \"*\" unless path.index(\"*\")\n Dir[path].select {|f| test ?f, f}.sort_by {|f| File.mtime f}.pop\n end", "title": "" } ]
[ { "docid": "8f16f3c64cf461ab203abe17fdcd2d3c", "score": "0.73289627", "text": "def last_added_dir(path)\n path += \"*\" unless path.index(\"*\")\n Dir.glob(path + \"/*/\", File::FNM_CASEFOLD).sort_by {|f| File.mtime f}.pop\n end", "title": "" }, { "docid": "7de069df84a3640979666...
2cc5372448dbab886e2af1530f9f88a5
PATCH/PUT /prendas/1 PATCH/PUT /prendas/1.json
[ { "docid": "6bd202387d779d5950db9278695aa40f", "score": "0.5874428", "text": "def update\n respond_to do |format|\n if @prenda.update(prenda_params)\n format.html { redirect_to @prenda, notice: 'Prenda was successfully updated.' }\n format.json { render :show, status: :ok, location...
[ { "docid": "e7663d0348b74542ff1d2f4fd96156fe", "score": "0.6261907", "text": "def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end", "title": "" }, { "docid": "07909297fa75d1cbb297dfcdb8164958", "score": "0.6245077", "text": "def update\n @pre = ...
62b314c136d6589a54819466cc4f11b3
Returns the property's XML representation, suitable for sending to the IDE (after adding it to a proper response tag). depth:: The current depth when fetching child properties. This is used for internal purposes and should not be set externally. max_data:: Optional size to limit property value text to. The default
[ { "docid": "c474b5c57312824d24d31045df19a8da", "score": "0.7697273", "text": "def to_xml(depth = 1, max_data = nil, page: 0)\n property = REXML::Element.new('property')\n \n # Property attributes.\n property.add_attributes({\n 'name' => @name,\n 'fullname' =...
[ { "docid": "6e82bf4b0b0e06325de3e738594fdcf1", "score": "0.61607116", "text": "def on_property_value(argv, *)\n response = REXML::Element.new('response')\n response.add_attribute('command', 'property_value')\n \n args = {d: 0, c: 0, m: @options['max_data'].to_i, p: 0}\n OptionPa...
cdabb99035f980dfbc9979d55c8ed92a
Cancel transaction by setting its 'success' field to false to allow administrators to deal with the reversed transactions WR57859
[ { "docid": "3f75be6d7dcff33ab684c0bba0014d99", "score": "0.7412957", "text": "def cancel_transaction\n @dps_pxpay_id = params[:id]\n zencartdps_pxpay_record = ActiveRecord::Base.connection.update(\n \"UPDATE zencartdps_pxpay SET success = 0, response_text = '' WHERE dps_pxpay_id = #{@dp...
[ { "docid": "e8057323b62104216f6185220d7e144a", "score": "0.74619627", "text": "def cancel!\n if AccountTransaction.transfer(self.num * self.price, self.startup.account, self.startup.account, :escrow, :balance).new_record?\n self.errors.add(:num, 'could not be refunded to your startup\\'s balance...
26778f09d7f58133b514605597f8057b
Get the named attribute hierarchy. Returns an array of column names. Example: hierarchy(:fiscal_calendar) might return [:fiscal_year, :fiscal_quarter, :fiscal_month]
[ { "docid": "b4ca36c36732b38437fa4665a30cc333", "score": "0.6046828", "text": "def hierarchy(name)\n hierarchy_levels[name]\n end", "title": "" } ]
[ { "docid": "079d45b235ba8d0222fb28a67f8e3b82", "score": "0.6398281", "text": "def column_hierarchy\n ch = read_attribute(:column_hierarchy)\n if ch.nil? || ch == 'NULL'\n column_dimension_class.hierarchies.first\n else\n ch\n end\n end", "title": ""...
0cc2b6d1c5f0d6b6bf44c767a4dd4047
Send document to back office
[ { "docid": "14985bb1050ae2dd1abd6b7afaae76a0", "score": "0.0", "text": "def add_document(resource_item)\n @message.add_attachment(current_user, resource_item, @message.smsg_refno)\n end", "title": "" } ]
[ { "docid": "518f20ea15520c6f145f98cb9b6e0490", "score": "0.7018109", "text": "def send_doc\n tpl = Template.find(params[\"template_id\"])\n tpl.load(params[:id])\n \n Notification.deliver_order_email(self, tpl)\n Notification.deliver_order_fax(self, tpl)\n \n ...
f7eec8ff81f61f381a4fa78752f003ea
GET /organizations/1 GET /organizations/1.json
[ { "docid": "fca12003484c8d7aa707fcd43ea76918", "score": "0.0", "text": "def show\n authorize @organization\n end", "title": "" } ]
[ { "docid": "d6650a30986bfa18e1a4ca6767b09f60", "score": "0.78073215", "text": "def index\n @organizations = current_user.organization\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @organizations }\n end\n end", "title": "" }, { "do...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "3d7df74a16bc33d0627d749d5eade8ee", "score": "0.0", "text": "def orange_params\n params.require(:orange).permit(:color)\n end", "title": "" } ]
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.7122997", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "b32229655ba2c32ebe754084ef912a1a", "score": "0.70535856", "text": "def expected_permitted_parameter_names; end", "title": "...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "17f5c5fabf89be45e1c9627c32891cc9", "score": "0.0", "text": "def set_planter_gallery\n @planter_gallery = PlanterGallery.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...
1cac7c02a60943c936562d339e26c0c8
returns all matchdays. Dates without matches are filtered. The days will be ordered by ascending .
[ { "docid": "ca7ea4483282bf09f131fefd8dab6b41", "score": "0.70970935", "text": "def get_days\n sparql = SPARQL.parse(\"SELECT DISTINCT ?time\n WHERE {\n ?match <#{RDF.type}> <http://www.bbc.co.uk/ontologies/sport/Match> .\n ?match <http://pu...
[ { "docid": "777c59864060bb046226c2d27f2d1ea9", "score": "0.68867695", "text": "def all_matchday_times\n all_matches = fetch_matches\n matchtimes = Hash[(1..38).collect { |md| [md, []] }]\n all_matches.each do |m|\n matchtimes[m['matchday']].push(m['utcDate'])\n end\n matchtimes\n en...
b6a8133c51c9e4b08d2591ecc44b5bae
Method to encrypt password
[ { "docid": "08c90d35a2c418060be9cd1a226f6157", "score": "0.0", "text": "def encrypt_password\r\n unless password.blank?\r\n self.salt = BCrypt::Engine.generate_salt\r\n self.encrypted_password = BCrypt::Engine.hash_secret(password, salt)\r\n end\r\n end", "title": "" } ]
[ { "docid": "1157dc9509c7854080ee4296ba6af534", "score": "0.8659062", "text": "def encrypt_password(password)\n puts password \n end", "title": "" }, { "docid": "903896c238b23dab7506db008aadbfc1", "score": "0.8205775", "text": "def encrypt(password)\n secure_hash(\"#{salt}--#{p...
112b192337da6e9a6d522c19b063a91f
Creates a new Page object.
[ { "docid": "1328ee21af8a09bdb32f3c2a99cd95a8", "score": "0.0", "text": "def initialize(url,response)\n @url = url\n @response = response\n @headers = response.to_hash\n @doc = nil\n end", "title": "" } ]
[ { "docid": "f7bc6069ca7cf8b802df35a556838923", "score": "0.7764823", "text": "def new\n @page = Page.new\n end", "title": "" }, { "docid": "f7bc6069ca7cf8b802df35a556838923", "score": "0.7764823", "text": "def new\n @page = Page.new\n end", "title": "" }, { "docid...
466ff672349f051d800f07f1df33a7d9
Add the given ruby expression result to the template, escaping it based on the indicator given and escape flag.
[ { "docid": "e7128c623eada4779a8509f9a961d358", "score": "0.60942686", "text": "def add_expression(indicator, code); end", "title": "" } ]
[ { "docid": "0c49e93538fdefef767b793ad2871b08", "score": "0.68110996", "text": "def add_expression_result_escaped(code); end", "title": "" }, { "docid": "0c49e93538fdefef767b793ad2871b08", "score": "0.68110996", "text": "def add_expression_result_escaped(code); end", "title": "" ...
46dfbe9b9ef235cd2221e6ae6044c329
Example usage: c.command :run c.command :run, "Runs the good stuff" c.command :choose, "Runs the good stuff", do %w[possible values for the commands argument] end c.command :set_speed, "Runs the good stuff", do |run| run.flags :a_flag run.command :slowly run.command :fast end which map to example commandline expression...
[ { "docid": "414baa5fce46872e9c370a98fa0f87eb", "score": "0.0", "text": "def command(name, description=\"\", &block)\n contents << TabTab::Definition::Command.new(self, name, description, &block)\n end", "title": "" } ]
[ { "docid": "02a7975a619ef0a0224ac5ee821d2988", "score": "0.67276603", "text": "def run_commands(*commands) run commands.join(\" && \") end", "title": "" }, { "docid": "02a7975a619ef0a0224ac5ee821d2988", "score": "0.67276603", "text": "def run_commands(*commands) run commands.join(\" ...
13094113d6c04f55ba8182069613d84c
Creates a new instance of this plugin that references the specified connection.
[ { "docid": "eca202d38b7cea9241cbb0811258ff41", "score": "0.0", "text": "def initialize(connection, private_sender = nil)\n self.connection = connection\n self.private_sender = private_sender\n end", "title": "" } ]
[ { "docid": "1e0bc2815cf0ffd680e9fd10441e236e", "score": "0.6685242", "text": "def new_connection\n self.connection = new\n end", "title": "" }, { "docid": "148f9685661869662caee0c19a175692", "score": "0.66361165", "text": "def with_connection(connection)\n ...
3a7c446f04666780ea75a966f9c022cf
Test basic functions such as inspect, retrieving the amount/currency, and conversion between currencies test the output format of the inspect method this also tests the convert_to_float method
[ { "docid": "cd92c0c5b749b4c65bf0112dd0339130", "score": "0.6778072", "text": "def test_inspect_format\n twenty_dollars_inspected = MGDMoney.new(20, \"USD\").inspect\n assert_equal(\"20.00 USD\", twenty_dollars_inspected)\n end", "title": "" } ]
[ { "docid": "193202a95c2b8782c25ccccc33bb141c", "score": "0.7169417", "text": "def test_amount_types_oneToTwo\n @expected_value_2 = @apples_to_oranges.convert_currency_one_to_two(@amount)\n assert_instance_of Float, @expected_value_2\n end", "title": "" }, { "docid": "df5b4c01173097aba...
ed537534261aeff0bc75ab06c38402bc
accounts this cluster is in
[ { "docid": "c66e85400f1e3ae27be700cb8f51b375", "score": "0.0", "text": "def related_accounts\n self.class.related_accounts(self.id.to_s)\n end", "title": "" } ]
[ { "docid": "df084952063aec41355f5f9ddd80a0d8", "score": "0.6980772", "text": "def accounts\n @slurm.accounts\n end", "title": "" }, { "docid": "9e81650e3c43c77211cd5320f5edc699", "score": "0.6806492", "text": "def accounts\n @accounts ||= []\n end", "t...
94ea26697bd6e4917467dcf4c6e4bff9
by default, you may have only 1 concurrent tasks running Override this function to add more (because there aren't any you can take away logically)
[ { "docid": "6634f115e01f5cc3a4bb12bf168b5d6c", "score": "0.644192", "text": "def maximum_concurrent_task_count\n\t\t\t1\n\t\tend", "title": "" } ]
[ { "docid": "ab5b06d7bdd1965c8de725a3a2b88b9d", "score": "0.66108024", "text": "def add_task(task)\n thread_pool << task\n end", "title": "" }, { "docid": "226ce75674b1a4ec1cf2124f5156483c", "score": "0.65506124", "text": "def tasks\n @mutex.synchronize do...
2228f805c4dbadfa1c2460f379ade959
Returns an array of the headers belonging to the payload. If _include_content_length_ is +false+, then a 'Content Length' header will be omitted. If _include_content_length_ is not specified, then it will be +true+ if request_method is an HTTP method for which body content is expected.
[ { "docid": "79198245f97398d0a924e9f08ea7b9ba", "score": "0.6859017", "text": "def headers(include_content_length=\n METHODS_SENDING_BODY.include?(request_method))\n unless include_content_length\n return super().reject do |name, value|\n name == 'Content-Length'\n end\n ...
[ { "docid": "6556bd48f5a31afe3f6a06584424a61a", "score": "0.6656862", "text": "def headers\r\n # NB: return value is supposed to be an array of strings\r\n @headers || []\r\n end", "title": "" }, { "docid": "22546353b60080c58410e007c5ee4fa7", "score": "0.6582783", "text": "def ...
3f4b8263ce4a06a2f8f30102ea3eed3b
A port type decl
[ { "docid": "410353fd2eddd03bfc3e58a44df1abf3", "score": "0.0", "text": "def dut_type_declaration\n if vector\n \"#{dut_direction} [#{msb}:#{lsb}] #{name}\"\n else\n \"#{dut_direction} #{name}\"\n end\n end", "title": "" } ]
[ { "docid": "2b4f93a54ffd7cd0eb7b244d0da45f23", "score": "0.6939497", "text": "def _port; end", "title": "" }, { "docid": "f9c74fdbea36225a3a50eff894e60e79", "score": "0.6855147", "text": "def port_type\n return self[:port_type_asserted] unless self[:port_type_asserted].nil?\n ...
16f2fe03be2a3f610fdad5fd6f90b646
GET /confidence_levels/1 GET /confidence_levels/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "fec5db9ab8e40e76c24a561efc6a3738", "score": "0.7417677", "text": "def index\n @confidence_levels = ConfidenceLevel.all\n end", "title": "" }, { "docid": "e02a46f910a596c68e7be6774be5ad44", "score": "0.7023037", "text": "def show\n @confidence_level = ConfidenceLeve...
25c6145e71a28c2fbb2ac48649cf1a44
GET /articles/1 GET /articles/1.json
[ { "docid": "b1ca9da4c26949b37f3d5fc375fe87b4", "score": "0.0", "text": "def show\n @media_containers = @article.media_containers_for_carousel\n set_og_meta_tags(@article)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @article }\n end\n end",...
[ { "docid": "19a11bbe551c564fa7cca7d31c8cbc3f", "score": "0.80206245", "text": "def show\n @articles = Article.find(params[:id])\n render json: @articles\n end", "title": "" }, { "docid": "bdf95afa24978bfa5f06e563541d0398", "score": "0.78080183", "text": "def show\n\t\t@article...
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "64ce3ab8fbc8c49f0ec95f09fc77215d", "score": "0.0", "text": "def gym_class_final_params\n params.require(:gym_class_final).permit(:personal_trainer_id, :Type, :PTName, :Date, :Time)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7477011", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.716907", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist = ...
92a66963cdc42b5871513313732388a5
count = 0 will result in lrange(0,1), fetching all items
[ { "docid": "bee84da0e628a538d0871ecc5f1c8218", "score": "0.6063654", "text": "def get_from_queue(key, count)\n items = @redis.lrange(key, 0, count - 1)\n fetched_count = items.size\n items_to_remove = fetched_count == count ? count : fetched_count\n\n @redis.ltrim(key...
[ { "docid": "8cbf2504c9cf950957da437f347a36b4", "score": "0.66879344", "text": "def next( count = 1 )\n\n objects = nil\n\n if count > 1\n\n objects = [ ]\n count.times do\n objects.push( get_object( @adapter_cursor.next ) )\n end\n\n else\n\n objects = get_object( @ad...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "bbde4e5f04d30767d282d16755a27ea8", "score": "0.0", "text": "def cost_payment_plan_params\n params.fetch(:cost_payment_plan, {})\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...
7e8ec8ca8f9debf2075b694838805804
Odnajduje reprezentanta danego zbioru rozlacznego, stosujac kompresje sciezki.
[ { "docid": "8ee81188f2758d7f33742cddfb27d7a7", "score": "0.0", "text": "def find\nif self.parent.nil?\nself\nelse\nself.parent = parent.find\nend\nend", "title": "" } ]
[ { "docid": "a7c3ff6e9a70757ad110a0a6920415c1", "score": "0.6231933", "text": "def boruvka\n end", "title": "" }, { "docid": "7a8487c16cbf76d451c475999ec6c58b", "score": "0.6000798", "text": "def BrindesRota rota_id\n\t \n\tend", "title": "" }, { "docid": "1821da9f950c9b...
408fa2ea3d072a21201719f9e64fd55d
PUT /jobs/1 PUT /jobs/1.xml
[ { "docid": "30b7d0ded861f0828c45d275f04cbb8d", "score": "0.6320766", "text": "def update\n @job = Job.find(params[:id])\n\n respond_to do |format|\n if @job.update_attributes(params[:job])\n format.html { redirect_to(@job, :notice => 'Job was successfully updated.') }\n format.x...
[ { "docid": "bd9ab1132de10ed9da4a7f169979803b", "score": "0.6630085", "text": "def update_job_success(job_id, success)\n RestClient.put \"#{rest_jobs_url}/#{job_id}\", {\"passed\" => success}.to_json, :content_type => :json\nend", "title": "" }, { "docid": "bd9ab1132de10ed9da4a7f169979803b...
5001dd81cce8e7c936dadc932ef0c54b
list all the entries in the database. This doesn't show the password for any of them, just lists the key information about each entry so the user can see what is in the database
[ { "docid": "fb6b70ca4662ee255061e4ac78f92484", "score": "0.54744947", "text": "def list(account)\n matches = @db.find(account)\n title = \"Title\"\n username = \"Username\"\n add_info = \"Additional Information\"\n if matches.size > 0 then\n length...
[ { "docid": "e28e2aa951acb116b670949e4f9f59fb", "score": "0.65528744", "text": "def cdb_list(inflate=false)\n rs = Chef::CouchDB.new.list(\"users\", inflate)\n rs[\"rows\"].collect { |r| r[inflate ? \"value\" : \"key\" ]}\n end", "title": "" }, { "docid": "58c7bfbfd869eeb9c...
a2d59f6254dab224fecc7d1a8a676d8e
This adds the js exe call for the given field meta
[ { "docid": "2b722e6a3513a1e2ad99e915c2dc73ac", "score": "0.5246562", "text": "def add_validation(_formId, field_meta)\n (field_meta[:required] == true) ? required = 'true' : required = 'false'\n\n case (field_meta[:type])\n when 'radio', 'select'\n # classRefId used b/c styling cant be a...
[ { "docid": "2704409637490def91bb06f9d90a2db3", "score": "0.54568267", "text": "def javascript_submit(opts = {})\n options = {\n :workflow_action => nil\n }.update(opts)\n save_context(:js) do\n js = %Q|$('metaForm').submit();|\n if options[:workflow_action]\n if options[:w...
847ad1bbe889196d69e755aded327e26
Returns whether or not this record has been changed in any way (including whether any of its nested autosave associations are likewise changed)
[ { "docid": "2d0537062177163ecbe3ff25bf4b70cf", "score": "0.8485451", "text": "def changed_for_autosave?\n new_record? || changed? || marked_for_destruction? # TODO || nested_records_changed_for_autosave?\n end", "title": "" } ]
[ { "docid": "a86ec78f486125d0ac7209ec25efa73a", "score": "0.84968746", "text": "def changed_for_autosave?\n new_record? || changed? || marked_for_destruction? || nested_records_changed_for_autosave?\n end", "title": "" }, { "docid": "a86ec78f486125d0ac7209ec25efa73a", "score": "0....
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "d5de96a2dba23dde163b3c12c82fc2d0", "score": "0.0", "text": "def zed_params\n params.require(:zed).permit(:a1, :a2, :a3, :a4, :a5, :a6, :a7, :a8, :a9, :a10, :a11, :a12, :a13, :a14, :a15, :a16, :a17, :a18, :a19, :a20, :a21, :a22, :a23, :a24, :a25, :a26, :a27, :a28, :a29, :a30, :a31, :a32,...
[ { "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...
a4f7ae3283936e83e41920ee8a49db1b
Checks equality by comparing each attribute.
[ { "docid": "0aa8ea5babd4ddb4f879df2719bc4695", "score": "0.0", "text": "def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n aggregation_key == o.aggregation_key &&\n alert_type == o.alert_type &&\n date_happened == o.date_happened &&\n dev...
[ { "docid": "153b45ee9e17f104e42417688976c51c", "score": "0.7681316", "text": "def compare_attributes(attrs)\n\t\t\t\tattrs.each do |name, value|\n\t\t\t\t\tnext true if compare_attribute(name, value)\n\t\t\t\t\tbreak false\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "6c59827132384193...
be0867c89fd0167710f5d64ea0378c08
push to vimscripts.github.com so it we don't interfere with your regular ssh key. create a ~/.ssh/vimscriptsid_rsa and ~/.ssh/vimscriptsid_rsa.pub keypair, and create a ~/.ssh/config that has 2 Host sections: Host github.com\nHostName github.com\nUser git\nIdentityFile ~/.ssh/id_rsa Host vimscripts.github.com\nHostName...
[ { "docid": "b1c4b97e7dd2176a95741ee12c28912d", "score": "0.5901806", "text": "def remote_url script\n \"git@vim-scripts.github.com:vim-scripts/#{script['name']}\"\nend", "title": "" } ]
[ { "docid": "315911fbf3cc2d09d1dc6d31f54800ff", "score": "0.71474296", "text": "def upload_ssh_key_to_github\n if !ssh_key_uploaded_to_github? && !self.class.disable_ssh_github_upload && authorized_for_github?\n github.key.create \"Strano\", Strano.public_ssh_key\n self.toggle! :ssh_ke...
f57e22c7dea48d24deb79b26d4237f63
where every even number is replaced with it's greatest factor. A greatest factor is the largest number that divides another with no remainder. For example the greatest factor of 16 is 8. (For the purpose of this problem we won't say the greatest factor of 16 is 16, because that would be too easy, ha)
[ { "docid": "0cd82272db8ce9bd274374f76ad450f3", "score": "0.7152694", "text": "def greatest_factor_array(arr)\n arr.map do |num|\n if num.even?\n gf = 0\n (1...num).each{|f| gf = f if num % f == 0}\n gf\n else\n num\n end\n end\nend", "title": "" } ]
[ { "docid": "19f5cbd3eb1ac82d440f435fe8cd44f0", "score": "0.79061717", "text": "def greatest_factor(num)\n (2...num).reverse_each { |i| return i if num % i == 0}\nend", "title": "" }, { "docid": "c37baafdab6d7e9f02f437c9e8d664bc", "score": "0.7502249", "text": "def greatest_factor(nu...
7f0163f0893f73546b59c55d94760545
strange_sums Write a method strange_sums that accepts an array of numbers as an argument. The method should return a count of the number of distinct pairs of elements that have a sum of zero. You may assume that the input array contains unique elements. Examples p strange_sums([2, 3, 3, 4, 2]) 2 p strange_sums([42, 3, ...
[ { "docid": "be860aa624cda94be48a3cdababa2f66", "score": "0.7750562", "text": "def strange_sums(arr)\n count = 0\n arr.each_with_index do |ele, i|\n arr.each_with_index do |ele2, i2|\n if i > i2\n if ele + ele2 == 0\n count += 1\n e...
[ { "docid": "e96ad2c5ef0bb73c9276599021b44fdd", "score": "0.7989836", "text": "def strange_sums(arr)\n count = 0\n\n (0...arr.length).each do |idx_1|\n (idx_1+1...arr.length).each do |idx_2|\n count += 1 if (arr[idx_1] + arr[idx_2]) == 0\n end\n end\n count\nend", "title": "" }, { ...
7cfe37d6e62b84ce583ecbcb3f2dcd87
Opens the TCPServer at ip (optional) and port (required)
[ { "docid": "670f45b57d0c8d5b068e03305682392f", "score": "0.8299632", "text": "def start_server(ip, port)\n if ip\n @server = TCPServer.new( ip, port )\n else\n @server = TCPServer.new( port )\n end\n log \"Server opened on port #{port}.\"\n end", ...
[ { "docid": "2a68f31845eea61395e320d43af75a0e", "score": "0.77230346", "text": "def server\r\n @server ||= TCPServer.open(options.fetch('localhost', @portnumber))\r\n end", "title": "" }, { "docid": "b56dacc986d72d871e382e8e60c4df25", "score": "0.7691575", "text": "def open_connec...
450963ce88e476bafbdb7a329380c438
DELETE /collection_profiles/1 DELETE /collection_profiles/1.json
[ { "docid": "e72582436a0674afd4ecb5964886af71", "score": "0.7828792", "text": "def destroy\n @collection_profile.destroy\n respond_to do |format|\n format.html { redirect_to collection_profiles_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "209f51157925d384194d3163c44bcf93", "score": "0.7195271", "text": "def destroy\n @profile = Profile.find(params[:id])\n @profile.user.destroy\n @profile.destroy\n\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :ok }\n end\n ...
c5a066a445887ee0b297133a5b80ac55
You can use this function three ways: initialize(slot, name, attack_bonus, defense_bonus, damage, description, attack_type) This creates an item with the stats specified initialize(level) This creates a random item with stats calibrated to a character of the specified level initialize(level, slot) Creates a random item...
[ { "docid": "b9b0991695ab998b275d661c90a8469c", "score": "0.7477286", "text": "def initialize(*args)\r\n\t\t@slot_names = ['head', 'neck', 'body', 'l_hand', 'r_hand','2_hand' ,'waist' , 'legs', 'feet']\r\n\t\tif args.size == 7\r\n\t\t\t@slot = args[0]\r\n\t\t\t@name = args[1]\r\n\t\t\t@attack_bonus = arg...
[ { "docid": "11063280326d5a6240d9b31f9366e208", "score": "0.64909947", "text": "def initialize(name)\n @name = name\n @strength = 60 + rand(1..100) # LINE 2620\n @wealth = 30 + rand(1..100)\n @food = 0\n @tally = 0\n @monsters_killed = 0\n...
b0a8187e3dc346cc37b062369df19580
This endpoint is deprecated.
[ { "docid": "5baf18c3324bb0f62eed935623705952", "score": "0.0", "text": "def get_project_device_session_performance_using_get(device_session_id, project_id, run_id, opts = {})\n get_project_device_session_performance_using_get_with_http_info(device_session_id, project_id, run_id, opts)\n nil\n ...
[ { "docid": "77b0c109415e0f3e761fd3df7d4dff39", "score": "0.7556771", "text": "def deprecated; end", "title": "" }, { "docid": "77b0c109415e0f3e761fd3df7d4dff39", "score": "0.7556771", "text": "def deprecated; end", "title": "" }, { "docid": "77b0c109415e0f3e761fd3df7d4dff...
a28e478681ac9d29c5dd796aa824781d
PATCH/PUT /users/1 PATCH/PUT /users/1.json
[ { "docid": "2c0b5e3dfe96c3aa7c94ece7d5fc955b", "score": "0.0", "text": "def update\n respond_to do |format|\n if @user.update(user_params)\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { render :show, status: :ok, location: @user }\n ...
[ { "docid": "f0686f191a0def3b6c3ad6edfbcf2f03", "score": "0.7243395", "text": "def update_user(email)\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/users/2.json'\n ).to_s\n\n puts RestClient.patch(\n url,\n { user: { email: email } }\n ...
38778face89db6eb4a7196a1dba61070
Function to randomly scramble items in the array and verify that array members haven't changed Corresponds to test_3_random_sort
[ { "docid": "3e15e0bd72f26ad1e693a922679cbc6e", "score": "0.7323156", "text": "def random_sort(c)\n scrambled = c.shuffle\n if c - scrambled == [] && scrambled - c == []\n #puts \"Run pair_names(scrambled)...\" # inline test\n #return true # for testing, comment out for production\n pair_na...
[ { "docid": "7ead76f7cfe5bbc7d281f7128e116f46", "score": "0.7485468", "text": "def shuffle(array)\n array.sort_by {rand}\nend", "title": "" }, { "docid": "a559ee0ef4ae1ec36c192d363bd29ffe", "score": "0.7392737", "text": "def randomize(arr)\n return arr.shuffle\nend", "title": ""...
d317a8f55501e634407afac51e8f754e
In: Nothing Out: Numeric( current_offset )
[ { "docid": "443c67cb9a49379fe53cb1ae728489df", "score": "0.0", "text": "def current_offset\n @p_offset ||= p_ulong_long\n retval = self.debug_client.DebugRegisters.GetInstructionOffset( @p_offset )\n self.raise_errorcode( retval, __method__ ) unless retval.zero? # S_OK\n @p_offset.re...
[ { "docid": "31de07dd714962c60a3f1a6722cb0e05", "score": "0.72722775", "text": "def offset(value); end", "title": "" }, { "docid": "45822d4b66239cb399da5f0cae41b1b0", "score": "0.6853894", "text": "def offset\n if self[:offset] > 0\n return self[:value]\n else\n...
e55e175cafba80ae635d89449ed3b185
END of SNMP FUNCTIONS
[ { "docid": "4f695ef4c719d26528596ac3ec81e483", "score": "0.0", "text": "def ping (host) \n line_id=0;\n IO.popen(\"#{'C:/bynet/tools/net/Fping.exe'} #{host} -t 2ms -o -w #{PINGTIMEOUT}\") {\n |io| while (line = io.gets) do \n # puts line\n line_id+=1;\n line_a =...
[ { "docid": "34a2b2285d5e62980815f7cfd409b286", "score": "0.64923865", "text": "def getattrib (host,oid,community,numofelemetstoreturn)\n begin\n # if (true) then puts (\"getattrib (host=#{host} oid=#{oid} ) \") end\n out = \"\"\n manager = manager||SNMP::Manager.new(:host => host, :port =...
660b9ad77f115623fdc6fa9a7a171e62
Maps an ODBC SQL type to an ActiveRecord abstract data type c.f. Mappings in ConnectionAdapters::Columnsimplified_type based on native column type declaration See also: Columnklass (schema_definitions.rb) for the Ruby class corresponding to each abstract data type.
[ { "docid": "aba54a1f374b1565cfe580c5b37007bf", "score": "0.78343004", "text": "def mapSqlTypeToGenericType (odbcSqlType, nativeType, scale, booleanColSurrogate, rawPrecision, nativeTypes)\n if booleanColSurrogate && booleanColSurrogate.upcase.index(nativeType.upcase)\n fullType = nat...
[ { "docid": "a0082873a09d6ac6fc98d0305faffcbf", "score": "0.7471477", "text": "def native_database_types\n @logger.unknown(\"ODBCAdapter#native_database_types>\") if @@trace\n\n return {}.merge(@abstract2NativeTypeMap) unless @abstract2NativeTypeMap.nil?\n\n @abstract2NativeTyp...
26436f429fc38796bb79ff9358a64ac1
the json (string form) for this AdminRepositoryConsumer
[ { "docid": "6c725ac2007c5f4c26bd1c8652a9c98c", "score": "0.0", "text": "def to_json\n to_jaxb_json_hash.to_json\n end", "title": "" } ]
[ { "docid": "8727428ef4ad4a89548eeecb6c5d7ffd", "score": "0.68946934", "text": "def as_json(*args)\n json = super.as_json(*args)\n json[\"admin_string\"] = admin_string\n return json\n end", "title": "" }, { "docid": "dd182890c50f4a4c4ccb29215cff55ea", "score": "0.646740...
c5796037f7930fca7b908350ce73cd8c
Update an existing ApplicationAuthentication Updates a ApplicationAuthentication object
[ { "docid": "b28b3c1dc6a37157eed073b8e241f4f8", "score": "0.6059047", "text": "def update_application_authentication_with_http_info(id, application_authentication, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.update_application_authen...
[ { "docid": "6776a79dcd655339405b885c3f04f060", "score": "0.7124817", "text": "def update_application_authentication(id, application_authentication, opts = {})\n update_application_authentication_with_http_info(id, application_authentication, opts)\n nil\n end", "title": "" }, { ...
c8769ad9089da4f21b8aad8f72b4e319
Mongoid (v7.0.8) doesn't have a cache_version method on its document. This causes when trying to use Rails collection caching.
[ { "docid": "ab988c5dd12953e3ee8a5303dfb75613", "score": "0.61223", "text": "def cache_version\n if respond_to?(:updated_at)\n updated_at.utc.to_s(:usec)\n else\n nil\n end\n end", "title": "" } ]
[ { "docid": "ce444b6740eb4ee3c4193e9156832baa", "score": "0.7052873", "text": "def [](version)\n @cache[version] ||= @document.store.find(document.uuid,version)\n end", "title": "" }, { "docid": "b7211eef3db0a7d5563263fd34a46ea7", "score": "0.69371635", "text": "def cache_...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "05d81e598c7d70e94e2a81e838eccfc7", "score": "0.0", "text": "def set_csv_type\n @csv_type = CsvType.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...
e4ced8ae2272e09a71c08a3e712ac467
code your valid_move? method here
[ { "docid": "be6c86eab38d1c1fe878e6a1a23f8084", "score": "0.0", "text": "def valid_move?(position)\n if !position.is_a?(Integer)\n position = position.to_i\n end\n if(position>=1 && position<=@board.length && !position_taken?(position))\n return true\n end\n return false\n end",...
[ { "docid": "086e35cb3e58b6c5da89deea101185d6", "score": "0.82555014", "text": "def valid_move?(new_x, new_y)\n true\n end", "title": "" }, { "docid": "12acac49c32e11441196590b027fa462", "score": "0.8206571", "text": "def valid_move?(move_index)\r\n #valid if position is NOT ta...
9aad97a6bfc63216e4eeea4d64e97915
GET /admin/menus/new GET /admin/menus/new.json
[ { "docid": "59f77fa4cb0367cbdc50f626399d72ff", "score": "0.8199229", "text": "def new\n @admin_menu = Admin::Menu.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_menu }\n end\n end", "title": "" } ]
[ { "docid": "db0a6b8e296a4cc5611d1e5e6f15abb9", "score": "0.8171573", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @menu }\n end\n end", "title": "" }, { "docid": "6ed6eb2f623ff43d270aa02a2efdcc72", "score": "0.812199...
b446cf0695bd6a29cee8dfbfd4c4c80d
DELETE /precipitations/1 DELETE /precipitations/1.json
[ { "docid": "09bbada15ed69a5b6915f9d5587de461", "score": "0.7291271", "text": "def destroy\n @precipitation.destroy\n respond_to do |format|\n format.html { redirect_to precipitations_url, notice: 'Precipitation was successfully destroyed.' }\n format.json { head :no_content }\n end\n ...
[ { "docid": "b5abc0cec4dd219db45b766cca07389c", "score": "0.7072436", "text": "def destroy\n @percipitation = Percipitation.find(params[:id])\n @percipitation.destroy\n\n respond_to do |format|\n format.html { redirect_to(percipitations_url) }\n format.xml { head :ok }\n end\n end...
b673ba167b52804b4a17c1985f09d1f5
Would change to this
[ { "docid": "86d174ab4551bfbff5b4aa73f1675cfe", "score": "0.0", "text": "def name=(n) # This was renamed from \"set_name=\"\n @name = n\nend", "title": "" } ]
[ { "docid": "003f93545faf95741b6daf49b5599d9c", "score": "0.71410614", "text": "def _self; end", "title": "" }, { "docid": "ed46df5c17a3916ba8db7656712f8e8d", "score": "0.70854515", "text": "def self ; @self ; end", "title": "" }, { "docid": "ed46df5c17a3916ba8db7656712f8e...
2a78ccee6539f1ab56236ebaac0ce6b4
check fee collections present for the current batch and initiate the transfer
[ { "docid": "1b94a6659d89b824953ead7e7cae51f8", "score": "0.65368885", "text": "def fetch_fees_and_transfer(student, fee_type)\n fees_of_student(student, fee_type).each do |ff|\n if fee_collection_for_batch(ff, fee_type).present?\n finace_fee_check(fee_type) ? transfer_fees(student, ff, fe...
[ { "docid": "217202937bd369536d3da0e615277c7d", "score": "0.74116796", "text": "def collection_batch_check(collection, fee_type)\n if fee_type=='hostel'\n #HostelFeeCollection.find_by_name_and_batch_id_and_is_deleted_and_start_date_and_due_date(collection.name, @batch.id, collection.is_deleted, \...
f4cf818ef64cccf10a1cf797d2e2d5a0
Assuming url is a full url (including http:// etc), replaces the host with new_host.
[ { "docid": "490d8fa8d848fc4aa1f250bf347947e3", "score": "0.0", "text": "def redirect_to(options = {}, response_status = {}) #:doc:\n raise ActionControllerError.new(\"Cannot redirect to nil!\") unless options\n raise AbstractController::DoubleRenderError if response_body\n\n self.status =...
[ { "docid": "d137636894ed18f91004ec37d0379a1f", "score": "0.70194286", "text": "def parse_url_host\n url = self.url.gsub(/^https?\\:\\/\\//, '')\n url = url.gsub(/www\\./, '') unless (url.match(/www\\./).blank? && url.gsub(/www\\./, '').match(/[A-Za-z]/))\n self.url = \"https://\" + url\n end",...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "b83a4f54c150d25580ca2ee0e3303adf", "score": "0.0", "text": "def set_claimppriorauthorization\n @claimppriorauthorization = Claimppriorauthorization.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6165422", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.60457647", "text": "def action_hook...
7bf360d9d481578d1ca514d920deb18f
///////////////////////////////////////////////// Book the Choir Page
[ { "docid": "7ad2c2ea4a1c9d42c6b46d4823a642de", "score": "0.7046712", "text": "def book_choir\r\n\t@title = \"Book the Choir\"\r\n end", "title": "" } ]
[ { "docid": "39c4ae2ead6ecb0d9e6c5ba2764a0721", "score": "0.6715904", "text": "def page; end", "title": "" }, { "docid": "39c4ae2ead6ecb0d9e6c5ba2764a0721", "score": "0.6715904", "text": "def page; end", "title": "" }, { "docid": "39c4ae2ead6ecb0d9e6c5ba2764a0721", "sc...
90262ea6176f8e381ee4c479fd58f1a5
reduce 421 omitted reduce 422 omitted
[ { "docid": "0944cb7e08988bc82c235f2a3a480799", "score": "0.0", "text": "def _reduce_423(val, _values, result)\n result = s(:identifier, val[0].intern)\n \n result\nend", "title": "" } ]
[ { "docid": "34f6a4b15140bc116f6c661a42563df5", "score": "0.6640029", "text": "def _reduce_400(val, _values, result); end", "title": "" }, { "docid": "183cfacbd650c275363971e220a18553", "score": "0.6492789", "text": "def _reduce_409(val, _values, result); end", "title": "" }, ...
42f7d314297941becec498e5cb5ea396
Get a Transport Node's State Returns information about the current state of the transport node configuration and information about the associated hostswitch.
[ { "docid": "c38b2d20b2dcbc54a1808b59b8f3841c", "score": "0.73510224", "text": "def get_transport_node_state(transportnode_id, opts = {})\n data, _status_code, _headers = get_transport_node_state_with_http_info(transportnode_id, opts)\n return data\n end", "title": "" } ]
[ { "docid": "ad8f4bf9cce505fb22e9162db85677c0", "score": "0.71761054", "text": "def get_transport_node_state_with_http_info(transportnode_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: NetworkTransportApi.get_transport_node_state ...\"\n ...
59499d5b44295bcd7effeb68ef8392c5
Insert or Update List Entries
[ { "docid": "e4b79be6d736405149b7642e0c03cb41", "score": "0.0", "text": "def create_or_update(recipients)\n @client.call(method: :put, path: 'suppression-list', body_values: {recipients: recipients})\n end", "title": "" } ]
[ { "docid": "b0b836cddbd05102d2db2b8514f96038", "score": "0.69098717", "text": "def update_list(update)\n change_detail_update = ChangeDetail.new(update)\n \n # Update the editable fields and save\n self.name = change_detail_update.name\n self.active = change_detail_update.active...
5dcae4cfa2d2d545446fc94debe2c504
sort page names and pageranks by descending order
[ { "docid": "5ee28bf4441d90755b93e908c5169002", "score": "0.736797", "text": "def sort(page_names, pagerank)\n size = page_names.size\n (size - 1).downto(0) do |i|\n i.times do |j|\n if pagerank[i] > pagerank[j]\n swap(page_names, i, j)\n swap(pagerank, i, j)\n ...
[ { "docid": "433557be86081aaa9e964cc764ae13fb", "score": "0.69572693", "text": "def pages\n @_pages.sort_by(&:order)\n end", "title": "" }, { "docid": "c3331e0f9c07d14001e2efb4fe0952ae", "score": "0.67886734", "text": "def order_pages(pages, order_type = '')\n case ...
dcaff8c7821df314ea620246c02eca90
Returns a new Time representing the start of the minute (XX:XX:00).
[ { "docid": "4e8a4ad5d3383b28ddfa53b673f9a32c", "score": "0.75518805", "text": "def beginning_of_minute\n change(:sec => 0, :usec => 0)\n end", "title": "" } ]
[ { "docid": "482d020ba6bb43947cd923224f38fe20", "score": "0.7912296", "text": "def start_of_minute\n change(:sec => 0)\n end", "title": "" }, { "docid": "58afc33c0f253d1ab4157b7c34bbfbad", "score": "0.77532643", "text": "def start_of_minute\n change(:sec => 0)\n ...
b2d790f4b15532c4ee852677078eb0a0
Builds an HTTP pagination link header
[ { "docid": "fab0b38d51685faca31449f38aa469a5", "score": "0.6346915", "text": "def build_http_link_vnf(offset, limit)\n link = ''\n # Next link\n next_offset = offset + 1\n next_vnfs = Vnf.paginate(page: next_offset, limit: limit)\n\n address, port = read_config\n\n link << '<' + addres...
[ { "docid": "4e5383974ad83b0b178733821af0caf7", "score": "0.7736362", "text": "def build_pagination_headers path, values, params={}\n if values[:num_pages] > 1\n link_headers = {}\n new_params = params.merge({ per_page: values[:per_page], page: values[:page] })\n\n # Next page + Last pa...