Skip to content

Instantly share code, notes, and snippets.

View raghunandankavi2010's full-sized avatar
🤵‍♂️
Android dev looking to learn new technologies and always open for a new job.

Raghunandan Kavi raghunandankavi2010

🤵‍♂️
Android dev looking to learn new technologies and always open for a new job.
View GitHub Profile
@raghunandankavi2010
raghunandankavi2010 / TemperatureChart.kt
Created June 11, 2026 10:11
Tempearature showing with draggable indicator
private val temperatureAnchors = listOf(
-20f to Color(0xFFB71C1C), // super cold -> deep red
-10f to Color(0xFF1976D2), // cold -> blue
0f to Color(0xFF26C6DA), // cool -> cyan
20f to Color(0xFF2E9E5B), // comfortable -> green
30f to Color(0xFFFB8C00), // warm -> orange
40f to Color(0xFFD32F2F), // too hot -> red
)
/** Maps a temperature in °C to its zone color, clamped to the anchor range. */
package com.example.composelearning.spinningwheel
import android.graphics.Paint
import android.graphics.Typeface
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.graphics.Color
package com.example.composelearning.progess
import androidx.compose.animation.core.*
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.runtime.Composable
import androidx.compose.runtime.State
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
#!/usr/bin/env python3
"""
Medical RAG Comparative Study - Full Implementation
Author: Raghunandan Kavi
Institution: Liverpool John Moores University
Dataset: MedQuAD (Medical Question Answering Dataset)
"""
import os
import sys
/*
* Copyright 2026 Kyriakos Georgiopoulos
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
package com.example.composelearning.animcompose
import androidx.compose.animation.core.Animatable
import androidx.compose.animation.core.tween
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material3.Button
import androidx.compose.material3.MaterialTheme
@raghunandankavi2010
raghunandankavi2010 / InstagramCarousel2.kt
Created October 2, 2025 11:16
Instagram Carousel with item selection
package com.example.composelearning.lists
import android.annotation.SuppressLint
import android.widget.Toast
import androidx.compose.animation.core.Animatable
import androidx.compose.animation.core.FloatSpringSpec
import androidx.compose.animation.core.Spring
import androidx.compose.animation.core.calculateTargetValue
import androidx.compose.animation.splineBasedDecay
import androidx.compose.foundation.background
@raghunandankavi2010
raghunandankavi2010 / RetryCoroutines.kt
Created February 9, 2025 07:45
Retry with exponential back off coroutines
import kotlinx.coroutines.*
import java.io.IOException
suspend fun <T> retryIO(
times: Int = Int.MAX_VALUE,
initialDelay: Long = 100, // 0.1 second
maxDelay: Long = 1000, // 1 second
factor: Double = 2.0,
block: suspend () -> T
): T {
@raghunandankavi2010
raghunandankavi2010 / Retry.kt
Created February 9, 2025 07:38
Retry with exponential back off using flow
import kotlinx.coroutines.*
import kotlinx.coroutines.flow.*
import java.io.IOException
import kotlin.math.pow
fun <T> Flow<T>.retryWithExponentialBackoff(
times: Int,
initialDelay: Long,
factor: Double
): Flow<T> =
LaunchedEffect(greyAnimate,yellowAnimate,redAnimate,greenAnimate,redAnimate) {
launch {
greenAnimate.animateTo(
targetValue = 1f,
animationSpec = tween(durationMillis = 3000, easing = LinearEasing))
yellowAnimate.animateTo(
targetValue = 1f,
animationSpec = tween(durationMillis = 3000, easing = LinearEasing))
redAnimate.animateTo(