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 minimal exmaple of flash attention implemented in Numpy | |
# Contact: bingquanxia AT qq.com | |
import unittest | |
from typing import List | |
import numpy as np | |
import torch |
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
CC=clang | |
CXX=clang++ | |
PWD=$(shell pwd) | |
JOBS=$(shell nproc) | |
.ONESHELL: | |
.PHONY: all | |
all: vim iverilog go |
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
# environmental parameters | |
BASEDIR=$HOME/local | |
PACKAGES="autoconf bison build-essential clang curl flex gettext git gperf libncurses5-dev lua5.3 python-setuptools ruby zsh" | |
LANG_PACKAGES="liblua5.1-dev libluajit-5.1-dev luajit python3-dev ruby-dev" | |
GUI_PACKAGES="bleachbit gnome-tweak-tool gtkwave ibus-mozc indicator-multiload libgtk2.0-dev qtcreator synaptic vlc xorg-dev" | |
GOPATH=$HOME/go | |
GOROOT=$HOME/local/src/go | |
PATH=$GOPATH/bin:$PATH | |
PATH=$GOROOT/bin:$PATH | |
# |
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
Get-AppxPackage 9E2F88E3.Twitter | Remove-AppxPackage | |
Get-AppxPackage Microsoft.3DBuilder | Remove-AppxPackage | |
Get-AppxPackage Microsoft.BingFinance | Remove-AppxPackage | |
Get-AppxPackage Microsoft.BingNews | Remove-AppxPackage | |
Get-AppxPackage Microsoft.BingSports | Remove-AppxPackage | |
Get-AppxPackage Microsoft.BingWeather | Remove-AppxPackage | |
Get-AppxPackage Microsoft.CommsPhone | Remove-AppxPackage | |
Get-AppxPackage Microsoft.Getstarted | Remove-AppxPackage | |
Get-AppxPackage Microsoft.Messaging | Remove-AppxPackage | |
Get-AppxPackage Microsoft.MicrosoftOfficeHub | Remove-AppxPackage |
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 | |
if [ $# -eq 1 ]; then | |
INSTALLPATH=$1 | |
else | |
INSTALLPATH=`pwd`/local | |
fi | |
CORE=`expr \`nproc\` + 1` |
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
#-*- encoding: utf-8 -*- | |
import random | |
def open_door(doors, answer, choice): | |
rest_doors = [x for x in doors if x is not choice] | |
opened_door = random.choice([x for x in rest_doors if x is not answer]) | |
return [x for x in doors if x is not opened_door] | |
doors = [1, 2, 3] |
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
#-*- coding: utf-8 -*- | |
import sys | |
print("Input the item values:") | |
c = map(int, sys.stdin.readline().split(" ")) | |
c.insert(0, 0) | |
print("Input the item sizes:") | |
a = map(int, sys.stdin.readline().split(" ")) | |
a.insert(0, 0) |
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 argc, char *argv[]) | |
{ | |
int h,w; | |
int width; | |
int height; | |
int total; | |
size_t frame_size; |
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 math | |
def getwords(doc): | |
splitter = re.compile('\\W*') | |
# Split the words by non-alpha characters | |
words = [s.lower() for s in splitter.split(doc) | |
if len(s) > 2 and len(s) < 20] |
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 pysqlite2 import dbapi2 as sqlite | |
import re | |
import math | |
def getwords(doc): | |
splitter = re.compile('\\W*') | |
# Split the words by non-alpha characters | |
words = [s.lower() for s in splitter.split(doc) | |
if len(s) > 2 and len(s) < 20] |
NewerOlder