This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//비트맵을 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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import glob | |
import multiprocessing | |
import os | |
import time | |
from typing import List | |
from tqdm import tqdm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# !/usr/bin/env python3 | |
class PreprocessorHelper: | |
def __init__(self) -> None: | |
super().__init__() | |
def file_classification_by_datetime(self): | |
a_total = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# Normal | |
def test_custom_parser(self): | |
file_paths = glob.glob("/Users/len/log-analyer-assignment/logdata/20180824/*.txt", recursive=False) | |
start_time = time.time() | |
for file_path in file_paths: | |
with open(str(file_path), 'r', encoding='utf8') as infile: | |
lines = infile.readlines() | |
for row_list in tqdm(lines): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.google.gson.JsonArray; | |
import com.google.gson.JsonElement; | |
import com.google.gson.JsonParser; | |
import com.sun.media.jfxmediaimpl.MediaDisposer; | |
import io.reactivex.Observable; | |
import io.reactivex.disposables.Disposable; | |
import io.reactivex.functions.Function; | |
import okhttp3.OkHttpClient; | |
import okhttp3.Request; | |
import okhttp3.Response; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Geek: | |
def __init__(self, bb, cc, dd) -> None: | |
super().__init__() | |
self.bb = bb | |
self.cc = cc | |
self.dd = dd | |
self.input = "" | |
self.print_go(bb, cc, dd) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# !/usr/bin/env python3 | |
import re | |
from random import choice | |
import os.path | |
import requests | |
from lxml import etree | |
from bs4 import BeautifulSoup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// BEGIN imp_classifier | |
import java.util.HashMap; | |
import java.util.HashSet; | |
import java.util.Map; | |
import java.util.Set; | |
public class ImpNumberClassifierSimple { | |
private int _number; //<1> | |
private Map<Integer, Integer> _cache; //<2> |
OlderNewer