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
states = ('Healthy', 'Fever') | |
observations = ('normal', 'cold', 'dizzy') | |
start_probability = {'Healthy': 0.6, 'Fever': 0.4} | |
transition_probability = { | |
'Healthy' : {'Healthy': 0.7, 'Fever': 0.3}, | |
'Fever' : {'Healthy': 0.4, 'Fever': 0.6}, | |
} | |
emission_probability = { | |
'Healthy' : {'normal': 0.5, 'cold': 0.4, 'dizzy': 0.1}, | |
'Fever' : {'normal': 0.1, 'cold': 0.3, 'dizzy': 0.6}, |
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.time.LocalDate; | |
public class WhichDayOfYear { | |
public static void main(String[] args) { | |
//获取系统时间 | |
LocalDate today = LocalDate.of(2018, 8, 13); | |
//%tj表示一年中的第几天 | |
String strDate =String.format("今天是今年的第%tj天!!",today); | |
//输出时间 | |
System.out.println(strDate); |
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.CountDownLatch; | |
public class CountDownLatchDemo { | |
public static void main(String[] args) { | |
final CountDownLatch gate = new CountDownLatch(3); | |
Thread t1 = new Thread(){ | |
public void run() { | |
try { | |
Thread.sleep(3000); |
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
#! /usr/bin/env python | |
""" | |
Reads Darknet config and weights and creates Tensorflow model. | |
""" | |
import argparse | |
import configparser | |
import io |
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
Red [ | |
author: "Wayne Cui" | |
description: {Should first download the mnist data from http://yann.lecun.com/exdb/mnist/} | |
] | |
train-image-filename: "data/train-images-idx3-ubyte" | |
train-label-filename: "data/train-labels-idx1-ubyte" | |
test-image-filename: "data/t10k-images-idx3-ubyte" | |
test-label-filename: "data/t10k-labels-idx1-ubyte" |
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
Red [] | |
f: function[s][ | |
print 10 * s | |
] | |
f1: function[s][ | |
print 100 * s | |
] |
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
Rebol [ | |
title: %login2douban.reb | |
date: 13-Jan-2015 | |
author: "Graham Chiu / Cui Wen" | |
purpose: {login to douban.com} | |
description: { based on Graham Chiu's login2so.reb: https://github.com/gchiu/Rebol3/blob/master/scripts/login2so.reb} | |
] | |
print "loading modified prot-http.r3" | |
do https://raw.githubusercontent.com/gchiu/Rebol3/master/protocols/prot-http.r3 |
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
Rebol [ | |
Title: "Parse file uploads data by HTTP" | |
Author: "Cui Wen" | |
Description: { | |
simulate file-uploading via curl: | |
curl --form upload=@D:/a.txt --form upload=@D:/a.jpg --form press=OK http://localhost:8080 | |
} | |
] | |
server: open tcp://:8080 |
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
Rebol [ | |
Title: {remove comments from JS source files} | |
Author: "Cui Wen" | |
File: %comment-cleaner.reb | |
Version: 0.1.0 | |
Tabs: 4 | |
] | |
data: { | |
/** |
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
>> type? f: func[][print "foo"] | |
== function! | |
>> type? get 'f | |
== function! | |
>> type? f | |
"foo" | |
== unset! |
NewerOlder