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 IntelliSense to learn about possible attributes. | |
// Hover to view descriptions of existing attributes. | |
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "執行目前檔案", | |
"type": "python", | |
"request": "launch", |
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 React, { Component } from 'react' | |
class Tile extends Component { | |
render() { | |
const { type, colors } = this.props | |
switch (type) { | |
case '1': | |
return ( | |
<div style={{ | |
width: 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
var loopback = require('loopback'); | |
// HINT(s): | |
// Getting the app object: http://docs.strongloop.com/display/public/LB/Working+with+LoopBack+objects | |
// From a model script: http://docs.strongloop.com/display/public/LB/Working+with+LoopBack+objects#WorkingwithLoopBackobjects-Fromamodelscript | |
module.exports = function(StoreModel) { | |
StoreModel.prototype.instanceRemoteMethodSignature = function(cb) { | |
console.log('print this instance object: ', this); | |
cb(null); | |
}; |
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 | |
# Usage: | |
# python plot.py [end_record] | |
# python plot.py [start_record] [end_record] | |
import sys | |
import matplotlib as mpl | |
import matplotlib.pyplot as plt | |
import numpy as np |
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
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
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 sys | |
import matplotlib as mpl | |
import matplotlib.pyplot as plt | |
import numpy as np | |
mpl.rcParams['agg.path.chunksize'] = 10000 | |
FILES = [ | |
'./Channel4_20161004083134734.csv', |
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 _mysql | |
import time | |
FILE_NAMES = [ | |
'C:\Users\go-creating\Desktop\data-mining-hw1\dataset\data.log-20160918', | |
'C:\Users\go-creating\Desktop\data-mining-hw1\dataset\data.log-20160919', | |
'C:\Users\go-creating\Desktop\data-mining-hw1\dataset\data.log-20160920', | |
'C:\Users\go-creating\Desktop\data-mining-hw1\dataset\data.log-20160921', | |
'C:\Users\go-creating\Desktop\data-mining-hw1\dataset\data.log-20160922', | |
'C:\Users\go-creating\Desktop\data-mining-hw1\dataset\data.log-20160923', |
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
// Usage | |
var _r = new DollarRecognizer(); | |
if (_points.length >= 10) { | |
var isUseProtractor = false; | |
var result = _r.Recognize(_points, isUseProtractor); | |
console.log("Result: " + result.Name + " (" + round(result.Score,2) + ")."); | |
} else { | |
console.log("Too few points made. Please try again."); | |
} |
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 React from 'react'; | |
import Router from 'react-router'; | |
import routes from '../routes'; | |
Router.run(routes, Router.HistoryLocation, (Handler) => { | |
React.render(<Handler />, document.getElementById('react-container')); | |
}); |
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 SubnetForm(forms.Form): | |
# ...略 | |
@staticmethod | |
def int_to_human(address): | |
# ...略 | |
return ".".join(str(int(part.ljust(8, "0"), 2)) for part in parts) | |
def get_network_information(self): | |
return ({ | |
"address": self.int_to_human(address), |
NewerOlder