kristofer / API Concepts Guide
Last active
Useful to see both Java and Python examples of API usage
Explaining APIs to Beginner Programmers
Here is an explaination APIs to beginner programmers with examples in both Java and Python. APIs (Application Programming Interfaces) are indeed a fundamental concept for new programmers to understand.
What is an API?
An API is like a contract between different software components that defines how they should interact. Think of it as a menu at a restaurant - you don't need to know how the kitchen prepares the food, you just need to know what you can order and how to place that order.
kristofer / Intro Using ArrayLists
Last active
1 | import java.util.ArrayList; |
2 | import java.util.Collections; |
3 | import java.util.Comparator; |
4 | import java.util.Scanner; |
5 | |
6 | |
7 | // See below for information on this class. |
8 | public class ArrayListExamples { |
9 | |
10 | public static void main(String[] args) { |
kristofer / ArrayList class
Last active
Java ArrayLists: A Dynamic Alternative to Arrays
While Java arrays are powerful, they have a significant complication: their size is fixed once created. Enter ArrayLists - a more flexible, dynamic alternative that automatically grows and shrinks as needed. ArrayLists are part of Java's Collections Framework and offer enhanced functionality for managing groups of objects.
What Is an ArrayList?
An ArrayList is a resizable array implementation of the List interface. Unlike regular arrays, ArrayLists can dynamically change in size during program execution. They store objects rather than primitive types, though Java's autoboxing feature allows them to work seamlessly with primitives too.
ArrayList vs. Array
kristofer / IntroJavaArrays
Last active
Java Arrays: An Introduction for Beginners
Arrays are one of the most fundamental data structures in Java programming. They allow you to store multiple values of the same type under a single variable name, making your code more organized and efficient. This introduction will help you understand what arrays are, how they work, and how to use them effectively in your Java programs.
What Is an Array?
An array is a container that holds a fixed number of values of a single type. Think of an array as a row of boxes, where each box can store one item. All items in an array must be of the same data type - whether that's integers, floating-point numbers, characters, or even objects.
Why Use Arrays?
kristofer / Simple Text Edit Python
Last active
Python simple text edit using Tkinter
1 | import tkinter as tk |
2 | from tkinter.filedialog import askopenfilename, asksaveasfilename |
3 | |
4 | def open_file(): |
5 | """Open a file for editing.""" |
6 | filepath = askopenfilename( |
7 | filetypes=[("Text Files", "*.txt"), ("All Files", "*.*")] |
8 | ) |
9 | if not filepath: |
10 | return |
kristofer / Digital Clock Py GUI
Last active
1 | from tkinter import Label, Tk |
2 | import time |
3 | |
4 | # need to `brew install python-tk` |
5 | # to setup a mac for tkinter |
6 | # |
7 | |
8 | app_window = Tk() |
9 | app_window.title("Digital Clock") |
10 | app_window.geometry("420x150") |