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# FtpWebRequestでパスワード末に改行コードが含まれているとExceptionが発生する状況の再現 | |
//-----------------------------------------------------------------------------------// | |
var ftpReq = (System.Net.FtpWebRequest)System.Net.WebRequest.Create(new Uri("ftp://" + ip + sendPath)); | |
//FTPユーザーとFTPパスワード | |
//ただし、FTPパスワードにワザと改行コードを付与する | |
ftpReq.Credentials = new System.Net.NetworkCredential(user,password+"\r\n"); | |
ftpReq.Method = System.Net.WebRequestMethods.Ftp.UploadFile; |
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
//改行コード付きのテキストデータ | |
var textReturnCode = WebDriver.FindElement(By.TagName("textarea")).GetAttribute("value"); | |
//改行コードなしのテキストデータ | |
var textNonReturnCode = WebDriver.FindElement(By.TagName("textarea")).Text; |
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
void fb(int n) { | |
if (n == 0) return; | |
fb(n - 1); | |
if(n%15==0){ | |
print("FizzBuzz"); | |
}else if(n%5==0){ | |
print("Buzz"); | |
}else if(n%3==0){ | |
print("Fizz"); |
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 abstract class 顧客区分{ | |
private String 区分名; | |
private int デフォルト料金; | |
protected 料金 my料金object; | |
public 顧客区分(料金 料金object){ | |
my料金object=料金object; | |
} |
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
using (SymmetricAlgorithm cspAlgorithm = new AesManaged()) | |
{ | |
cspAlgorithm.Key = keyBytes | |
cspAlgorithm.IV = ivBytes | |
using (ICryptoTransform encryptor = cspAlgorithm.CreateDecryptor()) | |
{ | |
byte[] source = Convert.FromBase64String(Base64変換された暗号化された文章); | |
byte[] decrypted = encryptor.TransformFinalBlock(source, 0, source.Length); | |
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
using (SymmetricAlgorithm cspAlgorithm = new AesManaged()) | |
{ | |
cspAlgorithm.Key = keyBytes | |
cspAlgorithm.IV = ivBytes | |
using (ICryptoTransform encryptor = cspAlgorithm.CreateEncryptor()) | |
{ | |
byte[] source = Encoding.UTF8.GetBytes(暗号化させたい文章); | |
byte[] encrypted = encryptor.TransformFinalBlock(source, 0, source.Length); |
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
var bytes=ASCIIEncoding.ASCII.GetBytes(messageText); | |
var md5 = MD5.Create(); | |
var hash = md5.ComputeHash(bytes); |
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
int seed = Environment.TickCount; | |
var rand = new Random(seed); | |
int toSkip = rand.Next(0, this.targetList.Count - 1); | |
var status = this.targetList | |
.Skip(toSkip) | |
.Take(1) | |
.FirstOrDefault(); |
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
var tweetList = twitterCtx.Status | |
.Where(n => n.Type == StatusType.User) | |
.Where(n => n.ScreenName == targetUserId) | |
.Where(n=>n.Count==200) | |
.ToList(); |
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
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
public class Calc { | |
public static void main(String Args[]) throws IOException{ |
NewerOlder