Skip to content

Instantly share code, notes, and snippets.

View Esarve's full-sized avatar
💭
IDK🙄

Sourav Das Esarve

💭
IDK🙄
View GitHub Profile
@Esarve
Esarve / MainActivity.kt
Created May 8, 2023 09:37
Segmented Button Usage
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
MaterialSegmentedButtonTheme {
// A surface container using the 'background' color from the theme
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colorScheme.background
) {
@Esarve
Esarve / generalHotkeyScript.ahk
Created July 3, 2021 07:30
My AutoHotKey script.
#NoEnv
#NoTrayIcon ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; http://www.daveamenta.com/2011-05/programmatically-or-command-line-change-the-default-sound-playback-device-in-windows-7/
Devices := {}
IMMDeviceEnumerator := ComObjCreate("{BCDE0395-E52F-467C-8E3D-C4579291692E}", "{A95664D2-9614-4F35-A746-DE8DB63617E6}")
@Esarve
Esarve / door.java
Created June 16, 2021 07:00
Solution for 100 doors problem
public class ps8 {
public static void doooooooor(int num) {
int doors[] = new int[num];
for(int i=0; i<doors.length; i++){
doors[i] = 0;
}
for(int i=1; i<=num; i++){
int temp = num;
for (int j=i; temp>=j; temp--){
if(temp % j == 0){
@Esarve
Esarve / metadatafix.py
Last active May 27, 2021 17:04
This script will replace windows's last modified time and created time with date taken from image' exif
import os
import sys
import pywintypes, win32file, win32con
from datetime import datetime
from PIL import Image, ExifTags
def changeFileCreationTime(fname, newtime):
wintime = pywintypes.Time(newtime)
winfile = win32file.CreateFile(
fname, win32con.GENERIC_WRITE,
import java.util.Scanner;
public class AnotherTest {
public static void main(String[] args) {
Scanner scanner= new Scanner(System.in);
String input = scanner.nextLine();
StringBuilder output = new StringBuilder();
for (int i=0;i<input.length();i++){
char current = input.charAt(i);
if ( current == '+' || current == '-' || current == '*' || current == '/' || current == '=' || current == ';'){
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
public class Test {
private static ArrayList<String> operators = new ArrayList<>();
private static ArrayList<String> keywords = new ArrayList<>();
private static ArrayList<String> symbols = new ArrayList<>();
private static ArrayList<String> variables = new ArrayList<>();
import java.util.Scanner;
public class Main {
private static Scanner s = new Scanner(System.in);
public static void main(String[] args) {
System.out.print("Enter Your String: ");
String input = s.nextLine();
if (input.matches("/\\*.+\\*/")) System.out.println("This is a block comment");
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
public class Main {
// Arraylists for Input grammar, First and Follow
private static Scanner s = new Scanner(System.in);
private static ArrayList<String> lhs = new ArrayList();
#include <stdio.h>
#include <stdlib.h>
int partition(int arr[], int start, int end){
int pivot = arr[end];
int i=end;
int j;
int tmp;
for (j=end;j<end-1;j++){
if(arr[j]<=pivot){
#include <stdio.h>
#include <stdlib.h>
void print(int array[], int i);
int main(){
int i=0;
int array[]={1,2,3,4,5,6,7,8,9};
print(array, i);
}