Skip to content

Instantly share code, notes, and snippets.

Hello

Hello World

gist install test.

PHP演習課題2 - CLIアプリケーション編

メモ管理アプリケーションを開発します。

以下の機能を持つPHPプログラム(memo.php)を開発します。

コマンドプロンプトで動作するCLIアプリケーションとして開発します。

1. メモ作成機能

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import numpy as np
import matplotlib.pyplot as plt
class NeuralNetwork:
def __init__(self):
self.hw = 0.01 * np.random.randn(50, 4)
self.hb = np.zeros(50)
self.ow = 0.01 * np.random.randn(3, 50)
self.ob = np.zeros(3)
import tensorflow as tf
import numpy as np
features = [tf.contrib.layers.real_valued_column("x", dimension=1)]
estimator = tf.contrib.learn.LinearRegressor(feature_columns=features)
x = np.array([1., 2., 3., 4.])
y = np.array([0., -1., -2., -3.])
import numpy as np
import tensorflow as tf
W = tf.Variable([.3], tf.float32)
b = tf.Variable([-.3], tf.float32)
x = tf.placeholder(tf.float32)
model = W * x + b
y = tf.placeholder(tf.float32)
loss = tf.reduce_sum(tf.square(model - y))
class User < ActiveRecord::Base
attr_accessible :name, :password, :status
end
@murayama333
murayama333 / gist:1087427
Created July 17, 2011 10:18
Textmate web2py bundle-command
#!/usr/bin/env python
import sys
import re
import os
dir = os.environ["TM_DIRECTORY"]
if dir.find("controllers") != -1:
#controllers
re_symbol = re.compile(r"^(\s*)(?:class|def)\s+([a-zA-Z_][a-zA-Z_0-9]*)\s*[\:\(]")
# -*- coding: undecided -*-
require "http_util"
#なんちゃってDSL
browse http.twitter.com
browse http.yahoo.co.jp
require "open-uri"
class HttpUtil
def self.method_missing(method_name, *args)
HttpUtil.new(method_name)
end
def method_missing(method_name, *args)
@buf << method_name
self