View matrix.c
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> | |
int main() { | |
int row, col; | |
printf("enter row and col:"); | |
scanf("%d %d", &row, &col); | |
int **mat; | |
mat = calloc(row, sizeof(int *)); |
View binary-search.py
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
def binary_search(arr, low, high, number): | |
if high >= low: | |
mid = (high + low) // 2 | |
if arr[mid] == number: | |
return mid | |
elif arr[mid] > number: | |
return binary_search(arr, low, mid - 1, number) | |
else: | |
return binary_search(arr, mid + 1, high, number) | |
else: |
View install-latex-for-manim.sh
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
#!/bin/bash | |
set -e | |
INSTALLER_URL="http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz" | |
tmpdir=$(mktemp -d) | |
mkdir -pv $tmpdir | |
echo "Cding into temp directory $tmpdir" | |
cd $tmpdir |
View detect-mingw.py
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
# A program to check if the compiler passed | |
# is a Mingw-w64 based compiler. | |
import os | |
import subprocess | |
import argparse | |
import sys | |
def is_mingw(CC): |
View moderngl.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View gen-headers.py
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 sys | |
normal_headers = [ | |
"absolute.h", | |
"c-ctype.h", | |
"c-dir.h", | |
"c-errno.h", | |
"c-fopen.h", | |
"c-limits.h", | |
"c-memstr.h", | |
"c-minmax.h", |
View cybertruck.py
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
# Works on Manim Community Edition v0.15.0 | |
from manim import * | |
from manim.opengl import * | |
import textwrap | |
class InlineFullScreenQuad(Scene): | |
def construct(self): | |
surface = FullScreenQuad( | |
self.renderer.context, | |
textwrap.indent(""" |
View no_common_element_list.py
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
def no_common_element_list(a,b): | |
return set(a) - set(b) == set(a) and set(b) - set(a) == set(b) |
View isprime.py
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 math | |
def is_prime(n): | |
if n < 2: | |
return False | |
if n == 2: | |
return True | |
if n % 2 == 0: | |
return False | |
sqrt_n = int(math.floor(math.sqrt(n))) |
View download_tex_archives.py
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 re | |
import typing | |
from pathlib import Path | |
import requests | |
from textwrap import dedent | |
import tempfile | |
import tarfile | |
import logging | |
logger = logging.getLogger("downloader: ") |
NewerOlder