Skip to content

Instantly share code, notes, and snippets.

View HowardWhile's full-sized avatar

Howard Cheng HowardWhile

  • Foxconn
  • Taipei, Taiwan
  • 01:08 (UTC +08:00)
View GitHub Profile
#ifndef arc_console_h__
#define arc_console_h__
#include <time.h>
#include <sys/time.h>
#include <stdio.h>
#include <limits.h>
#define ENABLE_ARC_CONSOLE (1)
@HowardWhile
HowardWhile / git-proxy-switcher.bat
Created May 6, 2025 00:36
Batch Script to Set/Unset Global Git Proxy
@echo off
echo Select an operation:
echo 1. Set global proxy
echo 2. Unset global proxy
echo 3. Show current proxy settings
echo 4. Exit
set /p choice=Please enter the option number and press Enter:
if "%choice%"=="1" (
@HowardWhile
HowardWhile / cyclictest-hist-plot.sh
Created January 31, 2023 05:22
cyclictest & histogram
#!/bin/bash
# 1. Run cyclictest
sudo cyclictest -l ${1-10000} -m -Sp99 --policy=fifo -h ${2-400} -q >output
# 2. Get maximum latency
max=`grep "Max Latencies" output | tr " " "\n" | sort -n | tail -1 | sed s/^0*//`
# 3. Grep data lines, remove empty lines and create a common field separator
grep -v -e "^#" -e "^$" output | tr " " "\t" >histogram
@HowardWhile
HowardWhile / Version.cs
Last active July 28, 2020 03:11
CurrentVersion
public string CurrentVersion
{
get
{
Assembly assembly = Assembly.GetExecutingAssembly();
FileVersionInfo fileVersionInfo = FileVersionInfo.GetVersionInfo(assembly.Location);
return fileVersionInfo.ProductVersion;
}
}
@HowardWhile
HowardWhile / my_fft.cs
Last active May 29, 2020 05:37
my_fft
public class Result
{
public Result(int i_sample_len)
{
Array.Resize(ref x_hz, i_sample_len);
Array.Resize(ref y_magnitude, i_sample_len);
}
public double[] x_hz;
public double[] y_magnitude;
#include "FastestGaussianBlur.h"
#define _USE_MATH_DEFINES
#include <math.h>
#include <stdio.h>
#include <omp.h>
#define min(X, Y) (((X) < (Y)) ? (X) : (Y))
#define max(X, Y) (((X) > (Y)) ? (X) : (Y))