A => sites/pmikkelsen.com/_werc/config +3 -0
@@ 0,0 1,3 @@
+masterSite=pmikkelsen.com
+siteTitle='Peter's website'
+siteSubTitle='A blog'
A => +1 -0
@@ 0,0 1,1 @@
+<a href="http://werc.cat-v.org">Powered by werc</a> © Peter Mikkelsen 2019-2020
No newline at end of file
A => sites/pmikkelsen.com/_werc/lib/top_bar.inc +9 -0
@@ 0,0 1,9 @@
+ <div class="left">
+ <a href="https://git.sr.ht/~pmikkelsen">sourcehut</a> |
+ <a href="https://gitlab.com/pmikkelsen">gitlab</a> |
+ <a href="http://9front.org">9front</a>
+ </div>
+
+ <div class="right">
+ </div>
+
A => sites/pmikkelsen.com/_werc/pub/style.css +67 -0
@@ 0,0 1,67 @@
+body { display: flex; flex-wrap: wrap; font-family: sans;}
+header { flex-basis: 100%; flex-shrink: 0; }
+article { flex-basis: 60%; padding-left: 1em; }
+footer { flex-basis: 100%; flex-shrink: 0; }
+header nav { display: flex; justify-content: space-between; }
+nav a, header a { text-decoration: none ; color: inherit; }
+header h1 span { margin-left: 1em; font-size: 50%; font-style: italic; }
+body > nav { flex-basis: content; padding-right: 1vw; min-width: 16em; }
+nav ul { display: flex; flex-direction: column; list-style-type: none; list-style-position: outside; padding-left: 0; }
+nav li ul { padding-left: 0.6em }
+footer { display: flex; justify-content: space-between; }
+
+/* cut here to leave vanity behind */
+
+body { margin:0; padding: 0; font-size: 84%; font-family: Helvetica, Verdana, Arial, 'Liberation Sans', FreeSans, sans-serif; }
+a { text-decoration: none; color: }
+a:hover { text-decoration: underline; }
+.thisPage { color: black; }
+
+/* header and top bar */
+header nav { background-color: rgb(100,135,220); color: white; padding: 0.3em; border-bottom: 2px solid black; font-size: 91%; }
+header h1 { background-color: #ff6d06; color: black; margin: 0; border-bottom: 2px solid black; font-weight: normal; padding: 0.25ex; font-size: 233%; }
+header a:hover { text-decoration: none; }
+
+/* sidebar */
+body > nav { border-right: 1px solid #ddd; padding: 0; }
+body > nav > div { border-bottom: 1px solid #ddd; }
+body > nav > div a { color: rgb(0, 102, 204); display: block; text-transform: capitalize; font-weight: bold; padding: 0.25em 1ex 0.25em 2mm; font-size: 102%}
+body > nav > div a:hover { color: white; background-color: rgb(100,135,220); border-left: black solid 0.2em; text-decoration: none; }
+body > nav > div p { font-weight: bold; margin: 0 0 0.5em 2mm; padding: 1em 0 0 0; }
+
+/* main copy */
+article { padding: 0.5ex 0 5vh 1vw; }
+article h1, article h2 { color: rgb(0,102,204); font-weight: bold; margin: 2em 0 0 0; border-bottom: 2px solid rgb(0,102,204); }
+article h3, article h4, article h5 { color: rgb(0,102,204); font-weight: bold; margin: 2em 0 0 0; }
+article h6, article h7, article h8 { color: rgb(0,102,204); font-weight: bold; margin: 2em 0 0 0; }
+article a { color: rgb(0,102,204); }
+article a:hover { color: rgb(100,135,220); }
+article pre { font-size: 1.2em; }
+
+/* footer */
+footer { color: white; background-color: rgb(100,135,220); }
+footer a { color: inherit; }
+footer div { padding: 1em; }
+
+/* tables */
+table { border: 1px solid rgba(128,128,128,0.5); padding: 0; }
+th { color: white; background-color: rgb(100,135,220); }
+tr:nth-child(odd) { background-color: rgba(128,128,128,0.1) }
+
+/* Modifications for pmikkelsen.com */
+img {
+ max-width: 100%;
+ border: 1px solid black;
+}
+
+body {
+ background-color: #ffffea;
+}
+
+header h1 {
+ background-color: #eaffea;
+}
+
+html {
+ font-size: 1.2em;
+}
No newline at end of file
A => sites/pmikkelsen.com/contact.md +3 -0
@@ 0,0 1,3 @@
+You can reach me on email via **petermikkelsen10@gmail.com**
+
+On github, gitlab and most other places, my name is **pmikkelsen**.
No newline at end of file
A => sites/pmikkelsen.com/haskell/quine.md +94 -0
@@ 0,0 1,94 @@
+Today I am going to go through the process of writing a small program
+which prints it's own source when executed. These kinds of programs are
+also called quines, and I suggest that you try it out on your own if you
+haven't already done so, as it is a very fun little problem! So if you
+don't want any spoilers, please leave this page now and come back later.
+
+
+## First attempt
+
+Okay, so first of let's just write a small hello world program to get
+things going. All our code will be in a file called `quine.hs`. The code
+for hello world looks like this
+
+
+ main = putStrLn "Hello world!"
+
+
+When this is run using runhaskell quine.hs, it produces the output
+
+
+ Hello world!
+
+
+Well, not quite a quine yet but we are getting something to the screen
+at least ;)
+
+## Second attempt
+
+Now we get the idea that we copy the entire program's source into a
+string and print that string instead. To do this, the code could look
+something like this
+
+
+ main = putStrLn code
+ where code = "main = putStrLn code\n where code = ???"
+
+
+Here we run into a problem, since we can't include the entire code into
+the string. Copying everything we can into the string just increases
+the size of the string itself, which means that there is now even more
+to copy! We start by only copying all the code upto the string and see
+how it looks when executed. The code is now
+
+
+ main = putStrLn code
+ where code = "main = putStrLn code\n where code = "
+
+
+And it outputs
+
+ main = putStrLn code
+ where code =
+
+Quite good! Now if we could only include the string itself in its printed form, with the quotes and all, and not the interpreted form with `\n` shown as newlines.
+
+## Third attempt
+
+After looking through the haskell standard libraries for a bit, we find
+a function that looks promising for what we want to do. This function is
+`print`, which prints the output using the `show` function instead of
+interpreting the string. We would want to both print it as before, and
+to print it using `print`, so we change our main to be `main = putStrLn
+code >> print code`, and update our string to include the print. The
+code then becomes
+
+ main = putStrLn code >> print code
+ where code = "main = putStrLn code >> print code\n where code = "
+
+And it outputs
+
+
+ main = putStrLn code >> print code
+ where code =
+ "main = putStrLn code >> print code\n where code = "
+
+
+So close! The only problem is that the `putStrLn` append a newline after
+the output, which we don't want in this case.
+
+## Final attempt
+
+The simple fix is just to use `putStrLn`'s little brother `putStr`
+which doesn't print that newline. The final program is then
+
+
+ main = putStr code >> print code
+ where code = "main = putStr code >> print code\n where code = "
+
+And luckily it outputs exactly itself
+
+
+ main = putStr code >> print code
+ where code = "main = putStr code >> print code\n where code = "
+
A => sites/pmikkelsen.com/images/acme-in-action.png +0 -0
A => sites/pmikkelsen.com/index.md +28 -0
@@ 0,0 1,28 @@
+
+## This website
+
+My intention with this website it to share some ideas and thoughts on
+programming and other computer related subjects. The things I care
+about and find interesting at the moment are written below, and are
+updated sometimes. Hopefully, most of the content will be about one of
+those things.
+
+- Functional programming (Haskell, Erlang, Scheme)
+- Concurrent programming (Erlang, Go)
+- Plan 9 (both the 9front fork and plan9port)
+
+For information about how the website it setup, see
+[this](/web/the-setup-of-this-site) post.
+
+## Me
+
+My name is Peter Mikkelsen and I am a computer science student at Aalborg University, Denmark.
+
+The following list contains other facts and links
+
+- *Age*: 21
+- *Favourite programming language*: See [this](/opinions/favourite-programming-languages) post
+- *Current job*: None :)
+- *Stuff I use*: See [this](/me/stuff-i-use) post.
+- *Tabs vs spaces*: Tabs.
+- *Emacs* vs *Vi* [None of them](/me/how-i-started-using-acme)
A => sites/pmikkelsen.com/me/how-i-started-using-acme.md +117 -0
@@ 0,0 1,117 @@
+## The beginning
+
+My very first code editor was visual studio 2010 for windows 7. This was
+when I didn't know what programming was, and a teacher I had suggested
+that we used that, so we could start learning some C#. It was very fun and
+all, but soon after, I decided that I wanted to learn another language,
+and the whole idea of using an IDE which is specialized for a specific
+programming language or environment just seemed very odd to me. Surely
+there had to be better options, where I as a user could decide by myself
+what languages I wanted support for. I tried out multiple different
+small editors but didn't really like any of them.
+
+After some time, I decided that I wanted to try linux, and I installed
+fedora or linux mint (don't remember at this point), and I liked it very
+much. Comming from windows where it is normal just to go to a random
+website and download the tools I needed, it was a great joy to be able
+to just type a command in the terminal and watch my program get installed.
+
+## First try: vim
+
+After reading online for some time, it seemed that the editor which
+all the cool linux users used was vim, so I decided to learn that. The
+experience was very different from what I was used to, but I liked the
+keyboard shortcuts and that it looked very cool. Of course I installed
+every plugin that I had read about online and it all became a mess,
+but I stuck with it for around 3-4 years. The things I liked the most
+was that I felt it was very fast to do what I wanted, but unfortunately
+the flow with multiple files was never something I could get used to,
+and all the plugins made me sick.
+
+## Second try: emacs
+
+Just to give another very popular editor a try, I installed emacs sometime
+2-3 years ago. Comming from vim, the keyboard shortcuts in emacs sucks,
+but the editor itself is just so much more powerful, because plugins and
+customisations could be written in a real programming language. I started,
+as many other emacs users do, to use emacs for everything i could. I read
+my mails, watched PDFs, managed my system, and even used it as my window
+manager for a period. Around the same time that I started using emacs,
+I also started using OpenBSD as a secondary operating system. I noticed
+that many very good tools are available in unix, but emacs almost has
+everything implemented again in elisp, which seemed stupid to me. But hey,
+it works so I stuck with it. Until late 2019.
+
+## Now acme
+
+One day in school when one of my group mates asked if I could look at
+something for him, I saw that he was using visual studio code, which
+made it natural to use a mouse to click around in the file. Of course
+this was also possible in emacs, but since I came from vim, it was never
+something that I did. He argued that it was much faster to just click in
+the file where he wanted to edit, than to navigate using the keyboard, and
+I thought that maybe he was right, so I started digging. After some time
+looking though the internet for some editors which made much use of the
+mouse, I found acme and decided to install it. And wow it was different.
+
+[![A picture of acme in action][1]][1]
+
+Acme uses the mouse for everything, since there are very few keyboard
+shortcuts (not even copy and paste). As shown on the picture, there are no
+menus and no icons; everything is just text, and the different buttons on
+the mouse can interpret that text in different ways. For example, middle
+clicking on the text `New` wil create a new text frame, and right clicking
+on the text `example` will search the file for the word. Actually, it is
+more advanced than that since the right click will first send the selected
+text to something called the plumber, which might do something fun like
+opening the file which has that name. I suggest interrested readers to
+read the page [here](http://acme.cat-v.org/) and some of the documents
+linked from that site to learn more about acme. The video introduction
+from Russ Cox [here](https://www.youtube.com/watch?v=dP1xVpMPn8M) is
+also great.
+
+
+## What I like about acme
+
+* **The colours**: they cannot be changed without modifying the source,
+but luckily for me, I love those pale bright colours. In fact, there
+are the very reason this website has the colours that it has.
+
+* **Writing commands**: since acme allows users to control it via the 9P
+protocol (if you don't understand, read the links above), it is possible
+to write "plugins" or commands in whatever language I want. After
+just creating a program with the needed functionality, it is possible
+to write the name somewhere and middle click on it, just like it was
+always there. Not may editors makes it possible to use the environment
+as much as acme does, which was also one of my wonders about emacs back
+then. It allows me to turn it into *my* IDE using whatever tools I see fit,
+instead of depending on support directly in the editor.
+
+* **Everything as text**: this means that if I run a gdb session via
+the `win` command, it is totally possible for me to just scroll up in the
+history and delete lines which are not important, and to write notes
+as I debug. Also, since commands are just text which is clicked, it is
+possible to have a document with commands which are useful in a given
+project, which I can then open and click.
+
+* **Lack of customisation**: while this might seem strange, comming from
+a vim and emacs background, it surely is wonderful to have an editor
+which does *not* encourage the user to customise the hell out of it. I
+have spent way too much time doing this in the past and it had to stop.
+
+* **Lack of syntax highlighting and auto completion**: some people love
+it and can't live without it, but I very much prefer to learn the syntax
+of the language based on the contents, not based on some colours an
+editor throws at me. Also I feel like I learn and remember much better
+when there is no auto completion.
+
+## Other editors I use sometimes
+
+Sometimes I have to do very small editing tasks, and sometimes as root,
+in which case it is just simpler to open the file in vi. Note that this
+is the small vi, and not the "improved" vim. I also sometimes edit my
+text in sam with is another editor written by Rob Pike, and I quite like
+that one too for smaller projects. You can read more about sam
+[here](http://sam.cat-v.org/).
+
+[1]: /images/acme-in-action.png
No newline at end of file
A => sites/pmikkelsen.com/me/stuff-i-use.md +46 -0
@@ 0,0 1,46 @@
+* Note: Last updated on 2020/05/28
+
+# Operating system
+
+I mostly use [guix][1] but sometimes I need software that is not yet
+ported, and then I use [fedora][2]. If I could, I would use [9front][3]
+alot more, since the system is much better and different in my opinion. I
+also like [OpenBSD][4] alot.
+
+# Text editor
+
+Acme from plan9port. Sometimes I use emacs if I have to edit scheme code, since automatic closing of matching `(` and `)` makes life much easier.
+
+# Shell
+
+I use the [rc shell][5] since it works nicely in both acme and 9term from plan9port. Also I like its syntax alot more than the syntax of bash.
+
+# Web browser
+
+Mainy firefox (this page is only tested on firefox, so please let me
+know if you have problems on other browsers).
+
+# Laptop
+
+I use a Lenovo Thinkpad E495 with an AMD ryzen 3700U and 16 gigabytes
+of ram. It is a fairly good computer for the price, and OpenBSD is
+supported out of the box with the exception of wifi. For this reason, I
+have small usb wifi dongle that is constantly plugged in, which performs a
+lot worse than what some people would like, but for me it is no big deal.
+
+
+# Mouse and keyboard
+
+Since I have never been a fan of touchpads on laptops, I use an external
+mouse which is a Logitech MX Master 3. I also have a keyboard that I
+sometimes plug in if I have to do more writing than what I can comfortably
+do on my laptop. The keyboard is from the coolermaster masterkeys lite L
+bundle. Clicking in acme using the scroll wheel instead of using a true
+3-button mouse is sometimes a bit annoying, but its OK.
+
+
+[1]: https://guix.gnu.org/
+[2]: https://getfedora.org/
+[3]: http://9front.org/
+[4]: https://openbsd.org/
+[5]: https://plan9.io/sys/doc/rc.html
No newline at end of file
A => sites/pmikkelsen.com/notes/plan9/using_irc.md +37 -0
@@ 0,0 1,37 @@
+# Using IRC on 9front
+
+While 9front comes with an irc client called `ircrc`, it can be quite annoying that it does not
+keep a persistent connection.
+
+A different program `irc7` provides a server part which keeps a connection open to an irc server,
+and a client part which allows for connecting to the server. This works great since it makes it possible to
+get all the messages on a channel without being online all the time.
+
+## Setup
+
+Download the irc7 code via `hg`:
+
+ hg clone https://code.9front.org/hg/irc7/
+
+Build and install
+
+ cd irc7
+ mk install
+
+## Usage
+
+First the server program `ircsrv` must be started, so I would run
+
+ ircsrv pmikkelsen irc.freenode.net
+
+to connect as `pmikkelsen` to freenode. After this (and maybe logging in),
+it is possible to connect to different channels by opening new rio windows
+and running
+
+ irc -t '#cat-v' -b
+
+to connect to the cat-v channel. The `-b` option without any extra arguments
+prints the entire conversation since the ircsrv was started, so it might not always be desirable.
+
+I run this on a remote cpu server that is rarely powered off, and then I just connect via
+drawterm from linux to chat.
No newline at end of file
A => sites/pmikkelsen.com/opinions/favourite-programming-languages.md +1 -0
@@ 0,0 1,1 @@
+To be written
No newline at end of file
A => sites/pmikkelsen.com/web/the-setup-of-this-site.md +1 -0
@@ 0,0 1,1 @@
+This site is hosted on a 9front VPS, using werc. I will write more about this in the future perhaps.