Skip to content

Instantly share code, notes, and snippets.

View mauroa's full-sized avatar

Mauro Agnoletti mauroa

  • Microsoft
  • Buenos Aires, Argentina
View GitHub Profile
'Calculate Google Maps distance between two addresses
Public Function GetDistance(start As String, dest As String)
Dim firstVal As String, secondVal As String, lastVal As String
firstVal = "http://maps.googleapis.com/maps/api/distancematrix/json?origins="
secondVal = "&destinations="
lastVal = "&mode=car&language=pl&sensor=false&key=YOUR_KEY"
Set objHTTP = CreateObject("MSXML2.ServerXMLHTTP")
URL = firstVal & Replace(start, " ", "+") & secondVal & Replace(dest, " ", "+") & lastVal
objHTTP.Open "GET", URL, False
objHTTP.setRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
<entry>
<record>2540</record>
<time>2018/02/08 17:30:59.303</time>
<type>Error</type>
<source>VisualStudio</source>
<description>LegacySitePackage failed for package [XamarinAndroidPackage]Source: &apos;Xamarin.AndroidTools&apos; Description: Must call AndroidSdk.Refresh() first!&#x000D;&#x000A;System.InvalidOperationException: Must call AndroidSdk.Refresh() first!&#x000D;&#x000A; at Xamarin.AndroidTools.AndroidSdk.SetPreferredJavaSdkPath(String path) in C:\Users\mag\Git\xvs\External\androidtools\Xamarin.AndroidTools\AndroidSdk.cs:line 356&#x000D;&#x000A; at Xamarin.VisualStudio.Android.Services.AndroidToolsSdk.set_JavaSdkPath(String value) in C:\Users\mag\Git\xvs\src\Core\VisualStudio.Android\Services\AndroidToolsSdk.cs:line 414&#x000D;&#x000A; at Xamarin.VisualStudio.Android.Services.AndroidToolsSdk.InitializeJavaSdk(Boolean isFirstRun) in C:\Users\mag\Git\xvs\src\Core\VisualStudio.Android\Services\AndroidToolsSdk.cs:line 516&#x000D;&#x000A; at Xamarin.VisualStudio.Android.Servic
Xamarin.Messaging.Client.AgentConsoleRunner: Error: 0: An unexpected error occurred and the agent 'IDB 4.8.0.539' will be terminated
System.IO.FileNotFoundException: Could not load file or assembly 'Polly' or one of its dependencies
File name: 'Polly'
at System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef, System.Security.Policy.Evidence assemblySecurity) [0x001a9] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/corlib/System/AppDomain.cs:777
at (wrapper remoting-invoke-with-check) System.AppDomain:Load (System.Reflection.AssemblyName,System.Security.Policy.Evidence)
at System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef) [0x00000] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/corlib/System/AppDomain.cs:714
at (wrapper remoting-invoke-with-check) System.AppDomain:Load (System.Reflection.AssemblyName)
at System.Reflection.Assembly.Load (System.Reflection.AssemblyName assemblyRef) [0
@mauroa
mauroa / mqttclient
Created June 29, 2017 12:38
System.Net.Mqtt client sample
//Note that you can set more properties and also not set the port,
//in which case the MQTT default will be used
var configuration = new MqttConfiguration { Port = 55555 };
//Creation of the MQTT client
var client = await MqttClient.CreateAsync("192.168.1.29", configuration);
//MQTT connection of the client. You can pass optional args to the
//ConnectAsync method and credentials
await client.ConnectAsync(new MqttClientCredentials("testClient"));
@mauroa
mauroa / LaunchDeviceError
Created August 17, 2016 18:50
LaunchDeviceError
Xamarin.Messaging.Client.AgentConsoleRunner Information: 0 : [2016-08-17 23:57:45.8462] ==== :: Xamarin :: 4.2.0.515-cycle8+f83e26d ====
Xamarin.Messaging.Client.AgentConsoleRunner Information: 0 : [2016-08-17 23:57:45.9660] Starting IDB 4.2.0.515...
Xamarin.Messaging.IDB.IDBAgent Information: 0 : [2016-08-17 23:57:50.2299] Starting Agent: IDB 4.2.0.515 (PID=15229)
Xamarin.Messaging.IDB.IDBAgent Information: 0 : [2016-08-17 23:57:50.5704] IDB 4.2.0.515 agent started
Xamarin.Messaging.IDB.Handlers.LaunchAppMessageHandler Error: 0 : [2016-08-18 00:01:36.7250] USB connect timeout (ENODATA), likely because the app failed to launch. Please review device logs and/or crash reports for more information.
System.IO.IOException: USB connect timeout (ENODATA), likely because the app failed to launch. Please review device logs and/or crash reports for more information.
at Xamarin.MacDev.AggregateAsyncResult.CheckError (System.Boolean cancelled) [0x00038] in <a9944eaa3dd24951bedbcec49fb6bdcd>:0
at Xamarin.MacDev.IPhon
@mauroa
mauroa / IDBError
Created August 17, 2016 04:03
IDB Launch App Error
Xamarin.Messaging.Client.AgentConsoleRunner Information: 0 : [2016-08-16 22:56:35.9968] ==== :: Xamarin :: 4.2.0.495-cycle8+5920e67 ====
Xamarin.Messaging.Client.AgentConsoleRunner Information: 0 : [2016-08-16 22:56:36.0032] Starting IDB 4.2.0.495...
Xamarin.Messaging.IDB.IDBAgent Information: 0 : [2016-08-16 22:56:40.3266] Starting Agent: IDB 4.2.0.495 (PID=14505)
Xamarin.Messaging.IDB.IDBAgent Information: 0 : [2016-08-16 22:56:40.9532] IDB 4.2.0.495 agent started
Xamarin.Messaging.IDB.MTouch Information: 0 : [2016-08-16 22:57:55.5995] /Users/macbook/Library/Caches/Xamarin/XMA/Agents/IDB/4.2.0.495/mlaunch --devname "iPhone 6s" --installdev "/Users/macbook/Library/Caches/Xamarin/mtbs/builds/App20/f202e3f04783d316071ba68bb93139ca/bin/iPhone/Debug/App20.app" -argument=-monodevelop-port -argument=10000 -argument=-connection-mode -argument=usb --sdkroot "/Applications/Xcode.app/Contents/Developer" -sdk 9.3
Xamarin.Messaging.IDB.MTouch Information: 0 : [2016-08-16 22:57:57.5565] Installing application bundle 'com
<entry>
<record>576</record>
<time>2016/08/04 19:27:09.506</time>
<type>Error</type>
<source>VisualStudio</source>
<description>LegacySitePackage failed for package [XamarinIOSPackage]Source: &apos;Clide&apos; Description: Object reference not set to an instance of an object.&#x000D;&#x000A;System.NullReferenceException: Object reference not set to an instance of an object.&#x000D;&#x000A; at Clide.Host.Initialize(IServiceProvider hostingPackage)&#x000D;&#x000A; at Xamarin.VisualStudio.TastyPackage.Initialize() in C:\GitHub\XVS\src\Core\VisualStudio\FlavorProject\TastyPackage.cs:line 160&#x000D;&#x000A; at Xamarin.VisualStudio.IOS.XamarinIOSPackage.Initialize() in C:\GitHub\XVS\src\Core\VisualStudio.IOS\XamarinIOSPackage.cs:line 298&#x000D;&#x000A; at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsPackage.SetSite(IServiceProvider sp)</description>
<guid>{77875FA9-01E7-4FEA-8E77-DFE942355CA1}</guid>
<hr>80004003 - E_POINTER</hr>
<errorinfo><
@mauroa
mauroa / a - summary
Last active July 14, 2016 20:10
Designer Send Payload Performance
- Each Storyboard render action sends 3 differents messages from VS to XMA on the Mac
- Each message received on the Mac, logs 4 different time measures (Getting Designer Server connection, Deserializing designer command, Forwarding designer command, Forwarding designer response)
- The time measure that takes the most time is "Forwarding designer command". The line of code of that action is:
//Connection is an instance of MonoTouch.Design.Client.ServerProcessConnection
connection.SendRequest (request, throwIfNotRunning), out sendRequestMillisecs);
- When there is no csproxy process, that action takes a lot of time for the first message of three: ~ 55 secs, ~ 32 secs, ~40 secs for the three renders
@mauroa
mauroa / Localization
Created July 7, 2016 15:53
Localization fusion log
*** Assembly Binder Log Entry (07/07/2016 @ 12:50:43 p.m.) ***
The operation was successful.
Bind result: hr = 0x0. The operation completed successfully.
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable C:\GitHub\XVS\src\Tools\Xamarin.VisualStudio.iOS.DocSync\bin\Debug\DocSync.vshost.exe
--- A detailed error log follows.
=== Pre-bind state information ===
@mauroa
mauroa / error
Created April 6, 2016 14:50
Xamarin Studio launch error
FATAL ERROR [2016-04-06 11:47:48Z]: Xamarin Studio failed to start
System.NullReferenceException: Object reference not set to an instance of an object
at MonoDevelop.MacIntegration.MainToolbar.SearchBar+DarkSkinSearchFieldCell.DrawWithFrame (CGRect cellFrame, AppKit.NSView inView) [0x000c6] in /Users/builder/data/lanes/2920/afa59cd8/source/monodevelop/main/src/addins/MacPlatform/MainToolbar/SearchBar.cs:82
at (wrapper managed-to-native) GLib.Object:g_object_set_property (intptr,intptr,GLib.Value&)
at GLib.Object.SetProperty (System.String name, Value val) <0x116943f80 + 0x0004e> in <filename unknown>:0
at Gtk.Widget.set_Visible (Boolean value) <0x116ca9900 + 0x00082> in <filename unknown>:0
at MonoDevelop.Ide.Gui.Workbench.Show (System.String workbenchMemento) [0x0005f] in /Users/builder/data/lanes/2920/afa59cd8/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:129
at MonoDevelop.Ide.IdeApp.Initialize (MonoDevelop.Core.ProgressMonitor monitor) [0x001be] in /User