Skip to content

Instantly share code, notes, and snippets.

View chengengliu's full-sized avatar
:bowtie:
I may be slow to respond.

Victor Liu chengengliu

:bowtie:
I may be slow to respond.
  • Nanyang Technological University
  • Singapore
  • 13:01 (UTC +08:00)
View GitHub Profile
@endolith
endolith / DFT_ANN.py
Last active April 29, 2024 11:20
Training neural network to implement discrete Fourier transform (DFT/FFT)
"""
Train a neural network to implement the discrete Fourier transform
"""
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
import numpy as np
import matplotlib.pyplot as plt
N = 32
batch = 10000
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@klihelp
klihelp / app.module.ts
Last active March 24, 2021 13:41
Angular 2 - Add safeHtml for innerHTML
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { SafeHtmlPipe } from "./pipes"
@NgModule({
declarations: [
SafeHtmlPipe,
@marians
marians / CouchDB_Python.md
Last active May 21, 2024 20:53
The missing Python couchdb tutorial

This is an unofficial manual for the couchdb Python module I wish I had had.

Installation

pip install couchdb

Importing the module

@uupaa
uupaa / image.resize.in.github.flavored.markdown.md
Last active May 13, 2024 08:50
image resize in github flavored markdown.

Image source

https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png

Try resize it!

  • ![](https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png | width=100)
@vsouza
vsouza / .bashrc
Last active April 9, 2024 05:27
Golang setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell, fish or bash.
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
@mikehaertl
mikehaertl / gist:3258427
Created August 4, 2012 15:40
Learn you a Haskell - In a nutshell

Learn you a Haskell - In a nutshell

This is a summary of the "Learn You A Haskell" online book under http://learnyouahaskell.com/chapters.


1. Introduction

  • Haskell is a functional programming language.
@mmagm
mmagm / binary-tree.hs
Created May 26, 2012 12:01
haskell binary tree
data BinaryTree a = EmptyTree | Node a (BinaryTree a) (BinaryTree a)
deriving (Show)
treeInsert :: Ord a => a -> BinaryTree a -> BinaryTree a
treeInsert el EmptyTree = Node el EmptyTree EmptyTree
treeInsert el (Node a left right)
| el == a = Node el left right
| el < a = Node a (treeInsert el left) right
| el > a = Node a left (treeInsert el right)