Skip to content

Instantly share code, notes, and snippets.

View DavidYKay's full-sized avatar

David Young-Chan Kay DavidYKay

View GitHub Profile
@DavidYKay
DavidYKay / exception.log
Created March 6, 2015 17:45
Exception log for Contacts.Plugin.Android: "the bind value at index 20 is null"
[MonoDroid] UNHANDLED EXCEPTION:
[MonoDroid] Java.Lang.IllegalArgumentException: Exception of type 'Java.Lang.IllegalArgumentException' was thrown.
[MonoDroid] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0
[MonoDroid] at Android.Runtime.JNIEnv.CallObjectMethod (IntPtr jobject, IntPtr jmethod, Android.Runtime.JValue[] parms) [0x00000] in <filename unknown>:0
[MonoDroid] at Android.Content.ContentResolver.Query (Android.Net.Uri uri, System.String[] projection, System.String selection, System.String[] selectionArgs, System.String sortOrder) [0x00000] in <filename unknown>:0
[MonoDroid] at Contacts.Plugin.ContactHelper+<GetContacts>d__19.MoveNext () [0x00000] in <filename unknown>:0
[MonoDroid] at Contacts.Plugin.ContactHelper+<GetContacts>d__9.MoveNext () [0x00000] in <filename unknown>:0
[MonoDroid] at Contacts.Plugin.ContactReader+<GetEnumerator>d__4.MoveNext () [0x00000] in <filename unknown>:0
[MonoDroid] at System.Linq.Enumerable+<Cr
@DavidYKay
DavidYKay / watershed.py
Created March 2, 2015 17:49
watershed example from Python OpenCV
#!/usr/bin/python
import urllib2
import sys
import cv2.cv as cv
class Sketcher:
def __init__(self, windowname, dests):
self.prev_pt = None
self.windowname = windowname
self.dests = dests
{:kind "plus#activity",
:annotation "An exemplar of Internet society.",
:etag "\"YFr-hUROXQN7IOa3dUHg9dQ8eq0/jI7ahl6Ey1kNnsd1GejZ1bUaDAY\"",
:access {:kind "plus#acl",
:description "Public",
:items [{:type "public"}]},
:object {:content "<br /><br /><a rel=\"nofollow\" class=\"ot-hashtag\" href=\"https://plus.google.com/s/%23funny\">#funny</a>",
:replies {:totalItems 0,
:selfLink "https://www.googleapis.com/plus/v1/activities/z12hid2qmvnihhx3p22zurijnzjjjddws04/comments"},
:attachments [{:objectType "photo",
------------------------------------------------------------
updateComments:(person:(firstName)
------------------------------------------------------------
Result: Behaves a lot like the updateComments call. Person object comes back empty.
URL: https://api.linkedin.com/v1/companies/1694/updates:(updateComments:(person:(firstName)))
Response:
{
"cookies": {
@DavidYKay
DavidYKay / crash.log
Created June 30, 2014 17:41
Three-turn video crash
E/AndroidRuntime(14736): Process: com.dl.skatefreshAdvancePartTwo, PID: 14736
E/AndroidRuntime(14736): java.lang.IllegalStateException
E/AndroidRuntime(14736): at android.media.MediaPlayer.prepareAsync(Native Method)
E/AndroidRuntime(14736): at android.widget.VideoView.openVideo(VideoView.java:335)
E/AndroidRuntime(14736): at android.widget.VideoView.access$2100(VideoView.java:71)
E/AndroidRuntime(14736): at android.widget.VideoView$7.surfaceCreated(VideoView.java:607)
E/AndroidRuntime(14736): at android.view.SurfaceView.updateWindow(SurfaceView.java:572)
E/AndroidRuntime(14736): at android.view.SurfaceView.access$000(SurfaceView.java:86)
E/AndroidRuntime(14736): at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:175)
E/AndroidRuntime(14736): at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:847)
@DavidYKay
DavidYKay / dualhead-xorg.conf
Last active August 2, 2022 18:25
X11 Config for dual / single screen NVIDIA TwinView.
# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings: version 280.13 (buildd@rothera) Fri Aug 5 12:28:41 UTC 2011
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 0 0
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
Option "Xinerama" "0"
public class Deadlock {
static class Friend {
private final String name;
public Friend(String name) {
this.name = name;
}
public String getName() {
return this.name;
}
public void bow(Friend bower) {
@DavidYKay
DavidYKay / video.java
Created May 25, 2013 20:00
Simple VideoView code. Works in an Activity but not a Fragment.
VideoView video = (VideoView) findViewById(R.id.video);
//save video that is in assets folder into root of sd card to play
video.setVideoPath("http://www.androidbegin.com/tutorial/AndroidCommercial.3gp");
video.start();
@DavidYKay
DavidYKay / git-sub.sh
Created May 7, 2013 19:10
Git search and replace
#!/bin/bash
#~/.scripts/git-sub
#Author: Khaja Minhajuddin <minhajuddin@cosmicvent.com>
#script which does a global search and replace in the git repository
#it takes two arguments
#e.g. git sub OLD NEW
old=$1
new=$2
{"fetchResponse":{"responseCode":"NEW","responseCodeInt":4,"success":true,"data":[{"duration":0,"plannedEffort":90000000,"dates":{"plannedEarlyStart":"2013-01-01T23:54:24+0000","plannedEarlyFinish":"2013-12-31T23:54:24+0000","plannedLateStart":"2013-01-01T23:54:24+0000","plannedLateFinish":"2013-12-31T23:54:24+0000"},"resources":[{"personID":"512ce2e3e4b0355eee5044cf","billable":true,"subID":0}],"schedConstraints":[],"billable":false,"scheduled":false,"milestone":false,"externalService":false,"client":160,"text":[{"textType":"BusText","language":"en","text":"First Stage","original":false,"subID":0}],"hierarchies":[],"busUnits":["5123c186e4b06624ba84f79d"],"extID":"PRJ006-1","responsible":"512ce2e3e4b0355eee5044cf","assigned":["512ce2e3e4b0355eee5044cf"],"categories":[],"recentHistory":[],"files":[],"updateLock":false,"tags":[],"comments":[],"messages":[],"template":false,"intStatus":0,"id":"512d4b9ae4b0320061c843d8","createdOn":"2013-02-26T23:56:10+0000","createdBy":"512ce2e3e4b0355eee5044ce","changedOn":"201