Skip to content

Instantly share code, notes, and snippets.

View jgold6's full-sized avatar

Jonathan Goldberger jgold6

View GitHub Profile
System.ExecutionEngineException: Attempting to JIT compile method
'(wrapper managed-to-native) System.Threading.Interlocked:Exchange
(System.Threading.Tasks.IContinuation&,System.Threading.Tasks.IContinuat
ion)' while running with --aot-only. See
http://docs.xamarin.com/ios/about/limitations for more information.
the web link given should be: http://docs.xamarin.com/guides/ios/advanced_topics/limitations/
@jgold6
jgold6 / gist:8565510
Created January 22, 2014 19:20
Monotouch.Dialog ReloadComplete() call causes topmost Element to scroll off screen.
public void DemoRefresh ()
{
int i = 0;
var root = new RootElement ("Pull to Refresh"){
new Section () {
new MultilineElement ("Pull from the top to add\na new item at the bottom\nThen wait 1 second")
}
};
var dvc = new DialogViewController (root, true);
@jgold6
jgold6 / gist:8603101
Last active January 4, 2016 09:39
LiveSDK Method
// Customer is getting this error in his binding project:
// /Users/apple/Downloads/AndroidBinding_LiveSDK/AndroidBinding_LiveSDK/obj/Debug/generated/src/Com.Microsoft.Live.LiveConnectClient.cs(59,59): Error CS0311: The type `System.IO.Stream' cannot be used as type parameter `TResult' in the generic type or method `Java.Interop.JavaObjectExtensions.JavaCast<TResult>(this Android.Runtime.IJavaObject)'. There is no implicit reference conversion from `System.IO.Stream' to `Android.Runtime.IJavaObject' (CS0311) (AndroidBinding_LiveSDK)
// For the below method:
// This method is explicitly implemented as a member of an instantiated Com.Microsoft.Live.ApiRequestAsync.IObserver
void global::Com.Microsoft.Live.ApiRequestAsync.IObserver.OnComplete (global::Java.Lang.Object p0)
{
OnComplete (global::Java.Interop.JavaObjectExtensions.JavaCast<System.IO.Stream>(p0));
}
[Activity(Label = "HelloTabsICS", MainLauncher = true)]
public class Activity1 : Activity
{
SampleTabFragment1 sf1;
SampleTabFragment2 sf2;
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
Second test:
Calling web service without SSL...<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ExecuteResponse xmlns="http://tempuri.org/">
<ExecuteResult>
<ResponseMethod>
<MethodDefinition>
<Name>MobileAccess.GetAppointments</Name>
<Version>1.0.0</Version>
int[] Num2 = new int[141]; //array for random numbers
// Fill the array with numbers from 0 to 140
for (int i = 0; i < Num2.Length; i++) {
Num2[i] = i;
}
// Shuffle Array
Random rnd = new Random((int)DateTime.Now.Ticks); // seed the random number generator based on the time so you don't get the same sequence repeatedly
for (int i = Num2.Length; i > 1; i--) {
// Pick random element to swap
public override void ViewDidLoad()
{
base.ViewDidLoad();
// Perform any additional setup after loading the view, typically from a nib.
UIWebView webView = new UIWebView(View.Frame);
this.View.AddSubview(webView);
string youTubeVideoHTML = @"<body><p>Testing</p><br><iframe width=""420"" height=""315"" src=""http://www.youtube.com/embed/Gw1ImiSR6Eg"" frameborder=""0"" allowfullscreen></iframe></body>";
webView.LoadHtmlString(youTubeVideoHTML, null);
Set the outlineView's hightStyle to "none":
outlineView.SelectionHighlightStyle = NSTableViewSelectionHighlightStyle.None;
Then in the NSOutlineViewDelegate:
public override void WillDisplayCell(NSOutlineView outlineView, NSObject cell, NSTableColumn tableColumn, NSObject item)
{
uint rowNo = (uint)outlineView.RowForItem(item);
NSColor backgroundColor;
1>------ Build started: Project: Core.Android, Configuration: Debug Any CPU ------
1> Core.Android -> C:\Users\apple\Documents\XamarinSupportProjects\Motis_DennisWelu_AndroidApp\Client\Core.Android\bin\Debug\Core.dll
2>------ Build started: Project: Nieron.Android, Configuration: Debug Any CPU ------
2>C:\Users\apple\Documents\XamarinSupportProjects\Motis_DennisWelu_AndroidApp\Client\packages\Microsoft.Bcl.Build.1.0.13\tools\Microsoft.Bcl.Build.targets(225,5): warning : All projects referencing Core.Android.csproj must install nuget package Microsoft.Bcl.Build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317569.
2> Nieron.Android -> C:\Users\apple\Documents\XamarinSupportProjects\Motis_DennisWelu_AndroidApp\Client\Nieron.Android\bin\Debug\Nieron.dll
3>Packaging application..
3>Microsoft (R) Build Engine version 4.0.30319.33440
3>[Microsoft .NET Framework, version 4.0.30319.34011]
3>Copyright (C) Microsoft Corporation. All rights reserved.
3>
@jgold6
jgold6 / gist:9538525
Last active August 29, 2015 13:57
GeoMoby Binding MetaData.xml file
<metadata>
<!-- It seemed that these may not have been needed? -->
<!-- <remove-node path="/api/package[@name='android.support.v4.content']/class[@name='AsyncTaskLoader.LoadTask']" />
<remove-node path="/api/package[@name='android.support.v4.content']/class[@name='CursorLoader']/method[@name='loadInBackground']" />-->
<!-- Added the following -->
<attr path="/api/package[@name='com.geomoby.async']/class[@name='ClickThroughAsyncTask']/method[@name='doInBackground']" name="managedName">_DoInBackground</attr>
<attr path="/api/package[@name='com.geomoby.async']/class[@name='GeoNamesAsyncTask']/method[@name='doInBackground']" name="managedName">_DoInBackground</attr>
<attr path="/api/package[@name='com.geomoby.async']/class[@name='RedeemAsyncTask']/method[@name='doInBackground']" name="managedName">_DoInBackground</attr>
</metadata>