Skip to content

Instantly share code, notes, and snippets.

View HyundongHwang's full-sized avatar

Hyundong Hwang HyundongHwang

View GitHub Profile
@HyundongHwang
HyundongHwang / ZTest.cs
Created September 20, 2024 10:36
Call CameraRoll on Android in Unity
public class ZTest : ZMonoBehaviour
{
private void _On_zaos_openGalleryVideo()
{
var zActivityCls = new AndroidJavaClass("app.streamstudio.stream.zaos.ZActivity");
zActivityCls.CallStatic("openGalleryVideo", "mainScript");
}
public async void openGalleryVideo_Success(string videoPath)
{
import os
def rename_files_in_directory():
for filename in os.listdir('.'): # loop through all the files in the directory
if filename.endswith(".png") and filename.startswith("-"): # check for .png files with the particular pattern
split_name = filename.split('-') # split the filename on the hyphen
if len(split_name) == 3: # check to ensure we have the expected three parts
prefix, old_number, rest = split_name
new_number = str(int(old_number) + 54678).zfill(5) # add 54678 to the old number, convert to string, and pad with zeroes
new_filename = f"{new_number}-{rest}" # assemble the new filename
@HyundongHwang
HyundongHwang / cuda_stress.py
Last active June 28, 2023 14:34
cuda stress
import torch
while True:
print(f"STRESS_START")
a = torch.randn(1024, 1024, dtype=torch.double, device='cuda')
b = torch.randn(1024, 1024, dtype=torch.double, device='cuda')
for i in range(100000):
c = a @ b
@HyundongHwang
HyundongHwang / gst_python_custom_element.py
Created June 14, 2023 06:23
gst_python_custom_element.py
# -*- coding: utf-8 -*-
import cv2
import gi
import numpy as np
import os
import threading
import time
gi.require_version('GLib', '2.0')
gi.require_version('GObject', '2.0')
# -*- coding: utf-8 -*-
import maya
import numpy as np
import os
import pandas as pd
import time
from datetime import datetime, timedelta
from enum import Enum, auto
@HyundongHwang
HyundongHwang / _48_2_thread_loop.kt
Last active July 3, 2020 10:13
_48_2_thread_loop
private val _ps_2_thread_loop = PublishSubject.create<Array<Any>>()
fun _48_2_thread_loop() {
_ps_2_thread_loop
.observeOn(Schedulers.io())
.map {
val cmd = it[0] as String
when (cmd) {
"cmd0" -> {
@HyundongHwang
HyundongHwang / dyn-json-parse.cs
Created December 14, 2017 17:24
동적 json 파싱
class Program
{
static void Main(string[] args)
{
var JSON_STR_0 = "{\"method\":\"m0\",\"body\":{\"hello\":\"world\"}}"; ;
var JSON_STR_1 = "{\"method\":\"m1\",\"body\":{\"name\":\"이름\",\"birthYear\":1900}}";
var jobj = JObject.Parse(JSON_STR_0);
var m = jobj.Value<string>("method");
var jbody = jobj.GetValue("body");
@HyundongHwang
HyundongHwang / CoconutNsisPlugin.cpp
Created November 7, 2017 07:23
닷넷프레임워크4.0, KB2468871 설치 여부 체크 dll, 사용 스크립트
// CoconutNsisPlugin.cpp : Defines the exported functions for the DLL application.
//
#include "stdafx.h"
#include "CoconutNsisPlugin.h"
@HyundongHwang
HyundongHwang / coverflow-fix.java
Created October 26, 2017 06:32
coverflow-fix.java
public static void setViewPagerScrollSensitive(ViewPager viewPager, int sensitiveOffset) {
viewPager.setOnTouchListener(new View.OnTouchListener() {
public int _curIdx;
public float _oldX;
public float _oldY;
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
int action = motionEvent.getAction();
@HyundongHwang
HyundongHwang / gist:6d480ef916a7126843acc52242f76ace
Last active September 20, 2017 17:08
get pc unique id from pc's hardware
private static string _GetPcUniqueKey()
{
if (!string.IsNullOrWhiteSpace(_pcUniqueKey))
return _pcUniqueKey;
var processorId = "";
var baseBoardSerialNumber = "";
var macAddress = "";