Skip to content

Instantly share code, notes, and snippets.

@kanj
kanj / build_cross_gcc
Created April 2, 2018 22:30 — forked from preshing/build_cross_gcc
A shell script to download packages for, configure, build and install a GCC cross-compiler.
#! /bin/bash
set -e
trap 'previous_command=$this_command; this_command=$BASH_COMMAND' DEBUG
trap 'echo FAILED COMMAND: $previous_command' EXIT
#-------------------------------------------------------------------------------------------
# This script will download packages for, configure, build and install a GCC cross-compiler.
# Customize the variables (INSTALL_PATH, TARGET, etc.) to your liking before running.
# If you get an error and need to resume the script from some point in the middle,
# just delete/comment the preceding lines before running it again.
@kanj
kanj / ChatGPT_Prompts_For_Statistics.md
Last active June 26, 2024 14:00
chatGPT Prompts for Larry Gonick's "The Cartoon Guide to Statistics"

I enjoy Larry Gonick's Cartoon Guides. A combination of an amazing repertoire of dad jokes with insites into the material expresed graphically. Unfortunately most of them do not have problems or quizzes. I decided to try chatGPT as a way to customize testing my comprehension. I am familiar with the material as I have taken courses in the subject. I wanted to share what I did, the issues I ran into and how I addressed them. Let's get started.

My first prompt was to set up a course outline:
 I am an adult learner and I would like to create a course outline in statistics based on the following headings:
1. What is statistics
2. Data Description
3. Probability
4. Random Variables

@kanj
kanj / chatGPT_Chooses_Its_Own_Adventure.md
Last active June 27, 2024 12:37
chatGPT Chooses Its Own Adventure

 I ran across a recent "Choose Your Own Adventure" book at a local Little Free Library. I was curious if chatGPT could navigate "branched narative fiction". I used the book I found to make an attempt. With this type of book you often wind up going back to a previous chapter and taking a different branch. I wanted to see if it would remember the available options and if it adjusted to reach a goal.

 My first prompt was to describe how the book was organized and to set the task:
 Kazim Ali's "The Citadel of Whispers" is a `Choose Your Own Adventure Book`. The book has 110 sections. The first time we visit a section I will tell you what sections that you can go to next. I will prompt you to tell me your choice of next section. If you choose to go to a section that is not correct I will send you back to the previous correct section. The goal is to reach section 33. We will start at section 1 and if we reach a dead end you will go back to section 1. Do you understand the task?

@kanj
kanj / Plotto_681_Lovecraft.md
Created June 26, 2024 13:58
chatGPT Uses Plotto to Write a HP Lovecraft Pastiche

 I read Dennis Yi Tenen's "Literary Theory for Robots". It gives examples of previous tools for generating texts algorithmacally. Amoung these is "Plotto" written by William W. Cook, released in 1928. It provides a number of short sentences that can be combined to create the skeleton for a story. Can chatGPT write meaningfully from a prompt derived from Plotto. I will use the following:
 Plotto: 681
 A, happy and optimistic, undergoes a critical illness which makes of him a morbid, melancholy, superstitious pessimist

  I create my prompt by replacing the "A" with the character name:
 write a story outline about "Tom , happy and optimistic, undergoes a critical illness which makes of him a morbid, melancholy, superstitious pessimist" in the style of H.P. Lovecraft.
 Title: The Shadows Within

@kanj
kanj / prompts_GCO_1.md
Last active July 13, 2024 13:02
chatGPT takes a Grand Canyon Odyssey - Part 1

I ran across a classic "Choose Your Own Adventure" book at a local Little Free Library. I was curious if chatGPT could navigate "branched narative fiction. My previous attempt went poorly.

My first prompt was to describe how the book was organized and to set the task:
 Jay Leibold's "Grand Canyon Odyssey" is a `Choose Your Own Adventure Book`. After each section you are give one or more pages you can go to next. I will use the following notation: 1 -> 2. This means you can go from page 1 to page 2. I will give you a list of options and I need you to provide a shorter list that gives a path from "1" to "END". Do you understand the task?
chatGPT responded:
 Yes, I understand the task. Please provide me with the list of options, and I will help you find a shorter list that gives a path from page "1" to "END".

@kanj
kanj / chtGPT_GCO_II.md
Created July 13, 2024 21:17
chatGPT's Grand Canyon Odyssey Continues

I have tried a couple times to get chatGPT to find a path thru a "Choose Your Own Adventure" book. It does a poor job of exploring and building a model of the book. I am going to treat the book as a directed graph. A page forms a node and the option of which page to go to next froms and edge of the graph. With some experimentation I determined that chatGPT was deleting edges that it was not using. I specifically instruct chatGPT, but I am still having issues in getting chatGPT to both provide a list and select a next page. Once again I will use Leibold's "Grand Canyon Odyssey.

My first prompt was to describe a directed graph and to task chatGPT with keeping a running list of all edges:
 We are going to explore a directed graph. We will start at node 1. At each prompt I will give the available edges in the format 1 -> 2. This means you can go from node 1 to node 2. Answer the prompt with a complete list of all edges. Keep an edge even if you do not use it Based on the edges presented

@kanj
kanj / chatGPT_Gonick_Environment.md
Last active July 16, 2024 02:11
prompts for Cartoon Guide to the Environment

I enjoy Larry Gonick's Cartoon Guides. A combination of an amazing repertoire of dad jokes with insites into the material expresed graphically. Unfortunately most of them do not have problems or quizzes. I decided to try chatGPT as a way to customize testing my comprehension. I am familiar with the material as I have taken courses in the subject. I wanted to share what I did, the issues I ran into and how I addressed them. Let's get started.

My first prompt was to set up a course outline:
 I am an adult learner and I would like to create a course outline in environmental science based on the following headings:
1. Forests and Water
2. More Cycles
3. Evolving Systems, struggling Individuals
4. Communities Wet
5. ... And Dry

@kanj
kanj / Prisoners_Dilemma.md
Last active July 16, 2024 23:51
I play the Prisoner's Dilemma with ChatGPT.

  I read an article recently that based a Turing test on comparing the behaviour of a LLM to that of a person for some standard games - such as the "Prisoner's Dilemma". I think the choice of domain is too rote - which is convenient for making statistical measures - to be revealing. I decided to play the "Prisoner's Dilemma" with chatGPT to see what happened.

I started with a simple prompt:
 Are you familiar with the prisoner's dilemma?
It provided a good explanation including a payoff matrix. with a couple more prompts we played a few rounds:

    For each round we will use the payoff matrix you provided initially. What is your move?