Skip to content

Instantly share code, notes, and snippets.

View iamcrypticcoder's full-sized avatar

Mahbubur Rahman iamcrypticcoder

View GitHub Profile
@iamcrypticcoder
iamcrypticcoder / AmazonCloudFrontServiceTests.kt
Created March 13, 2023 17:18
Spring Boot Services for AWS Java SDK v2
import org.junit.After
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.test.context.ActiveProfiles
import org.springframework.test.context.junit4.SpringRunner
@RunWith(SpringRunner::class)
@iamcrypticcoder
iamcrypticcoder / PriorityQueueDemo.java
Created September 23, 2021 16:19
PriorityQueueDemoJava
import java.util.AbstractMap;
import java.util.Comparator;
import java.util.Map;
import java.util.PriorityQueue;
public class PriorityQueueDemo {
public static void main(String[] args) {
priorityQueueDemo1();
priorityQueueDemo2();
priorityQueueDemo3();
#include <set>
#include <map>
#include <list>
#include <cmath>
#include <ctime>
#include <queue>
#include <stack>
#include <cctype>
#include <cstdio>
#include <string>
@iamcrypticcoder
iamcrypticcoder / LCMSUM
Created February 28, 2019 08:46
Solution of the SPOJ problem: https://www.spoj.com/problems/LCMSUM/
#include <iostream>
#include <math.h>
using namespace std;
#define FOR(i, L, U) for(int i=(int)L; i<=(int)U; i++)
#define FORD(i, U, L) for(int i=(int)U; i>=(int)L; i--)
#define READ(x) freopen(x, "r", stdin)
#define WRITE(x) freopen(x, "w", stdout)
#include <iostream>
#include <math.h>
using namespace std;
#define FOR(i, L, U) for(int i=(int)L; i<=(int)U; i++)
#define FORD(i, U, L) for(int i=(int)U; i>=(int)L; i--)
#define READ(x) freopen(x, "r", stdin)
#define WRITE(x) freopen(x, "w", stdout)
@iamcrypticcoder
iamcrypticcoder / sigma_calculation_efficient.cpp
Created February 28, 2019 06:00
Sigma calculation in efficient way
#include <iostream>
#include <vector>
#include <math.h>
using namespace std;
#define READ(x) freopen(x, "r", stdin)
#define WRITE(x) freopen(x, "w", stdout)
#define PB push_back
@iamcrypticcoder
iamcrypticcoder / sigma_calculation_naive.cpp
Created February 28, 2019 05:57
Sigma calculation in naive approach
#include <iostream>
#include <vector>
#include <math.h>
using namespace std;
#define READ(x) freopen(x, "r", stdin)
#define WRITE(x) freopen(x, "w", stdout)
#define PB push_back

Keybase proof

I hereby claim:

  • I am iamcrypticcoder on github.
  • I am iamcrypticcoder (https://keybase.io/iamcrypticcoder) on keybase.
  • I have a public key ASCEE1AUMNw-7QclSaZp30EoHUelXP_QpgAdXa7vayfthQo

To claim this, I am signing this object:

public class FunctionDemo {
static Function<String, String> shortName = (s) -> {
if (null == s || s.length() == 0) return "Unknown";
String[] splits = s.split(" ");
String ret = splits[0];
if (splits.length >= 2) ret += " " + splits[1].substring(0, 1) + ".";
return ret;
};
public class ConsumerDemo {
static class Point {
Double x, y;
public Point(Double x, Double y) {
this.x = x;
this.y = y;
}
}