Skip to content

Instantly share code, notes, and snippets.

View chilversc's full-sized avatar

Chris Chilvers chilversc

View GitHub Profile
@chilversc
chilversc / Fob.hbm.xml
Created January 25, 2010 09:49
NHibernate insert/update problem
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-access="property" auto-import="true" default-cascade="none" default-lazy="true">
<class xmlns="urn:nhibernate-mapping-2.2" name="ValueMapping.Fob, ValueMapping, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" table="`Fob`">
<id type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<column name="id" />
<generator class="native" />
</id>
<property name="Something" type="System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<column name="Something" />
</property>
</class>
void Main()
{
int x = System.Net.IPAddress.HostToNetworkOrder((127 << 24) | 1);
var y = new System.Net.IPAddress(x);
Console.WriteLine(x);
Console.WriteLine(y);
}
create table Foo (data1 bit, data2 bit, data3 bit, seq int not null)
go
insert into Foo (data1, data2, data3, seq)
values (NULL, 0, 1, 1), (1, NULL, 0, 2), (0, 1, NULL, 3)
go
with unpivoted as (
select seq, value, col
from (select seq, data1, data2, data3 from Foo) a
@chilversc
chilversc / monodoc-style.css
Created December 31, 2009 02:10
Style for editing monodoc xml using tools such as oxygen
AssemblyInfo, TypeParameters, Base, MemberType, Parameters, ReturnValue
{
display: none;
}
TypeSignature {
display: block;
padding: 1em;
margin: 1em;
content: attr(Value);