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 / NQueenProblem.java

0 likes
0 forks
1 files
Last active 1718984322
1 // Java program to solve N Queen Problem using backtracking
2
3 public class NQueenProblem {
4 final int N = 4;
5
6 // A utility function to print solution
7 void printSolution(int board[][])
8 {
9 for (int i = 0; i < N; i++) {
10 for (int j = 0; j < N; j++) {
kristofer's Avatar

kristofer / Minesweeper.java

0 likes
0 forks
1 files
Last active 1718984273
1 import java.util.Random;
2 import java.util.Scanner;
3
4 public class Minesweeper {
5 private static final int SIZE = 10;
6 private static final int MINES = 15;
7
8 private char[][] board;
9 private boolean[][] mines;
10 private boolean[][] revealed;
kristofer's Avatar

kristofer / IntersectionOfTwoArrays.java

0 likes
0 forks
1 files
Last active 1718984169
1 import java.util.*;
2
3 public class IntersectionOfTwoArrays {
4 public static void main(String args[])
5 {
6 Scanner sc=new Scanner(System.in);
7 HashSet<Integer>s=new HashSet<Integer>();
8 System.out.println("Enter the no. of elements in array a");
9 int n1=sc.nextInt();
10 System.out.println("Enter the no. of elements in array b");
kristofer's Avatar

kristofer / InterfaceDemo.java

0 likes
0 forks
1 files
Last active 1718984132
1 interface Shape {
2 double area();
3 double perimeter();
4 }
5
6 class Circle implements Shape {
7 private double radius;
8
9 public Circle(double radius) {
10 this.radius = radius;
kristofer's Avatar

kristofer / PolymorphismInheritance.java

0 likes
0 forks
1 files
Last active 1718984106
1 class A
2 {
3 public void methodA() {
4 System.out.println("method of Class A");
5 }
6 }
7 class B extends A{
8 public void methodB(){
9 System.out.println("method of Class B");
10 }
kristofer's Avatar

kristofer / Inheritance.java

0 likes
0 forks
1 files
Last active 1731081982
1 class A
2 {
3 public void methodA() {
4 System.out.println("method of Class A");
5 }
6 }
7 class B extends A{
8 public void methodB(){
9 System.out.println("method of Class B");
10 }
kristofer's Avatar

kristofer / HeapSort.java

0 likes
0 forks
1 files
Last active 1718984029
1 import java.util.*;
2 public class HeapSort {
3 public void sort(int arr[])
4 {
5 int N = arr.length;
6
7 for (int i = N / 2 - 1; i >= 0; i--)
8 heapify(arr, N, i);
9
10 for (int i = N - 1; i > 0; i--) {
kristofer's Avatar

kristofer / WebsiteStatusChecker.java

0 likes
0 forks
1 files
Last active 1718983990
1 import java.io.IOException;
2 import java.net.HttpURLConnection;
3 import java.net.URL;
4 import java.util.Scanner;
5
6 public class WebsiteStatusChecker {
7 public static void main(String[] args) {
8 Scanner scanner = new Scanner(System.in);
9 System.out.print("Enter the website URL to check: ");
10 String urlToCheck = scanner.nextLine();
kristofer's Avatar

kristofer / FastAPI_auth_example.py

0 likes
0 forks
1 files
Last active 1718312876
1 from fastapi import FastAPI, Depends, HTTPException, status, Header
2 from sqlalchemy import create_engine, Column, String, Integer
3 from sqlalchemy.ext.declarative import declarative_base
4 from sqlalchemy.orm import sessionmaker
5 from keycove import encrypt, decrypt, hash, generate_token
6 from sqlalchemy.orm import Session
7
8 app = FastAPI()
9
10 SQLALCHEMY_DATABASE_URL = "sqlite:///db.sqlite3"
kristofer's Avatar

kristofer / AsyncWithFASTAPI.md

0 likes
0 forks
1 files
Last active 1718287788

Useful, from FastAPI, description of Async and Await within concurrency in Python

Concurrency and async / await

Newer Older

Powered by Opengist ⋅ Load: 177ms⋅

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