###一番シンプル メソッドとかも利用せずに、ただただインスタンス変数を呼び出して計算。
###クラス外メソッドを利用したやつ これがいいかも?シンプルで汎用性もある。 クラス外メソッド
###クラス変数とクラスメソッドを使うやつ
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |
# coding:utf-8 | |
import csv | |
from sqlalchemy import create_engine, MetaData, Table, Column, Integer, String | |
from collections import OrderedDict | |
class myTable: | |
def __init__(self): | |
pass |
class Person | |
def initialize(math,english) | |
#インスタンス変数に代入 | |
@math = math | |
@english = english | |
end | |
#外からアクセスできるように(これをしないと、taro.mathとかで呼び出せない) | |
attr_accessor :math, :english |
class Person | |
def initialize(math,english) | |
@math = math | |
@english = english | |
end | |
#外からアクセスできるように(これをしないと、taro.mathとかで呼び出せない) | |
attr_accessor :math, :english | |
end |
class Person | |
#どんなPersonがいるかをリストに入れる | |
#@@はクラス変数といい、クラスで共有される変数 | |
@@person = [] | |
def initialize(math,english) | |
@math = math | |
@english = english | |
#インスタンスが生成されたときにこのメソッドが呼ばれるので | |
#リストに入れておく。selfというのは、インスタンス自身のこと |
# 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) |
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; |
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(/ |
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) |