Skip to content

Instantly share code, notes, and snippets.

View occar421's full-sized avatar
😴
Sleeping, thinking or reading

MasuqaT occar421

😴
Sleeping, thinking or reading
View GitHub Profile
@occar421
occar421 / Expression for static inheritance by singleton pattern.md
Last active August 29, 2015 14:15
Expression for static inheritance of C#

Expression for static inheritance by singleton pattern in CSharp

@occar421
occar421 / RxLogicCircuit3.md
Last active August 29, 2015 14:08
Reactive Extensions Logic Circuit 3

Reactive Extension Logic Circuit 3

Summary

This Gist is experimental logic circuit description with C#.
I think, using Reactive Extension(Rx), we can write electrical circuit easily.
Previous Gist Code

Files

LogicLine.cs

This class means logic wire. Logic gates are defined as operator override.

@occar421
occar421 / RxLogicCircuit2.md
Created September 30, 2014 15:04
Reactive Extensions Logic Circuit 2

Reactive Extension Logic Circuit 2

Summary

This Gist is experimental logic circuit description with C#.
I think, using Reactive Extension(Rx), we can write electrical circuit easily.
Previous Gist Code

Files

LogicLine.cs

This class means logic wire. Logic gates are defined as operator override.

@occar421
occar421 / RxLogicCircuit1.md
Last active August 29, 2015 14:04
Reactive Extensions Logic Circuit 1

Reactive Extension Logic Circuit 1

Summary

This Gist is my experimental code of explanation for logic circuit with C#.
I think, using Reactive Extension, we can write more smart code for circuit(not only logical one).

Files

LogicSignal.cs

This class means logic wire. Logic gate elements are also provided.
For IObservalble<bool> instances with default value, factory method "CreateWithDefault" is exist.

@occar421
occar421 / OpenTKGameWindow button with Rx.md
Last active July 25, 2020 00:32
Implemantation of button for OpenTK GameWIndow with ReactiveExtensions.

About this Gist

##Description This Gist shows an implementation the simple button on OpenTK GameWindow with ReactiveExtensions. Code is divided into base class "UIWindow" and sub class "MyWindow".

UIWindow provides things for implemeting the base of UI. In more details, it has collection of UI element, make UI elements draw, and fires click events. Because it hides SwapBuffers method and provides new SwapBuffer, who making sub class hasn't to pay attention to difference between UIWindow and GameWindow.

Files

  • UIElement.cs
    UIElement class provides base of UI element. ex. position, color, hit test, event. Button class overrides UIElement.Draw method, only drawing.
@occar421
occar421 / WPFConsole.md
Last active August 29, 2015 14:01
WPF with console remote

このGistについて

このGistはコンソールでのコマンドのみでWPFを変化させるものです。
自動化スクリプトなど、人がGUIに触れずに動くことを想定しています。
メモリリークや例外、ファイル分けなどは、あまり考慮していません。
極力MVVMに沿うように心掛けたので、ちょっと回りくどい実装です。

ファイル構成

  • Models
  • Collections.cs
    データの実態二つ
@occar421
occar421 / 2ndParser.cs
Created March 4, 2014 06:23
Discussion of .srf file linq parser 2
public void Parse(IEnumerable<string> data)
{
DateTime start = DateTime.Now;
var stream = data.Where(x => !string.IsNullOrEmpty(x));
if (stream.First().StartsWith("surf", false, null))
{
throw new FileFormatException("SURF Header");
}
@occar421
occar421 / 1stParser.cs
Created March 2, 2014 11:51
Discussion of .srf file linq parser 1
public void Parse(IEnumerable<string> data)
{
DateTime start = DateTime.Now;
var stream = data.Where(x => !string.IsNullOrEmpty(x));
if (stream.First().StartsWith("surf", false, null))
{
throw new FileFormatException("SURF Header");
}