「C#入門」インターフェースの定義(event、method、property)
サンプルコード
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.T ...「go言語」rangeで配列の要素を出力するサンプル
サンプルコード
package mainimport ( "fmt")func main() {//配列 var value = int{{1, 2}, {3, 4}, {5, 6}} for i, v := range val ...「Mac」MAMP の MySQL をコマンドラインで操作する
1.Finderを起動し、「アプリケーション」→「ユーティリティ」にアクセスし、「ターミナル」を起動する
作業ディレクトリを移動する
$ cd/Applications/MAMP/Library/bin/
...
「jQuery」clickイベントを利用するサンプル
サンプルコード
<script>$(document).ready(function(){ $("p").click(function(){ $(this).hide(); });});</script> ...「jQuery」:eq()、:gt() 、:lt()で要素を取り出すサンプル
1.n番目の要素よりも前方/後方の要素を指定
:lt(index)
index番目よりも前方の要素
例
$(‘option:lt(3)’).css(‘backgrou ...
「jQuery」選択ボックスの偶数/奇数番目の要素を取り出す
サンプルコード
$(function() { $('option:even').css('background-color', 'Red'); $('option:odd').css('background-color', 'B ...「jQuery入門」:evenで偶数行の要素を指定する
:even
偶数番目のインデックス要素
サンプル
<script src=""></script><script>$(document).ready(function(){ ...「jQuery」fadeTo()で要素のフェード処理を行うサンプル
書式
$(selector).fadeTo(speed,opacity,callback);
サンプルコード
<script>$(document).ready(function(){ $("bu ...「jQuery」fadeToggle()で開閉式のメニューを実装する
書式
$(selector).fadeToggle(speed,callback);
サンプルコード
「jQuery」fadeIn()、fadeOut()でフェードイン、アウトを実現する
フェードイン
$(“button”).click(function(){
$(“#div1”).fadeIn();
$(“#div2”). ...
「React入門」インラインスタイル(Inline style)を指定するサンプル
サンプルコード
<div id="example"></div> <script type="text/babel"> var cftStyle = { fontSize: 100, colo ...「React入門」ReactDOM.renderの使い方
1.react-domモジュールをimportする
<script src=”/react.development.js”></script>
<script sr ...
「React入門」JSX のタグを書くメモ
1.単行のタグ
return <h3>test data</h3>;
2.複数行のタグ
return (
<div>
<h3>test dat ...
OpenLDAPでユーザーを追加する方法
1. パスワード生成
# slappasswd
New password:
Re-enter new password:
{SSHA}xxxxxxxxxxxxxxxxx
2.ldifファイル ...
「SpringMVC」@Path、@Producesでjsonを返すサンプル
サンプルコード
@GET @Path("list") @Produces(MediaType.APPLICATION_JSON) public List<String> list() { return Arrays. ...「CSS3入門」ボタンを作る方法(font-size、border-radius、disabled)
1.font-sizeでボタンのサイズを指定する
サンプルコード
.button1 {font-size: 10px;}
.button2 {font-size: 12px;}
.button3 {fo ...
「CSS入門」hsl()関数を利用するサンプル
説明
hsl(hue, saturation, lightness)
hue (色相) … 0~360
saturation (彩度) … 0~100%
lightness (輝度) … 0~100% ...
「CSS入門」rgb()で色を指定する方法
関数記法
rgb(red, green, blue)/* 整数値 */
rgb( 100%, 0%, 30% );/* 割合 */
サンプルコード