Skip to content

Instantly share code, notes, and snippets.

@AidanHak
AidanHak / WindowsSpotlight.vbs
Last active December 1, 2023 04:20
Convert Windows Spotlight image files to JPG image files and save them in a designated folder to make them easier to access. Filters out all the non-Windows Spotlight images (start menu icons and such).
' TO RUN THIS SCRIPT:
' 1. Open cmd as admin
' 2. Run the command: cscript WindowsSpotlight.vbs
' Edit:
mySpotlightFolder = "D:\Pictures\Windows Spotlight" ' THIS IS THE FOLDER IN WHICH THE JPG IMAGES WILL BE SAVED
''''''''''''''''''''''''''''''''''''''''''''''''''''''''
set fs = CreateObject("Scripting.FileSystemObject")
@AidanHak
AidanHak / OptimalPageReplacement.java
Created October 21, 2017 03:05
Optimal page replacement algorithm in Java
import java.util.Scanner;
import java.io.IOException;
public class OptimalPageReplacement
{
public static void main(String[] args) throws IOException
{
Scanner in = new Scanner(System.in);
int frames = 0;
int pointer = 0;
@AidanHak
AidanHak / LRUPageReplacement.java
Created October 21, 2017 02:59
Least recently used page replacement algorithm in Java
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;
public class LRUPageReplacement
{
public static void main(String[] args) throws IOException
{
Scanner in = new Scanner(System.in);
int frames = 0;
@AidanHak
AidanHak / SimpleShell.java
Created October 21, 2017 02:57
A basic Shell in Java
import java.io.*;
import java.util.*;
public class SimpleShell {
public static void main(String[] args) throws java.io.IOException
{
String commandLine;
String delims = "[]+";
ArrayList<String> history = new ArrayList<String>();
BufferedReader console = new BufferedReader(new InputStreamReader(System.in));