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 sympy import symbols, Implies, And, Not, simplify_logic, S | |
from itertools import combinations | |
from tqdm import tqdm | |
# Define the function to count nodes | |
def count_nodes(expr): | |
"""Recursively count all nodes in a SymPy expression.""" | |
count = 1 | |
if hasattr(expr, "args") and expr.args: |
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
(async () => { | |
function sleep(ms) { | |
return new Promise(resolve => setTimeout(resolve, ms)); | |
} | |
watchedVideoOverlays = Array.from(document.getElementsByClassName('ytd-thumbnail-overlay-resume-playback-renderer')) | |
for(let i = 0; i < watchedVideoOverlays.length; i += 1){ | |
console.log(i) | |
try{ |
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
/** | |
USAGE | |
1. Open the playlist you want | |
2. Right click > Inspect element > Console | |
3. Copy this and paste. Hit enter. | |
4. For watch later make sure to click the Edit button | |
EDIT: Not all playlists have hours. | |
*/ |
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
# http://www-01.sil.org/linguistics/wordlists/english/wordlist/wordsEn.txt | |
with open("./wordsEn.txt") as word_file: | |
english_words = set(word.strip().lower() for word in word_file) | |
matches = [] | |
WORD_LEN = 4 | |
for word in english_words: | |
if len(word) == WORD_LEN: |
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
var students = []; | |
var rows = $("tr"); | |
for(var i = 1; i < rows.length; i++){ | |
students[i-1] = {}; | |
var row = rows[i]; | |
var name = (row.children[0].innerHTML+"").trim(); | |
students[i-1]["name"] = name.replace(" ","").replace(/\s\s+/g,' '); | |
var cgpa = (row.children[3].innerHTML+"").trim(); |
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
''' | |
SqueezeNet v1.1 (https://github.com/DeepScale/SqueezeNet/tree/master/SqueezeNet_v1.1) | |
Paper: https://arxiv.org/abs/1602.07360 | |
TODO: Use Xavier initializer | |
''' | |
import tensorflow as tf | |
x = tf.placeholder(tf.float32,(None,28*28)) |
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
/** | |
USAGE | |
1. Open the playlist you want | |
2. Right click > Inspect element > Console | |
3. Copy this and paste. Hit enter. | |
4. For watch later make sure to click the Edit button | |
Make sure &disable_polymer=true flag is set | |
e.g. | |
https://www.youtube.com/playlist?list=WL&disable_polymer=true |
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
class Main{ | |
public static void main(String[]args){ | |
float a = 5; | |
float b = 6; | |
System.out.println(Math.exp(Math.log(a)+Math.log(b))); | |
} | |
} |
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 matplotlib.pyplot as plt | |
from matplotlib import style | |
import numpy as np | |
style.use('ggplot') | |
class Support_Vector_Machine: | |
def __init__(self, visualization=True): | |
self.visualization = visualization | |
self.colors = {1:'r',-1:'b'} | |
if self.visualization: |
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
#include<stdio.h> | |
#include<stdlib.h> | |
#include<time.h> | |
#define FRAMES 4 | |
#define ITERATIONS 10 | |
// Check if the page is already in the frame | |
int hasPageInFrame(int *a,int request){ | |
int i; |
NewerOlder