Skip to content

Instantly share code, notes, and snippets.

View teocci's full-sized avatar
👨‍💻
Coding

Teocci teocci

👨‍💻
Coding
View GitHub Profile

Annual Percentage Rate (APR) and Annual Percentage Yield (APY) may seem similar, but knowing the difference and how they are used will help you make better financial decisions.

Compounding Period
Annually 1
Semi-Annually 2
Monthly 12
Weekly 52
Daily 365
  1. Commit all changes
git commit -am "changes"
Output
[main 3235010] Add Goodbye method
 1 file changed, 4 insertions(+)
  1. Push changes

How To Install FFmpeg on CentOS 7 / RHEL 7

The RPM Fusion repository depends on the EPEL software repository. If the EPEL is not enabled on your system, enable it by typing:

## RHEL 7
subscription-manager repos --enable rhel-*-optional-rpms \
                           --enable rhel-*-extras-rpms \
                           --enable rhel-ha-for-rhel-*-server-rpms
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
## CentOS 7
ExecutorService executor = Executors.newSingleThreadExecutor();
Handler handler = new Handler(Looper.getMainLooper());
executor.execute(() -> {
//Background work here
handler.post(() -> {
//UI Thread work here
});
});
val datePicker =
MaterialDatePicker.Builder.datePicker()
.setTitleText("Select date")
.setSelection(MaterialDatePicker.todayInUtcMilliseconds())
.build()
datePicker.show()
@teocci
teocci / gson.java
Last active February 15, 2022 08:54
save JSON data in a file and retrieve it
Gson gson = new Gson();
Type collectionType = new TypeToken<ArrayList<PersonContainer>>() {}.getType();
ArrayList<PersonContainer> Persons = gson.fromJson(new FileReader("input.json"), collectionType);
System.out.println(gson.toJson(persons));
class PersonContainer
{
Person person;

- Alpha

Alpha measures the difference between an investment's expected returns based on its beta and its actual returns. A positive alpha indicates the investment has performed better than its beta would predict. A negative alpha indicates an investment has underperformed, given the investment's beta.

- Beta

Beta measures an investment's sensitivity to market movements. A beta greater than one indicates the investment is more volatile than the market. If beta is less than one, the investment is less risky than the market.

- R-Squared

R-Squared reflects the percentage of an investment's movements that are explained by movements in its benchmark index. A higher R-squared indicates a more useful beta figure. A lower R-squared (less than 70%) is less relevant to the investment's performance.

- Standard Deviation

@teocci
teocci / MobaXterm.ini
Created December 16, 2021 00:58
mobaxterm dracula theme
[Misc]
PasswordsInRegistry=0
LastSession=WSL-Ubuntu|#105#14%1%
SessionP=67662133194
DefTextEditor=_ProfileDir_\AppData\Local\Programs\Microsoft VS Code\Code.exe
LogFileFormat=
StorePasswords=Never
StoreSSHKeysPassphrases=0
BackupIni=1
LogTerminalActivity=0
@teocci
teocci / clock.svg
Last active December 23, 2021 09:25
clock.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@teocci
teocci / bash-tar-without-dir.sh
Created December 2, 2021 11:05
bash-tar-without-dir.sh
#!/bin/bash
# mkdir -vp ~/tmp/{web/gui,cpp/bin}
# touch cpp/bin/gcs.out
# touch web/gui/gui-{a,b,c,d}.js
# touch web/gui/other-{a,b}.js
# touch web/conf-{a,b,c}.json
# touch web/other-{1,2,3,4}
## Builds directories
BUILDS_DIR='builds'