Skip to content

Instantly share code, notes, and snippets.

Maybe<List<Long>> maybe = Maybe
.zip(
webViewRepository.getHabitReadArticle(webView),
habitReadArticleDao.getAll(),
new BiFunction<HabitReadArticleWebViewLocal, List<HabitReadArticle>, List<Long>>() {
@Override
public List<Long> apply(HabitReadArticleWebViewLocal habitReadArticleWebViewLocal, List<HabitReadArticle> habitReadArticles) throws Exception {
if (!hasSameArticleIds(habitReadArticleWebViewLocal, habitReadArticles)) {
return saveArticles(habitReadArticleWebViewLocal);
}
package jp.co.sample.presentation.navigation;
import android.net.Uri;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import jp.co.sample.BuildConfig;
import jp.co.sample.data.repositories.UserInfo;
public class WebViewUrlBuilder {
public class DialogUtils {
public static void showOkButtonDialog(Context context, String message) {
View view = LayoutInflater.from(context).inflate(R.layout.view_alert_dialog, null, false);
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(context);
builder.setView(view);
android.app.AlertDialog alert = builder.create();
ColorDrawable back = new ColorDrawable(android.graphics.Color.TRANSPARENT);
package jp.co.sample.presentation.navigation;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.support.v4.app.FragmentManager;
import jp.co.sample.R;
import jp.co.sample.utils.DialogUtils;
import timber.log.Timber;
package presentation;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.concurrent.Task;
import javafx.stage.Stage;
import presentation.navigator.MenuNavigator;
public class MainApp extends Application {
package presentation.utils;
import javafx.embed.swing.SwingFXUtils;
import javafx.scene.image.ImageView;
import javafx.scene.image.WritableImage;
import org.apache.batik.transcoder.TranscoderException;
import org.apache.batik.transcoder.TranscoderInput;
import org.apache.batik.transcoder.image.PNGTranscoder;
import java.awt.image.BufferedImage;
import java.io.FileNotFoundException;
from typing import List
from PIL import Image
import os
from zipfile import ZipFile, ZIP_DEFLATED
import glob
class Resize:
def __init__(self, root_dir_path: str, resize_param_list: List[object]):
@koifish082
koifish082 / list_utils.py
Created August 24, 2018 01:02
list_key_exist: It's like array_key_exists in php
class ListUtil:
@staticmethod
def list_key_exist(sample_list, index):
if len(sample_list) > index:
print(sample_list[index])
return
print("-1")
class MyProfileAdapter(
private var items: List<Favorite>,
private val myProfileViewModel: MyProfileViewModel,
) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
// -----------------
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
when (viewType) {
TYPE_HEADER -> {
return MyProfileViewHolderHeader(LayoutInflater
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".presentation.view.profile.MyProfileFragment">
<android.support.v7.widget.Toolbar
android:id="@+id/myProfileToolbar"