Skip to content

Instantly share code, notes, and snippets.

@uchidev
uchidev / DirNode.kt
Created December 11, 2016 17:09
ReadMeMaker
package com.uchidev.kotlin_ex.tool
import java.io.Closeable
import java.io.InputStreamReader
interface DirNode: Closeable {
fun getDirName(): CharSequence
fun onContent(name: CharSequence, operation: (bodyReader: InputStreamReader?) -> Unit)
fun eachContentNode(operation: ((name: CharSequence, bodyReader: InputStreamReader) -> Unit))
fun eachChildrenDirNode(operation: ((DirNode) -> Unit))
ctr <- caps 1d 3a
esc <- H/Z(K) 01 29
H/Z(K) <- esc 29 01
00,00,00,00, 00,00,00,00,
04,00,00,00, 1d,00,3a,00,
01,00,29,00, 29,00,01,00,
00,00,00,00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
public class TargetProvider extends ContentProvider {
final private String tag;
final private String providerName;
final private String dbName;
final private String tableName;
private SQLiteOpenHelper dbHelper = null;
private UriMatcher uriMatcher = null;
public TargetProvider(String providerName, String dbName, String tableName, String tag) {
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\DWM]
"Composition"=dword:00000001
"ColorPrevalence"=dword:00000001
"ColorizationColor"=dword:c4515c6b
"ColorizationColorBalance"=dword:00000059
"ColorizationAfterglow"=dword:c4515c6b
"ColorizationAfterglowBalance"=dword:0000000a
"ColorizationBlurBalance"=dword:00000001
@uchidev
uchidev / ACText.java
Last active July 30, 2016 03:50
AppCompatTextView
AppCompatTextView textView = view.findViewByIdR.id.text);
textView.setTextAppearance(textView.getContext(), R.style.ItemText);
textView.setBackgroundResource(R.drawable.item_bg);
textView.setText("Hello");
@uchidev
uchidev / MySQLiteHelperTest.java
Last active May 28, 2016 14:53
JUnit Android Context assertThat
import android.content.Context;
import android.test.AndroidTestCase;
import android.test.RenamingDelegatingContext;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
public class MySQLitHelperTest extends AndroidTestCase {
private Context context;
import android.support.annotation.Nullable;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import java.lang.ref.WeakReference;
public abstract class ThreadModule {
private Handler mHandler;
private boolean mInitialized = false;
@uchidev
uchidev / ExternalStorage.java
Last active February 17, 2016 15:42
ExternalStorage operation
private class ExternalStorage {
public List<String> getDirPathList() {
try {
return getDirPathList(Environment.getExternalStorageDirectory().getCanonicalFile());
} catch (IOException e) {
return emptyList();
}
}
(apply 'concat '("a" "b"))
;; "ab"
(mapconcat #'(lambda (x) x) '("a" "b") "")
;; "ab"
(mapconcat #'(lambda (x) (char-to-string x)) "ab" "")
;; "ab"
(mapconcat #'(lambda (x) (char-to-string x)) '(?a ?b) "")