pxkw.hatenadiary.com

めもめも

code

トグる2

クリックでtdの表示をトグる <div id="slide-toggle-sample1"> <table> <tr > <td> <div id="trigger">Click me to show msg</div> <div id="message" style="display:none" >Can you see me?</div> </td> </tr> </table> <script src="http://code.jquery.com/jquery-2.1.0.min.js"></script> <script> $(function(){ $("#trigger").cl…</div>

trをslideToggleする

<div id="trSlideToggleSample"> <table> <tr class="trTrigger"> <th colspan="2">Click me to show.</th> </tr> <tr style="display:none"> <th>Can you</th> <td>see me?</td> </tr> </table> <script src="http://code.jquery.com/jquery-2.1.0.min.js"></script> <script> $(function(){ $(".trTrigger").click( funct…</div>

tdをslideToggleする

<div id="tdSlideToggleSample"> <table> <tr> <th class="thTrigger">Click me to show.</th> <td style="display:none">Can you see me?</td> </tr> </table> <script src="http://code.jquery.com/jquery-2.1.0.min.js"></script> <script> $(function(){ $(".thTrigger").click( function() { $(this).next().slideTogg…</div>

dlをslideToggleする

参考: 超簡単jQuery!"toggle系メソッド"を使ってアコーディオンメニューやタブをさくっと実装する方法 | 株式会社LIGミニマルなコードはこんな感じかな <div id="dlSlideToggleSample"> <dl> <dt class="trigger">Click me to show/hide item.</dt> <dd style="display:none"> Can you see me?</dd> </dl> <script src="http://code.jquery.com/jquery-2.1.0.min.js"></script> <script>…</div>

JavaでC-cした時の処理

シャットダウン時に走るスレッドを用意してRuntimeに渡す.参考:日記(仮) >> Javaプログラム終了時に確実に終了処理をするミニマルなコードはこんな感じか public class ShutdownHookSample { public static void main(String[] args) { // Set thread to be…

symlinkをchownする

オプションhを付与する。 chown -h owner:group symlinkchownのマニュアル: -h, --no-dereference affect each symbolic link instead of any referenced file (useful only on systems that can change the ownership of a symlink)なので、 -h を付与しな…

Hello Velocity Advanced

Hello Velocity http://pxkw.hatenadiary.com/entry/2013/12/07/113648 をちょっとだけ発展させたもの。下記2つを実行時に指定させるよう変更 テンプレートファイル テンプレートに差し込む文字列 コード HelloVelocityAdvanced.java package hello; import …

Hello Velocity

Velocityのミニマムなコード. できるだけミニマムに.HelloVelocity.java package hello; import java.io.IOException; import java.io.StringWriter; import java.io.Writer; import org.apache.velocity.Template; import org.apache.velocity.VelocityCont…

-mxxと-Oxをターゲットに指定したいときのMakefile

32/64bitと最適化オプションをターゲットにmakeするときのMakefile. こんな感じで良いのかなぁ.泥臭いな. Makefile DIR_SRC=./src DIR_HDR=./include DIR_BIN=. m32o0suf = m32o0 m32o1suf = m32o1 m32o2suf = m32o2 m64o0suf = m64o0 m64o1suf = m64o1 m64o…

Text in oval

こーすると <div id="div_tio" ><div> <script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script> <script type="text/javascript"> var dataset = [ {'name':'v1', 'x':1, 'y':0}, {'name':'v2', 'x':2, 'y':0}, {'name':'v3', 'x':3, 'y':0}, {'name':'v4', 'x':4, 'y':0}, {'name':'v5', 'x':5, 'y':0}, {'name'…</div></div>

D3でbuttonを追加する

こうすると <div id="d_button"></div> <script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script> <script type="text/javascript"> var dataset = [ 1,2,3,4,5 ]; function onButtonClicked( ){ var text = '(name,value)=(' + this.name + ',' + this.value + ')'; alert( text ); }; d3.select('#d_button') .s…