This file contains 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 com.example.util | |
import android.support.v7.widget.LinearLayoutManager | |
import android.support.v7.widget.RecyclerView | |
/** | |
* Call listener when the current page is changed. | |
* Use this with LinearLayoutManager and PagerSnapHelper. | |
* | |
* Whether the listener is called at first might depend on the version of RecyclerView. |
This file contains 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 com.example.util | |
import android.arch.lifecycle.LiveData | |
import android.arch.lifecycle.MediatorLiveData | |
import android.arch.lifecycle.Observer | |
fun <T1,T2> zipLiveData(src1: LiveData<T1?>, src2: LiveData<T2?>): LiveData<Pair<T1?,T2?>> { | |
val merged = MediatorLiveData<Pair<T1?,T2?>>() | |
var flag: Int = 0 |
This file contains 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 main | |
import ( | |
"bufio" | |
"bytes" | |
"fmt" | |
"os" | |
) | |
func main() { |
This file contains 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 com.example | |
import android.arch.lifecycle.LiveData | |
import android.database.ContentObserver | |
import android.database.Cursor | |
import android.os.Handler | |
import android.os.Looper | |
import kotlinx.coroutines.experimental.channels.ActorJob | |
import kotlinx.coroutines.experimental.channels.actor |
This file contains 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
; 使い方 | |
; (def session (make-session)) | |
; (signin session "チーム名" "ユーザー名" "パスワード") ; チーム名は、xxx.kibe.laのxxxの部分 | |
; (post-wiki session "タイトル" "中身" "カテゴリ") | |
(ns kibela.core | |
(:require [net.cgrand.enlive-html :as html]) | |
(:require [clj-http.cookies]) | |
(:require [clj-http.client :as http]) |
This file contains 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 com.company; | |
import java.lang.reflect.Field; | |
public class Main { | |
public static void main(String[] args) { | |
// fill the cache with the same value | |
try { |
This file contains 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
// ==UserScript== | |
// @name scrollbar widen | |
// @namespace https://developer.android.com/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @include https://developer.android.com/* | |
// @include https://developers.google.com/* | |
// @grant GM_addStyle | |
// ==/UserScript== |
This file contains 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
(defn gray-encode [x] | |
(bit-xor x (unsigned-bit-shift-right x 1))) | |
(defn gray-decode [x] | |
(loop [mask 0x80000000 | |
b 0] | |
(if (= mask 0) | |
b | |
(recur (unsigned-bit-shift-right mask 1) | |
(bit-or b |
This file contains 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
File->Import->General->Preferences->Import Keys Preferences |
This file contains 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
// (column1=0 OR column=1) AND (column2=3) | |
TODO_Selector a = orma.selectFromTODO().column1Eq(0).or().column1Eq(1); | |
Cursor cursor = orma.selectFromTODO() | |
.where(a).and().column2Eq(3) |
NewerOlder