Skip to content

Instantly share code, notes, and snippets.

View zachlatta's full-sized avatar
🏴‍☠️

Zach Latta zachlatta

🏴‍☠️
View GitHub Profile
It is a well-known fact that behind every good comet is a UFO. These UFOs often come to collect loyal supporters from here on Earth. Unfortunately, they only have room to pick up one group of followers on each trip. They do, however, let the groups know ahead of time which will be picked up for each comet by a clever scheme: they pick a name for the comet which, along with the name of the group, can be used to determine if it is a particular group's turn to go (who do you think names the comets?). The details of the matching scheme are given below; your job is to write a program which takes the names of a group and a comet and then determines whether the group should go with the UFO behind that comet.
Both the name of the group and the name of the comet are converted into a number in the following manner: the final number is just the product of all the letters in the name, where "A" is 1 and "Z" is 26. For instance, the group "USACO" would be 21 * 19 * 1 * 3 * 15 = 17955. If the group's number mod 47 is the

It is a well-known fact that behind every good comet is a UFO. These UFOs often come to collect loyal supporters from here on Earth. Unfortunately, they only have room to pick up one group of followers on each trip. They do, however, let the groups know ahead of time which will be picked up for each comet by a clever scheme: they pick a name for the comet which, along with the name of the group, can be used to determine if it is a particular group's turn to go (who do you think names the comets?). The details of the matching scheme are given below; your job is to write a program which takes the names of a group and a comet and then determines whether the group should go with the UFO behind that comet.

Both the name of the group and the name of the comet are converted into a number in the following manner: the final number is just the product of all the letters in the name, where "A" is 1 and "Z" is 26. For instance, the group "USACO" would be 21 * 19 * 1 * 3 * 15 = 17955. If the group's number mod 47 is the

Languages Known

  • Java
  • C++
  • Whitespace
--indent-classes
--indent-switches
--indent-namespaces
--indent-labels
--indent-preprocessor
--indent-col1-comments
--break-blocks
--break-blocks=all
--pad-oper
--unpad-paren
@zachlatta
zachlatta / if.go
Last active December 26, 2015 09:19
i := 10
if i > 10 {
fmt.Println("Big")
} else {
fmt.Println("Small")
}
#!/bin/bash
file="/usr/local/bin/nexus5ship"
tmp="/tmp/nexus5ship"
curl -s https://gist.github.com/zachlatta/7277571/raw/e3e65590383d42c4bce2eaec7c9cef75fa7e751e/nexus5ship.sh > $tmp
sudo mv $tmp $file
sudo chmod +x $file
read -p "Tracking code: " tracking_code
#!/bin/sh
cat $0
@zachlatta
zachlatta / pages_policy_awesome.rb
Created December 31, 2013 09:25
The magic of metaprogramming.
class PagesPolicy < ApplicationPolicy
%w(home about contact acknowledgements sign_up_selection).each do |a|
define_method "#{a}?" do
true
end
end
end
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDX28ewY4SINoiin9X3aU1SU0fzuT9sN0NW9eDYuw2Feje5IR3gKdOHYBxjEDiWYa9fSZ41EA4YPkebS9v/d8gvBUtPjIYMcSLiHUP5I7Gr6cTFZCIf8rohWT7T2CngDSBoK+ch9ufrXD2tEXF6Spzxe/faCFSuyhP3JgfuNVLoZsZuwIrEEFhVoF0XL64/vvPTIIhY0D4n1AcxS6RJIZN8mH7ge9oI0eXdchAborylpj5B4dtaxN4ALtpTR1Yn1kuaZuoBdOPeaQwpkUvE0nvjbb6nlulB+8Q+q4+m1L3856yJoZ83xM3IPBJP2/AwQ03sSaqNSlFoC+zgTipjs0nt [email protected]