- You can store a price in a floating point variable.
- All currencies are subdivided in 1/100th units (like US dollar/cents, euro/eurocents etc.).
- All currencies are subdivided in decimal units (like dinar/fils)
- All currencies currently in circulation are subdivided in decimal units. (to exclude shillings, pennies) (counter-example: MGA)
- All currencies are subdivided. (counter-examples: KRW, COP, JPY... Or subdivisions can be deprecated.)
- Prices can't have more precision than the smaller sub-unit of the currency. (e.g. gas prices)
- For any currency you can have a price of 1. (ZWL)
- Every country has its own currency. (EUR is the best example, but also Franc CFA, etc.)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 DIM FourDigitPassword INTEGER | |
20 FOR i = 0 TO 9 | |
30 FOR j = 0 TO 9 | |
40 FOR k = 0 TO 9 | |
50 FOR l = 0 TO 9 | |
60 FourDigitPassword = getFourDigits (i,j,k,l) | |
70 IF checkPasswordMatch(FourDigitPassword) = TRUE THEN | |
80 GOTO 140 | |
90 END | |
100 NEXT l |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file modifies benchmark-ips to better accommodate the optimisation | |
# characteristics of sophisticated implementations of Ruby that have a very | |
# large difference between cold and warmed up performance, and that apply | |
# optimisations such as value profiling or other speculation on runtime values. | |
# Recommended to be used with a large (60s) warmup and (30s) measure time. This | |
# has been modified to be the default. Note that on top of that, it now runs | |
# warmup five times, so generating the report will be a lot slower than | |
# before. | |
# Code is modified from benchmark-ips |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "braintree" | |
transaction_attributes = { | |
:amount => "1000.00", | |
:credit_card => { | |
:number => "5105105105105100", | |
:expiration_date => "05/12" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark/ips' | |
class FakeDimension | |
def initialize | |
@margin_start = 10 | |
@margin_start_relative = false | |
end | |
def relative?(result) | |
result.is_a?(Float) && result <= 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_relative "../helper" | |
describe "A room" do | |
let(:room) { Wumpus::Room.new(12) } | |
it "has a number" do | |
room.number.must_equal(12) | |
end | |
it "may contain hazards" do |
I want to write software that helps kill people.
Please, before you call the police and get my github account put on lockdown, allow me a moment to explain. What I really want to do is work on projects that advance the human condition and improve people's lives. I've been in a mad dash to learn how to program for the past four or five years exactly because I realized how much good I could do for the world with a computer.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'bundler/setup' | |
require 'celluloid' | |
class Table | |
include Celluloid | |
CHOPSTICK_FREE = 0 | |
CHOPSTICK_USED = 1 |
List moved
Please use https://github.com/bf4/learning to fork and pull changes.
NewerOlder