Skip to content

Instantly share code, notes, and snippets.

Module Module1
Sub Main()
Dim f = New Foo()
Dim v = f.Value
Dim c = f.Count
End Sub
End Module
#include <iostream>
#include <functional>
template <typename T>
struct add1 : std::unary_function<T, T> {
#if 1
typedef typename std::unary_function<T, T>::result_type result_type;
typedef typename std::unary_function<T, T>::argument_type argument_type;
#endif
result_type operator ()(const argument_type& arg) const {
import sys
import clr
import thread
import Misuzilla.Applications.TwitterIrcGateway
import Misuzilla.Applications.TwitterIrcGateway.AddIns
from System import *
from System.Threading import Thread, ThreadStart
from System.Collections.Generic import *
@mashiro
mashiro / judgment.py
Created November 5, 2009 08:35
ジャッジメントですの!
import sys
from Misuzilla.Applications.TwitterIrcGateway.AddIns.DLRIntegration import DLRIntegrationAddIn
def OnPreSendMessageTimelineStatus(sender, e):
e.Text = e.Text + "\tジャッジメントですの!"
def OnBeforeUnload(sender, e):
Session.PreSendMessageTimelineStatus -= OnPreSendMessageTimelineStatus
Session.PreSendMessageTimelineStatus += OnPreSendMessageTimelineStatus
import clr
import re
from System.Net import WebClient
from Misuzilla.Applications.TwitterIrcGateway import Status, Statuses, User, Users, Utility
from Misuzilla.Applications.TwitterIrcGateway.AddIns.DLRIntegration import DLRIntegrationAddIn, DLRBasicConfiguration, DLRContextHelper
username = "your bit.ly username"
apikey = "your bit.ly apikey"
re_shorten = re.compile(r"<shortUrl>(.+)</shortUrl>")
#define BOOST_PYTHON_STATIC_LIB
#include <boost/python.hpp>
#include <boost/ref.hpp>
#include <iostream>
namespace py = boost::python;
class IntValue
{
public:
#include <boost/unordered_map.hpp>
#include <map>
#include <list>
#include <typeinfo>
template <typename T>
class tree
{
public:
typedef T value_type;
from System.Diagnostics import Debug, Trace, TraceListener
from System.Reflection import BindingFlags, PropertyInfo
from Misuzilla.Net.Irc import NoticeMessage, PrivMsgMessage
from Misuzilla.Applications.TwitterIrcGateway import TraceLogger
from Misuzilla.Applications.TwitterIrcGateway.AddIns.DLRIntegration import DLRIntegrationAddIn
def get_trace_source(logger):
type = logger.GetType()
flags = BindingFlags.Instance | BindingFlags.NonPublic
property = type.GetProperty('TraceSource', flags)
#include <algorithm>
#include <vector>
#include <iostream>
int main()
{
std::vector<int> v;
for (int i = 0; i < 10; ++i) v.push_back(i);
struct { void operator ()(int n) { std::cout << n << std::endl; } } f;
#include <boost/mpl/vector.hpp>
#include <boost/mpl/for_each.hpp>
#include <iostream>
struct register_type
{
typedef boost::mpl::vector<> type;
template <typename T>
struct push_back