Skip to content

Instantly share code, notes, and snippets.

View smilu97's full-sized avatar

Kim YoungJin smilu97

View GitHub Profile
@smilu97
smilu97 / src.cpp
Last active July 7, 2018 19:57
Min-Max Heap
#include <cstdio>
#include <cstdlib>
#include <cstring>
#define HEAPSIZE 10000
typedef long long int64;
typedef unsigned int uint;
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int rnd() { // Returns pseudo-random 32-bit positive integer
static int seed = 0xdeadbeef;
seed *= 65535;
if (seed < 0) seed *= -1;
return seed;
}
🌞 Morning 119 commits ██▏░░░░░░░░░░░░░░░░░░ 10.2%
🌆 Daytime 480 commits ████████▋░░░░░░░░░░░░ 41.3%
🌃 Evening 433 commits ███████▊░░░░░░░░░░░░░ 37.3%
🌙 Night 129 commits ██▎░░░░░░░░░░░░░░░░░░ 11.1%
RT @gas6723: 늑대와 댕댕이 https://t.co/iqTHSSi1V1
@smilu97
smilu97 / join_association.rs
Last active June 29, 2020 06:17
Find Many-to-One related entities and merge them.
use serde_json::{Value, json};
use superslice::*;
pub fn find_with_keys<T: serde::Serialize, U: Ord>(
items: &Vec<T>,
keys: &Vec<U>,
key: U
) -> Value {
let lo = keys.lower_bound(&key);
let up = keys.upper_bound(&key);
@smilu97
smilu97 / ubuntu20-ros-noetic-gym-gazebo-robotis-op3
Created February 9, 2021 17:00
Install gym-gazebo, robotis-op3 on ubuntu 20.04 (gym-gazebo not built)
#!/bin/sh
# Install ros-noetic-desktop-full from apt repository
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt update
sudo apt install -y ros-noetic-desktop-full
@smilu97
smilu97 / ubuntu18-ros-melodic-robotis-op3-gym-gazebo-setup.sh
Last active July 17, 2023 02:31
Setup ros-melodic, robotis-op3, gym-gazebo on ubuntu 18
#!/bin/sh
# Install ROS melodic from apt repository
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt update
sudo apt install -y ros-melodic-desktop-full
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc
const constructStyle = (x, y) => `
position: fixed;
left: ${x}px;
top: ${y}px;
width: 50px;
height: 50px;
background: red;
border-radius: 25px;
`;
# author: smilu97
# description: solution code for https://projecteuler.net/problem=11
import numpy as np
raw = '''
08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08
49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00
81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65
52 70 95 23 04 60 11 42 69 24 68 56 01 32 56 71 37 02 36 91
@smilu97
smilu97 / geocode.py
Last active May 12, 2021 04:53
Simple geocoding impl
# created at: 2021-05-12 12:24
# author: smilu97
from collections import defaultdict
from typing import Iterable
import numpy as np
import hashlib
class Geocoding: