Homepage

Welcome to my homepage where I write about all kinds of things.

Kinds of knowledge

What is it and why is it important? The knowledge of how to ride a bicyle is clearly different to the fact that two plus two equals four, or the fact that when I feel hungry I usually have a meal. We can categorise this into Declarative knowledge Knowledge that relates to facts such as the days of the week, the price of a pair of shoes and the colour of fresh cow’s milk....

The relationship between arousal and performance

What is it and why is it important? Ok. Before I continue I want to ask you to get your mind out of the gutter, arousal does not always refer to sexual arousal. Like affect, which is the standard term psychology academics use to describe emotion, arousal is a term used to describe level of excitement - which may happen to be sexual in nature but more often than not simply relates to attentiveness or lack thereof....

Development of decision log software (proposal)

What is it and why is it important? MY guiding phisolophy has always been, as far as is humanly possible, to ensure clarity of thought so to enable confidence the decisions which are a product of that thought and a confidence that action arising out of those decisions are highly probably to lead to a net advantage. With the development of local-running LLMs, it is of interest to analyse decision-related data to study not just the decisions and their outcomes but events, the environment and the context of things preceding such decisions....

The plant sceletium tortuosum

What is it and why is it important? Alternate names for this plant are “kanna” and “kougoed” (things to chew on). It is a plant used in traditional Khoi-San medicine and is said to alleviate feelings of anxiety and hunger. Some have reported mild cognitive enhancement (likely an effect of lowered anxiety) and others have reported on its psychedelic properties, although no scientific evidence of psychedelic nor addictive properties have been found in numerous studies concerning this plant....

Using acme.sh and hosting multiple domains

There are several websites I am running off this domain. One of the best utility applications I am running is called ntfy.sh, which I’ve written about here before. My setup is I have the ntfy application running as a standalone application listening on its own port, and using the reverse proxy feature on nginx any traffic coming into notifications.notlocalhost.dev gets redirected to that local port. One of the problems with this approach is that it redirects everything, including the verification request my certificate provider (through acme....

2025-02-27 213 words 1 min

Integrating VisJs with Angular 18

Let’s look at how to integrate the javascript graph visualisation library with Angular 18.x Introduction A graph is a data structure commonly used in computer science. The easiest way to think about it is as a data type you use to store cities and roads which connect them. In this case roads are known as edges, and cities are known as nodes. An edge may be directed meaning it can only go in one direction, and it may be weighted which in the case of connected cities the weight of an edge might represent the distance between the two connected cities....

Seeking participants for a research study

This is an invitation to participate in a research project Thank you reaching my page. I am looking for research participants to be interviewed for the purposes of a mini-thesis to complete my honours degree in Industrial Psychology through the University of South Africa. It is a qualitative study and will be conducted via face to face semi-structured interviews held over video conference software (Microsoft Teams). What is the research about?...

2024-08-15 373 words 2 min

Implementing JWT authentication and authorization in FastAPI

Let’s look at how to implement authentication and authorization in FastAPI. I’m going to assume you use VS Code or an IDE that’s capable of automatically resolving the required imports. There’s already a page in the FastAPIdocumentation about authentication but I’m going to extend that information to show you how to add authorization using JWT where your roles sit in a database. And it’s going to be so easy. When we’re all done we’ll be protecting routes like this @router....

Upload a file to a FastAPI route

Let’s look at how to upload a file to a FastAPI route. It’s going to be easy! For my app I need the Angular front-end to upload a PDF document to the FastAPI route defined at @router.post("/", tags=["Documents"], response_model=schemas.IdResult) @security.authorize(roles='admin,system,user') async def upload_pdf(data:schemas.DocumentForm = Depends(schemas.DocumentForm.as_form), db: Session = Depends(get_db), token_data:TokenData=Depends(security.get_token_data)): #some code removed thistd = uuid.uuid1(0,0).hex file_contents = data.pdf_file.file.read() base_folder = os.path.join(Config.BASE_FILES_DIRECTORY, thistd) os.makedirs(base_folder) file_name = f"{os.path.join(base_folder,thistd)}.pdf" with open(file_name,'wb') as f: f....

Webscraping using Python

So there’s this website where they sell limited amounts of something at a very good price. Someone gave me a hint that something is going to be sold there that’s worth a lot of money on the open market, and since all the items on the website are priced according to class we know what this object will sell for. The only problem is that manually checking the site might take too long and we might miss the boat....