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 python3 | |
import numpy as np | |
class Dense: | |
def __init__(self, input_width, width): | |
self._W = np.random.normal(size=(input_width, width)) | |
self._b = np.random.normal(size=(1, width)) | |
self._X = None |
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 bash | |
from subprocess import Popen, PIPE | |
import json | |
# init.json be like : | |
''' | |
{"initdata": | |
{ | |
"game": { |
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 <stdlib.h> | |
#include <string.h> | |
#include <stdio.h> | |
#include <err.h> | |
#include <fcntl.h> | |
#include <sys/stat.h> | |
void cat(int rfd) { | |
int wfd; | |
static char *buf; |
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 <stdlib.h> | |
#include <string.h> | |
#include <stdio.h> | |
#include <err.h> | |
#include <fcntl.h> | |
#include <sys/stat.h> | |
void cat(int rfd) { | |
int wfd; | |
static char *buf; |
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
from manimlib.imports import * | |
class Playground(Scene): | |
def construct(self): | |
semicircle = Arc(fill_opacity=1, angle=PI/2) | |
self.play(FadeIn(semicircle)) | |
def Range(in_val,end_val,step=1): | |
return list(np.arange(in_val,end_val+step,step)) |
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
from manimlib.once_useful_constructs.region import Region | |
# PMobject 有 filter_out 方法,Circle 没有 | |
class SquareToCircle(Scene): | |
def construct(self): | |
circle = Circle() | |
a = ORIGIN | |
pointB = Dot(point=np.array([-0.5042, 0.8636, 0])) | |
centerB = np.array([-0.7521, 0.4318,0]) | |
semi_circleA = Arc(angle=np.pi, radius=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
import requests | |
import json | |
import pandas as pd | |
from datetime import datetime | |
def get_data(): | |
url = 'https://plugin.sosobtc.com/widgetembed/data/period' | |
data = requests.get(url, {'symbol':'yunbiethcny', 'step':86400}) | |
return json.loads(data.text) |
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
Manipulate[ | |
Module[ | |
{m={-2000,1500}, | |
n={8000, 1500}, | |
radius=15000 | |
}, | |
yuan[\[Alpha]_]={radius* Cos[\[Alpha]],radius*Sin[\[Alpha]]}+m; | |
With[{p=yuan[\[Alpha]]}, | |
E=m+t*{p-m}; | |
ts=Solve[ |
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 <vector> | |
#include <iostream> | |
using std::vector; | |
void process(const vector<int>& vec1, vector<int>& vec2) { | |
unsigned int i = 0; | |
while(i < vec1.size()) { | |
if (vec1[i] == 1 && vec1[i+1] == 2) { | |
// do not copy and skip the other 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
create table test_partition ( | |
id int, | |
name string, | |
no int) | |
partitioned by(dt string) | |
row formatdelimited | |
fieldsterminated by ',' | |
stored astextfile; | |
load data local inpath '/home/zhangxin/hive/test_hive.txt' overwrite intotabletest_partition partition (dt='2012-03-05'); |