First, create your ASP.NET Core Razor Pages / MVC / Blazor project if you haven't already.
Open a terminal in your project folder (not the solution folder!) and run the following to initialize an NPM package, which in our case only serves to download tailwindcss and daisyui:
This file contains hidden or 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
| use std::rc::Rc; | |
| use std::cell::RefCell; | |
| pub struct Character { | |
| pub display_name: String, | |
| // TODO: ability to store arbitrary properties | |
| } | |
| impl Character { | |
| pub fn new(name: impl Into<String>) -> Character { |
This file contains hidden or 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
| const std = @import("std"); | |
| const maxInt = std.math.maxInt; | |
| fn scaleInt(comptime DestType: type, val: anytype) DestType { | |
| if (@bitSizeOf(@TypeOf(val)) > 16) { | |
| @compileError("Function unsafe for values of bitsize greater than 16."); | |
| } | |
| const fv = @intToFloat(f32, val) / @intToFloat(f32, maxInt(@TypeOf(val))); // make ratio | |
| return @floatToInt(DestType, fv * maxInt(DestType) + 0.5); | |
| } |
This file contains hidden or 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
| /// Copy a source directory's files and its subdirectories' files to a destination. Will only copy directories and files. | |
| fn copyRecursiveDir(src_dir: fs.Dir, dest_dir: fs.Dir, src_path: []const u8, dest_path: []const u8) anyerror!void { | |
| var iter = src_dir.iterate(); | |
| while (true) { | |
| const entry = try iter.next(); | |
| if (entry == null) { | |
| break; | |
| } else { | |
| switch (entry.?.kind) { | |
| .File => try src_dir.copyFile(entry.?.name, dest_dir, entry.?.name, fs.CopyFileOptions{}), |
It's important that you connect with a community for something you want to learn, because it will help ease the learning process.
Discord is my preferred method of chatting. It's a good app, a lot of people use it. It's like the new Skype.
- The Handmade Network - Very talented people... let 'em know you're a newbie and you want guidance.
- Game Dev League - A community of hobbyist game developers.
- The Shebang - A smaller community of software developers. I used to co-own it. Drop me an @ ... I'm Code Messiah.
This file contains hidden or 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
| const Builder = @import("std").build.Builder; | |
| pub fn build(b: *Builder) void { | |
| const mode = b.standardReleaseOptions(); | |
| const exe = b.addExecutable("qubit", "src/main.zig"); | |
| exe.setBuildMode(mode); | |
| exe.linkSystemLibrary("c"); // link with libc | |
| exe.linkSystemLibrary("ncurses"); // link with ncurses.a (requires ncurses be installed where program is run) | |
This file contains hidden or 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
| /* | |
| NUMBER GUESSING DOMAIN-SPECIFIC LANGUAGE IN JAVA | |
| BY LUKE I. WILSON | |
| */ | |
| package org.vv; | |
| import java.util.ArrayList; | |
| import java.util.Scanner; | |
| import java.util.Random; |
This file contains hidden or 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
| package main | |
| import ( | |
| "bufio" | |
| "fmt" | |
| "os" | |
| "strings" | |
| "time" | |
| ) |
This file contains hidden or 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
| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| "strconv" | |
| ) | |
| const ( | |
| eps1m01 float64 = 1.0 - 0x1P-01 |
NewerOlder