Skip to content

Instantly share code, notes, and snippets.

View TheRealMentor's full-sized avatar
🐢
Learning is a continuous process

Sharad Roy TheRealMentor

🐢
Learning is a continuous process
  • Shopee, Singapore
  • Singapore
  • 07:15 (UTC +08:00)
View GitHub Profile
@TheRealMentor
TheRealMentor / DTFT
Created March 22, 2017 10:01
Code for plotting the magnitude and phase of DTFT of a function.
#Importing packages
import matplotlib.pyplot as plt
import numpy as np
from array import *
import math as math
import cmath as cm
#Defining arrays
f=array('f')
@TheRealMentor
TheRealMentor / Delta
Created March 22, 2017 10:26
Plotting Delta Function
#importing the packages
import numpy as np
import matplotlib.pyplot as plt
#Defining the delta function
def delta(n):
if n == 0:
return 1
else:
return 0
@TheRealMentor
TheRealMentor / Wave
Created March 23, 2017 07:05
Reading Wave File
import pyaudio
import wave
#Defining Chunk
chunk = 1024
#Female voice, for male voice file_name = 'brian.wav'
file_name = 'amy.wav'
#Opening file
@TheRealMentor
TheRealMentor / Arduino LED Ring
Last active April 7, 2017 09:43
Blinking of LED's sequentially in circular fashion. Follow this project on : https://the-real-mentor.blogspot.in/2017/04/arduino-led-ring.html
;========================
;File: circle.asm
;Author: TheRealMentor
;Created on: 07/04/17
;========================
;========================================
;INCLUDING HEADER FILE FOR Chip ATmega328P
;========================================
.include "/usr/share/avra/m328Pdef.inc"
@TheRealMentor
TheRealMentor / Decade Counter
Created April 10, 2017 07:28
Code for Decade Counter using Assembly.
;========================
;File: decade_counter.asm
;Author: TheRealMentor
;Created on: 10/04/17
;========================
;========================================
;INCLUDING HEADER FILE FOR Chip ATmega328P
;========================================
.include "/usr/share/avra/m328Pdef.inc"
#include <Time.h>
const int LEDpins[] = {9,8,7,6,5,4,3,2};
int rows= 8;
const int charHeight = 8;
const int charWidth = 5;
const unsigned char font[95][5] = {
{0x00,0x00,0x00,0x00,0x00}, // 0x20 32
{0x00,0x00,0x6f,0x00,0x00}, // ! 0x21 33
{0x00,0x07,0x00,0x07,0x00}, // " 0x22 34
'''
@author: TheRealMentor
@date: 28/06/2019
'''
import math
def isPrime(A):
#Check if A = 1
if A == 1:
'''
@author: TheRealMentor
@date: 28/06/2019
'''
import math
def allFactors(A):
res = []
if A == 0 or A == 1:
'''
@author: TheRealMentor
@date: 28/06/2019
'''
import math
def sieve(A):
if A < 2:
return []