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 'package:rxdart/rxdart.dart'; | |
import 'package:test/test.dart'; | |
void main() { | |
test('ReplaySubjectのサンプル', () { | |
ReplaySubject<int> subject = new ReplaySubject<int>(); | |
// 1, 2をStreamに流す。しかしこの時点ではListenerがいないので配信されない | |
subject.sink.add(1); | |
subject.sink.add(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
import 'package:rxdart/rxdart.dart'; | |
import 'package:test/test.dart'; | |
void main() { | |
test('BehaviorSubjectのサンプル', () { | |
BehaviorSubject<int> subject = new BehaviorSubject<int>(); | |
// 1, 2をStreamに流す。しかしこの時点ではListenerがいないので配信されない | |
subject.sink.add(1); | |
subject.sink.add(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
import 'package:rxdart/rxdart.dart'; | |
import 'package:test/test.dart'; | |
void main() { | |
test('PublishSubjectのサンプル', () { | |
PublishSubject<int> subject = new PublishSubject<int>(); | |
// 1, 2をStreamに流す。しかしこの時点ではListenerがいないので配信されない | |
subject.sink.add(1); | |
subject.sink.add(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
クラス名 | リスナー数 | 要素の保存 | |
---|---|---|---|
PublishSubject | リスナーは常にひとりだけ(Single-Subscription) | なし | |
BehaviroSubject | 複数人同時可能(Broadcast) | 最後の1要素のみ保存 | |
ReplaySubject | 複数人同時可能(Broadcast) | (デフォルトでは)全て保存 |
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
Show hidden characters
{ | |
"presets": [ | |
[ | |
"@babel/preset-env", | |
{ | |
"targets": { | |
"node": "6.11.5" | |
} | |
} | |
] |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Action": "ec2:*", | |
"Effect": "Allow", | |
"Resource": "*" | |
}, | |
{ | |
"Effect": "Deny", |
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
const N = 100; | |
// 裏返しのカードを100枚生成 | |
const cards = Array.from({length: N}, (_unused, index) => { | |
return { is_reversed: true, number: index + 1}; | |
}); | |
// n枚目から、n+1枚ごとにフリップする(n >= 2) | |
for (let i = 1; i < cards.length; i++) { | |
for (let j = i; j < cards.length; j += (i + 1)) { | |
cards[j].is_reversed = !cards[j].is_reversed; |
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/perl -w | |
use strict; | |
use warnings; | |
use Time::Local 'timelocal'; | |
$| = 1; | |
my $config = { | |
# ログの検索条件(ユーザIDを指定することになるはず) | |
criterion => undef, | |
# 探索するApacheログの格納パス |
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
FROM gpmidi/centos-6.2 | |
#FROM debian:jessie | |
# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added | |
#RUN groupadd -r www-data && useradd -r --create-home -g www-data www-data | |
ENV HTTPD_PREFIX /usr/local/apache2 | |
ENV PATH $PATH:$HTTPD_PREFIX/bin | |
RUN mkdir -p "$HTTPD_PREFIX" \ | |
&& chown www-data:www-data "$HTTPD_PREFIX" |
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
package ResourceParser; | |
use Exporter; | |
@ISA = qw(Exporter); | |
@EXPORT = qw(read_csv_file); | |
sub read_csv_file { | |
my $filename = shift or die 'no such csv filepath'; | |
my $key_label = shift or die 'no such csv keyword'; | |
my $results = {}; |
NewerOlder