Skip to content

Instantly share code, notes, and snippets.

# clearest
(1..1000).each do |nums|
div3 = nums % 3 == 0
div5 = nums % 5 == 0
div7 = nums % 7 == 0
if div3 && div5 && div7
puts "SuperFizzBuzz"
elsif div3 && div7
puts "SuperFizz"
elsif div5 && div7
File.open("word-list.txt", "r") do |f|
f.each_line do |line|
vowels = line.chars.select { |l| l =~ /[aeiouy]/ }
puts line if vowels == ["a","e","i","o","u","y"]
end
end
1. The Agile model is a much smaller version of the Waterfall model. The Agile model can be repeated and improved upon over time.
2. The Agile model is popular in software development because it allows for changes in what the client wants, rather than having to go back an repeat an entire section that was built.
3. I think Agile could be applicable in a lot of industries. In statistics, Agile could definitely be applied, repeating small pieces of data cleaning and analysis until the full analysis has been completed.

Setting Group Expectations

Group Member Names: Beth Secor, Toni Rib, Steve Pentler

  1. When are group members available to work together? What hours can each group member work individually? Are there any personal time commitments that need to be discussed?
  • Toni: Working together M-F before 8pm, work individually after 8pm, Tuesdays with Toni 4- 5:45, Thursdays pairing with Alex 4-5, 10-11 Saturday pairing with mentor

  • Beth: Working together M-F before 8pm, work individually after 8pm, Tuesdays pairing with Jaime 4-5, Mentor meeting wednesday 12-1

Descriptions of git commands:

  • git stash: Records the current state of the working directory and the index, but want to go back to a clean working directory. The command saves your local modifications away and reverts the working directory to match the HEAD commit.
  • git stash apply: Applies the stashed changes to the current branch you are working on. Does not remove the state from the stash list.
  • git shortlog: Summarizes git log output.
  • git commit --amend: convenient way to fix up the most recent commit. It lets you combine staged changes with the previous commit instead of committing it as an entirely new snapshot. It can also be used to simply edit the previous commit message without changing its snapshot.
  • git reset --hard: Resets the index and working tree (throws away uncommited changes). Any changes to tracked files in the working tree since are discarded.
  • git reset --soft: Does not touch the index file or the working tree at all (but resets the head to <
class Combatant < ActiveRecord::Base
belongs_to :dojo
has_many :winning_fights, :class_name => "Fight", :foreign_key => "winning_combatant_id"
has_many :losing_fights, :class_name => "Fight", :foreign_key => "losing_combatant_id"
end
class Dojo < ActiveRecord::Base
has_many :combatants
has_many :winning_fights, :class_name => "Fight", :foreign_key => "winning_dojo_id"
has_many :losing_fights, :class_name => "Fight", :foreign_key => "losing_dojo_id"
<h3>Victories: </h3>
<ul>
<% @dojo.winning_fights.each do |fight| %>
<li> <%= fight.winning_combatant.name %> defeated <%= fight.losing_combatant.name %> of <%= fight.losing_dojo.dojo_name %> </li>
<% end %>
</ul>
<h3>Defeats: </h3>
require 'better-benchmark'
@data = (1..100).to_a
result = Benchmark.compare_realtime(
:iterations => 30,
:inner_iterations => 500_000,
:warmup_iterations => 1,
:verbose => true
) { |iteration|
🍇 ruby better_benchmarking/shuffle.rb
..............................
Set 1 mean: 1.586 s
Set 1 std dev: 0.092
Set 2 mean: 1.831 s
Set 2 std dev: 0.117
p.value: 6.797632810792956e-11
W: 57.0
The difference (+15.4%) IS statistically significant.
Rails.application.config.middleware.use OmniAuth::Builder do
provider :instagram, ENV['INSTAGRAM_ID'], ENV['INSTAGRAM_SECRET'],
{:scope => "basic likes comments follower_list public_content relationships"}
end