Skip to content

Instantly share code, notes, and snippets.

View a6y3ap's full-sized avatar

Abuzar a6y3ap

  • Chengdu, China
  • 18:20 (UTC +08:00)
View GitHub Profile
@a6y3ap
a6y3ap / PythonSerialExceptionFix.md
Created August 23, 2024 14:00
Fix for Python SerialException: Device reports readiness to read but returned no data (device disconnected?)

Python SerialException: Device reports readiness to read but returned no data (device disconnected?)

Fix:

Use this command:

sudo systemctl stop [email protected]
@a6y3ap
a6y3ap / MySQLcommandLine.md
Created August 19, 2022 19:29
How to use MySQL Command Line with special characters password

How to use MySQL command line with special characters password

You must do this if the password has any of the following characters:

* ? [ < > & ; ! | $ ( )

🟥 Important Note: Make sure there is no space after -p and MySQL password.

@a6y3ap
a6y3ap / GoogleDrive-WGET.md
Created August 13, 2022 10:03
How to download a Google Drive URL via WGET

How to download a Google Drive URL via WGET

For small file

Run following command on your terminal:

wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O FILENAME
@a6y3ap
a6y3ap / JosephusProblem.java
Last active July 3, 2021 11:49
Josephus Problem using Bitwise Operation (Java)
/*
* Solution of Josephus Problem using Bitwise Operation
* Shifting the most-significant set bit of n to the
* least significant bit will return the safe position.
*
* ====================== EXPLANATION ======================
*
* n (41) the number of people standing in the circle
* n = 101001
*
@a6y3ap
a6y3ap / JosephusProblem.java
Created January 6, 2019 22:20
Joshphus Problem using Bitwise Operation (Java)
/*
* Solution of Joshphus Problem using Bitwise Operation
* Wikipedia: https://en.wikipedia.org/wiki/Josephus_problem
* YouTube: https://www.youtube.com/watch?v=uCsD3ZGzMgE
*
* ====================== EXPLANATION ======================
*
* n (41) the number of people standing in the circle
* n = 101001
*
@a6y3ap
a6y3ap / StringNumber.java
Created January 3, 2019 20:57
Check if string is a valid number (Java)
static boolean isValid(String value) {
try { new java.math.BigInteger(value); }
catch (Exception e) { return false; }
return true;
}