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 tensorflow as tf | |
import numpy as np | |
from tensorflow.examples.tutorials.mnist import input_data | |
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) | |
x = tf.placeholder(tf.float32, [None, 784]) | |
W = tf.Variable(tf.zeros([784, 10])) | |
b = tf.Variable(tf.zeros([10])) | |
y = tf.nn.softmax(tf.matmul(x, W) + b) |
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
cd vis | |
python -m SimpleHTTPServer & | |
th eval.lua -model model_id1-501-1448236541.t7_cpu.t7 -image_folder imgs/ -gpuid -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
# -*- coding: utf-8 -*- | |
import csv | |
f = open('Page1-表格 1.csv', 'r') | |
for row in csv.DictReader(f): | |
original = row['客戶全稱'] | |
new = original.split("-") | |
print new[0] | |
f.close() |
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
public function getSiteInfo(Request $request) { | |
$sites = Site::where("site_category_id", $request->site_category_id)->get(); | |
foreach ($sites as $key => $value) { | |
$sites[$key]->category; | |
$currentSite = $sites[$key]; | |
$currentRental = $currentSite->currentRental | |
->where('rental_start_date', '<=', $request->rental_start_date) |
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
$.ajax({ | |
url: '', | |
type: 'GET', | |
data: { | |
}, | |
error: function(xhr) { | |
alert('Ajax request 發生錯誤'); | |
}, | |
success: function(response) { | |
} |
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 sklearn.neural_network import MLPClassifier | |
X = [] | |
y = [] | |
with open('letter-recognition.data') as f: | |
lines = f.readlines() | |
for line in lines: | |
line = line.replace("\n", "") | |
parseLine = line.split(",") | |
y.append(parseLine[0]) |
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/bash | |
# add bridge | |
ovs-vsctl add-br ovsbr0 | |
#add hosts | |
docker rm container1 | |
docker run --name=container1 --cap-add=NET_ADMIN --net='none' -itd busybox /bin/sh | |
docker rm container2 | |
docker run --name=container2 --cap-add=NET_ADMIN --net='none' -itd busybox /bin/sh |
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
javascript:(function()%7Bfunction%20callback()%7B(function(%24)%7Bvar%20jQuery%3D%24%3Balert%20%3D%20function()%20%7B%7D%3Bwindow.alert%20%3D%20function()%20%7B%7D%3Bvar%20units%20%3D%20%5B%22200000000A%22%2C%22201000000A%22%2C%22202000000A%22%2C%22202010000A%22%2C%22301000000A%22%2C%22301000100G%22%2C%22301000200G%22%2C%22301020000G%22%2C%22301020700G%22%2C%22301020800G%22%2C%22301020900G%22%2C%22301021000G%22%2C%22301021100G%22%2C%22301021200G%22%2C%22301021300G%22%2C%22301021400G%22%2C%22301023400G%22%2C%22301060000C%22%2C%22301060100C%22%2C%22301060200C%22%2C%22301060300C%22%2C%22301060400C%22%2C%22313000000G%22%2C%22313010000G%22%2C%22313010100G%22%2C%22313020000G%22%2C%2231302101DG%22%2C%22313022000G%22%2C%22313022100G%22%2C%22313022300G%22%2C%22313022400G%22%2C%22313022500G%22%2C%22313022600G%22%2C%22313022700G%22%2C%22313022800G%22%2C%22313022900G%22%2C%22313023000G%22%2C%22313023100G%22%2C%22313023200G%22%2C%22313023300G%22%2C%22313023400G%22%2C%22313023600G%22%2C%22313023700G%22%2C%22313023800G%22%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
from sqlite import Gp2014 | |
from tqdm import tqdm | |
if __name__ == '__main__': | |
gp = Gp2014.select().limit(20) | |
for row in gp: | |
print(row.gantryfrom) #取得出發點 | |
print(row.gantryto) #取得終點 | |
print(row.vehicletype) #取得車種 |
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
"use strict" | |
Object.defineProperty(exports, "__esModule", { | |
value: true, | |
}) | |
exports.DirectionsRenderer = undefined | |
var _defineProperty2 = require("babel-runtime/helpers/defineProperty") | |
var _defineProperty3 = _interopRequireDefault(_defineProperty2) |
OlderNewer