This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import curses | |
def filter_words(words, start): | |
return list(filter(lambda s: s.startswith(start), words)) | |
if __name__ == "__main__": | |
words = [] | |
with open("words.txt", "r") as f: | |
words = [l.strip() for l in f.readlines()] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, send_file, make_response, jsonify | |
from icalendar import Calendar, Event | |
from datetime import datetime, timedelta | |
from pytz import UTC | |
import atexit | |
import json | |
import os | |
import tasks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <experimental/mdspan> | |
#include <iostream> | |
#include <cstdlib> | |
#include <array> | |
namespace stdex = std::experimental; | |
template<const int x, const int y> | |
[[clang::jit]] void | |
kernel(stdex::mdspan<double, x, y>& f) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static int Ackermann(int m, int n) | |
{ | |
if (m == 0) | |
{ | |
return n + 1; | |
} | |
else if (n == 0) | |
{ | |
return Ackermann(m - 1, 1); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private double GetWorkDays(DateTime Start, DateTime End) | |
{ | |
double WorkDays = 1 + ((End - Start).TotalDays * 5 - (Start.DayOfWeek - End.DayOfWeek) * 2) / 7; | |
if (End.DayOfWeek == DayOfWeek.Saturday) WorkDays--; | |
if (Start.DayOfWeek == DayOfWeek.Sunday) WorkDays--; | |
return WorkDays; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.IO; | |
/// <summary> | |
/// Contains logic for detecting reserved file names in Windows. | |
/// </summary> | |
static class ReservedFileNameTool | |
{ | |
/// <summary> | |
/// Reserved file names in Windows. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace Coin | |
{ | |
class Program | |
{ | |
static void Main(string[] args) => Console.WriteLine(new Random().Next(0, 1000) % 2 == 0 ? "Heads" : "Tails"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading; | |
namespace RockPaperScissorsLizardSpock | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
int[,] WinMatrix = new int[5, 5] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set WshShell = CreateObject("WScript.Shell") | |
MsgBox ConvertToKey(WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId")) | |
Function ConvertToKey(Key) | |
Const KeyOffset = 52 | |
i = 28 | |
Chars = "BCDFGHJKMPQRTVWXY2346789" | |
Do | |
Cur = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayDeque; | |
import java.util.ArrayList; | |
import java.util.Deque; | |
import java.util.List; | |
import java.util.Stack; | |
public class ReversePolish { | |
private ReversePolish() { } | |
NewerOlder