Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
北海道 | |
青森県 | |
岩手県 | |
宮城県 | |
秋田県 | |
山形県 | |
福島県 | |
茨城県 | |
栃木県 | |
群馬県 |
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
require 'fileutils' | |
class TermColor | |
class << self | |
# 色を解除 | |
def reset | |
c 0 | |
end | |
# カラーシーケンスを出力する |
Option Explicit | |
' アクティブシートの結合されたセルの結合を解除して,すべてのセルの値を結合元のセルの値で埋めます。 | |
Public Sub Unmerge() | |
Dim OuterCell As Variant | |
Dim InnerCell As Variant | |
Dim Value As Variant | |
Dim Updating As Boolean ' 現在のスクリーン更新状態 | |
Updating = Application.ScreenUpdating |
// Ruby = 5.times { |i| puts i } | |
// JS = (1).times(function(i){console.log(i);}) | |
Number.prototype.times = function(cb) { | |
var i = -1; | |
while (++i < this) { | |
cb(i); | |
} | |
return +this; |
あいて = %w(ぐー ちょき ぱー) | |
じゃんけん = { :"ぐー" => 0, | |
:"ちょき" => 1, | |
:"ぱー" => 2} | |
loop do | |
print 'じゃんけん... :' | |
ぷれいやーの手 = gets.chomp |
Rails flash messages with AJAX requests
paizaオンラインハッカソン lite をPythonで解いてみた.
結果 は0.01秒.
単純に枝刈りしながら深さ優先探索するだけのコードだけど, あらかじめ単価の安い順にソートしておくのと, Solver.least_cost()
あたりの処理とで出来るかぎり浅いところで枝刈りされるようにしている.
とはいえ、このコードで TestCase7が0.01秒というのはちょっと速すぎる気がしないでもない.
# -*- coding:utf-8 -*-