This file contains hidden or 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
| (gdb) run -f doc/sample.dat bal | |
| Starting program: /home/aristid/Code/ledger/build/ledger/debug/ledger -f doc/sample.dat bal | |
| [Thread debugging using libthread_db enabled] | |
| Catchpoint 1 (exception thrown), 0x00e27525 in __cxa_throw () from /usr/lib/libstdc++.so.6 | |
| (gdb) bt | |
| #0 0x00e27525 in __cxa_throw () from /usr/lib/libstdc++.so.6 | |
| #1 0x082882e5 in ledger::throw_func<ledger::date_error> (message=...) at /home/aristid/Code/ledger/src/error.h:55 | |
| #2 0x08280a83 in ledger::date_parser_t::lexer_t::token_t::expected (wanted=0 '\000', c=77 'M') at /home/aristid/Code/ledger/src/times.cc:1440 | |
| #3 0x082804ad in ledger::date_parser_t::lexer_t::next_token (this=0xbfffbfb8) at /home/aristid/Code/ledger/src/times.cc:1411 | |
| #4 0x0827820a in ledger::date_parser_t::parse (this=0xbfffbfb4) at /home/aristid/Code/ledger/src/times.cc:676 |
This file contains hidden or 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
| $ ledger -f tests/ordering.ledger bal | |
| 10 EUR Aktiva:Bargeld | |
| 0 Passiva | |
| -10 EUR Anfangsbestand | |
| -------------------- | |
| 0 |
This file contains hidden or 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
| #include <boost/spirit/home/phoenix/core.hpp> | |
| #include <boost/spirit/home/phoenix/bind.hpp> | |
| #include <boost/spirit/home/phoenix/operator.hpp> | |
| #include <boost/bind.hpp> | |
| #include "flusspferd.hpp" | |
| using namespace flusspferd; | |
| using namespace std; |
This file contains hidden or 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
| # Für jedes Spiel kann ein Tipp abgegeben werden. Man kann auch nur selektiv Spiele tippen. | |
| # Ab dem Achtelfinale können zusätzlich auch die Mannschaften getippt werden. | |
| # Beachte: Ersetze nur die jeweiligen '-' mit Deinen Tipps. Unlesbare Datensätze werden ignoriert. | |
| Spiel 1: Südafrika versus Mexiko: Tipp: (1:2) | |
| Spiel 2: Uruguay versus Frankreich: Tipp: (2:1) | |
| Spiel 3: Argentinien versus Nigeria: Tipp: (1:2) | |
| Spiel 4: Korea Republik versus Griechenland: Tipp: (2:1) | |
| Spiel 5: England versus USA: Tipp: (3:3) | |
| Spiel 6: Algerien versus Slowenien: Tipp: (0:1) |
This file contains hidden or 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
| //****************************************************************************** | |
| // MSP430F20xx Demo - Timer_A, Ultra-Low Pwr UART 2400 Echo, 32kHz ACLK | |
| // | |
| // Description: Use Timer_A CCR0 hardware output modes and SCCI data latch | |
| // to implement UART function @ 2400 baud. Software does not directly read and | |
| // write to RX and TX pins, instead proper use of output modes and SCCI data | |
| // latch are demonstrated. Use of these hardware features eliminates ISR | |
| // latency effects as hardware insures that output and input bit latching and | |
| // timing are perfectly synchronised with Timer_A regardless of other | |
| // software activity. In the Mainloop the UART function readies the UART to |
This file contains hidden or 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
| -- | Get this amount's commodity and any commodities referenced in its price. | |
| amountCommodities :: Amount -> [Commodity] | |
| amountCommodities Amount{commodity=c,price=p} = | |
| case p of Nothing -> [c] | |
| Just (UnitPrice ma) -> c:(concatMap amountCommodities $ amounts ma) | |
| Just (TotalPrice ma) -> c:(concatMap amountCommodities $ amounts ma) |
This file contains hidden or 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
| {-# LANGUAGE OverloadedStrings #-} | |
| {- To Run: | |
| Load in ghci | |
| :set -XOverloadedStrings (for convenience) | |
| Execute repl expr -} | |
| import Control.Applicative | |
| import Data.Attoparsec hiding (Result) | |
| import Data.Attoparsec.Char8 (char8, isDigit_w8, isSpace_w8) |
This file contains hidden or 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
| import Data.Tree | |
| import Data.List | |
| import Control.Applicative | |
| permutationForest :: [a] -> Forest a | |
| permutationForest = zipWith3 build <*> inits <*> tail . tails | |
| where build a xs ys = Node a (permutationForest $ xs ++ ys) | |
| traverse :: Forest a -> [[a]] | |
| traverse [] = [[]] |
This file contains hidden or 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
| -- Generate a sparkline, Haskell version of <https://github.com/holman/spark/> | |
| -- Usage: after compile, try '$ spark -10 0 15.24 42' | |
| -- Author: Chao Xu, <http://chaoxuprime.com> | |
| import System (getArgs) | |
| main :: IO () | |
| main = do input <- getArgs | |
| putStrLn $ spark (map read input :: [Double]) | |
| spark :: RealFrac b => [b] -> String |
This file contains hidden or 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
| module GameOfLife where | |
| import Data.Set (Set, (\\)) | |
| import qualified Data.Set as S | |
| import Data.List (intercalate) | |
| unionMap :: (Ord a, Ord b) => (a -> Set b) -> Set a -> Set b | |
| unionMap f = S.fromList . concatMap (S.toList . f) . S.toList |