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
public class L { | |
private static final String LOG_PREFIX = "ys_"; | |
private static final int LOG_PREFIX_LENGTH = LOG_PREFIX.length(); | |
private static final int MAX_LOG_TAG_LENGTH = 23; | |
public L() { | |
} | |
public static String makeLogTag(String str) { | |
if (str.length() > MAX_LOG_TAG_LENGTH - LOG_PREFIX_LENGTH) { |
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
apply plugin: 'com.android.application' | |
android { | |
compileSdkVersion 20 | |
buildToolsVersion "20.0.0" | |
defaultConfig { | |
applicationId "com.poh.poh" | |
minSdkVersion 16 | |
targetSdkVersion 20 |
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
source 'https://rubygems.org' | |
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | |
# ruby '2.1.1' | |
gem 'rails', '4.1.5' | |
# Use sqlite3 as the database for Active Record | |
# Use SCSS for stylesheets | |
gem 'sass-rails', '~> 4.0.3' | |
# Use Uglifier as compressor for JavaScript assets | |
gem 'uglifier', '>= 1.3.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
public static void main(String[] args) { | |
// odd/even into lists of 10 | |
Observable.range(1, 100).groupBy(n -> n % 2 == 0) | |
.flatMap(g -> { | |
return g.take(10).toList(); | |
}).forEach(System.out::println); | |
} |
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 () | |
func main() { | |
for i := 0; i < 50; i++ { | |
// fmt.Printf("i is %d and result is %d.\n", i, fibo(i)) | |
fibo(i) | |
} | |
} |
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
function power(base,expo) { | |
switch(expo) { | |
case 0: return 1; | |
case 1: return base; | |
default: expo--;return base*power(base,expo); | |
} | |
} |
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
{ | |
"artist": "Taylor Swift", | |
"album": "1989", | |
"desciption": "1989 is the fifth studio album by American singer-songwriter Taylor Swift. It was released on October 27, 2014, through Big Machine Records.", | |
"songs": [ | |
{ | |
"title": "Welcome To New York", | |
"artist": "Taylor Swift", | |
"album": "1989", | |
"composer": "Taylor Swift & Ryan Tedder", |
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
// Zawgyi<>Unicode converter python module | |
// Based on rules from Parabaik Myanmar Text Converter | |
// Copyright (C) 2014 Ngwe Tun (Solveware Solution) | |
// Copyright (C) 2014 Ye Mon Kyaw | |
// This file is part of Paytan. | |
// Paytan is free software: you can redistribute it and/or modify | |
// it under the terms of the GNU General Public License as published by | |
// the Free Software Foundation, either version 3 of the License, or |
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
λ ~:mm-sort gem install ffi-icu | |
λ ~:mm-sort irb | |
2.2.2 :001 > require 'ffi-icu' | |
true | |
2.2.2 :002 > collator = ICU::Collation::Collator.new("mm") | |
#<ICU::Collation::Collator:0x007ff982336610 @c=#<FFI::AutoPointer address=0x007ff9837e2610>> | |
2.2.2 :003 > collator.collate(["အို", "အ", "အေ", "အု", "အော်", "အော", "အံ"]) | |
[ | |
[0] "အ", | |
[1] "အံ", |
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
// Top-level build file where you can add configuration options common to all sub-projects/modules. | |
buildscript { | |
repositories { | |
jcenter() | |
} | |
dependencies { | |
classpath "com.android.tools.build:gradle:1.3.0-beta2" | |
classpath "com.android.databinding:dataBinder:1.0-rc0" |