+# -*- org-publish-use-timestamps-flag: nil; -*-
#+TITLE: My Blog
#+AUTHOR: Preston Pan
#+DATE: <2023-06-14 Wed>
#+RESULTS:
- [[file:automation.org][automation.org]]
+- [[file:cognition.org][cognition.org]]
- [[file:crypto.org][crypto.org]]
- [[file:machine_learning.org][machine_learning.org]]
- [[file:nixos.org][nixos.org]]
+- [[file:private_keys.org][private_keys.org]]
- [[file:stem.org][stem.org]]
+- [[file:tech-bros.org][tech-bros.org]]
+- [[file:voting.org][voting.org]]
+- [[file:you_dont_matter.org][you_dont_matter.org]]
@@html: </div>@@
--- /dev/null
+#+title: Tech Bros
+#+author: Preston Pan
+#+description: and other people that other people hate.
+#+html_head: <link rel="stylesheet" type="text/css" href="../style.css" />
+#+html_head: <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
+#+html_head: <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
+#+html_head: <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
+#+html_head: <link rel="manifest" href="/site.webmanifest">
+#+html_head: <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
+#+html_head: <meta name="msapplication-TileColor" content="#da532c">
+#+html_head: <meta name="theme-color" content="#ffffff">
+#+html_head: <meta name="viewport" content="width=1000; user-scalable=0;" />
+#+language: en
+#+OPTIONS: broken-links:t
+* Introduction
+People use the term "tech bro" in a pejorative manner. This blog post is meant to be a cultural analysis
+of why people hate tech bros, and, in general, this blog post is meant to be a cultural analysis of tolerance and intolerance
+towards groups of people. In general, I believe that progressive or liberal cultural values are just as intolerant
+as conservative cultural values; progressives will tell me that this is wrong for many reasons, and I will try to give
+my best explanation as to why the common retorts are made from a misinformed stance.
+
+I think related to the culture of hating tech bros is hating self proclaimed smart people. Many like to make sarcastic
+or ironic remarks after people self-report intelligence, even though downplaying identity in any other context would
+be culturally unacceptable. In general, this is the case for people that are confident in any conventionally useful
+identity trait. People are, generally speaking, much more tolerant of "punching up" -- a concept that /shouldn't exist/
+if you take a postmodern outlook on identity. The rich are often made fun of in various ways, for example. In response
+to the statement I just made, someone might make fun of that fact, say, "oh no, not rich people!", or some sarcastic
+or ironic statement to that effect. I think this cultural phenomenon is toxic -- the statement "these people are doing
+better, therefore I can make fun of them" is not logically valid. A does not imply B -- "these people are doing better"
+does not imply "therefore, I get to be mean to them". It is just not a good reason to punch up. Ideally you'd consider
+the fact that the quality of categories of people doesn't matter in the face of individual people.
+
+Now, I understand the mentality of people that do this. There are common arguments that this is to be expected because of
+they themselves are a part of many marginalized groups; punching up seems to be an empowering way to use that against
+those same people who punch down. What people in general don't understand, I think, is that there are no groups of people,
+only individuals inside those categories. People that others in general make fun of aren't a monolithic group, and even
+progressives seem to not be able to register this fact at times.
+** Sexism and Feminism
+Now, I will also point out that sexism literally exists for everyone, not just women.
+I've heard the statement "I hate men" many times throughout my life, genuinely unable to tell whether
+or not they are being ironic. Obviously, one could say they are expressing their own personal life
+experiences, many of which may be negative, but people who are otherwise sexist or racist also do that. And, no,
+I don't think it's because "men lose out from the patriarchy too"; I think most people that subscribe to feminist
+analysis in practice don't pay attention to this after giving some minor lip service to this.
+I have no problem with feminism; it's a useful tool for observing the world, and the patriarchy is just a descriptive
+term (it is a model of the world that can be correct or incorrect, just like other
+models), and people may have their opinions about what is happening in the real world based on said descriptive models.
+But for most people, I don't think having said prescriptive opinion is useful because most people can't meaningfully change
+other people. If that is the case, it makes more sense to create a descriptive model than a prescriptive model. Unless,
+of course, your goal is to appear morally righteous to your peers. If that is the case, I'm not even judging you --
+I'm just calling this behavior out because it doesn't currently get enough attention.
+
+I'm not a feminist, but I'm not an anti-feminist. There are interesting points to be discussed regarding feminism,
+but I think there is value in using the same descriptive outlooks and coming to different conclusions. Yet,
+something tells me that there are some things that people would not like to actually think about from a morally neutral
+perspective (I am personally favorable to the argument that patriarchy is a /bad/ thing -- but then again, I think
+Capitalism is a /good/ thing, and apparently [[https://www.thegazelle.org/issue/199/capitalism-patriarchy-inseperable][Capitalism implies patriarchy]]. Wait, what does /good/ or /bad/ mean
+in the first place? Well, I actually think those terms are ultimately /meaningless/ -- but that's for another article).
+** Race
+The only race of people for which there is no slur is white people. Now, the term "cracker" might be seen as a slur,
+but many don't consider it to be, and the fact that I'm able to put it in quotes and just put it there as opposed
+to the N-word or the C-word might tell you that there's a special status assigned to "cracker" (note that I myself
+am allowed to say the C-word, or "chink", as I am asian. Yet I don't think this rule "should" exist either).
+
+Using the same "punching up" mentality, you can make the argument for assigning this special status. Yet, it's kind
+of psychotic in my opinion to make fun of someone's race. I've heard people say, "I hate white people" in the same
+way I've heard people say, "I hate men". I think they use irony to mask what they think in the same way ultra
+white-nationalist people do. Not to compare them in any other way, though.
+
+Not everyone that has white privilege feels it. Depending on your definition, not all white people may even have
+white privilege. It's not very empathetic or progressive to just say you hate white people. In truth, it is pretty
+deranged. The same is true for saying you hate men.
+** Confidence/Intelligence
+People who are confident about their intelligence or some other form of personality trait generally considered positive
+often are the butt of jokes. You get the point already, "I am oppressed, they are not, therefore let's be assholes" is
+not a logically coherent reason to just be an asshole to someone i.e. mock them when they are trying to tell you something
+that probably reflects some reality.
+** Class
+Same argument applies in almost the exact same way, read above.
+* Conclusion
+This is to say, tech bros are one of the most well-paid, intelligent, disproportionately white and male populations on
+the planet. I believe this is why they are also the most hated people in the progressive sphere, and one of the more
+misunderstood classes of people in my culture as a result. That statement might /sound/ really wrong to you. I don't
+want any conservative audience either championing anything that I say, because I think the conservative/"libertarian"
+crowd is one of the main sources of people shutting their brains off. Still, conservative /sounding/ statements are just
+tasteless to the progressive culture, even if they point to some reality. I wish to live until the day we ask ourselves
+/why/.
+
+And everything that I've said applies in the opposite direction, obviously. This should go without saying, but
+saying that you "hate women" is even more deranged than saying you hate men, and the same with race as well. Though,
+I didn't include this because everyone in my culture already knows. They need to desperately hear the other side of
+the story. Not to say that I have any influence over culture, anyway -- but it's fun sometimes to try.
--- /dev/null
+#+title: You Don't Matter
+#+author: Preston Pan
+#+description: Ideas aren't real, and morality is a spook.
+#+html_head: <link rel="stylesheet" type="text/css" href="../style.css" />
+#+html_head: <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
+#+html_head: <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
+#+html_head: <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
+#+html_head: <link rel="manifest" href="/site.webmanifest">
+#+html_head: <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
+#+html_head: <meta name="msapplication-TileColor" content="#da532c">
+#+html_head: <meta name="theme-color" content="#ffffff">
+#+html_head: <meta name="viewport" content="width=1000; user-scalable=0;" />
+#+language: en
+#+OPTIONS: broken-links:t
+* Introduction
+You don't matter. This should be entirely clear, yet I don't believe people actually get some of the implications
+of this idea. Your ideas aren't real. This, too, is something that everyone intuitively understands yet in practice
+seems to be not further extrapolated on. In this blog post I attempt to explain peoples' impact on the world, and
+peoples' ideas as it pertains to greater society. Note that I talk about my progressive culture because that is what I know.
+This is almost certainly the case (maybe even moreso) for other cultures around the world.
+** Morality is a Spook
+People in my progressive culture are pretty quick to realize that their sense of morality is not "real", and that
+peoples' moral sensibilities may not always be in line with other people. In other words, it seems perfectly acceptable
+to say that morality is subjective, or that in some sense it does not pertain to the real world, and it is made up
+by people. This is a statement which seems to be true from an empirical standpoint, and even if you don't agree that it
+is, there seems to be truth in the statement seeing as how the term morality would seem to have no meaning without conscious
+beings, or, depending on your outlook on animals, morality would seem to be a useless term without humans.
+
+Now, if you're a progressive and don't "believe in" any particular god, this subjective sense of morality seems to be
+quite viable. Given that morality is not real, it is still true that people in general have some in-built goals or desires.
+Now the question to what you "should do" in life remains clear. It seems perfectly clear that from your perspective, your
+goal in life is to try to achieve some in-built goals or desires. This could include being conventionally moral, or it
+could not. In either case, you decide.
+
+Said in-built goals or desires are not permanently fixed. You can start caring about more things, or stop caring
+about other things. In other words, giving up on a goal achieves the same effect as achieving said goal with respect
+to fulfilling all your desires. In this sense, one should evaluate all goals as a cost-benefit analysis of giving up
+on them versus actually working on them and achieving them. In the future, when I tell you, the reader, that you
+"should do x", it is in this sense I mean it. I mean that it is likely that if you do the cost-benefit analysis for your
+own goals, it is probable that x will achieve your goals, either by way of giving up or by otherwise changing your
+circumstance, in the most "painless" way possible (takes the least time, least effort, basically the most efficient way
+to get to where you want to be). In this sense, "should" is highly tied to prescription which is tied to moral outlook
+(you "should" do x if and only if it is moral to do x, and it is moral to do x if and only if it is efficient
+towards the goal of achieving your needs). Let's take this idea and expand on it in several practical examples.
+** Your Ideas Aren't Real
+Think about democracy. Is it a system which is moral in and of itself, or is it a system which is used to achieve some
+objectives? Many people would say the first, except if you take the previous section as fact it seems wildly incoherent
+to say that some idea, democracy, can have any inherent moral worth at all. Instead, it seems plausible to assume that
+what we mean by some statement like, "democracy is moral", is actually a proxy for some sort of cost-benefit analysis
+of the pros and cons of democracy existing totaling to it being a pro. Now let me ask a pretty obvious question: if you're
+an individual person, what does weighing the pros and cons of a system /mean/? Of course, the individual need not consider
+/systems/ in order to simply achieve their goals in most cases, it is sufficient to just focus on your own life.
+
+You could say you're weighing the pros and cons with respect to /society/. Okay, depending on your definition
+of society, it seems as though the definition of a statement like, "democracy is moral" has restored its meaning. Yet,
+I can point out something else that seems pretty obvious to say, which is that /you are not society/. In fact, you have
+/little to no/ influence over broader society, and you make no significant portion of society. You may have friends that
+you can count on, as well as a family, but democracy is an idea that pertains, in many cases, to nation states.
+
+Your ultimate goal in life could be that you want to influence society as much as possible. I am telling you that it
+/shouldn't be/. That is to say, it is a lot easier to have influence over your own actions than influence over society,
+so it is easier to give up on that ambition than to actually satisfy that ambition (I would argue that this is unambiguously
+true in almost all circumstances). If you're not convinced, there are most likely a couple million people in your society,
+and you're only one of them. The empirical probability that those millions of people should listen to you either directly
+or indirectly is objectively low (drops off proportional to 1/n), else you are delusional.
+
+So to recap, what does it mean to make a statement such as, "democracy is moral"? Well, it seems logical that it means
+something like, "it is better on average for society to have democracy than to not, weighing the pros and cons". Yet,
+this kind of statement is useless to say for nearly every individual who says it, if it isn't said for fun or for some
+goal which you should probably give up on anyways. Speaking of democracy, let's run a social experiment.
+** The Democracy Experiment
+The gain of voting in an n player game involving two candidates
+and popular vote drops off at 1/n, but the time it takes to be informed and vote has a constant value. The decisions
+of individuals in this game most likely, in real life, at most influence the decision making of one or two other
+people (in total, from the whole chain reaction),
+so the effect of influence is not very significant (so you can't argue that you have an influence over the crowd to vote,
+because you don't). Given all these conditions, for a large n, voting should not be
+worth it for most people, because the choice of you voting is independent of everyone else voting. You voting or not voting
+has no bearing over the crowd. Yet, the common retort is, "if everyone thought like you...". This logic is dead on arrival,
+because /not/ everyone's going to think like you. The character of the system is that other people irrationally vote
+regardless of if you do, and your decision to vote or not vote has no bearing over the crowd voting or not voting.
+
+This simple fact is what I call IEEDI (if everyone else did it) syndrome; people are quick to conform rather than
+think about the personal cost-benefit analysis, even if the logic stops working for large societies.
+*** Activism
+Activism is another example of IEEDI syndrome where people irrationally calculate the cost-benefit analysis of going
+to protests, divesting, engaging in violence, etc... and go along with the crowd, even if it does not benefit them.
+Again, it is much easier to give up on the ambition of doing activism rather than incurring all the costs of doing
+activism, most likely. "If everyone thought like you, nothing would change" is another instance of IEEDI. You have no
+control over what others think.
+** Politics
+When people say, "do you think we should do x", it is clear using this analysis that this means something like,
+"do you think the cost-benefit analysis for society weighs in favor of doing x?". It is worth pointing out whenever
+someone does this that your opinion on any analysis for broader society doesn't matter, as your opinion cannot change
+anything. People can get divided over political opinions even though it seems to literally not matter what
+political opinions you have from an impact perspective (even if someone is /literally hitler/, they can't do anything
+to change broader society in practice). One could argue that there are some personality traits that are associated with
+political opinions. For everyone inside the acceptable range of discourse right now, the personality trait differences
+are probably really low on average, even though they can be shown to exist. Anyways, if it's really the personality
+trait differences that matter, it seems irrational to comment on the politics of the person, because it's actually
+the personality traits that you're filtering for.
+
+That is to say, despite how useless politics is in every day life, people irrationally commit a lot of their personal
+lives to it and operate suboptimally as a result. This is another case of IEEDI.
+** You Don't Matter
+Perhaps a common theme in this blog post is that you don't matter. More accurately, you /do/ matter to yourself and people
+around you, and you should try to maximize your life around that, if that is your goal, because it is an achievable goal.
+On the other hand, trying to influence society in any way, or treat society as something more real than you, is a lost
+cause, in the sense that in most cases you should either look to give up on your goals of influencing society, or you
+are making some category error that I've just demonstrated is irrational given the premises.
+
+Another sense in which you don't matter is the sense in which your identity is malleable. You don't have to care
+about nearly anything, but there are some things which are hard not to care about, such as the people around you,
+your own well-being, and maybe one or two divine or ultimate purposes at a given point in time (I personally
+fulfill this by trying to get people around me and people on the internet to seriously consider opposing viewpoints,
+which I myself find satisfying). Note that there is nothing wrong with having such a purpose, so long as it is harder
+to get rid of than to fulfill, or it's just fun. In my case, it is pretty fun to do what I'm doing.
+* Conclusion
+Unless you are a millionaire or a billionaire or are doing it for fun, it's pretty hard to have control over millions
+of other people, so you should probably give up. You don't matter, ideas aren't real, and morality is a spook. And
+I can't promise you anything: this advice disguised as a rant may help you, or it may hurt you in your case. If it helps
+you, I also can't promise your situation will become well after you take my advice. I /can/ promise you that you'll
+start to actually improve your life.
-#+title: Elfeed Feed
+#+title: Interesting RSS Feeds
#+author: Preston Pan
#+date: <2023-06-09 Fri>
#+description: My list of blogs, news sites, and channels.
#+html_head: <link rel="stylesheet" type="text/css" href="../style.css" />
* Feed :elfeed:
-In general, this feed has rss feeds whose associated links are viewable in
-eww, by design. It has a focus on technology related subjects, with some of my personal
-feeds. Feeds labeled private are feeds that are connected to an account I have, so
-you might not want them.
+This is the feed I use for Elfeed, and the elfeed-org package allows me to publish
+them here in an automated fashion. This is why Emacs is so great!
** Blogs :blog:
Here are some interesting blogs, many of which are from substack.
-*** https://graymirror.substack.com/feed
-*** https://lukesmith.xyz/index.xml :lukesmith:
-
+*** [[https://graymirror.substack.com/feed][Gray Mirror]]
+Curtis Yarvin is quite the interesting person.
+*** [[https://lukesmith.xyz/index.xml][Luke Smith]] :lukesmith:
+Luke Smith is quite the interesting person.
+*** [[https://terrytao.wordpress.com/feed/][Terence Tao]]
+I like math.
** News :news:
These are the news articles that I subscribe to. Some of these are politics related
but I mostly just want to inform myself about technology subjects.
-*** https://www.wired.com/feed/tag/ai/latest/rss
-*** https://www.wired.com/feed/category/science/latest/rss
-*** https://feeds.washingtonpost.com/rss/politics?itid=lk_inline_manual_2
-*** https://news.ycombinator.com/rss
-
+*** [[https://www.wired.com/feed/tag/ai/latest/rss][Wired AI News]]
+Wired isn't too bad at covering science and technology.
+*** [[https://www.wired.com/feed/category/science/latest/rss][Wired Science]]
+*** [[https://feeds.washingtonpost.com/rss/politics?itid=lk_inline_manual_2][Washington Post Politics]]
+Politics is almost useless, but it helps with understanding what people are saying around me.
+*** [[https://news.ycombinator.com/rss][Hacker News]]
+Hacker News!
+*** [[https://api.quantamagazine.org/feed/][Quanta Magazine]]
+Credibility: misreported on ER EPR correspondence
** Podcasts :podcast:
-*** https://notrelated.xyz/rss :lukesmith:
-
+*** [[https://notrelated.xyz/rss][Not Related]] :lukesmith:
** Forums :forum:
-*** https://reddthat.com/feeds/front/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjkwMiwiaXNzIjoicmVkZHRoYXQuY29tIiwiaWF0IjoxNjg3NzgyNjk1fQ.XVCUjs0u5-kjNwFKvE6xlGCu7ij1QmzGEy0Pettdc_s.xml?sort=Active :personal:
-
** Science Journals :journal:
I like to get new information about recent studies related to technology.
-*** http://www.nature.com/nmat/current_issue/rss/
-
+*** [[http://www.nature.com/nmat/current_issue/rss/][Nature]]
+Nature is a prestigious journal with a good bit of good content.
+** YouTube :youtube:
+These are YouTube channels that I find interesting enough to keep up with:
+*** [[https://www.youtube.com/feeds/videos.xml?channel_id=UC7_gcs09iThXybpVgjHZ_7g][PBS Space Time]]
+PBS space time is a channel that discusses various (sometimes cutting edge) topics in Physics in an expert manner.
+I find that they are highly accurate, and the host is highly educated in Physics.
+*** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCWvq4kcdNI1r1jZKFw9TiUA][ScienceClic]]
+ScienceClic is another YouTube channel that does an especially good job at covering cutting edge ideas in physics.
+*** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCMxiv15iK_MFayY_3fU9loQ][UnHerd]] :podcast:
+UnHerd is one of the best, most interesting political podcasts, period, in my opinion. Though, do note that learning
+about politics is kind of pointless.
** Misc.
This is a section dedicated to everything that does not fit the above categories
or is newly added from Qutebrowser with the xr keybinding.
(pixel-scroll-precision-mode 1)
-(setq scroll-conservatively 101)
-(display-battery-mode 1)
-(setq display-time-24hr-format t)
-(display-time-mode 1)
-(menu-bar-mode -1)
-(scroll-bar-mode -1)
-(tool-bar-mode -1)
-(load-theme 'catppuccin :no-confirm)
-(setq display-line-numbers-type 'relative)
-(add-hook 'prog-mode-hook #'display-line-numbers-mode)
-(add-hook 'org-mode-hook #'display-line-numbers-mode)
-(set-face-attribute 'default nil :height 120)
-(setq use-short-answers t)
-(setq make-backup-files nil)
-(setq org-export-with-broken-links t)
-(setq org-src-fontify-natively t)
-;; (setq org-highlight-latex-and-related '(latex script entities))
-(setq warning-minimum-level :emergency)
-(add-hook 'text-mode-hook 'visual-line-mode)
-(and window-system (server-start))
-(setq debug-ignored-errors
- (cons 'remote-file-error debug-ignored-errors))
-(set-face-attribute 'default nil :font "Iosevka Nerd Font" :height 140)
-(setq prettify-symbols-alist
- '(("#+begin_src" . ?)
- ("#+BEGIN_SRC" . ?)
- ("#+end_src" . ?)
- ("#+END_SRC" . ?)
- ("#+begin_example" . ?)
- ("#+BEGIN_EXAMPLE" . ?)
- ("#+end_example" . ?)
- ("#+END_EXAMPLE" . ?)
- ("#+header:" . ?)
- ("#+HEADER:" . ?)
- ("#+name:" . ?﮸)
- ("#+NAME:" . ?﮸)
- ("#+results:" . ?)
- ("#+RESULTS:" . ?)
- ("#+call:" . ?)
- ("#+CALL:" . ?)
- (":PROPERTIES:" . ?)
- (":properties:" . ?)))
-(prettify-symbols-mode 1)
+ (setq scroll-conservatively 101)
+ (display-battery-mode 1)
+ (setq display-time-24hr-format t)
+ (display-time-mode 1)
+ (menu-bar-mode -1)
+ (scroll-bar-mode -1)
+ (tool-bar-mode -1)
+ (load-theme 'catppuccin :no-confirm)
+ (setq display-line-numbers-type 'relative)
+ (add-hook 'prog-mode-hook #'display-line-numbers-mode)
+ (add-hook 'org-mode-hook #'display-line-numbers-mode)
+ (setq org-confirm-babel-evaluate nil)
+ (set-face-attribute 'default nil :height 120)
+ (setq use-short-answers t)
+ (setq make-backup-files nil)
+ (setq org-export-with-broken-links t)
+ (setq org-src-fontify-natively t)
+ ;; (setq org-highlight-latex-and-related '(latex script entities))
+ (setq warning-minimum-level :emergency)
+ (add-hook 'text-mode-hook 'visual-line-mode)
+ (and window-system (server-start))
+ (setq debug-ignored-errors
+ (cons 'remote-file-error debug-ignored-errors))
+ (set-face-attribute 'default nil :font "Iosevka Nerd Font" :height 140)
+ (setq org-preview-latex-image-directory "/home/preston/.cache/ltximg/")
+ (add-hook 'prog-mode-hook
+ (lambda ()
+ (setq prettify-symbols-alist
+ '(("lambda" . ?λ)
+ ("->" . ?→)
+ ("map" . ?↦)
+ ("/=" . ?≠)
+ ("!=" . ?≠)
+ ("==" . ?≡)
+ ("<=" . ?≤)
+ (">=" . ?≥)
+ ("&&" . ?∧)
+ ("||" . ?∨)
+ ("sqrt" . ?√)
+ ("..." . ?…)))
+ (prettify-symbols-mode)))
+
+ (add-hook 'org-mode-hook (lambda ()
+ (setq prettify-symbols-alist
+ '(("#+begin_src" . ?)
+ ("#+BEGIN_SRC" . ?)
+ ("#+end_src" . ?)
+ ("#+END_SRC" . ?)
+ ("#+begin_example" . ?)
+ ("#+BEGIN_EXAMPLE" . ?)
+ ("#+end_example" . ?)
+ ("#+END_EXAMPLE" . ?)
+ ("#+header:" . ?)
+ ("#+HEADER:" . ?)
+ ("#+name:" . ?﮸)
+ ("#+NAME:" . ?﮸)
+ ("#+results:" . ?)
+ ("#+RESULTS:" . ?)
+ ("#+call:" . ?)
+ ("#+CALL:" . ?)
+ (":PROPERTIES:" . ?)
+ (":properties:" . ?)
+ ("lambda" . ?λ)
+ ("->" . ?→)
+ ("map" . ?↦)
+ ("/=" . ?≠)
+ ("!=" . ?≠)
+ ("==" . ?≡)
+ ("<=" . ?≤)
+ (">=" . ?≥)
+ ("&&" . ?∧)
+ ("||" . ?∨)
+ ("sqrt" . ?√)
+ ("..." . ?…))))
+ (prettify-symbols-mode))
+(global-prettify-symbols-mode 1)
(set-frame-parameter nil 'alpha-background 90)
(add-to-list 'default-frame-alist '(alpha-background . 90))
(interactive)
(if (eolp) (let (parens-require-spaces) (insert-pair)) (self-insert-command 1)))
- (add-hook 'org-mode-hook
+(add-hook 'org-mode-hook
(lambda ()
(define-key org-mode-map "\"" 'electric-pair)
(define-key org-mode-map "(" 'electric-pair)
(define-key org-mode-map "{" 'electric-pair)))
(add-hook 'prog-mode-hook
(lambda ()
- (define-key org-mode-map "\"" 'electric-pair)
- (define-key org-mode-map "(" 'electric-pair)
- (define-key org-mode-map "[" 'electric-pair)
- (define-key org-mode-map "{" 'electric-pair)))
-
-(add-hook 'nix-mode-hook
- (lambda ()
- (define-key org-mode-map "\"" 'electric-pair)
- (define-key org-mode-map "(" 'electric-pair)
- (define-key org-mode-map "[" 'electric-pair)
- (define-key org-mode-map "{" 'electric-pair)))
-
-(add-hook 'emacs-lisp-mode-hook
- (lambda ()
- (define-key org-mode-map "\"" 'electric-pair)
- (define-key org-mode-map "(" 'electric-pair)
- (define-key org-mode-map "[" 'electric-pair)
- (define-key org-mode-map "{" 'electric-pair)))
+ (define-key prog-mode-map "\"" 'electric-pair)
+ (define-key prog-mode-map "(" 'electric-pair)
+ (define-key prog-mode-map "[" 'electric-pair)
+ (define-key prog-mode-map "{" 'electric-pair)))
(use-package lyrics-fetcher
- :after (emmsx)
+ :after (emms)
:config
(setq lyrics-fetcher-genius-access-token
(password-store-get "genius_api"))
(lyrics-fetcher-use-backend 'genius))
-(add-hook 'after-init-hook 'global-company-mode)
+(use-package org-fragtog :hook (org-mode . org-fragtog-mode))
+
+(use-package yasnippet
+ :config
+ (add-to-list 'yas-snippet-dirs "~/org/website/yasnippet/")
+ (yas-global-mode 1))
+(add-hook 'org-mode-hook
+ (lambda () (yas-minor-mode)
+ (yas-activate-extra-mode 'latex-mode)))
+
+(eval-after-load "company" '(add-to-list 'company-backends '(company-ispell company-capf company-yasnippet company-files))) (add-hook 'after-init-hook 'global-company-mode)
+(use-package ispell
+ :init
+ (setq ispell-program-name "aspell")
+ (setq ispell-silently-savep t)
+ (setq ispell-dictionary "en")
+ (setq ispell-alternate-dictionary "/home/preston/.local/share/my.dict"))
+
+(dolist (hook '(text-mode-hook))
+ (add-hook hook (lambda () (flyspell-mode 1))))
(org-babel-do-load-languages 'org-babel-load-languages
'(
(evil-set-initial-state 'pdf-view-mode 'normal)
(use-package org-journal
+ :after (org)
:init
(setq org-journal-dir "~/org/website/journal/")
(setq org-journal-date-format "%A, %d %B %Y")
)
(use-package doom-modeline
-:config
-(doom-modeline-mode 1))
+ :config
+ (doom-modeline-mode 1))
+
+(use-package writegood-mode)
+
+(dolist (hook '(text-mode-hook))
+ (add-hook hook (lambda () (writegood-mode))))
(use-package org-superstar
-:config
-(add-hook 'org-mode-hook (lambda () (org-superstar-mode 1))))
+ :after (org)
+ :config
+ (add-hook 'org-mode-hook (lambda () (org-superstar-mode 1))))
(use-package eglot
:config
(add-hook 'prog-mode-hook 'eglot-ensure))
+(use-package projectile
+ :init
+ (setq projectile-project-search-path '("~/org" "~/src"))
+ :config
+ (projectile-mode +1))
+
(use-package dashboard
+ :after (projectile)
:init
(setq dashboard-banner-logo-title "Welcome, Commander!")
(setq dashboard-icon-type 'nerd-icons)
:config
(dashboard-setup-startup-hook))
-(use-package projectile
- :config
- (projectile-mode +1))
-
(use-package counsel)
(use-package ivy
:init
(global-set-key (kbd "C-c k") 'counsel-ag)
(global-set-key (kbd "C-x l") 'counsel-locate)
(global-set-key (kbd "C-S-o") 'counsel-rhythmbox)
- (define-key minibuffer-local-map (kbd "C-r") 'counsel-minibuffer-history)
:config
(ivy-mode))
+(define-key ivy-minibuffer-map (kbd "C-j") 'ivy-immediate-done)
(use-package magit)
"n j j" '(org-journal-new-entry :wk "Make new journal entry")
"n r f" '(org-roam-node-find :wk "Find roam node")
"n r i" '(org-roam-node-insert :wk "Insert roam node")
+ "n r a" '(org-roam-alias-add :wk "Add alias to org roam node")
"n r g" '(org-roam-graph :wk "Graph roam database")
"r s s" '(elfeed :wk "rss feed")
"." '(counsel-find-file :wk "find file")
"g P" '(magit-push :wk "git push")
"g c" '(magit-commit :wk "git commit")
"g p" '(magit-pull :wk "Pull from git")
+ "g s" '(magit-status :wk "Change status of files")
"o t" '(vterm :wk "Terminal")
"o e" '(eshell :wk "Elisp Interpreter")
"o m" '(mu4e :wk "Email")
"m m" '(emms :wk "Music player")
"m l" '(lyrics-fetcher-show-lyrics :wk "Music lyrics")
"o p" '(treemacs :wk "Project Drawer")
+ "o P" '(treemacs-projectile :wk "Import Projectile project to treemacs")
"f f" '(eglot-format :wk "Format code buffer")
"i c" '(prestonpan :wk "Connect to my IRC server")
"h m" '(woman :wk "Manual")
+ "h i" '(info :wk "Info")
+ "s m" '(proced :wk "System Manager")
+ "l p" '(list-processes :wk "List Emacs Processes")
+ "m I" '(org-id-get-create :wk "Make org id")
+ "y n s" '(yas-new-snippet :wk "Create new snippet")
+ "u w" '((lambda () (interactive) (shell-command "rsync -azvP ~/website_html/ root@nullring.xyz:/usr/share/nginx/ret2pop/")) :wk "rsync website update")
"h r r" '(lambda () (interactive) (org-babel-load-file (expand-file-name "~/org/website/config/emacs.org")))
))
(use-package elfeed
:init
(add-hook 'elfeed-search-mode-hook #'elfeed-update)
- (setq elfeed-search-filter "@1-month-ago +unread")
- )
+ (setq elfeed-search-filter "@1-month-ago +unread"))
(use-package elfeed-org
:init
(setq rmh-elfeed-org-files '("~/org/website/config/elfeed.org"))
:config
(elfeed-org))
+(use-package treemacs)
+(use-package treemacs-evil
+ :after (treemacs evil))
+(use-package treemacs-projectile
+ :after (treemacs projectile))
+(use-package treemacs-magit
+ :after (treemacs magit))
+
(setq search-engines
'(
(("google" "g") "https://google.com/search?q=%s")
(setq search-engine-default "google")
(setq eww-search-prefix "https://google.com/search?q=")
-(setq browse-url-secondary-browser-function 'browse-url-generic browse-url-generic-program "firefox")
+(setq browse-url-secondary-browser-function 'browse-url-generic browse-url-generic-program "chromium")
(setq browse-url-browser-function 'eww-browse-url)
(add-hook 'eww-mode-hook
(lambda () (local-set-key (kbd "y Y") #'eww-copy-page-url)))
(setq TeX-PDF-mode t)
(setq org-format-latex-options (plist-put org-format-latex-options :scale 1.5))
(setq org-return-follows-link t)
-(use-package latex-preview-pane
- :config
- (latex-preview-pane-enable))
+;; (use-package latex-preview-pane
+;; :config
+;; (latex-preview-pane-enable))
;; SMTP settings:
(setq user-mail-address "preston@nullring.xyz")
(setq mu4e-compose-dont-reply-to-self t)
(setq mu4e-change-filenames-when-moving t)
(setq mu4e-get-mail-command "mbsync prestonpan")
- (setq mu4e-compose-reply-ignore-address '("no-?reply" "preston@nullring.xyz"))
+ (setq mu4e-compose-reply-ignore-address '("no-?reply" "ret2pop@gmail.com"))
(setq mu4e-html2text-command "w3m -T text/html" ; how to hanfle html-formatted emails
mu4e-update-interval 300 ; seconds between each mail retrieval
mu4e-headers-auto-update t ; avoid to type `g' to update
(use-package stem-mode)
(add-to-list 'auto-mode-alist '("\\.stem\\'" . stem-mode))
-;; (use-package treesit-auto
-;; :config
-;; (global-treesit-auto-mode))
+(server-start)
emacs-lisp language only to configure variables for said packages, for the most part.
** UI Elements
This section contains important UI elements and starting customization variables to make
-emacs work in a semi-sane way and make it not look completely ugly:
-#+begin_src emacs-lisp
- (pixel-scroll-precision-mode 1)
- (setq scroll-conservatively 101)
- (display-battery-mode 1)
- (setq display-time-24hr-format t)
- (display-time-mode 1)
- (menu-bar-mode -1)
- (scroll-bar-mode -1)
- (tool-bar-mode -1)
- (load-theme 'catppuccin :no-confirm)
- (setq display-line-numbers-type 'relative)
- (add-hook 'prog-mode-hook #'display-line-numbers-mode)
- (add-hook 'org-mode-hook #'display-line-numbers-mode)
- (set-face-attribute 'default nil :height 120)
- (setq use-short-answers t)
- (setq make-backup-files nil)
- (setq org-export-with-broken-links t)
- (setq org-src-fontify-natively t)
- ;; (setq org-highlight-latex-and-related '(latex script entities))
- (setq warning-minimum-level :emergency)
- (add-hook 'text-mode-hook 'visual-line-mode)
- (and window-system (server-start))
- (setq debug-ignored-errors
- (cons 'remote-file-error debug-ignored-errors))
- (set-face-attribute 'default nil :font "Iosevka Nerd Font" :height 140)
- (setq prettify-symbols-alist
- '(("#+begin_src" . ?)
- ("#+BEGIN_SRC" . ?)
- ("#+end_src" . ?)
- ("#+END_SRC" . ?)
- ("#+begin_example" . ?)
- ("#+BEGIN_EXAMPLE" . ?)
- ("#+end_example" . ?)
- ("#+END_EXAMPLE" . ?)
- ("#+header:" . ?)
- ("#+HEADER:" . ?)
- ("#+name:" . ?﮸)
- ("#+NAME:" . ?﮸)
- ("#+results:" . ?)
- ("#+RESULTS:" . ?)
- ("#+call:" . ?)
- ("#+CALL:" . ?)
- (":PROPERTIES:" . ?)
- (":properties:" . ?)))
- (prettify-symbols-mode 1)
+emacs work in a semi-sane way and make it not look ugly:
+#+begin_src emacs-lisp
+ (pixel-scroll-precision-mode 1)
+ (setq scroll-conservatively 101)
+ (display-battery-mode 1)
+ (setq display-time-24hr-format t)
+ (display-time-mode 1)
+ (menu-bar-mode -1)
+ (scroll-bar-mode -1)
+ (tool-bar-mode -1)
+ (load-theme 'catppuccin :no-confirm)
+ (setq display-line-numbers-type 'relative)
+ (add-hook 'prog-mode-hook #'display-line-numbers-mode)
+ (add-hook 'org-mode-hook #'display-line-numbers-mode)
+ (setq org-confirm-babel-evaluate nil)
+ (set-face-attribute 'default nil :height 120)
+ (setq use-short-answers t)
+ (setq make-backup-files nil)
+ (setq org-export-with-broken-links t)
+ (setq org-src-fontify-natively t)
+ ;; (setq org-highlight-latex-and-related '(latex script entities))
+ (setq warning-minimum-level :emergency)
+ (add-hook 'text-mode-hook 'visual-line-mode)
+ (and window-system (server-start))
+ (setq debug-ignored-errors
+ (cons 'remote-file-error debug-ignored-errors))
+ (set-face-attribute 'default nil :font "Iosevka Nerd Font" :height 140)
+ (setq org-preview-latex-image-directory "/home/preston/.cache/ltximg/")
+ (add-hook 'prog-mode-hook
+ (lambda ()
+ (setq prettify-symbols-alist
+ '(("lambda" . ?λ)
+ ("->" . ?→)
+ ("map" . ?↦)
+ ("/=" . ?≠)
+ ("!=" . ?≠)
+ ("==" . ?≡)
+ ("<=" . ?≤)
+ (">=" . ?≥)
+ ("&&" . ?∧)
+ ("||" . ?∨)
+ ("sqrt" . ?√)
+ ("..." . ?…)))
+ (prettify-symbols-mode)))
+
+ (add-hook 'org-mode-hook (lambda ()
+ (setq prettify-symbols-alist
+ '(("#+begin_src" . ?)
+ ("#+BEGIN_SRC" . ?)
+ ("#+end_src" . ?)
+ ("#+END_SRC" . ?)
+ ("#+begin_example" . ?)
+ ("#+BEGIN_EXAMPLE" . ?)
+ ("#+end_example" . ?)
+ ("#+END_EXAMPLE" . ?)
+ ("#+header:" . ?)
+ ("#+HEADER:" . ?)
+ ("#+name:" . ?﮸)
+ ("#+NAME:" . ?﮸)
+ ("#+results:" . ?)
+ ("#+RESULTS:" . ?)
+ ("#+call:" . ?)
+ ("#+CALL:" . ?)
+ (":PROPERTIES:" . ?)
+ (":properties:" . ?)
+ ("lambda" . ?λ)
+ ("->" . ?→)
+ ("map" . ?↦)
+ ("/=" . ?≠)
+ ("!=" . ?≠)
+ ("==" . ?≡)
+ ("<=" . ?≤)
+ (">=" . ?≥)
+ ("&&" . ?∧)
+ ("||" . ?∨)
+ ("sqrt" . ?√)
+ ("..." . ?…))))
+ (prettify-symbols-mode))
+ (global-prettify-symbols-mode 1)
#+end_src
* Transparency
My NixOS configuration uses Hyprland to make things transparent:
(interactive)
(if (eolp) (let (parens-require-spaces) (insert-pair)) (self-insert-command 1)))
- (add-hook 'org-mode-hook
+ (add-hook 'org-mode-hook
(lambda ()
(define-key org-mode-map "\"" 'electric-pair)
(define-key org-mode-map "(" 'electric-pair)
(define-key org-mode-map "{" 'electric-pair)))
(add-hook 'prog-mode-hook
(lambda ()
- (define-key org-mode-map "\"" 'electric-pair)
- (define-key org-mode-map "(" 'electric-pair)
- (define-key org-mode-map "[" 'electric-pair)
- (define-key org-mode-map "{" 'electric-pair)))
-
- (add-hook 'nix-mode-hook
- (lambda ()
- (define-key org-mode-map "\"" 'electric-pair)
- (define-key org-mode-map "(" 'electric-pair)
- (define-key org-mode-map "[" 'electric-pair)
- (define-key org-mode-map "{" 'electric-pair)))
-
- (add-hook 'emacs-lisp-mode-hook
- (lambda ()
- (define-key org-mode-map "\"" 'electric-pair)
- (define-key org-mode-map "(" 'electric-pair)
- (define-key org-mode-map "[" 'electric-pair)
- (define-key org-mode-map "{" 'electric-pair)))
+ (define-key prog-mode-map "\"" 'electric-pair)
+ (define-key prog-mode-map "(" 'electric-pair)
+ (define-key prog-mode-map "[" 'electric-pair)
+ (define-key prog-mode-map "{" 'electric-pair)))
#+end_src
* Lyrics
#+begin_src emacs-lisp
(use-package lyrics-fetcher
- :after (emmsx)
+ :after (emms)
:config
(setq lyrics-fetcher-genius-access-token
(password-store-get "genius_api"))
(lyrics-fetcher-use-backend 'genius))
#+end_src
+* Fragtog
+#+begin_src emacs-lisp
+ (use-package org-fragtog :hook (org-mode . org-fragtog-mode))
+#+end_src
+* Snippets
+#+begin_src emacs-lisp
+ (use-package yasnippet
+ :config
+ (add-to-list 'yas-snippet-dirs "~/org/website/yasnippet/")
+ (yas-global-mode 1))
+ (add-hook 'org-mode-hook
+ (lambda () (yas-minor-mode)
+ (yas-activate-extra-mode 'latex-mode)))
+#+end_src
* Completion
Company-mode! We need this to do autocomplete stuff.
#+begin_src emacs-lisp
- (add-hook 'after-init-hook 'global-company-mode)
+ (eval-after-load "company" '(add-to-list 'company-backends '(company-ispell company-capf company-yasnippet company-files))) (add-hook 'after-init-hook 'global-company-mode)
+ (use-package ispell
+ :init
+ (setq ispell-program-name "aspell")
+ (setq ispell-silently-savep t)
+ (setq ispell-dictionary "en")
+ (setq ispell-alternate-dictionary "/home/preston/.local/share/my.dict"))
+#+end_src
+* Spelling
+#+begin_src emacs-lisp
+(dolist (hook '(text-mode-hook))
+ (add-hook hook (lambda () (flyspell-mode 1))))
#+end_src
* Org Babel
For some reason, org-babel doesn't load these languages by default:
I use org-journal to journal about my life, and it's a part of my website:
#+begin_src emacs-lisp
(use-package org-journal
+ :after (org)
:init
(setq org-journal-dir "~/org/website/journal/")
(setq org-journal-date-format "%A, %d %B %Y")
The default modeline is ugly.
#+begin_src emacs-lisp
(use-package doom-modeline
- :config
- (doom-modeline-mode 1))
+ :config
+ (doom-modeline-mode 1))
+#+end_src
+** Grammar
+I want to write good!
+#+begin_src emacs-lisp
+ (use-package writegood-mode)
+
+(dolist (hook '(text-mode-hook))
+ (add-hook hook (lambda () (writegood-mode))))
#+end_src
** Make Org Look Better
Org superstar adds those nice looking utf-8 bullets:
#+begin_src emacs-lisp
(use-package org-superstar
- :config
- (add-hook 'org-mode-hook (lambda () (org-superstar-mode 1))))
+ :after (org)
+ :config
+ (add-hook 'org-mode-hook (lambda () (org-superstar-mode 1))))
#+end_src
** LSP
We set up eglot, the LSP manager for emacs, now built in:
:config
(add-hook 'prog-mode-hook 'eglot-ensure))
#+end_src
+** Projectile
+Manages projects and shit.
+#+begin_src emacs-lisp
+ (use-package projectile
+ :init
+ (setq projectile-project-search-path '("~/org" "~/src"))
+ :config
+ (projectile-mode +1))
+#+end_src
** Dashboard
We want our emacs initialization to be pretty and display useful things.
#+begin_src emacs-lisp
(use-package dashboard
+ :after (projectile)
:init
(setq dashboard-banner-logo-title "Welcome, Commander!")
(setq dashboard-icon-type 'nerd-icons)
:config
(dashboard-setup-startup-hook))
#+end_src
-** Projectile
-Manages projects and shit.
-#+begin_src emacs-lisp
- (use-package projectile
- :config
- (projectile-mode +1))
-#+end_src
** Ivy
Ivy is a pretty cool general program for displaying stuff:
#+begin_src emacs-lisp
- (use-package counsel)
- (use-package ivy
- :init
- (setq ivy-use-virtual-buffers t)
- (setq enable-recursive-minibuffers t)
- ;; enable this if you want `swiper' to use it
- ;; (setq search-default-mode #'char-fold-to-regexp)
- (global-set-key "\C-s" 'swiper)
- (global-set-key (kbd "C-c C-r") 'ivy-resume)
- (global-set-key (kbd "<f6>") 'ivy-resume)
- (global-set-key (kbd "M-x") 'counsel-M-x)
- (global-set-key (kbd "C-x C-f") 'counsel-find-file)
- (global-set-key (kbd "<f1> f") 'counsel-describe-function)
- (global-set-key (kbd "<f1> v") 'counsel-describe-variable)
- (global-set-key (kbd "<f1> o") 'counsel-describe-symbol)
- (global-set-key (kbd "<f1> l") 'counsel-find-library)
- (global-set-key (kbd "<f2> i") 'counsel-info-lookup-symbol)
- (global-set-key (kbd "<f2> u") 'counsel-unicode-char)
- (global-set-key (kbd "C-c g") 'counsel-git)
- (global-set-key (kbd "C-c j") 'counsel-git-grep)
- (global-set-key (kbd "C-c k") 'counsel-ag)
- (global-set-key (kbd "C-x l") 'counsel-locate)
- (global-set-key (kbd "C-S-o") 'counsel-rhythmbox)
- (define-key minibuffer-local-map (kbd "C-r") 'counsel-minibuffer-history)
- :config
- (ivy-mode))
+ (use-package counsel)
+ (use-package ivy
+ :init
+ (setq ivy-use-virtual-buffers t)
+ (setq enable-recursive-minibuffers t)
+ ;; enable this if you want `swiper' to use it
+ ;; (setq search-default-mode #'char-fold-to-regexp)
+ (global-set-key "\C-s" 'swiper)
+ (global-set-key (kbd "C-c C-r") 'ivy-resume)
+ (global-set-key (kbd "<f6>") 'ivy-resume)
+ (global-set-key (kbd "M-x") 'counsel-M-x)
+ (global-set-key (kbd "C-x C-f") 'counsel-find-file)
+ (global-set-key (kbd "<f1> f") 'counsel-describe-function)
+ (global-set-key (kbd "<f1> v") 'counsel-describe-variable)
+ (global-set-key (kbd "<f1> o") 'counsel-describe-symbol)
+ (global-set-key (kbd "<f1> l") 'counsel-find-library)
+ (global-set-key (kbd "<f2> i") 'counsel-info-lookup-symbol)
+ (global-set-key (kbd "<f2> u") 'counsel-unicode-char)
+ (global-set-key (kbd "C-c g") 'counsel-git)
+ (global-set-key (kbd "C-c j") 'counsel-git-grep)
+ (global-set-key (kbd "C-c k") 'counsel-ag)
+ (global-set-key (kbd "C-x l") 'counsel-locate)
+ (global-set-key (kbd "C-S-o") 'counsel-rhythmbox)
+ :config
+ (ivy-mode))
+ (define-key ivy-minibuffer-map (kbd "C-j") 'ivy-immediate-done)
#+end_src
** Magit
#+begin_src emacs-lisp
#+end_src
** Keybindings
#+begin_src emacs-lisp
- (use-package general
- :config
- (general-create-definer leader-key
- :prefix "SPC")
- (leader-key 'normal
- "o a" '(org-agenda :wk "Open agenda")
- "o c" '(org-capture :wk "Capture")
- "n j j" '(org-journal-new-entry :wk "Make new journal entry")
- "n r f" '(org-roam-node-find :wk "Find roam node")
- "n r i" '(org-roam-node-insert :wk "Insert roam node")
- "n r g" '(org-roam-graph :wk "Graph roam database")
- "r s s" '(elfeed :wk "rss feed")
- "." '(counsel-find-file :wk "find file")
- "g /" '(magit-dispatch :wk "git commands")
- "g P" '(magit-push :wk "git push")
- "g c" '(magit-commit :wk "git commit")
- "g p" '(magit-pull :wk "Pull from git")
- "o t" '(vterm :wk "Terminal")
- "o e" '(eshell :wk "Elisp Interpreter")
- "o m" '(mu4e :wk "Email")
- "e w w" '(eww :wk "web browser")
- "e c c" '(ellama-chat :wk "Chat with Ollama")
- "e a b" '(ellama-ask-about :wk "Ask Ollama")
- "e s" '(ellama-summarize :wk "Summarize text with Ollama")
- "e c r" '(ellama-code-review :wk "Review code with Ollama")
- "e c C" '(ellama-code-complete :wk "Complete code with Ollama")
- "e c a" '(ellama-code-add :wk "Add code with Ollama")
- "e c e" '(ellama-code-edit :wk "Edit code with Ollama")
- "e w i" '(ellama-improve-wording :wk "Improve wording with Ollama")
- "e g i" '(ellama-improve-grammar :wk "Improve grammar with Ollama")
- "g s" '(gptel-send :wk "Send to Ollama")
- "g e" '(gptel :wk "Ollama interface")
- "p w" '(ivy-pass :wk "Password manager interface")
- "m P p" '(org-publish :wk "Publish website components")
- "s e" '(sudo-edit :wk "Edit file with sudo")
- "m m" '(emms :wk "Music player")
- "m l" '(lyrics-fetcher-show-lyrics :wk "Music lyrics")
- "o p" '(treemacs :wk "Project Drawer")
- "f f" '(eglot-format :wk "Format code buffer")
- "i c" '(prestonpan :wk "Connect to my IRC server")
- "h m" '(woman :wk "Manual")
- "h r r" '(lambda () (interactive) (org-babel-load-file (expand-file-name "~/org/website/config/emacs.org")))
- ))
+ (use-package general
+ :config
+ (general-create-definer leader-key
+ :prefix "SPC")
+ (leader-key 'normal
+ "o a" '(org-agenda :wk "Open agenda")
+ "o c" '(org-capture :wk "Capture")
+ "n j j" '(org-journal-new-entry :wk "Make new journal entry")
+ "n r f" '(org-roam-node-find :wk "Find roam node")
+ "n r i" '(org-roam-node-insert :wk "Insert roam node")
+ "n r a" '(org-roam-alias-add :wk "Add alias to org roam node")
+ "n r g" '(org-roam-graph :wk "Graph roam database")
+ "r s s" '(elfeed :wk "rss feed")
+ "." '(counsel-find-file :wk "find file")
+ "g /" '(magit-dispatch :wk "git commands")
+ "g P" '(magit-push :wk "git push")
+ "g c" '(magit-commit :wk "git commit")
+ "g p" '(magit-pull :wk "Pull from git")
+ "g s" '(magit-status :wk "Change status of files")
+ "o t" '(vterm :wk "Terminal")
+ "o e" '(eshell :wk "Elisp Interpreter")
+ "o m" '(mu4e :wk "Email")
+ "e w w" '(eww :wk "web browser")
+ "e c c" '(ellama-chat :wk "Chat with Ollama")
+ "e a b" '(ellama-ask-about :wk "Ask Ollama")
+ "e s" '(ellama-summarize :wk "Summarize text with Ollama")
+ "e c r" '(ellama-code-review :wk "Review code with Ollama")
+ "e c C" '(ellama-code-complete :wk "Complete code with Ollama")
+ "e c a" '(ellama-code-add :wk "Add code with Ollama")
+ "e c e" '(ellama-code-edit :wk "Edit code with Ollama")
+ "e w i" '(ellama-improve-wording :wk "Improve wording with Ollama")
+ "e g i" '(ellama-improve-grammar :wk "Improve grammar with Ollama")
+ "g s" '(gptel-send :wk "Send to Ollama")
+ "g e" '(gptel :wk "Ollama interface")
+ "p w" '(ivy-pass :wk "Password manager interface")
+ "m P p" '(org-publish :wk "Publish website components")
+ "s e" '(sudo-edit :wk "Edit file with sudo")
+ "m m" '(emms :wk "Music player")
+ "m l" '(lyrics-fetcher-show-lyrics :wk "Music lyrics")
+ "o p" '(treemacs :wk "Project Drawer")
+ "o P" '(treemacs-projectile :wk "Import Projectile project to treemacs")
+ "f f" '(eglot-format :wk "Format code buffer")
+ "i c" '(prestonpan :wk "Connect to my IRC server")
+ "h m" '(woman :wk "Manual")
+ "h i" '(info :wk "Info")
+ "s m" '(proced :wk "System Manager")
+ "l p" '(list-processes :wk "List Emacs Processes")
+ "m I" '(org-id-get-create :wk "Make org id")
+ "y n s" '(yas-new-snippet :wk "Create new snippet")
+ "u w" '((lambda () (interactive) (shell-command "rsync -azvP ~/website_html/ root@nullring.xyz:/usr/share/nginx/ret2pop/")) :wk "rsync website update")
+ "h r r" '(lambda () (interactive) (org-babel-load-file (expand-file-name "~/org/website/config/emacs.org")))
+ ))
#+end_src
** RSS Feed
I use really simple syndication (RSS) in order to read news. As a result, I use
(use-package elfeed
:init
(add-hook 'elfeed-search-mode-hook #'elfeed-update)
- (setq elfeed-search-filter "@1-month-ago +unread")
- )
+ (setq elfeed-search-filter "@1-month-ago +unread"))
(use-package elfeed-org
:init
(setq rmh-elfeed-org-files '("~/org/website/config/elfeed.org"))
:config
(elfeed-org))
#+end_src
+** Project Drawer
+#+begin_src emacs-lisp
+ (use-package treemacs)
+ (use-package treemacs-evil
+ :after (treemacs evil))
+ (use-package treemacs-projectile
+ :after (treemacs projectile))
+ (use-package treemacs-magit
+ :after (treemacs magit))
+#+end_src
** Eww
Used only for the purpose of viewing RSS feed items in emacs if I can, only resorting
-to Firefox if I have to:
+to Chromium if I have to:
#+begin_src emacs-lisp
(setq search-engines
'(
(setq search-engine-default "google")
(setq eww-search-prefix "https://google.com/search?q=")
-(setq browse-url-secondary-browser-function 'browse-url-generic browse-url-generic-program "firefox")
+(setq browse-url-secondary-browser-function 'browse-url-generic browse-url-generic-program "chromium")
(setq browse-url-browser-function 'eww-browse-url)
(add-hook 'eww-mode-hook
(lambda () (local-set-key (kbd "y Y") #'eww-copy-page-url)))
(setq TeX-PDF-mode t)
(setq org-format-latex-options (plist-put org-format-latex-options :scale 1.5))
(setq org-return-follows-link t)
- (use-package latex-preview-pane
- :config
- (latex-preview-pane-enable))
+ ;; (use-package latex-preview-pane
+ ;; :config
+ ;; (latex-preview-pane-enable))
#+end_src
** Email
Email in emacs can be done with Mu4e.
(setq mu4e-compose-dont-reply-to-self t)
(setq mu4e-change-filenames-when-moving t)
(setq mu4e-get-mail-command "mbsync prestonpan")
- (setq mu4e-compose-reply-ignore-address '("no-?reply" "preston@nullring.xyz"))
+ (setq mu4e-compose-reply-ignore-address '("no-?reply" "ret2pop@gmail.com"))
(setq mu4e-html2text-command "w3m -T text/html" ; how to hanfle html-formatted emails
mu4e-update-interval 300 ; seconds between each mail retrieval
mu4e-headers-auto-update t ; avoid to type `g' to update
(use-package stem-mode)
(add-to-list 'auto-mode-alist '("\\.stem\\'" . stem-mode))
#+end_src
-** Syntax
+** Server
+So that emacsclient can connect.
#+begin_src emacs-lisp
- ;; (use-package treesit-auto
- ;; :config
- ;; (global-treesit-auto-mode))
+(server-start)
#+end_src
-
+# -*- org-publish-use-timestamps-flag: nil; -*-
#+title: Configurations
#+author: Preston Pan
#+date: <2023-06-10 Sat>
--- /dev/null
+preston@continuity.1616:1718293659
\ No newline at end of file
* Friday, 31 May 2024
** 03:42
I can't sleep. This is quite painful.
+** 20:51
+I've optimized my setup a decent bit, and I'm currently deliberating on the trade-off between package use and
+functionality. I do want to keep the dependencies for this Emacs configuration slim in order to effectively make it
+portable across different versions of Emacs.
--- /dev/null
+#+TITLE: Daily Journal
+#+STARTUP: showeverything
+#+DESCRIPTION: My daily journal entry
+#+AUTHOR: Preston Pan
+#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="../style.css" />
+#+html_head: <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
+#+html_head: <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
+#+options: broken-links:t
+* Saturday, 01 June 2024
+** 11:23
+Slept okay but still feel tired; had a latte from the Mighty Oak. Need to work on writegood.el and other things.
--- /dev/null
+#+TITLE: Daily Journal
+#+STARTUP: showeverything
+#+DESCRIPTION: My daily journal entry
+#+AUTHOR: Preston Pan
+#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="../style.css" />
+#+html_head: <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
+#+html_head: <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
+#+options: broken-links:t
+* Sunday, 02 June 2024
+** 12:35
+Eggs for lunch; I'm probably going to go to the cafe as well. Additionally, I'm going to Bowen Island today
+and I might go to Victoria as well in two or three days. Above average sleep.
--- /dev/null
+#+TITLE: Daily Journal
+#+STARTUP: showeverything
+#+DESCRIPTION: My daily journal entry
+#+AUTHOR: Preston Pan
+#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="../style.css" />
+#+html_head: <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
+#+html_head: <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
+#+options: broken-links:t
+* Wednesday, 05 June 2024
+** 11:23
+Finished the interview process for a job; I'm now running some errands probably such as getting some L-theanine
+and getting some green tea, as well as Melatonin. Related, I'm going to Victoria today and I'm trying to study
+for my amateur radio license.
+** 16:38
+Going to Victoria now and called a few friends. I'm working on some mindmap stuff but my battery is low.
--- /dev/null
+#+TITLE: Daily Journal
+#+STARTUP: showeverything
+#+DESCRIPTION: My daily journal entry
+#+AUTHOR: Preston Pan
+#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="../style.css" />
+#+html_head: <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
+#+html_head: <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
+#+options: broken-links:t
+* Monday, 10 June 2024
+** 18:44
+I'm attempting to build a PC as well as get spend some small amounts of money existing.
+# -*- org-publish-use-timestamps-flag: nil; -*-
#+title: Journal
#+author: Preston Pan
#+description: My journal entries
:PROPERTIES:
:ID: 262ca511-432f-404f-8320-09a2afe1dfb7
+:ROAM_ALIASES: "Heat Equation" "Fourier Series"
:END:
#+title: Fourier Transform
#+author: Preston Pan
#+options: broken-links:t
* Introduction
-The Fourier Transform is a generalization of the Fourier Series.
+The Fourier Transform is a generalization of the Fourier Series. It has applications in solving [[id:4be41e2e-52b9-4cd1-ac4c-7ecb57106692][differential equations]] and
+has applications in many different fields, including [[id:136e79df-106f-4989-ab19-89705929cf91][quantum mechanics]], radio, planetary motion, and even the study
+of the heat equation. In this article we will study the heat equation, the Fourier Series, and the Fourier transform.
+
+** The Heat Equation
+The heat equation is the study of how heat travels in a conductor with the unknown function in question being $f(\vec{r}, t)$,
+giving the temperature at position $\vec{r}$ at time $t$. Now we want to describe the time rate of change of this function, so we use a
+[[id:3993a45d-699b-4512-93f9-ba61f498f77f][partial derivative]]:
+\begin{align}
+\label{Heat equation 1}
+\partial_{t}f = ?f
+\end{align}
+the left hand side should intuitively be some operator on $f$ dealing with how heat changes in space. A single spacial
+derivative operator $\partial_{x}f$ might give you the rate of change of the temperature over space. The [[id:a871e62c-b4a0-4674-9dea-d377de2f780b][continuity equation]] for
+heat might look like this:
+\begin{align}
+\label{}
+\partial_{t}f + \vec{\nabla} \cdot \vec{j} = 0
+\end{align}
+where $\vec{j}$ is the heat current. It makes sense that the heat equation ought to satisfy some continuity equation, because
+heat can't just teleport without leaving some enclosed area (in order for this theory to be physical, it must respect
+local conservation of energy). The heat current vector field and a scalar heat field might have a similar relation to
+that of the potential-vector field relation in [[id:6f2aba40-5c9f-406b-a1fa-13018de55648][conservative force]] fields:
+\begin{align}
+\label{}
+\vec{j} = -\vec{\nabla}u
+\end{align}
+substituting:
+\begin{align}
+\label{}
+\partial_{t}f = \nabla^{2}u
+\end{align}
+and heat $u$ is proportional to temperature $f$, so we have:
+\begin{align}
+\label{}
+\partial_{t}f = \alpha\nabla^{2}f
+\end{align}
+The result is a [[id:365190d8-0f3a-4728-9b09-83a216292256][PDE]] that we can solve analytically in one dimension.
+*** Solving the Heat Equation in One Dimension
+In one dimension, the heat equation looks like this:
+\begin{align}
+\label{}
+\partial_{t}f = \alpha\partial_{xx}f
+\end{align}
+we assume this is a [[id:8e9c975a-cd75-447e-b094-16258147d83c][separable differential equation]] i.e. the solution can be written:
+\begin{align}
+\label{}
+f(x, t) = X(x)T(t)
+\end{align}
+Plugging this in:
+\begin{align}
+\label{}
+X(x)\frac{dT}{dt} = \alpha T(t)\frac{d^{2}X}{dx^{2}} \\
+\frac{1}{T}\frac{dT}{dt} = \alpha \frac{1}{X}\frac{d^{2}X}{dx^{2}}
+\end{align}
+we see that each side doesn't depend on any variables from the other side, so we can separate this into two [[id:5ef63bef-2d8f-4e00-b292-8206cf69469a][ODEs]],
+because each side looks like a constant to the other side:
+\begin{align}
+\label{}
+\frac{1}{T}\frac{dT}{dt} = \alpha \frac{1}{X}\frac{d^{2}X}{dx^{2}} = -k
+\end{align}
+Now we solve for $T(t)$, by reducing this problem to being a homogeneous differential equation:
+\begin{align}
+\label{}
+\frac{dT}{dt} + kT = 0 \\
+\lambda + k = 0 \\
+\lambda = k \\
+T(t) = Ae^{-kt}
+\end{align}
+Solving for $X(x)$ is also a homogeneous case:
+\begin{align}
+\label{}
+\frac{d^{2}X}{dx^{2}} + \frac{k}{\alpha}X = 0 \\
+\lambda^{2} + \frac{k}{\alpha} = 0 \\
+\lambda = \pm \sqrt{-\frac{k}{\alpha}} \\
+X(x) = Be^{x\sqrt{-\frac{k}{\alpha}}} + Ce^{-x\sqrt{-\frac{k}{\alpha}}}
+\end{align}
+re-using $\lambda$ to mean something else and casting $\sqrt{\frac{k}{\alpha}} = \lambda$:
+\begin{align}
+\label{}
+X(x) = Be^{i\lambda x} + Ce^{-i\lambda x} \\
+T(t) = Ae^{-\lambda^{2}\alpha t} \\
+f(x, t) = ABe^{i\lambda x - \lambda^{2}\alpha t} + ACe^{-i\lambda x - \lambda^{2}\alpha t} \\
+f(x, t) = A_{1}e^{i\lambda x - \lambda^{2}\alpha t} + A_{2}e^{-i\lambda x - \lambda^{2}\alpha t}
+\end{align}
+we know that by the [[id:422653e2-daa4-422a-9cb7-3983a5a72554][superposition principle]]:
+\begin{align}
+\label{}
+f(x, t) = \sum_{i=0}^{N}f_{i}(x, t)
+\end{align}
+Now, in order to proceed, we need to formulate this as an [[id:bc7e9e01-9721-4b3e-a886-74a2fd27daf3][initial value problem]] with boundary conditions. A classic
+example would be a wire of dimension 1 and length $L$. Thus we set a couple of boundary conditions:
+
+* The Fourier Transform
+Taking the Fourier series and letting $T \rightarrow \infty$:
+\begin{align}
+\label{}
+f(x) = \sum_{n=-\infty}^{\infty}c_{n}e^{\frac{inx}{T}} \\
+Tc_{n} = \lim_{T\rightarrow\infty} \int_{-T}^{T}f(x)e^{\frac{inx}{T}}dx \\
+F(\omega) := Tc_{n} \\
+\omega := \frac{n}{T} \\
+F(\omega) = \int_{-\infty}^{\infty}f(x)e^{i\omega x}dx
+\end{align}
+$F(\omega)$ is the Fourier Transform of $f(x)$. Putting different functions as arguments gives you a Fourier Transform
+table, and the inverse transform is same as the forward transform, scaled by a constant. This makes Fourier Transforms
+useful tools for solving differential equations.
--- /dev/null
+:PROPERTIES:
+:ID: 53dade38-21e1-4fa9-a552-6ceab8a75f82
+:END:
+#+title: Heaviside Step Function
+#+author: Preston Pan
+#+html_head: <link rel="stylesheet" type="text/css" href="../style.css" />
+#+html_head: <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
+#+html_head: <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
+#+options: broken-links:t
+
+* Introduction
+the Heaviside Step Function $H(t)$ is an important function in signal analysis. It is defined as follows:
+\begin{align}
+\label{}
+H(t) =
+\[ \left\{
+\begin{array}{ll}
+0 & t \leq 0 \\
+1 & t > 0
+\end{array}
+\right. \]
+\end{align}
+and it is related to the [[id:90574fea-88f4-4b80-9cda-32cff0bcb76d][dirac delta]] distribution by taking a [[id:31d3944a-cddc-496c-89a3-67a56e821de3][derivative]]:
+\begin{align}
+\label{}
+\frac{dH}{dt} = \delta(t)
+\end{align}
+Note that this definition of the derivative may be different than that of the regular derivative definition.
:PROPERTIES:
-:ID: 5004f2b4-f8f7-46e6-87b5-e547184f82ef
+:ID: eac079b7-1144-4506-b8c5-4717ccac8a7b
:END:
-#+title: mass-spring system
+#+title: Hilbert Space
#+author: Preston Pan
#+html_head: <link rel="stylesheet" type="text/css" href="../style.css" />
#+html_head: <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
#+html_head: <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
#+options: broken-links:t
+
* Introduction
-A mass-spring model uses Hooke's law $F = kx$ in order to model a mass attached to a spring with a differential equation.
+A Hilbert Space $\mathcal{H}$ is an [[id:36a2715c-a8db-4b75-b799-61ce43be2d2d][inner product space]] whose inner product defines a complete metric space.
--- /dev/null
+:PROPERTIES:
+:ID: 700073f4-04d5-4d20-8bcd-ee9ba0a739c8
+:END:
+#+title: IAK
+#+author: Preston Pan
+#+html_head: <link rel="stylesheet" type="text/css" href="../style.css" />
+#+html_head: <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
+#+html_head: <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
+#+options: broken-links:t
+* Introduction
+Short for "I am king". Refers to the modern propensity for people to talk about political issues
+/as if they personally ran policy/, without any care to think about the fact that they /don't/.
+
+For example, the statement "we should raise taxes" is an IAK statement because "we" doesn't mean anything here.
+The person talking has no control over the "we", or the group of people making public policy. To say that they
+do via democracy is very likely to be a case of [[id:7456da20-684d-4de6-9235-714eaafb2440][IEEDI]] syndrome. Talking about IAK without being aware of the lack
+of direct input can put people in an unhealthy mindset.
+
+* Conclusion
+It can be fun to make IAK statements, in which case do so, but many do not realize how useless they are, because
+it is a direct consequence of [[id:7456da20-684d-4de6-9235-714eaafb2440][IEEDI]], which people also don't get in general.
--- /dev/null
+:PROPERTIES:
+:ID: 7456da20-684d-4de6-9235-714eaafb2440
+:END:
+#+title: IEEDI
+#+author: Preston Pan
+#+html_head: <link rel="stylesheet" type="text/css" href="../style.css" />
+#+html_head: <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
+#+html_head: <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
+#+options: broken-links:t
+
+* Introduction
+Short for "if everyone else did it...". This particular /syndrome/ involves arguments about group mentality
+that would be completely insolvent in game theory, yet are often brought up in defense of modern practices.
+** The Democracy Game
+Democracy is a good example of IEEDI syndrome. The gain of voting in an $n$ player game involving two candidates
+and popular vote drops off at $\frac{1}{n}$, but the time it takes to be informed and vote has a constant value. The decisions
+of individuals in this game most likely, in real life, at most influence the decision making of one or two other people
+(in total, from the whole chain reaction),
+so the effect of influence is not very significant (so you can't argue that you have an influence over the crowd to vote,
+because you don't). Given all these conditions, for a large $n$, voting should not be
+worth it for most people, because the choice of you voting is independent of everyone else voting. You voting or not voting
+has no bearing over the crowd. Yet, the common retort is, "if everyone thought like you...". This logic is dead on arrival,
+because /not/ everyone's going to think like you. The character of the system is that other people irrationally vote
+regardless of if you do, and your decision to vote or not vote has no bearing over the crowd voting or not voting.
+
+This simple fact is IEEDI syndrome; people are quick to conform rather than think about the personal cost-benefit analysis,
+even if the logic stops working for large societies.
+** The Activism Game
+The activism game is similar; your activism doesn't matter much, and the crowd would continue existing even if you weren't
+a part of it. Thus, any attempt to engage in activism at almost any cost is useless.
+
+* Symptoms
+One may diagnose people with IEEDI syndrome if they:
+1. cannot affect a situation meaningfully, yet they try to anyways.
+2. make [[id:700073f4-04d5-4d20-8bcd-ee9ba0a739c8][IAK]] statements regularly.
+3. engage in activism.
+
+* Conclusion
+Almost any decision to try to influence large societies where your influence is a fraction of everyone elses'
+is unjustified from a cost benefit analysis standpoint.
:END:
#+title: Kirchhoff's Laws
#+author: Preston Pan
+#+description: basic laws of circuit analysis
#+html_head: <link rel="stylesheet" type="text/css" href="../style.css" />
#+html_head: <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
#+html_head: <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
#+options: broken-links:t
* Introduction
-Kirchhoff's Laws, along with Ohm's law, create the axioms of circuit analysis. The two laws are the Kirchhoff Voltage Law
+Kirchhoff's Laws, along with [[id:3cdce475-7644-4529-a447-6e790ad4055f][Ohm's Law]], create the axioms of [[id:a7d6d6e9-9f7a-446f-b6af-255c802f86b1][circuit analysis]]. The two laws are the Kirchhoff Voltage Law
(KVL) and Kirchhoff's Current Law (KCL). They can be derived from an approximation of [[id:fde2f257-fa2e-469a-bc20-4d11714a515e][Maxwell's Equations]].
** KCL
:PROPERTIES:
Therefore:
\begin{align}
\label{}
-\sum_{n}I_{n} = 0
+\sum_{n}^{N}I_{n} = 0
\end{align}
where the total current $\vec{I}$ can be decomposed into many currents of each branched path $I_{n}$.
** KVL
+:PROPERTIES:
+:ID: 92c952ee-f1f3-4782-b9e2-6fecb56caac6
+:END:
+The Kirchhoff voltage law can be derived also from [[id:fde2f257-fa2e-469a-bc20-4d11714a515e][Maxwell's Equations]], specifically the [[id:63713308-0ff7-433f-8103-8b64ba9bdbe1][electrostatics]] equations
+that formulate the electric field as an [[id:951db9ac-3e8b-49a1-b609-2bbb795be834][electrostatic potential]]:
+\begin{align}
+\label{}
+\vec{E} = -\vec{\nabla}V
+\end{align}
+more specifically, the [[id:951db9ac-3e8b-49a1-b609-2bbb795be834][potential difference]] across a circuit element can be defined by
+$\int \vec{E} \cdot d\vec{l} = V(b) - V(a)$, where $a$ and $b$ correspond to the positions before and after the circuit element.
+We know from electrostatics that:
+\begin{align}
+\label{}
+\oint \vec{E} \cdot d\vec{l} = 0
+\end{align}
+and from the superposition principle we know:
+\begin{align}
+\label{}
+V_{tot} = \sum V_{i}
+\end{align}
+so the total voltage drop, or potential difference around the entire circuit must be zero:
+\begin{align}
+\label{}
+\sum_{n=0}^{N}V_{n} = 0
+\end{align}
:PROPERTIES:
:ID: 6dbe2931-cc18-48fc-8cc1-6c71935a6be3
+:ROAM_ALIASES: "mass-spring system"
:END:
#+title: LRC circuit
#+author: Preston Pan
* AC [[id:951db9ac-3e8b-49a1-b609-2bbb795be834][Voltage]] Source
Here is the circuit diagram for the LRC circuit with a voltage source:
#+name: LRC Circuit
-#+header: :exports both :file lrc_circuit_source.png
+#+header: :export
+#+header: :exports both :file lrc_circuit.png
#+header: :imagemagick yes :iminoptions -density 600 :imoutoptions -geometry 400
#+header: :fit yes :noweb yes :headers '("\\usepackage{circuitikz}")
#+begin_src latex :exports both :file
\begin{align*}
[LD^{2} + RD + \frac{1}{C}]i(t) = V_{0}sin(\phi + 2\pi\omega t)
\end{align*}
-where the right hand side of the equation includes the term created by the AC [[id:951db9ac-3e8b-49a1-b609-2bbb795be834][voltage]] source.
+where the right hand side of the equation includes the term created by the AC [[id:951db9ac-3e8b-49a1-b609-2bbb795be834][voltage]] source. Now we take the
+[[id:e73baa24-1a29-4f35-9d3d-0fad4a3a8e59][Laplace Transform]] of both sides (using euler notation to keep track of the phase shift $\phi$):
+\begin{align}
+\label{}
+\mathcal{L}\{LD^{2} + RD + \frac{1}{C}\}i(t) = V_{0}e^{i\phi}\mathcal{L}\{e^{i 2\pi\omega t}\} \\
+L(s^{2}I(s) - s i(0) - i'(0)) + R(sI(s) - i(0)) + \frac{1}{C}I(s) = V_{0}e^{i\phi}\mathcal{L}\{e^{i 2\pi\omega t}\} \\
+(Ls^{2} + (R - i(0))s + \frac{1}{C})I(s) = V_{0}e^{i\phi}\mathcal{L}\{e^{i 2\pi\omega t}\} + i'(0) + i(0) \\
+I(s) = \frac{V_{0}e^{i\phi}\frac{1}{s - 2\pi i \omega} + i'(0) + i(0)}{Ls^{2} + (R - i(0))s + \frac{1}{C}} \\
+i(t) = \mathcal{L}^{-1}\{\frac{V_{0}e^{i\phi}}{(s - 2\pi i \omega)(Ls^{2} + (R - i(0))s + \frac{1}{C})}\} +
+\mathcal{L}^{-1}\{\frac{i'(0) + i(0)}{Ls^{2} + (R - i(0))s + \frac{1}{C}}\}
+\end{align}
+We want to use partial fraction decomposition in order to break these denominators apart, so that doing the inverse
+transform is easier (the Laplace transform is [[id:ab024db7-6903-48ee-98fc-b2a228709c04][linear]]). Now we already know the roots of the polynomial, and we can
+set the root $2\pi i\omega = z_{1}$. Let's also ignore the rightmost term for now:
+\begin{align}
+\label{Pain}
+i(t) = V_{0}e^{i\phi}\mathcal{L}^{-1}\{\frac{1}{(s - z_{1})(s - z_{2})(s - z_{3})}\}
+\end{align}
+where $z_{2}$ and $z_{3}$ are the two roots we found for the homogeneous case. We then use partial fraction decomposition:
+\begin{align}
+\label{}
+\frac{1}{(s - z_{1})(s - z_{2})(s - z_{3})} = \frac{A}{s - z_{1}} + \frac{B}{s - z_{2}} + \frac{C}{s - z_{3}} \\
+A(s - z_{2})(s - z_{3}) + B(s - z_{1})(s - z_{3}) + C(s - z_{1})(s - z_{2}) = 1
+\end{align}
+from this we know:
+\begin{align}
+\label{}
+A + B + C = 0 \\
+z_{2}z_{3}A + z_{1}z_{3}B + z_{1}z_{2}C = 1 \\
+(z_{2} + z_{3})A + (z_{1} + z_{3})B + (z_{1} + z_{2})C = 0
+\end{align}
+Which is a linear system of equations. Eliminating C:
+\begin{align}
+\label{}
+(z_{2}z_{3} - z_{1}z_{2})A + (z_{1}z_{3} - z_{1}z_{2})B = 1 \\
+(z_{2} + z_{3})A + (z_{1} + z_{3})B - (z_{1} + z_{2})(A + B) = 0
+\end{align}
+Now we want to eliminate B:
+\begin{align}
+\label{}
+[(z_{2} + z_{3}) - (z_{1} + z_{2})]A + [(z_{1} + z_{3}) - (z_{1} + z_{2})]B = 0 \\
+(z_{3} - z_{1})A + (z_{3} - z_{2})B = 0 \\
+B = -\frac{z_{3} - z_{1}}{z_{3} - z_{2}}A \\
+\end{align}
+finally, we have one equation in terms of A:
+\begin{align}
+\label{}
+[(z_{2}z_{3} - z_{1}z_{2}) - (z_{1}z_{3} - z_{1}z_{2})\frac{z_{3} - z_{1}}{z_{3} - z_{2}}]A = 1 \\
+[(z_{2}z_{3} - z_{1}z_{2})\frac{z_{3} - z_{2}}{z_{3} - z_{2}}
+- (z_{1}z_{3} - z_{1}z_{2})\frac{z_{3} - z_{1}}{z_{3} - z_{2}}]A = 1 \\
+\frac{(z_{2}z_{3} - z_{1}z_{2})(z_{3} - z_{2}) - (z_{1}z_{3} - z_{1}z_{2})(z_{3} - z_{1})}{z_{3} - z_{2}}A = 1 \\
+\frac{z_{2}z_{3}^{2} - z_{1}z_{2}z_{3} - z_{2}^{2}z_{3} + z_{1}z_{2}^{2} -
+z_{1}z_{3}^{2} + z_{1}z_{2}z_{3} + z_{1}^{2}z_{3} - z_{1}^{2}z_{2}}{z_{3} - z_{2}}A = 1 \\
+\frac{z_{2}z_{3}^{2} - z_{2}^{2}z_{3} + z_{1}z_{2}^{2} -
+z_{1}z_{3}^{2} + z_{1}^{2}z_{3} - z_{1}^{2}z_{2}}{z_{3} - z_{2}}A = 1 \\
+A = \frac{z_{3} - z_{2}}{z_{2}z_{3}^{2} + z_{1}z_{2}^{2} + z_{1}^{2}z_{3} - z_{1}z_{3}^{2} - z_{1}^{2}z_{2} - z_{2}^{2}z_{3}} \\
+B = -\frac{z_{3} - z_{1}}{z_{3} - z_{2}}A \\
+B = -\frac{z_{3} - z_{1}}{z_{2}z_{3}^{2} + z_{1}z_{2}^{2} + z_{1}^{2}z_{3} - z_{1}z_{3}^{2} - z_{1}^{2}z_{2} - z_{2}^{2}z_{3}} \\
+C = -(A + B) \\
+C = \frac{z_{2} - z_{1}}{z_{2}z_{3}^{2} + z_{1}z_{2}^{2} + z_{1}^{2}z_{3} - z_{1}z_{3}^{2} - z_{1}^{2}z_{2} - z_{2}^{2}z_{3}}
+\end{align}
+So we have the three coefficients:
+\begin{align}
+\label{}
+A = \frac{z_{3} - z_{2}}{z_{2}z_{3}^{2} + z_{1}z_{2}^{2} + z_{1}^{2}z_{3} - z_{1}z_{3}^{2} - z_{1}^{2}z_{2} - z_{2}^{2}z_{3}} \\
+B = \frac{z_{1} - z_{3}}{z_{2}z_{3}^{2} + z_{1}z_{2}^{2} + z_{1}^{2}z_{3} - z_{1}z_{3}^{2} - z_{1}^{2}z_{2} - z_{2}^{2}z_{3}} \\
+C = \frac{z_{2} - z_{1}}{z_{2}z_{3}^{2} + z_{1}z_{2}^{2} + z_{1}^{2}z_{3} - z_{1}z_{3}^{2} - z_{1}^{2}z_{2} - z_{2}^{2}z_{3}}
+\end{align}
+The resulting solution looks like this:
+\begin{align}
+\label{}
+i(t) = V_{0}e^{i\phi}(Ae^{z_{1}t} + Be^{z_{2}t} + Ce^{z_{3}t})
+\end{align}
+where:
+\begin{align}
+\label{}
+z_{1} = 2\pi i \omega \\
+z_{2} = \frac{-(R - i(0)) + \sqrt{(R - i(0))^{2} - \frac{4L}{C}}}{2L} \\
+z_{3} = \frac{-(R - i(0)) - \sqrt{(R - i(0))^{2} - \frac{4L}{C}}}{2L}
+\end{align}
+by taking the inverse Laplace Transform. The other terms can be either ignored if $i'(0) = 0$ and $i(0) = 0$ or
+one can solve for them in the same way. Solving for the two other terms:
+\begin{align}
+\label{}
+\frac{1}{(s - z_{2})(s - z_{3})} = \frac{D}{s - z_{2}} + \frac{E}{s - z_{3}} \\
+D(s - z_{3}) + E(s - z_{2}) = 1 \\
+D + E = 0 \\
+D z_{3} + E z_{2} = -1
+\end{align}
+We have a much easier linear system:
+\begin{align}
+\label{}
+E = -D \\
+D(z_{3} - z_{2}) = -1 \\
+D = -\frac{1}{z_{3} - z_{2}} \\
+E = \frac{1}{z_{3} - z_{2}}
+\end{align}
+so the full solution including the terms used for the [[id:bc7e9e01-9721-4b3e-a886-74a2fd27daf3][initial value problem]] looks like this:
+\begin{align}
+\label{}
+i(t) = V_{0}e^{i\phi}(Ae^{z_{1}t} + Be^{z_{2}t} + Ce^{z_{3}t}) + (i'(0) + i(0))(De^{z_{2}t} + Ee^{z_{3}t})
+\end{align}
+the sinusoidal part of the solution looks like this:
+\begin{align}
+\label{hello world}
+\frac{(z_{3} - z_{2})V_{0}e^{i\phi}e^{2\pi i\omega t}}{z_{2}z_{3}^{2} + z_{1}z_{2}^{2} + z_{1}^{2}z_{3} - z_{1}z_{3}^{2} - z_{1}^{2}z_{2} - z_{2}^{2}z_{3}}
+\end{align}
+
+* Mass-Spring System
+Starting from [[id:6e2a9d7b-7010-41da-bd41-f5b2dba576d3][Newtonian mechanics]] in a single dimension:
+\begin{align}
+\label{}
+F_{net} = \sum_{i} m\frac{d^{2}x}{dt}
+\end{align}
+With Hooke's law:
+\begin{align}
+\label{}
+F = -kx
+\end{align}
+then:
+\begin{align}
+\label{}
+m\ddot{x} = -kx \\
+m\ddot{x} + kx = 0
+\end{align}
+We can define some damping force to be:
+\begin{align}
+\label{}
+F_{damp} = -a\dot{x}
+\end{align}
+which will always resist a change in the direction of motion. Then, the new equation is:
+\begin{align}
+\label{}
+m\ddot{x} + a\dot{x} + kx = 0
+\end{align}
+which has the same form as the above LRC circuit equation. Now, any external driving force will appear
+on the right hand side.
--- /dev/null
+:PROPERTIES:
+:ID: 0ecee9ae-7786-4db0-940c-c3d64f6240f6
+:END:
+#+title: L_{2} space
+#+author: Preston Pan
+#+html_head: <link rel="stylesheet" type="text/css" href="../style.css" />
+#+html_head: <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
+#+html_head: <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
+#+options: broken-links:t
+
+* Introduction
+The $L_{2}$ space is a [[id:9a1cc2d9-ef99-436c-8c21-9e68fd7df192][normed vector space]] with a particular norm:
+\begin{align}
+\label{}
+(\sum_{n=0}^{N}x_{n}^{2})^{\frac{1}{2}}
+\end{align}
+It is easy to prove that this norm satisfies the triangle inequality, and it is even more trivial to prove
+that this norm satisfies the other postulates. This norm is a part of a larger set of norms that all satisfy the
+norm definition.
--- /dev/null
+:PROPERTIES:
+:ID: e73baa24-1a29-4f35-9d3d-0fad4a3a8e59
+:END:
+#+title: Laplace Transform
+#+author: Preston Pan
+#+html_head: <link rel="stylesheet" type="text/css" href="../style.css" />
+#+html_head: <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
+#+html_head: <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
+#+options: broken-links:t
+
+* Introduction
+The dual-edge Laplace Transform is defined as:
+\begin{align}
+\label{Laplace Transform}
+F(s) = \int_{-\infty}^{\infty}f(t)e^{-st}dt
+\end{align}
+when $s$ is complex (which it usually is), the [[id:262ca511-432f-404f-8320-09a2afe1dfb7][Fourier Transform]] can be taken to be a special case of the
+dual-edge Laplace Transform. One can think of this as analyzing the complex exponential domain, rather than just
+the frequency domain (imaginary exponential domain). Now, multiplying the signal by the [[id:53dade38-21e1-4fa9-a552-6ceab8a75f82][Heaviside Step Function]]:
+\begin{align}
+\label{Step Function}
+F(s) = \int_{-\infty}^{\infty}H(t)f(t)e^{-st}dt = \int_{0}^{\infty}f(t)e^{-st}dt
+\end{align}
+gives you the conventional Laplace Transform.
+** Usage
+The Laplace Transform is primarily used for analyzing [[id:32a116d9-b813-4b5a-a2e8-6dd7b767ec16][linear differential equations]] as it converts these equations into
+algebraic equations. The inverse Laplace Transform is complicated, and is therefore not used often. Instead, Laplace
+Transform tables are used in order to convert back into the time-domain. Taking the Laplace transform of all terms in
+a linear differential equation will yield this result. One of the simplest differential equations that the Laplace
+Transform can solve is the [[id:6dbe2931-cc18-48fc-8cc1-6c71935a6be3][mass-spring system]], and it also generally has applications in [[id:a7d6d6e9-9f7a-446f-b6af-255c802f86b1][circuit analysis]].
--- /dev/null
+:PROPERTIES:
+:ID: 3cdce475-7644-4529-a447-6e790ad4055f
+:END:
+#+title: Ohm's Law
+#+author: Preston Pan
+#+html_head: <link rel="stylesheet" type="text/css" href="../style.css" />
+#+html_head: <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
+#+html_head: <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
+#+options: broken-links:t
+* Introduction
+The name is a misnomer; Ohm's law simply refers to the tendency for real world materials to obey this relation:
+\begin{align}
+\label{}
+V = IR
+\end{align}
+where $V$ is the [[id:951db9ac-3e8b-49a1-b609-2bbb795be834][voltage]], $I$ is the current, and $R$ is a proportionality constant arguably defined by this equation.
+Essentially this law posits that resistors scale the current in a [[id:ab024db7-6903-48ee-98fc-b2a228709c04][linear]] fashion. This law is used extensively in
+the analysis of resistors in [[id:a7d6d6e9-9f7a-446f-b6af-255c802f86b1][circuit analysis]].
+
--- /dev/null
+:PROPERTIES:
+:ID: a7d6d6e9-9f7a-446f-b6af-255c802f86b1
+:END:
+#+title: circuit analysis
+#+author: Preston Pan
+#+html_head: <link rel="stylesheet" type="text/css" href="../style.css" />
+#+html_head: <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
+#+html_head: <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
+#+options: broken-links:t
+
+* Introduction
+Circuit analysis is the study of real world circuits using circuit elements and circuit components with idealized
+wires. There are three basic axioms of circuit analysis, the two [[id:1d586d6b-bd97-4c59-ad57-8894ae4ac8ba][Kirchhoff's Laws]], and [[id:3cdce475-7644-4529-a447-6e790ad4055f][Ohm's Law]]. Circuit analysis
+is generally visualized via circuit diagrams, but one can represent circuits using [[id:4be41e2e-52b9-4cd1-ac4c-7ecb57106692][differential equations]] as well.
+Simple examples of circuits analyzed in this field include the [[id:6dbe2931-cc18-48fc-8cc1-6c71935a6be3][LRC circuit]] and various filters.
--- /dev/null
+:PROPERTIES:
+:ID: 4b4d4071-2ef4-4a6d-ada3-adc8cac425cc
+:END:
+#+title: consequentialism
+#+author: Preston Pan
+#+html_head: <link rel="stylesheet" type="text/css" href="../style.css" />
+#+html_head: <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
+#+html_head: <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
+#+options: broken-links:t
+* Introduction
+Consequentialism is a set of metaethical views that give importance to the consequence of actions rather than some
+inherent quality in the action. Examples of consequentialism include [[id:326eb3f8-680a-432c-bf69-42ba4d366116][egoism]] and utilitarianism. This is in contrast
+to [[id:6d8c8bcc-58b0-4267-8035-81b3bf753505][frameworks]] that posit that there is some inherent moral quality to certain things or actions, such as virtue ethics
+or deontologism. I posit that these non-consequentialist frameworks are special cases of consequentialist calculation,
+less abstracted versions of the same phenomenon. Of course, to say anything is more or less abstract is itself
+suspect as anything can be explained in terms of anything else, but it is a useful fiction to assume that one comes from
+the other, because of heuristics that follow downstream from consequentialism, such as noticing [[id:7456da20-684d-4de6-9235-714eaafb2440][IEEDI]] syndrome.
+
\int_{\vec{a}}^{\vec{b}}\vec{f} \cdot d\vec{l} = V(\vec{a}) - V(\vec{b})
\end{align*}
because it is path independent, we do not need to consider the infinite paths between \(\vec{a}\) and \(\vec{b}\), which
-allows us to define this function \(V(\vec{r})\). Then by the fundamental theorem of calculus:
+allows us to define this function \(V(\vec{r})\). Then by the fundamental theorem of calculus, using the [[id:3587c3b4-c3d8-4ff1-b0ba-8eecb1ef0e4c][Gradient]]:
\begin{align*}
\vec{f} = -\vec{\nabla}V
\end{align*}
-Therefore, conservative forces can be represented by a scalar field. Now taking the curl of both sides we get:
+Therefore, conservative forces can be represented by a scalar field. Now taking the [[id:b25e0e44-c764-4f0a-a5ad-7f9d79c7660d][Curl]] of both sides we get:
\begin{align*}
\vec{\nabla} \times \vec{f} = 0
\end{align*}
and gradient have been described, I feel it is trivial to understand the Laplacian.
** Product Rules
-The product rules pertaining to the del operator are consistent with that of linear algebra and single variable derivative rules.
+The [[id:d1e245f4-0b04-450e-8465-a9c85fe57f7e][product rules]] pertaining to the del operator are consistent with that of linear algebra and single variable derivative rules.
For example, \( \vec{\nabla} \times \vec{\nabla}f = 0\). You can show this yourself quite easily, so I find no need to go over it here.
When in doubt, just assume the del works the same way as any old vector except you apply the [[id:d1e245f4-0b04-450e-8465-a9c85fe57f7e][product rule]], and you will usually be correct.
Differential equations are often used to model real world systems, and are the main tool in numerical simulations of said
systems.
** ODE
+:PROPERTIES:
+:ID: 5ef63bef-2d8f-4e00-b292-8206cf69469a
+:END:
An ODE is a differential equation involving single variable function solution classes and their derivatives.
** PDE
+:PROPERTIES:
+:ID: 365190d8-0f3a-4728-9b09-83a216292256
+:END:
A PDE is a differential equation involving multivariable function solution classes and generally involve partial derivatives
of the unknown function.
** initial value problem
+:PROPERTIES:
+:ID: bc7e9e01-9721-4b3e-a886-74a2fd27daf3
+:END:
An initial value problem is a problem where one is given a differential equation and particular values of the unknown function
and particular values of its derivatives, and the result is a particular solution.
+** separable differential equation
+:PROPERTIES:
+:ID: 8e9c975a-cd75-447e-b094-16258147d83c
+:END:
+For [[id:5ef63bef-2d8f-4e00-b292-8206cf69469a][ODEs]], separable differential equations are differential equations of the form:
+\begin{align}
+\label{}
+\frac{dy}{dx} = f(y)g(x)
+\end{align}
+which can be solved by taking an integral on both sides:
+\begin{align}
+\label{}
+\frac{dy}{f(y)} = g(x)dx \\
+\int\frac{dy}{f(y)} = \int g(x)dx
+\end{align}
+evaluating the integrals and solving for $y$, you obtain solutions for $y$ in terms of $x$.
+** [[id:ab024db7-6903-48ee-98fc-b2a228709c04][linear]] differential equation
+:PROPERTIES:
+:ID: 32a116d9-b813-4b5a-a2e8-6dd7b767ec16
+:END:
+Linear differential equations are differential equations of the form:
+\begin{align}
+\label{}
+[\sum_{i}f_{i}(x)D^{i}]y(x) = g(x)
+\end{align}
+where $D$ is the [[id:31d3944a-cddc-496c-89a3-67a56e821de3][derivative]] operator. They are linear because the unknown function $y(x)$ is being operated on by some
+linear operator, and common methods in linear algebra can be used in order to analyze equations of this kind. For
+example, a first-order linear differential equation would look like this:
+\begin{align}
+\label{}
+[f(x)D + g(x)]y(x) = h(x)
+\end{align}
+which can be easily solved in the following way where $G(x) = \frac{g(x)}{f(x)}$ and $H(x) = \frac{h(x)}{f(x)}$:
+\begin{align}
+\label{}
+[D + G(x)]y(x) = H(x) \\
+\mu(x)[D + G(x)]y(x) = \mu(x)H(x) \\
+\mu'(x) := G(x)\mu(x) \\
+D(\mu(x)y(x)) = \mu(x)H(x) \\
+y(x) = \frac{\int\mu(x)H(x)dx}{\mu(x)}
+\end{align}
+Now to solve for $\mu(x)$, using [[id:8e9c975a-cd75-447e-b094-16258147d83c][separable differential equation]] methods:
+\begin{align}
+\label{}
+\frac{d\mu}{dx} = G(x)\mu(x) \\
+\frac{1}{\mu}d\mu = G(x)dx \\
+\int\frac{1}{\mu}d\mu = \int G(x)dx \\
+ln(\mu) = \int G(x)dx \\
+e^{\int G(x)dx} = \mu
+\end{align}
+Therefore:
+\begin{align}
+\label{}
+y(x) = \frac{\int e^{\int G(x)dx}H(x)dx}{e^{\int G(x)dx}}
+\end{align}
+Then, to model any particular first order system, plug in functions for $G(x)$ and $H(x)$.
+*** superposition principle
+:PROPERTIES:
+:ID: 422653e2-daa4-422a-9cb7-3983a5a72554
+:END:
+The principle of superposition states that any solutions $f_i(x)$ add to a new solution:
+\begin{align}
+\label{}
+\sum_{i=0}^{N}f_{i}(x) = f_{new}(x)
+\end{align}
+that also satisfies the linear differential equation. This works because the operator is [[id:ab024db7-6903-48ee-98fc-b2a228709c04][linear]], so additive properties
+work over this space.
+*** Higher Order Linear Differential Equations
+Solving higher order linear differential equations requires a couple of tricks. For example, transforms such
+as the [[id:e73baa24-1a29-4f35-9d3d-0fad4a3a8e59][Laplace Transform]] or the [[id:262ca511-432f-404f-8320-09a2afe1dfb7][Fourier Transform]] may be used. Such transforms reduce differential equation
+problems to algebraic problems, thus simplifying their solution methods. Other methods include guessing (I'm not
+pulling your leg here, this is real), formulation as an eigenvalue problem, and taylor polynomial solutions. We will
+take a look at all of these in this section.
+*** Homogeneous Case
+Take the case $Ay'' + By' + Cy = 0$, the substitute the form $y = De^{kt}$. Then:
+\begin{align}
+\label{}
+De^{kt}(Ak^{2} + Bk + C) = 0 \\
+Ak^{2} + Bk + C = 0
+\end{align}
+Then, use the quadratic formula to solve for $k$ in terms of the other constants. Such a polynomial is called the
+characteristic polynomial of this differential equation.
+*** Eigenvalue Problems
+Eigenvalue problems can be solved just like in the familiar linear algebra case. For instance, take some differential
+equation in this form:
+\begin{align}
+\label{}
+A(f) = \lambda f
+\end{align}
+where $A$ is a linear operator in [[id:b1f9aa55-5f1e-4865-8118-43e5e5dc7752][function]] space, and $\lambda$ is any constant. Traditionally, one would solve such an eigenvalue
+problem like so:
+\begin{align}
+\label{}
+\det{(A - \lambda I)} = 0
+\end{align}
+In the simple example of a polynomial basis, this function $f$ can be represented as some linear combination of linearly
+independent polynomials. A simple basis to choose could be the Taylor series basis i.e. $\vec{e_{n}} = x^{n}$ where $e_{n}$ is the nth
+basis vector. Note that there are many polynomial bases that are an orthogonal basis and span this subset of function
+space, but this is a simple example. In this case, the matrix $A$ would represent an operation on an infinite polynomial,
+and the $\lambda I$ tells you to subtract $\lambda$ from all its diagonals. You can interpret this literally, using the following example.
+**** Example
+\begin{align}
+\label{}
+D(r^{2}D(f(r)) = \lambda f(r)
+\end{align}
+is such an example of an eigenvalue problem. Now, using the Taylor basis, we need to know two things: what $D$ is as an
+infinite dimensional matrix in this basis, and what $t^{2}$ is as an infinite dimensional matrix. $f$ is some unknown vector
+we are trying to solve for in this system. Note this observation:
+\begin{align}
+\label{}
+\begin{pmatrix}
+0 & 1 & 0 & 0 & 0 \\
+0 & 0 & 2 & 0 & 0 \\
+0 & 0 & 0 & 3 & 0 \\
+0 & 0 & 0 & 0 & 4 \\
+\end{pmatrix}
+\begin{pmatrix}
+a \\
+b \\
+c \\
+d \\
+e
+\end{pmatrix}
+=
+\begin{pmatrix}
+b \\
+2c \\
+3d \\
+4e
+\end{pmatrix}
+\end{align}
+
+That this matrix encodes the power rule for the Taylor eigenbasis for 4 dimensions; each entry in the vectors encodes the nth
+power monomial term, which means, for example:
+\begin{align}
+\label{}
+\begin{pmatrix}
+a \\
+b \\
+c \\
+d \\
+e
+\end{pmatrix} := a + bx + cx^{2} + dx^{3} + ex^{4}
+\end{align}
+then the derivative of this vector would be:
+\begin{align}
+\label{derivative}
+b + 2cx + 3dx^{2} + 4ex^{3}
+\end{align}
+which is exactly the coefficients in the resultant vector! Now, if we generalize this to an infinite amount of dimensions
+(where the vector has an infinite length and the matrix has infinite entries), this corresponds to the same effect.
+
+Thus, the infinite matrix with the off-diagonal increasing entries is the $D$ matrix, or $D$ operator. But what is the
+$r^{2}$ operator? We know it must be a matrix operation that shifts the entire vector up by two, and pads the first two
+entries of the vector with two zeros. If we find this matrix, the matrix multiplication $DRD$ should yield a new
+infinite matrix $M$, which we can use in order to solve the eigenvalue problem $\det{(M - \lambda I)} = 0$. Now this matrix is:
+\begin{align}
+\label{R matrix}
+\begin{pmatrix}
+0 & 0 & 0 & 0 & 0 \\
+0 & 0 & 0 & 0 & 0 \\
+1 & 0 & 0 & 0 & 0 \\
+0 & 1 & 0 & 0 & 0 \\
+0 & 0 & 1 & 0 & 0 \\
+\end{pmatrix}
+\end{align}
+and so on. This matrix does the exact same thing to a polynomial vector as what multiplying $r^{2}$ does to a polynomial.
+We then multiply the two matrices to get this new matrix:
+\begin{align}
+\label{new}
+\begin{pmatrix}
+0 & 0 & 0 & 0 & 0 \\
+0 & 0 & 0 & 0 & 0 \\
+1 & 0 & 0 & 0 & 0 \\
+0 & 1 & 0 & 0 & 0 \\
+0 & 0 & 1 & 0 & 0 \\
+\end{pmatrix}
+\begin{pmatrix}
+0 & 1 & 0 & 0 & 0 \\
+0 & 0 & 2 & 0 & 0 \\
+0 & 0 & 0 & 3 & 0 \\
+0 & 0 & 0 & 0 & 4 \\
+0 & 0 & 0 & 0 & 0
+\end{pmatrix} =
+\begin{pmatrix}
+0 & 0 & 0 & 0 & 0 \\
+0 & 0 & 0 & 0 & 0 \\
+0 & 1 & 0 & 0 & 0 \\
+0 & 0 & 2 & 0 & 0 \\
+0 & 0 & 0 & 3 & 0 \\
+\end{pmatrix}
+\end{align}
+and so on, as you can see the pattern. Now we multiply in another $D$:
+\begin{align}
+\label{DS}
+\begin{pmatrix}
+0 & 1 & 0 & 0 & 0 \\
+0 & 0 & 2 & 0 & 0 \\
+0 & 0 & 0 & 3 & 0 \\
+0 & 0 & 0 & 0 & 4 \\
+0 & 0 & 0 & 0 & 0
+\end{pmatrix}
+\begin{pmatrix}
+0 & 0 & 0 & 0 & 0 \\
+0 & 0 & 0 & 0 & 0 \\
+0 & 1 & 0 & 0 & 0 \\
+0 & 0 & 2 & 0 & 0 \\
+0 & 0 & 0 & 3 & 0 \\
+\end{pmatrix} =
+\begin{pmatrix}
+0 & 0 & 0 & 0 & 0 \\
+0 & 2 \cdot 1 & 0 & 0 & 0 \\
+0 & 0 & 3 \cdot 2 & 0 & 0 \\
+0 & 0 & 0 & 4 \cdot 3 & 0 \\
+0 & 0 & 0 & 0 & 5 \cdot 4
+\end{pmatrix}
+\end{align}
+of course the $5 \cdot 4$ isn't actually resultant from the image above, but it is from the infinite version
+of this process. Now, we can finally subtract $\lambda$ from this infinite matrix:
+\begin{align}
+\label{lambda}
+\begin{pmatrix}
+-\lambda & 0 & 0 & 0 & 0 \\
+0 & 2 \cdot 1 - \lambda & 0 & 0 & 0 \\
+0 & 0 & 3 \cdot 2 - \lambda & 0 & 0 \\
+0 & 0 & 0 & 4 \cdot 3 - \lambda & 0 \\
+0 & 0 & 0 & 0 & 5 \cdot 4 - \lambda
+\end{pmatrix}
+\end{align}
+Now, you might be wondering how we're going to take the determinant of this infinite matrix. We can take
+a [[id:122fd244-ffeb-47d0-89ce-bf9bc6f01b70][limit]] of finite matrices to find out what the generalization might be. For instance, the 3d case might look like this:
+\begin{align}
+\label{}
+\lambda^{2}(2\cdot 1 - \lambda)
+\end{align}
+(as the very last diagonal entry in the finite case does not extend infinitely, there is no $3 \cdot 2$ term). Now taking some
+higher dimensions:
+\begin{align}
+\label{higher dimensions}
+\lambda^{2}(2 \cdot 1 - \lambda)(3 \cdot 2 - \lambda) \\
+\lambda^{2}(2 \cdot 1 - \lambda)(3 \cdot 2 - \lambda)(4 \cdot 3 - \lambda) \\
+\lambda^{2}(2 \cdot 1 - \lambda)(3 \cdot 2 - \lambda)(4 \cdot 3 - \lambda)(5 \cdot 4 - \lambda)
+\end{align}
+using inductive reasoning we should expect the infinite form to be:
+\begin{align}
+\label{}
+det(M) = -\lambda(2 \cdot 1 - \lambda)(3 \cdot 2 - \lambda)(4 \cdot 3 - \lambda)(5 \cdot 4 - \lambda)(6 \cdot 5 - \lambda)\dots
+\end{align}
+(note that it isn't $\lambda^{2}$ because the very last $-\lambda$ never gets multiplied, and it's negative for that reason too). Note
+that if we want to set $det(M) = 0$, $\lambda = n(n - 1)$ where $n$ is a natural number (including zero). Then we substitute
+back in the $\lambda$ for some $n$, let's use $n = 2$ as an example:
+\begin{align}
+\label{n=2}
+\begin{pmatrix}
+-2 & 0 & 0 & 0 & 0 \\
+0 & 0 & 0 & 0 & 0 \\
+0 & 0 & 4 & 0 & 0 \\
+0 & 0 & 0 & 10 & 0 \\
+0 & 0 & 0 & 0 & 18
+\end{pmatrix}
+\begin{pmatrix}
+a_{1} \\
+a_{2} \\
+a_{3} \\
+a_{4} \\
+a_{5} \\
+\end{pmatrix} =
+\begin{pmatrix}
+0 \\
+0 \\
+0 \\
+0 \\
+0
+\end{pmatrix}
+\end{align}
+clearly, when we choose $n = 2$, the second value $a_{2}$ is free, and the rest for the given eigenfunction
+must be zero, meaning for a given $n$, the resulting eigenvector is $ax^{n}$ for any value $a$. This is one of the solutions
+to this differential equation.
+
+It turns out there's another solution in a space that the Taylor space does not span, but I'll leave it as an exercise
+to find the other solution using this method, by extending it to include other kinds of functions. Note that for your
+eigenbasis one can use the [[id:262ca511-432f-404f-8320-09a2afe1dfb7][Fourier Transform]] to make a Fourier basis, but that's also easy to generalize.
Egoism, broadly defined, is the philosophical view that one should maximize for their own utility function, or well-being,
or self-satisfaction, etc..., whatever you want to call it. The general statement is that there is some value one would
want to maximize for themselves. This philosophical view is a metaethical view in general but can be applied descriptively.
+
+This view is a part of a broader view of [[id:4b4d4071-2ef4-4a6d-ada3-adc8cac425cc][consequentialism]], a view that I broadly subscribe to; sometimes utilitarian
+analysis is useful for describing things inside the egoist framework, and sometimes it is not.
* Descriptively
In economics, homo-econimus is a kind of idealized economic agent that maximizes for their own economic value. Descriptive
egoism is in a sense the statement that people tend to maximize for some utility function. In a sense, there are many games
on \( P_{1} \) is as follows:
\begin{align*}
-\vec{F(\vec{r})} = \frac{1}{4\pi\epsilon_{0}}\frac{qQ}{r^{2}} \hat{r}.
+\vec{F(\vec{r})} = \frac{1}{4\pi\epsilon_{0}}\frac{qQ}{r^{2}} \hat{r}
\end{align*}
Where \( \hat{r} \) is the unit vector pointing in the direction of \( P_{2} \). Note that there are a
couple of interesting things about this force. First, it is an [[id:2a543b79-33a0-4bc8-bd1c-e4d693666aba][inverse square]] law, and the formula looks a lot like the one for gravitation,
only charge can be negative and mass cannot. Second, it is symmetrical,
in the sense that the force felt by \( P_{2} \) is going to be the same, only \( \hat{r} \)
-is pointing in the other direction. Also, note that due to linearity, this force calculation follows the /superposition principle/.
+is pointing in the other direction. Also, note that due to linearity, this force calculation follows the [[id:422653e2-daa4-422a-9cb7-3983a5a72554][superposition principle]].
That is, if we have different electrostatic forces acting on one particle:
\begin{align*}
because we often want to find the force if an arbitrary object with an arbitrary charge is next
to the particle in question, instead of focusing specifically on two charges.
-Note that it is trivial to prove that \( \vec{E} \) also follows the superposition principle.
+Note that it is trivial to prove that \( \vec{E} \) also follows the [[id:422653e2-daa4-422a-9cb7-3983a5a72554][superposition principle]].
** Continuous Charge Distributions
:PROPERTIES:
:ID: 6d8c8bcc-58b0-4267-8035-81b3bf753505
+:ROAM_ALIASES: system
:END:
#+title: framework
#+author: Preston Pan
+# -*- org-publish-use-timestamps-flag: nil; -*-
#+title: Mindmap
#+author: Preston Pan
#+date: <2023-06-10 Sat>
\begin{align*}
\forall a \in \mathbb{R}, -\infty < a < \infty
\end{align*}
+This definition of infinity is generally used to define concepts such as [[id:122fd244-ffeb-47d0-89ce-bf9bc6f01b70][limits]] in [[id:a6bc601a-7910-44bb-afd5-dffa5bc869b1][mathematics]].
--- /dev/null
+:PROPERTIES:
+:ID: 36a2715c-a8db-4b75-b799-61ce43be2d2d
+:END:
+#+title: inner product space
+#+author: Preston Pan
+#+html_head: <link rel="stylesheet" type="text/css" href="../style.css" />
+#+html_head: <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
+#+html_head: <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
+#+options: broken-links:t
+
+* Introduction
+An inner product space is a [[id:9a1cc2d9-ef99-436c-8c21-9e68fd7df192][normed vector space]] with an inner product defined. This inner product obeys the
+following properties:
+\begin{align}
+\label{}
+\langle x,y \rangle = \overline{\langle y,x \rangle} \\
+\langle ax + by, z \rangle = a\langle x,z \rangle + b\langle y,z \rangle \\
+\langle x,x \rangle > 0, x > 0 \\
+\langle x,x \rangle = 0, x = 0
+\end{align}
+where $\overline{\langle y,x \rangle}$ is the complex conjugate of $\langle x,y \rangle$. This gives rise to a normed vector space:
+\begin{align}
+\label{}
+\lVert x \rVert = \langle x,x \rangle
+\end{align}
+
\end{align*}
Note that because this field does not require keeping track of vector orientation, it is significantly easier to solve for \(V\) then convert to \(\vec{f}\). Additionally,
setting a reference point to something that is not infinity would be valid as well -- we just choose infinity because it cancels off the constant term. However,
-the /difference/ in potentials is absolute and does not require any constant adjustment.
+the /difference/ in potentials is absolute and does not require any constant adjustment. Then, the divergence of inverse
+square fields can be reformulated with the [[id:65004429-a6b7-41f2-8489-07605841da3d][Laplacian]] operator:
+\begin{align}
+\label{}
+\nabla^{2}V(\vec{r''}) = k\sigma(\vec{r''})
+\end{align}
+
\begin{align*}
\lim s_{n} = s \iff \forall \epsilon > 0, \exists N, n > N \implies | s_{n} - s | < \epsilon \\
\end{align*}
-
+which is equivalent to:
+\begin{align*}
+\lim s_{n} = s \iff \forall \epsilon > 0, \exists N, n > N \implies s - \epsilon < s_{n} < s + \epsilon
+\end{align*}
and our sequence $\{s_{n}\}$ is monotone. If $\{s_{n}\}$ is increasing, we have:
\begin{align*}
s_{n + 1} \ge s_{n}
\end{align*}
-for all n.
+for all n. Without loss of generality we shall assume $\{s_{n}\}$ is increasing. Then we take two cases:
+1. $\{s_{n}\}$ is bounded.
+2. $\{s_{n}\}$ is unbounded.
+In the case $\{s_{n}\}$ is bounded:
+\begin{align}
+\label{}
+\exists M, \forall n, s_{n} \le M \\
+s_{0} \le ... \le s_{n} \le s_{n + 1} \le s_{n + 2} \le ... \le M
+\end{align}
+
#+end_proof
Logic is the foundation of everything mathematical, and can even study itself; this is known as metalogic. In order to
demonstrate logic, we must first demonstrate some axioms of logic, starting with propositional logic.
** Propositional Logic
+Propositional logic
#+html_head: <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
#+html_head: <link rel="stylesheet" type="text/css" href="../style.css" />
-* Mathematics is Logic
-With a couple of set theory axioms. One might
-describe it as an extrapolation framework
-without grounding (i.e. a set of implications;
-if p then q, but never specifying if p is a property
-of a real system or not). Therefore, mathematics
-is suitable for modeling other things if we believe
-those other things have some rules and are logically
-consistent.
+* Mathematics is [[id:29ebc4f9-0fd8-4203-8bfe-84f8558e09cf][Logic]]
+With a couple of set theory axioms. One might describe it as an extrapolation framework
+without grounding (i.e. a set of implications; if p then q, but never specifying if p is a property
+of a real system or not). Therefore, mathematics is suitable for modeling other things if we believe
+those other things have some rules and are logically consistent.
-There are many subfields in math, ranging from group theory
-to complex analysis. However, much of the time we are able to find
-morphisms between these different fields in mathematics, which we
+There are many subfields in math, ranging from group theory to calculus.
+However, much of the time we are able to find morphisms between these different fields in mathematics, which we
model using category theory.
-
** Mathematical Models
+There are many fields where mathematics is the main method of analysis.
*** [[id:ece8bf94-4e3c-4939-a77a-9949c1ec0dc6][Physics]]
Physics is the study of the natural world and its laws, usually resorting to a mathematical framework.
--- /dev/null
+:PROPERTIES:
+:ID: 6f24f731-60e5-4904-88d7-c63869505981
+:ROAM_ALIASES: metric
+:END:
+#+title: metric space
+#+author: Preston Pan
+#+html_head: <link rel="stylesheet" type="text/css" href="../style.css" />
+#+html_head: <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
+#+html_head: <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
+#+options: broken-links:t
+
+* Introduction
+A metric space $(G, d)$ is a set with a metric $d(x,y): G \times G \rightarrow \mathbb{R}$ defined on members of the set.
+This metric is a generalization of distance, with the following properties:
+\begin{align}
+\label{}
+d(x, x) = 0 \\
+x \ne y \implies d(x, y) > 0 \\
+d(x, y) = d(y, x) \\
+d(x, z) \le d(x, y) + d(x, z)
+\end{align}
+where property $(4)$ is the triangle inequality.
--- /dev/null
+:PROPERTIES:
+:ID: 9a1cc2d9-ef99-436c-8c21-9e68fd7df192
+:END:
+#+title: normed vector space
+#+author: Preston Pan
+#+html_head: <link rel="stylesheet" type="text/css" href="../style.css" />
+#+html_head: <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
+#+html_head: <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
+#+options: broken-links:t
+
+* Introduction
+A normed vector space is a [[id:ab024db7-6903-48ee-98fc-b2a228709c04][vector space]] with a norm defined, which describes the "length" of the vector.
+This norm obeys these properties:
+\begin{align}
+\label{}
+\lVert ax \rVert = \lvert a \rvert \lVert x \rVert \\
+\lVert x + y \rVert \le \lVert x \rVert + \lVert y \rVert
+\end{align}
+this gives rise to a [[id:6f24f731-60e5-4904-88d7-c63869505981][metric]] $d(x, y)$:
+\begin{align}
+\label{}
+d(x, y) = \lVert x - y \rVert
+\end{align}
It is just a different kind of emotion, but there is no underlying fact of the matter that one can point to with regards
to moral theory.
-Note that there are several arguments that facts are treated on a separate footing to moral theory under such a framework.
+Note that there are several arguments that facts are treated on a separate footing to moral theory under such a [[id:6d8c8bcc-58b0-4267-8035-81b3bf753505][framework]].
Indeed it is true that this mindmap will rest on some emperical facts, but this mindmap maintains that doing this is a
perfectly internally consistent and descriptive standpoint. From here on, we will use ethical and moral statements as
a description of people, rather than a description of some real moral fact.
+
+Generally speaking, one can use [[id:29ebc4f9-0fd8-4203-8bfe-84f8558e09cf][logical deduction]] in order to reach conclusions from initial epistemological or
+metaphysical assertions in philosophy. People also apply the same reasoning to moral intuition, but as I explained above,
+I do not hold moral philosophy to be important.
+* Philosophy and Egoism
+Egoism is a generally acceptable bootstrapping belief; it can get oneself into talking about moral facts (or the lack
+thereof) without many buy-ins, and it can describe a wide variety of other beliefs from within its own framework. The logical
+consequence of choosing egoism as an acceptable framework is that philosophy becomes the study of maximizing for the
+goals created by oneself; in esscence, egoism is the weak assertion that there is something in life to be optimized.
+
+One can, in general, create an optimal life by doing two things:
+1. When a value is easier to get rid of than to satisfy, get rid of it.
+2. Derive as many current values from deeper, more fundamental values as possible, using [[id:29ebc4f9-0fd8-4203-8bfe-84f8558e09cf][logic]].
+Being attached to moral values is itself in contradiction to satisfying said moral values; you're creating more work
+for yourself, much of which one can't do. One should view values themselves as tools to achieve some optimal end,
+whatever that may mean to you, and deriving current values from deeper values using logic allows you to rule out
+values that you hold for no good reason. This metavalue system is efficient because it gets rid of values that do harm
+to the egoist goal.
+
+For instance, some may care about climate change, and wish to do something about climate change because of some moral
+value that they hold. I hold that this is, in many cases, ill advised, because singular people cannot do anything about
+climate change. However, many still hold onto the belief that they are somehow important in the cause, when they just
+objectively aren't (it would be [[id:7456da20-684d-4de6-9235-714eaafb2440][IEEDI]] syndrome), and hold that they should still do it for "moral reasons". If these "moral reasons" are just tools
+that you can bend given you convince yourself of something else, why would one subject themselves to doing something
+suboptimal?
+
+The answer is that two things could be going on: either it is hard mentally for them to accept getting rid of their
+values, in which case they should keep their values, or they haven't thought about the fact that it isn't a good idea
+from an egoist standpoint. I think this is common.
+
+Very few modern ideas that people would consider "moral things to do" are built into the human condition. As long
+as you can escape those ideas easily, you'd have more time and energy to allocate towards doing something that satisfies
+goals that are more tangible (you can't fix climate change on your own, but you can fix your own life). Give up on
+things that don't give you an advantage, or gives you a disadvantage (advantage and disadvantage being with respect
+to values that are hard to give up on, such as having friends, eating food, drinking water, etc...).
+* Isn't This Value Itself A Tool?
+Yes, and I could've described this in many different ways using many different metaframeworks, as they all probably
+have the same perscriptive power. However, I hold that this would "work better" for most people who try it.
many correspondences and [[id:1b1a8cff-1d20-4689-8466-ea88411007d7][dualities]].
** Classical Mechanics
Classical mechanics deals with fields of physics that do not deal with time dilation or quantum
-weirdness. It is called classical mechanics because most of these theories wer invented before
+weirdness. It is called classical mechanics because most of these theories were invented before
their quantum or relativistic counterparts, and usually serve as a baseline understanding
for the later topics.
*** [[id:6e2a9d7b-7010-41da-bd41-f5b2dba576d3][Newtonian mechanics]]
This is a different strain of classical mechanics. Instead of looking at direction and vectors,
it looks at a single fundamental principle, even more fundamental than inertia and conservation of momentum:
optimization. We believe that nature always optimizes for some parameters in all physical phenomena. Almost
-all physical theories including electromagnetism, general relativity, Newtonian mechanics, and even quantum mechanics can be explained
-within the Lagrangian framework.
+all physical theories including electromagnetism, general relativity, Newtonian mechanics, and even quantum
+mechanics can be explained within the Lagrangian framework.
+*** Fluid Mechanics
+*** Thermodynamics
*** Classical Electrodynamics
Classical electrodynamics attempts to explain the electromagnetic force from a classical perspective. What is
light? How does electricity actually work? All these questions you will find (half) answered in the study
*** General Relativity
General Relativity aims unify gravity with [[id:e38d94f2-8332-4811-b7bd-060f80fcfa9b][special relativity]], in a unified theory of macroscopic forces
including classical electromagnetism.
-
-** Quantum Mechanics
+** [[id:136e79df-106f-4989-ab19-89705929cf91][Quantum Mechanics]]
Quantum mechanics renounces all hope of having a deterministic view of physics, and instead replaces direct causation
with statistical causation, at least according to some interpretations.
+** QFT
+Quantum Field Theory is an approach that combines [[id:e38d94f2-8332-4811-b7bd-060f80fcfa9b][special relativity]] with [[id:136e79df-106f-4989-ab19-89705929cf91][quantum mechanics]], then utilizing a process
+called canonical quantization in order to quantize a given field. This is the closest thing we have to a theory of [[id:2b8515d8-9f3c-44a3-a40d-147f6a2bbb25][everything]]
+in physics.
+
+* Note
+I did not exhaustively cover all fields in physics but this is most of it.
+++ /dev/null
-:PROPERTIES:
-:ID: 5d2e2f3b-96ac-4196-9baf-4c3d6d349c98
-:END:
-#+title: python
-#+author: Preston Pan
-#+html_head: <link rel="stylesheet" type="text/css" href="../style.css" />
--- /dev/null
+:PROPERTIES:
+:ID: 136e79df-106f-4989-ab19-89705929cf91
+:END:
+#+title: quantum mechanics
+#+author: Preston Pan
+#+html_head: <link rel="stylesheet" type="text/css" href="../style.css" />
+#+html_head: <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
+#+html_head: <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
+#+options: broken-links:t
+* Introduction
+Quantum mechanics was discovered as a predictive [[id:6d8c8bcc-58b0-4267-8035-81b3bf753505][framework]] in the early 1900's after a set of experiments (i.e. the
+photoelectric effect and the Stern Gerlach experiment) showed that particles were better described as waves, and
+that the probability of measurement of particle states were random. Indeed, other experiments that tested Bell's
+inequality have confirmed this assertion of quantum mechanics that the world is fundamentally random. Let's take
+a look at some of the postulates of quantum mechanics (for which the [[id:a6bc601a-7910-44bb-afd5-dffa5bc869b1][mathematics]] borrow from linear algebra quite a bit).
+* Postulates
+Here, we describe all the postulates of quantum mechanics, with some motivation when needed.
+** Postulate 1
+$| \psi \rangle$ is the state vector in a [[id:eac079b7-1144-4506-b8c5-4717ccac8a7b][Hilbert Space]] $\mathcal{H}$ which describes the entire system.
+** Postulate 2
+The norm $\langle \psi | \psi \rangle$ of all state vectors are 1.
+** Postulate 3
+If $| \psi \rangle$ and $| \phi\rangle$ represent two different quantum systems, the composite system can be described by
+$| \psi \rangle \otimes | \phi \rangle$, where $\otimes$ is the tensor product.
+** Postulate 4
+Observable quantities are represented by Hermitian operators $\hat{A}$ whose eigenvectors form a basis for $\mathcal{H}$.
+Solutions to $\hat{A}|\psi\rangle = a|\psi\rangle$ for eigenvalues $a$ are the only possible observable values for a given eigenvector $|\psi\rangle$.
+** Postulate 5
+The time-evolution of the state vector $|\psi\rangle$ can be given by the Schrodinger equation, a [[id:365190d8-0f3a-4728-9b09-83a216292256][PDE]]:
+\begin{align}
+\label{}
+\hat{H}|\psi\rangle = i\hbar\partial_{t}|\psi\rangle
+\end{align}
+which is motivated by the De Broglie hypothesis:
+\begin{align}
+\label{}
+p = hf
+\end{align}
+where $p$ is the momentum, and $f$ is the frequency. De Broglie hypothesized that all matter behaves like a wave,
+after Einstein came up with the same relation for light:
+\begin{align}
+\label{}
+p = \frac{E}{c} = hf
+\end{align}
+where $h$ is Planck's constant, which is specifically a relation
#+RESULTS:
: 120
-and in stem, we can print out the stack every step of the way with the builtin word ~?~:
+and in stem, we can print out the [[id:52d255d2-114c-42f4-b362-f0b4a2f7b83d][stack]] every step of the way with the builtin word ~?~:
#+begin_src stem :exports both
factorial-debug [ dup 0 <= [ 1 + ] [ ? "\n" . dup 1 - factorial-debug ? "\n" . * ] if ] def
5 factorial-debug .
is present in all programming languages, although in stem the operations are transparent as the stack is accessible by regular program users. In short, we keep
on going down and down until we hit the bottom, base case, in which case we have all the pieces we need in order to go back up again, where the stack stores
the information from most recent tasks to be done and we work back up in order to do the less recent tasks.
+
+This concept is important in programming because it allows one to build definitions in an intuitive way, simply by
+specifying the base case and specifying the case that is not the base case. Such an algorithm absolves oneself from having
+to design complicated patterns, as instead the entire computation emerges out of simple rules.
+
+In general, we see recursive definitions and design patterns in nature in the form of fractals.
+* Self Reference Problems
+A big part of [[id:654280d8-82e8-4a0e-a914-bd32181c101b][infinite]] [[id:8f265f93-e5fd-4150-a845-a60ab7063164][recursion]] has to do with self reference problems. For instance, Russel's paradox with respect to
+set theory: does a set that contains all sets that do not contain themselves contain itself?
+
+Such a set would contain itself if and only if it didn't contain itself. This apparent contradiction in set theory is an
+example of using recursion to reach self reference paradoxes. There are more examples, such as Godel's theorems and
+Turing's computability theorem.
#+title: stack
#+author: Preston Pan
#+html_head: <link rel="stylesheet" type="text/css" href="../style.css" />
+* Introduction
+A stack in programming is a data structure that satisfies the following API rules:
+1. Push: puts something on the top of the stack
+2. Pop: takes item off stack and gives it to the caller
+3. Peek: hands copy of top item on the stack to caller
+4. isEmpty: checks if the stack size is zero
+where stacks generally store their data in a list, either an array or a singly linked list.
--- /dev/null
+:PROPERTIES:
+:ID: ab024db7-6903-48ee-98fc-b2a228709c04
+:ROAM_ALIASES: vector linear "linear space"
+:END:
+#+title: vector space
+#+author: Preston Pan
+#+html_head: <link rel="stylesheet" type="text/css" href="../style.css" />
+#+html_head: <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
+#+html_head: <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
+#+options: broken-links:t
+
+* Introduction
+A vector space $V$ is a set with addition and scalar multiplication defined. It obeys the following axioms:
+\begin{align}
+\label{}
+\vec{a} + (\vec{b} + \vec{c}) = (\vec{a} + \vec{b}) + \vec{c} \\
+\vec{a} + \vec{b} = \vec{b} + \vec{a} \\
+\exists \vec{0},\forall \vec{a}, \vec{a} + \vec{0} = \vec{a} \\
+\forall \vec{a},\exists\vec{-a}, \vec{a} + \vec{-a} = \vec{0} \\
+(cd)\vec{a} = c(d\vec{a}) \\
+1\vec{a} = \vec{a} \\
+c(\vec{a} + \vec{b}) = c\vec{a} + c\vec{b} \\
+(c + d)\vec{a} = c\vec{a} + d\vec{a}
+\end{align}
+
+vector spaces are an Abelian [[id:ba7b95b0-0ce6-4b33-9a79-5e5fddaea710][group]] under addition. $\vec{a}$, $\vec{b}$, and $\vec{c}$ are considered vectors so long as they fulfill these
+properties.
-webkit-columns: 2;
-moz-columns: 2;
}
+.theorem {
+display:block;
+margin-left:10px;
+margin-bottom:20px;
+font-style:normal;
+}
+.theorem:before{
+content:"Theorem.\00a0\00a0";
+float:left;
+font-weight:bold;
+}
+.proof{
+display:block;
+margin-left:10px;
+margin-bottom:30px;
+font-style:normal;
+}
+.proof:before{
+content:'Proof.\00a0\00a0';
+float:left;
+font-weight:bold;
+}
+.proof:after{
+content:"\25FC";
+float:right;
+}
/* On smaller screens, where height is less than 450px, change the style of the sidebar (less padding and a smaller font size) */
@media screen and (max-height: 450px) {
.sidenav {
--- /dev/null
+
+# -*- mode: snippet -*-
+# name: abs
+# key: abs
+# --
+| $1 | $0
--- /dev/null
+# -*- mode: snippet -*-
+# name: bra
+# key: bra
+# --
+\langle $1 | $0
--- /dev/null
+# -*- mode: snippet -*-
+# name: braket
+# key: braket
+# --
+\left\langle $2 \middle| $1 \right\rangle $0
\ No newline at end of file
--- /dev/null
+# -*- mode: snippet -*-
+# name: ket
+# key: ket
+# --
+| $1 \rangle $0
--- /dev/null
+# -*- mode: snippet -*-
+# name: norm
+# key: norm
+# --
+\lVert $1 \rVert $0
\ No newline at end of file
--- /dev/null
+# -*- mode: snippet -*-
+# name: date
+# key: date
+# --
+`(format-time-string "%Y-%m-%d")`$0
--- /dev/null
+# -*- mode: snippet -*-
+# name: namemain
+# key: namemain
+# --
+if __name__ == "__main__":
+ $0
\ No newline at end of file
--- /dev/null
+# -*- mode: snippet -*-
+# name: pclass
+# key: pclass
+# --
+
+class $1:
+ def __init__(self$2):
+ $0