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
| IDENTIFICATION DIVISION. | |
| PROGRAM-ID. SAMPLE. | |
| ENVIRONMENT DIVISION. | |
| CONFIGURATION SECTION. | |
| SOURCE-COMPUTER. IBM-ATX. | |
| OBJECT-COMPUTER. IBM-ATX. | |
| SPECIAL-NAMES. |
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
| 001000 IDENTIFICATION DIVISION. | |
| * 2016-10-29 created by mcarter | |
| * convert version3 to version 4 | |
| 001010 PROGRAM-ID. v3-v4. | |
| 002000 ENVIRONMENT DIVISION. | |
| 002010 INPUT-OUTPUT SECTION. | |
| FILE-CONTROL. | |
| select fd-in assign to ws-fd-in-name 12 | |
| organisation is line sequential. |
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
| vector<char> v(str.begin(), str.end()); | |
| v.push_back(0); | |
| char *str = &v[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 <iostream> | |
| #include <decimal/decimal> | |
| using std::cout; | |
| using std::endl; | |
| template<typename T> | |
| void print(T d) | |
| { | |
| cout << std::decimal::decimal_to_double(d) << endl; |
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
| #!/usr/bin/env bash | |
| # download a decade's worth of Yahoo data | |
| # Specify symbol (e.g. VOD.L) in first argument | |
| #echo "$d0" | awk -v T=0 ' | |
| dfield () { | |
| echo "$1" | awk -v T="$2" ' |
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
| ;;; Copyright (c) 2011 Cardinal Peak | |
| ;;; | |
| ;;; Permission is hereby granted, free of charge, to any person obtaining a copy | |
| ;;; of this software and associated documentation files (the "Software"), to deal | |
| ;;; in the Software without restriction, including without limitation the rights | |
| ;;; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| ;;; copies of the Software, and to permit persons to whom the Software is | |
| ;;; furnished to do so, subject to the following conditions: | |
| ;;; | |
| ;;; The above copyright notice and this permission notice shall be included in |
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
| //#![feature(old_io)] | |
| use std::thread; | |
| use std::old_io::timer; | |
| use std::time::duration::Duration; | |
| fn main() { | |
| let vin = vec![1.4f64, 1.2f64, 1.5f64]; | |
| let mut guards = Vec::with_capacity(3); | |
| for i in 0..3 { |
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 <functional> | |
| #include <stdlib.h> | |
| #include <iostream> | |
| #include <vector> | |
| template <class T> | |
| class breaker { | |
| public: |
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
| #!/usr/bin/env bash | |
| w=$HOME/.mca/work | |
| s1=$w/s1 | |
| cd $w/s2 | |
| # dollar exchange rate | |
| url="http://download.finance.yahoo.com/d/quotes.csv?s=USDGBP=X&f=nl1d1t1" | |
| curl -s -L $url > usd.csv & |
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 <ctime> | |
| void printtime() | |
| { | |
| std::time_t t = std::time(nullptr); | |
| char buffer[80]; | |
| strftime(buffer, 80, "%Y-%m-%d", std::localtime(&t)); | |
| std::cout << "*" << buffer << "*\n" ; // *2016-06-11* | |
| strftime(buffer, 80, "%H:%M:%S", std::localtime(&t)); | |
| std::cout << "*" << buffer << "*\n" ; // *11:05:08* |