View singleton_with_context.java
public class MySingleton {
private static MySingleton sInstance;
private final Context mContext;
private MySingleton(Context context) {
mContext = context.getApplicationContext();
}
public getInstance(Context context) {
synchronized (MySingleton.class) {
View mingw-w64-3.10-osx10.9.sh
#!/bin/sh
# check_error my_cmd --param ...
check_error() {
$* # we execute everything
if [ $? -ne 0 ]; then
echo "check_error(): There's an error with the following command:"
echo "check_error(): $*"
echo "check_error(): Do you want to continue? [y/N]"
read a