This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c:\slack>set token=xoxb-33030529412-yZJDFkFnGpH3CvzvFoyEgEzx | |
| |
c:\slack>node bot.js | |
module.js:338 | |
throw err; | |
^ | |
Error: Cannot find module 'c:\slack\bot.js' | |
at Function.Module._resolveFilename (module.js:336:15) | |
at Function.Module._load (module.js:278:25) | |
at Function.Module.runMain (module.js:501:10) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package transient_test; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.FileOutputStream; | |
import java.io.ObjectInputStream; | |
import java.io.ObjectOutputStream; | |
import java.io.Serializable; | |
// transient修飾子を指定したフィールドが直列化されないことを証明するためのクラス |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
*この文字列の部分文字列である新しい文字列を返します。部分文字列は、指定された beginIndex から始まり、 | |
*インデックス endIndex - 1 にある文字までです。したがって、部分文字列の長さは endIndex-beginIndex になります。 | |
*/ | |
public String substring(int beginIndex, int endIndex) { | |
return ((beginIndex == 0) && (endIndex == count)) ? this : | |
new String(offset + beginIndex, endIndex - beginIndex, value); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public String trim() { | |
int len = count; // 文字数(終了インデックス) | |
int st = 0; // 開始インデックス | |
int off = offset; // 最初のインデックス | |
char[] val = value; // String文字列 | |
// Stringオブジェクトの長さが0より大きく、(最初のindex+0)番目の文字がスペースより小さい場合 | |
while ((st < len) && (val[off + st] <= ' ')) { | |
// indexを1つずらし、次の文字をチェック。。 | |
// スペースじゃなくなるまで行う |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class No4 { | |
/* | |
* 文字列のコピーを返します。先頭と最後の空白は省略されます。 | |
* この String オブジェクトが空の文字列を表す場合、あるいはこの | |
* Stringオブジェクトによって表される 文字列の最初と最後の文字のコードが '\u0020' (スペース文字) より大きい場合は、この | |
* String オブジェクトへの参照が返されます。 | |
* | |
* 文字列内に '\u0020' より大きいコードの文字がない場合は、空の文字列を表す新しい String オブジェクトが生成されて返されます。 | |
* | |
* たとえば、k が文字列内の最初の文字のインデックスであり、「 」より大きいコード値を持ち、 m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Nest; | |
public class NestCls { | |
// 非staticメンバ | |
int i = 0; | |
// staticなメンバ | |
static int a = 999; | |
// インナークラス(非static) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Nest; | |
public class NestCls { | |
// 非staticメンバ | |
int i = 0; | |
// staticなメンバ | |
static int a = 999; | |
// インナークラス(非static) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test; | |
public class Test { | |
static Integer num; | |
public static void main(String[] args) { | |
switch (num) { | |
case 0: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test; | |
public class Test { | |
static int num; | |
public static void main(String[] args) { | |
switch (num) { | |
case 0: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package study_03; | |
public class No5 { | |
/* | |
* 指定されたindexから始まる部分文字列の先頭から始まるかどうかテストする | |
* | |
* このオブジェクトの部分文字列のときはtrue,そうでなければfalse | |
* tooffsetが負の値である場合、あるいはStringオブジェクトの長さよりも長い場合false そうでない場合は結果は次の式の結果と同じ | |
* this.subString(toffset).startsWith(prefix) |