Skip to content

Instantly share code, notes, and snippets.

View azyobuzin's full-sized avatar

Takuya Sakurai azyobuzin

View GitHub Profile
<Query Kind="Program" />
void Main()
{
var a = new A();
a.SetX(2);
Action<int> b = a.SetX;
b(1);
a.Dump();
}
foreach (var i in System.Linq.Enumerable.Range(1, 100))
System.Console.WriteLine(
i % 15 == 0 ? "FizzBuzz"
: i % 3 == 0 ? "Fizz"
: i % 5 == 0 ? "Buzz"
: i.ToString());
#!/virtual/azyobuzin/local/bin/python
# -*- coding: utf-8 -*-
import shelve
import urlparse
import oauth2
from wop_core import *
from wop_core import database
double Arctan(double x) {
double a = 0;
for (var i = 0; i < 10000; i++) {
var k = 1 + i *2;
if (i % 2 == 0) {
a = a + (1.0 / k * Math.Pow(x, k));
} else {
a = a - (1.0 / k * Math.Pow(x, k));
}
}
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using Livet;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
using System.Threading;
namespace CoreTweet
{
private static List<byte> TestList = new List<byte>();
static async Task Do()
{
var source = new CancellationTokenSource();
var t = Task.Run(() =>
{
source.Token.Register(() => TestList = null);
for (var i = 0; i < 100000000; i++)
//2本接続
var observable = t.Streaming.StartObservableStream(StreamingType.User);
var disposable1 = observable.OfType<StatusMessage>().Subscribe(s => Console.WriteLine("status"));
var disposable2 = observable.OfType<EventMessage>().Subscribe(e => Console.WriteLine("event"));
//1本接続
var observable = t.Streaming.StartObservableStream(StreamingType.User).Publish();
observable.OfType<StatusMessage>().Subscribe(s => Console.WriteLine("status"));
observable.OfType<EventMessage>().Subscribe(e => Console.WriteLine("event"));
var disposable = observable.Connect();
using System;
using System.IO;
namespace paizen
{
class Program
{
const int NewLine = 10;
const int Space = 32;
const int ZeroChar = 48;
using System;
using System.Collections.Generic;
using System.Linq;
namespace CoreTweet.Core
{
public interface ITwitterResponse
{
RateLimit RateLimit { get; set; }
}