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
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{ |
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
さらば不具合 輝く緑は | |
テスト駆動TDD | |
小さな機能 実装のため | |
テストを書いて 今始める | |
赤いバーを 緑にするため | |
ソースに書き込む 仮実装 | |
緑を保ち リファクタリング | |
黄金の回転 テスト駆動TDD | |
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 System; | |
using NUnit.Framework; | |
using FizzBuzz; | |
namespace FizzBuzzTest | |
{ | |
[TestFixture] | |
public class UnitTest1 | |
{ | |
[Test] |
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 System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using NUnit.Framework; | |
using OpenQA.Selenium; | |
using OpenQA.Selenium.IE; | |
using OpenQA.Selenium.Support.UI; | |
namespace SeleniumDemo |
NewerOlder