Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiled_starters/c/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ int main(int argc, char *argv[]) {
// You can use print statements as follows for debugging, they'll be visible when running tests.
fprintf(stderr, "Logs from your program will appear here!\n");

// Uncomment this to pass the first stage
// TODO: Uncomment the code below to pass the first stage
// printf("database page size: %u\n", page_size);

fclose(database_file);
Expand Down
2 changes: 1 addition & 1 deletion compiled_starters/clojure/src/sqlite/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
;; You can use print statements as follows for debugging, they'll be
;; visible when running tests.
(println "Logs from your program will appear here!")
;; Uncomment this block to pass the first stage
;; TODO: Uncomment the code below to pass the first stage
;; (let [command (second args)]
;; (case command
;; ".dbinfo"
Expand Down
2 changes: 1 addition & 1 deletion compiled_starters/cpp/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ int main(int argc, char* argv[]) {
return 1;
}

// Uncomment this to pass the first stage
// TODO: Uncomment the code below to pass the first stage
// database_file.seekg(16); // Skip the first 16 bytes of the header
//
// char buffer[2];
Expand Down
2 changes: 1 addition & 1 deletion compiled_starters/csharp/src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// You can use print statements as follows for debugging, they'll be visible when running tests.
Console.Error.WriteLine("Logs from your program will appear here!");

// Uncomment this line to pass the first stage
// TODO: Uncomment the code below to pass the first stage
// databaseFile.Seek(16, SeekOrigin.Begin); // Skip the first 16 bytes
// byte[] pageSizeBytes = new byte[2];
// databaseFile.Read(pageSizeBytes, 0, 2);
Expand Down
2 changes: 1 addition & 1 deletion compiled_starters/elixir/lib/main.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ defmodule CLI do
# You can use print statements as follows for debugging, they'll be visible when running tests.
IO.puts(:stderr, "Logs from your program will appear here!")

# Uncomment this to pass the first stage
# TODO: Uncomment the code below to pass the first stage
# :file.position(file, 16) # Skip the first 16 bytes of the header
# <<page_size::16>> = IO.binread(file, 2)
# IO.puts("database page size: #{page_size}")
Expand Down
2 changes: 1 addition & 1 deletion compiled_starters/gleam/src/main.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub fn main() {

let args = argv.load().arguments

// Uncomment this to pass the first stage
// TODO: Uncomment the code below to pass the first stage
// case args {
// [database_file_path, ".dbinfo", ..] -> {
// let assert Ok(rs) = read_stream.open(database_file_path)
Expand Down
2 changes: 1 addition & 1 deletion compiled_starters/go/app/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func main() {
// You can use print statements as follows for debugging, they'll be visible when running tests.
fmt.Fprintln(os.Stderr, "Logs from your program will appear here!")

// Uncomment this to pass the first stage
// TODO: Uncomment the code below to pass the first stage
// fmt.Printf("database page size: %v", pageSize)
default:
fmt.Println("Unknown command", command)
Expand Down
2 changes: 1 addition & 1 deletion compiled_starters/java/src/main/java/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static void main(String[] args){
// You can use print statements as follows for debugging, they'll be visible when running tests.
System.err.println("Logs from your program will appear here!");

// Uncomment this block to pass the first stage
// TODO: Uncomment the code below to pass the first stage
// System.out.println("database page size: " + pageSize);
} catch (IOException e) {
System.out.println("Error reading file: " + e.getMessage());
Expand Down
2 changes: 1 addition & 1 deletion compiled_starters/javascript/app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if (command === ".dbinfo") {
// You can use print statements as follows for debugging, they'll be visible when running tests.
console.error("Logs from your program will appear here!");

// Uncomment this to pass the first stage
// TODO: Uncomment the code below to pass the first stage
// const pageSize = buffer.readUInt16BE(16); // page size is 2 bytes starting at offset 16
// console.log(`database page size: ${pageSize}`);
} else {
Expand Down
2 changes: 1 addition & 1 deletion compiled_starters/kotlin/app/src/main/kotlin/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fun main(args: Array<String>) {
if (command == ".dbinfo") {
val databaseFile = java.io.File(databaseFilePath).inputStream()

// Uncomment this block to pass the first stage
// TODO: Uncomment the code below to pass the first stage
//
// databaseFile.skip(16) // Skip the first 16 bytes of the header
// val pageSizeBytes = ByteArray(2) // The following 2 bytes are the page size
Expand Down
2 changes: 1 addition & 1 deletion compiled_starters/python/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# You can use print statements as follows for debugging, they'll be visible when running tests.
print("Logs from your program will appear here!", file=sys.stderr)

# Uncomment this to pass the first stage
# TODO: Uncomment the code below to pass the first stage
# database_file.seek(16) # Skip the first 16 bytes of the header
# page_size = int.from_bytes(database_file.read(2), byteorder="big")
# print(f"database page size: {page_size}")
Expand Down
2 changes: 1 addition & 1 deletion compiled_starters/ruby/app/main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# You can use print statements as follows for debugging, they'll be visible when running tests.
$stderr.puts "Logs from your program will appear here"

# Uncomment this to pass the first stage
# TODO: Uncomment the code below to pass the first stage
# database_file.seek(16) # Skip the first 16 bytes of the header
# page_size = database_file.read(2).unpack("n")[0]
# puts "database page size: #{page_size}"
Expand Down
2 changes: 1 addition & 1 deletion compiled_starters/rust/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fn main() -> Result<()> {
// You can use print statements as follows for debugging, they'll be visible when running tests.
eprintln!("Logs from your program will appear here!");

// Uncomment this block to pass the first stage
// TODO: Uncomment the code below to pass the first stage
// println!("database page size: {}", page_size);
}
_ => bail!("Missing or invalid command passed: {}", command),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct Main {
// You can use print statements as follows for debugging, they'll be visible when running tests.
eprintln("Logs from your program will appear here!")

// Uncomment this block to pass the first stage
// TODO: Uncomment the code below to pass the first stage
// let pageSize = UInt16(database[16..<18])
// print("database page size: \(pageSize)")
default:
Expand Down
2 changes: 1 addition & 1 deletion compiled_starters/typescript/app/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if (command === ".dbinfo") {
// You can use print statements as follows for debugging, they'll be visible when running tests.
console.error("Logs from your program will appear here!");

// Uncomment this to pass the first stage
// TODO: Uncomment the code below to pass the first stage
// const pageSize = new DataView(buffer.buffer, 0, buffer.byteLength).getUint16(16);
// console.log(`database page size: ${pageSize}`);

Expand Down
2 changes: 1 addition & 1 deletion compiled_starters/zig/src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub fn main() !void {
// You can use print statements as follows for debugging, they'll be visible when running tests.
std.debug.print("Logs from your program will appear here!\n", .{});

// Uncomment this block to pass the first stage
// TODO: Uncomment the code below to pass the first stage
// var buf: [2]u8 = undefined;
// _ = try file.seekTo(16);
// _ = try file.read(&buf);
Expand Down
2 changes: 1 addition & 1 deletion solutions/c/01-dr6/diff/src/main.c.diff
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
- // You can use print statements as follows for debugging, they'll be visible when running tests.
- fprintf(stderr, "Logs from your program will appear here!\n");
-
- // Uncomment this to pass the first stage
- // TODO: Uncomment the code below to pass the first stage
- // printf("database page size: %u\n", page_size);
+ printf("database page size: %u\n", page_size);

Expand Down
2 changes: 1 addition & 1 deletion solutions/clojure/01-dr6/diff/src/sqlite/core.clj.diff
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
-;; You can use print statements as follows for debugging, they'll be
-;; visible when running tests.
(println "Logs from your program will appear here!")
-;; Uncomment this block to pass the first stage
-;; TODO: Uncomment the code below to pass the first stage
-;; (let [command (second args)]
-;; (case command
-;; ".dbinfo"
Expand Down
2 changes: 1 addition & 1 deletion solutions/cpp/01-dr6/diff/src/main.cpp.diff
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
return 1;
}

- // Uncomment this to pass the first stage
- // TODO: Uncomment the code below to pass the first stage
- // database_file.seekg(16); // Skip the first 16 bytes of the header
- //
- // char buffer[2];
Expand Down
2 changes: 1 addition & 1 deletion solutions/csharp/01-dr6/diff/src/Program.cs.diff
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
- // You can use print statements as follows for debugging, they'll be visible when running tests.
- Console.Error.WriteLine("Logs from your program will appear here!");
-
- // Uncomment this line to pass the first stage
- // TODO: Uncomment the code below to pass the first stage
- // databaseFile.Seek(16, SeekOrigin.Begin); // Skip the first 16 bytes
- // byte[] pageSizeBytes = new byte[2];
- // databaseFile.Read(pageSizeBytes, 0, 2);
Expand Down
2 changes: 1 addition & 1 deletion solutions/elixir/01-dr6/diff/lib/main.ex.diff
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
- # You can use print statements as follows for debugging, they'll be visible when running tests.
- IO.puts(:stderr, "Logs from your program will appear here!")
-
- # Uncomment this to pass the first stage
- # TODO: Uncomment the code below to pass the first stage
- # :file.position(file, 16) # Skip the first 16 bytes of the header
- # <<page_size::16>> = IO.binread(file, 2)
- # IO.puts("database page size: #{page_size}")
Expand Down
2 changes: 1 addition & 1 deletion solutions/gleam/01-dr6/diff/src/main.gleam.diff
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
-
let args = argv.load().arguments

- // Uncomment this to pass the first stage
- // TODO: Uncomment the code below to pass the first stage
- // case args {
- // [database_file_path, ".dbinfo", ..] -> {
- // let assert Ok(rs) = read_stream.open(database_file_path)
Expand Down
2 changes: 1 addition & 1 deletion solutions/go/01-dr6/diff/app/main.go.diff
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
- // You can use print statements as follows for debugging, they'll be visible when running tests.
- fmt.Fprintln(os.Stderr, "Logs from your program will appear here!")
-
- // Uncomment this to pass the first stage
- // TODO: Uncomment the code below to pass the first stage
- // fmt.Printf("database page size: %v", pageSize)
+ fmt.Printf("database page size: %v", pageSize)
default:
Expand Down
2 changes: 1 addition & 1 deletion solutions/java/01-dr6/diff/src/main/java/Main.java.diff
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
- // You can use print statements as follows for debugging, they'll be visible when running tests.
- System.err.println("Logs from your program will appear here!");
-
- // Uncomment this block to pass the first stage
- // TODO: Uncomment the code below to pass the first stage
- // System.out.println("database page size: " + pageSize);
+ System.out.println("database page size: " + pageSize);
} catch (IOException e) {
Expand Down
2 changes: 1 addition & 1 deletion solutions/javascript/01-dr6/diff/app/main.js.diff
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
- // You can use print statements as follows for debugging, they'll be visible when running tests.
- console.error("Logs from your program will appear here!");
-
- // Uncomment this to pass the first stage
- // TODO: Uncomment the code below to pass the first stage
- // const pageSize = buffer.readUInt16BE(16); // page size is 2 bytes starting at offset 16
- // console.log(`database page size: ${pageSize}`);
+ const pageSize = buffer.readUInt16BE(16); // page size is 2 bytes starting at offset 16
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
if (command == ".dbinfo") {
val databaseFile = java.io.File(databaseFilePath).inputStream()

- // Uncomment this block to pass the first stage
- // TODO: Uncomment the code below to pass the first stage
- //
- // databaseFile.skip(16) // Skip the first 16 bytes of the header
- // val pageSizeBytes = ByteArray(2) // The following 2 bytes are the page size
Expand Down
2 changes: 1 addition & 1 deletion solutions/python/01-dr6/diff/app/main.py.diff
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
- # You can use print statements as follows for debugging, they'll be visible when running tests.
- print("Logs from your program will appear here!", file=sys.stderr)
-
- # Uncomment this to pass the first stage
- # TODO: Uncomment the code below to pass the first stage
- # database_file.seek(16) # Skip the first 16 bytes of the header
- # page_size = int.from_bytes(database_file.read(2), byteorder="big")
- # print(f"database page size: {page_size}")
Expand Down
2 changes: 1 addition & 1 deletion solutions/ruby/01-dr6/diff/app/main.rb.diff
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- # You can use print statements as follows for debugging, they'll be visible when running tests.
- $stderr.puts "Logs from your program will appear here"
-
- # Uncomment this to pass the first stage
- # TODO: Uncomment the code below to pass the first stage
- # database_file.seek(16) # Skip the first 16 bytes of the header
- # page_size = database_file.read(2).unpack("n")[0]
- # puts "database page size: #{page_size}"
Expand Down
2 changes: 1 addition & 1 deletion solutions/rust/01-dr6/diff/src/main.rs.diff
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
- // You can use print statements as follows for debugging, they'll be visible when running tests.
- eprintln!("Logs from your program will appear here!");
-
- // Uncomment this block to pass the first stage
- // TODO: Uncomment the code below to pass the first stage
- // println!("database page size: {}", page_size);
+ println!("database page size: {}", page_size);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
- // You can use print statements as follows for debugging, they'll be visible when running tests.
- eprintln("Logs from your program will appear here!")
-
- // Uncomment this block to pass the first stage
- // TODO: Uncomment the code below to pass the first stage
- // let pageSize = UInt16(database[16..<18])
- // print("database page size: \(pageSize)")
+ let pageSize = UInt16(database[16..<18])
Expand Down
2 changes: 1 addition & 1 deletion solutions/typescript/01-dr6/diff/app/main.ts.diff
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
- // You can use print statements as follows for debugging, they'll be visible when running tests.
- console.error("Logs from your program will appear here!");
-
- // Uncomment this to pass the first stage
- // TODO: Uncomment the code below to pass the first stage
- // const pageSize = new DataView(buffer.buffer, 0, buffer.byteLength).getUint16(16);
- // console.log(`database page size: ${pageSize}`);
+ const pageSize = new DataView(buffer.buffer, 0, buffer.byteLength).getUint16(16);
Expand Down
2 changes: 1 addition & 1 deletion solutions/zig/01-dr6/diff/src/main.zig.diff
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
- // You can use print statements as follows for debugging, they'll be visible when running tests.
- std.debug.print("Logs from your program will appear here!\n", .{});
-
- // Uncomment this block to pass the first stage
- // TODO: Uncomment the code below to pass the first stage
- // var buf: [2]u8 = undefined;
- // _ = try file.seekTo(16);
- // _ = try file.read(&buf);
Expand Down
2 changes: 1 addition & 1 deletion starter_templates/c/code/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ int main(int argc, char *argv[]) {
// You can use print statements as follows for debugging, they'll be visible when running tests.
fprintf(stderr, "Logs from your program will appear here!\n");

// Uncomment this to pass the first stage
// TODO: Uncomment the code below to pass the first stage
// printf("database page size: %u\n", page_size);

fclose(database_file);
Expand Down
2 changes: 1 addition & 1 deletion starter_templates/clojure/code/src/sqlite/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
;; You can use print statements as follows for debugging, they'll be
;; visible when running tests.
(println "Logs from your program will appear here!")
;; Uncomment this block to pass the first stage
;; TODO: Uncomment the code below to pass the first stage
;; (let [command (second args)]
;; (case command
;; ".dbinfo"
Expand Down
2 changes: 1 addition & 1 deletion starter_templates/cpp/code/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ int main(int argc, char* argv[]) {
return 1;
}

// Uncomment this to pass the first stage
// TODO: Uncomment the code below to pass the first stage
// database_file.seekg(16); // Skip the first 16 bytes of the header
//
// char buffer[2];
Expand Down
2 changes: 1 addition & 1 deletion starter_templates/csharp/code/src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// You can use print statements as follows for debugging, they'll be visible when running tests.
Console.Error.WriteLine("Logs from your program will appear here!");

// Uncomment this line to pass the first stage
// TODO: Uncomment the code below to pass the first stage
// databaseFile.Seek(16, SeekOrigin.Begin); // Skip the first 16 bytes
// byte[] pageSizeBytes = new byte[2];
// databaseFile.Read(pageSizeBytes, 0, 2);
Expand Down
2 changes: 1 addition & 1 deletion starter_templates/elixir/code/lib/main.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ defmodule CLI do
# You can use print statements as follows for debugging, they'll be visible when running tests.
IO.puts(:stderr, "Logs from your program will appear here!")

# Uncomment this to pass the first stage
# TODO: Uncomment the code below to pass the first stage
# :file.position(file, 16) # Skip the first 16 bytes of the header
# <<page_size::16>> = IO.binread(file, 2)
# IO.puts("database page size: #{page_size}")
Expand Down
2 changes: 1 addition & 1 deletion starter_templates/gleam/code/src/main.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub fn main() {

let args = argv.load().arguments

// Uncomment this to pass the first stage
// TODO: Uncomment the code below to pass the first stage
// case args {
// [database_file_path, ".dbinfo", ..] -> {
// let assert Ok(rs) = read_stream.open(database_file_path)
Expand Down
2 changes: 1 addition & 1 deletion starter_templates/go/code/app/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func main() {
// You can use print statements as follows for debugging, they'll be visible when running tests.
fmt.Fprintln(os.Stderr, "Logs from your program will appear here!")

// Uncomment this to pass the first stage
// TODO: Uncomment the code below to pass the first stage
// fmt.Printf("database page size: %v", pageSize)
default:
fmt.Println("Unknown command", command)
Expand Down
2 changes: 1 addition & 1 deletion starter_templates/java/code/src/main/java/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static void main(String[] args){
// You can use print statements as follows for debugging, they'll be visible when running tests.
System.err.println("Logs from your program will appear here!");

// Uncomment this block to pass the first stage
// TODO: Uncomment the code below to pass the first stage
// System.out.println("database page size: " + pageSize);
} catch (IOException e) {
System.out.println("Error reading file: " + e.getMessage());
Expand Down
2 changes: 1 addition & 1 deletion starter_templates/javascript/code/app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if (command === ".dbinfo") {
// You can use print statements as follows for debugging, they'll be visible when running tests.
console.error("Logs from your program will appear here!");

// Uncomment this to pass the first stage
// TODO: Uncomment the code below to pass the first stage
// const pageSize = buffer.readUInt16BE(16); // page size is 2 bytes starting at offset 16
// console.log(`database page size: ${pageSize}`);
} else {
Expand Down
2 changes: 1 addition & 1 deletion starter_templates/kotlin/code/app/src/main/kotlin/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fun main(args: Array<String>) {
if (command == ".dbinfo") {
val databaseFile = java.io.File(databaseFilePath).inputStream()

// Uncomment this block to pass the first stage
// TODO: Uncomment the code below to pass the first stage
//
// databaseFile.skip(16) // Skip the first 16 bytes of the header
// val pageSizeBytes = ByteArray(2) // The following 2 bytes are the page size
Expand Down
2 changes: 1 addition & 1 deletion starter_templates/python/code/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# You can use print statements as follows for debugging, they'll be visible when running tests.
print("Logs from your program will appear here!", file=sys.stderr)

# Uncomment this to pass the first stage
# TODO: Uncomment the code below to pass the first stage
# database_file.seek(16) # Skip the first 16 bytes of the header
# page_size = int.from_bytes(database_file.read(2), byteorder="big")
# print(f"database page size: {page_size}")
Expand Down
2 changes: 1 addition & 1 deletion starter_templates/ruby/code/app/main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# You can use print statements as follows for debugging, they'll be visible when running tests.
$stderr.puts "Logs from your program will appear here"

# Uncomment this to pass the first stage
# TODO: Uncomment the code below to pass the first stage
# database_file.seek(16) # Skip the first 16 bytes of the header
# page_size = database_file.read(2).unpack("n")[0]
# puts "database page size: #{page_size}"
Expand Down
Loading
Loading