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

All gists

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

kristofer / Riplz.html

0 likes
0 forks
1 files
Last active 1723477053
1 <!doctype html>
2 <html>
3 <head>
4 <meta charset="UTF-8" />
5 <style>
6 body, html {
7 height: 100%;
8 }
9
10 body {
kristofer's Avatar

kristofer / HTTP AytchTeeTeePee

0 likes
0 forks
4 files
Last active 1722542665
1 package rocks.zipcode;
2
3 import java.io.IOException;
4 import java.net.ServerSocket;
5 import java.net.Socket;
6 import java.util.Date;
7
8
9 // Show how Sockets work. Lower level than Main class.
10 class SimpleHTTPServer {
kristofer's Avatar

kristofer / JSON Fundamentals

0 likes
0 forks
1 files
Last active 1721137376
Just an introduction

JSON Fundamentals

JavaScript Object Notation (JSON) is a standard text-based format for representing structured data based on JavaScript object syntax. It is commonly used for transmitting data in web applications (e.g., sending some data from the server to the client, so it can be displayed on a web page, or vice versa). You'll come across it quite often. Better get a handle on it.

kristofer's Avatar

kristofer / Python Virtual Environments

0 likes
0 forks
1 files
Last active 1731506517
use to effect change in the universe

Python3 Virtual Environment Fundamentals

Python Virtual Environments are a tool used to create isolated spaces on your computer where you can install and manage different versions of Python, as well as their respective packages, without affecting the global system installation. This isolation helps avoid version conflicts between projects that require different dependencies or libraries.

Here's an in-depth look at how they work:

Why Use Virtual Environments?

kristofer's Avatar

kristofer / Hmm-Phi3andCards.md

0 likes
0 forks
1 files
Last active 1719340749

So I asked Phi3...

To generate some code like we talked about with Deal.java

Read this code.

To create a Java program that models a deck of cards, we'll define two main components: Card (using an enum to represent suits and ranks) and Hand (to hold a collection of cards). We will also implement a Deck class that initializes with all possible combinations of these cards.

Step 1: Define the Card Enum

First, we define an enum for both the suit and rank to represent each card uniquely.

kristofer's Avatar

kristofer / SpaceInvadersGame.java

0 likes
0 forks
1 files
Last active 1719509743
1 import javax.swing.*;
2 import java.awt.*;
3 import java.awt.event.ActionEvent;
4 import java.awt.event.ActionListener;
5 import java.awt.event.KeyEvent;
6 import java.awt.event.KeyListener;
7 import java.util.ArrayList;
8 import java.util.List;
9 import java.util.Random;
kristofer's Avatar

kristofer / SortingExamples.java

0 likes
0 forks
1 files
Last active 1718984838
1 import java.util.Arrays;
2 import java.util.Scanner;
3
4 public class SortingExamples {
5 public static void main(String[] args) {
6 Scanner input = new Scanner(System.in);
7
8 // Input array from the user
9 System.out.print("Enter the number of elements in the array: ");
10 int n = input.nextInt();
kristofer's Avatar

kristofer / UrlShortener.java

0 likes
0 forks
1 files
Last active 1718984693
1 import java.security.MessageDigest;
2 import java.security.NoSuchAlgorithmException;
3 import java.util.HashMap;
4 import java.util.Map;
5 import java.util.Random;
6
7 public class UrlShortener {
8 private Map<String, String> urlMap = new HashMap<>();
9 private static final String BASE_URL = "http://short.url/";
kristofer's Avatar

kristofer / WeatherApp.java

0 likes
0 forks
1 files
Last active 1718984504
1 import java.io.BufferedReader;
2 import java.io.IOException;
3 import java.io.InputStreamReader;
4 import java.net.HttpURLConnection;
5 import java.net.URL;
6
7 // go to https://openweathermap.org to see
8
9
10 public class WeatherApp {
kristofer's Avatar

kristofer / NotesApp.java

0 likes
0 forks
1 files
Last active 1718984355
1 import java.io.*;
2 import java.util.ArrayList;
3 import java.util.Scanner;
4
5 class Note {
6 private String title;
7 private String content;
8
9 public Note(String title, String content) {
10 this.title = title;
Newer Older

Powered by Opengist ⋅ Load: 256ms⋅

English
Čeština Deutsch English Español Français Magyar Português Русский 中文 繁體中文