query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
f2b214802aff87cddd4a0e0e6d50ef49
Get Text Color n : text color number (07)
[ { "docid": "e3a974c559fc37545a662bcbff6674c6", "score": "0.86818284", "text": "def text_color(n)\n case n\n when 0\n return Color.new(255, 255, 255, 255)\n when 1\n return Color.new(128, 128, 255, 255)\n when 2\n return Color.new(255, 128, 128, 255)\n when 3\n return C...
[ { "docid": "6d38e764dcb1351b26dddc645ae74f31", "score": "0.873532", "text": "def text_color(n)\n return case n\n when 0 then Color.new(255, 255, 255)\n when 1 then Color.new(80, 80, 255)\n when 2 then Color.new(255, 0, 0)\n when 3 then Color.new(0, 255, 0)\n when 4 then Color.new(128, ...
0a42e76642597b7e78bb85f90e29a4f1
POST /desired_pokemons POST /desired_pokemons.json
[ { "docid": "39fade876d036d1bbff95e61e9cf92ae", "score": "0.54669696", "text": "def create\n puts 'It is in create'\n puts \"params #{desired_pokemon_params}\"\n \n parameters = desired_pokemon_params.merge!(user_id: current_user.id)\n\n @desired_pokemon = DesiredPokemon.new(parameters)\n\...
[ { "docid": "f09d9b9f54ae3bffef03d250ed3cd9fb", "score": "0.59723014", "text": "def index\n @desired_pokemons = current_user.desired_pokemons\n end", "title": "" }, { "docid": "7d140bbdfa682a8cda979135c0044492", "score": "0.5897997", "text": "def get_pokemon\n i = 1\n while ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "9265e10131b0a3ed6586965bab4ffd6a", "score": "0.0", "text": "def empanada_params\n params.require(:empanada).permit(:ingrediente_ppal, :ingrediente_secundario, :cantidad)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74968386", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6958337", "text": "def strong_params\n params.require(:request).permit(param_whit...
78de117b753a06a3312c752e4a9fe1a5
this is stupid... shopping cart stuff is so wacky
[ { "docid": "46858e80233ec916996a088e8350814b", "score": "0.0", "text": "def account\n support_level.team.account || support_level.team.create_account\n end", "title": "" } ]
[ { "docid": "5bf9408c8d3c8ff97f108f4de846ff42", "score": "0.69043636", "text": "def cart ; end", "title": "" }, { "docid": "e01c9626ccae8adeaab96eea05193eb9", "score": "0.6380112", "text": "def cartman(quote)\nend", "title": "" }, { "docid": "47f6e9e7552124169a73558f92557e...
0736c6e2386a92abbe5e6a2451ef958b
Adds extra space when outputting an array. This helps create better version control diffs, because otherwise it is all on the same line.
[ { "docid": "f73eb8af1e98830c0f6c9641f48ed19e", "score": "0.61439", "text": "def prettyify_array(gemspec_ruby, array_name)\n gemspec_ruby.gsub(/s\\.#{array_name.to_s} = \\[.+?\\]/) do |match|\n leadin, files = match[0..-2].split(\"[\")\n leadin + \"[\\n #{files.split(\",\").join(\",\\n ...
[ { "docid": "7576011a42025c4c2b28325547b36b0a", "score": "0.72295505", "text": "def print_array_elements_per_line array\n array.join \"\\n\"\n end", "title": "" }, { "docid": "7576011a42025c4c2b28325547b36b0a", "score": "0.72295505", "text": "def print_array_elements_per_line arra...
e19de1ca594b2f7e66a3d655baba1585
Making sure last_modified is set to Time.now before each save.
[ { "docid": "3adbb23d67288eccd0032034dc8ae696", "score": "0.0", "text": "def before_save\n\n touch\n end", "title": "" } ]
[ { "docid": "0881e543e2acaaa657f32b2d0ce25f55", "score": "0.7244003", "text": "def touch\n\n self.last_modified = Time.now\n end", "title": "" }, { "docid": "0881e543e2acaaa657f32b2d0ce25f55", "score": "0.7244003", "text": "def touch\n\n self.last_modified = Time.now\n ...
e5349453bbf021bcc1f1cb998f3a9fc3
Takes a tagname and an optional value, returns all the file IDs with that tag
[ { "docid": "728aeff8c3b7c3049f4995b286adf606", "score": "0.5804578", "text": "def query(type, tagname, value=nil, comparator=\"=\")\n if type==:tag\n tag_id=get_tag(tagname)\n\n all_ft=Jam::db[:files_tags].filter(:tag_id=>tag_id)\n all_ft=all_ft.filter(\"note #{comparator} ? \",value) ...
[ { "docid": "2551ab3470a4cce9c389824a17195e09", "score": "0.65081406", "text": "def files\n @files ||= %x(mdfind 'kMDItemUserTags == #{@tag}').split(/\\n/)\n end", "title": "" }, { "docid": "29c663c4bcc375181b2d32971795638e", "score": "0.6026782", "text": "def get_file_pair_names(...
b73978b12e8f51ffcdad02776ae9aa73
Update Pry's internal state after evalling code. This method should not need to be invoked directly.
[ { "docid": "898fb8a3de87378d31eae346a33b8958", "score": "0.0", "text": "def update_input_history(code); end", "title": "" } ]
[ { "docid": "8dfc4aca11fb47dd916ee86bfb409a1a", "score": "0.6000226", "text": "def update(p0) end", "title": "" }, { "docid": "8dfc4aca11fb47dd916ee86bfb409a1a", "score": "0.6000226", "text": "def update(p0) end", "title": "" }, { "docid": "8dfc4aca11fb47dd916ee86bfb409a1a...
98329d2ece7502df85de16d1c764986b
get_back :send_comment_email, :pool => 3
[ { "docid": "553b40a57fd1d342c96fcda81fcdfd00", "score": "0.0", "text": "def password_required?\n logger.debug \"authentications: #{authentications.inspect}\"\n if authentications.blank? || authentications.first.provider.blank?\n super\n end\n end", "title": "" } ]
[ { "docid": "f88eb4b9d1d21ee3f50fa6e176bec417", "score": "0.63382107", "text": "def send_pending; end", "title": "" }, { "docid": "5a024b60aa1efd4758d83a75ce8b675e", "score": "0.59912574", "text": "def comment_received(comment)\n# @greeting = \"Hi\"\n @comment = comment\n\n m...
10f5a0e9cd2756e5e0bc9be964521de5
call plugin open() and return pluginspecific connection object, or exception
[ { "docid": "42027d792fd436d45ab9f36f5cd87b78", "score": "0.0", "text": "def try_open_direct(server, options)\n begin\n self.open(server.name, options)\n rescue => e\n e\n end\n end", "title": "" } ]
[ { "docid": "acd680d854ef4e116074d6602bcf6fb7", "score": "0.6598157", "text": "def open?; true && !@connection_impl.nil? && @connection_impl.isOpen; end", "title": "" }, { "docid": "6e4125686aaeea5cafea170bb1482bec", "score": "0.63431764", "text": "def connection?; end", "title": ...
6a58c31471314123a415c010ba9d7863
used by child Classes
[ { "docid": "99ffd24cca9a14f39ae5d0a9cb6cd0a3", "score": "0.0", "text": "def ssh_host\n return @identifier if @options[:noop] # for specs\n @ssh_host ||= build_ssh_host\n end", "title": "" } ]
[ { "docid": "7d3206fdee515addbaa426dffb5132aa", "score": "0.7018386", "text": "def method\n raise NotImplementedError, 'Define this method on the child classes'\n end", "title": "" }, { "docid": "2290804b238fc95bfd6b38f87c6d2895", "score": "0.69758576", "text": "def override; ...
d3e7b65207e72d50e0ffa4fd2740128f
Task function output debugging for gemspec tasks.
[ { "docid": "3f694ddfa0dff9acf9eb3731b8811d75", "score": "0.8010986", "text": "def do_gemspec_debug( task, args )\n\t\tgemspec = self.gemspec\n\t\tgemspec_src = gemspec.to_yaml\n\n\t\tif self.post_install_message\n\t\t\tself.prompt.say( \"Post-install message:\", color: :bright_green )\n\t\t\tself.prompt...
[ { "docid": "5e341f1683ba6c9273d4b1a30dec5381", "score": "0.61594534", "text": "def print_task(task)\n puts format_task(task) if @verbose\n end", "title": "" }, { "docid": "d0abc84807be62ca66c2b360392b1e90", "score": "0.6041773", "text": "def debug(&block)\n if @cycler....
d6d423b1543d89a17de99adac85ecfcb
Creates ties from founder to the group, based on _relation_ids, and ties from the group to founder and owners.
[ { "docid": "c9b0697263b64335e33a2fdb5b1cc64f", "score": "0.49783292", "text": "def create_ties\n create_ties_from_author\n create_ties_to_owners\n end", "title": "" } ]
[ { "docid": "68f30cc5d8b88ef2dda22926f38e5f93", "score": "0.5805709", "text": "def create_ties_from_founder\n _contact.sender.sent_contacts.create! :receiver_id => actor_id, :relation_ids => _relation_ids\n end", "title": "" }, { "docid": "2c86cd65311593565fe7bf69bc9d7de7", "score": ...
ff7a7ed43ee23f8324df38e5b79d1e68
Returns the tile that this bug is currently on top of.
[ { "docid": "75ab8e952ebd629eaf72fccbececdaa9", "score": "0.7212085", "text": "def tile\n tile_at(@position)\n end", "title": "" } ]
[ { "docid": "34d2425babc4958c798b34d41c44d913", "score": "0.65597", "text": "def tile_at(pos)\n tiles.each {|t| return t if t.position == pos}\n return nil\n end", "title": "" }, { "docid": "896c89aa7afcfb3fb55d3f31c6d41c10", "score": "0.6508404", "text": "def tile_at(pos...
136dba47dfc3fe08a4af6d593185a132
Advanced Scan an Azure Blob for viruses Advanced Scan the contents of a single Azure Blob and its content for viruses and threats. Advanced Scan files with 360degree Content Protection across Viruses and Malware, executables, invalid files, scripts, and even restrictions on accepted file types with complete content ver...
[ { "docid": "ba751b36bef58e0e2b8a0797ce4bdb01", "score": "0.5958563", "text": "def scan_cloud_storage_scan_azure_blob_advanced_with_http_info(connection_string, container_name, blob_path, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ScanCloudSto...
[ { "docid": "d48b96a5e805877a5bc24ed67527ea1c", "score": "0.5901228", "text": "def scan_cloud_storage_scan_azure_blob_advanced(connection_string, container_name, blob_path, opts = {})\n data, _status_code, _headers = scan_cloud_storage_scan_azure_blob_advanced_with_http_info(connection_string, conta...
096d2bdf1f8916c5733c247a9c76ff2f
GET /logistics_orders/new GET /logistics_orders/new.json
[ { "docid": "606963ffff4c60630b3b4083911e6603", "score": "0.80378926", "text": "def new\n @logistics_order = LogisticsOrder.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @logistics_order }\n end\n end", "title": "" } ]
[ { "docid": "3e3c698bf1929e86ce486278c1e297c0", "score": "0.7675855", "text": "def new\n @order = @customer.orders.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @order }\n end\n end", "title": "" }, { "docid": "e7f5e969f4b09d3469ff5...
4c3d28f4af051addb45e23f8fac3eec7
Get a value with key
[ { "docid": "ee4f46953acf059db590ea37c8e4b1bb", "score": "0.0", "text": "def [](key); end", "title": "" } ]
[ { "docid": "a9068e3f0aaa5cdb7768a3e88142bf4d", "score": "0.81332856", "text": "def get(key)\n find_by_keys([key]).first\n end", "title": "" }, { "docid": "a9068e3f0aaa5cdb7768a3e88142bf4d", "score": "0.81332856", "text": "def get(key)\n find_by_keys([key]).first\n end...
e8e71ee32555bcd5f36ac528695f604f
PUT /alignments/1 PUT /alignments/1.xml
[ { "docid": "d401f4f3e699e36dbf8ec66432d1f3b8", "score": "0.6554631", "text": "def update\n @alignment = Alignment.find(params[:id])\n\n respond_to do |format|\n if @alignment.update_attributes(params[:alignment])\n format.html { redirect_to(@alignment, :notice => 'Alignment was success...
[ { "docid": "e7bda59a073f65358298031b0d65c9b2", "score": "0.6721932", "text": "def update\n @alignment = Alignment.find(params[:id])\n\n if @alignment.update(alignment_params)\n head :no_content\n else\n render json: @alignment.errors, status: :unprocessable_entity\n end\n end", ...
26b00554dc9fa3bb6f20cbf39c0a95aa
DELETE /despesas/1 DELETE /despesas/1.json
[ { "docid": "0f0ff1971b30b97292c5b747e033718f", "score": "0.6981117", "text": "def destroy\n @despesa.destroy\n respond_to do |format|\n format.html { redirect_to condominio_despesas_path(condominio_id: @despesa.condominio_id), notice: 'Despesa was successfully destroyed.' }\n format.json...
[ { "docid": "d3fe5da4f31cfd1eedd0cfb06c92a11a", "score": "0.6999923", "text": "def destroy\n @despesa.destroy\n respond_to do |format|\n format.html { redirect_to despesas_url, notice: \"Despesa was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "titl...
8712f0012f0760316dfee0462604b09e
BEGIN ALL services functions (functions that affects all services for the app)
[ { "docid": "29ac004f5246e7c61954fdb37c7e6fd7", "score": "0.0", "text": "def app_services_create_log_service\n c = Capistrano::BaseHelper.get_capistrano_instance\n commands = []\n commands << \"#{c.sudo} mkdir -p #{File.join(\"/etc\", \"sv\", Capistrano::BaseHelper.user_app_env_path, \"log...
[ { "docid": "adbbec5bbd27d477566eef8748b8903c", "score": "0.66771644", "text": "def services\n\n end", "title": "" }, { "docid": "3bb2570f6050a0e966bc225d831bb966", "score": "0.66530895", "text": "def services\n end", "title": "" }, { "docid": "a2b0252f91059c8e5dc441fbc8...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "23306d107f59202eda67362bfab9ed74", "score": "0.0", "text": "def set_user\n @user = User.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...
f46128c25436973202d8087b4c7aa28a
To input the solution state
[ { "docid": "e1b1bd7ac728ef79eca87a275279cbc8", "score": "0.66127443", "text": "def input_solution_state\n puts 'Please enter the numbers in sequence:'\n (0...3).each do |i|\n (0...3).each do |j|\n print \"[#{i}][#{j}]:\"\n solution_state[i][j] = gets.chomp.to_i\n end\n e...
[ { "docid": "0ca6103b0871aec6eb1b1507a0b276fe", "score": "0.7527954", "text": "def solution\n end", "title": "" }, { "docid": "c69bfd01151922ab3c109faada868a5b", "score": "0.6827638", "text": "def solve\n end", "title": "" }, { "docid": "b34cf084f260465c2ea4ad161fe2b891"...
89dcb1b684b2fe219c70b243c2f63894
Create functions that compare willpower, frustration and rested. If willpower is greater than frustration but less than rested you can code
[ { "docid": "d654f0b240d253dd02b65a2cb3894a59", "score": "0.0", "text": "def rested_level\n puts\n \"You probs got around #{@rested} hours of sleep.\"\n end", "title": "" } ]
[ { "docid": "54b5a04b5709efbda06f838626206ec1", "score": "0.65986633", "text": "def goodVsEvil(good, evil)\n # good_power, evil_power = 0, 0\n # good.split.each_with_index do |num, i|\n # if i < 3\n # good_power += num.to_i * (i + 1)\n # elsif i < 5\n # good_power += num.to_i * i\n # ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "7d174a8236492b973c53a601a6def0b0", "score": "0.0", "text": "def prefs_params\n params.require(:preference).permit(:facebook,:twitter,:telephone,:telephone2,:email)\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...
f7a007ffa691ec78441b694255116594
Returns the logically inverse PredicateInstance, i.e. NOT(this)
[ { "docid": "f75be3b583d1d876155910b51eccea93", "score": "0.8259394", "text": "def inverse\r\n PredicateInstance.new @predicate.inverse, @step \r\n end", "title": "" } ]
[ { "docid": "501145d3d8228a6ff7066e5371df75ce", "score": "0.82155865", "text": "def not()\n NotPredicate.new(self)\n end", "title": "" }, { "docid": "d27f9f63b4d6469ee3acba2713868386", "score": "0.71184814", "text": "def inverse_of\n self[:inverse_of]\n end", "...
3dab893a6f5daa5331d461a6339ba9dc
Get an existing named cache, or create a new one if none exists name name of the cache Returns nothing.
[ { "docid": "8b215a4aa5c510f346d746bfcca1326e", "score": "0.0", "text": "def initialize(name)\n @cache = Jekyll::Cache.base_cache[name] ||= {}\n @name = name.gsub(%r![^\\w\\s-]!, \"-\")\n end", "title": "" } ]
[ { "docid": "d67f1be1c83eb79ec7dc2e63420ef581", "score": "0.7466084", "text": "def get(name)\n raise unless name.is_a?(String)\n @cache[name] ||= self.fresh\n end", "title": "" }, { "docid": "57c2288c37a19ad060191865a41c3150", "score": "0.7351393", "text": "def retrieve_from_ca...
368bbbb1784651b0134ee847450bbf7c
Update a 'boot.NvmeDevice' resource.
[ { "docid": "a645f101eaad402d091a1b2e08ded377", "score": "0.5868294", "text": "def patch_boot_nvme_device(moid, boot_nvme_device, opts = {})\n data, _status_code, _headers = patch_boot_nvme_device_with_http_info(moid, boot_nvme_device, opts)\n data\n end", "title": "" } ]
[ { "docid": "fa824354ae7e6396700ebf4def168413", "score": "0.62350625", "text": "def update_boot_nvme_device(moid, boot_nvme_device, opts = {})\n data, _status_code, _headers = update_boot_nvme_device_with_http_info(moid, boot_nvme_device, opts)\n data\n end", "title": "" }, { "do...
e60bd4f868b67cbcf8bff6f5cb41acfc
DELETE /purchase_orders/1 DELETE /purchase_orders/1.xml
[ { "docid": "c6de5691590cafbceb36674ffa72ca9b", "score": "0.63733", "text": "def destroy\n @purchase_order = PurchaseOrder.find(params[:id])\n @purchase_order.verify_for_destroy\n flash[:notice] = \"Purchase Order was successfully voided\"\n respond_to do |format|\n format.html { redirec...
[ { "docid": "38bdeac7c7a6ffb6e2c8052e1fceb583", "score": "0.6822707", "text": "def destroy\n @purchase = Purchase.find(params[:id])\n @purchase.destroy\n\n respond_to do |format|\n format.html { redirect_to(purchase_url) }\n format.xml { head :ok }\n end\n end", "title": "" ...
f92777674a3ecad92b6b4da265934ce2
POST /physicians POST /physicians.json
[ { "docid": "9ba22b0706129144153aec4e9b0f29bd", "score": "0.6029237", "text": "def create\n inform = Inform.find(params[:physician][:inform_id])\n # inform = Inform.find(params[:inform_id])\n physician = inform.physicians.build(physician_params)\n physician.user_id = current_user.id\n\n if...
[ { "docid": "942b28b17bef4240bb34b5adce622f3e", "score": "0.70307976", "text": "def create\n @physician = Physician.new(physician_params)\n\n respond_to do |format|\n if @physician.save\n format.html { redirect_to @physician, notice: \"Physician was successfully created.\" }\n fo...
33eae75892a9a4aa85077dd6fc7eb427
POST /meis POST /meis.json
[ { "docid": "741d0dfe5e25f59facfd3f520573c4aa", "score": "0.67770046", "text": "def create\n @mei = Mei.new(mei_params)\n\n respond_to do |format|\n if @mei.save\n format.html { redirect_to @mei, notice: 'Mei was successfully created.' }\n format.json { render :show, status: :cre...
[ { "docid": "f4c50ea38fcbc69cc586b99b6d3fc290", "score": "0.6767001", "text": "def create\n\t\tpost = current_user.posts.find(params[:post_id])\n\t\tpost_meme = post.post_memes.create(post_meme_params[:memes])\n\t\trender json: post_meme, status: :ok\n\tend", "title": "" }, { "docid": "65f921...
43b82179b9d4ab19986199e38f58f065
Label with text aligned to right
[ { "docid": "f841dda50e23b0467ecf2e6db89afa3e", "score": "0.6041075", "text": "def test_alignRight\n [@window, @sprite, @bitmap].each{|container|\n c = CLabel.new(container, Rect.new(0, 24, @window.contents.width, 24), \"Right\", 2)\n c.draw()\n }\n return true\n end", "title": ""...
[ { "docid": "f439a3322d6b22421224fc99e10fc372", "score": "0.6909668", "text": "def right_label(_wrapper_options = nil)\n @right_label ||= begin\n options[:right_label].to_s.html_safe if options[:right_label].present?\n end\n end", "title": "" }, { "docid": "7f1e3d2...
5636a356920273841779b04292d586f8
params passed to link are required :base_component string in form that appears in 'dtk components' :dep_component string in form that appears in 'dtk components' optional :service string that is external service associated with dep_component :unlink boolean meaning to unlink, rather than link (default is false) :link_n...
[ { "docid": "daf14f25b3a1a02af7c8cf147b4ef772", "score": "0.79369575", "text": "def link\n # TODO: DTK-3009; stub for Almin\n assembly = dep_assembly = assembly_instance()\n\n unless request_params(:service).empty? \n dep_assembly = external_assembly_instance(:service)\n...
[ { "docid": "45784dc830f6983fec3733d81953f45e", "score": "0.700913", "text": "def add_component_link(base_component, dep_component, opts = {})\n link_name = ComponentLink.find_and_check_link_name(base_component, dep_component, link_name: opts[:link_name], raise_error: opts[:raise_error])\n ...
a6d6d083fb4710a73d8dbea1be3dcba3
makes twitter flash messages look right app/helpers/application_helper.rb
[ { "docid": "c64ed39f4d251006816028691c9b5f1b", "score": "0.0", "text": "def twitterized_type(type)\n case type\n when :alert\n \"alert-block\"\n when :error\n \"alert-error\"\n when :notice\n \"alert-info\"\n when :success\n \"alert-success\"\n else\n type.to_s\n...
[ { "docid": "41a511964c5de9460f2f0a2fdcff18b9", "score": "0.7515944", "text": "def flash_helper\n flash.collect{|k,msg|\n case k\n when :notice then alert_class = \"success auto-dismiss\"\n when :alert then alert_class = \"warning\"\n else alert_class = k.to_s\n end\n con...
8dd8b7887b7a77a3691b6d8c93259353
The class of storage used to store the object.
[ { "docid": "fbcfe3b14a8f6beb749ed86f66bb1d81", "score": "0.82425755", "text": "def storage_class; end", "title": "" } ]
[ { "docid": "6b70a231d87b80c3b7ef8cc4582e6821", "score": "0.8383114", "text": "def storage_class\n data.storage_class\n end", "title": "" }, { "docid": "6b70a231d87b80c3b7ef8cc4582e6821", "score": "0.8383114", "text": "def storage_class\n data.storage_class\n end", ...
2ffaa3ae879a42fb29579ffc675c4dc5
Get your account information, plan and credits details
[ { "docid": "eed6b0e899c1fd67d72c87fb18a25471", "score": "0.0", "text": "def get_account_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AccountApi.get_account ...'\n end\n # resource path\n local_var_path = '/account'...
[ { "docid": "125489cec097d97fdadab627a16bbc93", "score": "0.7604869", "text": "def account_information\n response = get \"account\"\n data = JSON.parse response.body\n data[\"acccount\"][\"credits\"]\n end", "title": "" }, { "docid": "1d68694c1180580a0a8bb780bd559b07",...
1380245109ae6eba2b31813c94922a01
modify configuration. data is unchanged, unless :data => argument is also provided
[ { "docid": "a11fa701f7429da24c218a2b990447a4", "score": "0.0", "text": "def configure(args = {})\n @args.merge!(args)\n\n @cdf_lb = checkba(@args[:cdf_lb], true)\n @cdf_ub = checkba(@args[:cdf_ub], false)\n @cdf_smooth_lb = @args[:cdf_smooth_lb]\n @cdf_smooth_ub = @args[:cdf_smo...
[ { "docid": "eea4f4bada2ea048a18aa2cfdad24cd8", "score": "0.6952179", "text": "def configure data\n version = data[:version]\n\n # Note: These hooks do *not* need to be defined. \n # They're only defined if you're using version controlling\n # or if you want more control on how data i...
0d9ce8d573964631b2fa79e0627122f3
Convert the financial "collected" data into json for pie charts
[ { "docid": "72b54027e6d6f5f344e728292f0f1920", "score": "0.7088408", "text": "def financial_collected_monthly_json(collected)\n json = []\n collected.sort.each do |item|\n json << [item[0].localize(\"%b\").to_s, collected[item[0]].to_f]\n end\n json.to_json\n end", "title": "" } ...
[ { "docid": "2a23bffdc11b054af14722bfa94bd9ac", "score": "0.8192432", "text": "def financial_collected_json(collected)\n json = []\n collected.sort.each do |item|\n json << { label: \"#{item[0]}: #{item[1].format(no_cents_if_whole: true, symbol: true)}\", data: item[1].to_f }\n end\n jso...
377691c62ae1a17efcd337da0581533f
List view helper format the given user's email address as a link; do so using auto_link so we don't have to worry about malformed addresses. That's the main reason for doing this in a helper rather than manually, within the model.
[ { "docid": "b10f1f07a65104fb49fd57c4786b190b", "score": "0.68701464", "text": "def userhelp_email( user )\n return auto_link( h( user.email ) )\n end", "title": "" } ]
[ { "docid": "90e8b31e957d115b1af67ad1491fecf5", "score": "0.69608146", "text": "def rezm_to_user_link(email)\n link_to email.receiver_name, user_path(email.receiver_name)\n end", "title": "" }, { "docid": "841ab116e242c2e5f982f71cfa055e5e", "score": "0.6812803", "text": "def rezm_...
2158aa5aba10b5c551b50ddc6615a9c2
=> Learning about Ruby is fun! you can pass parameters to methods like this
[ { "docid": "42def87f7f939138c0a66308aa6af5d9", "score": "0.0", "text": "def clapYourHands(myNumber)\n puts \"Clap!\\n\" * myNumber\nend", "title": "" } ]
[ { "docid": "7326fea5189ee1072307cd3b9829b900", "score": "0.7450578", "text": "def example(a, b)\n a + b\nend", "title": "" }, { "docid": "2fe2b3c660c5338382d2941e241ae8be", "score": "0.7172665", "text": "def method(a, b)\n puts a + b\nend", "title": "" }, { "docid": "93...
41bb55a65e306834ded680b8a823c67b
Find all available product repositories by repository_key
[ { "docid": "bbf38e51434077b0996e88f6ee2d38ba", "score": "0.80592465", "text": "def find_available_repo(product, repository_key)\n @repos.find_all do |elem|\n elem[1]['product'] == product['name'] &&\n elem[1]['platform'] + '^' + elem[1]['platform_version'] == repository_key\n end\n en...
[ { "docid": "340236d22216aee11070349361c9f069", "score": "0.65687346", "text": "def repositories\n\t\t\telems = []\n\t\t\tget_resource_link(:datacenterrepositories, \"datacenterRepositories\", \"datacenterRepository\").each do |data|\n\t\t\t\telems << Repository.new(data)\n\t\t\tend\n\t\t\telems\n\t\tend...
0b717da8d3fa95197f0393b9a94e0d69
api :GET, '/user_accounts','List User Accounts'
[ { "docid": "df6f420d44cd61dda9a1c3946b1c544f", "score": "0.7169074", "text": "def index\n @user_accounts = @user.user_accounts.page(params[:page]).per(params[:per])\n\n render json: @user_accounts\n end", "title": "" } ]
[ { "docid": "3aed9bd4448e1b5e8bbd1f35a07962e7", "score": "0.7478503", "text": "def list\n if current_user\n accounts = current_user.accounts\n render json: { accounts: accounts }, status: :ok\n else\n render json: { error: I18n.t('request.forbidden') }, status: :forbidden\n end\n ...
f78d68abf2c476c59468964bbc0855f5
:reek:DuplicateCode run the validate command on +target_dir+ model
[ { "docid": "1e6945ff156d5a2bb41bd6248f731770", "score": "0.76840585", "text": "def run_validate(target_dir)\n commands[:validate_command].run({ :target_dir => target_dir })\n end", "title": "" } ]
[ { "docid": "5e59ede51933167e1bca5abe6a728415", "score": "0.71498936", "text": "def validate(target_dir = '.')\n initialize_commands\n apply_globals\n @wire_commands.run_validate(target_dir)\n end", "title": "" }, { "docid": "99142dcc52546335a6bade1c5695cf3d", "score": "...
cceed5dc3be8926c9fa815773b255006
POST /book_marks POST /book_marks.json
[ { "docid": "9a519543ebb9b15b961d517382d5a18f", "score": "0.7346734", "text": "def create\n redirect_to book_marks_url\n @book_mark = BookMark.new(book_mark_params)\n\n respond_to do |format|\n if @book_mark.save\n format.html { redirect_to @book_mark, notice: 'Book mark was successf...
[ { "docid": "112a1606e5f269b2d145204fb03455c2", "score": "0.70839643", "text": "def create\n @student_mark = StudentMark.new(student_mark_params)\n\n respond_to do |format|\n if @student_mark.save\n format.html { redirect_to @student_mark, notice: 'Student mark was successfully created....
859fadf972baec3ab1983b898f8654b8
Understand the problem Get positive integer Separate numeric characters Sum numeric characters Return sum Requirements Method takes only one positive integer Must return a positive number Write code withour basic looping constructs (while, until, loop, each) Inputs: integer (argument) Outputs: integer (method return) A...
[ { "docid": "8094d8cddb083f77cf111637ceed30d6", "score": "0.0", "text": "def digit_sum integer\n total = 0\n sum = integer.digits.collect { |num| total += num }.last\nend", "title": "" } ]
[ { "docid": "17a961113da5f914d608983bd214633d", "score": "0.7301736", "text": "def sum(integer)\n array = integer.to_s.split('').map(&:to_i).reduce(:+)\nend", "title": "" }, { "docid": "ab38be11ab13f17cf8675b7d57399943", "score": "0.72537297", "text": "def sum(integer)\n integer.to_...
e7ff4afc19b16f763d772276326dc702
DELETE /relsequences/1 DELETE /relsequences/1.json
[ { "docid": "e57ce7041666a4f7e45208611f0ceafb", "score": "0.7499386", "text": "def destroy\n @relsequence.destroy\n respond_to do |format|\n format.html { redirect_to relsequences_url, notice: 'Relsequence was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",...
[ { "docid": "59a46c806a9acf2bfa8a39fd2424c3c5", "score": "0.6824785", "text": "def destroy\n @sequence.destroy\n respond_to do |format|\n format.html { redirect_to sequences_path(@org), notice: 'Sequence was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", ...
da9f561dfc0b0c45750053819aac67df
Returns the number of threads waiting on the queue.
[ { "docid": "392a1acfd0a462e1381ccd716d8105a5", "score": "0.8410935", "text": "def num_waiting\n @mutex.synchronize do\n return @num_waiting + @num_enqueue_waiting\n end\n end", "title": "" } ]
[ { "docid": "a4ec5842b823099528bd3a641d898885", "score": "0.85154444", "text": "def num_waiting\n @queue.num_waiting\n end", "title": "" }, { "docid": "9fda119d83b7aa009c5e4b2ecdcd1186", "score": "0.846065", "text": "def waiting_threads_count\n @waitables.length\n...
64341371bf05cd905f51aad124af4afc
GET /crud_operations/1 GET /crud_operations/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "87cc6a83c37677e3ddd454f22bd4e0fa", "score": "0.716287", "text": "def index\n @crud_operations = CrudOperation.all\n end", "title": "" }, { "docid": "24db7d5665db41a9a3936d92bf2fcfd9", "score": "0.6644622", "text": "def set_crud_operation\n @crud_operation = CrudO...
a82159d726e7dcf5176f3ea9f176e3b2
DELETE /vehicles/1 DELETE /vehicles/1.json
[ { "docid": "6ffce27ede894c0a4ddf3f7e763b3f8c", "score": "0.750627", "text": "def destroy\n @vehicle.destroy\n respond_to do |format|\n format.html { redirect_to vehicles_url, notice: 'Vehicle was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title":...
[ { "docid": "54b3dccb01be59823a90ba63407f2899", "score": "0.7897605", "text": "def destroy\n @vehicle.destroy\n render json: { status: true }\n end", "title": "" }, { "docid": "1894cfe1a16fc5635e13d7784a19f1bd", "score": "0.78368735", "text": "def destroy\n destroy_resource ...
f517a8caccbd9f14bba9ea1a5c37eac4
GET /my_dairies/1 GET /my_dairies/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "89f1e6ea65e19a611f6859436c2c84ae", "score": "0.6251344", "text": "def index\n @my_dairies = MyDairy.all\n end", "title": "" }, { "docid": "a9c220342acf91b2c8dab8c07e824093", "score": "0.62257516", "text": "def show\n @kf_diary = Kf::Diary.find(params[:id])\n\n r...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "2ceb934a13d5dc3358f7497d56384db4", "score": "0.0", "text": "def person_params\n params.require(:person).permit(:first_name, :last_name, :salary, :country, :birth_date, :pincode)\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...
2fa4449f7ffbc4da95d0040a3e7d0131
Public: undelete partner on 'Partners in PendingDelete (not yet available to Purge)' and 'Partners in PendingDelete and available to Purge' Example
[ { "docid": "33a1899a305cc7a0fc8f7284a7b6b48b", "score": "0.7235001", "text": "def undelete_partner(where, partner_name)\n find(:xpath, \"//a[text()='#{partner_name}']//..//../td[1]//input\").check\n case where\n when 'pending-delete not available to purge'\n undelete_btn.click\...
[ { "docid": "d9357321d01b45c1b96c1cd47f1c87a6", "score": "0.6484091", "text": "def teardown_test_chamber\n if TestChamber::Config[:tc_partner_delete]\n TestChamber::Models::Partner.destroy_all(id: Array(TestChamber.created_partners))\n end\nend", "title": "" }, { "docid": "0453f021e31042...
12f8d5a48d57c326b8f6fb76b3a63d11
Returns a unique, deterministically reproducible index into an array We are hashing based on strings, let's use the ascii value of each string as a starting point.
[ { "docid": "a7a4481517df84c8e7f174a7cc9ae2a1", "score": "0.0", "text": "def index(key, size)\n\t\treturn key.sum % size\n end", "title": "" } ]
[ { "docid": "dec56ba389619bca802a841fd19914b8", "score": "0.6425626", "text": "def make_key(len)\n Array.new(len) { rand(26) }\n end", "title": "" }, { "docid": "6f07f2bf4bc7e3559affdb9f397c538c", "score": "0.6185899", "text": "def generate_index index_arr, length\n index = rand(...
2a0caf059b0bfdf9738786d11c2d802b
GET /template_packages GET /template_packages.json
[ { "docid": "7e0d4cfcdb0441bdb783ed56c83eb8f8", "score": "0.6226815", "text": "def index\n @template_packages=TemplateAuthor.find(:all,:conditions=>{:enable=>true})\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @template_packages }\n end\n end"...
[ { "docid": "02d40ffd34632b276b3a900afa1cebd8", "score": "0.67617154", "text": "def templates\n response = get \"storage/template\"\n data = JSON.parse response.body\n data\n end", "title": "" }, { "docid": "6b1d2d88a7c9fa5edaa0ab35388b178a", "score": "0.6724229", "text": "d...
82f83ebd368bc077d07a823370aa4d0c
returns the number of hours that was worked before change
[ { "docid": "b05b98fcda6411666eda7670da626193", "score": "0.7012509", "text": "def hours_worked_before_last_save\n (BigDecimal.new((self.finished_at_before_last_save - self.created_at_before_last_save).to_i) / 1.hour).round(ROUND_VALUE)\n\n end", "title": "" } ]
[ { "docid": "05c471e62de47e59bcae4a4c7577ab28", "score": "0.75221", "text": "def hours\n (left - went) / 1.hour\n end", "title": "" }, { "docid": "ce4174c0c4d9df08acab36ed7c41a27f", "score": "0.7312315", "text": "def remaining_hours\n shift_hours - applied_hours\n end", "t...
2ab14f9bed058368f614dd5eb426e877
Run the passed thread and return it's value. This method is called from debug_log_entry and debug and thus we rescue a DebuggerException, as the debug method catches any other Exception and wraps it in a DebuggerException
[ { "docid": "8fd0d0431fc5428a4d0ef3fecab2b8df", "score": "0.6392341", "text": "def debug_thread(client)\n # The next line raises if the Thread raised\n client.value\n end", "title": "" } ]
[ { "docid": "07a26b83bbfc2e0c9bcf9caddd585227", "score": "0.622344", "text": "def debug_thread(thr)\n thr.set_debugging @debug_channel, thr.control_channel\n end", "title": "" }, { "docid": "07a26b83bbfc2e0c9bcf9caddd585227", "score": "0.622344", "text": "def debug_thread(thr)\n ...
e87d66820759af6df917b3d7a6da09eb
Return escaped HTML. "X" > "&lt;i&gt;X&lt;/i&gt;"
[ { "docid": "6a59f56055105434b500425cbf3fedd2", "score": "0.72243464", "text": "def escape_html(html)\n h(html.to_str)\n end", "title": "" } ]
[ { "docid": "059b89120441a530ce22e0447d1ea10b", "score": "0.7752235", "text": "def html_escape\n return to_s\n end", "title": "" }, { "docid": "059b89120441a530ce22e0447d1ea10b", "score": "0.7752235", "text": "def html_escape\n return to_s\n end", "title": "" }, ...
891dae5ba314c9cd1bb852fcd18941d0
+outdir+, the dir to output the camera makers files
[ { "docid": "463e69220d945ec1f22bd0813cf4a0f1", "score": "0.6806419", "text": "def update_makers(outdir)\n @cameras.keys.each do |maker|\n maker_page = Redbubble::Generator::Maker.new(cameras, maker, outdir)\n @makers << maker_page\n end\n end", "title": "" } ]
[ { "docid": "0357276d20494c29e7b4a19abfb45fab", "score": "0.6129888", "text": "def update_models(outdir)\n @cameras.keys.each do |maker|\n @cameras[maker].keys.each do |model|\n model_page = Redbubble::Generator::Model\n .new(maker, model, @cameras[maker...
8b9f3c348428fdf061a170a2fbddb995
Get centre coordinates of element
[ { "docid": "559bf3b3d3ae25e2bbff70943e8eb45d", "score": "0.7095751", "text": "def center\n point = location\n dimensions = size\n Selenium::WebDriver::Point.new(point.x + (dimensions['width'] / 2),\n point.y + (dimensions['height'] / 2))\n end", ...
[ { "docid": "30b6f84577bb36f278fb1e58b5338f7d", "score": "0.83194846", "text": "def centre\n location = element.wd.location\n size = element.wd.size\n {'y' => (location['y'] + (size['height']/2)), 'x' => (location['x'] + (size['width']/2))}\n end", "title": "" }, { "...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "e4142a94ed9b0f481f5b52a9bd78e695", "score": "0.0", "text": "def liberry_params\n params.require(:liberry).permit(:name, :floor_count, :florr_area)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7493595", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6954758", "text": "def strong_params\n params.require(:request).permit(param_white...
0688e839fdf507c7209e09556d79cfbd
PATCH/PUT /return_details/1 PATCH/PUT /return_details/1.json
[ { "docid": "a8751823da1f7f84503f5a19d2ced598", "score": "0.7205692", "text": "def update\n respond_to do |format|\n if @return_detail.update(return_detail_params)\n format.html { redirect_to :back, notice: 'Return detail was successfully updated.' }\n format.json { render :show, st...
[ { "docid": "42da5be453e2688a0cb496875623d11c", "score": "0.73219055", "text": "def update\n respond_to do |format|\n if @return_detail.update(return_detail_params)\n format.html { redirect_to @return_detail, notice: 'Return detail was successfully updated.' }\n format.json { head :...
802a4da264935d788fcf424c2c35c897
TODO: Should be able to "cache" these calls by defining methods onthefly
[ { "docid": "7552ad55abfee909e8cd9160b8b4f9cc", "score": "0.0", "text": "def method_missing(method_id, *arguments, &block)\n # Column accessor methods\n method_id.to_s =~ /^(\\w+)(=)?/\n column_name = $1.carmelize\n method_name = $2 ? (column_name + \"_$eq\") : column_name\n\n # Key/Value\...
[ { "docid": "a29ccf5104a36e90daf739a9e5586ddf", "score": "0.65731245", "text": "def invoke_all; end", "title": "" }, { "docid": "25b3fcfcf33ffae73848158244a8d93b", "score": "0.6528097", "text": "def run_internal; end", "title": "" }, { "docid": "1c709e6047dee3022a362eb47e3...
eeec05529efe796714d6ece01e37e3b3
Purchase day is 2 at price 6 Sell day is 10 at price 150 144
[ { "docid": "a5262248b3b6af28a34f08c00df085f1", "score": "0.0", "text": "def findMedian( arrFirst, sizeFirst, arrSecond, sizeSecond)\n\tmedianIndex = ((sizeFirst + sizeSecond) + (sizeFirst + sizeSecond) % 2) / 2\n\t# ceiling function.\n\ti = 0\n\tj = 0\n\tcount = 0\n\twhile (count < medianIndex - 1)\n\t\...
[ { "docid": "bf29780053b2779c6f67062c9a979e06", "score": "0.6916739", "text": "def original_price\n purchase.program.price(purchase.days_left)\n end", "title": "" }, { "docid": "0dfaf694e1dce05dea7c31e99c64dede", "score": "0.6871652", "text": "def new_program_price\n program.pr...
6153ad246f1862f2a6e9347d5cb052a2
Provides access to a dependent ActionDraft::Content model that holds the draft attributes. This dependent attribute is lazily instantiated and will be autosaved when it's been changed. Example: class Message Funny times!") message.draft_title => "This is draft title" message.draft_content => "Funny times!" If you wish ...
[ { "docid": "a96aacad06e37eb91f032e3afe3eb778", "score": "0.6640254", "text": "def has_draft(*names)\n self.action_draft_attributes ||= []\n names = Array(names)\n names.each do |name|\n self.action_draft_attributes << name.to_sym\n\n class_eval <<-CODE, __FILE__, _...
[ { "docid": "095609bc4b1d621bb8c94d669250ea80", "score": "0.67196214", "text": "def draft\n @draft_version ||= AbstractVersion.find_by_abstract_id_and_content_status_id(self.id, ContentStatus[:draft].id)\n end", "title": "" }, { "docid": "bbd41c2c027b06aa1e3acc841ea92366", "score": "0...
3311ca50621ddd403010854f234409a6
Write ruby code to return the longest word in the list supplied ( words ) Assume each entry in the list implements a length method that returns a Fixnum.
[ { "docid": "7d4b89a2cf6fd6dc1d45c62d79d99b7d", "score": "0.0", "text": "def longest(list)\n # Your code goes here\n end", "title": "" } ]
[ { "docid": "9db05bb2336efcea78946ed3b4c0fb38", "score": "0.88410366", "text": "def longest_string(list_of_words)\n\tlist_of_words.max_by {|x| x.length}\nend", "title": "" }, { "docid": "1ffcecbf829a2be21edd087880079b7e", "score": "0.8820778", "text": "def longest_string(list_of_words...
0c9403705597c03480d1d67f0956decc
Gets geo file set decorator
[ { "docid": "0d0735008f2e403214050feffbf33ddb", "score": "0.7776938", "text": "def file_set\n @file_set ||= begin\n members = resource_decorator.geo_members\n members.first.decorate unless members.empty?\n end\n end", "title": "" } ]
[ { "docid": "327dec1e37b597ea44c710699041778d", "score": "0.7652994", "text": "def file_set\n @file_set ||= resource_decorator.geo_members&.first\n end", "title": "" }, { "docid": "1046164c1aaddd2b00b217f7a8e29d31", "score": "0.7163609", "text": "def file_set\n ...
7c44b7c79b04e5dfb55791bc1d6697e3
GET /topics GET /topics.json
[ { "docid": "711244798e10bfd829da245e01b8de86", "score": "0.0", "text": "def index\n @topic = Topic.new\n @topics = Topic.order(\"id desc\")\n @topics = Topic.page(params[:page]).per(10).order(\"id desc\")\n end", "title": "" } ]
[ { "docid": "b64878a9e43283c9c1e729077a1f3c5c", "score": "0.84226954", "text": "def topics\n get 'topics'\n end", "title": "" }, { "docid": "e7f1c7a4d11f981f7846cf4ba6b56a88", "score": "0.7653341", "text": "def index\n @topics = Topic.order(:name).all\n \n respond_to do...
754cda33f6db2bc775b418c7a6190879
Add the 'model_name' configuration option
[ { "docid": "d8b8bbdb048f5bfe7b3a93e991de78f5", "score": "0.59195876", "text": "def model_name\n unless @model_name\n @model_name\n self.model_name = nil\n end\n @model_name\n end", "title": "" } ]
[ { "docid": "968662d8a4bd8a2f5c2a39ada671db92", "score": "0.6761354", "text": "def set_model(model)\n @options[:model] = model\n end", "title": "" }, { "docid": "968662d8a4bd8a2f5c2a39ada671db92", "score": "0.6761354", "text": "def set_model(model)\n @options[:model...
64a8356c4b01852a0348fa86559465c3
Checks to see if we have all the neccessary attributes
[ { "docid": "af32edfda9f0bb8d7f6652ad68c70da3", "score": "0.6526059", "text": "def valid?\n clear_errors\n valid = true\n self.class.columns.keys.each do |attribute|\n if @attributes[attribute].blank?\n @errors.add \"#{attribute} cannot be blank\"\n valid = false\n...
[ { "docid": "56b357be57a66969646833e222385bc0", "score": "0.7798228", "text": "def check_attributes\n self.attributes.each do |attr_name , attr_value|\n if (attr_value.blank? || attr_value.nil?) && (attr_name != \"further_info\") && !(attr_name.include? \"toefl\")\n return false\n en...
ccca74918692b26057900339b08ba697
Lookup a instance method i.e. one defined by this object's class
[ { "docid": "ba82d66a59cb02052ecfdf1379f8ad4f", "score": "0.83347756", "text": "def lookup_instance_method(name)\n klass.lookup_method(name)\n end", "title": "" } ]
[ { "docid": "c1ed36d4aabe882ccc1c7647bbfd8ec8", "score": "0.73745394", "text": "def lookup_instance_method!(name)\n lookup_instance_method(name) || raise(Carat::CaratError, \"undefined method '#{name}'\")\n end", "title": "" }, { "docid": "5a997948ff83cc2ec6b3ce5ba1382cbd", "score...
49da1f866ad149ad8015b219e795e3d7
Custom attribute writer method with validation
[ { "docid": "bf768340fcbc1fd67224c31f4845ffb1", "score": "0.0", "text": "def settlement_type=(settlement_type)\n if !settlement_type.nil? && settlement_type.to_s.length > 32\n fail ArgumentError, 'invalid value for \"settlement_type\", the character length must be smaller than or equal to 32....
[ { "docid": "0f4a74039d4b8dc62405e39b58357a05", "score": "0.6472992", "text": "def attr_writer_tag(text); end", "title": "" }, { "docid": "ac55752dd9cc4f485a916c46d7b41237", "score": "0.6315012", "text": "def allowed_attributes=(_arg0); end", "title": "" }, { "docid": "ac5...
9c9b9eed06e00fb6290a5fc47ee8d585
GET /photos/1 GET /photos/1.json
[ { "docid": "b8fe0a58fc7cebff767a8cacaf2fa3e6", "score": "0.70416766", "text": "def show\r\n @photo = Photo.find(params[:id])\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @photo }\r\n end\r\n end", "title": "" } ]
[ { "docid": "8b967068a1ef07734415ac63e75409ff", "score": "0.8485481", "text": "def index\n if params[:single]\n\t url = \"#{API_BASE_URL}/photos/#{params[:id]}.json?token=#{ENV['API_KEY']}\"\n\t response = RestClient.get(url)\n\t @photo = JSON.parse(response.body)\n\telse\n\t url = \"#{API_BASE_UR...
cd7c1a88d50035c12f8ba948d2d78987
PUT /contests/1 PUT /contests/1.xml
[ { "docid": "d3daaad5dcc28b044050e20cefabed68", "score": "0.6962771", "text": "def update\n @contest = Contest.find(params[:id])\n\n respond_to do |format|\n if @contest.update_attributes(params[:contest])\n format.html { redirect_to(@contest, :notice => 'Contest was successfully update...
[ { "docid": "aee18d3c8ca9f6fe74366bd9887dee2d", "score": "0.70328385", "text": "def update\n @contest = Contest.find(params[:id])\n\n respond_to do |format|\n if @contest.update_attributes(params[:contest])\n flash[:notice] = 'Contest was successfully updated.'\n format.html { re...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "b9ed325004699c7ea47c7cf575c734f9", "score": "0.0", "text": "def privilegio_params\n params.require(:privilegio).permit(:nombre, :descripcion)\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...
470194f1f1ffff3823dd62a5fd54cd50
GET /redactions GET /redactions.json
[ { "docid": "ddc56b69b327a153d26a9e655288d2bf", "score": "0.62964946", "text": "def index\n @redaction = Redaction.all.order('id DESC').paginate(page: params[:page], per_page: 50)\n end", "title": "" } ]
[ { "docid": "c43cd1adb323fb4391da6fa037e8b909", "score": "0.7202297", "text": "def index\n @redactions = Redaction.all\n end", "title": "" }, { "docid": "bcd70bf6ef04ecfb1b869c6d6a802f03", "score": "0.61949617", "text": "def redactions(options = {})\r\n []\r\n end", "title...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "3429de93f0c46a775a88395406cd5185", "score": "0.0", "text": "def carline_params\n params.require(:carline).permit(:name, :phone, :address)\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...
dd2bdab8b8eea1d9ac8266f34220ac53
Recursion to create permutations
[ { "docid": "e9fc56cbdfba04421fb165c2c6de826b", "score": "0.0", "text": "def permute(array)\n return array if array.size <= 1\n\n result = []\n\n array.each do |el|\n new_array = array.dup\n new_array.delete(el)\n result += permute(new_array).map do |perm|\n if perm.is_a?(Array)\n ...
[ { "docid": "2fcd028c369dc6d9dc4e7d27e797317b", "score": "0.78010964", "text": "def permutations(arr)\n \nend", "title": "" }, { "docid": "2bb690084c0aa489c344441985afc981", "score": "0.77487034", "text": "def permutations(arr)\nend", "title": "" }, { "docid": "0b101ac3...
51ae5da9d0601d2f0feeb8aa20595a3d
squeeces all whitspace in the line (preserves the left spacing)
[ { "docid": "1cb4ad035b7e5620b04b71bbac3ae91f", "score": "0.0", "text": "def trim_all_whitespace(text)\n text.to_a.map do |line|\n left_spacing(line) + line.squeeze(\" \").squeeze(\" \").lstrip #the 2. is a tab\n end.join\n end", "title": "" } ]
[ { "docid": "c44f719a13703c13e556bc7110cb4bd9", "score": "0.6279596", "text": "def line_to_wrap; end", "title": "" }, { "docid": "ba22e50ee9c338b6bfc48a185be45885", "score": "0.57611006", "text": "def move increment\n\t\tnew_text = Array.new\n\t\tif increment > 0\n\t\t\t@text_spacer +...
fb31acadc48e0c9e53169d824ff6efc0
api :PUT, '/countries/:id','Update Country' param_group :country
[ { "docid": "66afb71509866d91dd2e9b9fd98daa9c", "score": "0.66428864", "text": "def update\n if @country.update(country_params)\n render json: @country\n else\n render json: @country.errors, status: :unprocessable_entity\n end\n end", "title": "" } ]
[ { "docid": "023ac7b2fd6a894c3b0612420bf2b8b7", "score": "0.72729", "text": "def update\n @country.update(country_params)\n respond_with(@country)\n end", "title": "" }, { "docid": "c6c4814d6021ec50fb2fc9986859ba9f", "score": "0.7151076", "text": "def update\n @countries = C...
68d3fef3928fd5a6c7032decc972622a
This is required because a new version which has not been persisted to the database breaks the normal ActiveRecord paradigm. Because normally when a record has not yet been persisted it can have no persisted has_one associations because there is no foriegn key. In our case we have a foreign key because it was determine...
[ { "docid": "97b8e978f39919f51a6b416b1164f184", "score": "0.7740329", "text": "def preserve_has_one_associations_to(new_version)\n # Preserve simple has_one reflections\n self.class.reflections.select { |_, reflection|\n reflection.macro == :has_one\n }.each do |key, reflect...
[ { "docid": "21aef3d39d45d1ad4a901767c2639e2e", "score": "0.6927263", "text": "def has_one(name, scope = nil, **options)\n # args = options.except(:null_object)\n\n # Call the real belongs_to so that the association gets defined.\n super(name, scope, **options.except(:null_object))\n...
1e7bf682a47df377adfdffb5c0709165
POST /appointments POST /appointments.json
[ { "docid": "d8370b9c1eb3e71745241d4011adedf2", "score": "0.7033689", "text": "def create\n @appointment = Appointment.new(appointment_params)\n\n respond_to do |format|\n if @appointment.save\n format.html { redirect_to @appointment, notice: 'Appointment was successfully created.' }\n ...
[ { "docid": "844e896a4f8e7743529b505ae1209040", "score": "0.79125816", "text": "def create_appointment\n\t\tarray = [retrieve_first_name, retrieve_last_name, get_appointment_start_time, leave_comment]\n\t\tresponse = HTTParty.post(@url,\n\t\t { \n\t\t :body => {\"appointment\" => { \"first_name\" => ...
871fced1c69245af68f216ebe8f6a6f8
not a valid tar file, since tar files include last modified date which breaks it for use in hashing. this method just wraps up everything for use in hashing.
[ { "docid": "59a2ccf7fead1739dac0512c5cb1972f", "score": "0.50184554", "text": "def tar(path)\n tar_filename = Pathname.new(path).realpath.to_path + '.tar'\n File.open(tar_filename, 'wb') do |tarfile|\n get_files_to_pack(path).each do |file|\n if File.file?(file)\n ...
[ { "docid": "0360da56d9aab3fb79f1b0ccf703a9de", "score": "0.62089604", "text": "def tar\n @tarreader\n end", "title": "" }, { "docid": "a6d68788333f3909100dad81eb9638cb", "score": "0.6205775", "text": "def untar_file(f, to)\n end", "title": "" }, { "...
ef8fc31251d4fbcf0420c2f28fadf1d0
In Resources.rb? Yes Summons a monster. INSTRUCTIONS:
[ { "docid": "b305ed3b4da833bd85448f281ceb0ea7", "score": "0.5884854", "text": "def summon\r\n playerset('unknown') # Sets variables\r\n puts \"stuff\"\r\n summoncard = @@hand.selectcard(\"monster\") # Returns the card data for whatever card you choose whi...
[ { "docid": "19bb5af058399e68a2f9de244290d19a", "score": "0.72390264", "text": "def display_resource(monster)\n monster.name\n end", "title": "" }, { "docid": "21e150be61e026934c3b95f6e0161696", "score": "0.67068094", "text": "def monster; end", "title": "" }, { "docid...
e7ca0c5cf5b43fcfbcb5038f4bfb6de3
DELETE /treinamentos/1 DELETE /treinamentos/1.json
[ { "docid": "c459d58cd0ec04b5a220418207554de3", "score": "0.7755412", "text": "def destroy\n @treinamento = Treinamento.find(params[:id])\n @treinamento.destroy\n\n respond_to do |format|\n format.html { redirect_to treinamentos_url }\n format.json { head :no_content }\n end\n end"...
[ { "docid": "57f2812fd3b9d3ac054bd232b73c2adc", "score": "0.74607956", "text": "def destroy\n @treino.destroy\n respond_to do |format|\n format.html { redirect_to treinos_url, notice: 'Treino was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": ...
ca3c5fcc9106cbdf3c6ca309450a32eb
GET /chapters/1 GET /chapters/1.json
[ { "docid": "31f22f0e71c09016ef6f757125cc92de", "score": "0.7452515", "text": "def show\n @chapter = @manga.chapters.find_by_number(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @chapter }\n end\n end", "title": "" } ]
[ { "docid": "21cd63c4a7b91b86c9dd2550ecd502f8", "score": "0.75712377", "text": "def show\n @chapter = Chapter.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @chapter }\n end\n end", "title": "" }, { "docid": "9a3470e...
21a865137321a70078274f369160b857
Perform a USB port reset to reinitialize a device. The system will attempt to restore the previous configuration and alternate settings after the reset has completed. If the reset fails, the descriptors change, or the previous state cannot be restored, the device will appear to be disconnected and reconnected. This mea...
[ { "docid": "36afcba0f3b1e8a2ba462dbd54f32b01", "score": "0.7977474", "text": "def reset_device\n res = Call.libusb_reset_device(@pHandle)\n LIBUSB.raise_error res, \"in libusb_reset_device\" if res!=0\n end", "title": "" } ]
[ { "docid": "65ef586c5e6ff76470fcad2617252a19", "score": "0.65875965", "text": "def reset_device\n send \"\\x1f\\x02\\x00\\x2e\\x00\\x00\\x2b\\x03\"\n send \"\\x00\\x02\\x00\\x2e\\x00\\x00\\x2b\\x04\"\n send \"\\x00\\x00\\x00\\x2e\\x00\\x00\\x2b\\x05\"\n end", "title": "" }, { ...
3365be0630886df9d7a22621252bac6c
POST /servers POST /servers.json
[ { "docid": "4fd650302e6c189b09d5c838038ed108", "score": "0.6602785", "text": "def create\n @server = Server.new(params[:server])\n\n respond_to do |format|\n if @server.save\n format.html { redirect_to @server, :notice => 'Server was successfully created.' }\n format.json { rend...
[ { "docid": "b5feb0e715bc3e35c6a5c048c3df2dd5", "score": "0.6693041", "text": "def create\n @server = Server.new(:hostname => params[:server][:hostname], :ip => params[:server][:ip])\n updateCategories\n respond_to do |format|\n if @server.save\n format.html { redirect_to @server, no...
0e4dfb159960c4d4242b3da72050c887
GET /editoras/new GET /editoras/new.xml
[ { "docid": "e273f39c011a22858d4f43939e8d6d91", "score": "0.7765657", "text": "def new\n @editora = Editora.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @editora }\n end\n end", "title": "" } ]
[ { "docid": "258f258b513297792ea221be552d7c86", "score": "0.7017015", "text": "def create\n @editora = Editora.new(params[:editora])\n\n respond_to do |format|\n if @editora.save\n flash[:notice] = 'CADASTRADO COM SUCESSSO.'\n format.html { redirect_to(new_editora_path) }\n ...
ee91f3fd390aecb80c4ae02cbf5a4e8c
DELETE /notes/1 or /notes/1.json
[ { "docid": "39d281e2e8fdb0630a8ac6d5ef58791e", "score": "0.67703104", "text": "def destroy\r\n @note = Note.find(params[:id])\r\n @note.destroy\r\n\r\n redirect_to @note\r\n end", "title": "" } ]
[ { "docid": "b6898f57991dab97533b9ca0c7d58ac8", "score": "0.7510771", "text": "def destroy\n @note = Note.find(params[:id])\n @note.destroy\n\n respond_to do |format|\n format.html { redirect_to(notes_url) }\n format.json { head :ok }\n end\n end", "title": "" }, { "do...
1b9f1d8437b09d2f7a2bf3aa84dbcf49
Stocks available with a particular keyword or set of keywords in the stock name, and mostrecent stock info
[ { "docid": "4cbd3b4d7e9145bf1913b862b1ae5923", "score": "0.661873", "text": "def stocks_avilable_by_keyword\r\n # SELECT * FROM orders WHERE stock = $keyword\r\nend", "title": "" } ]
[ { "docid": "1826f68bd3d0963eb99ebb0a40e01ae4", "score": "0.6646774", "text": "def search\n if (params[:stock])\n looked_up_stock = StockQuote::Stock.quote(params[:stock])\n return nil unless looked_up_stock.name\n @new_stock = looked_up_stock\n\n if @new_stock\n # render js...
4b82d39eb9699965632adb6521751d37
Execute a single API request.
[ { "docid": "e277a62495cd02977245cdaeaa1df1f5", "score": "0.57029855", "text": "def execute_request(method_name, method_params = {}) # :nodoc:\n begin\n $log.debug sprintf(\"%s: %s %s\", __method__, method_name.to_s, method_params.inspect)\n\n Surveymonkey::Request.new(method_name.to_s...
[ { "docid": "a4daea127906af4cb7aa0d8212866932", "score": "0.74142396", "text": "def execute!\n validate_request!\n perform_request!\n\n build_response\n end", "title": "" }, { "docid": "9d6e36a80f46fd2a03a0a102b98925a9", "score": "0.73044616", "text": "def execute!\n...
d924c8b25e6ce5246c48621eda16d3d2
Get the number of turns conducted so far.
[ { "docid": "8b86e78a6626f1a896b3eb4bd7689c0d", "score": "0.0", "text": "def turn_count\n @board.reject{|cell| cell == ' '}.length\n end", "title": "" } ]
[ { "docid": "a57b5f0f234dec8a53adf1beb3f37cdd", "score": "0.7829991", "text": "def peek_current_turn_count\n return turns + get_updated_turns()\n end", "title": "" }, { "docid": "1474be123cf1ebcb997844a860a189a7", "score": "0.7812518", "text": "def turn_count\n turns = 0\...
1837f8ae89a8669815b9670a2514a770
Search wikipedia suggestions [+params[:artist_name]+] The artist name to search
[ { "docid": "842ed651d78700e5ec21274830cb5cba", "score": "0.73658204", "text": "def search_wikipedia\n respond_to do |format|\n format.html do\n @wikipedia_search_text = params[:artist_name]\n meta = MetaGeneration.new(Setting.get_settings)\n @wikipedia_search = meta.search_t...
[ { "docid": "c1f0723b831920ee849b4bf871d14df7", "score": "0.7001892", "text": "def suggest\n @result = Artist.search( params[:term] )\n \n respond_to do |format|\n format.html\n format.json { render :json => @result }\n end\n end", "title": "" }, { "docid": "76d4767...
c7da8d05a1838a6ffb5e889c17cb0354
Verifies if the given clear password matches hash and salt stored in IPB's database, returns true/false depending on the result
[ { "docid": "6f2bc2ad3f315246b7a8771a69bf211e", "score": "0.7504413", "text": "def valid_password?(cleartext)\n return salted_hash(cleartext) == converge_pass_hash\n end", "title": "" } ]
[ { "docid": "53d2d1dd8ce421a3f4d67a137171c526", "score": "0.76566565", "text": "def correct_pass?(password)\n Crypto.hash_password(password, self.salt) == self.hashed_password\n end", "title": "" }, { "docid": "2ddca6b95d823f4de037b725c6c6f1f0", "score": "0.7652569", "text": "def ...
d366e7bb7185f6f50d0e2413c4f0ed1a
DELETE /ad_domains/1 DELETE /ad_domains/1.json
[ { "docid": "8b53f6937afea7d8953f8f866f7983a5", "score": "0.7128267", "text": "def destroy\n authorize! :destroy, @ad_domain\n @ad_domain.destroy\n respond_to do |format|\n format.html { redirect_to ad_domains_url, notice: 'Active Directory domain was successfully destroyed.' }\n forma...
[ { "docid": "ef8fce892177d523fddafeee3a401b57", "score": "0.7554419", "text": "def delete_agent_domain\n return false unless validate_domain\n render json: dme.delete_domain(params[:domain])\n end", "title": "" }, { "docid": "ca97b4c8095898e7413008c34bfc5060", "score": "0.71615237"...
52e2bd1f5644d715ac66f7186b6b06c2
will set to 0 if not exist
[ { "docid": "fa576e661aefffdf12be309720d1ca94", "score": "0.0", "text": "def findSubmission(global,kinetic_sync_id)\n\n uri = global[\"config\"][\"kinetic_datastore_uri\"]\n uri = \"#{uri}/datastore/forms/synchronized-task-log/submissions\"\n uri = \"#{uri}?include=values&direction=ASC&limit=25\"\n u...
[ { "docid": "73abea17d5caed114ad2076a0f0804d5", "score": "0.66825956", "text": "def desire()\n\t\treturn 0\n\tend", "title": "" }, { "docid": "4d2dde202dfe37847ef011995167bc1e", "score": "0.66709775", "text": "def count\n exist? ? 1 : 0\n end", "title": "" }, { ...
cb48f854235c217735e3ea7c0ed880d9
This is used by to_s to create a tag so that to_s can be overridden depending on the web framework being used e.g. with Rails.
[ { "docid": "6d9388f720c3afe44836d5c2452450c0", "score": "0.0", "text": "def to_html\n %(<link href=\"#{href}\" rel=\"stylesheet\">)\n end", "title": "" } ]
[ { "docid": "3082e0340c861d67423fc9ea6c9ab460", "score": "0.7378618", "text": "def to_s\n \"<#{tag_name}>#{content}</#{tag_name}>\"\n end", "title": "" }, { "docid": "4fe2c78dad75446012570eab13394ffe", "score": "0.6866868", "text": "def to_tag\n self.class.to_s\n e...
49da1f866ad149ad8015b219e795e3d7
Custom attribute writer method with validation
[ { "docid": "c1c1c8ba637da95723cbfb6047a3eb08", "score": "0.0", "text": "def name=(name)\n if name.nil?\n fail ArgumentError, \"name cannot be nil\"\n end\n\n if name.to_s.length > 100\n fail ArgumentError, \"invalid value for 'name', the character length must be smaller than...
[ { "docid": "0f4a74039d4b8dc62405e39b58357a05", "score": "0.6469466", "text": "def attr_writer_tag(text); end", "title": "" }, { "docid": "ac55752dd9cc4f485a916c46d7b41237", "score": "0.63154924", "text": "def allowed_attributes=(_arg0); end", "title": "" }, { "docid": "ac...
867ea4bcbe80ede0bb177ba142e3015c
use :web_price or :price mapped attribute
[ { "docid": "727bf1049e7faf8d01f51d828c9dfd88", "score": "0.0", "text": "def set_price(prod, row) super end", "title": "" } ]
[ { "docid": "7643474f20c38f30feb5a85aad8ebf02", "score": "0.74405825", "text": "def price; regular_price; end", "title": "" }, { "docid": "507a36d49550b5e1e22522d1373cfd5b", "score": "0.7153548", "text": "def price_in_cents #virtual attribute applies the Uniform Access Principle from ...
72e564016819aba551734525ccbd6f8d
executes this command (it calls the action)
[ { "docid": "cc4d2ea782616afd6e5d3bbd366e3b69", "score": "0.0", "text": "def execute\n view.add_control target, controller.current_view.instance\n end", "title": "" } ]
[ { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.74065775", "text": "def action_run\n end", "title": "" }, { "docid": "aeed727502953cedb43071ce3c4ff172", "score": "0.7278008", "text": "def exec_action_object(action)\n\t\t\taction.execute\n\t\tend", "title": "...
66a35630c506f13feddd1867bfbf51b8
PATCH/PUT /user_actions/1 PATCH/PUT /user_actions/1.json
[ { "docid": "a19abf8cc428b264520f4d736ba91fee", "score": "0.69204533", "text": "def update\n respond_to do |format|\n if @user_action.update(user_action_params)\n format.html { redirect_to @user_action, notice: 'User action was successfully updated.' }\n format.json { head :no_conte...
[ { "docid": "fb1d4679208c976a61c0f24e22af2f0f", "score": "0.77125895", "text": "def patch_user_action(user_action_id, request)\n start.uri('/api/user-action')\n .url_segment(user_action_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .patch()\n .go...