Skip to content

Instantly share code, notes, and snippets.

<Window x:Class="OxyPlotWpfTests.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:oxy="http://oxyplot.org/wpf"
xmlns:oxyPlotWpfTests="clr-namespace:OxyPlotWpfTests"
Title="MainWindow" Height="350" Width="525">
<Window.Resources>
<oxyPlotWpfTests:MainWindowViewModel x:Key="MainWindowViewModel" />
<oxyPlotWpfTests:CustomDataPointConverter x:Key="CustomDataPointConverter"/>
</Window.Resources>
@TABETA
TABETA / Hage.hpp
Created December 7, 2016 21:53
多重継承すると後ろ側のクラスで分岐が発生する? ref: http://qiita.com/abedominal/items/a845b81b1057279b79b7
#ifndef __HAGE_HPP__
#define __HAGE_HPP__
class NotifierA
{
public:
virtual void notifyA() = 0;
};
class NotifierBC
Function truncDate(t As Date) As Date
truncDate = TimeSerial(Hour(t), Minute(t), 0)
End Function
Function findTime(r As Long, c As Long) As Long
findTime = Application.WorksheetFunction.Match(CDbl(truncDate(Cells(r, c))), Range("2:2"), 1)
End Function
Sub t()
Dim cs As Long
@TABETA
TABETA / JIRA.bas
Last active March 10, 2018 23:24
JsonConverterに依存。
Option Explicit
Private JiraService As New MSXML2.XMLHTTP60
Private JiraAuth As New MSXML2.XMLHTTP60
Private sCookie
Const sJIRAUserID = ""
Const sJIRAPass = ""
Const url = "https://<name>.atlassian.net/rest/"
Private Sub Class_Initialize()
Dim sErg
@TABETA
TABETA / Caster.hpp
Created March 28, 2016 21:11
メンバ関数ポインタへのコールバックをtemplateで ref: http://qiita.com/abedominal/items/9cca99e10cf4eac1708f
#pragma once
#include "Singleton.hpp"
using namespace std;
struct Listner
{
public:
Listner() {}
virtual ~Listner(){}
@TABETA
TABETA / main.cpp
Created March 27, 2016 11:26
整数値をキーとしたstateパターンをtemplateで実現 ref: http://qiita.com/abedominal/items/73e2a9448330837ea6d6
#include <iostream>
#include <iomanip>
#include <cstdint>
using namespace std;
template <typename T>
class Singleton
{
protected:
#pragma once
#include <cstdint>
#include "Observer.hpp"
// 継承でStrategy部を自分で実装する。
// judgeを自分で持っているのでポインタ経由での関数呼び出しが一回減っている。
class ChangeDetectionObserver : public Observer
{
public:
ChangeDetectionObserver() :count_(){}
@TABETA
TABETA / After.cpp
Last active February 16, 2016 14:24
ポインタが指し示すデータを一時変数に受けていたせいで最適化が効かなくなった例 ref: http://qiita.com/abedominal/items/f188737285c8d4e71a03
push ebp
mov ebp, esp
mov edx, DWORD PTR _b$[ebp]
mov ecx, DWORD PTR _r$[ebp]
movzx eax, WORD PTR [edx+8]
mov WORD PTR [ecx], ax
movzx eax, WORD PTR [edx+40]
mov WORD PTR [ecx+2], ax
movzx eax, WORD PTR [edx+72]
mov WORD PTR [ecx+4], ax
@TABETA
TABETA / file0.cpp
Last active February 14, 2016 02:31
switch文のケースに使われているリテラル値で最適化はしてくれるのか? ref: http://qiita.com/abedominal/items/5f4eb9750737aff76efe
//maskの右辺値はコンパイル時に決められるから計算コスト不要であることを期待
class Select0
{
public:
bool operator()(int bitPos, uint32_t dword)
{
uint32_t mask = 0;
switch (bitPos)
{
case 1: mask = 1<<0; break;
#include <string>
#include <iostream>
#include <chrono>
#include <cstdint>
#include <cmath>
using namespace std;
void checkDiff(uint32_t l, uint32_t r, bool isLeftBigger)
{