Skip to content

Instantly share code, notes, and snippets.

Exception in thread "JavaFX Application Thread" java.lang.IllegalArgumentExcepti
on: Folder parameter must be a valid folder
at com.sun.glass.ui.CommonDialogs.convertFolder(CommonDialogs.java:239)
at com.sun.glass.ui.CommonDialogs.showFileChooser(CommonDialogs.java:191
)
at com.sun.javafx.tk.quantum.QuantumToolkit.showFileChooser(QuantumToolk
it.java:1514)
at javafx.stage.FileChooser.showDialog(FileChooser.java:413)
at javafx.stage.FileChooser.showOpenMultipleDialog(FileChooser.java:370)
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
"Assume the following is input into the terminal:"
class A:
x = 5
def waka(self, x):
self.x = x
def p(self):
print("from p method")
print(self.x)
"Fill in the following blanks with what the interactive terminal would output. The answer may be an error; the effect of some lines may have affect subsequent lines"
@Zhangerr
Zhangerr / readme.md
Created March 4, 2015 05:45
twitter phone interview questions
2 D grid. city blocks
. S .
x x .
. E .
start, end == (x ,y), (x, y)
int shortestPath(map, start, end) {
Queue q = new Queue();
Branch[] branches = getAllPossible(start);
@Zhangerr
Zhangerr / curious.py
Created March 4, 2015 05:38
interesting problem regarding frames
"""
What's the different in output between the following two functions?
HINT: look at environment diagram
"""
L = []
for i in range(10):
L.append(lambda: i)
for z in L:
@Zhangerr
Zhangerr / doge
Created February 16, 2015 23:10
:( inheritance hell
/**
* Created by azhang on 2/16/15.
*/
class test {
public static void main(String[] args) {
Animal fido = new Dog();
fido.speak(fido);
fido.speak((Dog) fido);
((Dog) fido).speak(fido);
((Dog) fido).speak((Dog) fido);
@Zhangerr
Zhangerr / diamond.js
Created October 4, 2014 19:46
Diamond generator
// *
// ***
// *****
// *******
// *********
// *******
// *****
// ***
// *
@Zhangerr
Zhangerr / quine.py
Created July 31, 2013 18:34
a simple little quine in python.
s = "s = {0}{1}{0};{2}print s.format(chr(34),s,chr(10))"
print s.format(chr(34),s,chr(10))
@Zhangerr
Zhangerr / fcntl.h
Created July 17, 2013 17:10
Flags for the linux syscall open in /usr/include/bits/fcntl.h
#define O_ACCMODE 0003
#define O_RDONLY 00
#define O_WRONLY 01
#define O_RDWR 02
#define O_CREAT 0100 /* not fcntl */
#define O_EXCL 0200 /* not fcntl */
#define O_NOCTTY 0400 /* not fcntl */
#define O_TRUNC 01000 /* not fcntl */
#define O_APPEND 02000
#define O_NONBLOCK 04000