Skip to content

Instantly share code, notes, and snippets.

@udaken
udaken / Archive.hpp
Created August 20, 2017 14:49
Header Only Wrapper Class for libarchive
#pragma once
#include "archive.h"
#include "archive_entry.h"
#include <mbstring.h>
#include <memory>
#include <exception>
#include <system_error>
#include <string>
namespace LibArchive
@udaken
udaken / GetUNCPath.cpp
Last active August 29, 2017 03:48
UNCパスを取得するサンプルコード
HRESULT GetUNCPath(LPCTSTR path,std::wstring &result)
{
using namespace std;
if(::PathIsNetworkPath(path) /*&& !::PathIsUNCServerShare(path) */)
{
TCHAR x[MAX_PATH] = {0};
lstrcpyn(x,path,MAX_PATH);
PathUnquoteSpaces(x);
@udaken
udaken / GetLinkTarget.cpp
Created August 29, 2017 03:47
LNKファイルからリンク先を取得するサンプルコード
HRESULT GetLinkTarget(IShellLinkWPtr pShellLink,const wstring &linkPath,wstring &target) throw()
{
HRESULT hr = S_OK;
{
IPersistFilePtr pPersistentFile;
hr = pShellLink.QueryInterface(IPersistFilePtr::GetIID(),&pPersistentFile);
if(SUCCEEDED(hr))
{
// Copyright (C) 2006, deraw.
// Hatena Antenna Manual Update (Original):Copyright (C) 2005, hatena.
// Released under the GPL license
// http://www.gnu.org/copyleft/gpl.html
//
// ==UserScript==
// @name Hatena Antenna ManualMultiUpdate
// @namespace http://www.hatena.ne.jp
// @include http://a.hatena.ne.jp/*
// @description
Option Explicit
Public Function TEXTJOIN(区切り記号 As String, 空の文字列を無視 As Boolean, ParamArray 文字列()) As String
Dim ret As String
Dim first As Boolean
first = True
Dim i As Long
Dim 文字列配列() As Variant
If (TypeName(文字列(LBound(文字列))) = "Range") Then
@udaken
udaken / tmp_popcount.hpp
Last active January 27, 2018 14:41
TMP(template meta programming) ビットカウント(C++)
template< unsigned long long N >
struct popcount
{
static const unsigned long long value = popcount< N / 2 >::value + (N % 2);
};
template<>
struct popcount< 0 >
{
static const unsigned long long value = 0;
@udaken
udaken / NamedPipeExample.cpp
Created February 19, 2018 22:48
名前付きパイプを利用して、 TransactNamedPipe() を行うサンプル
#include "stdafx.h"
#define NOMINMAX
#define WIN32_LEAN_AND_MEAN
#define STRICT
#include <windows.h>
#include <thread>
int main()
{

Visual Studio 2008 でgitを利用する(2018年版)

調べた範囲を記述する。まだ動作確認はしていない。
大体 http://blog.cybozu.io/entry/5132 を見ればいいと思う。

Git Source Control Provider(gitscc) V 1.3

現在、codeplexではアーカイブに移行してしまっているが、ダウンロードはできる。

  1. https://archive.codeplex.com/?p=gitsccdownload archive から、 gitscc.zipをダウンロードする。
  2. releases/1/3b4d43e5-4a5a-47c6-b886-c1bbf0510154 を、 GitSccProvider.msi にリネームして、インストールする。
  3. あとは こちら https://opcdiary.net/?page_id=5677 などを参照して環境を設定する。
@udaken
udaken / 給料.md
Last active December 21, 2018 14:43
2018年 額面 手取り
total
賞与2 556k 456k
2018/12
2018/11 363k 269k
2018/10 379k 284k
2018/9 336k 244k
2018/8 352k 259k
賞与1 530k 434k