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 numpy as np | |
def rgb_to_hex(rgb: np.ndarray) -> str: | |
rgb = rgb.reshape(3) | |
return '#{:02X}{:02X}{:02X}'.format(*rgb) | |
def hex_to_rgb(hex_str: str) -> np.ndarray: | |
hex_str = hex_str.strip() |
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
{ | |
"5R04": "C6A098", | |
"5R05": "C39990", | |
"5R06": "C1958C", | |
"5R07": "BE9186", | |
"4R04": "C6A096", | |
"4R05": "C39A8E", | |
"4R06": "C19487", | |
"4R07": "BC8D80", | |
"4R08": "B58678", |
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
/** | |
* A class that adds endless scroll support to a {@link RecyclerView}. | |
*/ | |
public class EndlessScrollSupport { | |
private final RecyclerView recyclerView; | |
private EndlessScrollListener endlessScrollListener; | |
private int startPage = 0; | |
/** The current offset index of data you have loaded. */ |
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
/** | |
* A class that adds item click support to a {@link RecyclerView}. | |
* | |
* @author Hugo Visser | |
* @see <a href="http://www.littlerobots.nl/blog/Handle-Android-RecyclerView-Clicks/"> | |
* Getting your clicks on RecyclerView</a> | |
*/ | |
public class ItemClickSupport { | |
private final RecyclerView recyclerView; | |
private OnItemClickListener itemClickListener; |
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) 2006 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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 2015 Shahin Yousefi | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
/** | |
* Formats a number count to an abbreviated form with the appropriate unit suffix. | |
* | |
* @param count number count | |
* @param <T> type of number | |
* @return An abbreviated count with the appropriate unit suffix. | |
*/ | |
public static <T extends Number & Comparable<? super T>> String shortCount(T count) { | |
String base = "##0"; | |
String[] suffixes = {"'K'", "'M'", "'B'"}; |
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
/** | |
* Sends the {@code AbstractGoogleJsonClientRequest} to the server and returns an {@code Observable} | |
* that emits the parsed {@code GenericJson} response. | |
* | |
* <dl> | |
* <dt><b>Scheduler:</b></dt> | |
* <dd>{@code executeAsObservable} does not operate by default on a particular | |
* {@link rx.Scheduler}.</dd> | |
* </dl> | |
* |
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) 2011 Micah Hainline | |
* Copyright (C) 2012 Triposo | |
* Copyright (C) 2013 Paul Imhoff | |
* Copyright (C) 2014 Shahin Yousefi | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* |