Skip to content

Instantly share code, notes, and snippets.

java.lang.NullPointerException
at model.common.Vault.findPrivateCall(Vault.java:77)
at model.item.ItemVault.find(ItemVault.java:51)
at common.command.AddItemCommandTest.testCreatedProduct(AddItemCommandTest.java:59)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
java.lang.NullPointerException
at model.item.Item.getProduct(Item.java:81)
at model.item.Item.getExpirationDate(Item.java:152)
at model.item.Item.getIsExpired(Item.java:284)
at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at model.common.Vault.linearSearch(Vault.java:166)
at model.common.Vault.findAllPrivateCall(Vault.java:129)
at model.item.ItemVault.findAll(ItemVault.java:63)
@mrmurphy
mrmurphy / gist:4357628
Created December 22, 2012 05:34
Interactive session describing unexpected behavior within pymel
>> import pymel.core as pm
Warning: file: /Applications/Autodesk/maya2013/Maya.app/Contents/bin/../scripts/startup/initialStartup.mel line 192: Y-axis is already the Up-axis
## The matrix initializes as expected.
>>> spam = pm.datatypes.Matrix(1,2,3)
>>> print spam.formated()
[[1.0, 2.0, 3.0, 0.0],
[1.0, 2.0, 3.0, 0.0],
[1.0, 2.0, 3.0, 0.0],
[1.0, 2.0, 3.0, 0.0]]
#!/bin/bash
#Heith Seewald 2012
#Feel free to extend/modify to meet your needs.
#Maya on Ubuntu v.1
#This is the base installer... I’ll add more features in later versions.
#if you have any issues, feel free email me at heiths@gmail.com
#### Lets run a few checks to make sure things work as expected.
#Make sure we’re running with root permissions.
if [ `whoami` != root ]; then
@mrmurphy
mrmurphy / Error
Last active December 16, 2015 03:59
This is the code I have, but this is the error I get back after clicking the 'search' button:
Exception from Deps recompute: Error: Error copying attribute '"': Error: InvalidCharacterError: DOM Exception 5
at Function.Spark._Patcher._copyAttributes (http://localhost:3000/packages/spark/patch.js?299cb25985c501315fbd758353d7f498697a39c3:494:19)
at Spark._Patcher.match (http://localhost:3000/packages/spark/patch.js?299cb25985c501315fbd758353d7f498697a39c3:249:26)
at http://localhost:3000/packages/spark/patch.js?299cb25985c501315fbd758353d7f498697a39c3:61:23
at visitNodes (http://localhost:3000/packages/spark/patch.js?299cb25985c501315fbd758353d7f498697a39c3:17:11)
at visitNodes (http://localhost:3000/packages/spark/patch.js?299cb25985c501315fbd758353d7f498697a39c3:18:9)
at visitNodes (http://localhost:3000/packages/spark/patch.js?299cb25985c501315fbd758353d7f498697a39c3:18:9)
at visitNodes (http://localhost:3000/packages/spark/patch.js?299cb25985c501315fbd758353d7f498697a39c3:18:9)
@mrmurphy
mrmurphy / gist:5833589
Created June 21, 2013 19:14
A little python script to find a .venv file in a parent directory and activate that virtual environment. Requirements: virtualenv virtualenvwrapper Notes: Does not search above the user's home directory.
#! /usr/bin/python
import os
HOME = os.getenv("HOME")
VENVDIR = os.path.join(HOME, ".venvs") # <-- Change this to your venv dir.
VENVFILENAME = ".venv"
def main():
pwd = os.getcwd().split(os.sep)
$default_sort_order = '[
"-webkit-animation",
"-moz-animation",
"-ms-animation",
"-o-animation",
"animation",
"-webkit-animation-delay",
"-moz-animation-delay",
"-ms-animation-delay",
"-o-animation-delay",
@mixin columns ($span: $cols of $cont-cols after $shift clearing $clear, $display: block ) {
$cols: nth($span, 1);
$cont-cols: nth($span, 3);
$shift: nth($span, 5);
$clear: nth($span, 7);
@include span-columns( $cols of $cont-cols, $display );
@include shift($shift);
@if $clear != 0 {
margin-right: ($clear * flex-gutter()) + flex-grid($clear);
@mrmurphy
mrmurphy / gist:6512784
Created September 10, 2013 17:32
Fresh docker install error
vagrant@precise64 ~> sudo docker pull base
Pulling repository base
b750fe79269d: Error pulling image (ubuntu-quantl) from base, endpoint: https://cdn-registry-1.docker.io/v1/, exit status 2: tar: Ignoring unknown extended header keyword `SCHILY.fflags'
gzip: stdin: unexpected end of file
tar: Unexpected EOF in archive
b750fe79269d: Error pulling image (ubuntu-quantl) from base, exit status 2: tar: Ignoring unknown extended header keyword `SCHILY.fflags'
gzip: stdin: unexpected end of file
tar: Unexpected EOF in archive
@mrmurphy
mrmurphy / gist:7345485
Created November 6, 2013 22:37
Coffeescript Binary Search (By Ryan Shaw)
binaryFindClosest = (haystack, needle) ->
closestBelow = 0
closestAbove = haystack.length - 1
middle = Math.floor (closestBelow + closestAbove) / 2
while haystack[middle] isnt needle and closestBelow < closestAbove
if needle < haystack[middle]
closestAbove = middle - 1
else if needle > haystack[middle]
closestBelow = middle + 1