我想做一个河内塔.
我想把控制部分放在中心,所以我检查了Bootstrap并使用class="center-block",但没有任何工作,如下:没有中心http://wuzhiwei.net/problems/no-center.png
<div class="container">
<div class="panel panel-default">
<div class="panel-heading">Hanoi Tower</div>
<div class="panel-body">
<canvas id="stage" class="center-block" width="400" height="220" style="border:1px black solid "></canvas>
<div id="ctrl" class="center-block">
<label for="numsel">Disc Number?</label>
<select id="numsel">
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
</select>
<button class="btn btn-default" id="start" value="start">Start</button>
<label for="step">Step?</label> <span class="badge" id="step">0</span>
</div>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
.panel {
min-width:400px;
}
#stage {
margin-bottom:15px;
}
#start {
margin-left:20px;
margin-right:20px;
}
Run Code Online (Sandbox Code Playgroud)
如何让这个div <div id="ctrl" class="center-block">居中?
What I want to do is really simple. I want use Lua to check lines in a Plist file.
Let's say if a line in Plist, is <integer>-1.00</integer>, I need to cut the .00 off to make it be <integer>-1</integer>.
I use a function to read the whole file content and do line by line check and replace.
local function doLineClean( cont )
newcont = ''
string.gsub( cont, "(.-)\r?\n", function(line) …Run Code Online (Sandbox Code Playgroud) 假设我要在'Core.dll'之后删除'git pull',所以我写了一个钩子。
import os
dir = os.path.dirname(__file__)
try:
os.remove(os.path.abspath(dir+os.sep+".."+os.sep+".."+os.sep+"Assets"+os.sep+"Plugins"+os.sep+"Core.dll"))
except OSError:
pass
Run Code Online (Sandbox Code Playgroud)
假设挂钩路径为'E:\client\.git\hooks',我要删除的文件位于'E:\client\Assets\Plugins\Core.dll'.
我认为我的方法很愚蠢,是否有任何优雅的方法来获得相对路径?
我怎么能把setPosition放在类中DrawClockHand?是DrawCLockHand即使在Javascript技术的一类.
码:
var DrawClockHand = function(cv) {
this._cv = cv;
this._ctx = cv.getContext('2d');
this.TIME = 1000;
this._r = 50;
}
DrawClockHand.prototype.setPosition = function(x,y) {
x = x || 0;
y = y || 0;
this._x = x;
this._y = y;
}
Run Code Online (Sandbox Code Playgroud)