Ruby
epub |eng | | Author:David B. Copeland

Configure Rails to Work with Angular’s Router Angular makes no prescription about what the server side should look like—that lack of direction is one of the main reasons for writing ...
( Category: JavaScript July 7,2020 )
epub |eng | 2019-01-29 | Author:Simon St. Laurent & Ivo Balbaert [Simon St. Laurent]

( Category: Tools July 4,2020 )
epub |eng | 2020-06-15 | Author:Dave Thomas, Andy Hunt

Reactive Programming, Streams, and Events If you’ve ever used a spreadsheet, then you’ll be familiar with reactive programming. If a cell contains a formula which refers to a second cell, ...
( Category: Object-Oriented Design June 27,2020 )
epub |eng | | Author:Jay McGavren

By the way, the code at right breaks a convention: for consistency, all of your type’s methods can take value receivers, or they can all take pointer receivers, but you ...
( Category: Programming Languages April 2,2020 )
epub |eng | 2013-03-15 | Author:Ophir Frieder, Gideon Frieder, and David Grossman

Example: Find the Max—Hash Example 6-10. Find the max—hash 1 scores = Hash.new 2 3 scores["Geraldo"] = [98, 95, 93, 96] 4 scores["Brittany"] = [74, 90, 84, 92] 5 scores["Michael"] ...
( Category: Storage & Retrieval March 23,2020 )
epub |eng | 2008-03-19 | Author:Russ Olsen

proxy = BankAccountProxy.new(account) proxy.deposit(50) proxy.withdraw(10) * * * There really is nothing very exciting going on in BankAccountProxy. The BankAccountProxy presents exactly the same interface as its subject, the BankAccount ...
( Category: Ruby March 20,2020 )
mobi, epub |eng | 2011-03-11 | Author:Obie Fernandez

( Category: Object-Oriented Design March 12,2020 )
azw3, epub |eng | 2018-04-16 | Author:Stefan Wintermeyer

<ul> <% product.errors.full_messages.each do |message| %> <li><%= message %></li> <% end %> </ul> </div> <% end %> <div class="field"> <%= f.label :name %> <%= f.text_field :name %> </div> <div class="field"> ...
( Category: Object-Oriented Design February 29,2020 )
epub |eng | | Author:Arundel, John

We've passed in an array of strings to the dotfile parameter of our ssh_user definition. Here's where that gets expanded into resource declarations: if $dotfile { $filepath = regsubst($dotfile,'^(.*)$',"/home/${name}/.\\0", 'G') ...
( Category: Linux & UNIX Administration February 28,2020 )
epub |eng | | Author:Steve Pugh [Pugh, Steve]

The Code unless ARGV[0] and File.exists?(ARGV[0]) puts "\n\nUsage is wordScramble.rb <word.file>\n\n" exit end tries = 10 words = File.readlines(ARGV[0]) mystery_word = words[rand(words.size)].chomp scramble_word = mystery_word.split(//).sort_by{rand}.join scramble_word.downcase! puts "\n\n\nThe scrambled word ...
( Category: Ruby February 10,2020 )
epub |eng | | Author:Sam Ruby & Dave Thomas & David Heinemeier Hansson

Iteration K1: Deploying with Phusion Passenger and MySQL So far, as we’ve been developing a Rails application on our local machine, we’ve probably been using WEBrick or Mongrel when we ...
( Category: Software Development February 10,2016 )
epub |eng | 2014-12-15 | Author:Jake Day Williams [Williams, Jake Day]

puts :im_a_symbol.object_id puts :im_a_symbol.object_id Notice that both instances of the strings have different ID numbers, while the symbols have the same ID number. We will talk more about symbols soon. ...
( Category: Software Development December 17,2015 )
epub |eng | 2015-06-17 | Author:Larkin, Michael

3. Create the test in /spec/services/contest_results_spec.rb: describe ContestResults do context "initialize" do it "should raise exception if not an array" do expect {ContestResults.new([1])}.to_not raise_error expect {ContestResults.new([1,2,3,4])}.to_not raise_error expect {ContestResults.new(["a","b"])}.to_not raise_error ...
( Category: Ruby November 27,2015 )
mobi |eng | 2015-02-10 | Author:Hal Fulton & André Arko

def initialize(name) @name = name end # ... def to_s "Pet: #@name" end end Other methods (such as the String concatenation operator +) are more picky; they expect you to ...
( Category: Object-Oriented Design July 18,2015 )
epub |eng | | Author:Paolo Perrotta

​ ​def​ self.now; ​'Mon Apr 06 12:15:50'​; ​end​ ​ ​end​ ​ ​ require ​'test/unit'​ ​ ​ ​class​ TestLoan < Test::Unit::TestCase ​ ​def​ test_conversion_to_string ​ Loan.instance_eval { @time_class = FakeTime } ...
( Category: Object-Oriented Design July 18,2015 )