Skip to content

Commit b57e8c8

Browse files
committed
added notes
1 parent e628e2e commit b57e8c8

File tree

46 files changed

+2483
-109
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2483
-109
lines changed

content/notes/_index.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
title: Notes
3+
---

content/notes/physics/_index.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: Physics
3+
menu:
4+
notes:
5+
name: Physics
6+
identifier: notes-physics
7+
weight: 10
8+
---
9+
10+
# Physics Notes
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
title: Electromagnetism
3+
weight: 10
4+
menu:
5+
notes:
6+
name: Electromagnetism
7+
identifier: notes-physics-em
8+
parent: notes-physics
9+
weight: 10
10+
---
11+
<!-- A Sample Program -->
12+
{{< note title="Maxwell Equation (Integral)" textcolor="white">}}
13+
14+
15+
$$\delta + 5 $$
16+
17+
{{< /note >}}
18+

content/notes/python/_index.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: Python Notes
3+
menu:
4+
notes:
5+
name: Python
6+
identifier: notes-python
7+
weight: 10
8+
---
9+
10+
# Python Notes

content/notes/python/web/index.md

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
title: WebSocket
3+
weight: 10
4+
menu:
5+
notes:
6+
name: WebSocket
7+
identifier: notes-python-web
8+
parent: notes-python
9+
weight: 10
10+
---
11+
<!-- A Sample Program -->
12+
{{< note title="Connect to a Websocket">}}
13+
A sample **python** program is show here.
14+
15+
```python
16+
import websocket
17+
18+
19+
def on_message(ws, message):
20+
print(message)
21+
22+
def on_error(ws, error):
23+
print(f"Encountered error: {error}")
24+
25+
def on_close(ws, close_status_code, close_msg):
26+
print("Connection closed")
27+
28+
def on_open(ws):
29+
print("Connection opened")
30+
ws.send("Hello, Worldy!")
31+
32+
if __name__ == "__main__":
33+
ws = websocket.WebSocketApp("ws://localhost:xxxx", # insert here you websocket addres
34+
on_message=on_message,
35+
on_error=on_error,
36+
on_close=on_close)
37+
ws.on_open = on_open
38+
ws.run_forever()
39+
```
40+
41+
Run the program as below:
42+
43+
```bash
44+
$ python websocket_example.py
45+
```
46+
{{< /note >}}
47+
48+
<!-- Declaring Variables
49+
50+
{{< note title="Variables" >}}
51+
**Normal Declaration:**
52+
```go
53+
var msg string
54+
msg = "Hello"
55+
```
56+
57+
---
58+
59+
**Shortcut:**
60+
```go
61+
msg := "Hello"
62+
```
63+
{{< /note >}}
64+
65+
66+
<!-- Declaring Constants -->
67+
68+
<!-- {{< note title="Constants" >}}
69+
```go
70+
const Phi = 1.618
71+
```
72+
{{< /note >}} --> -->

public/categories/finance/index.html

+7-7
Original file line numberDiff line numberDiff line change
@@ -296,15 +296,15 @@
296296
<div class="post-card">
297297
<div class="card">
298298
<div class="card-head">
299-
<a href="/posts/finance/stock_prediction/sarimax/index.md/" class="post-card-link">
300-
<img class="card-img-top" src='/images/default-hero.jpg' alt="Hero Image">
299+
<a href="/posts/finance/stock_prediction/sarimax/" class="post-card-link">
300+
<img class="card-img-top" src='/posts/finance/stock_prediction/sarimax/sarimax_example_files/sarimax_example_6_0.png' alt="Hero Image">
301301
</a>
302302
</div>
303303
<div class="card-body">
304-
<a href="/posts/finance/stock_prediction/sarimax/index.md/" class="post-card-link">
304+
<a href="/posts/finance/stock_prediction/sarimax/" class="post-card-link">
305305
<h5 class="card-title">SARIMAX Model Analysis of Apple Stock with Exogenous Variables</h5>
306-
<p class="card-text post-summary">Introduction to Exogenous Variables in Time Series Models Exogenous variables, also known as external regressors, are independent variables that are not part of the main time series but can influence it. In the context of stock price prediction, exogenous variables might include:
307-
Market indices (e.g., S&amp;P 500) Economic indicators (e.g., GDP growth, unemployment rate) Company-specific metrics (e.g., revenue, earnings per share) Sentiment indicators (e.g., social media sentiment) Mathematical Formulation of SARIMAX The SARIMAX model extends the SARIMA model by including exogenous variables.</p>
306+
<p class="card-text post-summary">In the previous articles we saw the limitations of the ARIMA and SARIMA. Therefore, in this article we are going to implement a SARIMAX model the can include exogenous variables
307+
Introduction to Exogenous Variables in Time Series Models Exogenous variables, also known as external regressors, are independent variables that are not part of the main time series but can influence it. In the context of stock price prediction, exogenous variables might include:</p>
308308
</a>
309309

310310
<div class="tags">
@@ -327,9 +327,9 @@ <h5 class="card-title">SARIMAX Model Analysis of Apple Stock with Exogenous Vari
327327
<div class="card-footer">
328328
<span class="float-start">
329329
Saturday, July 6, 2024
330-
| 12 minutes </span>
330+
| 7 minutes </span>
331331
<a
332-
href="/posts/finance/stock_prediction/sarimax/index.md/"
332+
href="/posts/finance/stock_prediction/sarimax/"
333333
class="float-end btn btn-outline-info btn-sm">Read</a>
334334
</div>
335335
</div>

public/categories/finance/index.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
<language>en</language>
99
<lastBuildDate>Sat, 06 Jul 2024 00:00:00 +0100</lastBuildDate><atom:link href="http://localhost:1313/categories/finance/index.xml" rel="self" type="application/rss+xml" /><item>
1010
<title>SARIMAX Model Analysis of Apple Stock with Exogenous Variables</title>
11-
<link>http://localhost:1313/posts/finance/stock_prediction/sarimax/index.md/</link>
11+
<link>http://localhost:1313/posts/finance/stock_prediction/sarimax/</link>
1212
<pubDate>Sat, 06 Jul 2024 00:00:00 +0100</pubDate>
1313

14-
<guid>http://localhost:1313/posts/finance/stock_prediction/sarimax/index.md/</guid>
15-
<description>Introduction to Exogenous Variables in Time Series Models Exogenous variables, also known as external regressors, are independent variables that are not part of the main time series but can influence it. In the context of stock price prediction, exogenous variables might include:
16-
Market indices (e.g., S&amp;amp;P 500) Economic indicators (e.g., GDP growth, unemployment rate) Company-specific metrics (e.g., revenue, earnings per share) Sentiment indicators (e.g., social media sentiment) Mathematical Formulation of SARIMAX The SARIMAX model extends the SARIMA model by including exogenous variables.</description>
14+
<guid>http://localhost:1313/posts/finance/stock_prediction/sarimax/</guid>
15+
<description>In the previous articles we saw the limitations of the ARIMA and SARIMA. Therefore, in this article we are going to implement a SARIMAX model the can include exogenous variables
16+
Introduction to Exogenous Variables in Time Series Models Exogenous variables, also known as external regressors, are independent variables that are not part of the main time series but can influence it. In the context of stock price prediction, exogenous variables might include:</description>
1717
</item>
1818

1919
<item>

public/index.json

+1-1
Large diffs are not rendered by default.

public/index.xml

+20
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,26 @@ To achieve this, we will utilize the yfinance library to fetch stock information
121121

122122

123123

124+
125+
<item>
126+
<title>Electromagnetism</title>
127+
<link>http://localhost:1313/notes/physics/electromagnetism/</link>
128+
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
129+
130+
<guid>http://localhost:1313/notes/physics/electromagnetism/</guid>
131+
<description>Maxwell Equation (Integral) $$\delta + 5 $$ x</description>
132+
</item>
133+
134+
<item>
135+
<title>WebSocket</title>
136+
<link>http://localhost:1313/notes/python/web/</link>
137+
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
138+
139+
<guid>http://localhost:1313/notes/python/web/</guid>
140+
<description>Connect to a Websocket A sample python program is show here.
141+
import websocket def on_message(ws, message): print(message) def on_error(ws, error): print(f&amp;#34;Encountered error: {error}&amp;#34;) def on_close(ws, close_status_code, close_msg): print(&amp;#34;Connection closed&amp;#34;) def on_open(ws): print(&amp;#34;Connection opened&amp;#34;) ws.send(&amp;#34;Hello, Worldy!&amp;#34;) if __name__ == &amp;#34;__main__&amp;#34;: ws = websocket.WebSocketApp(&amp;#34;ws://localhost:xxxx&amp;#34;, # insert here you websocket addres on_message=on_message, on_error=on_error, on_close=on_close) ws.on_open = on_open ws.run_forever() Run the program as below:
142+
$ python websocket_example.py --&gt;</description>
143+
</item>
124144

125145

126146

public/notes/index.html

+137
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,56 @@
250250
<li id="list-heading"><a href="/notes" data-filter="all">Notes</a></li>
251251
<div class="subtree">
252252

253+
254+
255+
256+
257+
258+
259+
<li>
260+
<i data-feather="plus-circle"></i><a class=" list-link" href="/notes/physics/"> Physics</a>
261+
262+
<ul class="">
263+
264+
265+
266+
267+
268+
269+
270+
<li><a class=" list-link" href="/notes/physics/electromagnetism/" title="Electromagnetism">Electromagnetism</a></li>
271+
272+
273+
274+
</ul>
275+
</li>
276+
277+
278+
279+
280+
281+
282+
283+
284+
<li>
285+
<i data-feather="plus-circle"></i><a class=" list-link" href="/notes/python/"> Python</a>
286+
287+
<ul class="">
288+
289+
290+
291+
292+
293+
294+
295+
<li><a class=" list-link" href="/notes/python/web/" title="WebSocket">WebSocket</a></li>
296+
297+
298+
299+
</ul>
300+
</li>
301+
302+
253303

254304
</div>
255305
</ul>
@@ -267,11 +317,98 @@
267317

268318

269319

320+
<!-- A Sample Program -->
321+
<p><div class="note-card ">
322+
<div class="item">
323+
<h5 class="note-title"><span>Maxwell Equation (Integral)</span></h5>
270324

325+
<div class="card">
326+
<div class="card-body">$$\delta + 5 $$</div>
327+
</div>
328+
329+
</div>
330+
</div>
331+
332+
x</p>
333+
271334

272335

273336

337+
<!-- A Sample Program -->
338+
<div class="note-card ">
339+
<div class="item">
340+
<h5 class="note-title"><span>Connect to a Websocket</span></h5>
341+
342+
<div class="card">
343+
<div class="card-body"><p>A sample <strong>python</strong> program is show here.</p>
344+
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#f92672">import</span> websocket
345+
</span></span><span style="display:flex;"><span>
346+
</span></span><span style="display:flex;"><span>
347+
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">def</span> <span style="color:#a6e22e">on_message</span>(ws, message):
348+
</span></span><span style="display:flex;"><span> print(message)
349+
</span></span><span style="display:flex;"><span>
350+
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">def</span> <span style="color:#a6e22e">on_error</span>(ws, error):
351+
</span></span><span style="display:flex;"><span> print(<span style="color:#e6db74">f</span><span style="color:#e6db74">&#34;Encountered error: </span><span style="color:#e6db74">{</span>error<span style="color:#e6db74">}</span><span style="color:#e6db74">&#34;</span>)
352+
</span></span><span style="display:flex;"><span>
353+
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">def</span> <span style="color:#a6e22e">on_close</span>(ws, close_status_code, close_msg):
354+
</span></span><span style="display:flex;"><span> print(<span style="color:#e6db74">&#34;Connection closed&#34;</span>)
355+
</span></span><span style="display:flex;"><span>
356+
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">def</span> <span style="color:#a6e22e">on_open</span>(ws):
357+
</span></span><span style="display:flex;"><span> print(<span style="color:#e6db74">&#34;Connection opened&#34;</span>)
358+
</span></span><span style="display:flex;"><span> ws<span style="color:#f92672">.</span>send(<span style="color:#e6db74">&#34;Hello, Worldy!&#34;</span>)
359+
</span></span><span style="display:flex;"><span>
360+
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">if</span> __name__ <span style="color:#f92672">==</span> <span style="color:#e6db74">&#34;__main__&#34;</span>:
361+
</span></span><span style="display:flex;"><span> ws <span style="color:#f92672">=</span> websocket<span style="color:#f92672">.</span>WebSocketApp(<span style="color:#e6db74">&#34;ws://localhost:xxxx&#34;</span>, <span style="color:#75715e"># insert here you websocket addres</span>
362+
</span></span><span style="display:flex;"><span> on_message<span style="color:#f92672">=</span>on_message,
363+
</span></span><span style="display:flex;"><span> on_error<span style="color:#f92672">=</span>on_error,
364+
</span></span><span style="display:flex;"><span> on_close<span style="color:#f92672">=</span>on_close)
365+
</span></span><span style="display:flex;"><span> ws<span style="color:#f92672">.</span>on_open <span style="color:#f92672">=</span> on_open
366+
</span></span><span style="display:flex;"><span> ws<span style="color:#f92672">.</span>run_forever()
367+
</span></span></code></pre></div><p>Run the program as below:</p>
368+
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>$ python websocket_example.py
369+
</span></span></code></pre></div></div>
370+
</div>
274371

372+
</div>
373+
</div>
374+
375+
<!-- Declaring Variables
376+
377+
<div class="note-card ">
378+
<div class="item">
379+
<h5 class="note-title"><span>Variables</span></h5>
380+
381+
<div class="card">
382+
<div class="card-body"><p><strong>Normal Declaration:</strong></p>
383+
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-go" data-lang="go"><span style="display:flex;"><span><span style="color:#66d9ef">var</span> <span style="color:#a6e22e">msg</span> <span style="color:#66d9ef">string</span>
384+
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">msg</span> = <span style="color:#e6db74">&#34;Hello&#34;</span>
385+
</span></span></code></pre></div></div>
386+
</div>
387+
388+
<div class="card">
389+
<div class="card-body"><p><strong>Shortcut:</strong></p>
390+
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-go" data-lang="go"><span style="display:flex;"><span><span style="color:#a6e22e">msg</span> <span style="color:#f92672">:=</span> <span style="color:#e6db74">&#34;Hello&#34;</span>
391+
</span></span></code></pre></div></div>
392+
</div>
393+
394+
</div>
395+
</div>
396+
397+
398+
399+
<!-- Declaring Constants -->
400+
<!-- <div class="note-card ">
401+
<div class="item">
402+
<h5 class="note-title"><span>Constants</span></h5>
403+
404+
<div class="card">
405+
<div class="card-body"><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-go" data-lang="go"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">Phi</span> = <span style="color:#ae81ff">1.618</span>
406+
</span></span></code></pre></div></div>
407+
</div>
408+
409+
</div>
410+
</div>
411+
--> -->
275412

276413

277414

public/notes/index.xml

+20
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,26 @@
1818

1919

2020

21+
<item>
22+
<title>Electromagnetism</title>
23+
<link>http://localhost:1313/notes/physics/electromagnetism/</link>
24+
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
25+
26+
<guid>http://localhost:1313/notes/physics/electromagnetism/</guid>
27+
<description>Maxwell Equation (Integral) $$\delta + 5 $$ x</description>
28+
</item>
29+
30+
<item>
31+
<title>WebSocket</title>
32+
<link>http://localhost:1313/notes/python/web/</link>
33+
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
34+
35+
<guid>http://localhost:1313/notes/python/web/</guid>
36+
<description>Connect to a Websocket A sample python program is show here.
37+
import websocket def on_message(ws, message): print(message) def on_error(ws, error): print(f&amp;#34;Encountered error: {error}&amp;#34;) def on_close(ws, close_status_code, close_msg): print(&amp;#34;Connection closed&amp;#34;) def on_open(ws): print(&amp;#34;Connection opened&amp;#34;) ws.send(&amp;#34;Hello, Worldy!&amp;#34;) if __name__ == &amp;#34;__main__&amp;#34;: ws = websocket.WebSocketApp(&amp;#34;ws://localhost:xxxx&amp;#34;, # insert here you websocket addres on_message=on_message, on_error=on_error, on_close=on_close) ws.on_open = on_open ws.run_forever() Run the program as below:
38+
$ python websocket_example.py --&gt;</description>
39+
</item>
40+
2141

2242

2343
</channel>

0 commit comments

Comments
 (0)