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 com.example.nevin.myapplication | |
import android.app.Activity | |
import android.app.Application | |
import android.os.Bundle | |
import com.jakewharton.threetenabp.AndroidThreeTen | |
import org.jetbrains.anko.button | |
import org.jetbrains.anko.centerInParent | |
import org.jetbrains.anko.onClick | |
import org.jetbrains.anko.relativeLayout |
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 com.biideal.biibonus.util | |
/** | |
* https://gist.github.com/sargunster/418c0fd98eb765fa9aca | |
*/ | |
import android.app.Activity | |
import android.support.design.widget.* | |
import android.support.v4.app.Fragment | |
import android.support.v4.view.PagerTabStrip | |
import android.support.v4.view.PagerTitleStrip |
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 com.biideal.biibonus.ui | |
import com.biideal.biibonus.util.Config | |
import junit.framework.Assert | |
import org.junit.Test | |
/** | |
* Test the util implementation | |
*/ |
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
// ============== Quick sort start 20151015============== | |
fun quickSort(a: IntArray, lowOffset: Int, highOffset: Int) { | |
if (lowOffset > highOffset ) return; | |
// find pivot | |
var pivot: Int = a[highOffset] | |
var nextSmallTail = lowOffset; |
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
// ============== merge sort start ============== | |
var numbers: IntArray = intArrayOf() | |
var temp: IntArray = intArrayOf() | |
fun merge(low: Int, middle: Int, high: Int) { | |
for (i in low..high) { | |
temp[i] = numbers[i]; |
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
fun selectionSort(a: IntArray) { | |
if (a.size() < 1) { | |
return | |
} | |
for( j in 0..a.size() - 1){ | |
var minp = j | |
for (i in j..a.size() - 1) { |
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 CustomView(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
setupBackPressed(); | |
} | |
public static void addMe(Activity host) { | |
NotificationView v = (NotificationView) host.getLayoutInflater().inflate(R.layout.notification_list, null); | |
LinearLayout.LayoutParams p = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); | |
host.addContentView(v, p); |
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 com.example | |
fun insertionSort(array: IntArray) { | |
for ((index, value) in array.withIndex()) { | |
// println("the element at $index is $value") | |
var j = index | |
while (j > 0 ) { | |
// swap if smaller than sorted[j] | |
if (array[j] < array[j - 1]) { |
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
import com.biideal.biibonus.util.Config; | |
import junit.framework.TestCase; | |
import java.util.HashMap; | |
/** | |
* Testing my home activity | |
*/ |
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
import android.app.Activity; | |
import android.os.Bundle; | |
import android.support.v7.widget.RecyclerView; | |
import android.util.Log; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.TextView; | |
import java.util.ArrayList; |