Skip to content

Instantly share code, notes, and snippets.

View sayemPasha's full-sized avatar

Sayem Pasha sayemPasha

View GitHub Profile
// 'Basic'
CLR - Common Language Runtime (Memory management, Security, Performance optimization)
JIT - Just In Time compiler (Translate CIL into machine code at runtime)
CIL - Common Intermediate Language (Compiler convert the code into CIL instead of machine code, like Java Bytecode)
GC - Garbage Collector
Reclaim unused object in 3 steps - Marking, Sweeping and Compact (reorganise to reduce fragmentation)
.Net Framework - Windows only, WinForms, WPF, Older ASP.NET Web Form\
.Net Core - Cross Platform, Support docker, Kubernetes, microservice
/*
1. Given two sorted arrays nums1 and nums2 of size m and n respecFvely, return the median of
the two sorted arrays.
The overall run Fme complexity should be O(log (m+n)).
Example 1:
Input: nums1 = [1,3], nums2 = [2]
Output: 2.00000
Explanation: merged array = [1,2,3] and median is 2.
Example 2:
@sayemPasha
sayemPasha / bitmapToBase64
Created January 3, 2024 09:35
Function to convert bitmap image to base64 without wrapping the line content (i.e No new line/ white space in the converted base64 image)
fun bitmapToBase64(bitmap: Bitmap): String {
val byteStream = ByteArrayOutputStream()
bitmap.compress(Bitmap.CompressFormat.JPEG, 20, byteStream)
val b: ByteArray = byteStream.toByteArray()
return Base64.encodeToString(b, Base64.NO_WRAP)
}