- 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.)
| def extension_path_for_nested_extension(path, apply_tmp) | |
| if File.exist?(path.gsub(/\.erb$/, "")) | |
| if %r{/(locales/.*\.yml)|((routes|#{gem_name})\.rb\.erb)$} === path | |
| # put new translations into a tmp directory | |
| path = path.split(File::SEPARATOR).insert(-2, "tmp").join(File::SEPARATOR) if apply_tmp | |
| elsif %r{/readme.md$} === path || %r{/#{plural_name}.rb$} === path | |
| path = nil | |
| end | |
| elsif %r{lib\/#{plural_name}.rb$} === path | |
| path = nil |
| #!/usr/bin/env ruby | |
| gem "parser", "~> 1.4" | |
| require "parser" | |
| require "parser/ruby19" | |
| require "set" | |
| class ConstantDeclarationAndUseProcessor < Parser::AST::Processor | |
| attr_reader :declared, :used | |
| def initialize |
ror, scala, jetty, erlang, thrift, mongrel, comet server, my-sql, memchached, varnish, kestrel(mq), starling, gizzard, cassandra, hadoop, vertica, munin, nagios, awstats
Kafka acts as a kind of write-ahead log (WAL) that records messages to a persistent store (disk) and allows subscribers to read and apply these changes to their own stores in a system appropriate time-frame.
Terminology:
- Producers send messages to brokers
- Consumers read messages from brokers
- Messages are sent to a topic
Let's say you have an iOS project, and you want to use some external library, like AFNetworking. How do you integrate it?
Add the project to your repo:
git submodule add [email protected]:AFNetworking/AFNetworking.git Vendor/AFNetworking
or something to that effect.
| /* This function runs when the spreadsheet is opened and populates a menu option | |
| labelled Zendesk that contains two options (7 days and 30 days) which are tied | |
| to the listed functions | |
| */ | |
| function onOpen() { | |
| var sheet = SpreadsheetApp.getActiveSpreadsheet(); | |
| var entries = [{ | |
| name : "Pull Satisfaction Data (last 7 days, rolling)", | |
| functionName : "getSatisfactionDataLast7" |
| #!/usr/bin/env sh | |
| brew update | |
| brew install rbenv | |
| brew install ruby-build | |
| brew install openssl | |
| CONFIGURE_OPTS=--with-openssl-dir=`brew --prefix openssl` rbenv install 2.0.0-preview1 |
This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.
Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:
getTweetsFor("domenic", function (err, results) {
// the rest of your code goes here.