This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<config name="Accelerator"> | |
<component name="TEST"> | |
{%- for i in range(total) -%} | |
{%- set no = '%05d' | format(i|int) %} | |
<pv name="Alarm{{ no }}"> | |
<description>Test {{ no }}</description> | |
<annunciating>true</annunciating> | |
</pv> | |
{%- endfor %} |
This file contains hidden or 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 subprocess import Popen | |
from flask import Flask, request, jsonify | |
app = Flask(__name__) | |
methods = ('GET', 'POST') | |
app_paths = {"chrome": "/Applications/Google Chrome.app" } | |
This file contains hidden or 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 unittest | |
class TestClass(unittest.TestCase): | |
def setUp(self): | |
""" | |
Initialization on each test | |
""" | |
def tearDown(self): | |
""" |
This file contains hidden or 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
Vagrant.configure("2") do |config| | |
config.vm.define "vm1" do |vm1| | |
vm1.vm.box = "centos/7" | |
vm1.vm.box_version = "1702.01" | |
vm1.vm.network :private_network, ip: "192.168.50.10", virtualbox__intnet: "pnet1" | |
vm1.vm.synced_folder ".", "/vagrant", type:"virtualbox" | |
vm1.vm.provision "shell" do |s| | |
s.inline = "yum -y update" | |
s.privileged = true | |
end |
This file contains hidden or 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 os | |
import subprocess | |
import atexit | |
import time | |
class IocControl(object): | |
server_port = 12782 | |
repeater_port = 12783 | |
def __init__(self, cpath="softIoc", arg_list=["-d","test.db"], verbose=False): |
This file contains hidden or 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 fabric.api import * | |
from fabric.contrib.files import exists | |
from cuisine import package_ensure, select_package, dir_ensure | |
select_package('yum') | |
rpms = ["wget", "readline", "readline-devel"] | |
def setup_rpms(): | |
for rpm in rpms: |
This file contains hidden or 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 Tkinter as tk | |
class Model(): | |
def __init__(self): | |
self.mode = tk.IntVar() | |
class NavbarFrm(tk.Frame): | |
def __init__(self, master=None, mode_var=None): |
This file contains hidden or 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <fcntl.h> | |
#include <sys/mman.h> | |
#include <unistd.h> | |
// レジスタブロックの物理アドレス | |
#define BCM2708_PERI_BASE 0x20000000 | |
#define GPIO_BASE (BCM2708_PERI_BASE + 0x200000) /* GPIO */ | |
#define PADS_BASE (BCM2708_PERI_BASE + 0x100000) /* PADS */ |
This file contains hidden or 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 tornado import gen, ioloop, httpserver | |
from tornado.web import RequestHandler, Application, url | |
class MainHandler(RequestHandler): | |
def get(self): | |
self.write('<a href="%s">link to story 1</a>' % | |
self.reverse_url("story", "1")) | |
class StoryHandler1(RequestHandler): | |
def initialize(self, db): |
This file contains hidden or 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 tornado import gen, ioloop, queues | |
q = queues.Queue(maxsize=2) | |
@gen.coroutine | |
def consumer(): | |
while True: | |
item = yield q.get() | |
try: | |
print('Doing work on %s' % item) |
NewerOlder