Skip to content

Instantly share code, notes, and snippets.

View luan1412167's full-sized avatar
🎯
Focusing

luan1412167 luan1412167

🎯
Focusing
  • Ho Chi Minh City Viet Nam Country
View GitHub Profile
@luan1412167
luan1412167 / getPools.ts
Created July 16, 2024 15:16 — forked from jakerumbles/getPools.ts
Raydium getPools.ts
import {
LIQUIDITY_STATE_LAYOUT_V4,
MARKET_STATE_LAYOUT_V3,
DEVNET_PROGRAM_ID,
MAINNET_PROGRAM_ID,
} from "@raydium-io/raydium-sdk";
import {
Connection,
PublicKey,
GetProgramAccountsConfig,
@luan1412167
luan1412167 / AdbCommands
Created January 7, 2022 04:44 — forked from Pulimet/AdbCommands
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@luan1412167
luan1412167 / csvfile.h
Created September 15, 2021 09:01 — forked from rudolfovich/csvfile.h
CSV file generator
#pragma once
#include <string>
#include <iostream>
#include <fstream>
#include <sstream>
class csvfile;
inline static csvfile& endrow(csvfile& file);
inline static csvfile& flush(csvfile& file);
@luan1412167
luan1412167 / tegra-cam-rec.py
Created August 20, 2021 03:10 — forked from jkjung-avt/tegra-cam-rec.py
A Tegra X2/X1 camera recorder, implemented in python
# --------------------------------------------------------
# Camera Recorder for Tegra X2/X1
#
# This program captures video from IP CAM, USB webcam,
# or the Tegra onboard camera, adds some watermark on
# the video frames and then records it into a TS file.
# The code demonstrates how to use cv2.VideoWriter()
# while taking advantage of TX2/TX1's H.264 H/W encoder
# capabilities.
#
@luan1412167
luan1412167 / how-to-download-from-pan-baidu.md
Created June 30, 2021 02:38
How to download from pan.baidu without account

How to download from pan.baidu.com

Disclaimer:

  • This methods uses a 3rd party website: https://baidu.kinh.cc/.
  • I don't know chinese and after one day of searching for a method I finally found this. I don't know how safe this website is but it does the job.
  • Do it on your own responsibility. I have no idea about possible copyright (if there is such a thing in China) and other stuff regarding to this.

Steps

1. Open the website mentioned above and fill out fields as following:

#!/bin/bash
## This gist contains instructions about cuda v10.1 and cudnn 7.6 installation in Ubuntu 18.04 for Tensorflow 2.1.0
### steps ####
# verify the system has a cuda-capable gpu
# download and install the nvidia cuda toolkit and cudnn
# setup environmental variables
# verify the installation
###
@luan1412167
luan1412167 / weighted_cross_entropy.py
Created October 2, 2020 03:30 — forked from nasimrahaman/weighted_cross_entropy.py
Pytorch instance-wise weighted cross-entropy loss
import torch
import torch.nn as nn
def log_sum_exp(x):
# See implementation detail in
# http://timvieira.github.io/blog/post/2014/02/11/exp-normalize-trick/
# b is a shift factor. see link.
# x.size() = [N, C]:
b, _ = torch.max(x, 1)