Skip to content

Instantly share code, notes, and snippets.

# -*- coding: utf-8 -*-
def func():
hw = map(int, raw_input().split())
h = hw[0]
w = hw[1]
display = []
for i in range(h):
# -*- coding: utf-8 -*-
def func():
h, w = map(int, raw_input().split())
display = []
for i in xrange(h):
row = raw_input()
display.append(row)
@lethe2211
lethe2211 / static_pages_controller.rb
Last active August 29, 2015 14:01
app/controllers/static_pages_controller.rb
# -*- coding: utf-8 -*-
require 'open3'
require 'json'
class StaticPagesController < ApplicationController
# 検索画面に相当するアクション
def search
end
# 検索結果画面に相当するアクション
@lethe2211
lethe2211 / main.js
Last active August 29, 2015 14:01
app/assets/javascripts/main.js
$(document).ready(function(){
// 省略 //
// JSONの読み込み(static_pages/get_citationを呼び出すことで,変数dataにJSONが返ってくる)
var data = $.getJSON('get_citation',function(data){
sys.graft({nodes:data.nodes, edges:data.edges})
});
// 省略 //
@lethe2211
lethe2211 / routes.rb
Created May 20, 2014 01:02
config/routes.rb
Search::Application.routes.draw do
get "static_pages/search"
get "static_pages/result"
get "static_pages/get_citation"
end
# -*- coding: utf-8 -*-
require 'json'
require 'fileutils'
=begin
JSONファイルを用いたファイルキャッシュ
=end
class JsonCache
def initialize(dir: "cache/")
lethe@target$ emacs /etc/ssh/sshd_config
# Package generated configuration file
# See the sshd_config(5) manpage for details
# Waht ports, IPs and protocols we listen for
Port 22
Port 22222 # 書き足す
# (略)
lethe@target$ sudo /etc/init.d/ssh restart
# -*- coding: utf-8 -*-
def func():
m = int(raw_input())
n = int(raw_input())
q = []
r = []
for i in range(n):
tmp_q, tmp_r = map(int, raw_input().split())