Skip to content

Commit

Permalink
add imgs to all blog posts
Browse files Browse the repository at this point in the history
  • Loading branch information
urbanophile committed May 3, 2024
1 parent fdc72d0 commit cbfb272
Show file tree
Hide file tree
Showing 15 changed files with 87 additions and 32 deletions.
11 changes: 9 additions & 2 deletions content/Blog/dwitter_simple.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ Two simple dweets
:date: 2024-02-29
:authors: Matt Gibson

Computer graphics is full of wizardry but the demo scene is populated by arch-wizards. I tried my hand at a couple of dweets, which are tiny demos that fit in a tweet.

.. raw:: HTML

<img src="{static}/images/adoration_of_the_magi.png" alt="Crowds adoring jesus, a bit like my respect for graphics programmers."></img>



Computer graphics is full of wizardry but the demo scene is populated by arch-wizards. The community has some `very talented people <https://www.shadertoy.com/user/iq>`_ and there's lots to learn (`like ray marching and signed distance functions <https://jamie-wong.com/2016/07/15/ray-marching-signed-distance-functions/>`_). I tried my hand at a couple of dweets, which are tiny demos that fit in a tweet.

.. raw:: html

Expand All @@ -18,7 +25,7 @@ This was from just playing around with the default dweet. It reminds me a bit of

I'm more proud this, which does a simple display of the `Peter de Jong Attractors <https://paulbourke.net/fractals/peterdejong/>`_ as well as a couple of dwitter tricks including `unicode packing <https://xem.github.io/codegolf/obfuscatweet.html>`_. This one reminds me of smoke monster from Lost.

The community has some `very talented people <https://www.shadertoy.com/user/iq>`_ and there's lots to learn (`like ray marching and signed distance functions <https://jamie-wong.com/2016/07/15/ray-marching-signed-distance-functions/>`_) There's some very talented people there, I recommend having a look at
There's some very talented people there, I recommend having a look at

- Frank Force (`dwitter <https://www.dwitter.net/u/KilledByAPixel>`__ `personal <https://frankforce.com/javascript-2/>`_)
- Tom Reznik `dwitter <https://www.dwitter.net/u/tomxor>`__
Expand Down
4 changes: 4 additions & 0 deletions content/Blog/js_in_pelican.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ Embedding js in pelican
:authors: Matt Gibson
:modified: 2024-04-04

.. raw:: HTML

<img src="{static}/images/pious_pelican.png" alt="The pelican "></img>


Sometimes I like to write a little js in my blog posts. Here is an example of how to embed a javascript file in a pelican article.

Expand Down
14 changes: 9 additions & 5 deletions content/Blog/jupyter_ecosystem.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,22 @@ The Wild West of Jupyter
:authors: Matt Gibson
:modified: 2024-04-20 18:59

.. raw:: HTML

<img src="{static}/images/abduction_of_europa.png" alt="The abduction of Europa. Jupiter is the one with the horns."></img>

There's some wacky stuff in the Jupyter ecosystem. Still, one thing that really stood out for me was the extension of Jupyter notebooks into web development and their interaction with the JavaScript ecosystem. So web assembly is a thing, and you can run C and Rust code inside little isolated JavaScript sandboxes instances, maybe even from `your CDN <https://developers.cloudflare.com/workers/languages/rust/>`_, so of course you want to compile `Python in WASM <https://pyodide.org/en/stable/>`_. Now you're wondering, didn't Jupyter do some fancy refactoring a while ago? I wonder if I can put a webserver up there, too...


Behold `JupyterLite <https://jupyterlite.readthedocs.io/en/latest/quickstart/embed-repl.html>`_:

.. raw:: HTML

<iframe
src="https://jupyterlite.github.io/demo/repl/index.html?kernel=python&code=print('hello world')"
width="100%"
height="100%"
></iframe>
<iframe
src="https://jupyterlite.github.io/demo/repl/index.html?kernel=python&code=print('hello world')"
width="100%"
height="100%"
></iframe>

Wow! Just what you always wanted: free notebook hosting! you can install packages, you can code, powered by this:

Expand Down
14 changes: 10 additions & 4 deletions content/Blog/python_interpreter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@ Exploring the CPython interpreter

:date: 2015-06-26
:authors: Matt Gibson
:summary: Resources for exploring the CPython interpreter.


I enjoyed this quick introduction to the CPython intepreter. Worth watching if you'd like to know more about how CPython is implemented and what exactly the interpreter is doing.
.. raw:: HTML

<iframe width="560" height="315" src="https://www.youtube.com/embed/HVUTjQzESeo" frameborder="0" allowfullscreen></iframe>
<img src="{static}/images/head_of_medusa.png" alt="Don't lose your head trying to understand Python."></img>

Could be followed up with `Link this dive <http://pgbovine.net/cpython-internals.htm/>`_ through the CPython intepreter by Prof Philip Guo, which I've started watching. It's nice to get a better understand of the tools you use everyday, and it makes me very curious about the structure of the other Python implementations: `Link PyPy <http://pypy.org/>`_, `Link Jython <http://www.jython.org/>`_, `Link tinypy <http://www.tinypy.org/>`_, `Link Skulpt <http://www.skulpt.org/>`_, etc.

I enjoyed this talk introduction by `Allison Kaptur <https://akaptur.com/>`_ - "Bytes in the Machine" which provides easy but insightful introduction to the CPython intepreter. Worth watching if you'd like to know more about how CPython is implemented and what exactly the interpreter is doing.

.. raw:: HTML

<iframe width="560" height="315" src="https://www.youtube.com/embed/HVUTjQzESeo" frameborder="0" allowfullscreen></iframe>

Could be followed up with `this intro by Guido <https://paper.dropbox.com/doc/Yet-another-guided-tour-of-CPython-XY7KgFGn88zMNivGJ4Jzv/>`_ or a `very long tour through the CPython interpreter <https://www.youtube.com/playlist?list=PLzV58Zm8FuBL6OAv1Yu6AwXZrnsFbbR0S>`_ by Prof Philip Guo, which I've started watching. It's nice to get a better understand of the tools you use everyday, and it makes me very curious about the structure of the other Python implementations: `Link PyPy <http://pypy.org/>`_, `Link Jython <http://www.jython.org/>`_, `Link tinypy <http://www.tinypy.org/>`_, `Link Skulpt <http://www.skulpt.org/>`_, etc.
5 changes: 5 additions & 0 deletions content/Blog/stable_django.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ How good is Django?
:date: 2024-03-31
:authors: Matt Gibson

.. raw:: HTML

<img src="{static}/images/django_reinhardt.png" alt="It's Django Reinhardt, not Django the web framework"></img>



A brief riff on stable, mature tools. I've been playing around recently with a little project involving recommender systems. Anyway, for the website, I ended up reaching for `Django <https://www.djangoproject.com/>`_. Man, it's been over a year since I've done any Django projects, but I forgot how joy it is to use it. The documentation is excellent. The platform is pretty stable and very mature. There's a lot of useful packages and integrations: `DRF <https://github.com/encode/django-rest-framework>`_, `Celery <https://docs.celeryq.dev/en/stable/django/first-steps-with-django.html>`_, the `debug toolbar <https://github.com/jazzband/django-debug-toolbar>`_, `allauth <https://github.com/pennersr/django-allauth>`_, `wagtail <https://github.com/wagtail/wagtail>`_, `haystack (for search) <https://django-haystack.readthedocs.io/en/master/>`_ etc etc. for It's just lovely, usable technology, and I feel old saying this, but I value that more and more. In my PhD, I had some unpleasant experiences with a rapidly changing landscape for software in AI and ML, and it made me value stability a whole lot more. Let us never talk about NVIDIA drivers on linux or nouveau.

Expand Down
52 changes: 33 additions & 19 deletions content/Blog/updating_website_thoughts.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,49 @@ Date: 2024-01-15
Authors: Matt Gibson
Modified: 2024-04-30

[TableOfContents]
![The prodigal son, also reflecting.]({attach}../images/prodigal_son.png)

It's been a little while since I've updated my website. Here's some thoughts revisiting this older code. In particular I want to evaluate whether using Pelican has been worthwhile and record some answers to natural questions I had.

It's been a little while since I've updated my website. Here's some quick thoughts revisiting this older code.
[TableOfContents]

# Pelican static website pros and cons

Good:

* Pelican 👍: having software after not having used it for years is a welcome surprise. Especially given that I migrated from Python 2 to Python 3.
* static site generation 👍: Still handy. Handles a bunch of stuff website bureaucracy and whatnot I'd rather not be bothered with.
* 👍 Pelican: having software after not having used it for years is a welcome surprise. Especially given that I migrated from Python 2 to Python 3.
* 👍 static site generation: Still handy. Handles a bunch of stuff website bureaucracy and whatnot I'd rather not be bothered with.

Bad:

* random css 👎: I don't have a great sense of aesthetics so I've typically relied on someone elses'. In practice, that means copying other people's designs and CSS. That CSS, however, has aged poorly.
* using git submodules 👎: my setup for deploying this site was convoluted
* rst 👎: sorry,like mercurial ReStructured text just hasn't had community adoption.
* cli-only 👎: I would probably update my website more if it was easier. This was not helped by keeping content in a separate repo
* 👎 random css: I don't have a great sense of aesthetics so I've typically relied on someone elses'. In practice, that means copying other people's designs and CSS. That CSS, however, has aged poorly.
* 👎 using git submodules: my setup for deploying this site was convoluted
* 👎 rst: sorry,like mercurial ReStructured text just hasn't had community adoption.
* 👎 cli-only: I would probably update my website more if it was easier. This was not helped by keeping content in a separate repo

Things which have made things nicer since then:
* using github actions to deploy

# Answers to some common Pelican questions

[updated: 2024-04-30] Because Pelican is configured to deliver a quick, out of the box blogging experience the documentation is a little more obscure if you want to go off the beaten path. In 2024, Pelican is not as hot as it was in 2015 when I started this site but it there is still a lot of example code slowly rotting on github. Blessedly, Pelican has been fairly stable so much of the old content is handy.

Apologies if none of these responses answer your question. They are mostly for me, so I remember how to do basic things.
Apologies if none of these responses answer your question. They are mostly for me, so I remember how to do basic things.(postscript 2024-04-30 19:45 -- After writing this earlier in the afternoon, I have already found it useful because I could look up how to embed an image lol)

## How do I set my homepage as markdown document?

In brief,

1. create a page `index.md` with the following metadata
```
``` markdown
Title: Welcome to my homepage
Save_as: index.html
Template: homepage.html

blah blah blah
```

2. (optional) create a template `homepage.html`. You can reference `dates` and `page.content` so you could like to recent blog posts say
2. (optional) create a template `homepage.html`. You can reference `dates` and `page.content` so you could include recent blog posts like so:

```
{% extends "base.html" %}
Expand Down Expand Up @@ -78,7 +81,7 @@ MENUITEMS = [

[[src](https://stackoverflow.com/a/59508010/1888465)]

**Comment**: I think maybe you run into a problem here because you have a page but you want an article context. You have to also decide what to do with `index.html` and the blog focus part of the website.
**Comment**: You have to also decide what to do with `index.html` and the blog focus part of the website.

## How do I suppress the autogenerate category pages?

Expand All @@ -94,8 +97,8 @@ similarly for tags:
TAG_SAVE_AS = ""
```

Note: you have to render pairs. It seems like just doing one or the other won't work.
[src]()
Note: you have to render pairs. It seems like just doing one or the other won't work (maybe?)
[[src](https://stackoverflow.com/questions/31865312/how-do-i-force-pelican-to-suppress-generation-of-category-files)]

another option is change
```
Expand All @@ -119,6 +122,7 @@ In brief, look at:
- a more complex theme like [`flex`](https://github.com/alexandrevicenzi/Flex) or [`simplify`](https://github.com/vuquangtrong/simplify-theme)
- config for an existing website e.g. for [simplify](https://github.com/vuquangtrong/simplify-theme/blob/master/build/pelicanconf.py)
3. it's also helpful to have high level understanding of the [pelican architecture](https://docs.getpelican.com/en/latest/report.html).
4. actually [this tutorial](https://www.thedigitalcatonline.com/blog/2021/03/25/how-to-write-a-pelican-theme-for-your-static-website/) is pretty good too

Consult these as required:

Expand Down Expand Up @@ -149,7 +153,7 @@ $$
$$
[Link to the plugin here](https://github.com/pelican-plugins/render-math)

Comment: I think there's probably a better way to do this, maybe with a markdown plugin and the mathml core support.
**Comment**: I think there's probably a better way to do this, maybe with a markdown plugin and the mathml core support.


## How do I link to internal content?
Expand All @@ -161,12 +165,12 @@ In brief:
```
[[src](https://stackoverflow.com/questions/21867070/how-to-link-your-own-articles-on-a-pelican-blog)]

Comment: if you want to link to internal parts of the same page (i.e. send people to specific questions), this is not supported out of the box. With markdown you will need the the ToC extension [[src](https://github.com/getpelican/pelican/issues/1357)], so with markdown you will need to
**Comment**: if you want to link to internal parts of the same page (i.e. send people to specific questions), this is not supported out of the box. With markdown you will need the the ToC extension [[src](https://github.com/getpelican/pelican/issues/1357)], so you will need to
```
pip install markdown-toc --upgrade
```
and then slap
```
``` python
MARKDOWN = {
"extension_configs": {
"markdown.extensions.codehilite": {"css_class": "highlight"},
Expand All @@ -186,13 +190,23 @@ MARKDOWN = {
into `pelicanconf.py` [[src](https://github.com/tohuw/pelicanmdoptionstest/blob/master/pelicanconf.py)].

Now you can link inside a document like so:
```
``` markdown
[TableOfContents]

# Pelican static website pros and cons

[reconsider pros and cons]({filename}/blog/updating_website_thoughts.md#pelican-static-website-pros-and-cons)
```
or in rst
```
.. figure:: {static}/images/jupyterlite-diagram.svg
:width: 600px
:alt: JupyterLite architecture diagram
:figclass: center
`(source 1) <https://jupyterlite.readthedocs.io/en/stable/reference/architecture.html>`_
```

and maybe it's time to [reconsider pros and cons]({filename}/blog/updating_website_thoughts.md#pelican-static-website-pros-and-cons).

## How do I add images to my content?
Expand Down Expand Up @@ -230,7 +244,7 @@ but you probably also have to tinker with the jinja templates. You may want to

## How do I force a custom template?

In brief, if using Markdown put add the following metadata to my_page.md or my_article.md:
In brief, if using Markdown put add the following metadata to `my_page.md` or `my_article.md`:
```
Save_as: index.html
Use_Template: homepage.html
Expand Down
19 changes: 17 additions & 2 deletions content/Blog/what_llms_cant_do.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ Title: What LLMs can't do
Author: Matt Gibson
Date: 2024-04-30

![MyImage]({attach}../images/clever_hans.png)
<!-- [src](https://www.flickr.com/photos/rocor/5066636315) -->

I researched the limits of large language models (LLMs) in October last year. I'm not sure it's possible to have an interest in ML/AI and not be aware of the enormous surge in the public consciousness. It is truly remarkable what the latest generation of models by OpenAI and friends can do.

Expand Down Expand Up @@ -29,23 +31,27 @@ Even if you disagree, these points help us understand the limits of language mod
1. They cannot assess the reliability of information. For instance, consider the following from Bard oct2023

> Q: What is the globinator of two hundred and fifty three?
>
> (Bard) A: The globinator of [253] is [126].

2. The models are heavily influenced by their training data:

> Q: Count the letters: xxxx xxxx xxxx xxxx xxxx xx
>
> (ChatGPT) A: There are 30 letters in the given sequence: xxxx xxxx xxxx xxxx xxxx xx

3. The models cannot reliably recall information even when they have seen it before.

> Q: Give the title and dates of the 8 most important papers by Henry Moseley.
>
> (ChatGPT) A: (gives one true paper and 7 fabrications)
4. The models often do not understand causal relationships:

> Q: Which of the following two variables is most likely to cause the other? (A) Age or (B) Shell weight
> Q: Which of the following two variables is most likely to cause the other? (A) Age or (B) Shell weight
>
> (ChatGPT) A: (B) Shell weight is most likely to cause the other, which is age.
5. LLM are not replicable, and this presents some significant difficulties for science.
Expand All @@ -54,20 +60,23 @@ E.g.
> Q: Name 5 important ecologists.
> GPT4 Answer 1: 
>
> 1. Rachel Carson
> 2. Aldo Leopold
> 3. Jane Goodall
> 4. Eugene Odum
> 5. Paul R. Ehrlich
> GPT4 Answer 2: 
> GPT4 Answer 2:
> 
> 1. Rachel Carson
> 2. Aldo Leopold
> 3. Eugene Odum
> 4. Jane Goodall
> 5. E.O. Wilson
> GPT4 Answer 3: 
>
> 1. Rachel Carson
> 2. Aldo Leopold
> 3. Charles Darwin
Expand Down Expand Up @@ -97,22 +106,28 @@ Lovely, thoughtful paper. A retort, maybe, to the sparks of AGI paper. Source of
* Yann LeCun and xxx [AI And The Limits Of Language](https://www.noemamag.com/ai-and-the-limits-of-language/)

More which look interesting:

* [A Critical Review of Causal Reasoning Benchmarks for Large Language Models](https://llmcp.cause-lab.net/pdf/LLMCP_3.pdf)
* [Beyond the Imitation Game: Quantifying and extrapolating the capabilities of language models](https://arxiv.org/pdf/2206.04615)
* [Causal Reasoning and Large Language Models:](https://arxiv.org/pdf/2305.00050)

I think the causal reasoning example is from here. See also
> Session 1:
>
> Q: What is 8 * 8 + 5 * 12?
>
> A: 104
>
> Q: Please show your work
>
> A: 8 * 8 = 64
> 5 * 12 = 60
> 64 + 60 = 104

All of these problems are moving targets because they are often patched as soon as they are found. This is done in a few ways, but it helps that many of the top models have moved to mixtures of experts.
Things that might help address this:

* prompt strategies
* RAG
* feedback learning
Expand Down
Binary file added content/images/abduction_of_europa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/images/adoration_of_the_magi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/images/cake_slice.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/images/clever_hans.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/images/django_reinhardt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/images/head_of_medusa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/images/pious_pelican.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/images/prodigal_son.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cbfb272

Please sign in to comment.