This file contains 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 java.util.Arrays; | |
public class Time { | |
public static void main(String[] args) throws InterruptedException { | |
int n = 100; | |
int[] before = new int[n]; | |
int[] after = new int[n]; | |
// warmup |
This file contains 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 java.io.IOException; | |
import java.nio.MappedByteBuffer; | |
import java.nio.channels.FileChannel; | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.nio.file.Paths; | |
import java.nio.file.StandardOpenOption; | |
import java.time.Instant; | |
/** |
This file contains 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 com.sun.net.httpserver.Filter; | |
import com.sun.net.httpserver.HttpExchange; | |
import com.sun.net.httpserver.HttpHandler; | |
import com.sun.net.httpserver.HttpServer; | |
import java.io.IOException; | |
import java.net.HttpURLConnection; | |
import java.net.InetSocketAddress; | |
import java.util.Arrays; | |
import java.util.List; |
This file contains 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 <boost/make_shared.hpp> | |
class Widget { | |
public: | |
virtual int getMass() const = 0; | |
}; | |
class SimpleWidget : Widget { |
This file contains 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> | |
// modified from https://wandbox.org/permlink/YnHKdrHmMFiJsjOm | |
template <typename T, typename Deleter> | |
struct handle { | |
handle(T value, Deleter deleter = Deleter()) : value_(value), deleter_(deleter) { | |
} | |
~handle() { |
This file contains 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 java.util.concurrent.ExecutionException; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.SynchronousQueue; | |
import java.util.concurrent.ThreadPoolExecutor; | |
import java.util.concurrent.TimeUnit; | |
import java.util.concurrent.TimeoutException; | |
import java.util.concurrent.atomic.AtomicInteger; | |
import java.util.concurrent.atomic.AtomicReference; | |
import java.util.function.Consumer; |
This file contains 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
public class Calculus { | |
public static void main(String[] args) { | |
double δx = 17.0; | |
double δy = 23.0; | |
double δxノδy = δx / δy; | |
System.out.println("δxノδy = " + δxノδy); | |
} | |
} |
This file contains 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 <vector> | |
#include <boost/make_shared.hpp> | |
#include <ql/indexes/ibor/euribor.hpp> | |
#include <ql/math/interpolations/convexmonotoneinterpolation.hpp> | |
#include <ql/termstructures/yield/piecewiseyieldcurve.hpp> | |
#include <ql/termstructures/yield/ratehelpers.hpp> | |
#include <ql/time/daycounters/actual360.hpp> |
This file contains 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 <vector> | |
#include <boost/make_shared.hpp> | |
#include <ql/indexes/ibor/euribor.hpp> | |
#include <ql/math/interpolations/all.hpp> | |
#include <ql/termstructures/yield/piecewiseyieldcurve.hpp> | |
#include <ql/termstructures/yield/ratehelpers.hpp> | |
#include <ql/time/daycounters/actual360.hpp> |
This file contains 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
term | rate | forward | |
---|---|---|---|
0.0 | -0.0033133321508 | -0.0033133321508 | |
0.1 | -0.00329678287008599 | -0.003263684308657968 | |
0.2 | -0.003247135027943958 | -0.0031147407822318712 | |
0.30000000000000004 | -0.0031652069127224678 | -0.00289212724033709 | |
0.4 | -0.00307524118684741 | -0.002711931672110584 | |
0.5 | -0.0029812451740789943 | -0.002491961467903277 | |
0.6 | -0.002878499729047622 | -0.0022396014243447277 | |
0.7 | -0.0027726330307377965 | -0.002047717424672988 | |
0.7999999999999999 | -0.002674128906090226 | -0.0019474822563351547 |