Skip to content

Instantly share code, notes, and snippets.

View geekykant's full-sized avatar

Sreekant Shenoy geekykant

View GitHub Profile
clc;
clear all;
close all;
rp = input('Enter the pass band ripple: ');
rs = input('Enter the stop band ripple: ');
wp = input('Enter the pass band freq: ');
ws = input('Enter the pass band freq: ');
fs = input('Enter the sampling freq: ');
w1= (2*wp)/fs;
clc;
clear all;
close all;
rp = input('Enter the pass band ripple: ');
rs = input('Enter the stop band ripple: ');
wp = input('Enter the pass band freq: ');
ws = input('Enter the pass band freq: ');
fs = input('Enter the sampling freq: ');
w1= (2*wp)/fs;
def isprimebad(n):
if n < 2:
return(False)
else:
for i in range(2,n):
if n%i == 0:
return(False)
return(True)
def lexsortbad(l):
def get_a(n):
a = next_large_prime(n)
def next_large_prime(num):
while(True):
num+=1
if(is_prime(num)):
return num
def is_prime(num):
@geekykant
geekykant / hotspot_ip
Created July 17, 2019 13:37
Get Hotspot IP Address
private String getHotspotIpAddress() {
String ip = "";
try {
Enumeration<NetworkInterface> enumNetworkInterfaces = NetworkInterface
.getNetworkInterfaces();
while (enumNetworkInterfaces.hasMoreElements()) {
NetworkInterface networkInterface = enumNetworkInterfaces
.nextElement();
Enumeration<InetAddress> enumInetAddress = networkInterface
.getInetAddresses();
@geekykant
geekykant / get_local_ip.js
Created April 18, 2019 09:22
Get local IP address on a network using JS.
window.RTCPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection;//compatibility for Firefox and chrome
var pc = new RTCPeerConnection({iceServers:[]}), noop = function(){};
pc.createDataChannel('');//create a bogus data channel
pc.createOffer(pc.setLocalDescription.bind(pc), noop);// create offer and set local description
pc.onicecandidate = function(ice)
{
if (ice && ice.candidate && ice.candidate.candidate)
{
var myIP = /([0-9]{1,3}(\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/.exec(ice.candidate.candidate)[1];
pc.onicecandidate = alert(`IP Address: ${myIP}`);
@geekykant
geekykant / app.py
Created March 28, 2019 08:04
Play music for every new line added to text file
import os
old_ll = None
new_ll = None
with open("values.txt", "r+") as f:
for old_ll in f:
pass
while(1):