Write a Deaf Grandma program.
Whatever you say to grandma (whatever you type in), she should respond with
HUH?! SPEAK UP, SONNY!
unless you shout it (type in all capitals).
Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
| Ctrl+C | copy current line (if no selection) |
| Ctrl+X | cut current line (if no selection) |
| Ctrl+⇧+K | delete line |
| Ctrl+↩ | insert line after |
Write a program that will take a number from 0 to 999,999,999,999 and break it into chunks, adding the magnitude.
In other words, if the input to the program is 1234567890 then the output should be '1 billion 234 million 567 thousand 890'
The program must also report any values that are out of range.
We are going to do the Transform step of an Extract-Transform-Load.
This is a fancy way of saying "We have some crufty, legacy data over in this system, and now we need it in this shiny new system over here, so we're going to migrate this".
Typically, this is followed by "We're only going to need to run this once", which is then typically followed by much forehead slapping and moaning about
Write a program that will convert a binary number, represented as a string (i.e. "101010"), to it's decimal equivalent using first principles (i.e. no, you may not use built-in ruby libraries or gems to accomplish the conversion).
The program should consider strings specifying an invalid binary as the value 0.
This is how computers work:
# "1011001"| # shortform git commands | |
| alias g='git' | |
| # list all files ever added to a git repo | |
| git log --name-status --oneline --all | grep -P "^[A|M|D]\s" | awk '{print $2}' | sort | uniq | |
| # get current branch | |
| git branch | grep "^*" | sed 's/* //g' | |
| # stage manually deleted files |
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
Write a program that, given a number, can find the sum of all the multiples of 3 or 5 up to and including that number.
Allow the program to be configured to find the sum of multiples of numbers other than 3 and 5.
A variation on Problem 1 at Project Euler