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
class InheritancePractice | |
{ | |
public static abstract class Vehicle | |
{ | |
public int maxSpeed; // In MPH | |
public int acceleration; // In 0-60MPH secs | |
public Vehicle(int maxSpeed, int acceleration) { | |
this.maxSpeed = maxSpeed; | |
this.acceleration = acceleration; |
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.*; | |
class Errors | |
{ | |
/* Adds the given value to everything in the ArrayList. | |
* | |
* This AddToAll method does not work correctly. Explain | |
* why. | |
* | |
* Which of the following replacements for line 19 will fix the method? |
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.*; | |
class MoreArrayListTest | |
{ | |
public static void main(String[] args) | |
{ | |
// Run all the tests. | |
testNormalize(); | |
testShuffle(); | |
testRemoveDuplicates(); |
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
/** | |
* Fancy ID generator that creates 20-character string identifiers with the following properties: | |
* | |
* 1. They're based on timestamp so that they sort *after* any existing ids. | |
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs. | |
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly). | |
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the | |
* latter ones will sort after the former ones. We do this by using the previous random bits | |
* but "incrementing" them by 1 (only in the case of a timestamp collision). | |
*/ |
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
<# | |
Note: Eliminate `-WhatIf` parameter to get action be actually done | |
Note: PS with version prior to 4.0 can't delete non-empty folders | |
#> | |
Get-ChildItem -Path "." -Include "node_modules" -Recurse -Directory | Remove-Item -Recurse -Force -WhatIf |
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
/** | |
* @type {import('next').NextConfig} | |
*/ | |
const nextConfig = { | |
output: "export", | |
trailingSlash: true, | |
images: { unoptimized: true } | |
} | |
module.exports = nextConfig |