React | Omniverse |
---|---|
Styling | |
class="my_class" | name="my_class" |
.my_class { ... } | Element.my_class { ... } |
id="my_id" | style_type_name_override="my_id" |
my_id { ... } | MyId { ... } |
Layout | |
flexbox, flex-direction: row, gap: gap | ui.VStack(spacing=gap) |
flexbox, flex-direction: column, gap: gap | ui.HStack(spacing=gap) |
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
npx create-react-app@latest client --template=typescript |
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
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle | |
builder.Services.AddEndpointsApiExplorer(); | |
builder.Services.AddSwaggerGen(); |
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
md Service | |
cd Service | |
dotnet new sln | |
dotnet new gitignore | |
dotnet new webapi -n Articles.Api | |
dotnet sln add Articles.Api | |
git add -A | |
git commit -m "Initial Commit" |
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
md dotnet-openapi-node | |
cd dotnet-openapi-node | |
git init |
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 [playerProbability, questionProbability] = ratingSystem.getPlayerProbabilities(player.rating, question.rating) | |
const expectedOutcome = playerProbability > 0.5 ? 1 : 0 | |
const playerOutcome = Math.random() < playerProbability ? 1 : 0 |
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 minRating = player.rating - ratingRange | |
const maxRating = player.rating + ratingRange | |
const isRatingWithinRange = (question: Question) => minRating <= question.rating && question.rating <= maxRating | |
const question = getRandomWhichMeetsConstraints(questions, isRatingWithinRange) |
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
export function createCsvFromObjects<T extends Record<string, unknown>>(os: T[]): string { | |
if (os.length == 0) { | |
throw new Error(`Cannon create CSV from empty list. Given list must not be empty.`) | |
} | |
const firstResult = os[0] | |
const keys = Object.keys(firstResult) | |
const headers = keys.join(',') | |
const rows = os.map(result => Object.values(result).join(',')) |
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
// Execute simulation | |
const numQuestionsPerPlayer = 100 | |
// The maximum difference that a question's rating will be from the player's rating | |
// Simulates a queuing system the pairs likely candidates | |
const ratingRange = 250 | |
const symmetricResults = simulateGames(symmetricRatingSystem, players, questions, numQuestionsPerPlayer, ratingRange) | |
const asymmetricResults = simulateGames(asymmetricRatingSystem, players2, questions2, numQuestionsPerPlayer, ratingRange) |
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
// For each player simulate the player answering series of questions and observe rating changes | |
export default function simulateGames( | |
ratingSystem: RatingSystem, | |
players: Player[], | |
questions: Question[], | |
numQuestionsPerPlayer: number, | |
ratingRange: number | |
): Result[] { | |
const results: Result[] = [] |
NewerOlder