Skip to content

Instantly share code, notes, and snippets.

View DavidYKay's full-sized avatar

David Young-Chan Kay DavidYKay

View GitHub Profile
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 / 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"
@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)
------------------------------------------------------------
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": {
{: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",
@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
@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 / error.log
Created March 25, 2015 17:29
Shrimp example: "Unable to mount WebDav" on attempting to connect to REPL
$ script/jscrepljs
[1] Shrimp on iPhone Simulator (ikong-home)
[R] Refresh
Choice: 1
java.lang.Exception: Unable to mount WebDAV at http://192.168.1.9:49153
at ambly.repl.jsc$mount_webdav.invoke(jsc.clj:260)
at ambly.repl.jsc$setup.invoke(jsc.clj:282)
@DavidYKay
DavidYKay / simple_cb.py
Last active June 26, 2023 00:52
Simple color balance algorithm using Python 2.7.8 and OpenCV 2.4.10. Ported from: http://www.morethantechnical.com/2015/01/14/simplest-color-balance-with-opencv-wcode/
import cv2
import math
import numpy as np
import sys
def apply_mask(matrix, mask, fill_value):
masked = np.ma.array(matrix, mask=mask, fill_value=fill_value)
return masked.filled()
def apply_threshold(matrix, low_value, high_value):
@DavidYKay
DavidYKay / crash.log
Created May 2, 2015 21:41
NullPointerException in RoboVM IntelliJ Plugin when loading project with 3 modules: ios, android, common
null
java.lang.NullPointerException
at org.robovm.idea.RoboVmPlugin.isRoboVmModule(RoboVmPlugin.java:338)
at org.robovm.idea.interfacebuilder.IBIntegratorModuleComponent.moduleAdded(IBIntegratorModuleComponent.java:46)
at com.intellij.openapi.module.impl.ModuleImpl.moduleAdded(ModuleImpl.java:232)
at com.intellij.openapi.module.impl.ModuleManagerImpl$6.run(ModuleManagerImpl.java:998)
at com.intellij.openapi.roots.impl.ProjectRootManagerImpl.makeRootsChange(ProjectRootManagerImpl.java:363)
at com.intellij.openapi.module.impl.ModuleManagerImpl.commitModel(ModuleManagerImpl.java:954)
at com.intellij.openapi.module.impl.ModuleManagerImpl.access$1300(ModuleManagerImpl.java:73)
at com.intellij.openapi.module.impl.ModuleManagerImpl$ModuleModelImpl.commitWithRunnable(ModuleManagerImpl.java:850)