Skip to content

Instantly share code, notes, and snippets.

View mgp's full-sized avatar

Michael Parker mgp

View GitHub Profile
package com.omgitsmgp;
import java.time.Duration;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executors;
import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
### Paradigms of Independence
* Effective interdependence can only be built on a foundation of true indepndence.
*
## The 7 Habits of Highly Effective People
### Part One: Paradigms and Principles
#### Inside Out
* The Character Ethic from early success defines the foundation of success as integrity, humility, fidelity, temperance, courage, justice, patience, industry, simplicity, modesty, and the Golden Rule.
* The Personality Ethic, by contrast, defines success a function of personality, of public image, of attitudes and behaviors, skills and techniques that lubricate the process of human interaction.
* If your character is fundamentally flawed, then if you employ good human relations techniques, you will be seen as manipulative. You will not be successful.
* The Personality Ethic may allow you to get by in short-term situations, but these secondary traits have no permanent worth in long-term relationships.
@mgp
mgp / gist:bfbd37e6262456d81603
Created March 3, 2016 19:15
observable chain notes
We often talk about subscribing to observables, and we talk about observables filtering or transforming values.
But to be pedantic, and to better our understanding, you aren't really subscribing to an observable itself.
Observables create subscriber chains.
Each call to subscribe does something. Either execute some work, or create the next node in a subscriber chain.
structure:
The structure of the subscriber chain resembles that of the obervable chain that creates it.
Whereas each observable has a parent observable, subscriptions are a bidirectional concept.
Each node in the subscriber chain has a list of nodes that are subscribed to it.
package org.khanacademy.core.net;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import org.khanacademy.core.exceptions.BaseRuntimeException;
import org.khanacademy.core.logging.KALogger;
import com.google.common.base.Optional;
import com.squareup.okhttp.Cache;
01-19 13:43:45.278 3576-3576/org.khanacademy.android.debug E/RxJavaErrorHandler: Unhandled onError.
01-19 13:43:45.278 3576-3576/org.khanacademy.android.debug E/RxJavaErrorHandler: java.lang.IllegalArgumentException: Attempt to inject a UserProgressManager with no user
01-19 13:43:45.278 3576-3576/org.khanacademy.android.debug E/RxJavaErrorHandler: at rx.android.internal.Preconditions.checkArgument(Preconditions.java:30)
01-19 13:43:45.278 3576-3576/org.khanacademy.android.debug E/RxJavaErrorHandler: at org.khanacademy.android.dependencies.modules.UserModule.lambda$progressManager$312(UserModule.java:60)
01-19 13:43:45.278 3576-3576/org.khanacademy.android.debug E/RxJavaErrorHandler: at org.khanacademy.android.dependencies.modules.UserModule.access$lambda$0(UserModule.java)
01-19 13:43:45.278 3576-3576/org.khanacademy.android.debug E/RxJavaErrorHandler: at org.khanacademy.android.dependencies.modules.UserModule$$Lambda$1.call(Unknown Source)
01-19 13:43:45.278 3576-3576/org.khanacademy.android
mgp-mbp:dex-method-counts mgp$ java -jar ./build/jar/dex-method-counts.jar ~/khan/android/app/build/outputs/apk/app-debug.apk
Processing /Users/mgp/khan/android/app/build/outputs/apk/app-debug.apk
Read in 40511 method IDs.
<root>: 40511
<default>: 1
android: 11057
accounts: 3
animation: 27
app: 219
bluetooth: 2
@mgp
mgp / gist:789e1024fe439af391f8
Created December 16, 2015 16:53
Android video player crash
12-16 11:39:27.094 2266-2266/org.khanacademy.android.debug E/RxJavaErrorHandler: Unhandled onError.
java.util.NoSuchElementException: Sequence contains no elements
at rx.internal.operators.OperatorSingle$ParentSubscriber.onCompleted(OperatorSingle.java:131)
at rx.internal.operators.OperatorTake$1.onCompleted(OperatorTake.java:53)
at rx.internal.operators.NotificationLite.accept(NotificationLite.java:140)
at rx.subjects.SubjectSubscriptionManager$SubjectObserver.accept(SubjectSubscriptionManager.java:319)
at rx.su
@mgp
mgp / gist:9fced22f1211168df1f2
Created December 14, 2015 20:48
proguard-exoplayer-1.5.3
Information:Gradle tasks [:app:assembleDebug]
Store file (/Users/mgp/khan/android/app/secrets/android.jks) does not exist.
If you need to sign a release build you need to download it from https://phabricator.khanacademy.org/F125352
Google Play API certificate (/Users/mgp/khan/android/app/secrets/Google_Play_Android_Developer.p12) does not exist.
If you need to publish a build you need to download it from https://phabricator.khanacademy.org/F125370
Could not find ZipAlign task. Did you specify a signingConfig for the variation Release?
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
//
// SearchFilterSequence.swift
// Khan Academy
//
// Created by Mike Parker on 12/2/15.
// Copyright © 2015 Khan Academy. All rights reserved.
//
import Foundation