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:
| //go:build dpdk | |
| // Blast dummy UDP packets over several queues (one core each) and print | |
| // packets/sec. ~45 lines of Go driving DPDK through github.com/atoonk/packetio, | |
| // hitting 64-byte line rate on a 100G ConnectX. | |
| // | |
| // Build & run (needs libdpdk installed, e.g. `apt install libdpdk-dev`): | |
| // | |
| // mkdir blast && cd blast # drop this file in as main.go | |
| // go mod init blast |
| package main | |
| import ( | |
| "encoding/json" | |
| "fmt" | |
| "reflect" | |
| ) | |
| // NatsMessage with Data field as json.RawMessage | |
| type NatsMessage struct { |
| # Jails vs bhyve (https://forums.freebsd.org/threads/jails-vs-bhyve.57817/) | |
| # bhyve - Virtualisation: Creates a blank-disk that can be used to run an entire-OS | |
| (bootloader, kernel, userland, etc.) by the virtualisation software. | |
| # Jails - OS-Level Virtualisation: Jails uses the same kernel and main resources as | |
| the host OS (FreeBSD). But creates a separate and isolated userland and network-space. | |
| So the Jail cannot see the filesystems of the host OS. | |
| It all depends on your hardware resources and needs. It would be a waste of resources to run FreeBSD inside Bhyve if using the same |
| # Disable app on xiaomi | |
| pm disable-user app.package.name | |
| # Re-enable it | |
| pm enable app.package.name | |
| # Uninstall app | |
| # Sometimes uninstall command may not work without -k option on un-rooted devices | |
| pm uninstall --user 0 app.package.name | |
| # Install uninstalled system app | |
| pm install --user 0 $(pm dump app.package.name | awk '/path/{ print $2 }') |
| #!/usr/bin/env python3 | |
| import os | |
| import subprocess | |
| import sys | |
| import tempfile | |
| if subprocess.run(["git", "branch"], stdout=subprocess.PIPE | |
| ).stdout.decode().strip() != "master": | |
| print("WARNING! Not on the master branch.") | |
| subprocess.run(["git", "pull", "--rebase"]) |
| @Entity | |
| @NamedEntityGraph(name = "graph.Order.items", | |
| attributeNodes = @NamedAttributeNode("items")) | |
| public class Order implements Serializable { | |
| .... |
| Start spring-boot app without depending on Database? | |
| https://stackoverflow.com/questions/23850585/how-to-start-spring-boot-app-without-depending-on-database/23875516#23875516 | |
| Spring boot apps will start fine even if DB is down or there is no DB. | |
| Apps will pick up the connections on the fly as DB comes up which means there is no need to restart the web server or redeploy the apps. | |
| There is no need to start the tomcat or redeploy the apps, if DB goes down from running state and comes up again. | |
| application.yml : | |
| spring: | |
| datasource: | |
| driverClassName: com.mysql.jdbc.Driver |
| https://vpsfree.org | |
| https://vestacp.com/ | |
| http://browserstack.com | |
| Good analysis. People rush to “optimize the code” but they don’t bother to measure or look for the best algorithm. | |
| Bug Hunting | |
| https://amybughunter.files.wordpress.com/2013/01/defect_tracking_decide1.jpg | |
| # mssql jdbc driver installation in maven for now on Nexus repository |
| run this in .m2 files | |
| it lists all the corrupted jar files in the repository | |
| find /home/me/.m2/repository/ -name "*jar" | xargs -L 1 zip -T | grep error | grep invalid | |
| To resolve them , delete them first and re run the build or run |