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
object Hello extends Application { | |
println("hello") | |
} |
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.proto.fragment; | |
import android.os.Bundle; | |
import android.support.v4.app.Fragment; | |
import android.support.v4.app.FragmentManager; | |
import android.support.v4.app.FragmentTransaction; | |
import android.util.Log; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; |
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 kr.pe.kingori.exp.charset; | |
import java.nio.charset.Charset; | |
import java.util.concurrent.atomic.AtomicInteger; | |
import android.app.Activity; | |
import android.os.Bundle; | |
import android.os.Handler; | |
import android.util.Log; | |
import android.view.View; |
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 class SampleEndlessLoader extends AsyncTaskLoader<List<String>> { | |
EventManager evManager; | |
int itemCount = 0; | |
boolean isLoading = false; | |
public SampleEndlessLoader(Context context, EventManager evManager) { | |
super(context); | |
Log.d(LOG_TAG, "EndlessLvFrag.SampleLoader.SampleLoader:"); | |
this.evManager = evManager; |
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 Spannable getLinkifiedSpannable(String text) { | |
Spannable spannable = new SpannableStringBuilder(text); //create spannable for linkify | |
Linkify.addLinks(spannable, Linkify.ALL); // make URLspan | |
URLSpan[] spans = spannable.getSpans(0, spannable.length(), URLSpan.class); //get url spans | |
for (URLSpan span : spans) { //iterate on url spans | |
int spanStart = spannable.getSpanStart(span); //save postion of current url span | |
int spanEnd = spannable.getSpanEnd(span); | |
if (spanStart < 0 || spanEnd < 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 class FullScreenImageViewTouch extends ImageViewTouch { | |
public FullScreenImageViewTouch(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
} | |
@Override | |
public void setImageDrawable(Drawable drawable) { | |
Point p = getScreenSize(getContext()); | |
int bitmapWidth = drawable.getIntrinsicWidth(); | |
int bitmapHeight = drawable.getIntrinsicHeight(); |
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
class Euler1 { | |
/** | |
* 1 부터 maxVal 미만의 수 중 3 또는 5의 배수의 합 | |
* @param maxVal | |
* @return | |
*/ | |
def getMultipleOf3Or5(maxVal: Int) = { | |
(0 /: (1 until maxVal).filter((arg: Int) => (arg % 3 == 0 || arg % 5 == 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
class Euler2 { | |
/** | |
* max 이하의 짝수 피보나치 수열 합 | |
* @param op1 | |
* @param op2 | |
* @param max | |
* @param sum | |
* @return | |
*/ |
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
class Euler3 { | |
/** | |
* prime 여부 | |
* @param num | |
* @return | |
*/ | |
def isPrimeLong(num: Long): Boolean = { | |
var index = 2L | |
while (index < num) { |
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
class Euler4 { | |
def findMaxPalindrome():Int = { | |
for (i <- (1 to 9).reverse; j <- (0 to 9).reverse; k <- (0 to 9).reverse) { | |
val num = 100001 * i + 10010 * j + 1100 * k | |
for (k <- (100 to Math.sqrt(num).toInt).reverse if num % k == 0 && num / k < 1000) { | |
return num | |
} | |
} | |
return 0 | |
} |
OlderNewer