Skip to content

Instantly share code, notes, and snippets.

Avatar
🤓

P Sandesh Baliga skymansandy

🤓
View GitHub Profile
View Percentage -> Hex alpha Mapping
100% — FF
99% — FC
98% — FA
97% — F7
96% — F5
95% — F2
94% — F0
93% — ED
92% — EB
91% — E8
View Kotlin functions and extension functions
/**
* You can edit, run, and share this code.
* play.kotlinlang.org
*/
fun main() {
println(sum(3,4))
println(sumVarArg(1..10))
println("nicebrokgyjv".last())
println("2^2 = ${2 pow 2}")
View Kotlin Playground
/**
* You can edit, run, and share this code.
* play.kotlinlang.org
*/
fun main() {
//Nullsafe operator
var nickname: String? =null
val uppercase = nickname?.toUpperCase()?:"Bor $nickname?"
println(uppercase)
View ripple_effect.xml
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/colorPrimaryDark">
<item android:id="@android:id/mask">
<shape android:shape="rectangle">
<solid android:color="@color/grey_text" />
</shape>
</item>
<item android:id="@android:id/background">
View ssos12.c
#include<stdio.h>
struct process
{
int all[6],max[6],need[6],finished;
}p[10];
int avail[6],sseq[10],ss=0,check1=0,check2=0,n,work[6];
int nor;
int safeseq(void);
int main()
{
View ssos11.c
#include<stdio.h>
#include<omp.h>
int fibonacci(int n)
{
if(n<2)
return n;
else
return fibonacci(n-1)+fibonacci(n-2);
}
View ssos10.c
#include<stdio.h>
#include<stdlib.h>
struct proc
{
int id;
int arrival;
int burst;
int rem;
int wait;
int finish;
View ssos9b.c
#include<stdio.h>
#include<stdlib.h>
#include<sys/types.h>
int main()
{
int status,ppid,mpid,pid;
pid=fork();
if(pid<0)
{
printf("error in the fork call\n");
View ssos9a.sh
#!bin/sh
#program to create a bundle script
if [ $# -eq 0 ]
then
echo "No arguments passed"
exit 1
fi
for i in $*
do
View ssos8b.c
#include<stdio.h>
#include<stdlib.h>
#include<fcntl.h>
#include<sys/stat.h>
#include<sys/types.h>
#include<unistd.h>
int main()
{
char buff1[ ]="abcdefghijklmnop ";