http://vim-users.jp/2010/08/hack166/
- input
a
bbb
ccccccc
var groupId = document.getElementById('groupId').value; | |
var artifactId = document.getElementById('artifactId').value; | |
var name = document.getElementById('name').value; | |
var description = document.getElementById('description').value; | |
var packageName = document.getElementById('packageName').value; | |
var type = document.getElementById('type').value; | |
var packaging = document.getElementById('packaging').value; | |
var javaVersion = document.getElementById('javaVersion').value; | |
var language = document.getElementById('language').value; | |
var bootVersion = document.getElementById('bootVersion').value; |
// helper | |
def shouldFail(Class klass, Closure clos) { | |
try { | |
clos.call() | |
} catch (Throwable e) { | |
assert e.class == klass : "expected: ${klass.name}, but actual: ${e.class.name}" | |
return | |
} | |
assert false : "expected: ${klass.name}, but nothing thrown" | |
} |
def arrange(input) { | |
def requests = input.split(/\|/).toList() | |
def result = [:].withDefault { [] } | |
(0..<5).each { index -> | |
requests.clone().each { request -> | |
def (student, preferences) = request.split("_") | |
def day = preferences[index] | |
if (result[day].size() < 4) { | |
result[day] << student.toInteger() | |
requests.remove(request) |
http://tech-gym.com/2012/07/%E6%9C%AA%E5%88%86%E9%A1%9E/786.html | |
1234567 x | |
1 lhikoav | |
2 rqsczlp | |
3 uqalnfo | |
4 tykajeh | |
5 ahitsyd | |
6 efoptxn | |
7 ruzwyve |
#!/usr/bin/env bash | |
#>******************************************************* | |
# THIS FILE WAS AUTO-GENERATED BY ATLASSIAN STASH. | |
# DO NOT MODIFY UNDER ANY CIRCUMSTANCE. | |
#>******************************************************* | |
# | |
# Firing a job on Jenkins | |
# | |
read oldrev newrev refname |
@Grab('net.htmlparser.jericho:jericho-html:3.3') | |
import net.htmlparser.jericho.*; | |
// http://www.javaroad.jp/servletjsp/sj_jsp1.htm | |
Source source = new Source(""" | |
<HTML> | |
<BODY> | |
<%-- (1)pageディレクティブでJSPプログラムの特性を定義 --%> | |
<%@ page language="java" | |
contentType="text/html; charset=Windows-31J" %> |
http://vim-users.jp/2010/08/hack166/
a
bbb
ccccccc
class Fibonacci { | |
def calc = { n -> | |
return (n == 0) ? 0 : | |
(n == 1) ? 1 : | |
call(n - 1) + call(n - 2) | |
} | |
static void main(String[] args) { | |
def num = args[0] as int | |
println "Fib($num) = ${new Fibonacci().calc(num)}" |
#!/bin/bash | |
# Constant | |
GPIO_DIR=/sys/class/gpio | |
SWITCH_GPIO_NUM=24 | |
LED_GPIO_NUM=25 | |
# Tear down for previous | |
echo $SWITCH_GPIO_NUM > $GPIO_DIR/unexport | |
echo $LED_GPIO_NUM > $GPIO_DIR/unexport |
http://www.slideshare.net/makingx/grails-30-spring-boot
$ java -jar target/jggug-helloworld-1.0.0-SNAPSHOT.jar --spring.config.name=config`
とやることで同一ディレクトリのconfig.propertiesを一括で読み込める。 アプリケーションプロセスのロール?ごとにファイルを用意すれば良さそう。