This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BehaviorProcessor<List<Article>> articleList = BehaviorProcessor.create(); | |
LocalDataSource(ArticleDao articleDao) { | |
this.articleDao = articleDao; | |
articleDao.subscribeOn(Schedulars.io()).getAll().subscribe(articleList::onNext) | |
} | |
public Completable saveArticles(List<Article> article) { | |
return Completable.fromAction(() -> articleDao.insert(article)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// ArticleViewModel.java | |
disposables.addAll( | |
articleService.getArticles() | |
.subscribeOn(Schedular.io()) | |
.subscribe(() -> { }, e -> {}), | |
articleService.observeArticles() | |
.toSingle() | |
.observeOn(Android.mainthread()) | |
.subscribe(list -> view::bind) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class EndlessRecyclerViewScrollListener extends RecyclerView.OnScrollListener { | |
// The minimum amount of items to have below your current scroll position | |
// before loading more. | |
private int visibleThreshold = 5; | |
// The current offset index of data you have loaded | |
private int currentPage = 0; | |
// The total number of items in the dataset after the last load | |
private int previousTotalItemCount = 0; | |
// True if we are still waiting for the last set of data to load. | |
private boolean loading = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from requests_oauthlib import OAuth1Session | |
import configparser | |
import json | |
import csv | |
config = configparser.ConfigParser() | |
config.read('config.txt') | |
url = 'https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=tomoaki_imai&count=200&exclude_replies=true' | |
params = {} | |
options = config["keys"] | |
twitter = OAuth1Session(options["ConsumerKey"], options["ConsumerSecret"], options["AccessToken"], options["AccessSecret"]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Custom implementation of {@Link android.database.CursorJoiner.java} | |
* Does a join on two cursors using specific columns. This class allows join by int type. | |
* Tomoaki Imai 2016 | |
* reference: http://poly.hatenablog.com/entry/20101006/p1 | |
* MIT License | |
* Permission is hereby granted, free of charge, to any person obtaining | |
* a copy of this software and associated documentation files (the | |
* "Software"), to deal in the Software without restriction, including | |
* without limitation the rights to use, copy, modify, merge, publish, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
価格帯は¥500以上、¥2000以下でソート | |
``` | |
for (Entry<String, Integer> entry : entries) { | |
result.put(entry.getKey(), entry.getValue()); | |
if ((entry.getValue() >= 1)) { | |
try { | |
int price = Integer.parseInt(entry.getKey()); | |
if(price >500 && price < 2000){ | |
System.out.println("" + entry.getValue() +"\t\t" + price); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
id,tweet,retweetCount,isRetweetedByMe,favCount,date | |
,平成27年12月30日水曜日、ラーメン二郎 三田本店、大ラーメン ニンニク 650YEN<n>麺、ツルとしてザクザク喰えるもの。<n>汁、ウンメ〜ッ!スッキリと飲みやすい汁、カラダに優しい癒し汁。<n>ぶた、プリップリで脂身甘いもの。<n>完飲。 https://t.co/F48ssmuRce,511,false,430,2015/12/30 10:18:10 | |
,平成27年12月29日火曜日、ラーメン二郎 西台駅前店、小豚+味噌+白ネギ+味付うずら+生卵+生卵 ニンニク 1200YEN<n>汁、アッツアツ、凍えた体ポッカポカ。<n>生姜加えて、メッチャウンメ〜ッ!<n>豚、端豚、巻豚、神域ィ!<n>完飲。 https://t.co/P8UMRZhZZE,698,false,555,2015/12/29 21:52:36 | |
,平成27年12月28日月曜日、ラーメン二郎 歌舞伎町店、普通盛+煮玉子 ニンニク800YEN<n>麺、モチとした食感の喰いごたえあるもの。<n>汁、ヤサイと合う、ニンニク溶けてウマい汁。<n>ブタ、いささかパサも、汁に浸しておいて吉。<n>完飲。 https://t.co/WtikdoVhHr,546,false,439,2015/12/28 19:41:00 | |
,平成27年12月27日日曜日、ラーメン二郎大宮店、大ラーメン アブラカラメ生姜 700YEN<n>完飲。 https://t.co/kCB8tBUqYS,1888,false,1054,2015/12/27 18:36:02 | |
,平成27年12月26日土曜日、ラーメン二郎 三田本店夜の部、大ラーメン ニンニクカラメ 650YEN<n>ぶた切れ無念。<n>麺、デッロプリに液体アブラ絡んでウッメェェッ!<n>汁、ウマ味と醤油利いたスッキリしたもの。クタヤサイと合う。<n>完飲。 https://t.co/DshC89IF7L,516,false,395,2015/12/26 21:42:08 | |
,平成27年12月26日土曜日、ラーメン二郎 三田本店、ぶた入り大ラーメン ニンニク 750YEN<n>麺、プリとした柔らかめの食感。俺好み。<n>汁、ウマ味利いてウンメ〜ッ!<n>ブタ、喰いごたえあるぶ厚い端ブタ。しっとりとしてウマい。<n>完飲。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val: 364 t: 汁 | |
val: 309 t: 麺 | |
val: 304 t: ラーメン二郎 | |
val: 300 t: 完飲 | |
val: 255 t: 味 | |
val: 249 t: ニンニク | |
val: 238 t: 生卵 | |
val: 227 t: ラーメン | |
val: 162 t: 大 | |
val: 132 t: ブタ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package eu.fiskur.pennineway.tutorial; | |
import android.graphics.Color; | |
import android.os.Bundle; | |
import android.support.v4.app.Fragment; | |
import android.support.v4.app.FragmentManager; | |
import android.support.v4.app.FragmentStatePagerAdapter; | |
import android.support.v4.view.PagerAdapter; | |
import android.support.v4.view.ViewPager; | |
import android.support.v7.app.ActionBarActivity; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./gradlew :app:dependencies | |
current task: :app:dependencies | |
single_task: :app:dependencies | |
**************************************************** | |
* CONFIGURATION | |
* TASK: :app:dependencies | |
* SDK_FLAVOR: Production | |
* SDK_BUILD TYPE: Release | |
* aviarySdkPackageName: com.aviary.android.feather.sdk | |
* aviarySdkVersionName: 3.4.3 |