kristofer / PyObjects.py
Utoljára aktív
1 | print("1 Hello World!") |
2 | |
3 | class HelloWorld: |
4 | def main(self): |
5 | print("2 Hello World!") |
6 | |
7 | obj = HelloWorld() |
8 | obj.main() |
9 | |
10 | # What do you MEAN Python is an Object Oriented Language? |
kristofer / symboltable2.md
Utoljára aktív
describe how you would use python's dict data structure to build a symbol table for a small language compiler
TinyLlama
In a small language compiler like Python, the goal is to convert an input program into a bytecode that can be executed by an interpreter. This bytecode is then translated into machine code (CPU instructions) and executed by a CPU, or run directly in a virtual machine (VM). The intermediate representation for this process is called a symbol table,
kristofer / symboltable1.md
Utoljára aktív
describe how you would use python's dict data structure to build a symbol table for a small language compiler
Phi3
Building a symbol table using Python's dictionary data structure for a small language compiler involves several steps. The symbol table will be used to keep track of variables, their types, and scopes during the compilation process. Here's how you can implement it:
- Define basic classes
kristofer / docker boot.md
Utoljára aktív
Get Spring/jhipster running in Docker container
On the mac you'll need to download Docker Desktop
This provides the docker
commands on the Mac
Not sure if you need to download and install docker-compose or not....
./mvnw package -Pprod verify jib:dockerBuild
kristofer / Python OOP Sample
Utoljára aktív
1 | # here is a very simple example of python OOP |
2 | |
3 | # normal hello-world |
4 | print("1 Hello World!") |
5 | |
6 | # an OOP version |
7 | |
8 | class HelloWorld: |
9 | def main(self): |
10 | print("2 Hello World!") |
kristofer / S3 Access (java, Python)
Utoljára aktív
Some samples of working with S3 on AWS.
1 | import com.amazonaws.services.s3.AmazonS3; |
2 | import com.amazonaws.services.s3.AmazonS3ClientBuilder; |
3 | import com.amazonaws.services.s3.model.*; |
4 | import java.io.File; |
5 | |
6 | public class S3Examples { |
7 | |
8 | private final AmazonS3 s3 = AmazonS3ClientBuilder.defaultClient(); |
9 | |
10 | // Create an S3 bucket |
dasha / gist:96cdfa4bcaa24a0b9bcab1a04d8babd4
Utoljára aktív
1 | export JAVA_HOME=`/usr/libexec/java_home -v 21.0.2` |
dasha / gist:2a139a024b97494aa56a5732cc49d631
Utoljára aktív
1 | Error 86: |
2 | |
3 | #!/bin/bash |
4 | |
5 | # Loop through all directories in PATH |
6 | for dir in ${PATH//:/ }; do |
7 | echo "$dir" |
8 | # Check if directory exists before trying to access |
9 | if [ -d "$dir" ]; then |
10 | # Loop through executable files in this directory |
kristofer / Git Tricks
Utoljára aktív
For re-doing the repo, to take into account your changes to the .gitignore
Remove Stuff that should ignored.
The series of commands below will remove all of the items from the Git Index (not from the working directory or local repo), and then updates the Git Index, while respecting git ignores. PS. Index = Cache
First:
git rm -r --cached .