Skip to content

Instantly share code, notes, and snippets.

View LenKIM's full-sized avatar
🐋
small step make a big difference👣

simplify-len LenKIM

🐋
small step make a big difference👣
View GitHub Profile
@LenKIM
LenKIM / 파일 분할.py
Created September 17, 2018 02:48
시간별로 로그 파일 분할하기
# -*- coding: utf-8 -*-
# !/usr/bin/env python3
class PreprocessorHelper:
def __init__(self) -> None:
super().__init__()
def file_classification_by_datetime(self):
a_total = []
@LenKIM
LenKIM / MultiProcesses
Last active September 18, 2018 01:29
[파이썬] 아웃풋이 되는 공유자원-리스트를 얻기 위한 멀티스레드 VS 멀티 프로세스 비교
#!/usr/bin/python3
import glob
import multiprocessing
import os
import time
from typing import List
from tqdm import tqdm
@LenKIM
LenKIM / RecyclerViewLastPostionHelper.txt
Last active January 15, 2017 07:21
RecyclerViewLastPostionHelper
/**
* Custom Scroll listener for RecyclerView.
* Based on implementation https://gist.github.com/ssinss/e06f12ef66c51252563e
*/
public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener {
public static String TAG = "EndlessScrollListener";
private int previousTotal = 0; // The total number of items in the dataset after the last load
private boolean loading = true; // True if we are still waiting for the last set of data to load.
private int visibleThreshold = 5; // The minimum amount of items to have below your current scroll position before loading more.
@LenKIM
LenKIM / [android] BitmapToDrawable.txt
Last active December 26, 2016 10:42
[android] BitmapToDrawable
//비트맵을 drawable로 변환하는 함수
public Drawable getDrawableFromBitmap(Bitmap bitmap){
Drawable drawable = new BitmapDrawable(bitmap);
return drawable;
}
//Drawable 을 Bitmap으로 변환하는 함수
public static Bitmap drawableToBitmap (Drawable drawable){
if (drawable instanceof BitmapDrawable){
return ((BitmapDrawable)drawable).getBitmap();
/*
* Copyright (c) 2015, Nordic Semiconductor
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.