「JavaScript」getYear() のサンプル
サンプルコード
<script type="text/javascript">var cft = new Date("July 21, 1993 01:15:00")document.write("年: " + cf ...「C++」string型からint型に変換するサンプル
サンプルコード
#include <stdio.h>#include <string> int main() { std::string cftStr = "6688"; int num = atoi(c ...java.util.HashMap.keySetのサンプル
サンプルコード
package com.arkgame;import java.util.HashMap;public class HashMapDemo {public static void main(Stringjava.io.StringWriterのサンプル
サンプルコード
package com.arkgame;import java.io.BufferedReader;import java.io.FileInputStream;import java.io.IOExceptio ...正規表現で数字の桁数を指定するサンプル
1.6桁の数字
{6}
2.6桁以上の数字
{6,}
3.6桁以下の数字
{,6}
4.3桁以上、6桁以下の数字
{3,6}
「Java」BigDecimalの四則演算のサンプル
サンプルコード
package com.study;import java.math.BigDecimal;public class BigDecimalDemo {public static void main(String[ ...「Java」Properties インスタンスのサンプル
サンプルコード
package com.study;import java.util.Properties;public class PropertyDemo {public static void main(String[] ...「Laravel入門」exists()とunique()を利用するサンプル
1.exists()
'email' => ,2.unique()
'email' => ,「Java」replaceAll() を利用するサンプル
サンプルコード
package com.arkgame;public class ReplaceAllDemo {public static void main(String+", "***");System.out.print ...「Struts2」request、response、sessionを取得するサンプル
構文
1.リクエストを取得します
ServletActionContext.getRequest()
2.レスポンスを取得します
ServletActionContext.getResponse() ...
「Java入門」getHeader(“user-agent”)によるブラウザを判定するサンプル
1.ブラウザIEの判定
String ugt = request.getHeader("user-agent"); Pattern ptn = Pattern.compile(".*((MSIE)+ \\.).*"); Matc ...json形式の文字列をオブジェクトに変換する
サンプル
var cft = JSON.parse(‘{“country”:”日本”}’);
document.write(cft.country ...
JSON.stringify()でオブジェクトをjsonの文字列に変換
サンプル
var str = JSON.stringify({key1: “tokyo”, key2: “yokohama”,key3: “kawasaki̶ ...
「Struts2」s:actionタグの使い方
1.struts.xml
<action name=”M0100″ method = “execute” class = “com.arkgame.pro.cf ...
「Python入門」== と is の使い方
サンプルコード
>>> a=100>>> b=100.0>>> a is bFalse>>> a==bTrue>>> id(a)30696 ...JavaScriptでcookieを削除するサンプル
JSコード
function cookieDelete(key){ var dt = new Date(); var cft = key + "=;expires=" + dt.toGMTString(); document.c ...java.security.SecureRandomでランダムな文字列を生成するサンプル
サンプルコード
package com.arkgame.demopro;import java.security.NoSuchAlgorithmException;import java.security.SecureRando ...TO_NUMBER()で文字列を数値に変換する
SQL構文
SELECT TO_NUMBER('123') FROM DUAL;結果123.456