- 原材料: A社
- 製造: B社
- 卸: C社
- 小売: D社
消費税が無い状態で、小売売価100、卸値70、製造販売価50、原材料価格20とする。1個商品が売れた場合
| |売価|仕入れ値|粗利|
type InitFunction = (send: SendFunction) => CleanupFunction; | |
type SendFunction = (event: string, data: string) => void; | |
type CleanupFunction = () => void; | |
export function eventStream(request: Request, init: InitFunction) { | |
let stream = new ReadableStream({ | |
start(controller) { | |
let encoder = new TextEncoder(); | |
let send = (event: string, data: string) => { | |
controller.enqueue(encoder.encode(`event: ${event}\n`)); |
(use srfi-27) | |
(use srfi-42) | |
(use gauche.sequence) | |
(define *n* 10000) | |
(define *points* (make-vector *n* 0)) | |
(define (reset init) | |
(set! *points* (make-vector *n* init))) |
require 'bundler/inline' | |
gemfile do | |
source 'https://rubygems.org' | |
gem 'colorize' | |
end | |
class MatcherInterface | |
def initialize(some_object) | |
@some_object = some_object |
#!/bin/bash | |
# Script to backup git repo to Backblaze B2 | |
# Set bucket, dir, password and account to use for the backup. I keep mine in local env vars | |
# These are set by localrc which lives on an encrypted home directory and is executed by my bashrc | |
# Ensure you have authorized the B2 command line tool with the correct account AND added your SSH | |
# public key to your github account, if you need to backup private repositories. | |
# To restore this repo in the future, download it from B2, extract it and then use this command: | |
# cd old-repository.git |
module IncrementAndDecrement | |
def increment(&block) | |
matcher = change(&block).by(1) | |
RSpec::Matchers::AliasedMatcher.new(matcher, lambda do |desc| | |
desc.gsub("changed", "incremented").gsub("change", "increment") | |
end) | |
end | |
def decrement(&block) | |
matcher = change(&block).by(-1) |
Python
begin | |
require "bundler/inline" | |
rescue LoadError => e | |
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler" | |
raise e | |
end | |
gemfile(true) do | |
source "https://rubygems.org" |
# LVDB - LLOOGG Memory DB | |
# Copyriht (C) 2009 Salvatore Sanfilippo <antirez@gmail.com> | |
# All Rights Reserved | |
# TODO | |
# - cron with cleanup of timedout clients, automatic dump | |
# - the dump should use array startsearch to write it line by line | |
# and may just use gets to read element by element and load the whole state. | |
# - 'help','stopserver','saveandstopserver','save','load','reset','keys' commands. | |
# - ttl with milliseconds resolution 'ttl a 1000'. Check ttl in dump! |