This file contains hidden or 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
| package com.github.manuelpeinado.toolbartest; | |
| import android.graphics.Color; | |
| import android.graphics.drawable.Drawable; | |
| import android.os.Bundle; | |
| import android.support.v7.app.ActionBarActivity; | |
| import android.support.v7.widget.Toolbar; | |
| import android.view.Menu; | |
| import android.view.View; |
This file contains hidden or 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
| /** | |
| * This is a direct port of https://github.com/nathan-fiscaletti/ansi-util | |
| * | |
| * @author Nathan Fiscaletti | |
| * @see https://github.com/nathan-fiscaletti/ansi-util | |
| * | |
| * Usage: | |
| * | |
| * StringBuilder sb = new StringBuilder(); | |
| * |
This file contains hidden or 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
| Spinner spinner = (Spinner) findViewById(R.id.main_spinner); | |
| ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<>(getSupportActionBar().getThemedContext(), | |
| R.layout.spinner_list_style, | |
| getResources().getStringArray(R.array.countries)); | |
| spinnerAdapter.setDropDownViewResource(R.layout.spinner_dropdown_item); | |
| spinner.setAdapter(spinnerAdapter); |
This file contains hidden or 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
| # data: dictionary { 'dd/mm/yyy': price, 'dd/mm/yyyy': price, ... } | |
| def relativeStrengthIndex(data, num): | |
| if not isinstance(data, dict): | |
| raise Exception('Dictionary input expected') | |
| if not isinstance(num, int): | |
| raise Exception('Integer input expected') |
This file contains hidden or 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 pandas as pd | |
| def rsi(ohlc: pd.DataFrame, period: int = 14) -> pd.Series: | |
| """See source https://github.com/peerchemist/finta | |
| and fix https://www.tradingview.com/wiki/Talk:Relative_Strength_Index_(RSI) | |
| Relative Strength Index (RSI) is a momentum oscillator that measures the speed and change of price movements. | |
| RSI oscillates between zero and 100. Traditionally, and according to Wilder, RSI is considered overbought when above 70 and oversold when below 30. | |
| Signals can also be generated by looking for divergences, failure swings and centerline crossovers. |
This file contains hidden or 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
| #if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end | |
| import android.content.Context; | |
| import android.view.LayoutInflater; | |
| import android.view.View; | |
| import android.view.ViewGroup; | |
| import androidx.annotation.Nullable; | |
| import androidx.recyclerview.widget.DiffUtil; | |
| import androidx.recyclerview.widget.RecyclerView; |
This file contains hidden or 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
| # SGR color constants | |
| # rene-d 2018 | |
| class Colors: | |
| """ ANSI color codes """ | |
| BLACK = "\033[0;30m" | |
| RED = "\033[0;31m" | |
| GREEN = "\033[0;32m" | |
| BROWN = "\033[0;33m" | |
| BLUE = "\033[0;34m" |
This file contains hidden or 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
| android.buildTypes { | |
| release { | |
| // You must use the following property to specify additional ProGuard | |
| // rules for dynamic feature modules. | |
| consumerProguardFiles 'proguard-rules-dynamic-features.pro' | |
| } | |
| } |
This file contains hidden or 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
| <?xml version="1.0" encoding="utf-8"?> | |
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| xmlns:tools="http://schemas.android.com/tools" | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| tools:context="com.example.oshin.myjsonlist.MainActivity"> | |
| <ListView | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" |