Skip to content

Instantly share code, notes, and snippets.

View sushihangover's full-sized avatar

Robert N. sushihangover

View GitHub Profile
@sushihangover
sushihangover / EasyLayout.cs
Created November 23, 2017 20:05 — forked from praeclarum/EasyLayout.cs
EasyLayout makes writing auto layout code in Xamarin.iOS easier. See [the example](https://gist.github.com/praeclarum/8185036) for hints on how to use this library.
//
// Copyright (c) 2013-2015 Frank A. Krueger
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
@sushihangover
sushihangover / TestAppViewController.cs
Created September 19, 2016 16:38 — forked from brendanzagaeski/TestAppViewController.cs
Obtaining the subnet mask of network interfaces on Xamarin.iOS and Xamarin.Mac
// Obtaining the subnet mask of network interfaces on Xamarin.iOS and Xamarin.Mac
//
// On Xamarin.iOS and Xamarin.Mac, `NetworkInterface.OperationalStatus` always
// returns: `OperationalStatus.Unknown`
// https://github.com/mono/mono/blob/f48ceb9860676c342f4c91fbc2e34ea600d839c6/mcs/class/System/System.Net.NetworkInformation/NetworkInterface.cs#L552-L556
//
// Additionally, on all "Linux-like" platforms, including iOS and Mac,
// `UnicastIPAddressInformation.IPv4Mask` is not implemented
// https://github.com/mono/mono/blob/f48ceb9860676c342f4c91fbc2e34ea600d839c6/mcs/class/System/System.Net.NetworkInformation/UnicastIPAddressInformation.cs#L165-L167
//
@sushihangover
sushihangover / ParentViewController.Keyboard.cs
Created August 31, 2016 13:06 — forked from redent/ParentViewController.Keyboard.cs
Parent view controller to handle keyboard notifications to center views in the screen. UIScrollView related methods moved to an extension class.
using System;
using Foundation;
using UIKit;
using TwinCoders.TouchUtils.Extensions;
using CoreGraphics;
namespace SalesForce.Touch.Views
{
public abstract partial class ParentViewController
{
@sushihangover
sushihangover / XamarinScrollableListView.cs
Created August 8, 2016 13:10 — forked from PiMaker/XamarinScrollableListView.cs
A custom ListView for Xamarin.Android that enables scrolling via moving a DragShadow to the top or bottom.
// File: XamarinScrollableListView.cs
// Created: 27.07.2016
//
// This class represents a custom View. It inherits from ListView but adds automatic Drag and Drop scrolling.
using Android.Content;
using Android.Runtime;
using Android.Util;
using Android.Views;
using Android.Widget;
open System
open Neo4jClient
open System.Linq
[<CLIMutable>]
type Person = { Name:string; Twitter:string }
[<CLIMutable>]
type Knows = { How:string }

Movie Recommendations with k-Nearest Neighbors and Cosine Similarity


Introduction

The k-nearest neighbors (k-NN) algorithm is among the simplest algorithms in the data mining field. Distances / similarities are calculated between each element in the data set using some distance / similarity metric ^[1]^ that the researcher chooses (there are many distance / similarity metrics), where the distance / similarity between any two elements is calculated based on the two elements' attributes. A data element’s k-NN are the k closest data elements according to this distance / similarity.


1. A distance metric measures distance; the higher the distance the further apart the neighbors. A similarity metric measures similarity; the higher the similarity the closer the neighbors.
@sushihangover
sushihangover / xamarinandroidbindings.md
Created April 15, 2016 17:38 — forked from JonDouglas/xamarinandroidbindings.md
Xamarin Android Bindings Troubleshooting

Approaching a Xamarin.Android Bindings Case

1. Investigation

One of the best ways to investigate a problematic Xamarin.Android Binding is to first ensure you have the proper tooling available:

%{
using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
namespace MarkdownParser
{
class Counter
{
@sushihangover
sushihangover / AppController.cs
Created January 9, 2016 03:42 — forked from grexican/AppController.cs
Windowless Mac App with MonoMac
using System;
using MonoMac.Foundation;
using MonoMac.AppKit;
namespace StatusMenu
{
[Register("AppController")]
public partial class AppController : NSObject
{
public AppController()
@sushihangover
sushihangover / genymotionwithplay.txt
Created January 6, 2016 23:46 — forked from wbroek/genymotionwithplay.txt
Genymotion with Google Play Services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?fid=23501681358544845 - gapps-kk-20140606-signed.zip)
Google Apps for Android 4.3 (https://www.androidfilehost.com/?fid=23060877490000124 - gapps-jb-20130813-signed.zip)