Skip to content

Instantly share code, notes, and snippets.

View takekazuomi's full-sized avatar
:octocat:
on code

Takekazu Omi takekazuomi

:octocat:
on code
View GitHub Profile
@takekazuomi
takekazuomi / request.log
Created April 21, 2011 08:51
entity group transaction sample
POST http://127.0.0.1:10002/devstoreaccount1/$batch HTTP/1.1
User-Agent: Microsoft ADO.NET Data Services
DataServiceVersion: 1.0;NetFx
MaxDataServiceVersion: 2.0;NetFx
x-ms-version: 2009-09-19
x-ms-date: Wed, 20 Apr 2011 07:45:40 GMT
Authorization: SharedKeyLite devstoreaccount1:e7JvAlvY5Ldy06ZVXhWc9gYQsZ90cTiDk5trOlkT5Zc=
Accept: application/atom+xml,application/xml
Accept-Charset: UTF-8
Content-Type: multipart/mixed; boundary=batch_ca2d9fac-f1a2-4ed3-b584-4c09d3ecf99a
namespace Jobs {
public class EntityOne : TableServiceEntity {
public EntityOne() {
}
public EntityOne(string partitionKey, string rowKey)
: base(partitionKey, rowKey) {
}
@takekazuomi
takekazuomi / body.cs
Created April 22, 2011 08:35
main loop
try {
if (concurrency == 1) {
foreach (var es in EntityGenerator<EntityOne>.Shift(source, batchSize)) {
body(es, null, monitor);
}
} else {
ParallelOptions options = new ParallelOptions();
options.MaxDegreeOfParallelism = concurrency;
@takekazuomi
takekazuomi / retry.cs
Created April 22, 2011 08:39
retry code
namespace Jobs {
public static class Retry {
static ILog log = LogManager.GetCurrentClassLogger();
public static RetryPolicy Exponential(int retryCount, TimeSpan minBackoff, TimeSpan maxBackoff, TimeSpan deltaBackoff) {
// Do any argument Pre-validation here, i.e. enforce max retry count etc.
return () => {
return (int currentRetryCount, Exception lastException, out TimeSpan retryInterval) => {
log.Info(m => m("currentRetryCount:{0},lastException:{1}", currentRetryCount, lastException));
@takekazuomi
takekazuomi / term.sh
Created May 31, 2011 01:05
switch LANG setting
if [ "$TERM" = "xterm" ]
then
export LANG=ja_JP.UTF-8
fi
@takekazuomi
takekazuomi / build -Wall -WX-
Created July 23, 2011 13:36
libgit2 compile with x64 VC++
Microsoft(R) Visual Studio Version 10.0.40219.1.
Copyright (C) Microsoft Corp. All rights reserved.
1>------ ビルド開始: プロジェクト: ZERO_CHECK, 構成: Debug x64 ------
1> Checking Build System
1> CMake does not need to re-run because C:/home/takekazu/src/libgit2/buildx64/CMakeFiles/generate.stamp is up-to-date.
2>------ ビルド開始: プロジェクト: git2, 構成: Debug x64 ------
3>------ ビルド開始: プロジェクト: libgit2_test, 構成: Debug x64 ------
3> Building Custom Rule C:/home/takekazu/src/libgit2/CMakeLists.txt
2> Building Custom Rule C:/home/takekazu/src/libgit2/CMakeLists.txt
@takekazuomi
takekazuomi / build -Wall -WX-
Created July 23, 2011 13:36
libgit2 compile with x64 VC++
Microsoft(R) Visual Studio Version 10.0.40219.1.
Copyright (C) Microsoft Corp. All rights reserved.
1>------ ビルド開始: プロジェクト: ZERO_CHECK, 構成: Debug x64 ------
1> Checking Build System
1> CMake does not need to re-run because C:/home/takekazu/src/libgit2/buildx64/CMakeFiles/generate.stamp is up-to-date.
2>------ ビルド開始: プロジェクト: git2, 構成: Debug x64 ------
3>------ ビルド開始: プロジェクト: libgit2_test, 構成: Debug x64 ------
3> Building Custom Rule C:/home/takekazu/src/libgit2/CMakeLists.txt
2> Building Custom Rule C:/home/takekazu/src/libgit2/CMakeLists.txt
int git_odb_backend_pack(git_odb_backend **backend_out, const char *objects_dir)
{
struct pack_backend *backend;
char path[GIT_PATH_MAX];
backend = git__calloc(1, sizeof(struct pack_backend));
if (backend == NULL)
return GIT_ENOMEM;
if (git_vector_init(&backend->packs, 8, packfile_sort__cb) < GIT_SUCCESS) {
@takekazuomi
takekazuomi / gist:1104311
Created July 25, 2011 14:55
sudo port -vd selftupdate error
checking build system type... i386-apple-darwin11.0.0
checking host system type... i386-apple-darwin11.0.0
checking target system type... i386-apple-darwin11.0.0
checking MacPorts version... 2.0.0
checking for sw_vers... /usr/bin/sw_vers
checking for defaults... /usr/bin/defaults
checking for xcode-select... no
checking Mac OS X version... 10.7
checking Xcode version... 3.2.3
checking for gcc... /usr/bin/llvm-gcc-4.2
@takekazuomi
takekazuomi / gist:1219328
Created September 15, 2011 14:09
The value for one of the HTTP headers is not in the correct format.
System.Data.Services.Client.DataServiceRequestException: この要求の処理中にエラーが発生しました。 ---> System.Data.Services.Client.DataServiceClientException: <?xml version="1.0" encoding="utf-8" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code>InvalidHeaderValue</code>
<message xml:lang="en-US">The value for one of the HTTP headers is not in the correct format.</message>
</error>
場所 System.Data.Services.Client.DataServiceContext.SaveResult.<HandleBatchResponse>d__1e.MoveNext()
--- 内部例外スタック トレースの終わり ---
場所 Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.get_Result()
場所 Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.ExecuteAndWait()
場所 Microsoft.WindowsAzure.StorageClient.TaskImplHelper.ExecuteImplWithRetry[T](Func`2 impl, RetryPolicy policy)