Skip to content

Instantly share code, notes, and snippets.

View sumitmallick's full-sized avatar
:octocat:
Gitting

Sumit Kumar Mallick sumitmallick

:octocat:
Gitting
View GitHub Profile
# lru cache:
# Problem: Implement a LRU Cache:
# - LRUCache(int capacity) Initialize the LRU cache with positive size capacity.
# - int get(int key) Return the value of the key if the key exists, otherwise return -1.
# - void put(int key, int value) Update the value of the key if the key exists. Otherwise, add the key-value pair to the cache. If the number of keys exceeds the capacity from this operation, evict the least recently used key.
from collections import OrderedDict
*******************************************************************************************************************************
# views.py
#imports
import json
import os
import pprint
import re
import copy
import math
import calendar
@sumitmallick
sumitmallick / try.py
Last active March 19, 2019 10:35
outcome 'un' checks redefined
print('Target Impression, Range: >=1')
target_impressions = int(input("Enter the Input:"))
print('Achieved Impression Range: >=0')
imp_ressions = int(input("Enter the Input: "))
print('Date Range:')
days = int(input("Enter the Input: "))
if target_impressions>0 and target_impressions and imp_ressions:
get_percent = (imp_ressions/target_impressions)*100
print(get_percent)
import requests
import json
import urllib.request
from hello.models import ContactOutcomes
from django.core.management.base import BaseCommand
APIKEY_VALUE = "39752e30-2ade-426a-955b-8e6daf9de1af"
APIKEY = "/profile?hapikey=" + APIKEY_VALUE
HS_API_URL = "http://api.hubapi.com"
xurl = "/contacts/v1/contact/vid/"