java.util.HashMap.putAll()のサンプル
Javaコード
package arkgame.study;
import java.util.HashMap;
public class PutAllDemo {
public stati ...
「jQuery入門」each()でプラグインを作成するサンプル
1.プラグインの定義
$.fn.txtChangePlugin = function(str) {
$(this).each(function() {
$(this).text(str).trigger( ...
toLocaleString()で文字列をフォーマットするサンプル
JSコード
var amount = 2000000;
amount.toLocaleString();
console.log(amount);
結果
2,0 ...
「Python入門」del文でキーを指定して要素を削除するサンプル
1.キーを指定して要素を削除
emp = {‘yamada’: 31, ‘sato’: 23, ‘ootuka’: 32,’murasaki& ...
java.sql.Timestamp.valueOf()のサンプル
サンプルコード
package com.arkgamer.study;
public class TimeStampDemo {
public static void main(String[] arg ...
java.util.LinkedHashMap.LinkedHashMap()のサンプル
サンプルコード:
package com.arkgame.study;
import java.util.Iterator;
import java.util.LinkedHashMap;
impo ...
java.lang.String.startsWith()とjava.lang.String.startsWith()のサンプル
サンプルコード
package com.arkgame.study;
public class StartWithDemo {
public static void main(String[] args ...
java.util.PropertiesでPropertyファイルを読み込むサンプル
サンプルコード:
private static final String COMMON_FILE_PATH = “common.properties”;
private static final ...
「C#入門」ReadAllLines()でファイルを配列に読み込むサンプル
サンプルコード
using System;
namespace PlayingAround {
class ReadAll {
public static void Main(string lines ...
「java開発」RMI (Remote Method Invocation)を使うメモ
1.インタフェースを定義する
package com.arkgame.server;
import java.rmi.Remote;
import java.rmi.RemoteException;
p ...
「jQuery入門」イベントデリゲート( event.delegateTarget)を利用するサンプル
サンプルコード
$(“#cft”).on( “click”, “span”, function(event){
console.log( ev ...
java.lang.Integer.toHexString()のサンプル
サンプルコード
package test;
public class AndclassDemo {
public static void main(String[] args) {
int cft ...
java.util.regex.Pattern.splitAsStream()のサンプル
Javaコード
package test;
import java.util.regex.Pattern;
import java.util.stream.Stream;
public clas ...
「jQuery入門」addClass()で要素を非表示する
1.addClass()
htmlコード
<div id=”kdfc”>test data 11</div>
.hide{
display:none; ...
「mongodb入門」sort()とexplain()のサンプル
1.昇順ソート
db.membertbl.find({}).sort(
{reg_id: 1}
)
2.降順ソート
db.membertbl.find({}).sort(
{reg_ ...
「MongoDB入門」find()でデータを検索するサンプル
1.等価比較
db.employees.find(
{position: “SE”}
)
2.非等価比較
db.employees.find(
{position ...
「python入門」readlines()のサンプル
サンプルコード:
with open(“cft_folder/cft_kdf.txt”, “r”, encoding=’utf-8) as mb:
d = m ...
Dockerfileの作成コマンドのメモ
1. Dockerfileの作成
$ vim Dockerfile
FROM centos
MAINTAINER Admin <admin@example.com>
RUN echo ...