Skip to content

Instantly share code, notes, and snippets.

var r = new StringReader(ss);
var xmlreader = XmlReader.Create(r);
var doc = XamlReader.Load(xmlreader) as FixedDocument;
// get writer
LocalPrintServer server = new LocalPrintServer();
PrintQueue pq = server.DefaultPrintQueue;
var writer = PrintQueue.CreateXpsDocumentWriter(pq);
@podhmo
podhmo / gist:9067403
Created February 18, 2014 09:18
qr encode
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZXing;
using ZXing.Common;
using ZXing.QrCode;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Shapes;
using System.Windows.Media;
using System.Windows.Markup;
<Application x:Class="ScallableApplication.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>
<Style TargetType="Window" x:Key="FullScreenStyle">
<Setter Property="Height" Value="768"></Setter>
<Setter Property="Width" Value="1366"></Setter>
<Setter Property="WindowStyle" Value="None"></Setter>
<Setter Property="ResizeMode" Value="NoResize"></Setter>
l:DummyModel xmlns:l="clr-namespace:Application11">
<l:DummyModel.Age>10</l:DummyModel.Age>
<l:DummyModel.Name>foo</l:DummyModel.Name>
<l:DummyModel.IsActive>true</l:DummyModel.IsActive>
</l:DummyModel>
# -*- coding:utf-8 -*-
import logging
logger = logging.getLogger(__name__)
from collections import namedtuple
from io import StringIO
import sys
import json
class Converter(object):
@podhmo
podhmo / gist:9207824
Created February 25, 2014 12:21
focus
<Window x:Class="FocusSample.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Window.Resources>
<Style TargetType="TextBox">
<Setter Property="Height" Value="50"/>
<Setter Property="FontSize" Value="40"/>
</Style>
</Window.Resources>
<Application x:Class="FocusSample.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>
# -*- coding:utf-8 -*-
import sys
class Sample(object):
def __init__(self, n):
self.n = n
def __iter__(self):
for i in range(self.n):
print(i)
# -*- coding:utf-8 -*-
import sqlalchemy as sa
import sqlalchemy.orm as orm
from sqlalchemy.ext.declarative import declarative_base
Session = orm.scoped_session(orm.sessionmaker())
Base = declarative_base()
class A(Base):
__tablename__ = "A"