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
defines = [ | |
['"(.*)"/"(.*)"でログインする',"open,/login/show,\ntype,u,%s\ntype,p,%s\nclickAndWait,login2,"], | |
["「確認画面へ」", "//img[@alt='確認画面へ']"], [".*に遷移する", "ClickAndWait,%s,"], | |
] | |
actions = ['"id"/"password"でログインする','「確認画面へ」に遷移する'] | |
testblock = actions.map do |action| | |
testcases = defines.find_all{|d| action =~ Regexp.new('^' + d[0] + '$')}[0][1] | |
target = action.scan(/「.*」/).map{|x| defines.find_all{|d| x == d[0]}[0] }.map{|x| x[1]} + action.scan(/"(.*?)"/).flatten |
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
# package dfines | |
APP_NAME = "myapp" | |
TARGET = "hello.rb" | |
FILES = [ | |
"hello.rb", | |
"testcase.xls", | |
"lib/*" | |
] | |
# work directories |
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
module PConfig | |
def self.setup params | |
@store = params[:store] | |
end | |
def self.store | |
@store | |
end | |
end | |
class Index |
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
load './kvs.rb' | |
require 'roma-client' | |
PConfig.setup :store => Roma::Client::RomaClient.new (["localhost:11212"]) | |
data.each{ |xs| | |
p xs | |
index = xs[1] + xs[0] | |
order = Order.new "koduki" + index | |
order.isbn = xs[0] | |
order.user_id = 'koduki' |
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 java.util.List; | |
import javax.ejb.embeddable.EJBContainer; | |
import javax.naming.NamingException; | |
import javax.persistence.EntityManager; | |
import javax.persistence.Persistence; | |
import javax.persistence.Query; | |
import javax.persistence.criteria.CriteriaBuilder; | |
import javax.persistence.criteria.CriteriaQuery; | |
import javax.persistence.criteria.Predicate; | |
import javax.persistence.criteria.Root; |
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" standalone="no"?> | |
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> | |
<persistence-unit name="CustomerDBPU" transaction-type="JTA"> | |
<jta-data-source>jdbc/sample</jta-data-source> | |
<exclude-unlisted-classes>false</exclude-unlisted-classes> | |
<properties> | |
<property name="eclipselink.logging.level" value="FINE" /> | |
<property name="eclipselink.logging.timestamp" value="true" /> | |
<property name="eclipselink.logging.session" value="true" /> | |
<property name="eclipselink.logging.thread" value="true" /> |
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" standalone="no"?> | |
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> | |
<persistence-unit name="CustomerDBPU" transaction-type="JTA"> | |
<jta-data-source>jdbc/sample</jta-data-source> | |
<exclude-unlisted-classes>false</exclude-unlisted-classes> | |
<properties> | |
<property name="eclipselink.logging.level" value="FINE" /> | |
<property name="eclipselink.logging.timestamp" value="true" /> | |
<property name="eclipselink.logging.session" value="true" /> | |
<property name="eclipselink.logging.thread" value="true" /> |
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
#!/bin/zsh | |
MOBILE_SDK=${HOME}/Library/Application\ Support/Titanium/mobilesdk/osx/1.7.0.RC1 | |
ANDROID_SDK=/opt/android-sdk-mac_x86 | |
guid=`xpath tiapp.xml "//guid/text()"` 2> /dev/null | |
name=`xpath tiapp.xml "//name/text()"` 2> /dev/null | |
id=`xpath tiapp.xml "//id/text()"` 2> /dev/null | |
$MOBILE_SDK/android/builder.py install $name $ANDROID_SDK ./ $id $guid |
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
# -*- encoding: UTF-8 -*- | |
require 'time' | |
require 'twitter' | |
require 'roma/client' | |
timeline = Twitter.user_timeline('ntt_rate1').map{|s| [s.id, s.text, Time.parse(s.created_at)]} | |
rates = timeline.map do |r| | |
[ |
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
# -*- encoding: UTF-8 -*- | |
require 'mongo_mapper' | |
class Rate | |
include MongoMapper::Document | |
key :twitter_id, String | |
key :date, Date | |
key :USD, Float | |
key :EUR, Float |