This document provides guidelines for maintaining high-quality Rust code. These rules MUST be followed by all AI coding agents and contributors.
All code you write MUST be fully optimized.
"Fully optimized" includes:
| """ | |
| The most atomic way to train and run inference for a GPT in pure, dependency-free Python. | |
| This file is the complete algorithm. | |
| Everything else is just efficiency. | |
| @karpathy | |
| """ | |
| import os # os.path.exists | |
| import math # math.log, math.exp |
| # ----------------------------------------------------------------------------- | |
| # AI-powered Git Commit Function | |
| # Copy paste this gist into your ~/.bashrc or ~/.zshrc to gain the `gcm` command. It: | |
| # 1) gets the current staged changed diff | |
| # 2) sends them to an LLM to write the git commit message | |
| # 3) allows you to easily accept, edit, regenerate, cancel | |
| # But - just read and edit the code however you like | |
| # the `llm` CLI util is awesome, can get it here: https://llm.datasette.io/en/stable/ | |
| gcm() { |
| // Runs simplified goldfish games of Penny Dreadful Near-Death Experience Combo. Simplifications include: | |
| // - no interaction from the opponent, obviously | |
| // - doesn't simulate cards besides combo pieces and lands | |
| // - no maximum hand size | |
| // - Lost Auramancers doesn't actually remove NDE from the deck | |
| // - generally poor decision making | |
| // - lots of other stuff (see inline comments) | |
| using System; | |
| using System.Collections.Generic; |
| #!/bin/bash | |
| # this forces Arena into full screen mode on startup, set back to 3 to reset | |
| # note that if you go into the Arena "Graphics" preference panel, it will reset all of these | |
| # and you will need to run these commands again | |
| defaults write com.wizards.mtga "Screenmanager Fullscreen mode" -integer 0 | |
| defaults write com.wizards.mtga "Screenmanager Resolution Use Native" -integer 0 | |
| # you can also replace the long complicated integer bit with any other scaled 16:9 | |
| # resolution your system supports. |
| import 'dart:async'; | |
| import 'package:firebase_database/firebase_database.dart'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:shared_preferences/shared_preferences.dart'; | |
| void main() { | |
| runApp(new MyApp()); | |
| } |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <stdint.h> | |
| #ifdef _MSC_VER | |
| #include <intrin.h> /* for rdtscp and clflush */ | |
| #pragma optimize("gt",on) | |
| #else | |
| #include <x86intrin.h> /* for rdtscp and clflush */ | |
| #endif |
How do you send information between clients and servers? What format should that information be in? What happens when the server changes the format, but the client has not been updated yet? What happens when the server changes the format, but the database cannot be updated?
These are difficult questions. It is not just about picking a format, but rather picking a format that can evolve as your application evolves.
By now there are many approaches to communicating between client and server. These approaches tend to be known within specific companies and language communities, but the techniques do not cross borders. I will outline JSON, ProtoBuf, and GraphQL here so we can learn from them all.
| #!/usr/bin/env bash | |
| # Author: Sasha Nikiforov | |
| # source of inspiration | |
| # https://stackoverflow.com/questions/41293077/how-to-compile-tensorflow-with-sse4-2-and-avx-instructions | |
| # Detect platform | |
| if [ "$(uname)" == "Darwin" ]; then | |
| # MacOS |