This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib.auth import get_user_model | |
from rest_framework_simplejwt.serializers import TokenObtainSerializer | |
from rest_framework_simplejwt.tokens import RefreshToken | |
class MyTokenObtainSerializer(TokenObtainSerializer): | |
@classmethod | |
def get_token(cls, user): | |
return RefreshToken.for_user(user) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from itertools import repeat | |
n = 100000000 | |
array = [] | |
start = time.time() | |
for i in range(n): | |
array.append(0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
largest = 0 | |
smallest = 0 | |
while True: | |
try: | |
num = input("Enter a number: ") | |
try: | |
if num == 'done': | |
break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
from PIL import Image, ImageDraw, ImageFont | |
img = Image.new('RGB',(300,200),(255,255,255)) | |
draw = ImageDraw.Draw(img) | |
text = u"আমি দেখছি অনেক কিছুই" | |
fontdir = '/usr/share/fonts' | |
fontfile = ImageFont.truetype("/home/shafi/Downloads/BenSenHandwriting.ttf",24) #use a bengali font of choice | |
draw.text((50,100), text, fill='blue',font=fontfile) | |
img.save('imagetext.jpg') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Stack; | |
import java.util.Vector; | |
public class AdvanceCalculator extends Calculator{ | |
private String temp; | |
private String mainInputString ; | |
Vector <Float> vec = new Vector<>(); | |
Vector <content> postFix = new Vector<>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Calculator { | |
public Calculator () { | |
} | |
public int add (int numberOne, int numberTwo){ | |
return (numberOne+numberTwo); | |
} | |
public double add (double numberOne , double numberTwo){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class MainApp_2 { | |
public static void main(String args[]) { | |
Scanner stdin = new Scanner(System.in); | |
String input = stdin.nextLine(); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Md. Shafi Ul Alam | |
* BSSE- 0630 | |
* Date: 11-09-2014 | |
*/ | |
/* | |
* The program demonstrates the solution of "Tower Of Hanoi" using the recursion process for N number of disks | |
* | |
* pegs denoted by peg-1, peg-2 and peg-3 | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//dfa.cpp dfa = definite finite automata | |
//user shall define the starting step and finishing step(s). User is given the liberty to define conditions for multiple steps. | |
//Binary string input determines whether finishing step(s) reached | |
#include <iostream> | |
#include <vector> | |
#include <string> | |
using namespace std; | |
int main (void) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//greatestSubstring.cpp | |
//program finds out the greatest substring between two strings | |
#include <iostream> | |
#include <string> | |
#include <sstream> | |
using namespace std; | |
int main (void) |