Skip to content

Instantly share code, notes, and snippets.

View jonpryor's full-sized avatar

Jonathan Pryor jonpryor

View GitHub Profile
#/usr/bin/env perl -w
use strict;
use Mail::SPF;
my $spf_server = Mail::SPF::Server->new(
# Optional custom default for authority explanation:
default_authority_explanation => 'See http://www.%{d}/why/id=%{S};ip=%{I};r=%{R}',
max_dns_interactive_terms => 18
);
enum Test
{
Hello,
Heya
}
var test = Test.Hello;
Console.WriteLine(test.GetType().IsEnum);
Console.WriteLine("Property Count: {0}", test.GetType().GetProperties().Length);
$ csharp -r:System.Numerics.dll
Mono C# Shell, type "help;" for help
Enter statements below.
csharp> using System.Numerics;
csharp> var b = new BigInteger(3);
csharp> var r = BigInteger.Pow(b, 1000);
csharp> r;
1322070819480806636890455259752144365965422032752148167664920368226828597346704899540778313850608061963909777696872582355950954582100618911865342725257953674027620225198320803878014774228964841274390400117588618041128947815623094438061566173054086674490506178125480344405547054397038895817465368254916136220830268563778582290228416398307887896918556404084898937609373242171846359938695516765018940588109060426089671438864102814350385648747165832010614366132173102768902855220001
$ csharp
Mono C# Shell, type "help;" for help
Enter statements below.
csharp> v.GetType().FullName;
"System.Int16"
csharp> v += 1;
csharp> v.GetType().FullName;
"System.Int32"
csharp> v = int.MaxValue;
using System;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
using Android.Webkit;
diff --git a/mcs/tools/mkbundle/mkbundle.cs b/mcs/tools/mkbundle/mkbundle.cs
index 945522b..77cc712 100644
--- a/mcs/tools/mkbundle/mkbundle.cs
+++ b/mcs/tools/mkbundle/mkbundle.cs
@@ -14,10 +14,10 @@ using System.Xml;
using System.Collections.Generic;
using System.Reflection;
using System.IO;
+using System.IO.Compression;
using System.Runtime.InteropServices;
./de-DE/MyResources.resources.dll
./de-DE/Scratch.I18n.resources.dll
./fr-CA/MyResources.resources.dll
./fr-CA/Scratch.I18n.resources.dll
./MyResources.dll
./MyResources.dll.mdb
./Scratch.I18n.exe
./Scratch.I18n.exe.mdb
// To allow this project to build: https://dl.dropbox.com/u/15227809/Xamarin/HZLVBinding.zip
// Add a new file to the HZLVBinding project with these contents:
using Android.Runtime;
namespace Com.Devsmart.Android.UI {
partial class HorizontalListView {
protected override Java.Lang.Object RawAdapter {
get {return Adapter.JavaCast<Java.Lang.Object>();}
csharp> var x = XElement.Parse("<MEMLOC loc= '0x55E155' />");
csharp> x.Descendants("MEMLOC");
{ }
csharp> x.DescendantsAndSelf("MEMLOC");
{ <MEMLOC loc="0x55E155" /> }
csharp> x.DescendantNodes();
{ }
csharp> x.DescendantNodesAndSelf();
{ <MEMLOC loc="0x55E155" /> }
csharp>
using System;
using System.Linq;
using System.Threading;
class Test {
const int NumBusyWaiters = 10;
public static void Main ()
{
AppDomain.CurrentDomain.ProcessExit += (s, e) => {