Giter VIP home page Giter VIP logo

loadingview's People

Contributors

ldoublem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

loadingview's Issues

About color issues

The default color is white , how to modify the color I want?Avoid default color and background color conflict。

Copyright problem

Hello sir
The "LVEatBeans" it looks similar to pacman.So if am adding it to my application does it cause any copyright or trademark issues

Interpolation search

fun search(list: List, x: Long): Int {
var low = 0
var high = list.size - 1

while ((list[low] < x) &amp;&amp; (x < list[high]))
{
    var mid = (low + ((x - list[low])*(high - low))/(list[high] - list[low])).toInt()

    if (list[mid] < x)
    low = mid + 1
    else if (list[mid] > x)
    high = mid - 1
    else
    return mid
}

if (list[low] == x.toInt())
return low
if (list[high] == x.toInt())
return high
return -1

}

var items = listOf(2, 3, 5, 7, 11, 13, 17)

println(search(items, 1))
//print -1
println(search(items, 7))
//print 3
println(search(items, 19))
//print -1

// *** simplified speed test ***

items = Array(1000000, {0}).mapIndexed { i, _ -> i }
val count = 100

val start = Date()

for (i in 0..count-1) {
search(items, 777777)
}

val milliseconds = Date().time - start.time

println(milliseconds)
// about 4 milliseconds

R

E

Amazing

diao diao de_(:зゝ∠)_

Bubble sort

// Time Complexity O(n^2)
// Space Complexity O(1)

fun sort(arr: Array): Array {
var items = arr.copyOf()
for (i in 0 .. items.size - 1) {
for (j in i + 1 .. items.size - 1) {
if (items[j] < items[i]) {
val tmp = items[j]
items[j] = items[i]
items[i] = tmp
}
}
}
return items;
}

var items = arrayOf(4, 1, 5, 3, 2)

val sortItems = sort(items)
// sortItems is {1, 2, 3, 4, 5}
sortItems.forEach { print("$it ") }
println()

// *** simplified speed test ***
items = Array(200, {0})
.mapIndexed { i, _ -> i }
.toTypedArray()
val tmp = items[5]
items[5] = items[6]
items[6] = tmp
val count = 10000
val start = Date()

for (i in 0..count - 1) {
sort(items)
}

val milliseconds = Date().time - start.time

println(milliseconds)
// about 2742 milliseconds

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.