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
// clang++ -o minitest minitest.cpp -std=c++1y -stdlib=libc++ | |
#include <iostream> | |
#define TEST_PREDICATE(expr, oper) \ | |
do { \ | |
auto expr__ = (expr); \ | |
if (!(expr__ oper)) { \ | |
std::cout << __FILE__ << ":" << __LINE__ << " " \ | |
<< "FAILED " << #expr << " " << #oper \ |
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
package com.arakitech.kotlisp | |
import java.util.HashMap | |
fun StringBuilder.clear() { | |
this.setLength(0) | |
} | |
class Tokenizer(val input: String) { | |
private var position = 0 |
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 <list> | |
#include <thread> | |
namespace ya { | |
template<class item_t> | |
class channel { | |
private: |
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
(defconst if3 (* 2 3)) | |
(defconst if5 (* if3 4 5)) | |
(defconst if7 (* if5 6 7)) | |
(defconst if9 (* if7 8 9)) | |
(defconst if11 (* if9 10 11)) | |
(defun simple-sine (x) | |
(unless (eq 'float (type-of x)) | |
(setf x (float x))) | |
(let* ((x2 (* x x)) |
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
(in-package :cl-user) | |
(defpackage forth | |
(:use :cl) | |
(:export :run | |
:clear | |
:create-context)) | |
(in-package :forth) | |
(defstruct context | |
(dictionary (make-hash-table :test 'equal)) |
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
/* | |
* Copyright (C) 2015 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
/* | |
* Copyright (C) 2017 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <stdbool.h> | |
typedef enum _Type Type; | |
enum _Type { | |
TYPE_INT, | |
TYPE_PAIR, | |
}; |
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
<?xml version="1.0" encoding="utf-8"?> | |
<android.support.constraint.ConstraintLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:id="@+id/container" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context=".MainActivity"> |
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
package io.github.yaraki.dependencyinjection | |
import android.arch.lifecycle.LiveData | |
import android.os.Handler | |
import android.os.Looper | |
import android.os.SystemClock | |
import android.text.format.DateFormat | |
import java.util.* | |
class ClockLiveData : LiveData<CharSequence>() { |