View List2D.cs
using System.Linq; | |
namespace System.Collections.Generic | |
{ | |
public class List2D<T> : IEnumerable<List2dIndexer<T>> where T : new() | |
{ | |
public List2D(int w, int h) | |
{ | |
mWidth = w; | |
mHeight = h; |
View file0.cpp
#include <string> | |
template <typename List> | |
void split(const std::string& s, const std::string& delim, List& result) | |
{ | |
result.clear(); | |
using string = std::string; | |
string::size_type pos = 0; |
View Main.cpp
#include <iostream> | |
#include "immutable.hpp" | |
#include <vector> | |
#include <list> | |
#include <string> | |
#include <cassert> | |
using namespace std; | |
int main(void){ |
View InvertedSphere.cs
using UnityEngine; | |
using UnityEditor; | |
public class InvertedSphere : EditorWindow { | |
private string st = "1.0"; | |
[MenuItem("GameObject/Create Other/Inverted Sphere...")] | |
public static void ShowWindow() { | |
EditorWindow.GetWindow(typeof(InvertedSphere)); | |
} |
View Image2D.h
#include <sstream> | |
#include <vector> | |
#include <random> | |
#include <cstdio> | |
// 2次元画像クラス | |
class Image2D { | |
public: | |
// Int に Pixel という別名をつける |
View Converter.h
struct Converter | |
{ | |
static unsigned short UShort(unsigned char b1, unsigned char b2) | |
{ | |
return (unsigned short)( (0xff00 & (b2 << 8)) | (0x00ff & (b1 << 0)) ); | |
} | |
static short Short(unsigned char b1, unsigned char b2) | |
{ |
View FixedQueue.h
#include <deque> | |
/** | |
* 固定長キュークラス | |
*/ | |
template <typename T> | |
class FixedQueue | |
{ | |
public: |
View CurryImpl.h
/** A -> (B -> C) 型の関数オブジェクト */ | |
template <typename A, typename B, typename C> | |
struct CurryImpl { | |
// コンストラクタでオリジナルの関数をキャプチャ | |
CurryImpl(function<C(A, B)>& f) : mFunc(f) {} | |
/** B -> C 型の関数オブジェクトをリターンする */ | |
function< C(B) > operator () (A& a) { | |
return CurryImpl2(mFunc, a); |
View file0.cs
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Microsoft.Office.Interop.Word; | |
using Word = Microsoft.Office.Interop.Word; | |
namespace WordSample | |
{ |
View file0.java
/** | |
* タイル画像をキャンバス上に敷き詰める. | |
* @param canvas 描画用キャンバス. | |
* @param resource リソースオブジェクト. | |
* @param resourceId タイル画像のリソースID. | |
*/ | |
public static void fillByTile(@NonNull Canvas canvas, | |
@NonNull Resources resource, | |
@DrawableRes int resourceId) | |
{ |
NewerOlder