Tags » F

Property-based testing

Unit testing. We all do it. Some of us even practice TDD (although I wish I had a penny for each time I see a company claiming that they practice TDD when what they actually mean is “We write unit tests.”). 1,029 more words

General Chat

F販讀書店台北店20080517

​F販讀書店台北店20080517

H:販讀書店在台大後門,於20080517結束營業,直接以台中店為主。每次英語班上課前,都會駐足買書,如今已消失多年,今天2017011507找到名片,再查網路,回憶販讀書店台北店的種種,也算是一種追憶。

http://blog.vgod.tw/2008/05/15/%e8%b2%a9%e8%ae%80%e6%9b%b8%e5%ba%97%e8%a6%81%e9%97%9c%e9%96%80%e4%ba%86/?variant=zh-tw

販讀書店

剛在PTT看到這消息..
作者 yasgale (在我還沒睜開眼之前) 看板 bookhouse

標題 [情報] 台大後門的販讀要結束營業了

時間 Sat May 3 17:29:45 2008

───────────────────────────────────────
今天興高采烈地去販讀報到時

赫然發現販讀的門口貼了張布告

說:因為租約到期,5/17起停止營業

如果要便宜的書,請洽台中販讀
唉呀呀 又少了一家便宜的好書店了
這家書店就開在台大辛亥路後門附近,離資訊系館很近。記得在台北時,每天晚上到辛亥路去吃飯常會經過這家書店。店面雖小,但書很便宜,老闆挑得書也都還不錯,此外還有多種雜誌,讓我每次吃完飯路過都會想順便進去逛一逛。
這樣的好書店沒想到這麼快就經營不下去了,真是很可惜啊。
愛書的人們趕快趁這三天去販讀見見它最後一面吧。

F

F#: Practicing Units of Measure

I decided to create my own car kata.
In doing so, I decided to leverage the UOM (Unit of Measure) feature in F#. This essentially constrains how one calculates values that are associated to specific units of measure. 195 more words

Software Development

F#: Revisiting the Vending Machine (again)

I really do enjoy the Vending Machine kata. I decided on the late night to revisit it.

module TempImpl

(*Types*)
type Product = Gum     | Chips | Soda
type Coin =    Quarter | Dime  | Nickel

type Change =  Change of Coin list

type Transaction =
    | Purchased  of Product * Change
    | Required   of decimal
    | OutOfStock of Product

(*Functions*)
let priceOf = function
              | Gum   -> 0.25m
              | Chips -> 0.50m
              | Soda  -> 1.00m

let valueOf = function
              | Quarter -> 0.25m
              | Dime    -> 0.10m
              | Nickel  -> 0.05m

let balanceOf coins =
    (0.0m , coins) 
    ||> List.fold (fun balance coin -> balance + (valueOf coin))
 
let remaining balance product = (priceOf product) - balance
 
let rec getChange balance change =
     
    let rec get remaining change =

        if remaining >= valueOf Quarter
        then get (remaining - valueOf Quarter) (Quarter::change)
 
        elif remaining >= valueOf Dime
        then get (remaining - valueOf Dime) (Dime::change)
 
        elif remaining >= valueOf Nickel
        then get (remaining - valueOf Nickel) (Nickel::change)
 
        else change
 
    get balance []


let select product deposited products =

    if not (products |> List.contains product)
    then OutOfStock product

    elif balanceOf deposited >= priceOf product
    then Purchased (product , Change <| getChange (balanceOf deposited - priceOf product) [])
    else Required (priceOf product - balanceOf deposited)

(*Client*)
let products = [ Gum ; Chips ; Soda ]
               |> select Gum 
… 17 more words
Software Development

Is Fiat Chrysler in the Same Emissions Mess as Volkswagen?

It turns out that Volkswagen may not have been the only car company that in the wrong on emissions. Reports that Fiat Chrysler Automobiles N.V. (NYSE: FCAU) is now being targeted by the Environmental Protection Agency (EPA) have put a serious hurt on shares of the carmaker. 786 more words

Autos

The 6 Most Shorted NYSE Stocks

The Trump rally seemed to weaken as the year wound to its conclusion, while many investors and traders were out for the holidays. Yet with markets still near all-time highs, those short sellers got out of the way of some of the most shorted stocks traded on the New York Stock Exchange between the December 15 and December 30 settlement dates. 922 more words

Investing

SqlJuxt - Building primary keys on a table

There were a few interesting design decisions I had to make when designing the code to script a primary key on a table. Before I dive into them I think it is good to see the finished code, here is a test that uses the TableBuilder to create a clustered primary key on a table: 740 more words

.Net