query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
bfbcddcc918ef40f76e5014276919dbc
Preview this email at
[ { "docid": "fb9c202dbe956271f13aca10fed62c9b", "score": "0.0", "text": "def user_new_item_confirmation\n UserMailer.user_new_item_confirmation\n end", "title": "" } ]
[ { "docid": "f4f01bf0c4f6341760a71d13d7b6cc72", "score": "0.7310511", "text": "def preview_email\n email = UserMailer.emailing(@emailing)\n mail_inliner = Roadie::Rails::MailInliner.new(email, Rails.application.config.roadie)\n mail = mail_inliner.execute\n\n mail.html_part.decoded.gsub /http...
99bb7ed886528f4b9e4847418b781fcc
=begin Write a method that takes two strings as arguments, determines the longest of 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. =end
[ { "docid": "1ebe145da791f531ea58cf8ba8be935d", "score": "0.0", "text": "def short_long_short(str1, str2)\n if str1.size > str2.size\n long_string = str1\n short_string = str2\n else\n long_string = str2\n short_string = str1\n end\n concat_string = short_string + long_string + short_stri...
[ { "docid": "5f9f898ab739c70da9a0004ac78f4b7d", "score": "0.8528593", "text": "def longest(s1, s2)\n (s1 + s2).split('').uniq.sort.join\nend", "title": "" }, { "docid": "692df0e08f89c5c764d71ec2d9ac1448", "score": "0.84562093", "text": "def longest string1, string2\n new_str = s...
411ba5be43211d779e4b4ff03c619a83
Adds a new rule to the set.
[ { "docid": "93b234c5a1043d0712f614350db7d87d", "score": "0.82220644", "text": "def add_rule(rule)\n @rules << rule\n end", "title": "" } ]
[ { "docid": "0b27fde79414a409d9fb19a2466baf45", "score": "0.81402576", "text": "def <<(rule)\n @rules << rule\n self\n end", "title": "" }, { "docid": "8ba9e96ecb0bd088e9b5c0e6fc2af865", "score": "0.8061345", "text": "def <<(rule)\n @rules << rule\n end", "tit...
8567fd01b3a92bd29dcdd6958561952a
PATCH/PUT /case_insensitives/1 PATCH/PUT /case_insensitives/1.json
[ { "docid": "495177d1b873ed5d7f39436128139f0f", "score": "0.71098655", "text": "def update\n respond_to do |format|\n if @case_insensitive.update(case_insensitive_params)\n format.html { redirect_to @case_insensitive, notice: 'Case insensitive was successfully updated.' }\n format.j...
[ { "docid": "3f5b070d61e026e7a68931defcbe68d0", "score": "0.7059685", "text": "def update!(**args)\n @case_sensitive = args[:case_sensitive] if args.key?(:case_sensitive)\n end", "title": "" }, { "docid": "c83f64b18b5da0388f668d73d9ebac43", "score": "0.646374", "text":...
b7f236ab289e6d1346d375c36f4d65f1
Get read status of a user's discussion thread response with GET /users/:user_id/courses/:course_id/threadeddiscussions/:thread_id/topics/:topic_id/responses/:response_id/readStatus`` using OAuth1 or OAuth2 as a student.
[ { "docid": "30c427bf96a0512bcf4f1f9d73a65610", "score": "0.8768274", "text": "def get_threaded_discussion_response_read_status(user_id, course_id, thread_id, topic_id, response_id)\r\n relative_url = PATH_USERS_COURSES_THREADEDDISCUSSIONS_TOPICS_RESPONSE_READSTATUS % [user_id, course_id, thread_id,...
[ { "docid": "88996fa48f8118d6f3a2fa7200fde285", "score": "0.75662243", "text": "def update_threaded_discussion_response_read_status(user_id, course_id, thread_id,\r\n topic_id, response_id, read_status)\r\n relative_url = PATH_USERS_COURSES_THREADEDD...
b8a1309c01da59989defe6b92dd6ab79
PATCH/PUT /paymentplanfeatures/1 PATCH/PUT /paymentplanfeatures/1.json
[ { "docid": "4a42874ac1a0ffec714a7f7a6fded316", "score": "0.6951661", "text": "def update\n respond_to do |format|\n if @paymentplanfeature.update(paymentplanfeature_params)\n format.html { redirect_to @paymentplanfeature, notice: 'Rate-Function was successfully updated.' }\n format...
[ { "docid": "c3d9f6ff3a556e3fdac2bf6e45bd311b", "score": "0.66894734", "text": "def update\n @panel_planfeature = Panel::Planfeature.find(params[:id])\n\n respond_to do |format|\n if @panel_planfeature.update_attributes(params[:panel_planfeature])\n format.html { redirect_to(@panel_plan...
094774775d712744eef55a97c75e23e9
Use frameworks instead of static libraries for Pods. This attribute is inherited by child target definitions.
[ { "docid": "e32fe1656152846e69a4945d15e40109", "score": "0.7398122", "text": "def use_frameworks!(flag = true)\n current_target_definition.use_frameworks!(flag)\n end", "title": "" } ]
[ { "docid": "391f93aaf4cd8571de05fa4f915c35f4", "score": "0.68636286", "text": "def prebuild_frameworks! \n\n # build options\n sandbox_path = sandbox.root\n existed_framework_folder = sandbox.generate_framework_path\n bitcode_enabled = Pod::Podfile::DSL.bitcod...
933ae564e402dc61007442a3b1131c2e
calculate loop through the calculator
[ { "docid": "89b6cf3582698d22c7c9bb5ec284be14", "score": "0.65620255", "text": "def run_calculator\n\n while calculate != \"exit\"\n calculate\n\n end\n\nend", "title": "" } ]
[ { "docid": "7ca90cb9b9950f2d778512c55bf870de", "score": "0.73331845", "text": "def calc()\n\tputs \"Calculator:\"\n\tcalculate = true\n\twhile calculate == true\n\t\tfirst_num = input_num()\n\t\tputs \"> #{first_num}\"\n\t\toperator = input_operator()\n\t\tputs \"> #{first_num} #{operator}\"\n\t\tsecond...
fe9bbbe7198bd3b3ffd3d03e1a79339a
Return the definition of this instance of AppProperty as an XML element (does the reverse of 'from_xml') [Return] an XML element
[ { "docid": "284c2818d86a72848b59b2c1aca7b09c", "score": "0.66437644", "text": "def to_xml\n a = REXML::Element.new(\"property\")\n a.add_attribute(\"id\", name)\n a.add_element(\"name\").text = name\n if (parameter)\n a.add_element(\"parameter\").text = parameter\n end\n if (descr...
[ { "docid": "a7f5398c5712f3a84693d5b778182497", "score": "0.76945645", "text": "def to_xml\n a = REXML::Element.new(\"property\")\n a.add_attribute(\"name\", idref)\n if isBound\n a.add_element(\"binding\", {\"idref\" => bindingRef})\n elsif value != nil\n v = a.add_elem...
0764193c2da1a9aa2e2ba67d70985c19
Matches this importer to an user's name/address
[ { "docid": "724eef9692e2cd7dbcaeef4d71976686", "score": "0.0", "text": "def =~(options)\n return false unless options && options[:username]\n domain = username_domain(options[:username].downcase)\n !domain.empty? && DOMAINS.keys.include?( domain ) ? true : false\n end", "title": "" } ]
[ { "docid": "c3ee3b94f05714ad6ee7781aa9004ab9", "score": "0.64987653", "text": "def parse_user(name, email, trailer)\n link_to_user User.find_by_any_email(email),\n name: name,\n email: email,\n trailer: trailer\n end", "title": "" }, { "docid": "91d57ff...
252d0f53c49ef6c0555911d1272040bf
DELETE /colonies/1 DELETE /colonies/1.json
[ { "docid": "1ca498792cfc929b325096dc07943e01", "score": "0.62700325", "text": "def destroy\n if @colony.can_destroy?\n @colony.destroy\n respond_to do |format|\n format.html { redirect_to colonies_url, notice: 'Colony was successfully destroyed.' }\n format.json { head :no_con...
[ { "docid": "32092c1ef881fdc2f46a272d84e80a28", "score": "0.69516647", "text": "def destroy\n @excluded_colony.destroy\n respond_to do |format|\n format.html { redirect_to excluded_colonies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b...
0e120d8f27ac13a30a2b0528f248c7e3
Adds a new customer.
[ { "docid": "3baf779792490da4fbf97b920a539d15", "score": "0.0", "text": "def v1_customers_post_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CustomersApi.v1_customers_post ...\"\n end\n # resource path\n local_var_p...
[ { "docid": "9fb137c943cb3c1c5e84788e5b6c96d8", "score": "0.8483029", "text": "def add_customer name, id_proof, phone_number, address1, city, state, country, zipcode\n customer = Customer.new(name, id_proof, phone_number, address1, city, state, country, zipcode)\n @customer << customer # Adding cus...
4ddb756bff6c8ac65743785f0092b01d
DELETE /archivos/1 DELETE /archivos/1.json
[ { "docid": "17554d6a976eb81206024e2a7b7121d8", "score": "0.7449365", "text": "def destroy\n @archivo.destroy\n respond_to do |format|\n format.html { redirect_to archivos_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "cd68023110a24857fabd47c43554bacd", "score": "0.7490742", "text": "def destroy\n @archivo = Archivo.find(params[:id])\n @archivo.destroy\n\n respond_to do |format|\n format.html { redirect_to archivos_url }\n format.json { head :ok }\n end\n end", "title": "" }, ...
35f8db003c4213438b846fdac11128bb
POST /direccions POST /direccions.json
[ { "docid": "43db5233e827676737fe4d802fa84b4a", "score": "0.53491336", "text": "def create\n @clientes = Cliente.all\n @sucursales = Sucursal.where(\"cliente_id = ?\", params[:direccion][:cliente_id]).order(:nombre)\n\n #@direccion = Direccion.new(direccion_params)\n @direccion.sucursal_id =p...
[ { "docid": "2a71a96c412440bbc66d7e9ee1399c8b", "score": "0.71964765", "text": "def create\n @diretorio = Diretorio.new(diretorio_params)\n if @diretorio.save\n render json: @diretorio\n else\n render json: @diretorio.errors, status: :unprocessable_entity\n end\n end", "title...
6e55fd7d66bbd6dc87e2217de196034f
Delete a card Permanently deletes a card definition with the given ID. Once deleted, data fetch requests for this card will no longer be sent to your service. This can't be undone.
[ { "docid": "498d06aa5e2c37403c8294f44e00052c", "score": "0.0", "text": "def archive(app_id, card_id, opts = {})\n archive_with_http_info(app_id, card_id, opts)\n nil\n end", "title": "" } ]
[ { "docid": "792a6b9b8dfdf725e9bed8d31fddbd8a", "score": "0.7816533", "text": "def delete(card_id, opts = {})\n data, _status_code, _headers = card_delete_with_http_info(card_id, opts)\n data\n end", "title": "" }, { "docid": "8bda1cf1a611a3806acbbcf4598d83da", "score": "0.76...
48e638dc9acd226d181347290bd85ca0
Move the node to the child of another node with specify index
[ { "docid": "33bc24566a70472ffb9d9a58bab9462e", "score": "0.82799745", "text": "def move_to_child_with_index(node, index)\n if node.children.empty?\n move_to_child_of(node)\n elsif node.children.count == index\n move_to_right_of(node.children.last)\n ...
[ { "docid": "13a2628f53480fb577c2ebde8859e7d6", "score": "0.7938242", "text": "def move_member(from_index, to_index)\n\t #get node to be moved and clone it\n\t moving_node = self.find_by_terms({:mods=>from_index.to_i}).first().clone()\n\t #get node at to_index\n\t to_node = self.find_by_terms...
8cc159faf8f67c3fc77383fea3853195
Ent.Par. => Lllegando \d.+ min. => Llega en Autobus entorno parada. => Llegando sup. \d+ min. =>
[ { "docid": "1ba8656028333bc1e888be0eebab65a9", "score": "0.52140087", "text": "def transform_response(response)\n puts \"#{response}\"\n response.gsub!('Autobus entorno parada.', 'Llegando...')\n response.gsub!('Ent.Par', 'Llegando...')\n response.gsub!(/sup\\.\\s(\\d+)'/, 'Llega en ...
[ { "docid": "e1ce8380d9d51325b77f519745374d33", "score": "0.6167686", "text": "def numlet(numero)\r\n #numero=\"1658323.40\"\r\n @StrNumero=\"\"\r\n @StrUnidades=\"\"\r\n @StrDieces=\"\"\r\n @StrDecenas=\"\"\r\n @StrCienmil=\"\"\r\n @StrNumLet=\"\"\r\n @StrNumLet2=...
17f82e4bf354cc8bcf6671b2ab935d47
TIME COMPLEXITY = N 2
[ { "docid": "afc6f0f68c4b872c4bdd82086d58fe8f", "score": "0.0", "text": "def second_anagram?(string1, string2)\n arr1 = string1.chars\n arr2 = string2.chars\n\n arr1.each_with_index do |el1, i|\n arr2.each_with_index do |el2, j|\n if el1 == el2\n arr1[i] = nil\n arr2[j] = nil\n ...
[ { "docid": "b7b674ddf3589873196cccd40498f1ed", "score": "0.62616116", "text": "def time_dilation(t0,v,c)\n dilation = t0 / Math.sqrt(1-((v/c)*(v/c)))\n return dilation\nend", "title": "" }, { "docid": "b3929c54bbce28e89dd83fba60f7b4b0", "score": "0.62238574", "text": "def build...
c75d365584693a149d6317d9cd70d53c
Returns list of app profile IDs created Returns list of app profile IDs created
[ { "docid": "f843f6c373f9f3ebce12c06838258a12", "score": "0.0", "text": "def get_app_profiles_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiAppDiscoveryApi.get_app_profiles ...'\n end\n if @api_client.co...
[ { "docid": "26cdd6ce601265d6ee60ea8135d67ec0", "score": "0.6989538", "text": "def profile_ids\n @customer_profile_id_list\n end", "title": "" }, { "docid": "ce032561e489b186b0a0205e779fc129", "score": "0.657842", "text": "def generate_profile_id\n if not too_many_ids\n ...
50d35bf9990fcf1e7f4aa36060bc50de
From the page 626 hsh.hash_key?(key) > true or false Return true if the given key is present in hsh.
[ { "docid": "bad8da6ad57067bbf9cb58eeaed80d68", "score": "0.7371992", "text": "def test_Hash_InstanceMethods_hash_key?\n\t\th = {'a'=>100, 'b'=>200}\n\t\tassert_equal(true, h.has_key?('a'))\n\t\tassert_equal(false, h.has_key?('z'))\n\tend", "title": "" } ]
[ { "docid": "20331e2c129191f4cf197af9542506f6", "score": "0.8218521", "text": "def has_key?(key)\n @h.has_key?(key.to_sym)\n end", "title": "" }, { "docid": "a2bf24cf8987c2a829de70de5f008107", "score": "0.8101871", "text": "def hash_has_key?(hash, key)\r\n hash.key?(key) #...
02800d047aa08fac27be47fefbb19675
Indicates that parent is root in to_s
[ { "docid": "e78d20e572f9b4db40592e8643eb0dff", "score": "0.0", "text": "def data; '*'; end", "title": "" } ]
[ { "docid": "796e868726d7d4cff18d65350d0f0550", "score": "0.7006921", "text": "def to_s\n @root\n end", "title": "" }, { "docid": "796e868726d7d4cff18d65350d0f0550", "score": "0.7006921", "text": "def to_s\n @root\n end", "title": "" }, { "docid": "175aa4c5...
594977a71718232fd645ef0e44bee4da
show a single player's profile based on passed in id
[ { "docid": "35cdcafbac622e4fd3c3692a64a453be", "score": "0.0", "text": "def show\n @player_id = params[:id].to_i\n\n if @player_id == 0\n @player = Person.find(1)\n @player_id = 1\n else\n @player = Person.find(@player_id)\n end\n\n @golf_course_people = GolfCoursePerson.wh...
[ { "docid": "48addf42cc629651d643b8b0126f1526", "score": "0.78256667", "text": "def show\n show_profile(params[:id])\n end", "title": "" }, { "docid": "13b2e8b0b8d7855c56cc5557d8771ca4", "score": "0.7762266", "text": "def show\n @ok_player = OkPlayer.find(params[:id])\n redi...
1107ac52d62b889265c9634e6bc77c6f
DELETE /admin/orders/1 DELETE /admin/orders/1.json
[ { "docid": "661404d1f8a4267a6c44c0320ef8e217", "score": "0.0", "text": "def destroy\n @order = Order.find(params[:id])\n @order.destroy\n\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "ac23039e82f793639ed84f35b6bfc003", "score": "0.7466287", "text": "def destroy\n @v1_order = V1::Order.find(params[:id])\n @v1_order.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "40ec512a4e297c75b16b7908b49ea0ac", "score": "0.7403553", "text": "...
dc9db5cd62e9e06838112882cb1a04ab
def Mover: Traza una ruta al azar en la ventana
[ { "docid": "5ef9b5138585b4ccf6b31476e00e8b6c", "score": "0.6934757", "text": "def mover\r\n if !@libre && !self.rango?(@buscarx, @buscary)\r\n @direccion.buscar(@buscarx, @buscary)\r\n elsif @libre\r\n @direccion.mover\r\n else\r\n @libre = true\r\n end # if\r\n\r\n if @tib...
[ { "docid": "d283adf1df7e8320bc5b3b900ce6509a", "score": "0.67910683", "text": "def mover\r\n # Si se ha movido una cantidad de veces, cambiar su direccion\r\n # O en caso de que se salga del margen\r\n if @contador > @movimientos || (@posx - @desbordamientox) < 0 || (@posy - @desbordamientoy) <...
644c692786442bfc842e78bae11f3199
I worked on this challenge by myself. smallest_integer is a method that takes an array of integers as its input and returns the smallest integer in the array +list_of_nums+ is an array of integers smallest_integer(list_of_nums) should return the smallest integer in +list_of_nums+ If +list_of_nums+ is empty the method s...
[ { "docid": "690dad069997cf16bf7f55479906d142", "score": "0.79267853", "text": "def smallest_integer(list_of_nums)\n list_of_nums.min\nend", "title": "" } ]
[ { "docid": "c9d7691856e5caeddb9fe642d5d8e5ec", "score": "0.88102", "text": "def smallest_integer(list_of_nums)\n if list_of_nums == nil #test to see if array is empty, if so return nil\n return nil\n elsif list_of_nums.length == 1 #test to see if array is only 1 index long\n return list_of_nums[...
61076fa3abd1ae18bfba3d33fc1c2ec3
GET /vehicle_category_and_payments/1 GET /vehicle_category_and_payments/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "3cd5edb793ed1fdd55e377bfe401e27d", "score": "0.69595015", "text": "def index\n @vehicle_category_and_payments = VehicleCategoryAndPayment.all\n end", "title": "" }, { "docid": "4f1ba6b76f00dab8b83f2fd63959c5c2", "score": "0.65643", "text": "def set_vehicle_category_an...
f6a841d977f159cc4f39e1e5b9d28954
Invite a User Create a User and invite them to the system
[ { "docid": "23c9cece708f2ae89d0abf9d72a5f40c", "score": "0.0", "text": "def invite_user(invite_user_request, opts = {})\n invite_user_with_http_info(invite_user_request, opts)\n nil\n end", "title": "" } ]
[ { "docid": "a59e9b03fb07ffe1dd6439845cdce371", "score": "0.78062224", "text": "def invite(user)\n participation = @tandem.participations.create(\n user:user,\n token: generate_token\n )\n\n send_invitation_mail participation\n true\n end", "title": "" }, { "docid": "27...
b7db6cc74fce241c82740eff076853b8
Produces a random type that's either a String or an Integer.
[ { "docid": "989cac712a174e06b5f29e1976f8a7be", "score": "0.82403773", "text": "def random_type\n type_to_use = SIMPLE_TYPES[rand(0..SIMPLE_TYPES.length - 1)]\n case type_to_use\n when :string\n rb_string\n when :fixnum\n rb_integer\n end\n end", ...
[ { "docid": "354cb17b64f4413cd7cf87f6bb0ec39d", "score": "0.6685116", "text": "def auto_type\n random_type = [\"Fire\", \"Water\", \"Grass\", \"Rock\"]\n random_type.sample\n end", "title": "" }, { "docid": "6190b6f7e8fe39e6c75e71463784029a", "score": "0.66532546", "text": "def...
577d74eba49e127e9586596c2d5a758a
PUT /user_component_xrefs/1 PUT /user_component_xrefs/1.xml
[ { "docid": "90ebf44e70ce1a9dc1cbe776336d8614", "score": "0.6835093", "text": "def update\n @user_component_xref = UserComponentXref.find(params[:id])\n\n respond_to do |format|\n if @user_component_xref.update_attributes(params[:user_component_xref])\n format.html { redirect_to(@user_c...
[ { "docid": "4a809fbd342692894c909443ad6928bc", "score": "0.6207433", "text": "def destroy\n @user_component_xref = UserComponentXref.find(params[:id])\n @user_component_xref.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_component_xrefs_url) }\n format.xml { head...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "4c16ec8a7cc395b4282352d072e5ed03", "score": "0.0", "text": "def set_wallet\n @wallet = Wallet.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;...
8a1faaa0782e795558f479ac6e428813
GET /users/1 def show
[ { "docid": "eb2c463034a20763d6ddce1b6b5d1e3b", "score": "0.0", "text": "def create\n @user = User.new(user_params)\n set_uid_and_provider\n if @user.save\n render status: :created, json: @user, include: :roles\n else\n render json: @user.errors, status: :unprocessable_entity\n e...
[ { "docid": "b7f893411aa0a30a20a26dadbd483df5", "score": "0.8296563", "text": "def show_users(**params)\n get('users', params)\n end", "title": "" }, { "docid": "6793c5476ab256881a0da0ff5b613914", "score": "0.8259931", "text": "def show\n\t@users = User.find(params[:id])\n...
65ab672ffc7564d9efbb9d767f2cf82e
Read a resource bundle (an XML ATOM feed)
[ { "docid": "153b82b3095b7adc8ad93c11a68e78a8", "score": "0.5458909", "text": "def read_feed(klass, format=@default_format_bundle)\n options = { resource: klass, format: format }\n reply = get resource_url(options), fhir_headers(options)\n reply.resource = parse_reply(klass, format, ...
[ { "docid": "bbb38143ffacea56bfba34b8db42bb01", "score": "0.6226297", "text": "def read_resource(resource, content, extension=\"\")\n path = get_path(resource, extension)\n return File.open(path, 'r')\n end", "title": "" }, { "docid": "3424baab08058aa8348a2e16650a30db", "scor...
059e797836a7dfdf2f29d1ad8a0d83e2
exec against a live local API server used for script access to a local API server or database.
[ { "docid": "3ea83796a65d39075f0e0e7173ff6d5b", "score": "0.5622941", "text": "def ensure_docker_api(cmd_name, args)\n if Workbench.in_docker?\n return\n end\n Process.wait spawn(*(%W{docker-compose exec api ./project.rb #{cmd_name}} + args))\n unless $?.exited? and $?.success?\n Common.new.err...
[ { "docid": "688e16a9738d967a7e5b2df83070d300", "score": "0.61163646", "text": "def hit_api_local\n # Authentication info\n pass = ENV['stugov_api_user']\n priv = ENV['stugov_api_pass']\n # Our base URL hosted on stugov's server\n base_url = ENV['stugov_api_base_url']\n\n # We make a sh...
45e8592ee1d6ec71620cc73a5c0eb8de
Internal method tokenize the source template
[ { "docid": "a61a3c73a55aa0899fb06e55db8fce2d", "score": "0.7054199", "text": "def tokenize(source=@source)\n regex = / \\{\\{(\\{?)(.*?)\\}?\\}\\} | # {{ var }}, or {{{ var }}} 1,2\n \\{(\\#|if|else|loop|include|extends|block)(.*?)\\}\\s* | # {if expression } 3,...
[ { "docid": "d85ec353599177ba095f34dbbdaa0d67", "score": "0.7597764", "text": "def parse_template (tokens); parse_block tokens; end", "title": "" }, { "docid": "14dcbd50d9fc81a995517889d5a8ca26", "score": "0.7413023", "text": "def parse\n tokenize\n make_template\n @tem...
a0cead31846c8da2dca91fcb684c2086
POST /ag/household_apartments POST /ag/household_apartments.json
[ { "docid": "6e7e66cf5c5ff72268b6aaed5341caf8", "score": "0.69542843", "text": "def create\n @ag_household_apartment = Ag::HouseholdApartment.new(ag_household_apartment_params)\n\n respond_to do |format|\n if @ag_household_apartment.save\n format.html { redirect_to @ag_household_apartme...
[ { "docid": "745f8aad279e07bee86054a9e6a55543", "score": "0.6879704", "text": "def create\n @ag_household = Ag::Household.new(ag_household_params)\n\n respond_to do |format|\n if @ag_household.save\n format.html { redirect_to @ag_household, notice: 'Household was successfully created.' ...
91e94650e2f2494a5ce8d60a2e49e476
Weight methods apply only to WikiRatings TODO: hamlize
[ { "docid": "9e1693bb9ec06e42f88435724925982b", "score": "0.0", "text": "def weight_row weight=0, label=nil\n label ||= _render_thumbnail_no_link\n weight = weight_content weight\n output([wrap_with(:td, label, class: \"metric-label\"),\n wrap_with(:td, weight, class: \"metric-weight\...
[ { "docid": "8f0112484880b3d46414d321220a321c", "score": "0.692835", "text": "def weighted_score\n score * metric.weight\n end", "title": "" }, { "docid": "ab39aaa7dc9c5fff643a487ee592465b", "score": "0.6885323", "text": "def weight; end", "title": "" }, { "docid": "8e...
3e4a930ed3e65101e6a3ccdf2d5e0f47
Returns the Condition of Use link
[ { "docid": "c1a46b2e43a50e101731eb128d3a409d", "score": "0.72491336", "text": "def condition_of_use_link\n $tracer.trace(__method__)\n return ToolTag.new(jquery(\"a[href='/Home/ConditionsofUse']\"),__method__)\n end", "title": "" } ]
[ { "docid": "fd873f5eddc7f6d4532ffb772406e10b", "score": "0.6187962", "text": "def link_support\n attributes.fetch(:linkSupport)\n end", "title": "" }, { "docid": "4308a8e5747dfc18ada2a2d1c20e8b60", "score": "0.609424", "text": "def get_condition\n @condition\n ...
96f6c049297848f258b70ec1cf7acff9
Get the high limit for a "less played" songs criteria
[ { "docid": "fbf5bef6426163060db1c22e7ac1262a", "score": "0.82317144", "text": "def get_less_played_criteria_limit\n less_played_song_count = Song.all.order(:plays).limit(1).first.plays\n return less_played_song_count * 1.05\n end", "title": "" } ]
[ { "docid": "d0898bcef356a7deda248b9585b71ad9", "score": "0.8091555", "text": "def get_most_played_criteria_limit\n most_played_song_count = Song.all.order(plays: :desc).limit(1).first.plays\n return most_played_song_count * 0.95\n end", "title": "" }, { "docid": "040807f0f28b861...
0c0a9edb0e61ac0778208a71d0eff14c
Compares two nodes by their left values.
[ { "docid": "c2fd9a123a186f3f695e06bc5567841b", "score": "0.5939727", "text": "def <=>(x)\n x.left <=> left\n end", "title": "" } ]
[ { "docid": "9418fc8dbc20e82c90adb6744e848130", "score": "0.7482646", "text": "def compare_and_compute_node(node, x)\n return x.left if node.value < x.value\n x.right\n end", "title": "" }, { "docid": "00e0566ab457d2b7c96aee4418a10e7b", "score": "0.7027429", "text": "def ...
564db79c3505c40071d5f4281d27f4f4
This challenge took me [] hours. Pseudocode =begin input: an integer output:a boolean steps: sets the integer as the max run fibonacci formula while the number is lesser than max if the integer ever equals a number in the sequence return true, otherwise return false =end Initial Solution
[ { "docid": "cca6cf2a7ee43a0741b00e0f96648514", "score": "0.7152287", "text": "def is_fibonacci?(num)\n array = [0, 1, 1]\n current = 0\n while current <= num\n array << array[array.length - 1] + array[array.length - 2]\n current = array[array.length - 1]\n end\n if array.include?(num)\n p ...
[ { "docid": "252db74dc60149be4cf5d5dff9513b4e", "score": "0.80260265", "text": "def is_fibonacci?(num)\n sequence = [0, 1]\n while num > sequence.max\n x,y=sequence.pop(2)\n#sequence .pop(2) return and array of two values so I set x and y to be equal to those values respectively.\n sequence.push(...
4c66f790c881e1f50902003f2d878e7f
Read a signed 8bit (1byte) integer.
[ { "docid": "220bf437d22873c55f69cbb7390ad4da", "score": "0.80468863", "text": "def read_int8\n reader.read(1).unpack(\"c\").first\n end", "title": "" } ]
[ { "docid": "cf8cb247285d4e6bd8ec78bcad894619", "score": "0.86905056", "text": "def get_i_sint8\n data = read_and_advance(1)\n BinData::Int8.read(data) ^ (-1 << 7)\n end", "title": "" }, { "docid": "fdaafac1f39553a97f4b68db67db4b3a", "score": "0.7936542", "text": "def read_int8...
64e4b4bf23394fba268a612b94dfa2d4
when building objects that contain arrays, the second object seems to inherit data from the first
[ { "docid": "5a2aea7884ddad87b24f5a04bc1fb3d1", "score": "0.0", "text": "def test_one_to_many_without_container_sequence\n contrib = WriteableContributor.new\n contrib.name = \"David Thomas\"\n\n book_one = WriteableBookWithContributors.new\n book_one.isbn = \"9781843549161\"\n book_one.ti...
[ { "docid": "b0e1639c975652d45cf629ffd9582a54", "score": "0.661247", "text": "def creation_arrays\n\t\t\n\tend", "title": "" }, { "docid": "798ebc397a0dca18f2d0c839ad7d05e6", "score": "0.6434732", "text": "def __array__\n [ self ]\n end", "title": "" }, { ...
4ae282431af99d1ee5b15fede3ef8874
GET /logout DELETE /logout
[ { "docid": "468b28ceb9b9fd776af374f76980c453", "score": "0.7182174", "text": "def destroy\n \tuser_session.logout()\n \trestore_last_request(notice: \"Successfully logged out\")\n end", "title": "" } ]
[ { "docid": "7795113a40e721c0e69d8ec121eea354", "score": "0.82364875", "text": "def logout\n request(:post, '/api/logout/')\n end", "title": "" }, { "docid": "44a32680f44e92ca1b7805ac4c64ead1", "score": "0.8204714", "text": "def log_out \n get '/sessions/destroy'\nend", "...
45279d6e5be58a4217cf24e594635564
reduce 477 omitted reduce 478 omitted
[ { "docid": "8380df5d298432b48cf17e809650fe5b", "score": "0.0", "text": "def _reduce_479(val, _values, result)\n result = -val[1] # TODO: pt_testcase\n \n result\nend", "title": "" } ]
[ { "docid": "ad801b8250ddef70cf7a067f3e475838", "score": "0.7495632", "text": "def _reduce_496(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "7faaf50c91fb7bfbb28249efb280a691", "score": "0.7454606", "text":...
7701ac0c6327e49433f1fde4d6eee90b
GraphViz expects keys to be symbols, but it's only safe (and user friendly) to have keys as strings in a config file
[ { "docid": "674c89db3929f90a424f418acc1ca809", "score": "0.0", "text": "def symbolize_the_keys(hash)\n\n hash.each_with_object({}) { |(k, v), h| h[k.to_sym] = v.is_a?(Hash) ? symbolize_the_keys(v) : v }\n end", "title": "" } ]
[ { "docid": "1a19829144c02f2bc63a35df6d58f723", "score": "0.57207614", "text": "def setKeyConf(configstr) # see gnuplot set key manual\n # useful keyword: left, right, top, bottom\n # outside, below\n @strm.printf(\"set key %s\\n\",config...
e7ec36be46702ff32666b135f1e7ccbd
POST /gethotels POST /gethotels.json
[ { "docid": "d7c25cf93b1e40dd7d38218f5eb07216", "score": "0.58946437", "text": "def create\n gethotel = Gethotel.get_hotels(params)\n respond_to do |format|\n if gethotel.body.include?(\"<boolean xmlns=\\\"http://www.reconline.com/\\\">true</boolean>\")\n flash[:notice] = 'Gethotel was ...
[ { "docid": "f56aa0ec06aa777ff5fcd1e7e5849c89", "score": "0.5332774", "text": "def new\n #@gethotel = Gethotel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gethotel }\n end\n end", "title": "" }, { "docid": "5d400df4fe681e447b2e...
a22bb2e1b4ceecc1669622b79e7eaac2
return true if an element is visible def visible? element.present? end compare this element to another to determine if they are equal
[ { "docid": "4c6ca1789a6b8ed660c41e8c1c8ac6bd", "score": "0.0", "text": "def ==(other)\n other.is_a? self.class and element == other.element\n end", "title": "" } ]
[ { "docid": "cd8dace184d36dafab5382cdeffd72ff", "score": "0.8503281", "text": "def visible?\n element.isVisible\n end", "title": "" }, { "docid": "cd8dace184d36dafab5382cdeffd72ff", "score": "0.8503281", "text": "def visible?\n element.isVisible\n end", "title": ""...
c9156181282d0bbf18d202de96f33f91
DELETE /companies/1 DELETE /companies/1.json
[ { "docid": "abb5aa593c88884a259639fe28f01528", "score": "0.74335843", "text": "def destroy\n @company.destroy\n @companies = Company.all\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Company was successfully destroyed.' }\n format.json {render json: {mes...
[ { "docid": "b39a03413d606391c52e7c71e957a049", "score": "0.8019473", "text": "def delete\n render json: Company.delete(params[\"id\"])\n end", "title": "" }, { "docid": "5ff96663ef4eea6c4a06d9ce0fe8bad1", "score": "0.7862428", "text": "def destroy\n @company.destroy\n respo...
a5995a658b316c39c5ab7d0f9b2ec09a
Count all the occuring characters in a string. If the string is empty, then the result should be an empty hash. Assumption: Case matters Assumption: String will only contain letters. No special characters or numbers. Assumption: The resulting hash must be sorted by alphabetical order of the chars Data Structures input ...
[ { "docid": "cf0acdda2ccfb4ece179244260a21b20", "score": "0.7573997", "text": "def count_chars(str)\n arr_chars = str.chars \n counter = {}\n arr_chars.each do |char|\n if counter.keys.include?(char)\n counter[char] += 1\n else \n counter[char] = 1\n end\n end\n counter.sort.to...
[ { "docid": "bbc36c975a2d50c2e4d7865eb190baab", "score": "0.7424273", "text": "def char_count_to_hash(str)\r\n counter = 0\r\n hsh = {}\r\n loop do\r\n break if counter == str.length\r\n current_char = str[counter]\r\n hsh.key?(current_char) ? hsh[current_char] += 1 : hsh[current_char] = 1\...
4c45136bb4b408341b6f2dcb1cc32497
GET /subjects GET /subjects.json
[ { "docid": "c3e14c7349e599dca49195ba27eb94a1", "score": "0.0", "text": "def index\n\n # @tt = ['slot 1', 'slot 2', 'slot 3'];\n # ttc = [:slot1 => 'val 1 for slot 1', :slot2 => 'val 2 for slot 2', :slot3 => 'val 3 for slot 3' ];\n\n @subjects = Subject.all\n data = {};\n\n # data = '';\n\...
[ { "docid": "d80d4333a53cc29f4d017263f240637b", "score": "0.80696344", "text": "def get_subjects\n @content_year = ContentYear.find(params[:id]) unless params[:id].blank? rescue nil\n list = @content_year.subjects.map {|u| Hash[value: u.id, name: u.name]} rescue []\n render json: list\n end", ...
bd9e4a8feea6aa3603cb0812fbf523d1
Apple introducted a new file system in High Sierra (UTF8). Mac OS Extended was UTF16 and the ruby source code `dir.c` explicitly assumes UTF16 for the __APPLE__ compiler flag (which as been the case for the past 30 years until 2018). This causes Dir.glob to return a different file order on High Sierra vs Sierra. This m...
[ { "docid": "8ce73ff7730c393b17b669fda6e78229", "score": "0.60613364", "text": "def lexicographically pattern\n\tsupported_extensions = %w( c m cpp cxx mm h rb)\n\tpathnames = Pathname.glob pattern\n\tpathnames.sort_by do |p|\n\t p.each_filename.to_a.map(&:downcase).unshift supported_extensions.index(...
[ { "docid": "92d48190e6817e3fb7f0fa4ddfb9fe01", "score": "0.7471829", "text": "def glob_directory(path)\n results = ::Dir[path]\n\n return results unless RUBY_PLATFORM =~ /darwin/\n\n results.map { |r| r.encode('UTF-8', 'UTF-8-MAC') }\n end", "title": "" }, { "docid": "af2c0...
a880ef741a99e3dc90442438d4d86db9
Returns the path to an existing page, or nil if no page exists. This method returns the first existing page file regardless of extension.
[ { "docid": "108aa06dbbfb7a0e59d22ba7e40917ff", "score": "0.6693045", "text": "def existing_page_path(page_name, topic)\n Dir[\"#{topic_directory(topic)}/#{page_name}.*\"].first\n end", "title": "" } ]
[ { "docid": "5733cfb9f6c1472ef4035d9d544554d0", "score": "0.6637821", "text": "def find\n path = clean_content_pathname.join(page_id.tr(\"\\\\\", \"/\")).cleanpath.to_s\n if !path.start_with?(\"#{clean_content_pathname}/\")\n raise InvalidPageIdError.new \"Invalid page id: #{page_id}\"\n...
7df1ebd38c3e904eee7ea9af785ec70c
Edit team (admin only)
[ { "docid": "bfc5c38ac110fae7fbf84011371abef1", "score": "0.78579783", "text": "def edit\n\t\t@team = Team.find(params[:id])\n\tend", "title": "" } ]
[ { "docid": "d2049599b6c962c238503ce73dd4e37d", "score": "0.78684014", "text": "def edit\n @team = Team.find(params[:id])\n end", "title": "" }, { "docid": "6496df7abda77ad7ef15bbf261fe0d44", "score": "0.7736532", "text": "def set_admin_team\n @admin_team = Team.find(params[:...
acec564c3838f10c71d4d81e04c59794
If we visited the node, so there is a path from our source node to it.
[ { "docid": "e85cf1853ae48c52b4bcd53f97b51017", "score": "0.7031532", "text": "def has_path_to?(node)\n @visited.include?(node)\n end", "title": "" } ]
[ { "docid": "48f0149e00d3571b61567fd9e509ef3a", "score": "0.75364363", "text": "def path_to(node)\n return unless has_path_to?(node)\n path = []\n current_node = node\n\n while(current_node != @source_node) do\n path.unshift(current_node)\n current_node = @edge_to[current_node]\n ...
d0349c014d0cafc8086c5db2162a6c05
Array of methods/parameters that should be displayed returns an Array of strings
[ { "docid": "c9d4bf9efded2d03a911918faaca3464", "score": "0.0", "text": "def display_fields\n [\"name\", \"assignment_name\", \"description\", \"where_stored\"]\n end", "title": "" } ]
[ { "docid": "403b6d77754177b303285dcbf57b82ae", "score": "0.6766479", "text": "def display_method_list(methods)\n page do\n puts \"More than one method matched your request. You can refine\"\n puts \"your search by asking for information on one of:\\n\\n\"\n @formatter.wrap(methods.map ...
8f5d38d334cf055db7b73bb8ed7fa1f9
End of Iteration methods
[ { "docid": "42c764cbdc949c1bd504fff22bacfdc7", "score": "0.0", "text": "def flush_db_for_load_team_proj\n ProjectIteration.delete_all\n Project.delete_all\n Team.delete_all\n end", "title": "" } ]
[ { "docid": "57116e293841f9b2302739df9ad6d692", "score": "0.74663407", "text": "def end_all\n # nothing here\n end", "title": "" }, { "docid": "1df65d045e0d65f9bf9b98c8cdd94356", "score": "0.74214804", "text": "def finish()\n #This is a stub, used for indexing\n...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "6c19c5f60c534eea06ec3ae1bac69bb4", "score": "0.0", "text": "def set_flight\n @trip = Trip.find(params[:trip_id])\n @reservation =Reservation.find(params[:reservation_id])\n @flight = Flight.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60328794", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6017492", "text": "de...
bd3a7dfddc30bc69012064ac1ec450c4
Given a hash with numeric values, return the key for the smallest value
[ { "docid": "390e7be9ac0d7e42ec6405361029433b", "score": "0.0", "text": "def key_for_min_value(name_hash)\nname = nil \nlowest_valaue = 1050\n name_hash.collect do |key, value|\n if value < lowest_valaue\n lowest_valaue = value \n name = key\n end\n end\nname\nend", "title": "" } ...
[ { "docid": "187165074e32a7573ee53a9cabb44ed4", "score": "0.88816375", "text": "def key_for_min_value(hash)\n lowest_key=nil \n lowest_value= Float::INFINITY\n hash.each do |name,number|\n if number < lowest_value\n lowest_value=number\n lowest_key= name\n end \n end\n lowest_key\nen...
a7a817661c0faa5c863dfc7d8fa829b2
Returns the string representation of the object
[ { "docid": "a408df9f3be79d7c20500741a990725c", "score": "0.0", "text": "def to_s\n to_hash.to_s\n end", "title": "" } ]
[ { "docid": "fbdd4f858146598aaabf84003282a8d1", "score": "0.9019143", "text": "def to_s\n @object.to_s\n end", "title": "" }, { "docid": "d69be2e09bbb16dc0e9df0ec2905d3f4", "score": "0.88394713", "text": "def to_s\n\t\treturn self.obj.to_s\n\tend", "title": "" },...
df396b2458d62b5db5a2c515bf19bec9
POST /manuals POST /manuals.json
[ { "docid": "b462d41f1f26882cd639c7bb2f9ac92d", "score": "0.6545477", "text": "def create\n @manual = Manual.new(params[:manual])\n if @manual.save\n flash[:notice] = \"Your manual has been created.\"\n redirect_to @manual\n else\n flash[:alert] = 'Your manual has not been created...
[ { "docid": "59881a44b252d831c7c6db140c9fd1d4", "score": "0.7567606", "text": "def create\n @manual = Manual.new(manual_params)\n\n if @manual.save\n render json: @manual, status: :created, location: @manual\n else\n render json: @manual.errors, status: :unprocessable_entity\n end\n...
e86ac15faf7c71470a827d5d15432eb9
first we define the "print_two" method, then we tell it we want args which is like ARGV but for functions
[ { "docid": "0fd5ec54b08d4a3d80a8ca8f50106878", "score": "0.816983", "text": "def print_two(*args)\n\targ1, arg2 = args\n\tputs \"arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" } ]
[ { "docid": "24a980e1a8884629d649d39e3b07df7c", "score": "0.8722232", "text": "def print_two(arg1, arg2) #*args - ARGV for functions\n\t#arg1, arg2 = args\n\tputs \"Arg1: #{arg1}, arg2: #{arg2}\"\nend", "title": "" }, { "docid": "cf111edccdd55be5d6328ac617a17ae8", "score": "0.8642941", ...
85740de2dc8903969a9ee6b5981ff129
'csv' file is created with attributes of object
[ { "docid": "19de966707ca7401e61ee5d9773e8404", "score": "0.71004766", "text": "def create_csv\n\t\tCSV.open(@file, \"wb\") do |csv|\n \t\t@people_array.each do |person|\n \t\t csv << [person.first_name, person.last_name, person.email, person.phone, person.created_at]\n \t\tend\n\t\tend\n\tend", ...
[ { "docid": "b352564ba46b203c6e7e43b9da043d60", "score": "0.765678", "text": "def write_data(csv, attributes, objects)\n objects.each do |object|\n data = attributes.collect { |a| object.send(a) }\n csv << data\n end\n end", "title": "" }, { "docid": "6494e321b8b3e1811cd14356...
86b2f74a1f27818c63468a3dff980567
we can probably do something clever w/ method missing here
[ { "docid": "ad4ba8cb9a7122c47912398ec6ee49bf", "score": "0.0", "text": "def available?\n Holdings::Status::Available.new(@item).available?\n end", "title": "" } ]
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.7017827", "text": "def private; end", "title": "" }, { "docid": "0b8b7b9666e4ed32bfd448198778e4e9", "score": "0.6343866", "text": "def probers; end", "title": "" }, { "docid": "65ffca17e416f77c52ce148aeafbd826", ...
f6b0ecf188f5fea5f958868cbdbe4143
list all objects in the room
[ { "docid": "7f217585868b4a161b7b5479dbbe3bcc", "score": "0.0", "text": "def describe_objects\r\n sorted_contents.each { |obj|\r\n article = 'aeiou'.include?(obj[0..0].downcase) ? 'an' : 'a'\r\n puts \"There is #{article} #{obj} on the ground.\"\r\n }\r\n end", "title": "" } ]
[ { "docid": "e93d50d4692fef70db5fbd11f6621ca4", "score": "0.734171", "text": "def list_all_rooms\n return @rooms\n end", "title": "" }, { "docid": "44a5bc09e2e6e170133e5390e4e91d7a", "score": "0.7336335", "text": "def index\n @rooms = Room.all.map do |rm|\n Room.cleanFetch...
ab3170140f7f40b8505fcff252e4b10c
PATCH/PUT /games/1 PATCH/PUT /games/1.json
[ { "docid": "47df891c46815a22913add77e15c5d45", "score": "0.0", "text": "def update\n respond_to do |format|\n if @game.update(game_params)\n\t# start for mtm\n\t@game.genres.delete_all\n\tif params[:game][:genre_ids]\n\t params[:game][:genre_ids].each do |genre_id|\n\t unless genre_id.empty?...
[ { "docid": "e7ed2fba84a75b626b2e0b306e4eb204", "score": "0.7157309", "text": "def update\n #if game exists, pass here to update state\n @game = Game.find_by(id: params[:id])\n @game.update(game_params)\n render json: @game, status: 201\n end", "title": "" }, { "docid": "f3c597d4...
463b74c641d85a0b9972cd6fe99ae09f
Verify a host has no services
[ { "docid": "d18f9c86e99fd3c659b8d97f2e0bf4b7", "score": "0.77591914", "text": "def test_has_no_services\n hostname = \"lol-no-001.notreal.com\"\n assert_equal(false, cmk.has_services(hostname))\n end", "title": "" } ]
[ { "docid": "6b824de64ce95208d110ba87a85b6410", "score": "0.6711519", "text": "def has_required_host?\n true\n end", "title": "" }, { "docid": "73b6f5cc61510ccddacd91327e91da11", "score": "0.6545138", "text": "def check_host_existence\n if (Host.all.count == 0)\n flash[:er...
3b4406fe42e48798325757111d81de4e
I worked on this challenge with: . 1. Solution Write your comments on what each thing is doing. If you have difficulty, go into IRB and play with the methods.
[ { "docid": "076588ebe8cec6127faab76aae36236c", "score": "0.0", "text": "def north_korean_cipher(coded_message)\n input = coded_message.downcase.split(\"\") # Turning every letter into a lower case letter and then splitting it into array\n decoded_sentence = []\n cipher = {\"e\" => \"a\", # This is ...
[ { "docid": "b9960478999684c2b536f76e22f6fc63", "score": "0.63616985", "text": "def solution4(input)\n end", "title": "" }, { "docid": "f712d49ec6c615538b2e2aa846391fda", "score": "0.63327914", "text": "def challenge; end", "title": "" }, { "docid": "bca12d2414c241325b8be...
166a238d9b02522c4d9fb3f2e22dedc4
Adds an APIKEY and and APISECRET for a specified date range Method is chainable.
[ { "docid": "4ba48c3f2e4a1db6e255759142bb4071", "score": "0.48654678", "text": "def add_key(active_range, key, secret)\n @vendor_keys << VendorKey.new(active_range, key, secret)\n self\n end", "title": "" } ]
[ { "docid": "1af396a4df9f2d0cea6f6855044cc54e", "score": "0.5964116", "text": "def build_args(start_date, end_date)\n unless @environment_mode == \"production\"\n start_date = Date.new(2013,7,29)\n end_date = Date.new(2013,8,5)\n end\n\n {\n \"connectionID\" => @connec...
50333ef5bd93b7a71de9cb75fe03eb65
Rotate the image. Takes a single argument of degrees to rotate. Positive values rotate to the right, negative to the left. According to auugh: "The values seem to range as high as 135. Positive values rotate to the right, negative numbers rotate to the left. Negative numbers go... well, I stopped testing in the hundred...
[ { "docid": "4339add2e684212c5350f57ea9346b05", "score": "0.0", "text": "def tilt! (degrees)\n @transforms << \"PT#{degrees}\"\n self\n end", "title": "" } ]
[ { "docid": "d79d23851a3423c9aea95b6f62c7301f", "score": "0.74579275", "text": "def rotate( deg )\n set_base_image( base_image.rotate( deg ) )\n end", "title": "" }, { "docid": "12acf978ce97ea3407737b5980ab0cd4", "score": "0.7420056", "text": "def rotate angle\n positio...
ac7cb1ca690dbe16729af7c482720967
helper to generate correct urls for downloading fastq files
[ { "docid": "8e560501a799cab8c849b7bcdc4bb6f3", "score": "0.0", "text": "def download_path(file)\n\t\tif self.study.public?\n\t\t\tdownload_file_path(self.study.url_safe_name, filename: file)\n\t\telse\n\t\t\tdownload_private_file_path(self.study.url_safe_name, filename: file)\n\t\tend\n\tend", "titl...
[ { "docid": "3dd654e77ab77967a4e5f37a4aa6961d", "score": "0.6342509", "text": "def file_set_url(file_set_id)\n \"https://#{ENV['SERVER_NAME']}/downloads/#{file_set_id}\"\n end", "title": "" }, { "docid": "83c951cf5bf68f2e8210a48eeabd0a5d", "score": "0.63346654", "text": "def make_...
8211f9bc9f4d0f1d77342d7e26f4398c
Handles redirecting to page for updating / assigning courses for the selected faculty param faculty_id faculty id
[ { "docid": "98456297292241b5a047a9e162c92a3a", "score": "0.69212747", "text": "def select_faculty\n \tif params[:faculty_id] != \"\"\n \t\tfaculty_courses = FacultyCourse.where(\"faculty_id = ? and semester_id = ?\",params[:faculty_id],session[:semester_id])\n \t\tif faculty_courses.length == 0\n \t...
[ { "docid": "6b334c8e02e0b68ef78943fa37e924cd", "score": "0.7419968", "text": "def update\n if has_permissions_or_redirect(:staff, root_path)\n @course = Course.find(params[:id])\n\n if (params[:course][:is_configured]) #The previous page was configure action\n @course.twiki_url = par...
103edc36b5e73f7b97498b7e39f97b46
Returns a new time the specified number of days ago. source://activesupport//lib/active_support/core_ext/time/calculations.rb336
[ { "docid": "033f674a24921008a096210547ede17e", "score": "0.0", "text": "def prev_day(days = T.unsafe(nil)); end", "title": "" } ]
[ { "docid": "4780b3fc7bc5ee8172ede58cde310a93", "score": "0.72658277", "text": "def days_ago(days)\n Time.now - (days * 24 * 60 * 60)\n end", "title": "" }, { "docid": "5ab6d1564030dddfa9fd7dd1f1fbeef7", "score": "0.7213562", "text": "def days_ago(days)\n advance(:days =>...
60fc1dd97ede51a428347161de4cb963
search for videos at youtube
[ { "docid": "c32163360b4b4540db16f92ace6fc53d", "score": "0.62505865", "text": "def search(tags, params)\n \n begin\n tags_to_search = tags.strip.split.join(\"/\")\n start_index = (params[:page].to_i * params[:per_page].to_i)-(params[:per_page].to_i-1)\n order = youtuberize_sort(params[...
[ { "docid": "d24ba44bc4adf61f191fb8a278f636d7", "score": "0.7501221", "text": "def youtube_search(query_term)\n query_term = query_term + \" trailer\"\n query_term = query_term.split(\" \").map do |word|\n word.scan(/\\w+/)[0]\n end.join(\"%20\")\n url = \"https://www...
a2d196f9f1b7a77130550edf01966bf8
Do we need to search the other side of our axis? Or is the target node too far from the axis that we know there can't be anything closer? We need to check the other side if the best distance so far is larger than the distance from target node to my splitting axis (i.e., does a hypersphere of radius bestk cross the spli...
[ { "docid": "42251d256102cba44010197f9323f95e", "score": "0.7080867", "text": "def axis_too_far_from(target, bestk)\n target_to_axis_d = if @axis == 0\n @value.x - target.x\n elsif @axis == 1\n @value.y - target.y\n ...
[ { "docid": "50ecfca1ea8c3e71977f506d12a5ca51", "score": "0.71507066", "text": "def axis_too_far_from(target, bestk)\n target_to_axis_d = if @axis == 0\n @value.x - target.x\n else\n @value.y - target.y\n ...
cc6a5fb374ed45916cf2ff95c2cce59e
GET /api/v3/scenarios/:id/costs_parameters Returns a CSV file containing the cost paramaters of nodes belonging to costs groups.
[ { "docid": "18b6b007ffd0a7a8dc979ceac37752c9", "score": "0.7861042", "text": "def costs_parameters\n send_csv(CostsParametersSerializer.new(@scenario), 'costs_parameters.%d.csv')\n end", "title": "" } ]
[ { "docid": "6f17961f9c5ffdbcd6b31c0d93e1b938", "score": "0.5513154", "text": "def cost_params\n params.require(:cost).permit(:id, :name, :parent_id, :cost_type, :data_type, :tooltip)\n end", "title": "" }, { "docid": "019c88f9704594b4a0e6fc38b5148f38", "score": "0.54084677", ...
55e8cff23cedc2a038c025fcaa1e5603
GET /fundraisers/1 GET /fundraisers/1.json
[ { "docid": "deb5290836dde1b03b2be69cfc78a14a", "score": "0.729471", "text": "def show\n @fundraiser = Fundraiser.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fundraiser }\n end\n end", "title": "" } ]
[ { "docid": "7c8f8fa497669b965fb13282a3f37ba0", "score": "0.7204716", "text": "def show\n @fund = Fund.friendly.find(params[:id])\n\n render json: @fund\n end", "title": "" }, { "docid": "5928468f0bf087b503a022f1608ca11d", "score": "0.71344763", "text": "def index\n...
c4d53c76bb409fdfc215571a3ece1421
Trim length of the tail string segment. Default is the word length
[ { "docid": "ee872d91ab46b78d849fd0395d9c0954", "score": "0.750516", "text": "def trim \n @trim ||= length\n end", "title": "" } ]
[ { "docid": "0f98a38fa474c97f024b7984837928f4", "score": "0.7306448", "text": "def sa_truncate(length, after_a_word = false)\n str = self[0...length] \n \n if after_a_word == true\n words = str.split(/\\s+/)\n str = words[0..words.length - 2].join(' ')\n end\n\n ...
e87d63499662edf7dea5a7979e14b342
The server's 'string' is server:port format.
[ { "docid": "bc2f4d074ab29fe90acda46c83d5b14c", "score": "0.0", "text": "def to_s\n \"#{@addr}:#{@port}\"\n end", "title": "" } ]
[ { "docid": "61805a0ef3c9e3676ed2de8f4da915d6", "score": "0.7921368", "text": "def server\n \"#{@host}:#{@port}\"\n end", "title": "" }, { "docid": "ddcb1dbd680011b3904e84f981928830", "score": "0.7531363", "text": "def server=(server)\n @host, @port = server.split(':')\n ...
a7ea55daef83c6f2dc3e9a40e0474da1
Return the window height
[ { "docid": "21a002a6cb8a1c3dcdadbf847f656383", "score": "0.79874855", "text": "def window_height\n base_height = (wb = current_window_builder)[5] + wb[-1]\n base_height + default_line_height * line_number\n end", "title": "" } ]
[ { "docid": "40cc3c72d6aea8800123b9bd8985e729", "score": "0.86611307", "text": "def window_height\n end", "title": "" }, { "docid": "c1c4a7101db9d2605e078d254176619c", "score": "0.8348001", "text": "def window_height\n fitting_height(11)\n end", "title": "" }, { "doci...
4576bc6c5cc902ff9aa6b4ded1b55417
Get tags for an Invitation Returns the tags for the invitation.
[ { "docid": "6b48a66a1fc8d971d94a631bec111d0a", "score": "0.7682688", "text": "def get_invitation_tags(invitation_id, opts = {})\n data, _status_code, _headers = get_invitation_tags_with_http_info(invitation_id, opts)\n data\n end", "title": "" } ]
[ { "docid": "f2ac8b5a801e43faa9daec49ed3faeb3", "score": "0.6618631", "text": "def get_invitation_tags_with_http_info(invitation_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: InvitationsApi.get_invitation_tags ...'\n end\n # verify ...
dcbed8395a7771ece166b269caba65a1
Returns the value of +exp+.
[ { "docid": "7a690fc3b980fe2fb08e76c5c03a6664", "score": "0.0", "text": "def process_lit(exp)\n exp[1]\n end", "title": "" } ]
[ { "docid": "6a627f027ed514a942ff258906612ca3", "score": "0.77125907", "text": "def exp\n only_numerics(clone: false).recode(&:exp)\n end", "title": "" }, { "docid": "b1766967579bc426c507fa8e646cba01", "score": "0.73865914", "text": "def exp(base, exp)\n return 1 if e...
9c8c9ae4a46680b2ba114249e8758ee4
Read a &39;iam.SessionLimits&39; resource.
[ { "docid": "0107e5c4d02fceb84d8283753b5f53b0", "score": "0.6577441", "text": "def get_iam_session_limits_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: IamApi.get_iam_session_limits_list ...'\n end\n allowable_values...
[ { "docid": "622a509253d67d223bdb263be1b2592c", "score": "0.67190903", "text": "def limits\n login\n\n uri = @services['compute'] + 'limits'\n\n body = request Net::HTTP::Get, uri\n\n limits = body['limits']\n\n @rate_limits = limits['rate']\n @absolute_limits = limits['absolute']\n...
3fcbb72356f3b46a42ee85a5d909c291
Scans blocks for IDs If urls(id) are used, ensure these IDs are unique to this file Only replace IDs if urls exist to avoid replacing defs used in other svg files
[ { "docid": "de0a994ac1dec6eadae63f2974f7ff8a", "score": "0.54590416", "text": "def prep_defs(svg)\n\n # <defs> should be moved to the beginning of the SVG file for braod browser support. Ahem, Firefox ಠ_ಠ\n # When symbols are reassembled, @defs will be added back\n \n if @defs = svg....
[ { "docid": "548bcdd7fd21eccc838a7e594f202481", "score": "0.60725754", "text": "def refresh_ids\n\t\t# Find all puzzle IDs retrieved\n\t\tpuzzle_files = Dir[\"./puzzles/*.pdf\"]\n\t\tids = puzzle_files.map do |path|\n\t\t\tpath.split(\"/puzzle-\").last.split(\".\").first\n\t\tend\n\t\t@puzzle_ids = Set.n...
f10cc1167279e51b454e30a8917b2620
GET /position_approvals/1 GET /position_approvals/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "f4fb6f6cd80a71f41d95452557c82add", "score": "0.72898453", "text": "def index\n @position_approvals = PositionApproval.all\n end", "title": "" }, { "docid": "f31738c4108e1e45c7b58d525fdb0420", "score": "0.62760544", "text": "def set_position_approval\n @position_a...
a45206bf65434c073b2e1c71c19be1b6
GET /post227s/new GET /post227s/new.xml
[ { "docid": "5ac7a21f71677b6316841b052d38f924", "score": "0.7577785", "text": "def new\n @post227 = Post227.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post227 }\n end\n end", "title": "" } ]
[ { "docid": "e62bc68ab06a9acae0a40532873ee65c", "score": "0.74014485", "text": "def new\n @post101 = Post101.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post101 }\n end\n end", "title": "" }, { "docid": "efc7a1f3b0ee83a8e72c5...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "10426658d0a72fb44b301c65203f801e", "score": "0.0", "text": "def set_stripe_subscription\n @stripe_subscription = StripeSubscription.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;...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "af07b1f82e9e9304ed996d3c21fe355c", "score": "0.0", "text": "def set_student\n @student = Student.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...
43969b31687f2419153237f457db25a1
Version: 1.0 Date: 06 Jul 2016 Updated at | Update by 07 Jul 2016 | Mario Perez 09 Jul 2016 | Paola Munoz
[ { "docid": "93093b9a66e4659373185010c71191f0", "score": "0.0", "text": "def tableGrid\n\t@tableGrid ||=TableGrid.new\nend", "title": "" } ]
[ { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.64217323", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.64217323", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3...
914b183d7aa0fc8e989bdd6c73a4bd77
Should we disable the "amount" accessor? Is there a clean way to do that?
[ { "docid": "0d597ef56b117249b3555ae269e9b9d3", "score": "0.0", "text": "def outstanding_payments\n payer_payments.select { |pp| !pp.paid_up? }\n end", "title": "" } ]
[ { "docid": "75b843ae1937655944f7d3674d087101", "score": "0.76953727", "text": "def original_amount() nil end", "title": "" }, { "docid": "86ceb2f8826169bb435b0970a18e9db3", "score": "0.7492788", "text": "def amount\n nil\n end", "title": "" }, { "docid": "b843ec331a22...
4cca3af51f6bc9badb8134ae087a12e2
Public: Render the Asciidoc document using Tiltcompatible templates in the specified path. template_base The String pathname of the directory containing templates. Examples Dir.entries(template_dir) => ['.', '..', 'document.html.erb', 'section.html.erb', 'section_paragraph.html.erb', ...] doc.render(template_dir) => "D...
[ { "docid": "90bd0ba003f65535e857a361a7cb11b0", "score": "0.6406989", "text": "def render(template_dir)\n @renderer = Renderer.new(template_dir)\n html = @renderer.render('document', @root, :header => @header, :preamble => @preamble)\n @renderer = nil\n\n html\n end", "title": ...
[ { "docid": "8ad77bf2b7cacd8e9cfd23c65bfa4b85", "score": "0.6217351", "text": "def render(filename, template, b = nil)\n @current_path = filename\n File.makedirs(File.dirname(filename))\n t = R2Doc::TemplateManager.load_template(\"#{template_name}/#{template.to_s}\")\n b = b.nil? ? bi...
762084cca078472a3bb01aa1215b47db
callback when app config loaded
[ { "docid": "0d0b4ec30b9c9e2db756113b7dad6199", "score": "0.84182835", "text": "def on_app_config_loaded path\n end", "title": "" } ]
[ { "docid": "a397e7d70fb46699b1298d584daf15a8", "score": "0.7383459", "text": "def config_hook\n end", "title": "" }, { "docid": "e6c9b3f83294317aa25ea824549cc4c1", "score": "0.7057155", "text": "def loadConfig(config)\n _check_and_callback(:loadConfig, config)\n end", "title...
0a72008f999ff4986a767cd098ce3f66
build a ferret query matching only the record with the given id the class name only needs to be given in case of a shared index configuration
[ { "docid": "9d6ee60e63a43be9f64f27f30641612b", "score": "0.7315495", "text": "def query_for_record(id, class_name = nil)\n Ferret::Search::TermQuery.new(:id, id.to_s)\n end", "title": "" } ]
[ { "docid": "5340ace2af35d052abf01da7335e5d0a", "score": "0.67185825", "text": "def find(id)\n @klass.new(id) if @index_table.first(:id => id)\n end", "title": "" }, { "docid": "55c421aecab0668d5960a33a38515745", "score": "0.668319", "text": "def __records_for_klass(klass, ids...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "7c8a4706fec37f2c3d28a3dce22c6d2d", "score": "0.0", "text": "def reuniaoletra_params\n params.require(:reuniaoletra).permit(:nome, :data,\n :letras_reunioesletras_attributes => [:id, :letra_id, :_destroy,\n ...
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74964964", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6957765", "text": "def strong_params\n params.require(:request).permit(param_whit...
b2f84d5e784212cdad429af6a14914eb
DELETE /vinos/1 DELETE /vinos/1.json
[ { "docid": "cc32f05f73e01ed1497f82074fa1eaac", "score": "0.6898324", "text": "def destroy\n @vino.destroy\n respond_to do |format|\n format.html { redirect_to vinos_url, notice: 'Vino was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ...
[ { "docid": "179ff0053e8f4f967cb3d92206094cf0", "score": "0.76381564", "text": "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "title": "" }, { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.7258387", "text": "def delet...
78bd15a26df15155f0d06877766636bf
Requests a dispatch if a response is needed, then updates full_response.
[ { "docid": "97c02f8ad23578214b998da2c53c1efa", "score": "0.78014404", "text": "def dispatch!\n full_response! if !response_required? || Responder.dispatch_for(self)\n end", "title": "" } ]
[ { "docid": "93f6602cd207c09776b47605a1755777", "score": "0.7016494", "text": "def dispatch(response = Response.new(self, shell))\n @response ||= response\n end", "title": "" }, { "docid": "b3326c5cb130068e960cd84c12d8b684", "score": "0.61500335", "text": "def do_dispatch!...
d9d26d6700737c33cfe2111a57e6e53a
Handle test step started event
[ { "docid": "41f8283968e39ea5abd92785694aadd8", "score": "0.8862959", "text": "def on_test_step_started(event)\n event.test_step.hook? ? handle_hook_started(event.test_step) : handle_step_started(event.test_step)\n end", "title": "" } ]
[ { "docid": "dca1bfedb92f8904329f1e8efffd6981", "score": "0.8708465", "text": "def on_test_step_started(event)\n hook?(event.test_step) ? handle_hook_started(event.test_step) : handle_step_started(event.test_step)\n end", "title": "" }, { "docid": "dca1bfedb92f8904329f1e8efffd6981", ...
4735a74e10548e41afd5e7d24072ffa1
Returns the modulename for this testcase superclass. It is used by factory for categorizing tests.
[ { "docid": "34311c604702dc3a46807569f52859a7", "score": "0.0", "text": "def modulename\n \"cloudconfig\"\n end", "title": "" } ]
[ { "docid": "18261794d8f57ea5a6716246faebe780", "score": "0.73628956", "text": "def test_case_name\n @test_case_name ||= class_name + 'Test'\n end", "title": "" }, { "docid": "c5c5e2db6ccbf12d4d5277b651ee50ab", "score": "0.7231245", "text": "def full_test_case_name\n ...
97af8c5881458ceb3f4a03f1b87aa254
Parses an item line.
[ { "docid": "396b4dc24ebf07ef30dfe5c67e26a2e4", "score": "0.7401046", "text": "def parse_item(line)\n leader = line =~ /-/\n line[(leader + 2)..-1]\n end", "title": "" } ]
[ { "docid": "af3897c6203955ca39916760eaf37cac", "score": "0.70335656", "text": "def parse_line_items line\n if line.count != 5\n puts \"Incorrect blockchain format\"\n exit()\n end\n \n return line[0], line[1], line[2], line[3], line[4]\n end", "title": "" }, { "docid":...
dc9cc87a52d4107bf88728a2c53d17f7
GET /people GET /people.xml
[ { "docid": "be14f9f18a7f2ed43980f6b4dab24921", "score": "0.7083019", "text": "def index\n @people = Person.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @people }\n end\n end", "title": "" } ]
[ { "docid": "ae9600dafedd8bb0cf0eed9d52406aca", "score": "0.7331616", "text": "def show\n @people = People.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @people }\n end\n end", "title": "" }, { "docid": "342cab036...
0fd4a2c42522a211ad3052c2d7cb0b90
this will otherwise drop default procs and return a base hash
[ { "docid": "6cb2a372ad9b89508fab76021c441751", "score": "0.0", "text": "def transform_values\n LazyFeatureQueryFacet.new\n end", "title": "" } ]
[ { "docid": "8f97e73317cd71f4efbc229f285343ba", "score": "0.68320507", "text": "def hash_function\n @hash_function ||= 'sha256'\n end", "title": "" }, { "docid": "44edaff4dd89abd1e42d1234b61bb5b0", "score": "0.6335564", "text": "def hash\n super +\n @even...