Unnamed: 0
int64
0
0
repo_id
stringlengths
5
186
file_path
stringlengths
15
223
content
stringlengths
1
32.8M
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/hash-map
repos/exploratory-tech-studio/tech-studio-projects/data-structures/hash-map/cpp/HM.cpp
#include "HM.h" HashMapList::HashMapList() { for (std::size_t i = 0; i < TABLE_SIZE; ++i) { table[i] = nullptr; } } HashMapList::~HashMapList() { for (std::size_t i = 0; i < TABLE_SIZE; ++i) { Node* current = table[i]; while (current) { Node* next = current->next; delete current; current = next; } } } std::size_t HashMapList::hash(int key) const { return key % TABLE_SIZE; } void HashMapList::insert(int key, int value) { std::size_t index = hash(key); Node* newNode = new Node(key, value); newNode->next = table[index]; table[index] = newNode; } int HashMapList::get(int key) const { std::size_t index = hash(key); Node* current = table[index]; while (current) { if (current->key == key) { return current->value; } current = current->next; } return -1; // Not found } bool HashMapList::remove(int key) { std::size_t index = hash(key); Node* current = table[index]; Node* prev = nullptr; while (current) { if (current->key == key) { if (prev) { prev->next = current->next; } else { table[index] = current->next; } delete current; return true; } prev = current; current = current->next; } return false; // Not found } void HashMapList::display() const { for (std::size_t i = 0; i < TABLE_SIZE; ++i) { std::cout << "[" << i << "]: "; Node* current = table[i]; while (current) { std::cout << "(" << current->key << ", " << current->value << ") "; current = current->next; } std::cout << std::endl; } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/double-linked-list
repos/exploratory-tech-studio/tech-studio-projects/data-structures/double-linked-list/java/Album.java
package com.company; import java.util.ArrayList; import java.util.LinkedList; public class Album { private String name; private String artist; private ArrayList<Song> songs; public Album(String name, String artist) { this.name = name; this.artist = artist; this.songs = new ArrayList<Song>(); } public boolean addSong(String title, double duration) { if(findSong(title) == null) { this.songs.add(new Song(title, duration)); return true; } return false; } private Song findSong(String title) { for(Song checkedSong: this.songs) { if(checkedSong.getTitle().equals(title)) { return checkedSong; } } return null; } public boolean addToPlayList(int trackNumber, LinkedList<Song> playList) { int index = trackNumber -1; if((index >0) && (index <= this.songs.size())) { playList.add(this.songs.get(index)); return true; } System.out.println("This album does not have a track " + trackNumber); return false; } public boolean addToPlayList(String title, LinkedList<Song> playList) { Song checkedSong = findSong(title); if(checkedSong != null) { playList.add(checkedSong); return true; } System.out.println("The song " + title + " is not in this album"); return false; } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/double-linked-list
repos/exploratory-tech-studio/tech-studio-projects/data-structures/double-linked-list/java/Main.java
package com.company; import java.util.*; public class Main { private static ArrayList<Album> albums = new ArrayList<Album>(); public static void main(String[] args) { // Create a program that implements a playlist for songs // Create a Song class having Title and Duration for a song. // The program will have an Album class containing a list of songs. // The albums will be stored in an ArrayList // Songs from different albums can be added to the playlist and will appear in the list in the order // they are added. // Once the songs have been added to the playlist, create a menu of options to:- // Quit,Skip forward to the next song, skip backwards to a previous song. Replay the current song. // List the songs in the playlist // A song must exist in an album before it can be added to the playlist (so you can only play songs that // you own). // Hint: To replay a song, consider what happened when we went back and forth from a city before we // started tracking the direction we were going. // As an optional extra, provide an option to remove the current song from the playlist // (hint: listiterator.remove() Album album = new Album("Stormbringer", "Deep Purple"); album.addSong("Stormbringer", 4.6); album.addSong("Love don't mean a thing", 4.22); album.addSong("Holy man", 4.3); album.addSong("Hold on", 5.6); album.addSong("Lady double dealer", 3.21); album.addSong("You can't do it right", 6.23); album.addSong("High ball shooter", 4.27); album.addSong("The gypsy", 4.2); album.addSong("Soldier of fortune", 3.13); albums.add(album); album = new Album("For those about to rock", "AC/DC"); album.addSong("For those about to rock", 5.44); album.addSong("I put the finger on you", 3.25); album.addSong("Lets go", 3.45); album.addSong("Inject the venom", 3.33); album.addSong("Snowballed", 4.51); album.addSong("Evil walks", 3.45); album.addSong("C.O.D.", 5.25); album.addSong("Breaking the rules", 5.32); album.addSong("Night of the long knives", 5.12); albums.add(album); LinkedList<Song> playList = new LinkedList<Song>(); albums.get(0).addToPlayList("You can't do it right", playList); albums.get(0).addToPlayList("Holy man", playList); albums.get(0).addToPlayList("Speed king", playList); // Does not exist albums.get(0).addToPlayList(9, playList); albums.get(1).addToPlayList(8, playList); albums.get(1).addToPlayList(3, playList); albums.get(1).addToPlayList(2, playList); albums.get(1).addToPlayList(24, playList); // There is no track 24 play(playList); } private static void play(LinkedList<Song> playList) { Scanner scanner = new Scanner(System.in); boolean quit = false; boolean forward = true; ListIterator<Song> listIterator = playList.listIterator(); if(playList.size() == 0) { System.out.println("No songs in playlist"); return; } else { System.out.println("Now playing " + listIterator.next().toString()); printMenu(); } while(!quit) { int action = scanner.nextInt(); scanner.nextLine(); switch(action) { case 0: System.out.println("Playlist complete."); quit = true; break; case 1: if(!forward) { if(listIterator.hasNext()) { listIterator.next(); } forward = true; } if(listIterator.hasNext()) { System.out.println("Now playing " + listIterator.next().toString()); } else { System.out.println("We have reached the end of the playlist"); forward = false; } break; case 2: if(forward) { if(listIterator.hasPrevious()) { listIterator.previous(); } forward = false; } if(listIterator.hasPrevious()) { System.out.println("Now playing " + listIterator.previous().toString()); } else { System.out.println("We are at the start of the playlist"); forward = true; } break; case 3: if(forward) { if(listIterator.hasPrevious()) { System.out.println("Now replaying " + listIterator.previous().toString()); forward = false; } else { System.out.println("We are at the start of the list"); } } else { if(listIterator.hasNext()) { System.out.println("Now replaying " + listIterator.next().toString()); forward = true; } else { System.out.println("We have reached the end of the list"); } } break; case 4: printList(playList); break; case 5: printMenu(); break; case 6: if(playList.size() >0) { listIterator.remove(); if(listIterator.hasNext()) { System.out.println("Now playing " + listIterator.next()); } else if(listIterator.hasPrevious()) { System.out.println("Now playing " + listIterator.previous()); } } break; } } } private static void printMenu() { System.out.println("Available actions:\npress"); System.out.println("0 - to quit\n" + "1 - to play next song\n" + "2 - to play previous song\n" + "3 - to replay the current song\n" + "4 - list songs in the playlist\n" + "5 - print available actions.\n" + "6 - delete current song from playlist"); } private static void printList(LinkedList<Song> playList) { Iterator<Song> iterator = playList.iterator(); System.out.println("================================"); while(iterator.hasNext()) { System.out.println(iterator.next()); } System.out.println("================================"); } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/double-linked-list
repos/exploratory-tech-studio/tech-studio-projects/data-structures/double-linked-list/java/Song.java
package com.company; public class Song { private String title; private double duration; public Song(String title, double duration) { this.title = title; this.duration = duration; } public String getTitle() { return title; } @Override public String toString() { return this.title + ": " + this.duration; } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/double-linked-list
repos/exploratory-tech-studio/tech-studio-projects/data-structures/double-linked-list/cpp/DoubleLinkedList.h
#ifndef DOUBLY_LINKED_LIST_H #define DOUBLY_LINKED_LIST_H #include <cstddef> class DoublyLinkedList { public: DoublyLinkedList(); ~DoublyLinkedList(); void insertFront(int data); void insertBack(int data); void removeFront(); void removeBack(); bool isEmpty() const; void display() const; private: struct Node { int data; Node* prev; Node* next; Node(int val) : data(val), prev(nullptr), next(nullptr) {} }; Node* head; Node* tail; }; #endif // DOUBLY_LINKED_LIST_H
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/double-linked-list
repos/exploratory-tech-studio/tech-studio-projects/data-structures/double-linked-list/cpp/DoubleLinkedList.cpp
#include "DoubleLinkedList.h" #include <iostream> DoublyLinkedList::DoublyLinkedList() : head(nullptr), tail(nullptr) {} DoublyLinkedList::~DoublyLinkedList() { while (!isEmpty()) { removeFront(); } } void DoublyLinkedList::insertFront(int data) { Node* newNode = new Node(data); if (isEmpty()) { head = tail = newNode; } else { newNode->next = head; head->prev = newNode; head = newNode; } } void DoublyLinkedList::insertBack(int data) { Node* newNode = new Node(data); if (isEmpty()) { head = tail = newNode; } else { tail->next = newNode; newNode->prev = tail; tail = newNode; } } void DoublyLinkedList::removeFront() { if (isEmpty()) { return; } Node* temp = head; if (head == tail) { head = tail = nullptr; } else { head = head->next; head->prev = nullptr; } delete temp; } void DoublyLinkedList::removeBack() { if (isEmpty()) { return; } Node* temp = tail; if (head == tail) { head = tail = nullptr; } else { tail = tail->prev; tail->next = nullptr; } delete temp; } bool DoublyLinkedList::isEmpty() const { return head == nullptr; } void DoublyLinkedList::display() const { Node* current = head; while (current != nullptr) { std::cout << current->data << " "; current = current->next; } std::cout << std::endl; }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/double-linked-list
repos/exploratory-tech-studio/tech-studio-projects/data-structures/double-linked-list/cpp/main.cpp
#include <iostream> #include "DoubleLinkedList.h" int main() { DoublyLinkedList list; std::cout << "Inserting elements at the front..." << std::endl; list.insertFront(1); list.insertFront(2); list.insertFront(3); list.display(); // Output: 3 2 1 std::cout << "Inserting elements at the back..." << std::endl; list.insertBack(4); list.insertBack(5); list.insertBack(6); list.display(); // Output: 3 2 1 4 5 6 std::cout << "Removing elements from the front..." << std::endl; list.removeFront(); list.removeFront(); list.display(); // Output: 1 4 5 6 std::cout << "Removing elements from the back..." << std::endl; list.removeBack(); list.removeBack(); list.display(); // Output: 1 return 0; }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/single_linked-list
repos/exploratory-tech-studio/tech-studio-projects/data-structures/single_linked-list/java/Album.java
package com.company; import java.util.ArrayList; import java.util.LinkedList; public class Album { private String name; private String artist; private ArrayList<Song> songs; public Album(String name, String artist) { this.name = name; this.artist = artist; this.songs = new ArrayList<Song>(); } public boolean addSong(String title, double duration) { if(findSong(title) == null) { this.songs.add(new Song(title, duration)); return true; } return false; } private Song findSong(String title) { for(Song checkedSong: this.songs) { if(checkedSong.getTitle().equals(title)) { return checkedSong; } } return null; } public boolean addToPlayList(int trackNumber, LinkedList<Song> playList) { int index = trackNumber -1; if((index >0) && (index <= this.songs.size())) { playList.add(this.songs.get(index)); return true; } System.out.println("This album does not have a track " + trackNumber); return false; } public boolean addToPlayList(String title, LinkedList<Song> playList) { Song checkedSong = findSong(title); if(checkedSong != null) { playList.add(checkedSong); return true; } System.out.println("The song " + title + " is not in this album"); return false; } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/single_linked-list
repos/exploratory-tech-studio/tech-studio-projects/data-structures/single_linked-list/java/Main.java
package com.company; import java.util.*; public class Main { private static ArrayList<Album> albums = new ArrayList<Album>(); public static void main(String[] args) { // Create a program that implements a playlist for songs // Create a Song class having Title and Duration for a song. // The program will have an Album class containing a list of songs. // The albums will be stored in an ArrayList // Songs from different albums can be added to the playlist and will appear in the list in the order // they are added. // Once the songs have been added to the playlist, create a menu of options to:- // Quit,Skip forward to the next song, skip backwards to a previous song. Replay the current song. // List the songs in the playlist // A song must exist in an album before it can be added to the playlist (so you can only play songs that // you own). // Hint: To replay a song, consider what happened when we went back and forth from a city before we // started tracking the direction we were going. // As an optional extra, provide an option to remove the current song from the playlist // (hint: listiterator.remove() Album album = new Album("Stormbringer", "Deep Purple"); album.addSong("Stormbringer", 4.6); album.addSong("Love don't mean a thing", 4.22); album.addSong("Holy man", 4.3); album.addSong("Hold on", 5.6); album.addSong("Lady double dealer", 3.21); album.addSong("You can't do it right", 6.23); album.addSong("High ball shooter", 4.27); album.addSong("The gypsy", 4.2); album.addSong("Soldier of fortune", 3.13); albums.add(album); album = new Album("For those about to rock", "AC/DC"); album.addSong("For those about to rock", 5.44); album.addSong("I put the finger on you", 3.25); album.addSong("Lets go", 3.45); album.addSong("Inject the venom", 3.33); album.addSong("Snowballed", 4.51); album.addSong("Evil walks", 3.45); album.addSong("C.O.D.", 5.25); album.addSong("Breaking the rules", 5.32); album.addSong("Night of the long knives", 5.12); albums.add(album); LinkedList<Song> playList = new LinkedList<Song>(); albums.get(0).addToPlayList("You can't do it right", playList); albums.get(0).addToPlayList("Holy man", playList); albums.get(0).addToPlayList("Speed king", playList); // Does not exist albums.get(0).addToPlayList(9, playList); albums.get(1).addToPlayList(8, playList); albums.get(1).addToPlayList(3, playList); albums.get(1).addToPlayList(2, playList); albums.get(1).addToPlayList(24, playList); // There is no track 24 play(playList); } private static void play(LinkedList<Song> playList) { Scanner scanner = new Scanner(System.in); boolean quit = false; boolean forward = true; ListIterator<Song> listIterator = playList.listIterator(); if(playList.size() == 0) { System.out.println("No songs in playlist"); return; } else { System.out.println("Now playing " + listIterator.next().toString()); printMenu(); } while(!quit) { int action = scanner.nextInt(); scanner.nextLine(); switch(action) { case 0: System.out.println("Playlist complete."); quit = true; break; case 1: if(!forward) { if(listIterator.hasNext()) { listIterator.next(); } forward = true; } if(listIterator.hasNext()) { System.out.println("Now playing " + listIterator.next().toString()); } else { System.out.println("We have reached the end of the playlist"); forward = false; } break; case 2: if(forward) { if(listIterator.hasPrevious()) { listIterator.previous(); } forward = false; } if(listIterator.hasPrevious()) { System.out.println("Now playing " + listIterator.previous().toString()); } else { System.out.println("We are at the start of the playlist"); forward = true; } break; case 3: if(forward) { if(listIterator.hasPrevious()) { System.out.println("Now replaying " + listIterator.previous().toString()); forward = false; } else { System.out.println("We are at the start of the list"); } } else { if(listIterator.hasNext()) { System.out.println("Now replaying " + listIterator.next().toString()); forward = true; } else { System.out.println("We have reached the end of the list"); } } break; case 4: printList(playList); break; case 5: printMenu(); break; case 6: if(playList.size() >0) { listIterator.remove(); if(listIterator.hasNext()) { System.out.println("Now playing " + listIterator.next()); } else if(listIterator.hasPrevious()) { System.out.println("Now playing " + listIterator.previous()); } } break; } } } private static void printMenu() { System.out.println("Available actions:\npress"); System.out.println("0 - to quit\n" + "1 - to play next song\n" + "2 - to play previous song\n" + "3 - to replay the current song\n" + "4 - list songs in the playlist\n" + "5 - print available actions.\n" + "6 - delete current song from playlist"); } private static void printList(LinkedList<Song> playList) { Iterator<Song> iterator = playList.iterator(); System.out.println("================================"); while(iterator.hasNext()) { System.out.println(iterator.next()); } System.out.println("================================"); } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/single_linked-list
repos/exploratory-tech-studio/tech-studio-projects/data-structures/single_linked-list/java/Song.java
package com.company; public class Song { private String title; private double duration; public Song(String title, double duration) { this.title = title; this.duration = duration; } public String getTitle() { return title; } @Override public String toString() { return this.title + ": " + this.duration; } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/single_linked-list
repos/exploratory-tech-studio/tech-studio-projects/data-structures/single_linked-list/cpp/singleLinkedList.cpp
#include "SingleLInkedList.h" Node::Node(int value) : data(value), next(nullptr) {} LinkedList::LinkedList() : head(nullptr) {} LinkedList::~LinkedList() { Node* curr = head; while (curr != nullptr) { Node* next = curr->next; delete curr; curr = next; } } void LinkedList::insert(int value) { Node* newNode = new Node(value); newNode->next = head; head = newNode; } bool LinkedList::remove(int value) { if (head == nullptr) return false; // Empty list if (head->data == value) { // If the value to remove is in the head Node* temp = head; head = head->next; delete temp; return true; } Node* curr = head; while (curr->next != nullptr && curr->next->data != value) { curr = curr->next; } if (curr->next == nullptr) return false; // Value not found Node* temp = curr->next; curr->next = curr->next->next; delete temp; return true; } bool LinkedList::contains(int value) const { Node* curr = head; while (curr != nullptr) { if (curr->data == value) return true; curr = curr->next; } return false; } void LinkedList::display() const { Node* curr = head; while (curr != nullptr) { std::cout << curr->data << " "; curr = curr->next; } std::cout << std::endl; }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/single_linked-list
repos/exploratory-tech-studio/tech-studio-projects/data-structures/single_linked-list/cpp/SingleLinkedList.h
#ifndef LINKED_LIST_H #define LINKED_LIST_H #include <iostream> /** * @brief Node class representing a node in the linked list. */ class Node { public: int data; Node* next; Node(int value); }; /** * @brief LinkedList class representing a single linked list. */ class LinkedList { private: Node* head; public: LinkedList(); ~LinkedList(); void insert(int value); // Insert a value into the linked list bool remove(int value); // Remove a value from the linked list bool contains(int value) const; // Check if the linked list contains a value void display() const; // Display the elements of the linked list }; #endif // LINKED_LIST_H
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/single_linked-list
repos/exploratory-tech-studio/tech-studio-projects/data-structures/single_linked-list/cpp/main.cpp
#include <iostream> #include "SingleLinkedList.h" int main() { LinkedList list; // Insert elements into the linked list list.insert(10); list.insert(20); list.insert(15); // Display the linked list std::cout << "Linked List after insertion: "; list.display(); // Remove an element from the linked list list.remove(20); // Display the linked list after removal std::cout << "Linked List after removal: "; list.display(); // Check if the linked list contains a value std::cout << "Linked List contains 15: " << std::boolalpha << list.contains(15) << std::endl; std::cout << "Linked List contains 25: " << std::boolalpha << list.contains(25) << std::endl; return 0; }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/dynamic-array
repos/exploratory-tech-studio/tech-studio-projects/data-structures/dynamic-array/java/DynamicArrayList.java
public class DynamicArrayList { private int[] array; private int capacity; private int length; public DynamicArrayList() { capacity = 10; array = new int[capacity]; length = 0; } private void resize(int newCapacity) { int[] newArray = new int[newCapacity]; System.arraycopy(array, 0, newArray, 0, length); array = newArray; capacity = newCapacity; } public void append(int value) { if (length == capacity) { resize(capacity * 2); } array[length++] = value; } public void insert(int index, int value) { if (index > length || index < 0) { throw new IndexOutOfBoundsException("Index out of range"); } if (length == capacity) { resize(capacity * 2); } System.arraycopy(array, index, array, index + 1, length - index); array[index] = value; length++; } public void remove(int index) { if (index >= length || index < 0) { throw new IndexOutOfBoundsException("Index out of range"); } System.arraycopy(array, index + 1, array, index, length - index - 1); length--; if (length > 0 && length == capacity / 4) { resize(capacity / 2); } } public int get(int index) { if (index >= length || index < 0) { throw new IndexOutOfBoundsException("Index out of range"); } return array[index]; } public int size() { return length; } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/dynamic-array
repos/exploratory-tech-studio/tech-studio-projects/data-structures/dynamic-array/java/Main.java
public class Main { public static void main(String[] args) { DynamicArrayList list = new DynamicArrayList(); // Append elements list.append(1); list.append(2); list.append(3); list.append(4); // Insert element at index 2 list.insert(2, 5); // Remove element at index 1 list.remove(1); // Display list contents System.out.println("List contents:"); for (int i = 0; i < list.size(); i++) { System.out.print(list.get(i) + " "); } System.out.println(); } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/dynamic-array
repos/exploratory-tech-studio/tech-studio-projects/data-structures/dynamic-array/cpp/DynamicArray.h
#ifndef DYNAMIC_ARRAY_LIST_H #define DYNAMIC_ARRAY_LIST_H #include <cstddef> class DynamicArrayList { public: DynamicArrayList(); ~DynamicArrayList(); void append(int data); void insert(int index, int data); void remove(int index); int get(int index) const; std::size_t size() const; bool isEmpty() const; private: int* array; std::size_t capacity; std::size_t length; void resize(std::size_t newCapacity); }; #endif // DYNAMIC_ARRAY_LIST_H
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/dynamic-array
repos/exploratory-tech-studio/tech-studio-projects/data-structures/dynamic-array/cpp/main.cpp
#include <iostream> #include "DynamicArray.h" int main() { DynamicArrayList list; // Append elements list.append(1); list.append(2); list.append(3); list.append(4); // Insert element at index 2 list.insert(2, 5); // Remove element at index 1 list.remove(1); // Display list contents std::cout << "List contents:" << std::endl; for (std::size_t i = 0; i < list.size(); ++i) { std::cout << list.get(i) << " "; } std::cout << std::endl; return 0; }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/dynamic-array
repos/exploratory-tech-studio/tech-studio-projects/data-structures/dynamic-array/cpp/dynamicArray.cpp
#include "DynamicArray.h" DynamicArrayList::DynamicArrayList() : array(nullptr), capacity(0), length(0) {} DynamicArrayList::~DynamicArrayList() { delete[] array; } void DynamicArrayList::append(int data) { if (length == capacity) { resize(capacity == 0 ? 1 : capacity * 2); } array[length++] = data; } void DynamicArrayList::insert(int index, int data) { if (index < 0 || index > length) { return; // Invalid index } if (length == capacity) { resize(capacity == 0 ? 1 : capacity * 2); } for (std::size_t i = length; i > index; --i) { array[i] = array[i - 1]; } array[index] = data; ++length; } void DynamicArrayList::remove(int index) { if (index < 0 || index >= length) { return; // Invalid index } for (std::size_t i = index; i < length - 1; ++i) { array[i] = array[i + 1]; } --length; } int DynamicArrayList::get(int index) const { if (index < 0 || index >= length) { return -1; // Invalid index } return array[index]; } std::size_t DynamicArrayList::size() const { return length; } bool DynamicArrayList::isEmpty() const { return length == 0; } void DynamicArrayList::resize(std::size_t newCapacity) { int* newArray = new int[newCapacity]; for (std::size_t i = 0; i < length; ++i) { newArray[i] = array[i]; } delete[] array; array = newArray; capacity = newCapacity; }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/suffix-array
repos/exploratory-tech-studio/tech-studio-projects/data-structures/suffix-array/java/SuffixArray.java
import java.util.Arrays; public class SuffixArray { private final String text; private final int[] suffixArray; public SuffixArray(String text) { this.text = text; this.suffixArray = new int[text.length()]; } public void constructSuffixArray() { Suffix[] suffixes = new Suffix[text.length()]; for (int i = 0; i < text.length(); i++) { suffixes[i] = new Suffix(i, text.substring(i)); } Arrays.sort(suffixes); for (int i = 0; i < text.length(); i++) { suffixArray[i] = suffixes[i].index; } } public void displaySuffixArray() { for (int index : suffixArray) { System.out.print(index + " "); } System.out.println(); } private static class Suffix implements Comparable<Suffix> { int index; String suffix; Suffix(int index, String suffix) { this.index = index; this.suffix = suffix; } @Override public int compareTo(Suffix other) { return this.suffix.compareTo(other.suffix); } } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/suffix-array
repos/exploratory-tech-studio/tech-studio-projects/data-structures/suffix-array/java/Main.java
public class Main { public static void main(String[] args) { String text = "banana"; SuffixArray suffixArray = new SuffixArray(text); // Construct the suffix array suffixArray.constructSuffixArray(); // Display the suffix array System.out.print("Suffix Array: "); suffixArray.displaySuffixArray(); } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/suffix-array
repos/exploratory-tech-studio/tech-studio-projects/data-structures/suffix-array/cpp/SuffixArray.h
#ifndef SUFFIXARRAY_H #define SUFFIXARRAY_H #include <string> #include <vector> /** * @brief SuffixArray class representing a suffix array data structure. */ class SuffixArray { private: std::string text; std::vector<int> suffixArray; public: SuffixArray(const std::string& text); void constructSuffixArray(); void displaySuffixArray() const; }; #endif // SUFFIXARRAY_H
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/suffix-array
repos/exploratory-tech-studio/tech-studio-projects/data-structures/suffix-array/cpp/main.cpp
#include <iostream> #include "SuffixArray.h" int main() { std::string text = "banana"; SuffixArray suffixArray(text); // Construct the suffix array suffixArray.constructSuffixArray(); // Display the suffix array std::cout << "Suffix Array: "; suffixArray.displaySuffixArray(); return 0; }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/suffix-array
repos/exploratory-tech-studio/tech-studio-projects/data-structures/suffix-array/cpp/suffixArray.cpp
#include "SuffixArray.h" #include <algorithm> SuffixArray::SuffixArray(const std::string& text) : text(text) {} void SuffixArray::constructSuffixArray() { // Generate suffixes of the text int n = text.length(); std::vector<std::pair<std::string, int>> suffixes; for (int i = 0; i < n; i++) { suffixes.emplace_back(text.substr(i), i); } // Sort the suffixes lexicographically std::sort(suffixes.begin(), suffixes.end()); // Populate the suffix array with the sorted suffix indices suffixArray.resize(n); for (int i = 0; i < n; i++) { suffixArray[i] = suffixes[i].second; } } void SuffixArray::displaySuffixArray() const { // Display the suffix array for (int i : suffixArray) { std::cout << i << " "; } std::cout << std::endl; }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/polymorphism/Main.java
class Movie { private String name; public Movie(String name) { this.name = name; } public String plot() { return "No plot here"; } public String getName() { return name; } } class Jaws extends Movie { public Jaws() { super("Jaws"); } public String plot() { return "A shark eats lots of people"; } } class IndependenceDay extends Movie { public IndependenceDay() { super("Independence Day"); } @Override public String plot() { return "Aliens attempt to take over planet earth"; } } class MazeRunner extends Movie { public MazeRunner() { super("Maze Runner"); } @Override public String plot() { return "Kids try and escape a maze"; } } class StarWars extends Movie { public StarWars() { super("Star Wars"); } @Override public String plot() { return "Imperial Forces try to take over the universe"; } } class Forgetable extends Movie { public Forgetable() { super("Forgetable"); } // No plot method } public class Main { public static void main(String[] args) { for(int i=1; i<11; i++) { Movie movie = randomMovie(); System.out.println("Movie #" + i + " : " + movie.getName() + "\n" + "Plot: " + movie.plot() + "\n"); } } public static Movie randomMovie() { int randomNumber = (int) (Math.random() * 5) +1; System.out.println("Random number generated was: " + randomNumber); switch (randomNumber) { case 1: return new Jaws(); case 2: return new IndependenceDay(); case 3: return new MazeRunner(); case 4: return new StarWars(); case 5: return new Forgetable(); } return null; } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/abstract/ListItem.java
package com.company; public abstract class ListItem { protected ListItem rightLink = null; protected ListItem leftLink = null; protected Object value; public ListItem(Object value) { this.value = value; } abstract ListItem next(); abstract ListItem setNext(ListItem item); abstract ListItem previous(); abstract ListItem setPrevious(ListItem item); abstract int compareTo(ListItem item); public Object getValue() { return value; } public void setValue(Object value) { this.value = value; } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/abstract/NodeList.java
package com.company; public interface NodeList { ListItem getRoot(); boolean addItem(ListItem item); boolean removeItem(ListItem item); void traverse(ListItem root); }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/abstract/SearchTree.java
package com.company; public class SearchTree implements NodeList { private ListItem root = null; public SearchTree(ListItem root) { this.root = root; } @Override public ListItem getRoot() { return this.root; } @Override public boolean addItem(ListItem newItem) { if (this.root == null) { // the tree was empty, so our item becomes the head of the tree this.root = newItem; return true; } // otherwise, start comparing from the head of the tree ListItem currentItem = this.root; while (currentItem != null) { int comparison = (currentItem.compareTo(newItem)); if (comparison < 0) { // newItem is greater, move right if possible if (currentItem.next() != null) { currentItem = currentItem.next(); } else { // there's no node to the right, so add at this point currentItem.setNext(newItem); return true; } } else if (comparison > 0) { // newItem is less, move left if possible if (currentItem.previous() != null) { currentItem = currentItem.previous(); } else { // there's no node to the left, so add at this point currentItem.setPrevious(newItem); return true; } } else { // equal, so don't add System.out.println(newItem.getValue() + " is already present"); return false; } } // we can't actually get here, but Java complains if there's no return return false; } @Override public boolean removeItem(ListItem item) { if (item != null) { System.out.println("Deleting item " + item.getValue()); } ListItem currentItem = this.root; ListItem parentItem = currentItem; while (currentItem != null) { int comparison = (currentItem.compareTo(item)); if (comparison < 0) { parentItem = currentItem; currentItem = currentItem.next(); } else if (comparison > 0) { parentItem = currentItem; currentItem = currentItem.previous(); } else { // equal: we've found the item so remove it performRemoval(currentItem, parentItem); return true; } } return false; } private void performRemoval(ListItem item, ListItem parent) { // remove item from the tree if (item.next() == null) { // no right tree, so make parent point to left tree (which may be null) if (parent.next() == item) { // item is right child of its parent parent.setNext(item.previous()); } else if (parent.previous() == item) { // item is left child of its parent parent.setPrevious(item.previous()); } else { // parent must be item, which means we were looking at the root of the tree this.root = item.previous(); } } else if (item.previous() == null) { // no left tree, so make parent point to right tree (which may be null) if (parent.next() == item) { // item is right child of its parent parent.setNext(item.next()); } else if (parent.previous() == item) { // item is left child of its parent parent.setPrevious(item.next()); } else { // again, we are deleting the root this.root = item.next(); } } else { // neither left nor right are null, deletion is now a lot trickier! // From the right sub-tree, find the smallest value (i.e., the leftmost). ListItem current = item.next(); ListItem leftmostParent = item; while (current.previous() != null) { leftmostParent = current; current = current.previous(); } // Now put the smallest value into our node to be deleted item.setValue(current.getValue()); // and delete the smallest if (leftmostParent == item) { // there was no leftmost node, so 'current' points to the smallest // node (the one that must now be deleted). item.setNext(current.next()); } else { // set the smallest node's parent to point to // the smallest node's right child (which may be null). leftmostParent.setPrevious(current.next()); } } } @Override public void traverse(ListItem root) { // recursive method if (root != null) { traverse(root.previous()); System.out.println(root.getValue()); traverse(root.next()); } } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/abstract/Main.java
package com.company; public class Main { public static void main(String[] args) { // For this challenge, create an abstract class to define items that can be stored in a tree. // The class should contain 2 references to items which will represent the next and previous // items (in the case of a linked tree). // I.e., if you call your abstract class ListItem, then it would have 2 member variables of // type ListItem that will hold references to the next/right and previous/left ListItems. // // The abstract class will also need to hold a value - try to be as flexible as possible // when defining the type of this value. // // The class will also need methods to move to the next item and back to the previous item, // and methods to set the next and previous items. // // You should also specify a compareTo() method that takes a parameter of the same type as the // class and returns 0 if the values are equal, greater than zero if the value sorts greater than // the parameter and less than zero if it sorts less than the parameter. // // Create a concrete class from your abstract tree item class and use this in a LinkedList // class to implement a linked tree that will add items in order (so that they are sorted // alphabetically). Duplicate values are not added. // // Note that you are creating your own LinkedList class here, not using the built-in Java one.. // // The rules for adding an item to the linked tree are: // If the head of the tree is null, make the head refer to the item to be added. // If the item to be added is less than the current item in the tree, add the item before the // current item (i.e., make the previous item's "next" refer to the new item, and the new item's // "next" refer to the current item). // If the item to be added is greater than the current item, move onto the next item and compare // again (if there is no next item then that is where the new item belongs). // // Care will be needed when inserting before the first item in the tree (as it will not have a previous // item). // // You will also need a method to remove an item from the tree. // // Hint: If you are creating classes with names such as List, LinkedList, Node etc, make sure that // you create your classes before referring to them. In previous videos we have often referred to // classes that we create later, but if you use names that IntelliJ recognises as Java classes (such // as LinkedList) then it will create imports for them and possibly cause you problems later. // // Optional: create a class to use your concrete class to implement a Binary Search Tree: // When adding items to a Binary Search Tree, if the item to be added is less than the current item // then move to the left, if it is greater than the current item then move to the right. // // The new item is added when an attempt to move in the required direction would involve following a // null reference. // Once again, duplicates are not allowed. // // Hint: to avoid typing loads of "addItem" lines, split a string into an array and create your tree in // a loop as in the example below. // SearchTree tree = new SearchTree(null); tree.traverse(tree.getRoot()); // Create a string data array to avoid typing loads of addItem instructions: String stringData = "5 7 3 9 8 2 1 0 4 6"; // String stringData = "Darwin Brisbane Perth Melbourne Canberra Adelaide Sydney Canberra"; String[] data = stringData.split(" "); for (String s : data) { tree.addItem(new Node(s)); } tree.traverse(tree.getRoot()); tree.removeItem(new Node("3")); tree.traverse(tree.getRoot()); tree.removeItem(new Node("5")); tree.traverse(tree.getRoot()); tree.removeItem(new Node("0")); tree.removeItem(new Node("4")); tree.removeItem(new Node("2")); tree.traverse(tree.getRoot()); tree.removeItem(new Node("9")); tree.traverse(tree.getRoot()); tree.removeItem(new Node("8")); tree.traverse(tree.getRoot()); tree.removeItem(new Node("6")); tree.traverse(tree.getRoot()); tree.removeItem(tree.getRoot()); tree.traverse(tree.getRoot()); tree.removeItem(tree.getRoot()); tree.traverse(tree.getRoot()); } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/abstract/Node.java
package com.company; public class Node extends ListItem { public Node(Object value) { super(value); } @Override ListItem next() { return this.rightLink; } @Override ListItem setNext(ListItem item) { this.rightLink = item; return this.rightLink; } @Override ListItem previous() { return this.leftLink; } @Override ListItem setPrevious(ListItem item) { this.leftLink = item; return this.leftLink; } @Override int compareTo(ListItem item) { if(item != null) { return ((String) super.getValue()).compareTo((String) item.getValue()); } else { return -1; } } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/abstract/MyLinkedList.java
package com.company; public class MyLinkedList implements NodeList { private ListItem root = null; public MyLinkedList(ListItem root) { this.root = root; } @Override public ListItem getRoot() { return this.root; } @Override public boolean addItem(ListItem newItem) { if (this.root == null) { // The list was empty, so this item becomes the head of the list this.root = newItem; return true; } ListItem currentItem = this.root; while (currentItem != null) { int comparison = (currentItem.compareTo(newItem)); if (comparison < 0) { // newItem is greater, move right if possible if (currentItem.next() != null) { currentItem = currentItem.next(); } else { // there is no next, so insert at end of list currentItem.setNext(newItem).setPrevious(currentItem); return true; } } else if (comparison > 0) { // newItem is less, insert before if (currentItem.previous() != null) { currentItem.previous().setNext(newItem).setPrevious(currentItem.previous()); newItem.setNext(currentItem).setPrevious(newItem); } else { // the node with a previous is the root newItem.setNext(this.root).setPrevious(newItem); this.root = newItem; } return true; } else { // equal System.out.println(newItem.getValue() + " is already present, not added."); return false; } } return false; } @Override public boolean removeItem(ListItem item) { if (item != null) { System.out.println("Deleting item " + item.getValue()); } ListItem currentItem = this.root; while (currentItem != null) { int comparison = currentItem.compareTo(item); if (comparison == 0) { // found the item to delete if (currentItem == this.root) { this.root = currentItem.next(); } else { currentItem.previous().setNext(currentItem.next()); if (currentItem.next() != null) { currentItem.next().setPrevious(currentItem.previous()); } } return true; } else if (comparison < 0) { currentItem = currentItem.next(); } else { // comparison > 0 // We are at an item greater than the one to be deleted // so the item is not in the list return false; } } // We have reached the end of the list // Without finding the item to delete return false; } @Override public void traverse(ListItem root) { if (root == null) { System.out.println("The list is empty"); } else { while (root != null) { System.out.println(root.getValue()); root = root.next(); } } } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/scope/Main.java
package com.company; import java.util.Scanner; public class Main { public static void main(String[] args) { // Write a small program to read an integer from the keyboard // (using Scanner) and print out the times table for that number. // The table should run from 1 to 12. // // You are allowed to use one variable called scanner for your // Scanner instance. You can use as many other variables as you // need, but they must must all be called x. That includes any // class instances and loop control variables that you may decide // to use. // // If you use a class, the class can be called X (capital), but // any instances of it must be called x (lower case). // // Any methods you create must also be called x. // // Optional Extra: // Change your program so that ALL variables (including the scanner // instance) are called x. X x = new X(new Scanner(System.in)); x.x(); } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/scope/X.java
package com.company; import java.util.Scanner; public class X { private int x; public X(Scanner x) { System.out.println("Please enter a number: "); this.x = x.nextInt(); } public void x() { for(int x = 1; x < 13; x++) { System.out.println(x + " times " + this.x + " equals " + x * this.x); } } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/encapsulation/Player.java
public class Player { public String fullName; public int health; public String weapon; public void loseHealth(int damage) { this.health = this.health - damage; if(this.health <=0) { System.out.println("Player knocked out"); // Reduce number of lives remaining for the player } } public int healthRemaining() { return this.health; } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/encapsulation/Main.java
public class Main { public static void main(String[] args) { Player player = new Player(); player.fullName = "Tim Musterman"; player.health = 20; player.weapon = "Sword"; int damage = 10; player.loseHealth(damage); System.out.println("Remaining health = " + player.healthRemaining()); damage = 11; player.health = 200; player.loseHealth(damage); System.out.println("Remaining health = " + player.healthRemaining()); EnhancedPlayer playerOne = new EnhancedPlayer("Tim", 200, "Sword"); System.out.println("Initial health is " + playerOne.getHealth()); } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/encapsulation/EnhancedPlayer.java
public class EnhancedPlayer { private String name; private int hitPoints = 100; private String weapon; public EnhancedPlayer(String name, int health, String weapon) { this.name = name; if(health >0 && health <= 100) { this.hitPoints = health; } this.weapon = weapon; } public void loseHealth(int damage) { this.hitPoints = this.hitPoints - damage; if(this.hitPoints <=0) { System.out.println("Player knocked out"); // Reduce number of lives remaining for the player } } public int getHealth() { return hitPoints; } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/immutable-class/Location.java
import java.util.HashMap; import java.util.Map; public class Location { private final int locationID; private final String description; private final Map<String, Integer> exits; public Location(int locationID, String description, Map<String, Integer> exits) { this.locationID = locationID; this.description = description; this.exits = new HashMap<String, Integer>(exits); this.exits.put("Q", 0); } // public void addExit(String direction, int location) { // exits.put(direction, location); // } public int getLocationID() { return locationID; } public String getDescription() { return description; } public Map<String, Integer> getExits() { return new HashMap<String, Integer>(exits); } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/immutable-class/Main.java
import java.util.HashMap; import java.util.Map; import java.util.Scanner; public class Main { private static Map<Integer, Location> locations = new HashMap<Integer, Location>(); public static void main(String[] args) { // Change the program to allow players to type full words, or phrases, then move to the // correct location based upon their input. // The player should be able to type commands such as "Go West", "run South", or just "East" // and the program will move to the appropriate location if there is one. As at present, an // attempt to move in an invalid direction should print a message and remain in the same place. // // Single letter commands (N, W, S, E, Q) should still be available. Scanner scanner = new Scanner(System.in); Map<String, Integer> tempExit = new HashMap<String, Integer>(); locations.put(0, new Location(0, "You are sitting in front of a computer learning Java",tempExit)); tempExit = new HashMap<String, Integer>(); tempExit.put("W", 2); tempExit.put("E", 3); tempExit.put("S", 4); tempExit.put("N", 5); locations.put(1, new Location(1, "You are standing at the end of a road before a small brick building",tempExit)); tempExit = new HashMap<String, Integer>(); tempExit.put("N", 5); locations.put(2, new Location(2, "You are at the top of a hill",tempExit)); tempExit = new HashMap<String, Integer>(); tempExit.put("W", 1); locations.put(3, new Location(3, "You are inside a building, a well house for a small spring",tempExit)); tempExit = new HashMap<String, Integer>(); tempExit.put("N", 1); tempExit.put("W", 2); locations.put(4, new Location(4, "You are in a valley beside a stream",tempExit)); tempExit = new HashMap<String, Integer>(); tempExit.put("S", 1); tempExit.put("W", 2); locations.put(5, new Location(5, "You are in the forest",tempExit)); Map<String, String> vocabulary = new HashMap<String, String>(); vocabulary.put("QUIT", "Q"); vocabulary.put("NORTH", "N"); vocabulary.put("SOUTH", "S"); vocabulary.put("WEST", "W"); vocabulary.put("EAST", "E"); int loc = 1; while(true) { System.out.println(locations.get(loc).getDescription()); tempExit.remove("S"); if(loc == 0) { break; } Map<String, Integer> exits = locations.get(loc).getExits(); System.out.print("Available exits are "); for(String exit: exits.keySet()) { System.out.print(exit + ", "); } System.out.println(); String direction = scanner.nextLine().toUpperCase(); if(direction.length() > 1) { String[] words = direction.split(" "); for(String word: words) { if(vocabulary.containsKey(word)) { direction = vocabulary.get(word); break; } } } if(exits.containsKey(direction)) { loc = exits.get(direction); } else { System.out.println("You cannot go in that direction"); } } } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/inner-class/Album.java
package com.company; import java.util.ArrayList; import java.util.LinkedList; public class Album { private String name; private String artist; private SongList songs; public Album(String name, String artist) { this.name = name; this.artist = artist; this.songs = new SongList(); } public boolean addSong(String title, double duration) { return this.songs.add(new Song(title, duration)); } public boolean addToPlayList(int trackNumber, LinkedList<Song> playList) { Song checkedSong = this.songs.findSong(trackNumber); if(checkedSong != null) { playList.add(checkedSong); return true; } System.out.println("This album does not have a track " + trackNumber); return false; } public boolean addToPlayList(String title, LinkedList<Song> playList) { Song checkedSong = songs.findSong(title); if(checkedSong != null) { playList.add(checkedSong); return true; } System.out.println("The song " + title + " is not in this album"); return false; } private class SongList { private ArrayList<Song> songs; public SongList() { this.songs = new ArrayList<Song>(); } public boolean add(Song song) { if(songs.contains(song)) { return false; } this.songs.add(song); return true; } private Song findSong(String title) { for(Song checkedSong: this.songs) { if(checkedSong.getTitle().equals(title)) { return checkedSong; } } return null; } public Song findSong(int trackNumber) { int index = trackNumber - 1; if ((index > 0) && (index<songs.size())) { return songs.get(index); } return null; } } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/inner-class/Main.java
package com.company; import java.util.*; public class Main { private static ArrayList<Album> albums = new ArrayList<Album>(); public static void main(String[] args) { // Create a program that implements a playlist for songs // Create a Song class having Title and Duration for a song. // The program will have an Album class containing a list of songs. // The albums will be stored in an ArrayList // Songs from different albums can be added to the playlist and will appear in the list in the order // they are added. // Once the songs have been added to the playlist, create a menu of options to:- // Quit,Skip forward to the next song, skip backwards to a previous song. Replay the current song. // List the songs in the playlist // A song must exist in an album before it can be added to the playlist (so you can only play songs that // you own). // Hint: To replay a song, consider what happened when we went back and forth from a city before we // started tracking the direction we were going. // As an optional extra, provide an option to remove the current song from the playlist // (hint: listiterator.remove() Album album = new Album("Stormbringer", "Deep Purple"); album.addSong("Stormbringer", 4.6); album.addSong("Love don't mean a thing", 4.22); album.addSong("Holy man", 4.3); album.addSong("Hold on", 5.6); album.addSong("Lady double dealer", 3.21); album.addSong("You can't do it right", 6.23); album.addSong("High ball shooter", 4.27); album.addSong("The gypsy", 4.2); album.addSong("Soldier of fortune", 3.13); albums.add(album); album = new Album("For those about to rock", "AC/DC"); album.addSong("For those about to rock", 5.44); album.addSong("I put the finger on you", 3.25); album.addSong("Lets go", 3.45); album.addSong("Inject the venom", 3.33); album.addSong("Snowballed", 4.51); album.addSong("Evil walks", 3.45); album.addSong("C.O.D.", 5.25); album.addSong("Breaking the rules", 5.32); album.addSong("Night of the long knives", 5.12); albums.add(album); LinkedList<Song> playList = new LinkedList<Song>(); albums.get(0).addToPlayList("You can't do it right", playList); albums.get(0).addToPlayList("Holy man", playList); albums.get(0).addToPlayList("Speed king", playList); // Does not exist albums.get(0).addToPlayList(9, playList); albums.get(1).addToPlayList(8, playList); albums.get(1).addToPlayList(3, playList); albums.get(1).addToPlayList(2, playList); albums.get(1).addToPlayList(24, playList); // There is no track 24 play(playList); } private static void play(LinkedList<Song> playList) { Scanner scanner = new Scanner(System.in); boolean quit = false; boolean forward = true; ListIterator<Song> listIterator = playList.listIterator(); if(playList.size() == 0) { System.out.println("No songs in playlist"); return; } else { System.out.println("Now playing " + listIterator.next().toString()); printMenu(); } while(!quit) { int action = scanner.nextInt(); scanner.nextLine(); switch(action) { case 0: System.out.println("Playlist complete."); quit = true; break; case 1: if(!forward) { if(listIterator.hasNext()) { listIterator.next(); } forward = true; } if(listIterator.hasNext()) { System.out.println("Now playing " + listIterator.next().toString()); } else { System.out.println("We have reached the end of the playlist"); forward = false; } break; case 2: if(forward) { if(listIterator.hasPrevious()) { listIterator.previous(); } forward = false; } if(listIterator.hasPrevious()) { System.out.println("Now playing " + listIterator.previous().toString()); } else { System.out.println("We are at the start of the playlist"); forward = true; } break; case 3: if(forward) { if(listIterator.hasPrevious()) { System.out.println("Now replaying " + listIterator.previous().toString()); forward = false; } else { System.out.println("We are at the start of the list"); } } else { if(listIterator.hasNext()) { System.out.println("Now replaying " + listIterator.next().toString()); forward = true; } else { System.out.println("We have reached the end of the list"); } } break; case 4: printList(playList); break; case 5: printMenu(); break; case 6: if(playList.size() >0) { listIterator.remove(); if(listIterator.hasNext()) { System.out.println("Now playing " + listIterator.next()); } else if(listIterator.hasPrevious()) { System.out.println("Now playing " + listIterator.previous()); } } break; } } } private static void printMenu() { System.out.println("Available actions:\npress"); System.out.println("0 - to quit\n" + "1 - to play next song\n" + "2 - to play previous song\n" + "3 - to replay the current song\n" + "4 - list songs in the playlist\n" + "5 - print available actions.\n" + "6 - delete current song from playlist"); } private static void printList(LinkedList<Song> playList) { Iterator<Song> iterator = playList.iterator(); System.out.println("================================"); while(iterator.hasNext()) { System.out.println(iterator.next()); } System.out.println("================================"); } // Modify the playlist challenge so that the Album class uses an inner class. // Instead of using an ArrayList to hold its tracks, it will use an inner class called SongList // The inner SongList class will use an ArrayList and will provide a method to add a song. // It will also provide findSong() methods which will be used by the containing Album class // to add songs to the playlist. // Neither the Song class or the Main class should be changed. }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/inner-class/Song.java
package com.company; public class Song { private String title; private double duration; public Song(String title, double duration) { this.title = title; this.duration = duration; } public String getTitle() { return title; } @Override public String toString() { return this.title + ": " + this.duration; } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/composition/Car.java
public class Car extends Vehicle { private int doors; private int engineCapacity; public Car(String name, int doors, int engineCapacity) { super(name); this.doors = doors; this.engineCapacity = engineCapacity; } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/composition/PC.java
public class PC { private Case theCase; private Monitor monitor; private Motherboard motherboard; public PC(Case theCase, Monitor monitor, Motherboard motherboard) { this.theCase = theCase; this.monitor = monitor; this.motherboard = motherboard; } public Case getTheCase() { return theCase; } public Monitor getMonitor() { return monitor; } public Motherboard getMotherboard() { return motherboard; } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/composition/Motherboard.java
public class Motherboard { private String model; private String manufacturer; private int ramSlots; private int cardSlots; private String bios; public Motherboard(String model, String manufacturer, int ramSlots, int cardSlots, String bios) { this.model = model; this.manufacturer = manufacturer; this.ramSlots = ramSlots; this.cardSlots = cardSlots; this.bios = bios; } public void loadProgram(String programName) { System.out.println("Program " + programName + " is now loading..."); } public String getModel() { return model; } public String getManufacturer() { return manufacturer; } public int getRamSlots() { return ramSlots; } public int getCardSlots() { return cardSlots; } public String getBios() { return bios; } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/composition/Main.java
public class Main { public static void main(String[] args) { Dimensions dimensions = new Dimensions(20, 20, 5); Case theCase = new Case("2208", "Dell", "240", dimensions); Monitor theMonitor = new Monitor("27inch Beast", "Acer", 27, new Resolution(2540, 1440)); Motherboard theMotherboard = new Motherboard("BJ-200", "Asus", 4, 6, "v2.44"); PC thePC = new PC(theCase, theMonitor, theMotherboard); thePC.getMonitor().drawPixelAt(1500, 1200, "red" ); thePC.getMotherboard().loadProgram("Windows 1.0"); thePC.getTheCase().pressPowerButton(); } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/composition/Monitor.java
public class Monitor { private String model; private String manufacturer; private int size; private Resolution nativeResolution; public Monitor(String model, String manufacturer, int size, Resolution nativeResolution) { this.model = model; this.manufacturer = manufacturer; this.size = size; this.nativeResolution = nativeResolution; } public void drawPixelAt(int x, int y, String color) { System.out.println("Drawing pixel at " + x + "," + y + " in colour " + color); } public String getModel() { return model; } public String getManufacturer() { return manufacturer; } public int getSize() { return size; } public Resolution getNativeResolution() { return nativeResolution; } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/composition/Case.java
public class Case { private String model; private String manufacturer; private String powerSupply; private Dimensions dimensions; public Case(String model, String manufacturer, String powerSupply, Dimensions dimensions) { this.model = model; this.manufacturer = manufacturer; this.powerSupply = powerSupply; this.dimensions = dimensions; } public void pressPowerButton() { System.out.println("Power button pressed"); } public String getModel() { return model; } public String getManufacturer() { return manufacturer; } public String getPowerSupply() { return powerSupply; } public Dimensions getDimensions() { return dimensions; } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/composition/Resolution.java
public class Resolution { private int width; private int height; public Resolution(int width, int height) { this.width = width; this.height = height; } public int getWidth() { return width; } public int getHeight() { return height; } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/composition/Vehicle.java
public class Vehicle { private String name; public Vehicle(String name) { this.name = name; } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/composition/Dimensions.java
public class Dimensions { private int width; private int height; private int depth; public Dimensions(int width, int height, int depth) { this.width = width; this.height = height; this.depth = depth; } public int getWidth() { return width; } public int getHeight() { return height; } public int getDepth() { return depth; } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/generics/FootballPlayer.java
package com.company; public class FootballPlayer extends Player { public FootballPlayer(String name) { super(name); } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/generics/Team.java
package com.company; import java.util.ArrayList; public class Team<T extends Player> implements Comparable<Team<T>> { private String name; int played = 0; int won = 0; int lost = 0; int tied = 0; private ArrayList<T> members = new ArrayList<>(); public Team(String name) { this.name = name; } public String getName() { return name; } public boolean addPlayer(T player) { if (members.contains(player)) { System.out.println(player.getName() + " is already on this team"); return false; } else { members.add(player); System.out.println(player.getName() + " picked for team " + this.name); return true; } } public int numPlayers() { return this.members.size(); } public void matchResult(Team<T> opponent, int ourScore, int theirScore) { String message; if(ourScore > theirScore) { won++; message = " beat "; } else if(ourScore == theirScore) { tied++; message = " drew with "; } else { lost++; message = " lost to "; } played++; if(opponent != null) { System.out.println(this.getName() + message + opponent.getName()); opponent.matchResult(null, theirScore, ourScore); } } public int ranking() { return (won * 2) + tied; } @Override public int compareTo(Team<T> team) { if(this.ranking() > team.ranking()) { return -1; } else if(this.ranking() < team.ranking()) { return 1; } else { return 0; } } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/generics/SoccerPlayer.java
package com.company; public class SoccerPlayer extends Player { public SoccerPlayer(String name) { super(name); } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/generics/Player.java
package com.company; public abstract class Player { private String name; public Player(String name) { this.name = name; } public String getName() { return name; } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/generics/Main.java
package com.company; public class Main { public static void main(String[] args) { // ArrayList<Team> teams; // Collections.sort(teams); // Create a generic class to implement a league table for a sport. // The class should allow teams to be added to the list, and store // a list of teams that belong to the league. // // Your class should have a method to print out the teams in order, // with the team at the top of the league printed first. // // Only teams of the same type should be added to any particular // instance of the league class - the program should fail to compile // if an attempt is made to add an incompatible team. League<Team<FootballPlayer>> footballLeague = new League<>("AFL"); Team<FootballPlayer> adelaideCrows = new Team<>("Adelaide Crows"); Team<FootballPlayer> melbourne = new Team<>("Melbourne"); Team<FootballPlayer> hawthorn= new Team<>("Hawthorn"); Team<FootballPlayer> fremantle= new Team<>("Fremantle"); Team<BaseballPlayer> baseballTeam = new Team<>("Chicago Cubs"); hawthorn.matchResult(fremantle, 1, 0); hawthorn.matchResult(adelaideCrows, 3, 8); adelaideCrows.matchResult(fremantle, 2, 1); footballLeague.add(adelaideCrows); footballLeague.add(melbourne); footballLeague.add(hawthorn); footballLeague.add(fremantle); // footballLeague.add(baseballTeam); footballLeague.showLeagueTable(); BaseballPlayer pat = new BaseballPlayer("Pat"); SoccerPlayer beckham = new SoccerPlayer("Beckham"); Team rawTeam = new Team("Raw Team"); rawTeam.addPlayer(beckham); // unchecked warning rawTeam.addPlayer(pat); // unchecked warning footballLeague.add(rawTeam); // unchecked warning League<Team> rawLeague = new League<>("Raw"); rawLeague.add(adelaideCrows); // no warning rawLeague.add(baseballTeam); // no warning rawLeague.add(rawTeam); // no warning League reallyRaw = new League("Really raw"); reallyRaw.add(adelaideCrows); // unchecked warning reallyRaw.add(baseballTeam); // unchecked warning reallyRaw.add(rawTeam); // unchecked warning } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/generics/BaseballPlayer.java
package com.company; public class BaseballPlayer extends Player { public BaseballPlayer(String name) { super(name); } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/generics/League.java
package com.company; import java.util.ArrayList; import java.util.Collections; public class League<T extends Team> { public String name; private ArrayList<T> league = new ArrayList<>(); public League(String name) { this.name = name; } public boolean add(T team) { if(league.contains(team)) { return false; } league.add(team); return true; } public void showLeagueTable() { Collections.sort(league); for(T t : league) { System.out.println(t.getName() + ": " + t.ranking()); } } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/package
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/package/mylibrary/Series.java
package com.company.mylibrary; public class Series { public static long nSum(int n) { return (n * (n + 1)) /2; } public static long factorial(int n) { if(n == 0) { return 0; } long fact = 1; for (int i=1; i <= n; i++) { fact *= i; } return fact; } public static long fibonacci(int n) { if(n == 0) { return 0; } else if(n == 1) { return 1; } long nMinus1 = 1; long nMinus2 = 0; long fib = 0; for(int i= 1; i<n; i++) { fib = (nMinus2 + nMinus1); nMinus2 = nMinus1; nMinus1 = fib; } return fib; } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/inheritance/Animal.java
package com.company; public class Animal { private String name; private int brain; private int body; private int size; private int weight; public Animal(String name, int brain, int body, int size, int weight) { this.name = name; this.brain = brain; this.body = body; this.size = size; this.weight = weight; } public void eat() { System.out.println("Animal.eat() called"); } public void move(int speed) { System.out.println("Animal.move() called. Animal is moving at " +speed); } public String getName() { return name; } public int getBrain() { return brain; } public int getBody() { return body; } public int getSize() { return size; } public int getWeight() { return weight; } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/inheritance/Dog.java
package com.company; public class Dog extends Animal { private int eyes; private int legs; private int tail; private int teeth; private String coat; public Dog(String name, int size, int weight, int eyes, int legs, int tail, int teeth, String coat) { super(name, 1, 1, size, weight); this.eyes = eyes; this.legs = legs; this.tail = tail; this.teeth = teeth; this.coat = coat; } private void chew() { System.out.println("Dog.chew() called"); } @Override public void eat() { System.out.println("Dog.eat() called"); chew(); super.eat(); } public void walk() { System.out.println("Dog.walk() called"); super.move(5); } public void run() { System.out.println("Dog.run() called"); move(10); } private void moveLegs(int speed) { System.out.println("Dog.moveLegs() called"); } @Override public void move(int speed) { System.out.println("Dog.move() called"); moveLegs(speed); super.move(speed); } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/inheritance/Main.java
package com.company; public class Main { public static void main(String[] args) { Animal animal = new Animal("Animal", 1, 1, 5, 5); Dog dog = new Dog("Yorkie", 8, 20, 2, 4, 1, 20, "long silky"); dog.eat(); dog.walk(); dog.run(); } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/java/inheritance/Fish.java
package com.company; public class Fish extends Animal { private int gills; private int eyes; private int fins; public Fish(String name, int size, int weight, int gills, int eyes, int fins) { super(name, 1, 1, size, weight); this.gills = gills; this.eyes = eyes; this.fins = fins; } private void rest() {} private void moveMuscles() {} private void moveBackFin() {} private void swim(int speed) { moveMuscles(); moveBackFin(); super.move(speed); } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/cpp/Circle.h
#ifndef CIRCLE_H #define CIRCLE_H #include "Shape.h" class Circle : public Shape { private: double radius; public: Circle(double radius); // Implementing virtual functions double area() const override; double perimeter() const override; }; #endif // CIRCLE_H
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/cpp/Circle.cpp
#include "Circle.h" #include <cmath> Circle::Circle(double radius) : radius(radius) {} double Circle::area() const { return M_PI * radius * radius; } double Circle::perimeter() const { return 2 * M_PI * radius; }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/cpp/Drawing.h
#ifndef DRAWING_H #define DRAWING_H #include <vector> #include "Shape.h" class Drawing { private: std::vector
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/cpp/Rectangle.h
#ifndef RECTANGLE_H #define RECTANGLE_H #include "Shape.h" class Rectangle : public Shape { private: double length; double width; public: Rectangle(double length, double width); // Implementing virtual functions double area() const override; double perimeter() const override; }; #endif // RECTANGLE_H
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/cpp/Rectangle.cpp
#include "Rectangle.h" Rectangle::Rectangle(double length, double width) : length(length), width(width) {} double Rectangle::area() const { return length * width; } double Rectangle::perimeter() const { return 2 * (length + width); }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/cpp/main.cpp
#include <iostream> #include <vector> #include "Shape.h" #include "Rectangle.h" #include "Circle.h" int main() { // Using Inheritance Rectangle rectangle(5, 3); Circle circle(4); // Using Composition std::vector // Using Inheritance Rectangle rectangle(5, 3); Circle circle(4); // Using Inheritance Rectangle rectangle(5, 3); Circle circle(4); // Using Composition std::vector```
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming
repos/exploratory-tech-studio/tech-studio-projects/data-structures/object-oriented-programming/cpp/Shape.h
// Interface // #ifndef SHAPE_H #define SHAPE_H class Shape { public: virtual double area() const = 0; virtual double perimeter() const = 0; }; #endif // SHAPE_H
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/skip-list
repos/exploratory-tech-studio/tech-studio-projects/data-structures/skip-list/java/SkipList.java
import java.util.Random; public class SkipList<T extends Comparable<T>> { private static final double PROBABILITY = 0.5; private class Node { T value; Node[] next; Node(T value, int level) { this.value = value; next = new Node[level + 1]; } } private final int MAX_LEVEL; private int level; private Node head; private Random random; public SkipList(int maxLevel) { MAX_LEVEL = maxLevel; level = 0; head = new Node(null, MAX_LEVEL); random = new Random(); } public void insert(T value) { Node[] update = new Node[MAX_LEVEL + 1]; Node current = head; for (int i = level; i >= 0; i--) { while (current.next[i] != null && current.next[i].value.compareTo(value) < 0) { current = current.next[i]; } update[i] = current; } current = current.next[0]; if (current == null || !current.value.equals(value)) { int newLevel = randomLevel(); if (newLevel > level) { for (int i = level + 1; i <= newLevel; i++) { update[i] = head; } level = newLevel; } Node newNode = new Node(value, newLevel); for (int i = 0; i <= newLevel; i++) { newNode.next[i] = update[i].next[i]; update[i].next[i] = newNode; } } } public boolean contains(T value) { Node current = head; for (int i = level; i >= 0; i--) { while (current.next[i] != null && current.next[i].value.compareTo(value) < 0) { current = current.next[i]; } } current = current.next[0]; return current != null && current.value.equals(value); } public void remove(T value) { Node[] update = new Node[MAX_LEVEL + 1]; Node current = head; for (int i = level; i >= 0; i--) { while (current.next[i] != null && current.next[i].value.compareTo(value) < 0) { current = current.next[i]; } update[i] = current; } current = current.next[0]; if (current != null && current.value.equals(value)) { for (int i = 0; i <= level; i++) { if (update[i].next[i] != current) { break; } update[i].next[i] = current.next[i]; } while (level > 0 && head.next[level] == null) { level--; } } } private int randomLevel() { int level = 0; while (Math.random() < PROBABILITY && level < MAX_LEVEL) { level++; } return level; } public void display() { for (int i = level; i >= 0; i--) { Node current = head.next[i]; System.out.print("Level " + i + ": "); while (current != null) { System.out.print(current.value + " "); current = current.next[i]; } System.out.println(); } } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/skip-list
repos/exploratory-tech-studio/tech-studio-projects/data-structures/skip-list/java/Main.java
public class Main { public static void main(String[] args) { // Create a skip list with maximum level 4 SkipList<Integer> skipList = new SkipList<>(4); // Insert elements into the skip list skipList.insert(10); skipList.insert(20); skipList.insert(15); skipList.insert(25); // Display the skip list System.out.print("Skip List after insertion: "); skipList.display(); // Remove an element from the skip list skipList.remove(20); // Display the skip list after removal System.out.print("Skip List after removal: "); skipList.display(); // Check if the skip list contains a value System.out.println("Skip List contains 15: " + skipList.contains(15)); System.out.println("Skip List contains 20: " + skipList.contains(20)); } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/skip-list
repos/exploratory-tech-studio/tech-studio-projects/data-structures/skip-list/cpp/SkipList.h
#ifndef SKIPLIST_H #define SKIPLIST_H #include <iostream> #include <vector> #include <random> // Forward declaration of SkipListNode template<typename T> class SkipListNode; /** * @brief SkipList class representing a skip list data structure. */ template<typename T> class SkipList { private: int maxLevel; int currentLevel; SkipListNode<T>* head; public: SkipList(int maxLevel); ~SkipList(); void insert(const T& value); bool remove(const T& value); bool contains(const T& value) const; void display() const; }; /** * @brief SkipListNode class representing a node in the skip list. */ template<typename T> class SkipListNode { public: T value; std::vector<SkipListNode<T>*> next; SkipListNode(const T& value, int level); }; #endif // SKIPLIST_H
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/skip-list
repos/exploratory-tech-studio/tech-studio-projects/data-structures/skip-list/cpp/main.cpp
#include <iostream> #include "SkipList.h" int main() { // Create a skip list with maximum level 4 SkipList<int> skipList(4); // Insert elements into the skip list skipList.insert(10); skipList.insert(20); skipList.insert(15); skipList.insert(25); // Display the skip list std::cout << "Skip List after insertion: "; skipList.display(); // Remove an element from the skip list skipList.remove(20); // Display the skip list after removal std::cout << "Skip List after removal: "; skipList.display(); // Check if the skip list contains a value std::cout << "Skip List contains 15: " << std::boolalpha << skipList.contains(15) << std::endl; std::cout << "Skip List contains 20: " << std::boolalpha << skipList.contains(20) << std::endl; return 0; }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/skip-list
repos/exploratory-tech-studio/tech-studio-projects/data-structures/skip-list/cpp/skipList.cpp
#include "SkipList.h" template<typename T> SkipListNode<T>::SkipListNode(const T& value, int level) : value(value), next(level, nullptr) {} template<typename T> SkipList<T>::SkipList(int maxLevel) : maxLevel(maxLevel), currentLevel(1) { head = new SkipListNode<T>(T(), maxLevel); } template<typename T> SkipList<T>::~SkipList() { SkipListNode<T>* curr = head; while (curr) { SkipListNode<T>* temp = curr->next[0]; delete curr; curr = temp; } } template<typename T> void SkipList<T>::insert(const T& value) { // Determine the level of the new node int level = 1; while (std::rand() % 2 == 0 && level < maxLevel) { level++; } // Create a new node SkipListNode<T>* newNode = new SkipListNode<T>(value, level); // Update the next pointers SkipListNode<T>* curr = head; for (int i = currentLevel - 1; i >= 0; i--) { while (curr->next[i] && curr->next[i]->value < value) { curr = curr->next[i]; } if (i < level) { newNode->next[i] = curr->next[i]; curr->next[i] = newNode; } } // Update the current level of the skip list if (level > currentLevel) { currentLevel = level; } } template<typename T> bool SkipList<T>::remove(const T& value) { // Find the node to remove SkipListNode<T>* curr = head; bool found = false; for (int i = currentLevel - 1; i >= 0; i--) { while (curr->next[i] && curr->next[i]->value < value) { curr = curr->next[i]; } if (curr->next[i] && curr->next[i]->value == value) { found = true; curr->next[i] = curr->next[i]->next[i]; } } return found; } template<typename T> bool SkipList<T>::contains(const T& value) const { // Search for the value in the skip list SkipListNode<T>* curr = head; for (int i = currentLevel - 1; i >= 0; i--) { while (curr->next[i] && curr->next[i]->value < value) { curr = curr->next[i]; } if (curr->next[i] && curr->next[i]->value == value) { return true; } } return false; } template<typename T> void SkipList<T>::display() const { // Display the elements of the skip list SkipListNode<T>* curr = head->next[0]; while (curr) { std::cout << curr->value << " "; curr = curr->next[0]; } std::cout << std::endl; }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/heap
repos/exploratory-tech-studio/tech-studio-projects/data-structures/heap/java/Main.java
public class Main { public static void main(String[] args) { Heap maxHeap = new Heap(); // Insert elements into the heap maxHeap.insert(10); maxHeap.insert(20); maxHeap.insert(15); maxHeap.insert(30); maxHeap.insert(5); // Display the heap System.out.print("Heap after insertion: "); maxHeap.display(); // Get and remove the maximum element from the heap int max = maxHeap.extractMax(); System.out.println("Extracted maximum element: " + max); // Display the heap after extraction System.out.print("Heap after extraction: "); maxHeap.display(); } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/heap
repos/exploratory-tech-studio/tech-studio-projects/data-structures/heap/java/Heap.java
import java.util.ArrayList; import java.util.List; public class Heap { private List<Integer> heap; public Heap() { heap = new ArrayList<>(); } private int parent(int i) { return (i - 1) / 2; } private int leftChild(int i) { return 2 * i + 1; } private int rightChild(int i) { return 2 * i + 2; } public void insert(int key) { heap.add(key); int i = heap.size() - 1; while (i != 0 && heap.get(parent(i)) < heap.get(i)) { swap(i, parent(i)); i = parent(i); } } public int extractMax() { if (heap.size() == 0) { throw new IllegalStateException("Heap is empty"); } if (heap.size() == 1) { return heap.remove(0); } int root = heap.get(0); heap.set(0, heap.remove(heap.size() - 1)); maxHeapify(0); return root; } private void maxHeapify(int i) { int largest = i; int left = leftChild(i); int right = rightChild(i); if (left < heap.size() && heap.get(left) > heap.get(largest)) { largest = left; } if (right < heap.size() && heap.get(right) > heap.get(largest)) { largest = right; } if (largest != i) { swap(i, largest); maxHeapify(largest); } } private void swap(int i, int j) { int temp = heap.get(i); heap.set(i, heap.get(j)); heap.set(j, temp); } public void display() { for (int i : heap) { System.out.print(i + " "); } System.out.println(); } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/heap
repos/exploratory-tech-studio/tech-studio-projects/data-structures/heap/cpp/main.cpp
#include <iostream> #include "Heap.h" int main() { Heap maxHeap; // Insert elements into the heap maxHeap.insert(10); maxHeap.insert(20); maxHeap.insert(15); maxHeap.insert(30); maxHeap.insert(5); // Display the heap std::cout << "Heap after insertion: "; maxHeap.display(); // Get and remove the maximum element from the heap int max = maxHeap.extractMax(); std::cout << "Extracted maximum element: " << max << std::endl; // Display the heap after extraction std::cout << "Heap after extraction: "; maxHeap.display(); return 0; }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/heap
repos/exploratory-tech-studio/tech-studio-projects/data-structures/heap/cpp/Heap.h
#ifndef HEAP_H #define HEAP_H #include <vector> /** * @brief Heap class representing a max-heap data structure. */ class Heap { private: std::vector<int> heap; // Internal representation of the heap void heapifyUp(); // Restore heap property from bottom to top void heapifyDown(); // Restore heap property from top to bottom public: Heap(); ~Heap(); void insert(int value); // Insert a value into the heap int getMax() const; // Get the maximum value from the heap int extractMax(); // Extract and remove the maximum value from the heap bool isEmpty() const; // Check if the heap is empty void display() const; // Display the heap elements }; #endif // HEAP_H
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/heap
repos/exploratory-tech-studio/tech-studio-projects/data-structures/heap/cpp/Heap.cpp
#include "Heap.h" #include <iostream> Heap::Heap() {} Heap::~Heap() {} void Heap::insert(int value) { heap.push_back(value); heapifyUp(); } int Heap::getMax() const { if (!isEmpty()) { return heap[0]; } return -1; // Heap is empty } int Heap::extractMax() { if (!isEmpty()) { int max = heap[0]; heap[0] = heap.back(); heap.pop_back(); heapifyDown(); return max; } return -1; // Heap is empty } bool Heap::isEmpty() const { return heap.empty(); } void Heap::display() const { for (int value : heap) { std::cout << value << " "; } std::cout << std::endl; } void Heap::heapifyUp() { int index = heap.size() - 1; while (index > 0 && heap[index] > heap[(index - 1) / 2]) { std::swap(heap[index], heap[(index - 1) / 2]); index = (index - 1) / 2; } } void Heap::heapifyDown() { int index = 0; while (2 * index + 1 < heap.size()) { int leftChild = 2 * index + 1; int rightChild = 2 * index + 2; int largerChild = leftChild; if (rightChild < heap.size() && heap[rightChild] > heap[leftChild]) { largerChild = rightChild; } if (heap[index] < heap[largerChild]) { std::swap(heap[index], heap[largerChild]); index = largerChild; } else { break; } } }
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures
repos/exploratory-tech-studio/tech-studio-projects/data-structures/user-defined-data-structures-in-python/example_usages.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """Example usages of all user-defined data strucutres.""" from classes.Queue import Queue from classes.Graph import Graph from classes.LinkedList import LinkedList from classes.Stack import Stack from classes.BinaryTree import BinaryTree, TreeNode def main() -> None: """Main program and drving code.""" # ---- print() print("Graph example usage: ") g = Graph() g.add_edge(0, 1) g.add_edge(0, 2) g.add_edge(1, 2) g.add_edge(2, 0) g.add_edge(2, 3) g.print_graph() print(" "+str(g)) # ---- print() print("Linked list example usage: ") # create a new linked list my_list = LinkedList() # append data my_list.append(1) my_list.append(2) my_list.append(3) # print the list my_list.print_list() # ---- print() print("Queue example usage: ") q = Queue() q.enqueue(1) q.enqueue(2) q.enqueue(3) print(q.dequeue()) # ---- print() print("Stack example usage: ") s = Stack() s.push(1) s.push(2) s.push(3) print(" Take off the last added element: "+str(s.pop())) # ---- print() print("Tree example usage: ") root = TreeNode("A") child1 = TreeNode("B") child2 = TreeNode("C") # root.add_child(child1) # root.add_child(child2) # child1.add_child(TreeNode("D")) # child1.add_child(TreeNode("E")) print(" "+str(root)) root = BinaryTree("A") root.print_tree("inorder") return None if __name__ == "__main__": main()
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/user-defined-data-structures-in-python
repos/exploratory-tech-studio/tech-studio-projects/data-structures/user-defined-data-structures-in-python/classes/StackTests.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """Unit tests for the stack implementation.""" import unittest from Stack import Stack class TestStack(unittest.TestCase): """Test cases for the Stack class.""" def test_push(self): """Test pushing elements onto the stack.""" s = Stack() s.push(1) s.push(2) s.push(3) self.assertEqual(s.items, [1, 2, 3]) def test_pop(self): """Test popping elements from the stack.""" s = Stack() s.push(1) s.push(2) s.push(3) self.assertEqual(s.pop(), 3) self.assertEqual(s.items, [1, 2]) def test_is_empty(self): """Test checking if the stack is empty.""" s = Stack() self.assertTrue(s.is_empty()) s.push(1) self.assertFalse(s.is_empty()) def test_peek(self): """Test peeking at the top element of the stack.""" s = Stack() s.push(1) s.push(2) self.assertEqual(s.peek(), 2) s.pop() self.assertEqual(s.peek(), 1) def test_size(self): """Test getting the size of the stack.""" s = Stack() s.push(1) s.push(2) s.push(3) self.assertEqual(s.size(), 3) if __name__ == '__main__': unittest.main()
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/user-defined-data-structures-in-python
repos/exploratory-tech-studio/tech-studio-projects/data-structures/user-defined-data-structures-in-python/classes/Graph.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """graph.py""" class Graph: """ A class representing an undirected graph using an adjacency list representation. This class allows users to create a graph object and add edges between vertices. It also provides a method to print the adjacency list representation of the graph. Example usage: my_graph = Graph() my_graph.add_edge(1, 2) my_graph.add_edge(1, 3) my_graph.print_graph() 1 -> 2 -> 3 2 -> 1 3 -> 1 """ def __init__(self) -> None: """Initializes an empty graph with an empty dictionary to store the adjacency lists. """ self.graph: dict = {} print(f" Init graph: {self.graph}") return None def add_edge(self, u, v) -> None: """Adds an undirected edge between vertices u and v in the graph. If the vertex u already exists in the graph, v is appended to its adjacency list. If u does not exist, a new entry with u as the key and [v] as the value is created. Parameters: u -- The first vertex of the edge. v -- The second vertex of the edge. """ if u in self.graph: self.graph[u].append(v) print(f" Appended to its adjacency list, because u already exists: {self.graph[u]}") else: self.graph[u] = [v] print(f" New entry with key u and value [v]: {self.graph[u]}") return None def print_graph(self) -> None: """Prints the adjacency list representation of the graph. Each line of output represents a vertex followed by its adjacent vertices, separated by "->". """ for vertex in self.graph: # print(vertex, "->", " -> ".join(map(str, self.graph[vertex]))) adjacency_list = vertex, "->", " -> ".join(map(str, self.graph[vertex])) print(" "+str(adjacency_list)) return None
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/user-defined-data-structures-in-python
repos/exploratory-tech-studio/tech-studio-projects/data-structures/user-defined-data-structures-in-python/classes/LinkedListTests.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """Unit tests for the linked list implementation.""" import io import unittest from unittest.mock import patch from LinkedList import Node, LinkedList class TestLinkedList(unittest.TestCase): """Test cases for the LinkedList class.""" def test_node_creation(self): """Test creating a Node object.""" node = Node(5) self.assertEqual(node.data, 5) self.assertIsNone(node.next) def test_linked_list_append(self): """Test appending elements to the LinkedList.""" linked_list = LinkedList() linked_list.append(1) linked_list.append(2) linked_list.append(3) self.assertEqual(linked_list.head.data, 1) self.assertEqual(linked_list.head.next.data, 2) self.assertEqual(linked_list.head.next.next.data, 3) def test_linked_list_print(self): """Test printing the elements of the LinkedList.""" linked_list = LinkedList() linked_list.append(1) linked_list.append(2) linked_list.append(3) expected_output = "1 2 3 " with patch('sys.stdout', new=io.StringIO()) as fake_stdout: linked_list.print_list() self.assertEqual(fake_stdout.getvalue(), expected_output) if __name__ == '__main__': unittest.main()
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/user-defined-data-structures-in-python
repos/exploratory-tech-studio/tech-studio-projects/data-structures/user-defined-data-structures-in-python/classes/Stack.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """stack.py A class representing a stack data structure. """ from typing import Any, List class Stack: """ A class representing a stack data structure. """ def __init__(self) -> None: """Initializes an empty stack.""" self.items: List[Any] = [] return None def push(self, item: Any) -> None: """Pushes an item onto the top of the stack. Keyword arguments: item (Any) -- The item to be pushed onto the stack. """ self.items.append(item) def pop(self) -> Any: """Removes and returns the item at the top of the stack.""" if not self.is_empty(): return self.items.pop() def is_empty(self) -> bool: """Checks if the stack is empty.""" return len(self.items) == 0 def peek(self) -> Any: """Returns the item at the top of the stack without removing it.""" if not self.is_empty(): return self.items[-1] def size(self) -> int: """Returns the number of elements in the stack. Keyword arguments: - int -- The number of elements in the stack. """ return len(self.items)
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/user-defined-data-structures-in-python
repos/exploratory-tech-studio/tech-studio-projects/data-structures/user-defined-data-structures-in-python/classes/BinaryTree.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """binary_tree.py A module for implementing a singly linked list. """ import sys sys.path.append("..") from sklearn import tree class TreeNode: """TreeNode class""" def __init__(self, data: int) -> None: """Initialize a TreeNode. Keyword arguments: data (int) -- The data to be stored in the node. """ self.data = data self.left = None self.right = None return None class BinaryTree: """BinaryTree class""" def __init__(self, root: int) -> None: """Initialize a BinaryTree with a root node. Keyword arguments: root (int) -- The data for the root node. """ self.root = TreeNode(root) return None def print_tree(self, traversal_type: str) -> str: """Print the tree using the specified traversal type. Keyword arguments: traversal_type (str) -- The type of traversal to be performed ("preorder", "inorder", or "postorder"). """ if traversal_type == "preorder": return self.preorder_print(self.root, "") elif traversal_type == "inorder": return self.inorder_print(self.root, "") elif traversal_type == "postorder": return self.postorder_print(self.root, "") def preorder_print(self, start: TreeNode, traversal: str) -> str: """Perform preorder traversal starting from the given node. Keyword arguments: start (TreeNode) -- The starting node for traversal. traversal (str) -- The current traversal result. """ if start: traversal += (str(start.data) + "-") traversal = self.preorder_print(start.left, traversal) traversal = self.preorder_print(start.right, traversal) return traversal def inorder_print(self, start: TreeNode, traversal: str) -> str: """Perform inorder traversal starting from the given node. Keyword arguments: start (TreeNode) -- The starting node for traversal. traversal (str) -- The current traversal result. """ if start: traversal = self.inorder_print(start.left, traversal) traversal += (str(start.data) + "-") traversal = self.inorder_print(start.right, traversal) return traversal def postorder_print(self, start: TreeNode, traversal: str) -> str: """Perform postorder traversal starting from the given node. Keyword arguments: start (TreeNode) -- The starting node for traversal. traversal (str) -- The current traversal result. """ if start: traversal = self.postorder_print(start.left, traversal) traversal = self.postorder_print(start.right, traversal) traversal += (str(start.data) + "-") return traversal
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/user-defined-data-structures-in-python
repos/exploratory-tech-studio/tech-studio-projects/data-structures/user-defined-data-structures-in-python/classes/Queue.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """queue.py A class representing a queue data structure. This class implements the basic operations of a queue, including enqueue (adding an item to the end of the queue), dequeue (removing and returning the item at the front of the queue), peek (returning the item at the front of the queue without removing it), is_empty (checking if the queue is empty), and size (returning the number of elements in the queue). """ class Queue: """ A class representing a queue data structure. """ def __init__(self) -> None: """Initializes an empty queue.""" self.items = [] return None def enqueue(self, item: object) -> None: """Adds an item to the end of the queue. Keyword arguments: item -- The item to be added to the queue. """ self.items.insert(0, item) return None def dequeue(self) -> object: """Removes and returns the item at the front of the queue.""" if not self.is_empty(): return self.items.pop() def is_empty(self) -> bool: """Checks if the queue is empty.""" return len(self.items) == 0 def peek(self) -> object: """Returns the item at the front of the queue without removing it.""" if not self.is_empty(): return self.items[-1] def size(self) -> int: """Returns the number of elements in the queue.""" return len(self.items)
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/user-defined-data-structures-in-python
repos/exploratory-tech-studio/tech-studio-projects/data-structures/user-defined-data-structures-in-python/classes/LinkedList.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """linked_list.py A module for implementing a singly linked list. """ class Node: """A class representing a single node in a linked list.""" def __init__(self, data: int) -> None: """ Initialize a new node. Parameters: data (int): The integer data to be stored in the node. """ self.data = data self.next = None return None class LinkedList: """A class representing a singly linked list.""" def __init__(self) -> None: """ Initialize an empty linked list. """ self.head = None return None def append(self, data: int) -> None: """ Append a new node with the given data to the end of the list. Parameters: data (int): The integer data to be appended to the list. """ new_node = Node(data) if not self.head: self.head = new_node return last_node = self.head while last_node.next: last_node = last_node.next last_node.next = new_node return None def print_list(self) -> None: """ Print the data stored in each node of the list. """ current_node = self.head while current_node: print(" "+str(current_node.data), end=" ") current_node = current_node.next print() return None
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/user-defined-data-structures-in-python
repos/exploratory-tech-studio/tech-studio-projects/data-structures/user-defined-data-structures-in-python/classes/QueueTests.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """Unit tests for the queue implementation.""" import unittest from Queue import Queue class TestQueue(unittest.TestCase): """Test cases for the Queue class.""" def test_enqueue(self): """Test enqueueing elements into the queue.""" q = Queue() q.enqueue(1) q.enqueue(2) q.enqueue(3) self.assertEqual(q.items, [3, 2, 1]) def test_dequeue(self): """Test dequeuing elements from the queue.""" q = Queue() q.enqueue(1) q.enqueue(2) q.enqueue(3) self.assertEqual(q.dequeue(), 1) self.assertEqual(q.items, [3, 2]) def test_is_empty(self): """Test checking if the queue is empty.""" q = Queue() self.assertTrue(q.is_empty()) q.enqueue(1) self.assertFalse(q.is_empty()) def test_peek(self): """Test peeking at the front element of the queue.""" q = Queue() q.enqueue(1) q.enqueue(2) self.assertEqual(q.peek(), 1) q.dequeue() self.assertEqual(q.peek(), 2) def test_size(self): """Test getting the size of the queue.""" q = Queue() q.enqueue(1) q.enqueue(2) q.enqueue(3) self.assertEqual(q.size(), 3) if __name__ == '__main__': unittest.main()
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/user-defined-data-structures-in-python
repos/exploratory-tech-studio/tech-studio-projects/data-structures/user-defined-data-structures-in-python/classes/BinaryTreeTests.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """Unit tests for the binary tree implementation.""" from BinaryTree import BinaryTree import unittest class TestBinaryTree(unittest.TestCase): def setUp(self) -> None: """ Set up the binary tree for testing. """ self.tree: BinaryTree = BinaryTree(1) self.tree.root.left = TreeNode(2) self.tree.root.right = TreeNode(3) self.tree.root.left.left = TreeNode(4) self.tree.root.left.right = TreeNode(5) self.tree.root.right.left = TreeNode(6) self.tree.root.right.right = TreeNode(7) def test_preorder_print(self) -> None: """ Test preorder traversal of the binary tree. """ expected_output: str = "1-2-4-5-3-6-7-" self.assertEqual(self.tree.print_tree("preorder"), expected_output) def test_inorder_print(self) -> None: """ Test inorder traversal of the binary tree. """ expected_output: str = "4-2-5-1-6-3-7-" self.assertEqual(self.tree.print_tree("inorder"), expected_output) def test_postorder_print(self) -> None: """ Test postorder traversal of the binary tree. """ expected_output: str = "4-5-2-6-7-3-1-" self.assertEqual(self.tree.print_tree("postorder"), expected_output) if __name__ == '__main__': unittest.main()
0
repos/exploratory-tech-studio/tech-studio-projects/data-structures/user-defined-data-structures-in-python
repos/exploratory-tech-studio/tech-studio-projects/data-structures/user-defined-data-structures-in-python/classes/GraphTests.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """graph_test.py Unit tests for the graph implementation. """ import io import unittest from unittest.mock import patch from Graph import Graph class TestGraph(unittest.TestCase): """Test cases for the Graph class.""" def test_add_edge(self) -> None: """Test the add_edge method of the Graph class.""" graph = Graph() graph.add_edge(1, 2) graph.add_edge(1, 3) graph.add_edge(2, 3) expected_graph = {1: [2, 3], 2: [3]} self.assertEqual(graph.graph, expected_graph) return None def test_print_graph(self) -> None: """Test the print_graph method of the Graph class.""" graph = Graph() graph.add_edge(1, 2) graph.add_edge(1, 3) graph.add_edge(2, 3) expected_output = "1 -> 2 -> 3\n2 -> 3\n" with patch('sys.stdout', new=io.StringIO()) as fake_stdout: graph.print_graph() self.assertEqual(fake_stdout.getvalue(), expected_output) return None if __name__ == '__main__': unittest.main()
0
repos/exploratory-tech-studio/tech-studio-projects
repos/exploratory-tech-studio/tech-studio-projects/prompt-engineering-experiments/README.md
# Prompt Engineering Experiemnts ## :newspaper: About the project Experiments with seceral AI-Systems. ### How it works In progress ### Content overview . ├── ai/ - website main content ├── legal/ - legal source code ├── COPYRIGHT - project copyright ├── index.html - homepage ├── LICENSE - license text └── README.md - relevant information about the project ## :pencil2: Usage :globe_with_meridians: [Click here](https://CH6832.github.io/prompt-engineering-experiments/) to visit the website and inspect the results. ## :books: Resources used to create this project * AI-Systems * [ChatGPT 3.5](https://chat.openai.com/) * [Gemini](https://gemini.google.com/app) * [Claude](https://claude.ai/login) * [Copilot](https://copilot.microsoft.com/) * Markdwon * [Basic syntax](https://www.markdownguide.org/basic-syntax/) * [Complete list of github markdown emofis](https://dev.to/nikolab/complete-list-of-github-markdown-emoji-markup-5aia) * [Awesome template](http://github.com/Human-Activity-Recognition/blob/main/README.md) * [.gitignore file](https://git-scm.com/docs/gitignore) * Editor * [Visual Studio Code](https://code.visualstudio.com/) ## :bookmark: License [Creative Commons Attribution-NonCommercial 3.0](https://creativecommons.org/licenses/by-nc/3.0/legalcode.txt) :copyright: 2024 Christoph Hartleb ## :copyright: Copyright See the [COPYRIGHT](COPYRIGHT) file for copyright and licensing details.
0
repos/exploratory-tech-studio/tech-studio-projects
repos/exploratory-tech-studio/tech-studio-projects/prompt-engineering-experiments/index.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> <meta name="description" content="" /> <meta name="author" content="" /> <link rel="icon" href="../../favicon.ico" /> <link rel="canonical" href="https://getbootstrap.com/docs/3.4/examples/navbar-fixed-top/" /> <!-- Website title --> <title>Experimental PE-Project</title> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous" /> <!-- Optional theme --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap-theme.min.css" integrity="sha384-6pzBo3FDv/PJ8r2KRkGHifhEocL+1X2rVCTTkUfGk7/0pbek5mMa1upzvWbrUbOZ" crossorigin="anonymous" /> <!-- Bootstrap core CSS --> <!-- <link href="../../dist/css/bootstrap.min.css" rel="stylesheet"> --> <!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> <!-- <link href="../../assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet"> --> <!-- Custom styles for this template --> <!-- <link href="navbar-fixed-top.css" rel="stylesheet"> --> <!-- Just for debugging purposes. Don't actually copy these 2 lines! --> <!--[if lt IE 9 ]><script src="../../assets/js/ie8-responsive-file-warning.js"></script ><![endif]--> <!-- <script src="../../assets/js/ie-emulation-modes-warning.js"></script> --> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/html5shiv.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dest/respond.min.js"></script> <![endif]--> </head> <body data-spy="scroll" data-target="#navbar"> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- NAVBAR --> <nav class="navbar navbar-default navbar-fixed-top" id="navbar"> <div class="container-fluid"> <!-- Titel und Schalter werden für eine bessere mobile Ansicht zusammengefasst --> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false" > <span class="sr-only">Navigation ein-/ausblenden</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#">PROMPT ENGINEERING</a> </div> <!-- Alle Navigationslinks, Formulare und anderer Inhalt werden hier zusammengefasst und können dann ein- und ausgeblendet werden --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li class="active"> <a href="#jumbotron" >HOME <span class="sr-only">(aktuell)</span></a > </li> <li><a href="#mehrInfo">AI TOOLS</a></li> <!-- <li><a href="#footer">AI TOOLS</a></li> --> </ul> <ul class="nav navbar-nav navbar-right"> <form class="navbar-form navbar-left" role="search"> <div class="form-group"> <!-- <input type="email" class="form-control" placeholder="email" /> <input type="password" class="form-control" placeholder="passwort" /> --> <a href="https://www.linkedin.com/in/christoph-hartleb/"> <button type="button" class="btn btn-outline-secondary"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-linkedin" viewBox="0 0 16 16" > <path d="M0 1.146C0 .513.526 0 1.175 0h13.65C15.474 0 16 .513 16 1.146v13.708c0 .633-.526 1.146-1.175 1.146H1.175C.526 16 0 15.487 0 14.854zm4.943 12.248V6.169H2.542v7.225zm-1.2-8.212c.837 0 1.358-.554 1.358-1.248-.015-.709-.52-1.248-1.342-1.248S2.4 3.226 2.4 3.934c0 .694.521 1.248 1.327 1.248zm4.908 8.212V9.359c0-.216.016-.432.08-.586.173-.431.568-.878 1.232-.878.869 0 1.216.662 1.216 1.634v3.865h2.401V9.25c0-2.22-1.184-3.252-2.764-3.252-1.274 0-1.845.7-2.165 1.193v.025h-.016l.016-.025V6.169h-2.4c.03.678 0 7.225 0 7.225z" /> </svg> <span class="visually-hidden">Christoph Hartleb</span> </button></a > </div> <!-- <button type="submit" class="btn btn-success">Login</button> --> </form> </ul> </div> <!-- /.navbar-collapse --> </div> <!-- /.container-fluid --> </nav> <!-- /NAVBAR --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- HOME --> <div class="jumbotron" id="jumbotron"> <div class="container"> <br> <h1>Experimental PE-Project</h1> <br> <div class="alert alert-danger" role="danger"> WARNING: The project is in progress and has not reached production phase so far! </div> <h2>Overview</h2> <br> <p> This website presents the results of experiments with various Large Language Models that are available on the market. </p> <p> Only AI-Systems that were available free of charge were used. </p> <br> <p> The goals of the experiments are the following: </p> <p> <ul> <li>Crafting effective prompts</li> <br> <li>Optimizing and enhancing prompts to get out the best result</li> <br> <li>Trying to create more complex prompts with pre</li> <br> <li>Experimenting with already widely used patterns</li> </ul> </p> <hr /> </div> </div> <!-- /HOME --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- AI-TOOLS --> <div class="container" id="mehrInfo"> <!-- <div class="row" id="zusammenfassung"> <h1>AI-Systems</h1> <p class="lead">Overview of what AI-Systems are experimented with.</p> </div> </div> --> <div class="row"> <!-- ++++++++++++++ chat-gpt ++++++++++++++ --> <div class="col-sm-6 col-md-4"> <div class="thumbnail" style="background-color:seagreen;"> <!-- <img class="card-img-top" src="vorschau.png" alt="..." /> ---> <div class="caption" style="color:white;"> <h2><b><a href="https://chat.openai.com/" style="color:white;">ChatGPT</a></b></h2> <!-- <p> Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam </p> --> <p> <a href="ai/chatgpt-3.5/chatgpt-3.5.html" style="color:white;">Go to projects <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-right" viewBox="0 0 16 10"> <path fill-rule="evenodd" d="M1 8a.5.5 0 0 1 .5-.5h11.793l-3.147-3.146a.5.5 0 0 1 .708-.708l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 0 1-.708-.708L13.293 8.5H1.5A.5.5 0 0 1 1 8"/> </svg> </a> </p> </div> </div> </div> <!-- ++++++++++++++ /chat-gpt ++++++++++++++ --> <!-- ++++++++++++++ llama ++++++++++++++ --> <div class="col-sm-6 col-md-4"> <div class="thumbnail" style="background-color:red;"> <!-- <img class="card-img-top" src="vorschau.png" alt="..." /> ---> <div class="caption" style="color:lightpink;"> <h2><b><a href="https://www.llama2.ai/" style="color:lightpink;">Llama</a></b></h2> <!-- <p> Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam </p> --> <p> <a href="ai/llama-3/llama-3.html" style="color:lightpink;">Go to projects <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-right" viewBox="0 0 16 10"> <path fill-rule="evenodd" d="M1 8a.5.5 0 0 1 .5-.5h11.793l-3.147-3.146a.5.5 0 0 1 .708-.708l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 0 1-.708-.708L13.293 8.5H1.5A.5.5 0 0 1 1 8"/> </svg> </a> </p> </div> </div> </div> <!-- ++++++++++++++ /llama ++++++++++++++ --> <!-- ++++++++++++++ google-gemini ++++++++++++++ --> <!-- <div class="col-sm-6 col-md-4"> <div class="thumbnail" style="background-color:#8020F2;"> <img class="card-img-top" src="vorschau.png" alt="..." /> <div class="caption" style="color:lightgray;"> <h2><b><a href="https://gemini.google.com/app" style="color:lightgray;">Google Gemini</a></b></h2> <p> Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et </p> <p> <a href="" style="color:lightgray;">Go to projects <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-right" viewBox="0 0 16 10"> <path fill-rule="evenodd" d="M1 8a.5.5 0 0 1 .5-.5h11.793l-3.147-3.146a.5.5 0 0 1 .708-.708l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 0 1-.708-.708L13.293 8.5H1.5A.5.5 0 0 1 1 8"/> </svg> </a> </p> </div> </div> </div> --> <!-- ++++++++++++++ /google-gemini ++++++++++++++ --> <!-- ++++++++++++++ claude ++++++++++++++ --> <div class="col-sm-6 col-md-4"> <div class="thumbnail" style="background-color:#FAF9C1;"> <!-- <img class="card-img-top" src="vorschau.png" alt="..." /> --> <div class="caption" style="color:black;"> <h2><b><a href="https://claude.ai/login" style="color:black;">Claude.ai</a></b></h2> <!-- <p> Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et </p> --> <p> <a href="ai/claude/claude.html" style="color:black;">Go to projects <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-right" viewBox="0 0 16 10"> <path fill-rule="evenodd" d="M1 8a.5.5 0 0 1 .5-.5h11.793l-3.147-3.146a.5.5 0 0 1 .708-.708l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 0 1-.708-.708L13.293 8.5H1.5A.5.5 0 0 1 1 8"/> </svg> </a> </p> </div> </div> </div> <!-- ++++++++++++++ /claude ++++++++++++++ --> <!-- ++++++++++++++ bloom ++++++++++++++ --> <!-- <div class="col-sm-6 col-md-4"> <div class="thumbnail" style="background-color:#F7F7F7;"> <img class="card-img-top" src="vorschau.png" alt="..." /> <div class="caption" style="color:darkblue;"> <h2><b><a href="https://copilot.microsoft.com/Bloom">Copilot</a></b></h2> <p> Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et </p> <p> <a href="" style="color:darkblue;">Go to projects <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-right" viewBox="0 0 16 10"> <path fill-rule="evenodd" d="M1 8a.5.5 0 0 1 .5-.5h11.793l-3.147-3.146a.5.5 0 0 1 .708-.708l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 0 1-.708-.708L13.293 8.5H1.5A.5.5 0 0 1 1 8"/> </svg> </a> </p> </div> </div> </div> --> <!-- ++++++++++++++ /bloom ++++++++++++++ --> </div> <!-- /AI-TOOLS --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <br> <br> <br> <!-- <hr /> --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- FOOTER --> <!-- <div class="container" id="footer"> <div class="row"> <h2>Lade die App herunter!</h2> <p> <a href="" ><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/0/0f/Available_on_the_App_Store_%28black%29_SVG.svg/320px-Available_on_the_App_Store_%28black%29_SVG.svg.png" /></a> </p> </div> </div> --> <!-- <div class="container"> <div class="page-header"> <h1>Sticky footer</h1> </div> <p class="lead">Pin a fixed-height footer to the bottom of the viewport in desktop browsers with this custom HTML and CSS.</p> <p>Use <a href="../sticky-footer-navbar/">the sticky footer with a fixed navbar</a> if need be, too.</p> </div> --> <footer class="footer"> <div class="container"> <p> This site is goverend by the <a href="legal/terms_of_use.html">Terms of Use</a> and <a href="legal/privacy_policy.html">Privacy Policy</a>. Copyright 2024 Christoph Hartleb. All Rights reserved. </p> </div> </footer> <!-- /FOOTER --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- Latest compiled and minified JavaScript --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"> </script> </body> </html>
0
repos/exploratory-tech-studio/tech-studio-projects/prompt-engineering-experiments
repos/exploratory-tech-studio/tech-studio-projects/prompt-engineering-experiments/legal/privacy_policy.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> <meta name="description" content="" /> <meta name="author" content="" /> <link rel="icon" href="../../favicon.ico" /> <link rel="canonical" href="https://getbootstrap.com/docs/3.4/examples/navbar-fixed-top/" /> <!-- Website title --> <title>Experimental PE-Project</title> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous" /> <!-- Optional theme --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap-theme.min.css" integrity="sha384-6pzBo3FDv/PJ8r2KRkGHifhEocL+1X2rVCTTkUfGk7/0pbek5mMa1upzvWbrUbOZ" crossorigin="anonymous" /> <!-- Bootstrap core CSS --> <!-- <link href="../../dist/css/bootstrap.min.css" rel="stylesheet"> --> <!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> <!-- <link href="../../assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet"> --> <!-- Custom styles for this template --> <!-- <link href="navbar-fixed-top.css" rel="stylesheet"> --> <!-- Just for debugging purposes. Don't actually copy these 2 lines! --> <!--[if lt IE 9 ]><script src="../../assets/js/ie8-responsive-file-warning.js"></script ><![endif]--> <!-- <script src="../../assets/js/ie-emulation-modes-warning.js"></script> --> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/html5shiv.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dest/respond.min.js"></script> <![endif]--> </head> <body data-spy="scroll" data-target="#navbar"> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- NAVBAR --> <nav class="navbar navbar-default navbar-fixed-top" id="navbar"> <div class="container-fluid"> <!-- Titel und Schalter werden für eine bessere mobile Ansicht zusammengefasst --> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false" > <span class="sr-only">Navigation ein-/ausblenden</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="../index.html">PROMPT ENGINEERING</a> </div> <!-- Alle Navigationslinks, Formulare und anderer Inhalt werden hier zusammengefasst und können dann ein- und ausgeblendet werden --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li> <a href="../index.html" >HOME <span class="sr-only">(aktuell)</span></a> </li> <li><a href="../index.html#mehrInfo">AI TOOLS</a></li> <!-- <li><a href="#footer">AI TOOLS</a></li> --> </ul> <ul class="nav navbar-nav navbar-right"> <form class="navbar-form navbar-left" role="search"> <div class="form-group"> <!-- <input type="email" class="form-control" placeholder="email" /> <input type="password" class="form-control" placeholder="passwort" /> --> <a href="https://www.linkedin.com/in/christoph-hartleb/"> <button type="button" class="btn btn-outline-secondary"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-linkedin" viewBox="0 0 16 16" > <path d="M0 1.146C0 .513.526 0 1.175 0h13.65C15.474 0 16 .513 16 1.146v13.708c0 .633-.526 1.146-1.175 1.146H1.175C.526 16 0 15.487 0 14.854zm4.943 12.248V6.169H2.542v7.225zm-1.2-8.212c.837 0 1.358-.554 1.358-1.248-.015-.709-.52-1.248-1.342-1.248S2.4 3.226 2.4 3.934c0 .694.521 1.248 1.327 1.248zm4.908 8.212V9.359c0-.216.016-.432.08-.586.173-.431.568-.878 1.232-.878.869 0 1.216.662 1.216 1.634v3.865h2.401V9.25c0-2.22-1.184-3.252-2.764-3.252-1.274 0-1.845.7-2.165 1.193v.025h-.016l.016-.025V6.169h-2.4c.03.678 0 7.225 0 7.225z" /> </svg> <span class="visually-hidden">Christoph Hartleb</span> </button></a > </div> <!-- <button type="submit" class="btn btn-success">Login</button> --> </form> </ul> </div> <!-- /.navbar-collapse --> </div> <!-- /.container-fluid --> </nav> <!-- /NAVBAR --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- HOME --> <div class="jumbotron" id="jumbotron"> <div class="container"> <br> <h1>Privacy Policy</h1> <br> <p>This privacy policy sets out how <a href="https://ch6832.github.io/prompt-engineering-experiments/">https://www.prompt-engineering-experiments.com</a> uses and protects any information that you give when you use this website.</p> <h2>1. Information We Collect</h2> <p>We may collect the following information:</p> <ul> <li>Information provided voluntarily by you, such as name and email address, when you sign up for our newsletter or submit a contact form.</li> <li>Automatically collected information, such as IP address, browser type, and referring website, through the use of cookies and similar technologies.</li> </ul> <h2>2. How We Use Information</h2> <p>We use the information we collect for the following purposes:</p> <ul> <li>To personalize your experience and deliver relevant content.</li> <li>To improve our website and services based on your feedback.</li> <li>To send periodic emails with updates, promotions, and other information you may find interesting.</li> </ul> <h2>3. Data Security</h2> <p>We are committed to ensuring that your information is secure. We have implemented appropriate technical and organizational measures to safeguard and secure the information we collect online.</p> <h2>4. Third-Party Links</h2> <p>Our website may contain links to third-party websites. These third-party websites have their own privacy policies, and we are not responsible for the privacy practices or content of such websites.</p> <h2>5. Your Rights</h2> <p>You have the right to:</p> <ul> <li>Request access to the personal information we hold about you.</li> <li>Request correction of any inaccuracies in your personal information.</li> <li>Request deletion of your personal information.</li> </ul> <h2>6. Changes to This Privacy Policy</h2> <p>We may update this privacy policy from time to time by posting a new version on this website. You should check this page occasionally to ensure you are happy with any changes.</p> <h2>7. Contact Us</h2> <p>If you have any questions or concerns about this privacy policy, please contact us at [email protected].</p> </div> </div> </body> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- FOOTER --> <!-- <div class="container" id="footer"> <div class="row"> <h2>Lade die App herunter!</h2> <p> <a href="" ><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/0/0f/Available_on_the_App_Store_%28black%29_SVG.svg/320px-Available_on_the_App_Store_%28black%29_SVG.svg.png" /></a> </p> </div> </div> --> <!-- <div class="container"> <div class="page-header"> <h1>Sticky footer</h1> </div> <p class="lead">Pin a fixed-height footer to the bottom of the viewport in desktop browsers with this custom HTML and CSS.</p> <p>Use <a href="../sticky-footer-navbar/">the sticky footer with a fixed navbar</a> if need be, too.</p> </div> --> <footer class="footer"> <div class="container"> <p> This site is goverend by the <a href="terms_of_use.html">Terms of Use</a> and <a href="#">Privacy Policy</a>. Copyright 2024 Christoph Hartleb. All Rights reserved. </p> </div> </footer> <!-- /FOOTER --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
0
repos/exploratory-tech-studio/tech-studio-projects/prompt-engineering-experiments
repos/exploratory-tech-studio/tech-studio-projects/prompt-engineering-experiments/legal/terms_of_use.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> <meta name="description" content="" /> <meta name="author" content="" /> <link rel="icon" href="../../favicon.ico" /> <link rel="canonical" href="https://getbootstrap.com/docs/3.4/examples/navbar-fixed-top/" /> <!-- Website title --> <title>Experimental PE-Project</title> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous" /> <!-- Optional theme --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap-theme.min.css" integrity="sha384-6pzBo3FDv/PJ8r2KRkGHifhEocL+1X2rVCTTkUfGk7/0pbek5mMa1upzvWbrUbOZ" crossorigin="anonymous" /> <!-- Bootstrap core CSS --> <!-- <link href="../../dist/css/bootstrap.min.css" rel="stylesheet"> --> <!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> <!-- <link href="../../assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet"> --> <!-- Custom styles for this template --> <!-- <link href="navbar-fixed-top.css" rel="stylesheet"> --> <!-- Just for debugging purposes. Don't actually copy these 2 lines! --> <!--[if lt IE 9 ]><script src="../../assets/js/ie8-responsive-file-warning.js"></script ><![endif]--> <!-- <script src="../../assets/js/ie-emulation-modes-warning.js"></script> --> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/html5shiv.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dest/respond.min.js"></script> <![endif]--> </head> <body data-spy="scroll" data-target="#navbar"> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- NAVBAR --> <nav class="navbar navbar-default navbar-fixed-top" id="navbar"> <div class="container-fluid"> <!-- Titel und Schalter werden für eine bessere mobile Ansicht zusammengefasst --> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false" > <span class="sr-only">Navigation ein-/ausblenden</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="../index.html">PROMPT ENGINEERING</a> </div> <!-- Alle Navigationslinks, Formulare und anderer Inhalt werden hier zusammengefasst und können dann ein- und ausgeblendet werden --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li> <a href="../index.html" >HOME <span class="sr-only">(aktuell)</span></a> </li> <li><a href="../index.html#mehrInfo">AI TOOLS</a></li> <!-- <li><a href="#footer">AI TOOLS</a></li> --> </ul> <ul class="nav navbar-nav navbar-right"> <form class="navbar-form navbar-left" role="search"> <div class="form-group"> <!-- <input type="email" class="form-control" placeholder="email" /> <input type="password" class="form-control" placeholder="passwort" /> --> <a href="https://www.linkedin.com/in/christoph-hartleb/"> <button type="button" class="btn btn-outline-secondary"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-linkedin" viewBox="0 0 16 16" > <path d="M0 1.146C0 .513.526 0 1.175 0h13.65C15.474 0 16 .513 16 1.146v13.708c0 .633-.526 1.146-1.175 1.146H1.175C.526 16 0 15.487 0 14.854zm4.943 12.248V6.169H2.542v7.225zm-1.2-8.212c.837 0 1.358-.554 1.358-1.248-.015-.709-.52-1.248-1.342-1.248S2.4 3.226 2.4 3.934c0 .694.521 1.248 1.327 1.248zm4.908 8.212V9.359c0-.216.016-.432.08-.586.173-.431.568-.878 1.232-.878.869 0 1.216.662 1.216 1.634v3.865h2.401V9.25c0-2.22-1.184-3.252-2.764-3.252-1.274 0-1.845.7-2.165 1.193v.025h-.016l.016-.025V6.169h-2.4c.03.678 0 7.225 0 7.225z" /> </svg> <span class="visually-hidden">Christoph Hartleb</span> </button></a > </div> <!-- <button type="submit" class="btn btn-success">Login</button> --> </form> </ul> </div> <!-- /.navbar-collapse --> </div> <!-- /.container-fluid --> </nav> <!-- /NAVBAR --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- HOME --> <div class="jumbotron" id="jumbotron"> <div class="container"> <br> <h1>Terms of Use</h1> <br> <p>Welcome to <a href="https://ch6832.github.io/prompt-engineering-experiments/">https://www.prompt-engineering-experiments.com</a>. By accessing this website, you agree to comply with and be bound by the following terms and conditions of use. Please read these terms carefully before using this website.</p> <h2>1. Use of Content</h2> <p>The content provided on this website is for informational purposes only. You may use the content for personal, non-commercial use only. Any other use, including but not limited to reproduction, distribution, or modification of the content, is prohibited without prior written consent.</p> <h2>2. Attribution</h2> <p>If you use any content from this website, you are required to attribute the original creator by providing a visible and clickable link back to <a href="https://ch6832.github.io/prompt-engineering-experiments/">https://www.prompt-engineering-experiments.com</a> or by clearly stating the original creator's name.</p> <h2>3. Intellectual Property</h2> <p>All intellectual property rights related to the content and materials on this website are owned by Private Ltd. or its licensors. Unauthorized use of any content or materials on this website may violate copyright, trademark, and other laws.</p> <h2>4. Disclaimer</h2> <p>The content on this website is provided on an "as is" basis. Private Ltd. makes no representations or warranties of any kind, express or implied, regarding the accuracy, completeness, suitability, or availability of the content. Your use of the content is at your own risk.</p> <h2>5. Limitation of Liability</h2> <p>In no event shall Private Ltd. be liable for any direct, indirect, incidental, special, or consequential damages arising out of or in any way connected with the use of this website or the content contained herein.</p> <h2>6. Governing Law</h2> <p>These terms and conditions shall be governed by and construed in accordance with the laws of [Your Jurisdiction]. Any disputes relating to these terms and conditions shall be subject to the exclusive jurisdiction of the courts of Austrian Court of Justice.</p> <h2>7. Changes to Terms</h2> <p>Private Ltd. reserves the right to modify or revise these terms of use at any time without prior notice. By using this website, you agree to be bound by the current version of these terms and conditions.</p> <p>If you have any questions about these terms of use, please contact us at [Your Contact Email Address].</p> </div> </div> </body> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- FOOTER --> <!-- <div class="container" id="footer"> <div class="row"> <h2>Lade die App herunter!</h2> <p> <a href="" ><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/0/0f/Available_on_the_App_Store_%28black%29_SVG.svg/320px-Available_on_the_App_Store_%28black%29_SVG.svg.png" /></a> </p> </div> </div> --> <!-- <div class="container"> <div class="page-header"> <h1>Sticky footer</h1> </div> <p class="lead">Pin a fixed-height footer to the bottom of the viewport in desktop browsers with this custom HTML and CSS.</p> <p>Use <a href="../sticky-footer-navbar/">the sticky footer with a fixed navbar</a> if need be, too.</p> </div> --> <footer class="footer"> <div class="container"> <p> This site is goverend by the <a href="#">Terms of Use</a> and <a href="privacy_policy.html">Privacy Policy</a>. Copyright 2024 Christoph Hartleb. All Rights reserved. </p> </div> </footer> <!-- /FOOTER --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
0
repos/exploratory-tech-studio/tech-studio-projects/prompt-engineering-experiments/ai
repos/exploratory-tech-studio/tech-studio-projects/prompt-engineering-experiments/ai/chatgpt-3.5/py-unit-testing-single-employee.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> <meta name="description" content="" /> <meta name="author" content="" /> <link rel="icon" href="../../favicon.ico" /> <link rel="canonical" href="https://getbootstrap.com/docs/3.4/examples/navbar-fixed-top/" /> <!-- Website title --> <title>Experimental PE-Project</title> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous" /> <!-- Optional theme --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap-theme.min.css" integrity="sha384-6pzBo3FDv/PJ8r2KRkGHifhEocL+1X2rVCTTkUfGk7/0pbek5mMa1upzvWbrUbOZ" crossorigin="anonymous" /> <!-- Bootstrap core CSS --> <!-- <link href="../../dist/css/bootstrap.min.css" rel="stylesheet"> --> <!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> <!-- <link href="../../assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet"> --> <!-- Custom styles for this template --> <!-- <link href="navbar-fixed-top.css" rel="stylesheet"> --> <!-- Just for debugging purposes. Don't actually copy these 2 lines! --> <!--[if lt IE 9 ]><script src="../../assets/js/ie8-responsive-file-warning.js"></script ><![endif]--> <!-- <script src="../../assets/js/ie-emulation-modes-warning.js"></script> --> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/html5shiv.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dest/respond.min.js"></script> <![endif]--> </head> <body data-spy="scroll" data-target="#navbar"> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- NAVBAR --> <nav class="navbar navbar-default navbar-fixed-top" id="navbar"> <div class="container-fluid"> <!-- Titel und Schalter werden für eine bessere mobile Ansicht zusammengefasst --> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false" > <span class="sr-only">Navigation ein-/ausblenden</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="../../index.html">PROMPT ENGINEERING</a> </div> <!-- Alle Navigationslinks, Formulare und anderer Inhalt werden hier zusammengefasst und können dann ein- und ausgeblendet werden --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li> <a href="../../index.html#jumbotron" >HOME <span class="sr-only">(aktuell)</span></a > </li> <li><a href="../../index.html#mehrInfo">AI TOOLS</a></li> <!-- <li><a href="#footer">AI TOOLS</a></li> --> </ul> <ul class="nav navbar-nav navbar-right"> <form class="navbar-form navbar-left" role="search"> <div class="form-group"> <!-- <input type="email" class="form-control" placeholder="email" /> <input type="password" class="form-control" placeholder="passwort" /> --> <a href="https://www.linkedin.com/in/christoph-hartleb/"> <button type="button" class="btn btn-outline-secondary"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-linkedin" viewBox="0 0 16 16" > <path d="M0 1.146C0 .513.526 0 1.175 0h13.65C15.474 0 16 .513 16 1.146v13.708c0 .633-.526 1.146-1.175 1.146H1.175C.526 16 0 15.487 0 14.854zm4.943 12.248V6.169H2.542v7.225zm-1.2-8.212c.837 0 1.358-.554 1.358-1.248-.015-.709-.52-1.248-1.342-1.248S2.4 3.226 2.4 3.934c0 .694.521 1.248 1.327 1.248zm4.908 8.212V9.359c0-.216.016-.432.08-.586.173-.431.568-.878 1.232-.878.869 0 1.216.662 1.216 1.634v3.865h2.401V9.25c0-2.22-1.184-3.252-2.764-3.252-1.274 0-1.845.7-2.165 1.193v.025h-.016l.016-.025V6.169h-2.4c.03.678 0 7.225 0 7.225z" /> </svg> <span class="visually-hidden">Christoph Hartleb</span> </button></a > </div> <!-- <button type="submit" class="btn btn-success">Login</button> --> </form> </ul> </div> <!-- /.navbar-collapse --> </div> <!-- /.container-fluid --> </nav> <!-- /NAVBAR --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- HOME --> <div class="jumbotron" id="jumbotron"> <div class="container"> <br> <br> <h2 style="color:seagreen;">Test engineer with python</h2> <br> <p> You work as an test engineer and conduct certain tests. How to do that and what to do it was asked and answered here. </p> <br> <br> <h2 style="color:seagreen;">Prompt history:</h2> <br> <md-block> ### USER INPUT: </md-block> <div style="background-color:white;border:15px solid white;"> <md-block > Imagine you are woking all alone in the Quality Assurance department and you are resposnible for testing the inhouse software. What tests would you conduct? How would you organize them? When would you run them and how would you run them. The test shoul dbe wirtten in python. Third-party libaries should be avoided whenever possible. The tests can easily run in the background. </md-block> </div> <br> <br> <md-block> ### OUTPUT: </md-block> <div style="background-color:white;border:15px solid white;"> <md-block> Testing in a Quality Assurance (QA) department involves various types of tests to ensure the software meets the desired quality standards. Here's how I would organize and conduct tests for in-house software using Python: 1. **Unit Tests:** - These tests focus on individual components or functions. - Organize unit tests into separate files corresponding to the modules they test. - Use Python's built-in `unittest` module for writing and running unit tests. ```python import unittest from module_to_test import function_to_test class TestModule(unittest.TestCase): def test_function(self): self.assertEqual(function_to_test(input), expected_output) if __name__ == '__main__': unittest.main() ``` 2. **Integration Tests:** - These tests ensure that different modules or components work together correctly. - Organize integration tests based on the integration points between modules. - Use the same `unittest` framework for integration tests. ```python class TestIntegration(unittest.TestCase): def test_integration(self): # Test integration of multiple modules pass if __name__ == '__main__': unittest.main() ``` 3. **Regression Tests:** - These tests verify that new code changes do not adversely affect existing functionality. - Organize regression tests by functionality or by the areas impacted by recent changes. - Run regression tests after each code change or periodically. ```python class TestRegression(unittest.TestCase): def test_regression(self): # Test functionality affected by recent changes pass if __name__ == '__main__': unittest.main() ``` 4. **Performance Tests:** - These tests evaluate the performance of the software under various conditions. - Organize performance tests based on different scenarios (e.g., normal load, peak load). - Use Python's `timeit` module or custom timing functions to measure performance. ```python def test_performance(): # Test performance under normal load pass if __name__ == '__main__': test_performance() ``` 5. **Security Tests:** - These tests check for vulnerabilities and ensure data protection. - Organize security tests based on different security aspects (e.g., authentication, data encryption). - Use Python's built-in modules for cryptographic operations and custom tests for vulnerabilities. ```python def test_security(): # Test security measures (e.g., authentication, encryption) pass if __name__ == '__main__': test_security() ``` 6. **User Acceptance Tests (UAT):** - These tests verify that the software meets the requirements and expectations of end-users. - Organize UAT cases based on user stories or use cases. - Perform UAT either manually or using automation frameworks like Selenium for web applications. ```python def test_uat(): # Test user acceptance criteria pass if __name__ == '__main__': test_uat() ``` To run these tests in the background, you can use continuous integration (CI) tools like Jenkins or GitLab CI. Set up jobs in these tools to automatically trigger test execution whenever there's a code change. Additionally, schedule periodic runs for regression, performance, and security tests to ensure continuous monitoring of software quality. </md-block> </div> <br> <br> <md-block> ### USER INPUT: </md-block> <div style="background-color:white;border:15px solid white;"> <md-block > Please provide an example of an integration test. </md-block> </div> <br> <br> <md-block> ### OUTPUT: </md-block> <div style="background-color:white;border:15px solid white;"> <md-block> Sure, here's an example of an integration test for an imaginary system that involves multiple modules: Let's say we have two modules: `calculator.py` and `database.py`. The `calculator.py` module performs calculations, and the `database.py` module interacts with a database to store and retrieve data. We want to write an integration test to ensure that the `calculator.py` module correctly retrieves data from the database using the `database.py` module. First, let's create the `calculator.py` module: ```python # calculator.py import database def add_from_database(a, b): data = database.get_data() return a + b + data ``` Next, let's create the `database.py` module: ```python # database.py def get_data(): # Imaginary function to retrieve data from the database return 10 ``` Now, let's write the integration test: ```python # test_integration.py import unittest from calculator import add_from_database class TestIntegration(unittest.TestCase): def test_add_from_database(self): # Assume the data retrieved from the database is 10 result = add_from_database(5, 7) # Expected result: 5 + 7 + 10 = 22 self.assertEqual(result, 22) if __name__ == '__main__': unittest.main() ``` In this integration test: - We import the `add_from_database` function from the `calculator.py` module. - We define a test case `test_add_from_database`. - Inside the test case, we call the `add_from_database` function with two values (5 and 7). - We assert that the result of the calculation matches our expected result (5 + 7 + 10 = 22). This test ensures that the `calculator.py` module correctly integrates with the `database.py` module by retrieving data from the database and performing calculations. </md-block> </div> <br> <br> <md-block> ### USER INPUT: </md-block> <div style="background-color:white;border:15px solid white;"> <md-block > Please provide a specific example of an regression test. </md-block> </div> <br> <br> <md-block> ### OUTPUT: </md-block> <div style="background-color:white;border:15px solid white;"> <md-block> Certainly! Let's consider a scenario where we have a function that calculates the average of a list of numbers. We want to write a regression test to ensure that the function behaves correctly after any changes are made to it. Here's the function we want to test: ```python # average.py def calculate_average(numbers): if not numbers: return 0 total = sum(numbers) return total / len(numbers) ``` Now, let's write a regression test for this function: ```python # test_regression.py import unittest from average import calculate_average class TestRegression(unittest.TestCase): def test_calculate_average_with_positive_numbers(self): numbers = [1, 2, 3, 4, 5] expected_result = 3.0 # (1 + 2 + 3 + 4 + 5) / 5 = 3.0 result = calculate_average(numbers) self.assertEqual(result, expected_result) def test_calculate_average_with_empty_list(self): numbers = [] expected_result = 0 result = calculate_average(numbers) self.assertEqual(result, expected_result) def test_calculate_average_with_negative_numbers(self): numbers = [-1, -2, -3, -4, -5] expected_result = -3.0 # (-1 + -2 + -3 + -4 + -5) / 5 = -3.0 result = calculate_average(numbers) self.assertEqual(result, expected_result) if __name__ == '__main__': unittest.main() ``` In this regression test: - We import the `calculate_average` function from the `average.py` module. - We define multiple test cases to cover different scenarios: - Testing with a list of positive numbers (`test_calculate_average_with_positive_numbers`). - Testing with an empty list (`test_calculate_average_with_empty_list`). - Testing with a list of negative numbers (`test_calculate_average_with_negative_numbers`). - For each test case, we define the input (`numbers`) and the expected output (`expected_result`). - We call the `calculate_average` function with the input and assert that the result matches the expected output. These regression tests ensure that the `calculate_average` function behaves correctly even after changes are made to it or to other parts of the codebase. </md-block> </div> <br> <br> <md-block> ### USER INPUT: </md-block> <div style="background-color:white;border:15px solid white;"> <md-block > Please provide a specific example of an preformance test. </md-block> </div> <br> <br> <md-block> ### OUTPUT: </md-block> <div style="background-color:white;border:15px solid white;"> <md-block> Certainly! Let's consider a scenario where we have a function that sorts a list of numbers. We want to write a performance test to measure the execution time of this function under different conditions. Here's the function we want to test: ```python # sort.py def bubble_sort(numbers): n = len(numbers) for i in range(n): for j in range(0, n-i-1): if numbers[j] > numbers[j+1]: numbers[j], numbers[j+1] = numbers[j+1], numbers[j] return numbers ``` Now, let's write a performance test for this function using Python's `timeit` module: ```python # test_performance.py import timeit from sort import bubble_sort def test_performance(): setup_code = ''' from sort import bubble_sort import random numbers = [random.randint(1, 1000) for _ in range(1000)] ''' # Measure execution time for sorting 1000 random numbers execution_time = timeit.timeit(stmt='bubble_sort(numbers)', setup=setup_code, number=10) print("Average Execution Time:", execution_time / 10, "seconds") if __name__ == '__main__': test_performance() ``` In this performance test: - We import the `bubble_sort` function from the `sort.py` module. - We generate a list of 1000 random numbers as input for the sorting function. - We use Python's `timeit` module to measure the execution time of sorting the list of numbers. - The `timeit.timeit()` function is called 10 times to get an average execution time. - We print the average execution time in seconds. You can adjust the size of the input list (`numbers`) and the number of repetitions in the `timeit.timeit()` function to perform performance testing under different conditions (e.g., sorting larger lists, running more repetitions). This test helps identify potential performance bottlenecks in the sorting algorithm and allows for optimization if necessary. </md-block> </div> <br> <br> <md-block> ### USER INPUT: </md-block> <div style="background-color:white;border:15px solid white;"> <md-block > Please provide a specific example of a security test. </md-block> </div> <md-block> ### OUTPUT: </md-block> <div style="background-color:white;border:15px solid white;"> <md-block> Sure, let's consider a simple example of a security test for a login system. We'll write a test to ensure that the login process properly handles invalid credentials and prevents unauthorized access. Suppose we have a `login.py` module that contains the login functionality: ```python # login.py def login(username, password): # Check if username and password match a valid user in the system valid_username = "user" valid_password = "password" if username == valid_username and password == valid_password: return True else: return False ``` Now, let's write a security test to verify that the login system prevents unauthorized access: ```python # test_security.py import unittest from login import login class TestSecurity(unittest.TestCase): def test_login_with_valid_credentials(self): # Test login with valid credentials result = login("user", "password") self.assertTrue(result) def test_login_with_invalid_username(self): # Test login with invalid username result = login("invalid_user", "password") self.assertFalse(result) def test_login_with_invalid_password(self): # Test login with invalid password result = login("user", "invalid_password") self.assertFalse(result) if __name__ == '__main__': unittest.main() ``` In this security test: - We import the `login` function from the `login.py` module. - We define multiple test cases to cover different scenarios: - Testing login with valid credentials (`test_login_with_valid_credentials`). - Testing login with an invalid username (`test_login_with_invalid_username`). - Testing login with an invalid password (`test_login_with_invalid_password`). - For each test case, we call the `login` function with the input and assert whether the result matches the expected outcome (True for successful login, False for unsuccessful login). This security test helps ensure that the login system properly handles invalid credentials and prevents unauthorized access, thus enhancing the security of the application. Additional security tests can be added to cover other aspects such as session management, password policies, and input validation. </md-block> </div> </div> </div> <!-- /HOME --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- FOOTER --> <footer class="footer"> <div class="container"> <p> This site is goverend by the <a href="../../legal/terms_of_use.html">Terms of Use</a> and <a href="../../legal/privacy_policy.html">Privacy Policy</a>. Copyright 2024 Christoph Hartleb. All Rights reserved. </p> </div> </footer> <!-- /FOOTER --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- Latest compiled and minified JavaScript --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"> </script> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script> <script type="module" src="https://md-block.verou.me/md-block.js"></script> </body>
0
repos/exploratory-tech-studio/tech-studio-projects/prompt-engineering-experiments/ai
repos/exploratory-tech-studio/tech-studio-projects/prompt-engineering-experiments/ai/chatgpt-3.5/entire-world-travel-itinerary.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> <meta name="description" content="" /> <meta name="author" content="" /> <link rel="icon" href="../../favicon.ico" /> <link rel="canonical" href="https://getbootstrap.com/docs/3.4/examples/navbar-fixed-top/" /> <!-- Website title --> <title>Experimental PE-Project</title> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous" /> <!-- Optional theme --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap-theme.min.css" integrity="sha384-6pzBo3FDv/PJ8r2KRkGHifhEocL+1X2rVCTTkUfGk7/0pbek5mMa1upzvWbrUbOZ" crossorigin="anonymous" /> <!-- Bootstrap core CSS --> <!-- <link href="../../dist/css/bootstrap.min.css" rel="stylesheet"> --> <!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> <!-- <link href="../../assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet"> --> <!-- Custom styles for this template --> <!-- <link href="navbar-fixed-top.css" rel="stylesheet"> --> <!-- Just for debugging purposes. Don't actually copy these 2 lines! --> <!--[if lt IE 9 ]><script src="../../assets/js/ie8-responsive-file-warning.js"></script ><![endif]--> <!-- <script src="../../assets/js/ie-emulation-modes-warning.js"></script> --> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/html5shiv.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dest/respond.min.js"></script> <![endif]--> </head> <body data-spy="scroll" data-target="#navbar"> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- NAVBAR --> <nav class="navbar navbar-default navbar-fixed-top" id="navbar"> <div class="container-fluid"> <!-- Titel und Schalter werden für eine bessere mobile Ansicht zusammengefasst --> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false" > <span class="sr-only">Navigation ein-/ausblenden</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="../../index.html">PROMPT ENGINEERING</a> </div> <!-- Alle Navigationslinks, Formulare und anderer Inhalt werden hier zusammengefasst und können dann ein- und ausgeblendet werden --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li> <a href="../../index.html#jumbotron" >HOME <span class="sr-only">(aktuell)</span></a > </li> <li><a href="../../index.html#mehrInfo">AI TOOLS</a></li> <!-- <li><a href="#footer">AI TOOLS</a></li> --> </ul> <ul class="nav navbar-nav navbar-right"> <form class="navbar-form navbar-left" role="search"> <div class="form-group"> <!-- <input type="email" class="form-control" placeholder="email" /> <input type="password" class="form-control" placeholder="passwort" /> --> <a href="https://www.linkedin.com/in/christoph-hartleb/"> <button type="button" class="btn btn-outline-secondary"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-linkedin" viewBox="0 0 16 16" > <path d="M0 1.146C0 .513.526 0 1.175 0h13.65C15.474 0 16 .513 16 1.146v13.708c0 .633-.526 1.146-1.175 1.146H1.175C.526 16 0 15.487 0 14.854zm4.943 12.248V6.169H2.542v7.225zm-1.2-8.212c.837 0 1.358-.554 1.358-1.248-.015-.709-.52-1.248-1.342-1.248S2.4 3.226 2.4 3.934c0 .694.521 1.248 1.327 1.248zm4.908 8.212V9.359c0-.216.016-.432.08-.586.173-.431.568-.878 1.232-.878.869 0 1.216.662 1.216 1.634v3.865h2.401V9.25c0-2.22-1.184-3.252-2.764-3.252-1.274 0-1.845.7-2.165 1.193v.025h-.016l.016-.025V6.169h-2.4c.03.678 0 7.225 0 7.225z" /> </svg> <span class="visually-hidden">Christoph Hartleb</span> </button></a > </div> <!-- <button type="submit" class="btn btn-success">Login</button> --> </form> </ul> </div> <!-- /.navbar-collapse --> </div> <!-- /.container-fluid --> </nav> <!-- /NAVBAR --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- HOME --> <div class="jumbotron" id="jumbotron"> <div class="container"> <br> <br> <h2 style="color:seagreen;">Travel the entire world</h2> <br> <p> An entire travel itinerary for the entire globe. </p> <br> <br> <h2 style="color:seagreen;">Prompt history:</h2> <br> <br> <md-block> ### USER INPUT: </md-block> <div style="background-color:white;border:15px solid white;"> <md-block > You are a decorated travel expert. You travelled all over the globe and visited almost every major city on the entire planet. Please plan an entire world trip for me and cosider the following: Everything must be low-cost because I have a ver limited budget. I want to visit capitals only such as Lissaboa, Madrid, Barceloona, Paris London, Vienna, Budapest, Bratislave, Athens, Istanbul, Kario, Jerusalem, Bagdad, Katar, Dubai, New Dheli, Kadmandu, Moscow, Hongkong, Shanghai, Tokayo, San Francisco, San Diego, Los Angelos, Houston, Austin, New Orleans, Atlanta Orlando, New York City, Boston. I leave the rest up to you. </md-block> </div> <br> <br> <md-block> ### OUTPUT: </md-block> <div style="background-color:white;border:15px solid white;"> <md-block> Planning a low-cost world trip covering all these capitals requires some strategic thinking and prioritizing budget-friendly options. Let's craft an itinerary that maximizes affordability while still providing a diverse and memorable experience: ### Europe: 1. **Lisbon, Portugal:** - Stay in budget hostels or consider Airbnb for affordable accommodation options. - Explore the historic neighborhoods such as Alfama and Bairro Alto. 2. **Madrid, Spain:** - Opt for budget accommodations in the city center or near public transportation. - Visit the Prado Museum during free hours or enjoy free walking tours. 3. **Barcelona, Spain:** - Stay in hostels in areas like Gràcia or El Raval. - Enjoy free attractions like Park Güell, Gothic Quarter, and La Barceloneta Beach. 4. **Paris, France:** - Look for budget hotels or hostels in Montmartre or Belleville. - Enjoy free attractions like Notre Dame Cathedral, Sacré-Cœur Basilica, and the Luxembourg Gardens. 5. **London, United Kingdom:** - Stay in budget accommodations in areas like King's Cross or Camden. - Explore free museums like the British Museum, Tate Modern, and the National Gallery. ### Eastern Europe: 6. **Vienna, Austria:** - Stay in budget accommodations in areas like Favoriten or Leopoldstadt. - Visit free attractions like St. Stephen's Cathedral and the Naschmarkt. 7. **Budapest, Hungary:** - Stay in affordable hostels in the Jewish Quarter or District VII. - Enjoy free attractions like Buda Castle, Fisherman's Bastion, and the Chain Bridge. 8. **Bratislava, Slovakia:** - Look for budget accommodations in the Old Town area. - Explore attractions like Bratislava Castle and St. Martin's Cathedral. ### Middle East: 9. **Athens, Greece:** - Stay in budget accommodations in areas like Plaka or Psiri. - Visit free attractions like the Acropolis and the Ancient Agora. 10. **Istanbul, Turkey:** - Stay in budget accommodations in areas like Sultanahmet or Beyoglu. - Explore attractions like the Hagia Sophia, Blue Mosque, and Grand Bazaar. 11. **Cairo, Egypt:** - Look for budget accommodations in Downtown Cairo. - Visit attractions like the Giza Pyramids and the Egyptian Museum. ### Asia: 12. **Jerusalem, Israel:** - Stay in budget accommodations in the Old City or West Jerusalem. - Explore attractions like the Western Wall and the Church of the Holy Sepulchre. 13. **Baghdad, Iraq:** - Due to safety concerns, consider a day trip from a nearby city like Amman, Jordan. 14. **Doha, Qatar:** - Stay in budget accommodations in areas like Al Sadd or Al Najada. - Explore attractions like the Souq Waqif and the Corniche. 15. **Dubai, United Arab Emirates:** - Look for budget accommodations in areas like Deira or Bur Dubai. - Visit attractions like Jumeirah Beach and the Dubai Fountain. ### South Asia: 16. **New Delhi, India:** - Stay in budget accommodations in areas like Paharganj or Karol Bagh. - Explore attractions like the Red Fort, India Gate, and Jama Masjid. 17. **Kathmandu, Nepal:** - Look for budget accommodations in Thamel or Boudhanath. - Visit attractions like Swayambhunath (Monkey Temple) and Boudhanath Stupa. ### East Asia: 18. **Moscow, Russia:** - Stay in budget accommodations in areas like Arbat or Zamoskvorechye. - Explore attractions like Red Square and the Kremlin. 19. **Hong Kong, China:** - Consider staying in budget hostels in areas like Tsim Sha Tsui or Mong Kok. - Visit attractions like Victoria Peak and the Star Ferry. 20. **Shanghai, China:** - Look for budget accommodations in areas like Jing'an or Zhabei. - Explore attractions like the Bund and Yu Garden. ### North America: 21. **San Francisco, USA:** - Stay in budget accommodations in areas like the Tenderloin or Mission District. - Explore attractions like Golden Gate Park and Fisherman's Wharf. 22. **San Diego, USA:** - Look for budget accommodations in areas like Gaslamp Quarter or Hillcrest. - Visit attractions like Balboa Park and La Jolla Cove. 23. **Los Angeles, USA:** - Stay in budget accommodations in areas like Hollywood or Koreatown. - Explore attractions like Venice Beach and Griffith Observatory. 24. **Houston, USA:** - Look for budget accommodations in areas like Midtown or Montrose. - Visit attractions like the Space Center Houston and Hermann Park. 25. **Austin, USA:** - Stay in budget accommodations in areas like East Austin or South Congress. - Explore attractions like Zilker Park and the Texas State Capitol. 26. **New Orleans, USA:** - Look for budget accommodations in areas like the French Quarter or Marigny. - Visit attractions like Jackson Square and Frenchmen Street. 27. **Atlanta, USA:** - Stay in budget accommodations in areas like Midtown or Downtown. - Explore attractions like the Martin Luther King Jr. National Historic Site and Piedmont Park. 28. **Orlando, USA:** - Look for budget accommodations near International Drive or Kissimmee. - Visit attractions like Universal Studios and Walt Disney World. 29. **New York City, USA:** - Stay in budget accommodations in areas like Harlem or Brooklyn. - Explore attractions like Central Park and Times Square. 30. **Boston, USA:** - Look for budget accommodations in areas like Fenway or Back Bay. - Visit attractions like the Freedom Trail and Harvard Square. ### Itinerary Summary: - Be flexible with travel dates to take advantage of low-cost flights and accommodations. - Utilize budget airlines, public transportation, and walking to minimize transportation costs. - Consider purchasing city passes or museum passes where available to save money on attractions. - Look for free walking tours or self-guided walking itineraries to explore each city on a budget. - Research local markets and street food options for affordable dining experiences. With careful planning and prioritizing budget-friendly options, you can embark on an unforgettable world trip without breaking the bank. Safe travels! </md-block> </div> <br> <br> <md-block> ### USER INPUT: </md-block> <div style="background-color:white;border:15px solid white;"> <md-block > Could you provide a specific route on how to do that itinerary? </md-block> </div> <br> <br> <md-block> ### OUTPUT: </md-block> <div style="background-color:white;border:15px solid white;"> <md-block> Certainly! Here's a suggested route for your world trip itinerary, optimized for cost efficiency and logistical ease: 1. Start in **Europe**: - Lisbon, Portugal - Madrid, Spain - Barcelona, Spain - Paris, France - London, United Kingdom - Vienna, Austria - Budapest, Hungary - Bratislava, Slovakia 2. Move to the **Middle East**: - Athens, Greece - Istanbul, Turkey - Cairo, Egypt - Jerusalem, Israel 3. Continue to **Asia**: - Dubai, United Arab Emirates - New Delhi, India - Kathmandu, Nepal - Moscow, Russia - Hong Kong, China - Shanghai, China 4. Journey to **North America**: - San Francisco, USA - San Diego, USA - Los Angeles, USA - Houston, USA - Austin, USA - New Orleans, USA - Atlanta, USA - Orlando, USA - New York City, USA - Boston, USA ### Travel Tips: - Plan your flights strategically to minimize costs. Look for multi-city flight options or consider using budget airlines for shorter flights within Europe and Asia. - Use buses or trains for shorter distances between nearby cities, especially in Europe and parts of Asia where transportation networks are well-developed. - Consider using overnight buses or trains for longer journeys to save on accommodation costs. - Opt for budget accommodations like hostels, guesthouses, or Airbnb rentals. Book in advance to secure the best deals. - Take advantage of free walking tours, city passes, and discounts for attractions to make the most of your sightseeing while keeping costs down. By following this route and implementing cost-saving strategies, you can embark on an exciting world trip without exceeding your budget. Safe travels! </md-block> </div> <br> <br> <md-block> ### USER INPUT: </md-block> <div style="background-color:white;border:15px solid white;"> <md-block > What budget would you recommend for the journey? </md-block> </div> <br> <br> <md-block> ### OUTPUT: </md-block> <div style="background-color:white;border:15px solid white;"> <md-block> Determining an exact budget for a journey of this scale can vary greatly depending on several factors, including your travel style, preferences, duration of stay in each location, and the level of comfort you're willing to forgo for cost savings. However, I can provide a rough estimate for a budget traveler based on average costs in each region: 1. **Europe**: Budget approximately $50-70 USD per day for accommodation, $15-30 USD for food, and additional expenses for transportation and sightseeing. 2. **Middle East**: Budget approximately $40-60 USD per day for accommodation, $10-25 USD for food, and additional expenses for transportation and sightseeing. 3. **Asia**: Budget approximately $20-40 USD per day for accommodation, $5-15 USD for food, and additional expenses for transportation and sightseeing. 4. **North America**: Budget approximately $50-100 USD per day for accommodation, $15-30 USD for food, and additional expenses for transportation and sightseeing. Keep in mind that these are rough estimates and costs can vary significantly depending on factors such as the city you're visiting, the time of year, and your personal spending habits. For a comprehensive journey covering all the cities listed in your itinerary, a rough total budget range could be between $10,000 to $20,000 USD for several months of travel. This estimate includes accommodation, food, transportation between cities, sightseeing activities, visa fees (if applicable), and a buffer for unexpected expenses. To refine your budget further, research specific costs for accommodations, transportation, and attractions in each city you plan to visit. Look for ways to minimize expenses, such as opting for budget accommodations, cooking some of your meals, and taking advantage of free or low-cost activities. Additionally, consider any additional expenses such as travel insurance, visa fees, and souvenirs. Ultimately, your budget should be tailored to your individual needs, preferences, and financial situation. Be sure to plan and budget accordingly to ensure a smooth and enjoyable journey within your means. </md-block> </div> <br> <br> <md-block> ### USER INPUT: </md-block> <div style="background-color:white;border:15px solid white;"> <md-block > What are the dangers I have to keep in mind? </md-block> </div> <br> <br> <md-block> ### OUTPUT: </md-block> <div style="background-color:white;border:15px solid white;"> <md-block> When embarking on a world trip, especially on a budget, it's important to be aware of potential dangers and take precautions to ensure your safety and well-being. Here are some common dangers to keep in mind: 1. **Safety Concerns**: Some destinations may have higher crime rates or safety concerns, especially in certain neighborhoods or areas. Be cautious and vigilant, particularly in crowded tourist areas where pickpocketing and theft are more common. 2. **Health Risks**: Traveling exposes you to different climates, environments, and diseases. Research health risks such as infectious diseases, food and water safety, and environmental hazards (like extreme weather or natural disasters) in each destination. Take necessary vaccinations, carry any required medications, and practice good hygiene to minimize health risks. 3. **Scams and Tourist Traps**: Tourist-heavy areas are often targeted by scammers looking to take advantage of unsuspecting travelers. Be wary of common scams such as overcharging for goods or services, fake tour operators, and distraction thefts. Research common scams in each destination and stay informed to avoid falling victim. 4. **Political Instability**: Some regions may have political unrest, demonstrations, or conflicts that could affect travelers' safety. Stay updated on current events and travel advisories issued by your government or reputable sources. Avoid participating in political activities or demonstrations, and steer clear of areas with known instability. 5. **Transportation Risks**: Transportation safety can vary widely between countries and regions. Be cautious when using public transportation, especially in crowded or unfamiliar areas. Research reputable transportation options and choose licensed providers with good safety records. Practice road safety and use reputable taxi services. 6. **Cultural Sensitivities**: Different cultures have different customs, traditions, and social norms. Respect local customs and traditions, dress modestly where appropriate, and be mindful of cultural sensitivities to avoid unintentionally offending locals. 7. **Natural Disasters**: Some regions are prone to natural disasters such as earthquakes, hurricanes, floods, or wildfires. Research potential natural hazards in each destination and have a plan in place in case of emergency. Stay informed about local weather conditions and heed any evacuation warnings or advisories. 8. **Travel Documentation**: Ensure you have all necessary travel documentation, including passports, visas, and any required permits or certificates. Keep copies of important documents and store them securely, and consider registering with your embassy or consulate in each destination for emergency assistance. By staying informed, exercising caution, and taking necessary precautions, you can minimize risks and enjoy a safe and memorable world trip. Be proactive in your planning and remain adaptable to unexpected situations, and always trust your instincts if something feels unsafe or uncomfortable. </md-block> </div> <br> <br> <md-block> ### USER INPUT: </md-block> <div style="background-color:white;border:15px solid white;"> <md-block > What vaccinations do I need upfront? </md-block> </div> <br> <br> <md-block> ### OUTPUT: </md-block> <div style="background-color:white;border:15px solid white;"> <md-block> The specific vaccinations you'll need for your world trip will depend on the destinations you plan to visit, the duration of your stay, your medical history, and any pre-existing health conditions. However, there are several common vaccinations recommended for travelers to various regions around the world. Here are some of the most frequently recommended vaccinations: 1. **Routine Vaccinations**: Ensure your routine vaccinations are up to date. These may include vaccines for measles, mumps, rubella (MMR), diphtheria, tetanus, pertussis (whooping cough), polio, and influenza. 2. **Hepatitis A and Hepatitis B**: Recommended for travelers to regions with poor sanitation or where hepatitis is endemic, such as parts of Asia, Africa, and South America. Hepatitis A is usually given as a single shot, while Hepatitis B is a series of shots. 3. **Typhoid Fever**: Recommended for travelers to regions with poor sanitation or where typhoid is common, such as parts of Asia, Africa, and South America. Typhoid vaccine is available as an injection or oral capsules. 4. **Yellow Fever**: Required for travelers visiting certain countries in sub-Saharan Africa and tropical South America where yellow fever is endemic. Some countries may require proof of yellow fever vaccination for entry. 5. **Rabies**: Recommended for travelers to regions where rabies is prevalent, especially if you'll be spending extended periods outdoors or in rural areas where access to medical care may be limited. Rabies vaccine is given in a series of shots. 6. **Japanese Encephalitis**: Recommended for travelers to rural areas of Asia, particularly during the transmission season. Japanese encephalitis vaccine is given in a series of shots. 7. **Meningococcal Disease**: Recommended for travelers to regions where meningococcal disease is common, especially during outbreaks or in crowded settings. Meningococcal vaccine may be required for entry into certain countries. 8. **Cholera**: Recommended for travelers to regions with ongoing cholera outbreaks or where cholera is endemic, particularly in parts of Africa, Asia, and Haiti. Cholera vaccine is available as an oral vaccine. 9. **Tuberculosis (TB)**: Depending on your destination and activities, you may need a TB vaccine or screening test, especially if you'll be spending extended periods in high-risk areas or close contact with local populations. Before your trip, consult with a healthcare provider or travel medicine specialist to assess your individual vaccination needs based on your itinerary, medical history, and any specific health concerns. It's best to plan and receive vaccinations well in advance of your trip, as some vaccines may require multiple doses or take time to become effective. </md-block> </div> <br> <br> <md-block> ### USER INPUT: </md-block> <div style="background-color:white;border:15px solid white;"> <md-block > Anything else that I am missing? </md-block> </div> <br> <br> <md-block> ### OUTPUT: </md-block> <div style="background-color:white;border:15px solid white;"> <md-block> In addition to vaccinations, there are several other important aspects to consider when planning for your world trip. Here are some key factors you shouldn't overlook: 1. **Travel Insurance**: Purchase comprehensive travel insurance to cover medical expenses, trip cancellations, lost luggage, and other unforeseen emergencies. Make sure the policy provides adequate coverage for the duration and activities of your trip, including any adventure or high-risk activities. 2. **Prescription Medications**: Ensure you have an ample supply of any prescription medications you'll need for the duration of your trip. Pack them in your carry-on luggage along with a copy of your prescription, and research any restrictions or documentation requirements for bringing medications into each country you'll visit. 3. **Health and Safety Precautions**: Research potential health risks and safety concerns in each destination, such as food and water safety, insect-borne diseases, altitude sickness, and local hazards. Take appropriate precautions, such as practicing safe food and water hygiene, using insect repellent, and avoiding risky activities. 4. **Emergency Contacts and Medical Facilities**: Compile a list of emergency contacts, including local emergency services, your embassy or consulate, and any healthcare providers or clinics in each destination. Familiarize yourself with the location of medical facilities and pharmacies in case of emergencies. 5. **Currency and Financial Planning**: Plan your budget and ensure you have access to funds while traveling. Carry a mix of cash and cards, and notify your bank of your travel plans to avoid any issues with using your cards abroad. Research currency exchange rates and banking fees to minimize costs. 6. **Travel Documents and Identification**: Ensure you have all necessary travel documents, including passports, visas, travel permits, and proof of onward travel. Make copies of important documents and store them securely, both physically and digitally. 7. **Communication and Connectivity**: Arrange for international roaming or purchase a local SIM card in each destination to stay connected with family and friends, access maps and travel apps, and communicate in case of emergencies. Familiarize yourself with local customs and etiquette for communication. 8. **Cultural and Environmental Considerations**: Respect local customs, traditions, and cultural norms in each destination. Dress modestly where appropriate, observe local customs regarding greetings and gestures, and be mindful of cultural sensitivities. Respect the environment and minimize your impact on local ecosystems and communities. 9. **Emergency Preparedness**: Have a plan in place for emergencies, including natural disasters, medical emergencies, and security incidents. Know evacuation routes, emergency assembly points, and communication protocols. Stay informed about local developments and heed any travel advisories or warnings. By addressing these aspects and taking necessary precautions, you can help ensure a smooth and enjoyable world trip while minimizing risks and maximizing your travel experience. Safe travels! </md-block> </div> <br> <br> </div> </div> <!-- /HOME --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- FOOTER --> <footer class="footer"> <div class="container"> <p> This site is goverend by the <a href="../../legal/terms_of_use.html">Terms of Use</a> and <a href="../../legal/privacy_policy.html">Privacy Policy</a>. Copyright 2024 Christoph Hartleb. All Rights reserved. </p> </div> </footer> <!-- /FOOTER --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- Latest compiled and minified JavaScript --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"> </script> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script> <script type="module" src="https://md-block.verou.me/md-block.js"></script> </body>
0
repos/exploratory-tech-studio/tech-studio-projects/prompt-engineering-experiments/ai
repos/exploratory-tech-studio/tech-studio-projects/prompt-engineering-experiments/ai/chatgpt-3.5/prepare-meal-with-ingredients-you-have.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> <meta name="description" content="" /> <meta name="author" content="" /> <link rel="icon" href="../../favicon.ico" /> <link rel="canonical" href="https://getbootstrap.com/docs/3.4/examples/navbar-fixed-top/" /> <!-- Website title --> <title>Experimental PE-Project</title> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous" /> <!-- Optional theme --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap-theme.min.css" integrity="sha384-6pzBo3FDv/PJ8r2KRkGHifhEocL+1X2rVCTTkUfGk7/0pbek5mMa1upzvWbrUbOZ" crossorigin="anonymous" /> <!-- Bootstrap core CSS --> <!-- <link href="../../dist/css/bootstrap.min.css" rel="stylesheet"> --> <!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> <!-- <link href="../../assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet"> --> <!-- Custom styles for this template --> <!-- <link href="navbar-fixed-top.css" rel="stylesheet"> --> <!-- Just for debugging purposes. Don't actually copy these 2 lines! --> <!--[if lt IE 9 ]><script src="../../assets/js/ie8-responsive-file-warning.js"></script ><![endif]--> <!-- <script src="../../assets/js/ie-emulation-modes-warning.js"></script> --> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/html5shiv.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dest/respond.min.js"></script> <![endif]--> </head> <body data-spy="scroll" data-target="#navbar"> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- NAVBAR --> <nav class="navbar navbar-default navbar-fixed-top" id="navbar"> <div class="container-fluid"> <!-- Titel und Schalter werden für eine bessere mobile Ansicht zusammengefasst --> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false" > <span class="sr-only">Navigation ein-/ausblenden</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="../../index.html">PROMPT ENGINEERING</a> </div> <!-- Alle Navigationslinks, Formulare und anderer Inhalt werden hier zusammengefasst und können dann ein- und ausgeblendet werden --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li> <a href="../../index.html#jumbotron" >HOME <span class="sr-only">(aktuell)</span></a > </li> <li><a href="../../index.html#mehrInfo">AI TOOLS</a></li> <!-- <li><a href="#footer">AI TOOLS</a></li> --> </ul> <ul class="nav navbar-nav navbar-right"> <form class="navbar-form navbar-left" role="search"> <div class="form-group"> <!-- <input type="email" class="form-control" placeholder="email" /> <input type="password" class="form-control" placeholder="passwort" /> --> <a href="https://www.linkedin.com/in/christoph-hartleb/"> <button type="button" class="btn btn-outline-secondary"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-linkedin" viewBox="0 0 16 16" > <path d="M0 1.146C0 .513.526 0 1.175 0h13.65C15.474 0 16 .513 16 1.146v13.708c0 .633-.526 1.146-1.175 1.146H1.175C.526 16 0 15.487 0 14.854zm4.943 12.248V6.169H2.542v7.225zm-1.2-8.212c.837 0 1.358-.554 1.358-1.248-.015-.709-.52-1.248-1.342-1.248S2.4 3.226 2.4 3.934c0 .694.521 1.248 1.327 1.248zm4.908 8.212V9.359c0-.216.016-.432.08-.586.173-.431.568-.878 1.232-.878.869 0 1.216.662 1.216 1.634v3.865h2.401V9.25c0-2.22-1.184-3.252-2.764-3.252-1.274 0-1.845.7-2.165 1.193v.025h-.016l.016-.025V6.169h-2.4c.03.678 0 7.225 0 7.225z" /> </svg> <span class="visually-hidden">Christoph Hartleb</span> </button></a > </div> <!-- <button type="submit" class="btn btn-success">Login</button> --> </form> </ul> </div> <!-- /.navbar-collapse --> </div> <!-- /.container-fluid --> </nav> <!-- /NAVBAR --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- HOME --> <div class="jumbotron" id="jumbotron"> <div class="container"> <br> <br> <h2 style="color:seagreen;">Meal preparation</h2> <br> <p> Prepare a meal with available ingredients in the house. </p> <br> <br> <h2 style="color:seagreen;">Prompt history:</h2> <br> <br> <md-block> ### USER INPUT: </md-block> <div style="background-color:white;border:15px solid white;"> <md-block > I have o clue about cooking. Please prepare a meal with the following: 3x bananas, 3x apples, 3x pears, 1kg of noodles, tomates, onions, all sorts of spicies, 200 gramm of chopped beef, 250g of yogurt and 1 litre of ovamaltine.. </md-block> </div> <br> <br> <md-block> ### OUTPUT: </md-block> <div style="background-color:white;border:15px solid white;"> <md-block> With those ingredients, let's create a delicious meal! How about a fruity beef stir-fry with noodles, served with a side of tomato and onion salad, topped with a yogurt dressing? And for dessert, we can make a refreshing banana, apple, and pear smoothie using the Ovomaltine for a unique twist! Here's the breakdown: ### Fruity Beef Stir-Fry with Noodles: #### Ingredients: - 200g chopped beef - 1kg noodles - 3 bananas - 3 apples - 3 pears - Tomatoes - Onions - Assorted spices (like salt, pepper, garlic powder, and chili flakes) - Cooking oil #### Instructions: 1. **Prepare the Ingredients:** - Slice the bananas, apples, and pears into thin wedges. - Chop the tomatoes and onions. - Cook the noodles according to the package instructions and set aside. 2. **Cook the Beef:** - Heat some oil in a pan over medium-high heat. - Add the chopped beef and cook until browned and cooked through. - Season with salt, pepper, and any other spices you like. 3. **Stir-Fry with Fruits:** - Push the beef to one side of the pan and add a bit more oil if needed. - Add the sliced bananas, apples, and pears to the pan. - Stir-fry until the fruits are slightly caramelized and tender. 4. **Combine with Noodles:** - Once the fruits are cooked, mix them with the beef in the pan. - Add the cooked noodles to the pan and toss everything together until well combined. 5. **Serve:** - Serve the fruity beef stir-fry hot, garnished with some fresh herbs if desired. ### Tomato and Onion Salad with Yogurt Dressing: #### Ingredients: - Tomatoes - Onions - 250g yogurt - Assorted spices (like salt, pepper, garlic powder, and dried herbs) #### Instructions: 1. **Prepare the Salad:** - Slice the tomatoes and onions thinly. 2. **Make the Dressing:** - In a bowl, combine the yogurt with salt, pepper, garlic powder, and any other spices you like. Mix well to make a smooth dressing. 3. **Assemble:** - Arrange the sliced tomatoes and onions on a serving plate. - Drizzle the yogurt dressing over the salad. 4. **Serve:** - Serve the tomato and onion salad as a refreshing side dish. ### Banana, Apple, and Pear Smoothie with Ovomaltine: #### Ingredients: - 3 bananas - 3 apples - 3 pears - 1 litre Ovomaltine #### Instructions: 1. **Blend the Fruits:** - Peel and chop the bananas, apples, and pears. - Place them in a blender. 2. **Add Ovomaltine:** - Pour the Ovomaltine into the blender with the fruits. 3. **Blend Until Smooth:** - Blend everything together until smooth and creamy. 4. **Serve:** - Pour the smoothie into glasses and serve immediately. Enjoy your delicious and nutritious meal! If you have any questions or need further assistance, feel free to ask. </md-block> </div> <br> <br> </div> </div> <!-- /HOME --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- FOOTER --> <footer class="footer"> <div class="container"> <p> This site is goverend by the <a href="../../legal/terms_of_use.html">Terms of Use</a> and <a href="../../legal/privacy_policy.html">Privacy Policy</a>. Copyright 2024 Christoph Hartleb. All Rights reserved. </p> </div> </footer> <!-- /FOOTER --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- Latest compiled and minified JavaScript --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"> </script> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script> <script type="module" src="https://md-block.verou.me/md-block.js"></script> </body>
0
repos/exploratory-tech-studio/tech-studio-projects/prompt-engineering-experiments/ai
repos/exploratory-tech-studio/tech-studio-projects/prompt-engineering-experiments/ai/chatgpt-3.5/fully-functiona-xbrl-taxonomy.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> <meta name="description" content="" /> <meta name="author" content="" /> <link rel="icon" href="../../favicon.ico" /> <link rel="canonical" href="https://getbootstrap.com/docs/3.4/examples/navbar-fixed-top/" /> <!-- Website title --> <title>Experimental PE-Project</title> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous" /> <!-- Optional theme --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap-theme.min.css" integrity="sha384-6pzBo3FDv/PJ8r2KRkGHifhEocL+1X2rVCTTkUfGk7/0pbek5mMa1upzvWbrUbOZ" crossorigin="anonymous" /> <!-- Bootstrap core CSS --> <!-- <link href="../../dist/css/bootstrap.min.css" rel="stylesheet"> --> <!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> <!-- <link href="../../assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet"> --> <!-- Custom styles for this template --> <!-- <link href="navbar-fixed-top.css" rel="stylesheet"> --> <!-- Just for debugging purposes. Don't actually copy these 2 lines! --> <!--[if lt IE 9 ]><script src="../../assets/js/ie8-responsive-file-warning.js"></script ><![endif]--> <!-- <script src="../../assets/js/ie-emulation-modes-warning.js"></script> --> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/html5shiv.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dest/respond.min.js"></script> <![endif]--> </head> <body data-spy="scroll" data-target="#navbar"> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- NAVBAR --> <nav class="navbar navbar-default navbar-fixed-top" id="navbar"> <div class="container-fluid"> <!-- Titel und Schalter werden für eine bessere mobile Ansicht zusammengefasst --> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false" > <span class="sr-only">Navigation ein-/ausblenden</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="../../index.html">PROMPT ENGINEERING</a> </div> <!-- Alle Navigationslinks, Formulare und anderer Inhalt werden hier zusammengefasst und können dann ein- und ausgeblendet werden --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li> <a href="../../index.html#jumbotron" >HOME <span class="sr-only">(aktuell)</span></a > </li> <li><a href="../../index.html#mehrInfo">AI TOOLS</a></li> <!-- <li><a href="#footer">AI TOOLS</a></li> --> </ul> <ul class="nav navbar-nav navbar-right"> <form class="navbar-form navbar-left" role="search"> <div class="form-group"> <!-- <input type="email" class="form-control" placeholder="email" /> <input type="password" class="form-control" placeholder="passwort" /> --> <a href="https://www.linkedin.com/in/christoph-hartleb/"> <button type="button" class="btn btn-outline-secondary"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-linkedin" viewBox="0 0 16 16" > <path d="M0 1.146C0 .513.526 0 1.175 0h13.65C15.474 0 16 .513 16 1.146v13.708c0 .633-.526 1.146-1.175 1.146H1.175C.526 16 0 15.487 0 14.854zm4.943 12.248V6.169H2.542v7.225zm-1.2-8.212c.837 0 1.358-.554 1.358-1.248-.015-.709-.52-1.248-1.342-1.248S2.4 3.226 2.4 3.934c0 .694.521 1.248 1.327 1.248zm4.908 8.212V9.359c0-.216.016-.432.08-.586.173-.431.568-.878 1.232-.878.869 0 1.216.662 1.216 1.634v3.865h2.401V9.25c0-2.22-1.184-3.252-2.764-3.252-1.274 0-1.845.7-2.165 1.193v.025h-.016l.016-.025V6.169h-2.4c.03.678 0 7.225 0 7.225z" /> </svg> <span class="visually-hidden">Christoph Hartleb</span> </button></a > </div> <!-- <button type="submit" class="btn btn-success">Login</button> --> </form> </ul> </div> <!-- /.navbar-collapse --> </div> <!-- /.container-fluid --> </nav> <!-- /NAVBAR --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- HOME --> <div class="jumbotron" id="jumbotron"> <div class="container"> <br> <br> <h2 style="color:seagreen;">Fully functional xbrl taxonomy</h2> <br> <p> A fully functional taxonomy created with relevant linkabses included. </p> <br> <br> <h2 style="color:seagreen;">Prompt history:</h2> <br> <br> <md-block> ### USER INPUT: </md-block> <div style="background-color:white;border:15px solid white;"> <md-block > You are an XBRL Expert with 20+ years experience in xbrl taxonomy developmnet. Please provide a fully working xbrl taonomy with entrypoint and relevant linkbases such as label linkbase, table linkbase, defintion linkbase and reference linkbase. All the definitions for the tags and the rest is up to you. </md-block> </div> <br> <br> <md-block> ### OUTPUT: </md-block> <div style="background-color:white;border:15px solid white;"> <md-block> Creating a fully working XBRL taxonomy from scratch in this format would be quite extensive, but I can provide you with a simplified example to give you an idea of how it's structured. Firstly, let's define a simple XBRL taxonomy for a fictional company's financial reporting. We'll create a taxonomy for Income Statement items: 1. **Entry Point (Taxonomy Schema):** <?xml version="1.0"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.xbrl.org/2003/linkbase" xmlns:link="http://www.xbrl.org/2003/linkbase" targetNamespace="http://www.example.com/income_statement" xmlns:inc="http://www.example.com/income_statement"> <xsd:import namespace="http://www.xbrl.org/2003/linkbase" schemaLocation="http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd"/> <xsd:element name="incomeStatement" type="link:linkbaseType" substitutionGroup="link:linkbase"/> <xsd:schema> 2. **Label Linkbase:** This linkbase provides human-readable labels for each element in the taxonomy. <?xml version="1.0"?> <link:linkbase xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:link="http://www.xbrl.org/2003/linkbase" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:inc="http://www.example.com/income_statement" xsi:schemaLocation="http://www.xbrl.org/2003/linkbase http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd"> <link:labelLink xlink:type="extended" xlink:role="http://www.xbrl.org/2003/role/link" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label"> <link:label> <link:loc xlink:href="inc:revenue" xlink:label="inc_label_revenue"/> <link:labelArc xlink:from="inc_label_revenue" xlink:to="inc_revenue_label" order="1"/> </link:label> <!-- More labels for other elements --> </link:labelLink> <link:linkbase> 3. **Table Linkbase:** This linkbase defines relationships between elements for presentation purposes. <?xml version="1.0"?> <link:linkbase xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:link="http://www.xbrl.org/2003/linkbase" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:inc="http://www.example.com/income_statement" xsi:schemaLocation="http://www.xbrl.org/2003/linkbase http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd"> <link:presentationLink xlink:type="extended" xlink:role="http://www.xbrl.org/2003/role/presentationLink" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label"> <link:presentationArc xlink:from="inc:revenue" xlink:to="inc_revenue_label" order="1"/> <!-- More presentation arcs for other elements --> </link:presentationLink> <link:linkbase> 4. **Definition Linkbase:** This linkbase provides definitions for each element in the taxonomy. <?xml version="1.0"?> <link:linkbase xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:link="http://www.xbrl.org/2003/linkbase" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:inc="http://www.example.com/income_statement" xsi:schemaLocation="http://www.xbrl.org/2003/linkbase http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd"> <link:definitionLink xlink:type="extended" xlink:role="http://www.xbrl.org/2003/role/definitionLink" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label"> <link:definitionArc xlink:from="inc:revenue" xlink:to="inc_revenue_definition" order="1"/> <!-- More definition arcs for other elements --> </link:definitionLink> <link:linkbase> 5. **Reference Linkbase:** This linkbase provides references for each element in the taxonomy. <?xml version="1.0"?> <link:linkbase xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:link="http://www.xbrl.org/2003/linkbase" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:inc="http://www.example.com/income_statement" xsi:schemaLocation="http://www.xbrl.org/2003/linkbase http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd"> <link:referenceLink xlink:type="extended" xlink:role="http://www.xbrl.org/2003/role/referenceLink" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label"> <link:referenceArc xlink:from="inc:revenue" xlink:to="inc_revenue_reference" order="1"/> <!-- More reference arcs for other elements --> </link:referenceLink> <link:linkbase> This example provides a basic structure for an XBRL taxonomy, including the entry point and relevant linkbases. In a real-world scenario, the taxonomy would contain a more comprehensive set of elements and relationships, along with documentation and validation rules. </md-block> </div> <br> <br> </div> </div> <!-- /HOME --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- FOOTER --> <footer class="footer"> <div class="container"> <p> This site is goverend by the <a href="../../legal/terms_of_use.html">Terms of Use</a> and <a href="../../legal/privacy_policy.html">Privacy Policy</a>. Copyright 2024 Christoph Hartleb. All Rights reserved. </p> </div> </footer> <!-- /FOOTER --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- Latest compiled and minified JavaScript --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"> </script> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script> <script type="module" src="https://md-block.verou.me/md-block.js"></script> </body>
0
repos/exploratory-tech-studio/tech-studio-projects/prompt-engineering-experiments/ai
repos/exploratory-tech-studio/tech-studio-projects/prompt-engineering-experiments/ai/chatgpt-3.5/linkedin-profile-optimization.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> <meta name="description" content="" /> <meta name="author" content="" /> <link rel="icon" href="../../favicon.ico" /> <link rel="canonical" href="https://getbootstrap.com/docs/3.4/examples/navbar-fixed-top/" /> <!-- Website title --> <title>Experimental PE-Project</title> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous" /> <!-- Optional theme --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap-theme.min.css" integrity="sha384-6pzBo3FDv/PJ8r2KRkGHifhEocL+1X2rVCTTkUfGk7/0pbek5mMa1upzvWbrUbOZ" crossorigin="anonymous" /> <!-- Bootstrap core CSS --> <!-- <link href="../../dist/css/bootstrap.min.css" rel="stylesheet"> --> <!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> <!-- <link href="../../assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet"> --> <!-- Custom styles for this template --> <!-- <link href="navbar-fixed-top.css" rel="stylesheet"> --> <!-- Just for debugging purposes. Don't actually copy these 2 lines! --> <!--[if lt IE 9 ]><script src="../../assets/js/ie8-responsive-file-warning.js"></script ><![endif]--> <!-- <script src="../../assets/js/ie-emulation-modes-warning.js"></script> --> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/html5shiv.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dest/respond.min.js"></script> <![endif]--> </head> <body data-spy="scroll" data-target="#navbar"> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- NAVBAR --> <nav class="navbar navbar-default navbar-fixed-top" id="navbar"> <div class="container-fluid"> <!-- Titel und Schalter werden für eine bessere mobile Ansicht zusammengefasst --> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false" > <span class="sr-only">Navigation ein-/ausblenden</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="../../index.html">PROMPT ENGINEERING</a> </div> <!-- Alle Navigationslinks, Formulare und anderer Inhalt werden hier zusammengefasst und können dann ein- und ausgeblendet werden --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li> <a href="../../index.html#jumbotron" >HOME <span class="sr-only">(aktuell)</span></a > </li> <li><a href="../../index.html#mehrInfo">AI TOOLS</a></li> <!-- <li><a href="#footer">AI TOOLS</a></li> --> </ul> <ul class="nav navbar-nav navbar-right"> <form class="navbar-form navbar-left" role="search"> <div class="form-group"> <!-- <input type="email" class="form-control" placeholder="email" /> <input type="password" class="form-control" placeholder="passwort" /> --> <a href="https://www.linkedin.com/in/christoph-hartleb/"> <button type="button" class="btn btn-outline-secondary"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-linkedin" viewBox="0 0 16 16" > <path d="M0 1.146C0 .513.526 0 1.175 0h13.65C15.474 0 16 .513 16 1.146v13.708c0 .633-.526 1.146-1.175 1.146H1.175C.526 16 0 15.487 0 14.854zm4.943 12.248V6.169H2.542v7.225zm-1.2-8.212c.837 0 1.358-.554 1.358-1.248-.015-.709-.52-1.248-1.342-1.248S2.4 3.226 2.4 3.934c0 .694.521 1.248 1.327 1.248zm4.908 8.212V9.359c0-.216.016-.432.08-.586.173-.431.568-.878 1.232-.878.869 0 1.216.662 1.216 1.634v3.865h2.401V9.25c0-2.22-1.184-3.252-2.764-3.252-1.274 0-1.845.7-2.165 1.193v.025h-.016l.016-.025V6.169h-2.4c.03.678 0 7.225 0 7.225z" /> </svg> <span class="visually-hidden">Christoph Hartleb</span> </button></a > </div> <!-- <button type="submit" class="btn btn-success">Login</button> --> </form> </ul> </div> <!-- /.navbar-collapse --> </div> <!-- /.container-fluid --> </nav> <!-- /NAVBAR --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- HOME --> <div class="jumbotron" id="jumbotron"> <div class="container"> <br> <br> <h2 style="color:seagreen;">Linkedin profile description optimization</h2> <br> <p> The description section for my Linkedin profile was enhanced more towards in direction of software development. </p> <br> <br> <h2 style="color:seagreen;">Prompt history:</h2> <br> <md-block> ### USER INPUT: </md-block> <div style="background-color:white;border:15px solid white;"> <md-block > I love nuanced ways of looking at the world and thinking outside the box. Philosophers were extraordinary thinkers. This led me to a BA in Philosophy. Logic and analytical philosophy continued to suck me in. I wanted to apply this knowledge to the tech world. That's how I got into software development. During the learning process, I fell in love with my first programming language: Python. During my MA in Digital Humanities, it was fascinating how easy it was to learn the language and the gigantic applications it offered. I continue my education in different areas of software engineering nowadays. My specialties are: Fast learning of new skills, concepts and programming languages. I especially love C/C++, Java, Python, all about X-Technologies, HTML, CSS and JavaScript and Git/GitHub. Interesting areas in the IT field: AI, BigData, IT-Security, Blockchain, IoT, XBRL Reporting Preferred areas of work: - Pharmaceutical Industry - MedTech Industry - FinTech Industry Preferred locations: - USA/NY, Florida - IE/Dublin - UK/London - Switzerland </md-block> </div> <br> <br> <md-block> ### OUTPUT: </md-block> <div style="background-color:white;border:15px solid white;"> <md-block> It sounds like you have a diverse and fascinating background! Your journey from philosophy to software development, and now into various areas of IT, demonstrates a keen intellectual curiosity and adaptability. Your interest in applying logical and analytical thinking to the tech world is a valuable asset, especially in fields like AI, Big Data, and IT Security where problem-solving skills are crucial. Python's versatility and ease of learning have likely served you well in exploring these areas. Your preferences for industries such as pharmaceuticals, MedTech, and FinTech indicate a desire to work in sectors where technology plays a critical role in innovation and advancement. These industries are indeed at the forefront of integrating cutting-edge technologies into their operations. As for your preferred locations, each offers its own unique opportunities and advantages. The USA, particularly New York and Florida, boasts a robust tech scene with plenty of opportunities in your areas of interest. Dublin, London, and Switzerland are also significant hubs for technology and innovation, offering a mix of multinational corporations and startups. With your skill set and interests, you're well-positioned to make meaningful contributions in these industries and locations. Keep exploring, learning, and pushing the boundaries of what's possible in the intersection of philosophy, technology, and industry. User Please enhance my text above. It shoul dbe more appealing to software development roles ChatGPT Absolutely! Here's a revised version of your text, tailored to appeal to software development roles: My journey began with a passion for philosophical inquiry, but it was the allure of logic and analytical thinking that drew me into the world of software development. Armed with a BA in Philosophy, I embarked on a quest to apply my intellectual rigor to the ever-evolving landscape of technology. Python quickly became my gateway to this world, captivating me with its elegance and power. As I pursued my MA in Digital Humanities, I marveled at Python's versatility and its boundless potential in crafting innovative solutions. Since then, my appetite for knowledge has only grown. I thrive on the challenge of mastering new skills, concepts, and programming languages with lightning speed. From C/C++ to Java, from HTML/CSS to JavaScript, I embrace each new language and technology with fervor. But it's not just about the tools; it's about the possibilities they unlock. My interests span a wide array of cutting-edge fields, from AI and Big Data to IT Security, Blockchain, IoT, and XBRL Reporting. I see technology not just as a means to an end, but as a catalyst for transformative change. My passion extends beyond mere coding; it's about making a tangible impact in industries that matter. That's why I'm drawn to the intersection of technology and sectors like pharmaceuticals, MedTech, and FinTech. These industries represent the forefront of innovation, where every line of code has the potential to revolutionize how we work, live, and heal. As for location, I seek environments that foster creativity and collaboration. Whether it's the vibrant tech scene of New York and Florida, the burgeoning hubs of Dublin and London, or the precision-engineered landscape of Switzerland, I am eager to immerse myself in cultures that value innovation and excellence. In me, you'll find not just a software developer, but a relentless seeker of knowledge, a visionary thinker, and a passionate advocate for using technology to shape a better tomorrow. Let's create something extraordinary together. </md-block> </div> <br> <br> </div> </div> <!-- /HOME --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- FOOTER --> <footer class="footer"> <div class="container"> <p> This site is goverend by the <a href="../../legal/terms_of_use.html">Terms of Use</a> and <a href="../../legal/privacy_policy.html">Privacy Policy</a>. Copyright 2024 Christoph Hartleb. All Rights reserved. </p> </div> </footer> <!-- /FOOTER --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- Latest compiled and minified JavaScript --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"> </script> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script> <script type="module" src="https://md-block.verou.me/md-block.js"></script> </body>
0
repos/exploratory-tech-studio/tech-studio-projects/prompt-engineering-experiments/ai
repos/exploratory-tech-studio/tech-studio-projects/prompt-engineering-experiments/ai/chatgpt-3.5/chatgpt-3.5.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> <meta name="description" content="" /> <meta name="author" content="" /> <link rel="icon" href="../../favicon.ico" /> <link rel="canonical" href="https://getbootstrap.com/docs/3.4/examples/navbar-fixed-top/" /> <!-- Website title --> <title>Experimental PE-Project</title> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous" /> <!-- Optional theme --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap-theme.min.css" integrity="sha384-6pzBo3FDv/PJ8r2KRkGHifhEocL+1X2rVCTTkUfGk7/0pbek5mMa1upzvWbrUbOZ" crossorigin="anonymous" /> <!-- Bootstrap core CSS --> <!-- <link href="../../dist/css/bootstrap.min.css" rel="stylesheet"> --> <!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> <!-- <link href="../../assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet"> --> <!-- Custom styles for this template --> <!-- <link href="navbar-fixed-top.css" rel="stylesheet"> --> <!-- Just for debugging purposes. Don't actually copy these 2 lines! --> <!--[if lt IE 9 ]><script src="../../assets/js/ie8-responsive-file-warning.js"></script ><![endif]--> <!-- <script src="../../assets/js/ie-emulation-modes-warning.js"></script> --> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/html5shiv.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dest/respond.min.js"></script> <![endif]--> </head> <body data-spy="scroll" data-target="#navbar"> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- NAVBAR --> <nav class="navbar navbar-default navbar-fixed-top" id="navbar"> <div class="container-fluid"> <!-- Titel und Schalter werden für eine bessere mobile Ansicht zusammengefasst --> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false" > <span class="sr-only">Navigation ein-/ausblenden</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="../../index.html">PROMPT ENGINEERING</a> </div> <!-- Alle Navigationslinks, Formulare und anderer Inhalt werden hier zusammengefasst und können dann ein- und ausgeblendet werden --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li> <a href="../../index.html#jumbotron" >HOME <span class="sr-only">(aktuell)</span></a > </li> <li><a href="../../index.html#mehrInfo">AI TOOLS</a></li> <!-- <li><a href="#footer">AI TOOLS</a></li> --> </ul> <ul class="nav navbar-nav navbar-right"> <form class="navbar-form navbar-left" role="search"> <div class="form-group"> <!-- <input type="email" class="form-control" placeholder="email" /> <input type="password" class="form-control" placeholder="passwort" /> --> <a href="https://www.linkedin.com/in/christoph-hartleb/"> <button type="button" class="btn btn-outline-secondary"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-linkedin" viewBox="0 0 16 16" > <path d="M0 1.146C0 .513.526 0 1.175 0h13.65C15.474 0 16 .513 16 1.146v13.708c0 .633-.526 1.146-1.175 1.146H1.175C.526 16 0 15.487 0 14.854zm4.943 12.248V6.169H2.542v7.225zm-1.2-8.212c.837 0 1.358-.554 1.358-1.248-.015-.709-.52-1.248-1.342-1.248S2.4 3.226 2.4 3.934c0 .694.521 1.248 1.327 1.248zm4.908 8.212V9.359c0-.216.016-.432.08-.586.173-.431.568-.878 1.232-.878.869 0 1.216.662 1.216 1.634v3.865h2.401V9.25c0-2.22-1.184-3.252-2.764-3.252-1.274 0-1.845.7-2.165 1.193v.025h-.016l.016-.025V6.169h-2.4c.03.678 0 7.225 0 7.225z" /> </svg> <span class="visually-hidden">Christoph Hartleb</span> </button></a > </div> <!-- <button type="submit" class="btn btn-success">Login</button> --> </form> </ul> </div> <!-- /.navbar-collapse --> </div> <!-- /.container-fluid --> </nav> <!-- /NAVBAR --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- HOME --> <div class="jumbotron" id="jumbotron"> <div class="container"> <br> <h1 style="color:seagreen;">Chat GPT 3.5</h1> <br> <p> ChatGPT, a marvel of modern technology, is a sophisticated conversational agent designed to engage and assist users in diverse realms of inquiry and interaction. Powered by the formidable GPT-3.5 architecture developed by OpenAI, ChatGPT embodies a fusion of cutting-edge artificial intelligence and natural language processing prowess. It serves as a virtual companion, capable of comprehending and generating human-like responses across an expansive array of topics and contexts. Whether seeking information, creative inspiration, or simply engaging in meaningful conversation, ChatGPT stands ready to fulfill myriad needs and curiosities. Through its vast repository of knowledge and adaptive learning capabilities, ChatGPT seamlessly adapts to the preferences and nuances of its interlocutors, fostering immersive and enriching dialogue experiences. As users interact with ChatGPT, they embark on a journey of discovery, exploration, and intellectual exchange, tapping into a boundless wellspring of insights and perspectives. From casual chitchat to profound discourse, ChatGPT transcends conventional boundaries, serving as a testament to the boundless potential of artificial intelligence to enhance and elevate human interaction in the digital age. </p> <br> <h2 style="color:seagreen;"> Projects: </h2> <h3> <ul> <li><a href="linkedin-profile-optimization.html">LinkedIn profile description optimization.</a></li> <br> <li><a href="py-unit-testing-single-employee.html">An employee of a company and responsible for unit testing.</a></li> <br> <li><a href="prepare-meal-with-ingredients-you-have.html">Prepare a meal with the ingredience I have at home.</a></li> <br> <li><a href="fully-functiona-xbrl-taxonomy.html">Create a fully functional xbrl taxonomy.</a></li> <br> <li><a href="entire-world-travel-itinerary.html">Please create an itinerary for travelling the entire world.</a></li> </ul> </h3> <hr /> </div> </div> <!-- /HOME --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- FOOTER --> <!-- <div class="container" id="footer"> <div class="row"> <h2>Lade die App herunter!</h2> <p> <a href="" ><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/0/0f/Available_on_the_App_Store_%28black%29_SVG.svg/320px-Available_on_the_App_Store_%28black%29_SVG.svg.png" /></a> </p> </div> </div> --> <!-- <div class="container"> <div class="page-header"> <h1>Sticky footer</h1> </div> <p class="lead">Pin a fixed-height footer to the bottom of the viewport in desktop browsers with this custom HTML and CSS.</p> <p>Use <a href="../sticky-footer-navbar/">the sticky footer with a fixed navbar</a> if need be, too.</p> </div> --> <footer class="footer"> <div class="container"> <p> This site is goverend by the <a href="../../legal/terms_of_use.html">Terms of Use</a> and <a href="../../legal/privacy_policy.html">Privacy Policy</a>. Copyright 2024 Christoph Hartleb. All Rights reserved. </p> </div> </footer> <!-- /FOOTER --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- Latest compiled and minified JavaScript --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"> </script> </body>
0
repos/exploratory-tech-studio/tech-studio-projects/prompt-engineering-experiments/ai
repos/exploratory-tech-studio/tech-studio-projects/prompt-engineering-experiments/ai/claude/claude.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> <meta name="description" content="" /> <meta name="author" content="" /> <link rel="icon" href="../../favicon.ico" /> <link rel="canonical" href="https://getbootstrap.com/docs/3.4/examples/navbar-fixed-top/" /> <!-- Website title --> <title>Experimental PE-Project</title> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous" /> <!-- Optional theme --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap-theme.min.css" integrity="sha384-6pzBo3FDv/PJ8r2KRkGHifhEocL+1X2rVCTTkUfGk7/0pbek5mMa1upzvWbrUbOZ" crossorigin="anonymous" /> <!-- Bootstrap core CSS --> <!-- <link href="../../dist/css/bootstrap.min.css" rel="stylesheet"> --> <!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> <!-- <link href="../../assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet"> --> <!-- Custom styles for this template --> <!-- <link href="navbar-fixed-top.css" rel="stylesheet"> --> <!-- Just for debugging purposes. Don't actually copy these 2 lines! --> <!--[if lt IE 9 ]><script src="../../assets/js/ie8-responsive-file-warning.js"></script ><![endif]--> <!-- <script src="../../assets/js/ie-emulation-modes-warning.js"></script> --> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/html5shiv.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dest/respond.min.js"></script> <![endif]--> </head> <body data-spy="scroll" data-target="#navbar"> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- NAVBAR --> <nav class="navbar navbar-default navbar-fixed-top" id="navbar"> <div class="container-fluid"> <!-- Titel und Schalter werden für eine bessere mobile Ansicht zusammengefasst --> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false" > <span class="sr-only">Navigation ein-/ausblenden</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="../../index.html">PROMPT ENGINEERING</a> </div> <!-- Alle Navigationslinks, Formulare und anderer Inhalt werden hier zusammengefasst und können dann ein- und ausgeblendet werden --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li> <a href="../../index.html#jumbotron" >HOME <span class="sr-only">(aktuell)</span></a > </li> <li><a href="../../index.html#mehrInfo">AI TOOLS</a></li> <!-- <li><a href="#footer">AI TOOLS</a></li> --> </ul> <ul class="nav navbar-nav navbar-right"> <form class="navbar-form navbar-left" role="search"> <div class="form-group"> <!-- <input type="email" class="form-control" placeholder="email" /> <input type="password" class="form-control" placeholder="passwort" /> --> <a href="https://www.linkedin.com/in/christoph-hartleb/"> <button type="button" class="btn btn-outline-secondary"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-linkedin" viewBox="0 0 16 16" > <path d="M0 1.146C0 .513.526 0 1.175 0h13.65C15.474 0 16 .513 16 1.146v13.708c0 .633-.526 1.146-1.175 1.146H1.175C.526 16 0 15.487 0 14.854zm4.943 12.248V6.169H2.542v7.225zm-1.2-8.212c.837 0 1.358-.554 1.358-1.248-.015-.709-.52-1.248-1.342-1.248S2.4 3.226 2.4 3.934c0 .694.521 1.248 1.327 1.248zm4.908 8.212V9.359c0-.216.016-.432.08-.586.173-.431.568-.878 1.232-.878.869 0 1.216.662 1.216 1.634v3.865h2.401V9.25c0-2.22-1.184-3.252-2.764-3.252-1.274 0-1.845.7-2.165 1.193v.025h-.016l.016-.025V6.169h-2.4c.03.678 0 7.225 0 7.225z" /> </svg> <span class="visually-hidden">Christoph Hartleb</span> </button></a > </div> <!-- <button type="submit" class="btn btn-success">Login</button> --> </form> </ul> </div> <!-- /.navbar-collapse --> </div> <!-- /.container-fluid --> </nav> <!-- /NAVBAR --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- HOME --> <div class="jumbotron" id="jumbotron"> <div class="container"> <br> <h1>Claude</h1> <br> <p> Claude.ai stands as a pioneering figure in the realm of artificial intelligence, a versatile and dynamic tool designed to revolutionize workflows across industries. With its advanced natural language processing capabilities and machine learning algorithms, Claude.ai empowers organizations to streamline processes, optimize efficiency, and unlock new avenues of productivity. Whether it's analyzing vast datasets, automating repetitive tasks, or generating actionable insights, Claude.ai emerges as a trusted ally, adept at tackling complex challenges with precision and speed. Its intuitive interface and customizable features make it accessible to users of all proficiency levels, facilitating seamless integration into existing workflows. From customer service to data analysis, marketing automation to content creation, Claude.ai adapts to diverse use cases with unparalleled adaptability and scalability. As organizations harness its capabilities, they embark on a transformative journey towards greater innovation and competitiveness in the digital landscape. With Claude.ai at the helm, the future of work is redefined, marked by efficiency, intelligence, and endless possibilities. </p> <br> <div class="alert alert-danger" role="danger" style="font-size: 150%;"> WARNING: Unfortunately, Claude.ai is not available in my region right now :-( </div> <br> <br> </div> </div> <!-- /HOME --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- FOOTER --> <!-- <div class="container" id="footer"> <div class="row"> <h2>Lade die App herunter!</h2> <p> <a href="" ><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/0/0f/Available_on_the_App_Store_%28black%29_SVG.svg/320px-Available_on_the_App_Store_%28black%29_SVG.svg.png" /></a> </p> </div> </div> --> <!-- <div class="container"> <div class="page-header"> <h1>Sticky footer</h1> </div> <p class="lead">Pin a fixed-height footer to the bottom of the viewport in desktop browsers with this custom HTML and CSS.</p> <p>Use <a href="../sticky-footer-navbar/">the sticky footer with a fixed navbar</a> if need be, too.</p> </div> --> <footer class="footer"> <div class="container"> <p> This site is goverend by the <a href="../../legal/terms_of_use.html">Terms of Use</a> and <a href="../../legal/privacy_policy.html">Privacy Policy</a>. Copyright 2024 Christoph Hartleb. All Rights reserved. </p> </div> </footer> <!-- /FOOTER --> <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- Latest compiled and minified JavaScript --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"> </script> </body>