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
https://try.ocamlpro.com/#code/open'Format!!exception'Exit'of'int!!type'info'='FI'of'string'*'int'*'int'$5'UNKNOWN!type'$,a'withinfo'='$4i:'info;'v:'$,a$6!!let'dummyinfo'='UNKNOWN!let'createInfo'f'l'c'='FI(f,'l,'c)!!let'errf'f'=!print_flush();!open_vbox'0;!open_hvbox'0;'f();'print_cut();'close_box();'print_newline();!raise'(Exit'1)!!let'printInfo'=!''(*'In'the'text'of'the'book,'file'positions'in'error'messages'are'replaced!with'the'string'$(Error:$('*)!function!FI(f,l,c)'-$.!print_string'f;!print_string'$(:$(;!print_int'l;'print_string'$(.$(;!print_int'c;'print_string'$(:$(!$5'UNKNOWN'-$.!print_string'$($-Unknown'file'and'line$.:'$(!!let'errfAt'fi'f'='errf(fun()-$.'printInfo'fi;'print_space();'f())!!let'err's'='errf'(fun()-$.'print_string'$(Error:'$(;'print_string's;'print_newline())!!let'error'fi's'='errfAt'fi'(fun()-$.'print_string's;'print_newline())!!let'warning's'=!print_string'$(Warning:'$(;'print_string's;!print_newline()!!let'warningAt'fi's'=!printInfo'fi;'print_string'$('Warning:'$(;!print_string's;' |
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
module [Fibonacci] | |
## Returns the Fibonacci sequence up to the nth term. | |
fibonacci : U32 -> List U32 | |
fibonacci = \n -> | |
if n == 0 then | |
[] | |
else if n == 1 then | |
[0] | |
else |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Mathematical Notation</title> | |
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script> | |
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> | |
</head> | |
<body> |
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
aiodns==3.2.0 | |
aiohttp==3.9.5 | |
aiosignal==1.3.1 | |
alpaca-py==0.20.3 | |
alpha-vantage==2.3.1 | |
annotated-types==0.6.0 | |
appdirs==1.4.4 | |
APScheduler==3.10.4 | |
asttokens==2.4.1 | |
attrs==23.2.0 |
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
aiodns==3.2.0 | |
aiohttp==3.9.5 | |
aiosignal==1.3.1 | |
alpaca-py==0.20.3 | |
alpha-vantage==2.3.1 | |
annotated-types==0.6.0 | |
appdirs==1.4.4 | |
APScheduler==3.10.4 | |
asttokens==2.4.1 | |
attrs==23.2.0 |
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
plt.figure(figsize=(16, 8)) | |
stock_data_subset = stock_data[stock_data['ds'].isin(rescaled_predictions_df['ds'])] | |
plt.plot(stock_data_subset['ds'], stock_data_subset['y'], label='Actual Price', linewidth=3, color='blue') | |
# ['iTransformer', 'TSMixer', 'NHITS', 'PatchTST'] | |
plt.plot(rescaled_predictions_df['ds'], rescaled_predictions_df['iTransformer'], | |
label='iTransformer', linewidth=1, color='purple') | |
plt.plot(rescaled_predictions_df['ds'], rescaled_predictions_df['TSMixer'], | |
label='TSMixer', linewidth=1, color='green') | |
plt.plot(rescaled_predictions_df['ds'], rescaled_predictions_df['NHITS'], | |
label='NHITS', linewidth=1, color='red') |
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
# Run Docker image with NixOS and flox: | |
# https://flox.dev/docs/install-flox/ | |
# docker run --pull always --rm -it ghcr.io/flox/flox | |
docker run -it ghcr.io/flox/flox | |
# Then in that shell: | |
# flox config --set-bool disable_metrics true | |
cd ~ | |
flox init | |
flox install python311Packages.python |
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 os | |
import json | |
from datetime import datetime, timezone | |
import time | |
import argparse | |
from alpaca.data.historical.news import NewsClient | |
from alpaca.data.requests import NewsRequest | |
from alpaca.data.timeframe import TimeFrame |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
When naming variables in code, you can follow these best practices: | |
Descriptive: Choose names that are easy to remember. | |
Concise: Use clear and concise names. | |
A longer name needs to earn its length vs a shorter one by being more informative. | |
Lowercase: Use lowercase letters. | |
Underscores: Use underscores to separate words in a name. | |
No spaces: Avoid using spaces in names. | |
No special characters: Avoid using special characters. | |
No acronyms: Avoid using acronyms and abbreviations. | |
No conflicts: Avoid names that could be confused with keywords or built-in functions. |
NewerOlder