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
I am attesting that this GitHub handle tsaikoga is linked to the Tezos account tz1hincypNgSCEXBWxDhctvvqDaaTH8WZf42 for tzprofiles | |
sig:edsigu4GSac8nSMEiCxkoo3bEoJNgA1R6etb3MMATrTg8u6aB35RzYMy4gqSkbfmVZzSnUCJNSnCRRQrtnUCVkbvfKBCmZA3Ham |
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
def find_cointegrated_pairs(dataframe): | |
""" | |
判断协整关系的函数 | |
返回协整性p值矩阵,协整性强的股票对 | |
:param :dataframe | |
:return :pvalue_matrix, :pairs | |
""" | |
# 得到DataFrame长度 | |
n = dataframe.shape[1] | |
# 初始化p值矩阵 |
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 matplotlib.pyplot as plt | |
import numpy as np | |
def view_classify(img, ps, version="MNIST"): | |
''' Function for viewing an image and it's predicted classes. | |
''' | |
ps = ps.data.numpy().squeeze() | |
fig, (ax1, ax2) = plt.subplots(figsize=(6,9), ncols=2) | |
ax1.imshow(img.resize_(1, 28, 28).numpy().squeeze()) |
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
#!/bin/sh | |
param=$1 | |
start() { | |
fpms=`ps aux | grep -i "php-fpm" | grep -v grep | awk '{print $2}'` | |
if [ ! -n "$fpms" ]; then | |
php-fpm |
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
# check the listening ports | |
# 查看服务器中正在监听的端口: | |
netstat -tupln | |
# check if can connect the port of the host server | |
# 本地查看远程服务器的端口开启是否能够访问 | |
telnet www.xxx.com 3306 | |
# trace how many routes hops | |
# 查看访问的地址经过多少路由 |
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
def hurst(ts): | |
""" | |
Return the Hurst Exponent of the time series vector ts | |
""" | |
# Create the range of lag values | |
lags = range(2, 100) | |
# Calculate the array of the variance of the lagged differences | |
tau = [sqrt(std(substract(ts[lag:], ts[:-lag]))) for lag in lags] | |
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
per_page = 100 | |
page = 0 | |
total_page = (Product.count.to_f / per_page).ceil | |
total_page.times do | |
products = Product.limit(per_page).offset(page * per_page) | |
bill_items = bill_inventory_valuation_details products # 符合条件的采购入库单数据,此方法的查找也必须对 products 进行批量查找 | |
sell_items = sell_inventory_valuation_details products # 符合条件的销售出库数据 | |
package_items = package_inventory_valuation_details products # 异常出库数据 | |
adjust = adjust_inventory_valuation_details products # 调整仓库数据 |
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
class RenameOldOrderAddressRelatedColumn < ActiveRecord::Migration | |
def up | |
change_table(:orders, :bulk => true) do |t| | |
t.rename :order_status_code_id, :state | |
t.remove :in_process | |
[:first_name, | |
:last_name, | |
:country, | |
:state].each do |column| | |
t.rename "shipping_#{column}", "origin_shipping_#{column}" |