Skip to content

Instantly share code, notes, and snippets.

View HuangJiaLian's full-sized avatar
💭
I'm good

Jie Huang HuangJiaLian

💭
I'm good
View GitHub Profile
@HuangJiaLian
HuangJiaLian / make_dmg.sh
Created April 2, 2022 05:37
Two steps to turn a Python file to a macOS installer
#!/bin/sh
# Ref.: https://www.pythonguis.com/tutorials/packaging-pyqt5-applications-pyinstaller-macos-dmg/
rm -rf build dist/*
#################################################
# Create app file using pyinstaller
#################################################
pyinstaller --name 'Huanbu' \
@HuangJiaLian
HuangJiaLian / ConvergenceTest.md
Last active November 23, 2023 14:03
Convergence Testing For NaAlH4

1. K-mesh testing

K: 1 3 5 7 9 for the same ecut_wfc 46 ecut_rho 221

===================================================================================
K 1 ecut_wfc 46 ecut_rho 221
Forces on each atoms (Ry/au)
     atom    1 type  2   force =     0.00000000    0.00000000   -0.00000000
     atom    2 type  2   force =     0.00000000    0.00000000   -0.00000000
     atom    3 type  1   force =     0.00000000    0.00000000    0.00000000
     atom    4 type  1   force =     0.00000000    0.00000000    0.00000000
@HuangJiaLian
HuangJiaLian / Log.md
Last active October 18, 2023 09:17
How to run PPAFM workflow correctly

What I want

Generate the images like Yash 😃

Eviroment I use

System: Aalto Triton Linux On login node (CPU)

What I've done

Since I met some problems when I run the workflow, I just used these parameters you provided in PP_Complex_Tip branch. The image I get is diffenrent from you. Images samples

@HuangJiaLian
HuangJiaLian / log.md
Created May 30, 2023 11:43
Installation log to make GPU version runs on macOS

This is a installation log to enable GPU version ppafm runs macOS(13.4)

To use the GPU version of [[ppafm]] on macOS, I installed pyopencl and pocl as following, instead of using pip to install.

conda install -c conda-forge pyopencl
conda install -c conda-forge pocl

Installation log

@HuangJiaLian
HuangJiaLian / 9_change_tempo_part.py
Last active May 4, 2023 20:31
Change tempo using the scale
# Variable for the scale value
scale_var = tk.IntVar(midFrame)
# When scale changes
def update(*args):
global scale_var, time_signature, interval_ms, tempo
tempo = scale_var.get()
interval_ms = int((60/tempo) * (4/time_signature[-1]) * 1000)
# Use a scale to show the tempo range
@HuangJiaLian
HuangJiaLian / gist:f794700edda54ccdddfa9f73e40244dc
Created October 18, 2022 07:15
Errors: MBX-0.7/plugins/lammps/examples/na+_bulk/1atm/298K
(work) 298K > mpirun -np 2 lmp_mpi_mbx -in lammps.in
--------------------------------------------------------------------------
By default, for Open MPI 4.0 and later, infiniband ports on a device
are not used by default. The intent is to use UCX for these devices.
You can override this policy by setting the btl_openib_allow_ib MCA parameter
to true.
Local host: login-0-0
Local adapter: mlx4_0
Local port: 1
@HuangJiaLian
HuangJiaLian / gist:069ab4421b197a79ddfe561112148549
Created October 18, 2022 07:10
/MBX-0.7/plugins/lammps/examples/ch4/20atm/125K
(work) 125K > mpirun -np 2 lmp_mpi_mbx -in lammps.in
--------------------------------------------------------------------------
By default, for Open MPI 4.0 and later, infiniband ports on a device
are not used by default. The intent is to use UCX for these devices.
You can override this policy by setting the btl_openib_allow_ib MCA parameter
to true.
Local host: login-0-0
Local adapter: mlx4_0
Local port: 1
@HuangJiaLian
HuangJiaLian / 1_play_beats.py
Last active September 23, 2022 17:52
Play click sound
import simpleaudio, time
strong_beat = simpleaudio.WaveObject.from_wave_file('strong_beat.wav')
while True:
strong_beat.play()
time.sleep(0.5)
@HuangJiaLian
HuangJiaLian / cube_services.sh
Created April 6, 2022 01:38
Mi Magic Cube Services
0000aadb-0000-1000-8000-00805f9b34fb (Handle: 14): Vendor specific
0000aadc-0000-1000-8000-00805f9b34fb (Handle: 15): Vendor specific ['read', 'notify']
--------------------------------
0000aaaa-0000-1000-8000-00805f9b34fb (Handle: 18): Vendor specific
0000aaab-0000-1000-8000-00805f9b34fb (Handle: 19): Vendor specific ['notify']
0000aaac-0000-1000-8000-00805f9b34fb (Handle: 22): Vendor specific ['write-without-response']
--------------------------------
0000fe95-0000-1000-8000-00805f9b34fb (Handle: 24): Xiaomi Inc.
00000001-0000-1000-8000-00805f9b34fb (Handle: 25): SDP ['write', 'notify']
00000002-0000-1000-8000-00805f9b34fb (Handle: 28): Vendor specific ['read']
@HuangJiaLian
HuangJiaLian / 16_m_to_loop_through_ts_modes_part.py
Created March 31, 2022 15:45
M to loop through modes of time signature
time_signatures = {0: [' 2 / 4', (2, 4)], 1: [' 3 / 4',(3 ,4)], 2: [' 4 / 4',(4, 4)], 3: [' 2 / 2',(2, 2)],
4: [' 6 / 8',(6, 8)], 5: [' 9 / 8',(9, 8)], 6: ['12/ 8',(12, 8)],
7: [' * / 4',(-1, 4)], 8: [' * / 2',(-1,2)], 9: [' * / 8',(-1,8)]}
def key_pressed(event):
global ON, ts_mode, time_signatures
if event.char == ' ':
ON = not ON
elif event.char == 't':
tap_estimate()