text
stringlengths
10
2.61M
require 'spec_helper' describe Search do context "searching by filter" do before(:each) do @search = create(:search) @shop = create(:shop, published: true) end it "returns all published shops when no tags applied to shops" do expect(@search.filtered_by_hotel_tags).to eq(Shop.published)...
module Smtp class Header < GenericHeader TO = 'To'.freeze FROM = 'From'.freeze CONTENT_TYPE = 'Content-type'.freeze MIME_VERSION = 'MIME-Version'.freeze SUBJECT = 'Subject'.freeze CONTENT_TRANSFER_ENCODING = 'Content-Transfer-Encoding'.freeze CONTENT_DISPOSITION = 'Content-Disposition'.fre...
class PostsController < ApplicationController before_action :set_post, only: [:show, :edit, :update, :destroy, :vote] before_action :authenticate, only: [:new, :edit, :destroy] before_action :check_post_user, only: [:edit, :destroy] # GET /posts # GET /posts.json def index if params[:sort] == 'active' ...
# frozen_string_literal: true FactoryBot.define do factory :address do address1 { Faker::Address.street_address } address2 { Faker::Address.secondary_address } city { Faker::Address.city } state { Faker::Address.state } for_customer trait :for_customer do association(:addressable, fac...
Rails.application.routes.draw do mount RailsAdmin::Engine => '/admin', as: 'rails_admin' devise_for :responsibles match '/responsibles', to: 'responsibles#index', via: 'get' resources :students root 'students#index' resources :pages end
class FontNerkoOne < Formula head "https://github.com/google/fonts/raw/main/ofl/nerkoone/NerkoOne-Regular.ttf", verified: "github.com/google/fonts/" desc "Nerko One" desc "Chunky ‘marker’ effect font" homepage "https://fonts.google.com/specimen/Nerko+One" def install (share/"fonts").install "NerkoOne-Regu...
class CampusCrimesController < ApplicationController before_action :set_campus_crime, only: [:show, :edit, :update, :destroy] # GET /campus_crimes # GET /campus_crimes.json def index @campus_crimes = CampusCrime.all end # GET /campus_crimes/1 # GET /campus_crimes/1.json def show end # GET /ca...
class AddUserToBucketitems < ActiveRecord::Migration def change add_column :bucketitems, :user_id, :integer end end
module CDI module V1 module DiscussionOptions class CreateService < BaseCreateService record_type ::DiscussionOption def initialize(discussion, user, options) super user, options @discussion = discussion end def can_create_record? unless valid...
namespace '/api/v1/publishers' do get '' do result = Publisher.all.order(id: :asc).as_json halt(200, result.to_json) rescue Exception => e halt(500, {error: e.message}.to_json) end post '/new' do values = JSON.parse(request.body.read) publisher = Publish...
feature "Entity Class - Create" do context 'Visitor' do scenario "Access invalid" do visit new_entity_class_path expect(current_path).to eq new_session_path end end context 'Admin' do let(:user) { create :user} background do login user.e...
module Patch module Acts module Recoverable def acts_as_recoverable return if self.included_modules.include?(InstanceMethods) include InstanceMethods end module InstanceMethods def self.included(base) base.class_eval do before_destro...
require 'rails_helper' RSpec.describe PresentationSlide, type: :model do it 'can create content slide with content' do slide = build(:presentation_slide) expect(slide).to be_valid end it 'can not create content slide without content' do slide = build(:slide_without_content) expect(slide).not_to ...
# When done, submit this entire file to the autograder. # Part 1 def sum arr arr.inject(0){|sum, x| sum + x } end def max_2_sum arr arr.max(2).inject(0 , :+) end def sum_to_n? arr, n arr.combination(2).any? {|a, b| (a+b)==n } end # Part 2 def hello(name) return "Hello, #{name}" end def starts_with_conson...
Pod::Spec.new do |s| s.name = "BHUtils" s.version = "0.1.2" s.summary = "" s.description = <<-DESC React native utils DESC s.homepage = "" s.license = "MIT" s.author = "Bod...
# == Schema Information # # Table name: users # # id :integer not null, primary key # username :string(255) # password_hash :string(255) # password_salt :string(255) # what_uid :integer # created_at :datetime # updated_at :datetime # class User < ActiveRecord::Base attr_acce...
=begin Glassomium - web-based TUIO-enabled window manager http://www.glassomium.org Copyright 2012 The Glassomium Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at h...
class Student attr_accessor :name, :url, :twitter end
# frozen_string_literal: true require "beyond_api/utils" module BeyondApi class CheckoutSettings < Base include BeyondApi::Utils # # A +GET+ request is used to retrieve the checkout settings. # # $ curl 'https://api-shop.beyondshop.cloud/api/checkout-settings' -i -X GET \ # -H 'Acce...
# -*- mode: ruby -*- # vi: set ft=ruby : # Vagrantfile API/syntax version. Don't touch unless you know what you're doing! VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.box = "centos65" config.vm.box_url = "http://www.lyricalsoftware.com/downloads/centos65.b...
module PPC class Baidu class Group < ::PPC::Baidu def initialize(params = {}) params[:service] = 'Adgroup' super(params) end def all() """ @return : Array of campaignAdgroupIds """ request( "getAllAdgroupId" )["campaignAdgroupIds"] end ...
json.array!(@people_reports) do |people_report| json.extract! people_report, :id, :report_id, :person_id, :old_lastname, :is_teacher, :is_staffteacher, :is_student, :is_postgrad, :details json.url people_report_url(people_report, format: :json) end
class TicketsController < ApplicationController before_action :authenticate_user!, only: :create def show @ticket = Ticket.find(params[:id]) end def create @ticket = current_user.tickets.new if @ticket.save redirect_to @ticket else redirect_to search_path end end end
class Api::V1::UsersController < Api::V1::BaseController before_action :load_user, :except => [:index, :show_current_user, :create] def index authorize User render :json => User.all end def show authorize @user render :json => @user end def show_current_user authorize current_user...
class LineItemImporter def initialize(local_arm=nil, local_protocol, remote_sub_service_request) @local_arm = local_arm @local_protocol = local_protocol @remote_sub_service_request = remote_sub_service_request end def create remote_line_item_ids = @remote_sub_service_request['line_items'].map {...
class Schedule < ActiveRecord::Base EVENT_FOR = [ "Class Room" ] belongs_to :creator, polymorphic: true belongs_to :school_branch validates :title, :start_time, :end_time, :event_for, :school_branch_id, presence: true before_save :ensure_event_for_is_set validates_with MinMaxValidator, fields: { mi...
require 'logger' class EpisodeUpdater def update new_episodes_saved = 0 fetch_new_episodes.each do |episode| begin episode.save! new_episodes_saved += 1 rescue Rails.logger.error("The episode #{episode.title} #{episode.season_and_episode} already exists.") ...
# frozen_string_literal: true require 'test_helper' module LargeTextField class OwnerTest < ActiveSupport::TestCase context "updating in large_text_field_save hook" do { 'empty string' => '', 'non empty string' => 'this is some text' }.each do |name, value| should "be able to assign #{name}" do ...
class Banker < ActiveRecord::Base has_many :associates, dependent: :destroy has_attached_file :image, :styles => { :medium => "244x244>", :thumb => "144x144>" }, :default_url => "default-image.png" validates_attachment_content_type :image, :content_type => /\Aimage\/.*\Z/ #def self.text_search(query) # i...
component 'rubygem-concurrent-ruby' do |pkg, settings, platform| pkg.version '1.1.8' pkg.md5sum '68c226f3ee1bf39313dd4ebc0cf52d43' instance_eval File.read('configs/components/_base-rubygem.rb') end
require "rails_helper" RSpec.describe Task, type: :model do it { is_expected.to belong_to(:identity) } it { is_expected.to belong_to(:assignee) } it { is_expected.to belong_to(:assignable) } it { is_expected.to validate_presence_of(:assignee_id) } it { is_expected.to validate_presence_of(:due_at) } desc...
# # This module holds utility methods shared between repxe_host.rb, # cluster_assign_roles.rb and Vagrantfile # NOTE: Testing should be done with ChefDK and Vagrant rubys # # Most of the methods pertain to cluster.txt and its contents; should not # contact the Chef server, use Chef client or VirtualBox. # # pry is not...
require 'rails_helper' describe 'Question API' do let(:user) { create(:user) } let(:access_token) { create(:access_token, resource_owner_id: user.id) } describe 'GET /index' do let!(:questions) { create_list(:question, 2, user: user) } let!(:question) { questions.first } let!(:answer) { create(:answ...
json.array!(@revisiondisputes) do |revisiondispute| json.extract! revisiondispute, :id, :comment, :revisionreview_id json.url revisiondispute_url(revisiondispute, format: :json) end
# frozen_string_literal: true RSpec.describe Customerio::IdentifyUserBySubscriptionService, :customerio do let(:service) { described_class.new } describe '#call' do subject(:call) do service.call(subscription: subscription) end let(:subscription) { create(:stripe_subscription) } it 'identi...
# Next featured Number Higher than a Given Value =begin (Understand the Problem) Problem: Write a method that takes a single integer as an argument, and returns the next featured number that is greater than the argument. Inputs: Integer Outputs: Integer (next featured number) Questions: 1. What is a f...
class CreateUser attr_reader :user_params, :address_params def initialize(params) @user_params = params.select { |k,_| ["name", "email"].include?(k) }.to_h.symbolize_keys @address_params = params.select { |k,_| ["house_number", "street", "city"].include?(k) }.to_h.symbolize_keys end ...
require './spec/spec_helper' RSpec.describe Antlr4::Runtime do it "can create Parser" do lexer = Antlr4::Runtime::Lexer.new(Antlr4::Runtime::CharStreams.from_string("a=1", 'Test String')) tokens = Antlr4::Runtime::CommonTokenStream.new(lexer) parser = Antlr4::Runtime::Parser.new(tokens) expect(par...
module Concerns::MailmagazineContent::Method extend ActiveSupport::Concern included do before_save :set_datetime before_create :set_no private def set_no maximum_number = MailmagazineContent.where(send_mailmagazine_id: self.send_mailmagazine_id).maximum(:no) self.no = maximum_nu...
module CDI module V1 class RankingSerializer < SimpleRankingSerializer has_one :user, serializer: SimpleUserSerializer end end end
# http://oeis.org/A006255 require 'prime' require_relative '../helpers/boolean_matrix' require_relative '../helpers/is_square' class OEIS # Ron Graham's sequence: a(n) = smallest m for which there is a sequence # n = b_1 < b_2 < ... < b_t = m such that b_1*b_2*...*b_t is a perfect square. def self.a006255(n, op...
class RemoveLevelAndExperienceFromCharacters < ActiveRecord::Migration def change remove_column :characters, :level, :integer remove_column :characters, :experience, :integer end end
require_relative './stage' class NonSpamApplication < Stage attr_accessor :applications, :spam_mapping def load ids = @parent.applications.map { |a| a[:id] } # Returns a hash formatted like: { id -> is_spam? } output = Website.run_cmd( "rails runner 'output = {}; [#{ids.join(', ')}].each { |id|...
require 'rom/reader_registry/dsl' module ROM class ReaderRegistry attr_reader :readers def initialize(readers = {}) @readers = readers end def self.define(relations, &block) dsl = DSL.new(relations) dsl.instance_exec(&block) dsl.call end def [](name) readers....
# This file should contain all the record creation needed to seed the database with its default values. # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). # # Examples: # # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) # Ch...
# Copyright 2013 Petr Chalupa <git+algebrick@pitr.ch> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
class Room < ApplicationRecord has_many :patients validates :wing, inclusion: { in: %w(north south east west), message: "must be a valid wing (north, south, east, or west)" } validates :floor, numericality: {greater_than: 0, less_than: 5, only_integer: true, message: "floor must be between 1 and 4 and only...
if @error node(:error) { @error.to_json } else node(:rides) { partial 'api/rides/_ride', :object => @rides } end
class Tag < Table def self.most_popular(n) tags = $db.execute(<<-SQL, :n => n) SELECT tags.* FROM tags JOIN question_tags ON tags.id = question_tags.tag_id JOIN question_likes ON question_likes.question_id = question_tags.question_id GROUP BY ...
class RemoveCreatedDateFromConnections < ActiveRecord::Migration[5.1] def change remove_column :connections, :date_created, :connections end end
class Message < ActiveRecord::Base attr_accessible :body, :name, :photo_url, :provider, :provider_id, :room_id belongs_to :room validates :body, presence: true validates :name, presence: true end
#encoding: utf-8 Dado(/^que eu possua um msisdn válido e que possua o "([^"]*)" "([^"]*)" assinado$/) do |produto, versao| @env = environment_config @product = generate_product produto, versao expect(@product.msisdn).not_to be_empty @sms_mo = send_sms_mo @product, @env expect(@sms_mo.code).to be_eql 200 write...
require 'colorize' module ScreenHelpers def new_line_break puts "" end def system_clear system 'clear' end def prompt(msg) puts ">> #{msg}" end end module GameConstants CARD_SUITS = ['Hearts', 'Diamonds', 'Clubs', 'Spades'].freeze NUMBER_VALUES = ['2', '3', '4', '5', '6', '7', '8', '9',...
class Contest::InfSerializer < ActiveModel::Serializer root false attributes :id, :name, :task_count, :score def task_count object.tasks_count end def score object.score end end
require_relative "planet.rb" class SolarSystem attr_reader :star_name, :planets def initialize(star_name) @star_name = star_name @planets = [] end def add_planet(planet) # Takes an instance of planet planets << planet # Adds it to planets array end def list_planets list_num = 1 list_...
require_relative '../models/book' require_relative '../views/add_remove_books_view' require_relative '../controllers/users_controller' class AddRemoveBooksController class << self attr_accessor :book_title, :book_description, :book_rating, :book_year, :book_isbn, :book_publisher, :a...
module TwitterHandle def twitter=(handle) self[:twitter] = handle.gsub('@', ''); end def has_twitter? twitter && twitter != '' end def twitter_handle if has_twitter? twitter_handle = '@' + twitter else '' end end def twitter_profile_url if has_twitter? twitter_p...
class VideosController < ApplicationController def index @categories = Category.all end def new @video = Video.new end def show @video = Video.find(params[:id]) end def search @videos = Video.search_by_title(params[:name]) end private def video_params params.require(:video)...
require 'rubygems' require 'active_support' require "test/unit" require File.dirname(__FILE__) + "/../lib/xml_node" class TestXmlNode < Test::Unit::TestCase def test_init_sanity assert_raise(ArgumentError) { XmlNode.new } assert_nothing_raised { XmlNode.new('feed')} assert_nothing_raised { XmlNode.ne...
# -*- mode: ruby -*- # vi: set ft=ruby : Vagrant.configure("2") do |config| config.vm.box = "centos/6" config.vm.define "build" do |build| build.vm.hostname = "build" build.vm.network "private_network", ip: "192.168.50.10" config.vm.network "forwarded_port", guest: 21, host: 10021, build.vm.provisi...
class Evento < ActiveRecord::Base belongs_to :requisicao belongs_to :usuario validates_presence_of :tipo, :data, :usuario_id, :requisicao_id symbolize :tipo end
class Timer attr_reader :seconds, :time_string def initialize @seconds = 0 @time_string=0 end def seconds=(in_seconds) @seconds = in_seconds minutes = 0 hours = 0 if in_seconds > 60 @seconds = in_seconds%60 minutes = in_seconds/60 end minnew=0 if minutes > 60 minnew=minutes%60 hours...
class Post < ApplicationRecord paginates_per 5 belongs_to :category has_many :comments, dependent: :destroy validates :title, :summary, :body, :category, presence: true validates :title, uniqueness: true def self.recent(number) Post.order("created_at desc").limit(number) end end
# Problem 276: Primitive Triangles # http://projecteuler.net/problem=276 # Consider the triangles with integer sides a, b and c with a ≤ b ≤ c. # An integer sided triangle (a,b,c) is called primitive if gcd(a,b,c)=1. # How many primitive integer sided triangles exist with a perimeter not exceeding 10 000 000?
module OpenXml module DrawingML module Elements class Graphic < OpenXml::Docx::Elements::Container namespace :a end end end end
class UsersController < ApplicationController before_action :set_user, only: [:edit, :update, :destroy] before_action :logged_in_user, only: [:index, :edit, :update] before_action :following_id, only: [:index, :edit, :update] def show @user=User.find(params[:id]) @microposts =@user.microposts.order(c...
require 'pry' require_relative 'deck' class Game def initialize @purse = 100 @wager = 10 greeting end def greeting puts "Welcome to Blackjack! What is your name, player? " @player = gets.chomp.upcase puts "------------------------------------------------" puts "Welcome #{@player} to...
class FontClimateCrisis < Formula head "https://github.com/google/fonts/raw/main/ofl/climatecrisis/ClimateCrisis%5BYEAR%5D.ttf" desc "Climate Crisis" homepage "https://github.com/dancoull/ClimateCrisis" def install (share/"fonts").install "ClimateCrisis[YEAR].ttf" end test do end end
require_relative 'spec_helper' require_relative '../lib/DigitalItem' describe DigitalItem do before(:context) do @digital_item = DigitalItem.new "Generic Name", 5.99 end #check inilization describe "Initialize" do it "Initialize Name" do expect(@digital_item.name).to eq("Generic Name") end it...
module RadioTune class TestResponseRepository < MTest::Unit::TestCase def setup @database_adapter = database_adapter_stub(response_rows) @repository = ResponseRepository.new(@database_adapter) end def test_last @repository.last expectation = %{ SELECT cfurl_cache_response...
require 'rails_helper' RSpec.describe LinksController, type: :controller do let(:valid_attributes) do { title: 'Great Page', path: '/great-page', weight: 1 } end let(:invalid_attributes) do { path: nil } end let!(:existing_user) do User.create!(display_name: 'Zoi...
require 'rails_helper' RSpec.describe "Stats", type: :request do describe "GET /stats" do it "gets stats of all tags" do tag1 = FactoryGirl.create :entity, entity_type: 'Product', entity_id: Faker::Number.number(10), tags: ['Large', 'Pink'] tag2 = FactoryGirl.create :entity, entity_type: 'Product', e...
require 'spec_helper' describe BackpackTF::Price::ItemPrice do let(:item_price) do key = 'Unique_Tradable_Craftable' described_class.new(key, {}) end describe '::quality_name_to_index' do before(:each) do allow(described_class).to receive(:qualities).and_return([:foo, :bar]) end it 'r...
require 'rails_helper' describe 'Cities API' do describe 'GET /api/v1/city/:id/' do let!(:city) { create(:city) } it 'returns 200 status code', :lurker do get "/api/v1/cities/#{city.id}" expect(response).to be_success end it "give non exist city" do get "/api/v1/cities/999" ...
class AddPublishedAtToAlerts < ActiveRecord::Migration def change add_column :layout_breakingnewsalert, :published_at, :datetime remove_index :layout_breakingnewsalert, name: "index_layout_breakingnewsalert_on_status_and_created_at" add_index :layout_breakingnewsalert, [:status, :published_at] Breaki...
module Api module V1 class AssetsController < APIController def index assets = Asset.includes(:asset_type).order('asset_types.name') respond_with assets end def check_out asset.check_out(current_user || User.first) respond_with asset, location: nil, status: :no_...
# Let d(n) be defined as the sum of proper divisors of n (numbers less than n which divide evenly into n). # If d(a) = b and d(b) = a, where a ≠ b, then a and b are an amicable pair and each of a and b are called amicable numbers. # For example, the proper divisors of 220 are 1, 2, 4, 5, 10, 11, 20, 22, 44, 55 and 110...
class NationalPatientIdentifier < ActiveRecord::Base belongs_to :person belongs_to :assigner, :class_name => 'User' belongs_to :assigner_site, :class_name => 'Site' validates_presence_of :value, :assigner_site_id # don't allow more than one ID to be assigned to any person validates_uniqueness_...
module GitlabApiHelper def stub_add_collaborator_request(username, repo_name, user_token) stub_search_user_request(username, user_token) stub_request(:post, "#{gitlab_url}/api/v3/projects/#{repo_name}/members") .with( headers: { 'Private-Token' => user_token, 'Accept' => 'application/...
class RemoveUnusedTables < ActiveRecord::Migration def up drop_table :device_patients end def down end end
# frozen_string_literal: true class SearchAlgorithms # sort an ordered list by cutting it in half repeatedly def binary_search(list, item) # keep track of where you are in list low = 0 high = list.length - 1 while low <= high mid = (low + high) / 2 guess = list[mid] if guess == ...
#! ruby # # Usage # bundle exec ruby bootstrap.rb NewApp # Where NewApp is the name for your new rails application # # Script: # - updates the app name throughout the application # - removes origin reference # - sets a new secret # - sets a new session store key class NewApp FILES = [ 'config/applicatio...
class CreateBrands < ActiveRecord::Migration def self.up create_table :brands do |t| t.string :title t.belongs_to :merchant t.timestamps end execute "ALTER TABLE `brands` ADD `featured` ENUM('true', 'false')" execute "ALTER TABLE `brands` ADD `instant` ENUM('true', 'false')" exe...
class InPastValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) record.errors.add attribute, ("should be in the past") unless in_past?(value) end private def in_past?(date) date.present? && date <= Time.zone.today end end
class Sudoku # board should be a string with numbers and dashes for spaces def initialize(board) @board = board.chars.to_a end # prints board def show (0...9).each {|r| (0...9).each {|c| print @board[r*9 + c]} print "\n" } puts "\n" end # given index, returns array of characters in the same...
module ApplicationHelper KLASSES = { alert: :danger, notice: :success, info: :info } def flash_messages flash.map do |key, mensaje| content_tag :div, mensaje, class: "alert alert-#{KLASSES[key.to_sym]}" end.join.html_safe end def date(a_date, options = {}) a_date.present? ? l(a_date, option...
class Bird < SKSpriteNode BIRD = 0x1 << 0 def init self.initWithImageNamed("bird_one.png") self.physicsBody = physics_body self.position = CGPointMake(80, 400) self.scale = 1.1 self.name = "bird" self.runAction flap self end def flap bird_one = SKTexture.textureWithImageNamed("...
class Pet < ActiveRecord::Migration def change add_column :clients, :role_id, :integer, default: 1 remove_column :lawyers, :role_id end end
class CommentsController < ApplicationController skip_before_action :verify_authenticity_token before_action :find_comment_id, except: [:like, :create] def create @post = Post.find(params[:post_id]) @comment = @post.comments.new(comment_params) @comment.user = current_user if @comment.save ...
# This file should contain all the record creation needed to seed the database with its default values. # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). # # Examples: # # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) # Ch...
require 'cloudformation_mapper/resource' class CloudformationMapper::Resource::AwsResourceEc2NetworkAclEntry < CloudformationMapper::Resource register_type 'AWS::EC2::NetworkAclEntry' type 'Template' parameter do type 'Template' name :Properties parameter do type 'String' name :CidrB...
class Department < ActiveRecord::Base has_many :users, dependent: :destroy has_many :blogs, dependent: :destroy before_save :capitalize def capitalize self.department_name = self.department_name.capitalize end end
require 'synchronisable/worker/base' module Synchronisable module Worker # Responsible for associations synchronization. # # @api private class Associations < Base # Synchronizes associations. # # @see Synchronisable::Source # @see Synchronisable::DSL::Associations # @se...
# == Schema Information # # Table name: projects # # id :integer not null, primary key # title :string not null # end_date :date not null # funding_goal :integer not null # details :text not null # creator_...
class Carro attr_accessor :nome def turnOn puts 'The car is ready' end end civic = Carro.new puts civic.class civic.nome = 'Civic' puts civic.nome civic.turnOn
require 'spec_helper' require 'rails_helper' require 'shoulda-matchers' describe Lunch do let(:lunch) { FactoryGirl.build :lunch } subject { lunch } it { should validate_presence_of :name } it { should validate_presence_of :price } it { should validate_presence_of :date } it { should validate_presence_of ...
class StageOrdersController < GroupBase before_action :set_stage_order, only: [:show, :edit, :update, :destroy] load_and_authorize_resource # for cancancan # GET /stage_orders # GET /stage_orders.json def index @stage_orders = [] # 初期化 @groups.each { |group| @stage_orders += StageOrder.where( g...
# -*- coding: utf-8 -*- =begin '''Tamanho de strings.''' Faça um programa que leia 2 strings e informe o conteúdo delas seguido do seu comprimento. Informe também se as duas strings possuem o mesmo comprimento e são iguais ou diferentes no conteúdo. Compara duas strings String 1: Brasil Hexa 2006 String 2: Brasil! He...
json.exercise do json.partial! 'api/v1/exercises/show', exercise: @exercise end
require './spec/spec_helper' RSpec.describe Antlr4::Runtime do it "can create an Array2DHashSet" do s = Antlr4::Runtime::Array2DHashSet.new(nil, 2, 2) s.add('TEST1') s.add('TEST2') s.add('TEST3') s.add('TEST4') s.add('TEST5') s.add('TEST6') s.add('TEST7') s.add('TEST8') s.ad...