kristofer / String Splitting
Last active
split a string in both Python and Java
Splitting a String
into a list or array of strings.
Key differences:
- Python returns a list directly
- Java returns an array (String[]), which you can convert to List if needed
- Python uses split() with no argument to split by any whitespace
- Java requires explicit delimiter - use split("\s+") for any whitespace
kristofer / Random Integers (Java & Python)
Last active
easy way to generate a random int from to max
If you need to generate a random integer, a number from say, 1 to 6, you can write a couple routines:
Java
import java.util.Random;
int min = 1;
int max = 6;
kristofer / Spark/Docker Troubleshooting Guide
Last active
Spark-Docker-SQL - Troubleshooting Guide
🚨 Quick Emergency Fixes
🔥 "Everything is Broken" - Nuclear Option
# Stop everything and restart fresh
docker-compose down -v --remove-orphans
docker system prune -f
docker volume prune -fkristofer / DTOs (java & python)
Last active
Data Transfer Objects (DTOs) Explained for Beginners (Java, then Python)
Data Transfer Objects (DTOs) via Java; Explained for Beginners
What Are DTOs?
A Data Transfer Object (DTO) is a simple container for data that travels between different parts of your application. Think of a DTO like an envelope specifically designed to carry exactly what's needed—no more, no less.
public class OrderDTO {
private Long id;
private String customerName;
kristofer / Newbie and Git
Last active
How to SSH keys etc and so for Newbies and Git
Adding a new SSH key to your GitHub account
As a newbie, you don't understand this, but...
when you're in a terminal and you're fussing with git and you push and oops it doesn't work.
Maybe you need to make sure your git account has keys on your Mac so that git push works right.
To configure your account on GitHub.com to use your new (or existing) SSH key, you'll also need to add the key to your account.
kristofer / Maven for Java Newbies
Last active
Maven and POM.xml for Newbie Java Programmers
What is Maven?
Maven is a powerful build automation and project management tool primarily used for Java projects. Think of it as your project's organizer and assistant that handles several critical tasks:
- Dependency Management: Automatically downloads and manages libraries your project needs
- Project Building: Compiles your code, runs tests, and packages your application
- Project Structure: Enforces a standard directory layout for consistent organization