sudo apt-get install python3-pip
sudo pip3 install virtualenv
/* | |
* Copyright (C) 2011 Patrik Åkerfeldt | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
val <T> LiveData<T>.blockingValue: T? | |
get() { | |
var value: T? = null | |
val latch = CountDownLatch(1) | |
observeForever { | |
value = it | |
latch.countDown() | |
} | |
if (latch.await(2, TimeUnit.SECONDS)) return value | |
else throw Exception("LiveData value was not set within 2 seconds") |
public class PlaygroundTests { | |
// Template test using Observables | |
// Reference: http://docs.couchbase.com/developer/java-2.0/observables.html | |
@Test | |
public void test_subscribe0() throws InterruptedException { | |
final CountDownLatch latch = new CountDownLatch(1); |
# This script was originally written during for a summer course that I | |
# gave at FGV in January 2011. The script was used to show the | |
# students how to retrive data from Banco Central do Brasil | |
# (http://bcb.gov.br/?SERIETEMP) using SOAP protocol and R. | |
library(SSOAP) | |
library(XML) | |
library(RCurl) | |
wsdl <- getURL("https://www3.bcb.gov.br/sgspub/JSP/sgsgeral/FachadaWSSGS.wsdl", |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
diff --git a/app/src/main/java/name/vampidroid/ui/widget/CardFilters.java b/app/src/main/java/name/vampidroid/ui/widget/CardFilters.java | |
index 4133e99..3ff912e 100644 | |
--- a/app/src/main/java/name/vampidroid/ui/widget/CardFilters.java | |
+++ b/app/src/main/java/name/vampidroid/ui/widget/CardFilters.java | |
@@ -19,6 +19,9 @@ import android.widget.LinearLayout; | |
import android.widget.SeekBar; | |
import android.widget.TextView; | |
+import java.util.Arrays; | |
+import java.util.List; |
ps aux | grep -v "grep" | grep -i firefox.app | awk '{print $2}' | xargs kill -CONT |
<?xml version="1.0" encoding="utf-8"?> | |
<shape xmlns:android="http://schemas.android.com/apk/res/android" | |
android:shape="rectangle" | |
android:padding="30dp" | |
android:fromDegrees="45" | |
android:toDegrees="45"> | |
<solid android:color="#00aadd"/> | |
<corners | |
android:radius="2dp" |
# Reference http://stackoverflow.com/questions/7741879/if-i-wanted-to-modify-task-switching-in-osx | |
# Reference http://apple.stackexchange.com/questions/36163/applescript-kill-command-error | |
# http://lists.apple.com/archives/applescript-users/2012/Nov/msg00070.html | |
# SIGCONT and SIGSTOP don't work in shell executed by applescript. | |
# Has to use numbers, or STOP/CONT w/o SIG or use "set +o posix" | |
# http://unixhelp.ed.ac.uk/CGI/man-cgi?signal+7 | |
# http://superuser.com/questions/14762/execute-applescript-without-open-the-editor | |
# http://stackoverflow.com/questions/13653358/how-to-log-objects-to-a-console-with-applescript | |
# http://lists.apple.com/archives/applescript-users/2013/Apr/msg00024.html | |
# http://en.wikipedia.org/wiki/AppleScript -- for on quit handler |