All New

user:thomas gists created by user

title:mygist gists with given title

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

Login


All New Login

All gists

Recently created
Least recently created
Recently updated
Least recently updated
kristofer's Avatar

kristofer / Medici Banking Systems

0 likes
0 forks
1 files
Last active 1741791789
by claude.
1 /**
2
3 This Java implementation showcases the core principles of double-entry accounting, using ducats as
4 the currency in honor of the Medici banking dynasty. Here's what the code demonstrates:
5
6 1. **The Fundamental Principle**: Every transaction affects at least two accounts
7 (the double-entry principle), and the sum of debits must always equal the sum of credits.
8
9 2. **Five Main Account Types**:
10 - Assets: Resources owned by the business
kristofer's Avatar

kristofer / API Concepts Guide

0 likes
0 forks
1 files
Last active 1741698978
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's Avatar

kristofer / Intro TDD

0 likes
0 forks
1 files
Last active 1740760421

Introduction to Test Driven Development in Java

Test Driven Development (TDD) is a software development approach where tests are written before the actual code implementation. This methodology focuses on creating a solid foundation of tests that drive the design and development of your application code. For Java developers, TDD has become a fundamental practice that improves code quality, reduces bugs, and facilitates maintenance.

The TDD Cycle

The core of TDD revolves around a simple three-step cycle, often called "Red-Green-Refactor":

  1. Red: Write a failing test that defines the functionality you want to implement.
  2. Green: Write the minimal amount of code needed to make the test pass.
kristofer's Avatar

kristofer / Intro Using ArrayLists

0 likes
0 forks
3 files
Last active 1741204255
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's Avatar

kristofer / ArrayList class

0 likes
0 forks
1 files
Last active 1741098222

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's Avatar

kristofer / IntroJavaArrays

0 likes
0 forks
1 files
Last active 1741098232

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?

RazTechPro's Avatar

RazTechPro / IntroToAgileAtZipcode

0 likes
0 forks
1 files
Last active 1740270271
Intro to Agile At Zipcode

Introduction to Agile at Zipcode Wilmington

What is Agile?

Agile software development is an umbrella term for a set of frameworks and practices based on the values and principles expressed in the Manifesto for Agile Software Development.

The focus is on the engineers doing the work and the manner in which they work together to deliver working software.

At Zipcode Wilmington, Agile is the marriage of ProDev and Java/Data programs.

kristofer's Avatar

kristofer / Simple Text Edit Python

0 likes
0 forks
1 files
Last active 1739984695
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's Avatar

kristofer / Digital Clock Py GUI

0 likes
0 forks
1 files
Last active 1739983954
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")
kristofer's Avatar

kristofer / qrcodepy.md

0 likes
0 forks
1 files
Last active 1739983053

pip install pyqrcode

How to create a QR Code with Python:

import pyqrcode 
from pyqrcode import QRCode 
  
# String (URL) to make into QR code 
s = "https://zipcodewilmington.com"
Newer Older

Powered by Opengist ⋅ Load: 154ms⋅

English
Čeština Deutsch English Español Français Magyar Italiano Português Русский Türkçe Українська 中文 繁體中文