Skip to content

Instantly share code, notes, and snippets.

Avatar

Zhuo Zhang zchrissirhcz

  • HangZhou, China
View GitHub Profile
@zchrissirhcz
zchrissirhcz / For Mac 4.2.6 unlimited trial.md
Created Jun 7, 2022 — forked from rise-worlds/For Mac 4.2.6 unlimited trial.md
Beyond Compare 4 license for Windows, Mac, Linux
View For Mac 4.2.6 unlimited trial.md

for 4.2.4 or higher,4.2.5,4.2.6,4.3.7,it's works , this is the way which makes Always in evaluation mode 。

  1. open Terminal, go to the dir : cd /Applications/Beyond Compare.app/Contents/MacOS
  2. change the name BCompare to BCompare.bak: mv BCompare BCompare.bak
  3. touch a file name BCompare , and chmod a+u BCompare : touch BCompare && chmod a+u BCompare
  4. open BCompare with text editor, insert the script :
#!/bin/bash
rm "/Users/$(whoami)/Library/Application Support/Beyond Compare/registry.dat"
"`dirname "$0"`"/BCompare.bak $@
View AD.py
import math
def sin(x):
if isinstance(x, Dual):
return Dual(sin(x.x), cos(x.x) * x.dx)
return math.sin(x)
def cos(x):
if isinstance(x, Dual):
return Dual(cos(x.x), -1 * sin(x.x) * x.dx)
@zchrissirhcz
zchrissirhcz / read_txt_line_by_line.c
Created Aug 18, 2020
Read text file line by line, implemented in C.
View read_txt_line_by_line.c
/*
Read text file line by line, implemented in C.
*/
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
int main() {
const char* txt_pth = "input.txt";
@zchrissirhcz
zchrissirhcz / install-cudnn.py
Last active Aug 15, 2020
Generate cudnn installation shell commands via python3 for Linux
View install-cudnn.py
#!/bin/sh
"""
Description:
Generate cudnn installation shell commands via python3 for Linux
Author:
Zhuo Zhang (imzhuo@foxmail.com)
2020.08.15 19:00:00 (Asia/Shanghai Time)
@zchrissirhcz
zchrissirhcz / parse_mnist.cpp
Last active May 14, 2022
Parsing MNIST data, save as bmp images
View parse_mnist.cpp
/*
* Read mnist image and labels, save as bmp images
*
* Modified from https://stackoverflow.com/questions/8286668/how-to-read-mnist-data-in-c
*
* Compile:
* clang++ parse_mnist.cpp `pkg-config --libs --flags opencv4`
*/
#include <iostream>
@zchrissirhcz
zchrissirhcz / raw_nn.py
Last active Jun 10, 2020 — forked from borgwang/raw_nn.py
backpropagation with numpy
View raw_nn.py
import numpy as np
from sklearn.datasets import load_iris
def softmax(inputs):
return np.exp(inputs) / np.sum(np.exp(inputs), 1)[:, None]
def construct_net(in_dim, out_dim, hidden_dim=20):
bound1 = np.sqrt(6.0 / (in_dim + hidden_dim))