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 ai.crik.sports.features.analytics.pose.utils | |
| import ai.crik.sports.di.Utils | |
| import android.annotation.SuppressLint | |
| import android.content.Context | |
| import android.graphics.Bitmap | |
| import android.graphics.Matrix | |
| import android.os.SystemClock | |
| import androidx.annotation.OptIn | |
| import androidx.camera.core.CameraSelector |
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 ai.crik.sports.features.analytics.pose.utils | |
| import ai.crik.sports.di.Utils | |
| import android.annotation.SuppressLint | |
| import android.content.Context | |
| import android.graphics.Bitmap | |
| import android.graphics.Matrix | |
| import android.os.SystemClock | |
| import androidx.annotation.OptIn | |
| import androidx.camera.core.CameraSelector |
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 ai.crik.sports.features.analytics.pose.utils | |
| import ai.crik.sports.di.Utils | |
| import android.content.Context | |
| import android.graphics.Bitmap | |
| import android.graphics.Matrix | |
| import android.os.SystemClock | |
| import androidx.annotation.OptIn | |
| import androidx.camera.core.CameraSelector | |
| import androidx.camera.core.ExperimentalGetImage |
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 ai.crik.sports.features.analytics.utils | |
| import ai.crik.sports.features.analytics.pose.utils.PoseProcessor | |
| import ai.crik.sports.features.analytics.pose.viewmodel.PoseViewmodel | |
| import android.util.Log | |
| import androidx.camera.core.ImageAnalysis | |
| import androidx.camera.core.ImageProxy | |
| import kotlinx.coroutines.* | |
| import javax.inject.Inject |
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 Array<Int>.unionOfArrays(array:Array<Int>):MutableList<Int>{ | |
| var temp1 = 0 | |
| var temp2 = 0 | |
| var temp = 0 | |
| val arr:MutableList<Int> = mutableListOf() | |
| while (temp1<this.size && temp2<array.size){ | |
| if (this[temp1]<array[temp2]){ | |
| if (this[temp1]!=temp){ | |
| temp = this[temp1] | |
| arr.add(this[temp1]) |
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 Array<Int>.linearSearch(n:Int):Boolean{ | |
| for (i in 0 until this.size){ | |
| if (this[i] == n){ | |
| return true | |
| } | |
| } | |
| return false | |
| } |
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 Array<Int>.moving0sToEnd(){ | |
| var temp1 = 0 | |
| var temp2 = 1 | |
| while (temp2<this.size){ | |
| if ((this[temp1]!=0 && this[temp2]!=0)|| this[temp1]!=0 && this[temp2]==0){ | |
| temp1++ | |
| temp2++ | |
| }else if (this[temp1]==0 && this[temp2]!=0){ | |
| //swap | |
| val temp = this[temp1] |
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 Array<Int>.reverse(start:Int, end:Int){ | |
| var startN = start | |
| var endN = end | |
| while (startN<endN){ | |
| val temp = this[startN] | |
| this[startN]= this[endN] | |
| this[endN] = temp | |
| startN++ | |
| endN -- | |
| } |
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 Array<Int>.leftRotateByNPlaces(n:Int){ | |
| this.reverse(0, n-1) | |
| this.reverse(n, this.size-1) | |
| this.reverse(0,this.size-1) | |
| } | |
| fun Array<Int>.reverse(start:Int, end:Int){ | |
| var startN = start | |
| var endN = end | |
| while (startN<endN){ |
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 Array<Int>.leftRotateByOne(){ | |
| val temp = this[0] | |
| for (i in 1 until this.size){ | |
| this[i-1] = this[i] | |
| } | |
| this[size-1] = temp | |
| } |
NewerOlder