Skip to content

Instantly share code, notes, and snippets.

Hello, is this Turing?

Ahmad Moussa AhmadMoussa

Hello, is this Turing?
View GitHub Profile
import pandas as pd
file_path = 'path_to_your.csv'
if(file_path[-4:] == '.csv'):
df = pd.read_csv(file_path, sep=';')
df.to_excel (file_path[:-4] + '.xlsx', index = None, header=True)
file_path = file_path[:-4] + '.xlsx'
sheet = pd.read_excel(file_path, sheet_name='Sheet1')
View tezosprofilegist
I am attesting that this GitHub handle AhmadMoussa is linked to the Tezos account tz1hXx6tvTV3kzxpBR6E4hDYcxdgcRGHUTFj for tzprofiles
View orbiters_with_tethers.js
var listOfColors = ["#1c77c3", "#39a9db", "#40bcd8", "#f39237", "#d63230", "#540d6e", "#ee4266", "#ffd23f", "#f3fcf0", "#1f271b"];
["#540d6e", "#ee4266", "#ffd23f", "#f3fcf0", "#1f271b"]
class Orbiter {
constructor(cx, cy) {
this.centerX = cx
this.centerY = cy
this.positionX = 0
this.positionY = 0
View orbiters.js
var listOfColors = ["#1c77c3","#39a9db","#40bcd8","#f39237","#d63230","#540d6e","#ee4266","#ffd23f","#f3fcf0","#1f271b"];
class Orbiter{
this.centerX = cx
this.centerY = cy
this.positionX = 0
this.positionY = 0
View bubblebands.js
// Where is the circle
let x, y;
let num_circles = 150;
let circles = [];
class Circle {
constructor() {
this.x = random(0, width)
this.y = random(0, height)
this.diameter = random(10, 30);
View windshield_wiper_rect.frag
#ifdef GL_ES
precision mediump float;
uniform vec2 u_resolution;
float rectshape(vec2 position, vec2 scale){
scale = vec2(0.5) - scale * 0.5;
vec2 shaper = vec2(step(scale.x, position.x), step(scale.y, position.y));
View MultiThreadedFileLoader
import librosa
import threading
import numpy as np
import os
num_splits = 8
data_path = "ProcessedNumpys"
dataset = []
def add_to_arr(i, data_path, filenames, start, end):
View Convert m4a to
# ffmpeg -i filenameee.m4a -acodec libmp3lame -ab 256k output.mp3
AhmadMoussa /
Created Dec 8, 2019
Calculate padding of Conv1D and ConvTranspose1D in pytorch
import math
def calculatePadding(L, KSZ, S, D, deconv = False):
:param L: Input length (or width)
:param KSZ: Kernel size (or width)
:param S: Stride
:param D: Dilation Factor
:return: Returns padding such that output width is exactly half of input width
AhmadMoussa /
Last active Dec 8, 2019
DataLoader for data loading purposes C:
import os
import numpy as np
class DataLoader():
def __init__(self, data_path, data_shape, index_path = 0, batch_size = 1):
self.data_path = data_path
self.data_shape = data_shape
self.data_index = self._load_data_index(index_path) if index_path else self._create_data_index(data_path)
self.shuffled_index = self.data_index
self.batch_size = batch_size