更新: | 2024-04-16 |
---|---|
作者: | @voluntas |
バージョン: | 2024.1 |
URL: | https://voluntas.github.io/ |
概要
<?php | |
//Composerでstripe/stripe-php をrequire済み | |
require_once __FILE__. './jp.php'; | |
try{ | |
Stripe\Stripe::setApiKey('sk_test_YOUR_KEY'); | |
Stripe\Charge::create([]); | |
}catch(Stripe\Error\Base $e) { | |
$err = $e->getJsonBody()['error']; | |
if(key_exists('code', $err)) { |
# Time Series Testing | |
import keras.callbacks | |
from keras.models import Sequential | |
from keras.layers.core import Dense, Activation, Dense, Dropout | |
from keras.layers.recurrent import LSTM | |
# Call back to capture losses | |
class LossHistory(keras.callbacks.Callback): | |
def on_train_begin(self, logs={}): | |
self.losses = [] |
import pandas as pd | |
from random import random | |
flow = (list(range(1,10,1)) + list(range(10,1,-1)))*1000 | |
pdata = pd.DataFrame({"a":flow, "b":flow}) | |
pdata.b = pdata.b.shift(9) | |
data = pdata.iloc[10:] * random() # some noise | |
import numpy as np |
""" From: http://danielhnyk.cz/predicting-sequences-vectors-keras-using-rnn-lstm/ """ | |
from keras.models import Sequential | |
from keras.layers.core import TimeDistributedDense, Activation, Dropout | |
from keras.layers.recurrent import GRU | |
import numpy as np | |
def _load_data(data, steps = 40): | |
docX, docY = [], [] | |
for i in range(0, data.shape[0]/steps-1): | |
docX.append(data[i*steps:(i+1)*steps,:]) |
更新: | 2024-04-16 |
---|---|
作者: | @voluntas |
バージョン: | 2024.1 |
URL: | https://voluntas.github.io/ |
概要
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Description": "Misakai CoreOS Cluster for EC2: http://coreos.com/docs/running-coreos/cloud-providers/ec2/", | |
"Mappings" : { | |
"RegionMap" : { | |
"eu-central-1" : { | |
"AMI" : "ami-3a093a27" | |
}, |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
今回の問題は、StrutsでHttpリクエストパラメータをFormに入れる際に、commons-beanutilsの | |
BeanUtils.populateを使っていることに起因する。 | |
populateの中で使われている、BeanUtils.setPropertyはノーチェックでBeanのプロパティを探すので、 | |
プロパティ名を"class.classLoader.xxx"のように書いておくと、BeanのgetClassをよんで、 | |
ClassオブジェクトのgetClassLoaderをよんで、…と連鎖してクラスローダが取得される。 | |
そしてドットでつないだ最後のプロパティ名で値をセットにいくので、TomcatのWebAppClassLoaderが | |
途中でゲットされてしまうと、Struts2の脆弱性と同じ問題が発生してしまう。 |
更新: | 2025-04-08 |
---|---|
作者: | @voluntas |
バージョン: | 2025.2 |
url: | https://voluntas.github.io/ |
概要