Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections.Generic;
using Newtonsoft.Json;
namespace jittest
{
public class Test
{
public void SerializeDeserialiseTest()
{
Mon Feb 14 18:57:13 Jamess-iPhone kernel[0] <Debug>: launchd[15717] Builtin profile: container (sandbox)
Mon Feb 14 18:57:13 Jamess-iPhone kernel[0] <Debug>: launchd[15717] Container: /private/var/mobile/Applications/1AF9CA8A-4F8B-4CCE-9B47-9AB3AB3F060A [69] (sandbox)
Mon Feb 14 18:57:16 Jamess-iPhone UIKitApplication:jittest[0x8a54][15717] <Notice>: Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for PredicateOf`1 ---> System.ExecutionEngineException: Attempting to JIT compile method 'System.Linq.Enumerable/PredicateOf`1<System.Collections.Generic.KeyValuePair`2<System.Reflection.ParameterInfo, object>>:.cctor ()' while running with --aot-only.
Mon Feb 14 18:57:16 Jamess-iPhone UIKitApplication:jittest[0x8a54][15717] <Notice>: --- End of inner exception stack trace ---
@jamesantrobus
jamesantrobus / TimeZoneNotFoundException - Console Output
Created February 13, 2011 03:25
Console output of TimeZoneNotFoundException being thrown from Newtonsoft.Json.MonoTouch
Sun Feb 13 03:07:50 Jamess-iPad UIKitApplication:jamesantrobus.myapp[0x2397][3826] <Notice>: Unhandled Exception: System.TimeZoneNotFoundException: Exception of type 'System.TimeZoneNotFoundException' was thrown.
Sun Feb 13 03:07:50 Jamess-iPad UIKitApplication:jamesantrobus.myapp[0x2397][3826] <Notice>: at System.TimeZoneInfo.get_Local () [0x00000] in <filename unknown>:0
Sun Feb 13 03:07:50 Jamess-iPad UIKitApplication:jamesantrobus.myapp[0x2397][3826] <Notice>: at Newtonsoft.Json.JsonConvert.GetUtcOffset (DateTime dateTime) [0x00000] in <filename unknown>:0
@jamesantrobus
jamesantrobus / OracleSample.sql
Created January 17, 2011 14:03
Part of the Oracle Academy training material provided to Universities
--Part of the Oracle Academy training material provided to Universities
create or replace
TRIGGER secure_employees
BEFORE INSERT OR UPDATE OR DELETE ON employees
BEGIN
secure_dml;
END secure_employees;
public class Test()
{}
@jamesantrobus
jamesantrobus / PDFTransformToImage.cs
Created January 9, 2011 15:38
Rough demo to transform a CGPDFPage to a UIImage with a given width
private UIImage TransformToImage(CGPDFPage page, Single width)
{
RectangleF pageRect = page.GetBoxRect(CGPDFBox.Media);;
Single pdfScale = width / pageRect.Size.Width;
pageRect.Size = new SizeF(pageRect.Size.Width*pdfScale, pageRect.Size.Height*pdfScale);
//pageRect.Origin = CGPointZero;
UIGraphics.BeginImageContext(pageRect.Size);
CGContext context = UIGraphics.GetCurrentContext();
UITableView tableView = new UITableView(UIScreen.MainScreen.Bounds, UITableViewStyle.Grouped);
tableView.BackgroundColor = UIColor.Clear;
@jamesantrobus
jamesantrobus / UITableViewSpike.cs
Created December 29, 2010 16:54
Failing background colour on UITableView (iPad only)
UITableView tableView = new UITableView(UIScreen.MainScreen.Bounds, UITableViewStyle.Grouped);
//this runs but the default grey colour remains
tableView.BackgroundColor = UIColor.Clear;
//this sets the background as needed
UIView testView = new UIView();
testView.BackgroundColor = UIColor.Clear;
tableView.BackgroundView = testView;
//code doesn't throw but the modal window isn't displayed
partial void openModalWindow (MonoTouch.UIKit.UIButton sender)
{
ModalViewController modal = new ModalSpike.ModalViewController
{
ModalTransitionStyle = UIModalTransitionStyle.CoverVertical,
ModalPresentationStyle = UIModalPresentationStyle.FormSheet
};
//code doesn't throw but the modal window isn't displayed
partial void openModalWindow (MonoTouch.UIKit.UIButton sender)
{
ModalViewController modal = new ModalSpike.ModalViewController
{
ModalTransitionStyle = UIModalTransitionStyle.CoverVertical,
ModalPresentationStyle = UIModalPresentationStyle.FormSheet
};