| 更新: | 2017-05-09 |
|---|---|
| 作者: | @voluntas |
| バージョン: | 3.14 |
| URL: | http://voluntas.github.io/ |
MQTT をググって調べた人向け
| import contextlib | |
| import time | |
| import chainer | |
| import chainer.functions as F | |
| import cupy | |
| @contextlib.contextmanager | |
| def timer(message): |
| import numpy as np | |
| class InvertedIndex(object): | |
| def __init__(self, x): | |
| self.J = np.argsort(x) | |
| D = np.ediff1d(x[self.J], to_begin=1, to_end=1) | |
| self.I = np.repeat(np.arange(len(D)), D) | |
| def __getitem__(self, k): |
| 更新: | 2017-05-09 |
|---|---|
| 作者: | @voluntas |
| バージョン: | 3.14 |
| URL: | http://voluntas.github.io/ |
MQTT をググって調べた人向け
This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.
A file below this one contains the steps for doing this with Travis CI. However, these days I recommend GitHub Actions, for the following reasons:
| def toCamelCase(String string) { | |
| String result = "" | |
| string.findAll("[^\\W]+") { String word -> | |
| result += word.capitalize() | |
| } | |
| return result | |
| } | |
| afterEvaluate { project -> | |
| Configuration runtimeConfiguration = project.configurations.getByName('compile') |
| static BOOL PSPDFIsDevelopmentBuild(void) { | |
| #if TARGET_IPHONE_SIMULATOR | |
| return YES; | |
| #else | |
| static BOOL isDevelopment = NO; | |
| static dispatch_once_t onceToken; | |
| dispatch_once(&onceToken, ^{ | |
| // There is no provisioning profile in AppStore Apps. | |
| NSData *data = [NSData dataWithContentsOfFile:[NSBundle.mainBundle pathForResource:@"embedded" ofType:@"mobileprovision"]]; | |
| if (data) { |
| // from http://scratch99.com/web-development/javascript/convert-bytes-to-mb-kb/ | |
| function bytesToSize(bytes) { | |
| var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB']; | |
| if (bytes == 0) return 'n/a'; | |
| var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024))); | |
| if (i == 0) return bytes + ' ' + sizes[i]; | |
| return (bytes / Math.pow(1024, i)).toFixed(1) + ' ' + sizes[i]; | |
| }; |