Skip to content

Instantly share code, notes, and snippets.

View somaditya's full-sized avatar
🏠
Working from home

Somaditya Basak somaditya

🏠
Working from home
View GitHub Profile
@somaditya
somaditya / martingale.py
Created October 14, 2025 11:12
Monte-Carlo simulation of a betting strategy for Roulette.
""""""
from os import write
"""Assess a betting strategy.
"""
import numpy as np
import matplotlib.pyplot as plt
def author():
@somaditya
somaditya / martingale.py
Created September 6, 2025 21:43
Simulating an American Roulette Gambling Strategy
""""""
from os import write
"""Assess a betting strategy.
Copyright 2018, Georgia Institute of Technology (Georgia Tech)
Atlanta, Georgia 30332
All Rights Reserved
Template code for CS 4646/7646
pragma solidity ^0.5.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
package com.piggymetrics.monitoring;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
@SpringBootApplication
@EnableHystrixDashboard
public class MonitoringApplication {
package com.piggymetrics.registry;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
@SpringBootApplication
@EnableEurekaServer
public class RegistryApplication {
package com.piggymetrics.gateway;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
@SpringBootApplication
@EnableDiscoveryClient
@EnableZuulProxy
package com.somaditya.user;
import java.util.List;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
public interface UserRepository extends PagingAndSortingRepository<User, Long> {
package com.somaditya.user;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@Entity
public class User {
@somaditya
somaditya / pom.xml
Created January 17, 2020 22:04
User API pom
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.3.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
import { ObjectId } from "bson"
let movies
let mflix
const DEFAULT_SORT = [["tomatoes.viewer.numReviews", -1]]
export default class MoviesDAO {
static async injectDB(conn) {
if (movies) {
return