Skip to content

Instantly share code, notes, and snippets.

@TannerPerrien
TannerPerrien / UserProfileFragment.java
Last active August 29, 2015 14:06
Retrofit + RxJava + Data Manipulation (on background thread)
// mUserService is an instance of UserService, a Retrofit interface
mUserService
.getProfile(mUser.getId(), mUser.getSessionToken())
.observeOn(mComputationScheduler).map(new Func1<UserProfile, UserProfileModified>() {
@Override
public UserProfileModified call(UserProfile userProfile) {
// Code here executes on background thread
// Modify returned user profile as necessary
@TannerPerrien
TannerPerrien / Plugin.java
Last active December 16, 2015 08:19
Rapidminer Plugin.initAll()
/**
* Initializes all plugins if {@link RapidMiner#PROPERTY_RAPIDMINER_INIT_PLUGINS} is set. Plugins are searched for
* in the directory specified by {@link RapidMiner#PROPERTY_RAPIDMINER_INIT_PLUGINS_LOCATION} or, if this is not
* set, in the RapidMiner/lib/plugins directory.
*/
public static void initAll() {
// *** SURE ENOUGH, EMBEDDED_WITHOUT_UI WILL KEEP THIS FROM BEING CALLED ***
// only load managed extensions if execution modes indicates
if (RapidMiner.getExecutionMode().isLoadingManagedExtensions())
ManagedExtension.init();