(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.
(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.
| /** | |
| * Luhn Class is an implementation of the Luhn algorithm that checks validity of a credit card number. | |
| * | |
| * @author <a href="http://www.chriswareham.demon.co.uk/software/Luhn.java">Chris Wareham</a> | |
| * @version Checks whether a string of digits is a valid credit card number according to the Luhn algorithm. 1. Starting with the second to last digit and | |
| * moving left, double the value of all the alternating digits. For any digits that thus become 10 or more, add their digits together. For example, | |
| * 1111 becomes 2121, while 8763 becomes 7733 (from (1+6)7(1+2)3). 2. Add all these digits together. For example, 1111 becomes 2121, then 2+1+2+1 is | |
| * 6; while 8763 becomes 7733, then 7+7+3+3 is 20. 3. If the total ends in 0 (put another way, if the total modulus 10 is 0), then the number is valid | |
| * according to the Luhn formula, else it is not valid. So, 1111 is not valid (as shown above, it comes out to 6), while 8763 is valid (as shown | |
| * above, it comes ou |
| <?xml version="1.0" encoding="utf-8"?> | |
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
| package="com.example" | |
| android:versionCode="1" | |
| android:versionName="1.0"> | |
| <uses-sdk android:minSdkVersion="8"/> | |
| <uses-permission android:name="android.permission.READ_CONTACTS" /> | |
| <application android:label="@string/app_name"> |
| android { | |
| signingConfigs { | |
| release | |
| } | |
| buildTypes { | |
| release { | |
| signingConfig signingConfigs.release | |
| } |
| package rx.examples.groovy; | |
| import rx.observables.Observable | |
| import rx.observables.Observer; | |
| import rx.observables.Subscription; | |
| import rx.util.functions.Func1; | |
| import java.util.concurrent.ExecutorService; | |
| import java.util.concurrent.LinkedBlockingQueue; | |
| import java.util.concurrent.ThreadPoolExecutor; | |
| import java.util.concurrent.TimeUnit; |