###一番シンプル メソッドとかも利用せずに、ただただインスタンス変数を呼び出して計算。
###クラス外メソッドを利用したやつ これがいいかも?シンプルで汎用性もある。 クラス外メソッド
###クラス変数とクラスメソッドを使うやつ
const request = require('request'); | |
const host = 'http://localhost:3000'; | |
const getBook = () => { | |
return new Promise((resolve, reject) => { | |
request.get(`${host}/books/1`, (err, res, body) => { | |
if (err) { | |
reject(err) |
require 'sinatra' | |
require 'sinatra/reloader' | |
require 'json' | |
require 'net/http' | |
require 'uri' | |
require 'redis' | |
uri = URI.parse(ENV['REDISTOGO_URL']) | |
redis = Redis.new(host: uri.host, port: uri.port, password: uri.password) |
require 'json' | |
require 'net/http' | |
require 'uri' | |
require 'redis' | |
def send_notification(text) | |
request_url = ENV['INCOMING_URL'] | |
uri = URI.parse(request_url) | |
https = Net::HTTP.new(uri.host, uri.port) |
#! /usr/bin/env ruby | |
require 'date' | |
require 'uri' | |
today_speaker = ARGV[0] | |
tommorow_speaker = ARGV[1] | |
client = 'client@ml.kayac.com' | |
d = Date.today.strftime('%Y年%m月%d日') |
[mysqld] | |
datadir=/var/lib/mysql | |
socket=/var/lib/mysql/mysql.sock | |
# Disabling symbolic-links is recommended to prevent assorted security risks | |
symbolic-links=0 | |
# Settings user and group are ignored when systemd is used. | |
# If you need to run mysqld under a different user or group, | |
# customize your systemd unit file for mysqld according to the | |
# instructions in http://fedoraproject.org/wiki/Systemd |
from selenium import webdriver | |
import lxml.html | |
import time | |
driver = webdriver.PhantomJS() | |
driver.get("http://hesonogoma.com/stocks/japan-all-stock-data.html") | |
data = driver.page_source | |
root = lxml.html.fromstring(data) | |
driver.find_element_by_xpath('//*[@id="japan-all-stock-data_length"]/label/select/option[7]').click() | |
time.sleep(1) |
javascript:document.xpath = function (expression) { ret = document.evaluate(expression, document, null, XPathResult.ANY_TYPE, null); switch (ret.resultType) { case 1: return ret.numberValue; case 2: return ret.stringValue; case 3: return ret.booleanValue; case 4: case 5: a = []; while (e = ret.iterateNext()) { a.push(e); } ; return a; default: return ret; }};!function (d, f, s) { s = d.createElement("script"); s.src = "//j.mp/1bPoAXq"; s.onload = function () { f(jQuery.noConflict(1)) }; d.body.appendChild(s)}(document, function ($) {});$.ajax({ type: 'GET', url: location.href.indexOf('//m') > 0? document.xpath('//*[@id="content"]/div[3]/div[1]/div[2]/script[2]')[0].src : document.xpath('//*[@id="videoPlayer"]/script[3]')[0].src, dataType: 'html', success: function (data) { var base = data.toString().match(/ |
using UnityEngine; | |
using System.Collections; | |
using System.Net; | |
using System.Net.Sockets; | |
using System.Text; | |
using System.Threading; | |
public class udp_recieve_gui : MonoBehaviour { | |
int LOCA_LPORT = 22222; | |
static UdpClient udp; |
# coding: UTF-8 | |
import numpy as np | |
import cv2 | |
import multiprocessing as mp | |
from random import randint | |
def rect(f, num, features_point): | |
cv2.rectangle(f, (10, 10), (50, 50), (randint(0, 255), randint(0, 255), randint(0, 255)), 3) | |
cv2.imwrite(str(num) + '.jpg', f) |