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
""" | |
Ref. | |
[1] Peng Li, Chengyu Liu, Ke Li, Dingchang Zheng, Changchun Liu, | |
Yinglong Hou. "Assessing the complexity of short-term heartbeat | |
interval series by distribution entropy", Med Biol Eng Comput, | |
2015, 53: 77-87. | |
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
(C) Peng Li 2013-2017 | |
If you use the code, please make sure that you cite reference [1] | |
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
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
<template> | |
<div class="app"> | |
<div class="components"> | |
<p class="title">アコーディオン1</p> | |
<transition | |
name="expand" | |
@enter="enter" | |
@after-enter="afterEnter" | |
@leave="leave" | |
@after-leave="afterLeave" |
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
<template> | |
<div class="app"> | |
<div class="components"> | |
<p class="title">アコーディオン1</p> | |
<transition | |
name="expand" | |
@before-enter="beforeEnter" | |
@enter="enter" | |
@before-leave="beforeLeave" | |
@leave="leave" |
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 saga.sample01 | |
import cats.effect.{Concurrent, ContextShift, IO} | |
import com.vladkopanev.cats.saga.Saga._ | |
import scala.concurrent.ExecutionContext | |
object Main extends App { | |
implicit val ec: ContextShift[IO] = IO.contextShift(ExecutionContext.global) |
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 state.sample01 | |
case class V(value: Int) | |
object Main extends App { | |
val result1: Either[V, Unit] = Right(Unit) | |
val result2: Either[V, Unit] = Right(Unit) | |
val result3: Either[V, Unit] = Left(V(1)) | |
val result4: Either[V, Unit] = Left(V(2)) |
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
extern crate serde; | |
extern crate serde_json as sjson; | |
extern crate twitter_stream_message; | |
use twitter_stream_message::StreamMessage; | |
fn main() { | |
let data = r#" | |
{ | |
"created_at": "Tue Jun 04 09:04:39 +0000 2019", | |
"id": 1135834739275735000, |
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
# Setup Building Container | |
## Install Dependency Module | |
FROM rust:1.34.1-slim as builder | |
ENV RUSTUP_HOME=/usr/local/rustup \ | |
CARGO_HOME=/usr/local/cargo \ | |
PATH=/usr/local/cargo/bin:$PATH \ | |
OPENSSL_LIB_DIR=/usr/lib/x86_64-linux-gnu \ | |
OPENSSL_INCLUDE_DIR=/usr/include/openssl \ | |
RUST_VERSION=%%RUST-VERSION%% | |
RUN set -eux; \ |
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
fn main() { | |
let base_timeout = 30; | |
let mut counter = create_counter(base_timeout); | |
// twitter-stream-rsライブラリはsteram apiから4xxコードとかを受け取ると関数が返るのでloopで再生成してあげる必要がある。 | |
loop { | |
// この.watch()が実質先ほどのサンプルコードのrt::run(bot)に当たる。 | |
// twiqueryでは、連続失敗した時だけretryのインターバルを2倍にしていく。 | |
match twitter_client::TwitterClient::new(&config).watch() { | |
twitter_client::RESET_FLAG => counter = create_counter(base_timeout), | |
twitter_client::UNRESET_FLAG => (), |
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
fn main() { | |
const TRACK: &str = "@NAME_OF_YOUR_ACCOUNT"; | |
// `credential.json` must have the following form: | |
// {"consumer_key": "...", "consumer_secret": "...", "access_key": "...", "access_secret": "..."} | |
let mut credential_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); | |
credential_path.pop(); | |
credential_path.push("credential.json"); |
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 main | |
import ( | |
"fmt" | |
) | |
type Animal struct { | |
Cat string | |
Dog string | |
} |
NewerOlder