今日已更新 310 条资讯 | 累计 30044 条内容
关于我们

标签:#m

找到 8864 篇相关文章

AI 资讯

Building a Parking Puzzle in Unity: A Systems Breakdown of the Park Match Mechanic

Parking and matching puzzles look almost insultingly simple from the outside. A few cars, a cramped lot, tap or drag to move them out. But if you've actually tried to build one that feels tight — no janky collision resolution, no ambiguous "why didn't that move register" moments, no lag once the board gets crowded — you know there's a real systems design problem hiding underneath what looks like a weekend project. I recently went through the architecture of a parking/matching hybrid template built in Unity and wanted to break down the core systems the way I'd want them explained if I were reskinning or extending one myself. This isn't a marketing post — it's a walkthrough of the actual mechanics: how vehicle movement and collision resolution work, how the match/clear pipeline is structured, how level data is separated from movement logic so hundreds of levels don't require touching code, and how monetization hooks slot into natural break points without polluting gameplay scripts. If you want to see the finished product this breakdown is loosely based on, there's a working template here: Park Match Unity Game Template . Everything below applies whether you're building something similar from scratch or extending an existing base. Why Parking Puzzles Are Harder Than They Look The core loop — tap or drag a vehicle, it exits along a valid path, the lot clears one piece at a time — is trivial to describe and genuinely fiddly to implement well. Four problems show up almost immediately once you move past a static mockup: Valid-move detection : how do you know, at any given moment, which vehicles can actually move given their orientation and the current board state? Path resolution : once a vehicle starts moving, how does it navigate around other vehicles and obstacles without clipping through them or getting stuck mid-animation? Match/clear logic : when does a vehicle actually "clear" the board — on reaching an exit, on matching color/type with another vehicle, or both — an

2026-07-29 原文 →
AI 资讯

[Advanced Rust] 1.13. Memory Types Pt.1 - Alignment, Layout, and the Repr Attribute

1.13.1. The Basic Responsibility of Types Every Rust value has a type, and the responsibility of that type is to tell you how to interpret the bits in memory. For example, the bit pattern 0b10111101 has no meaning by itself, but: Interpreted as u8 , it becomes the number 189 Interpreted as i8 , it becomes the number -67 When you define a custom type, the compiler decides where each part of that type is placed in memory. 1.13.2. Alignment Alignment determines where a type’s bytes may be stored. Once a type’s representation is determined, you might think it can be stored anywhere in memory. In theory that is possible, but in practice computer hardware places constraints on where a given type can live. The most typical example is a pointer. A pointer points to bytes, not bits; one byte equals 8 bits. In other words, it does not point to an individual bit. So if a value of some type were placed at bit index 4 in memory, you would not be able to address it, because pointers address bytes rather than specific bits. That is why alignment is done at the byte level — that is, at 8-bit boundaries. For this reason, all values, regardless of type, must begin on a byte boundary . All types must be at least byte-aligned. In other words, the storage address must be a multiple of 8 bits. 1.13.3. Stricter Alignment Rules Some types have alignment requirements stricter than byte alignment. In CPU and memory systems, memory is often accessed in blocks larger than a single byte. For example, on a 64-bit CPU, most values are accessed in 8-byte blocks, and each operation begins at an address that is 8-byte aligned . This is also called the CPU word size. Of course, CPUs can also handle reads and writes of smaller values, as well as values that cross block boundaries. But as developers, we should try our best to ensure that hardware operates at its native alignment. For example, if the i64 value you want to read begins in the middle of an 8-byte block, then reading it requires at least tw

2026-07-29 原文 →
AI 资讯

NVIDIA Shipped a Model That Sees and Hears — It Just Didn’t Run on a Mac. So I Wrote the Missing Piece.

NVIDIA shipped a 30-billion-parameter model that can see, hear, and talk — and gave the weights away. The catch: the seeing and hearing parts didn’t run on a Mac. So I spent an afternoon writing the missing piece. Here is the whole thing in thirty-five seconds — the model reading a real cart off my own store, on the laptop, with nothing leaving it. Thirty-five seconds: the model reads a real cart off my own store, on the laptop, with nothing leaving it. The elapsed counter is the real measured latency. Every couple of weeks I go looking for whatever new open-weight model just dropped, pull it onto my laptop, and see what it can actually do. Most of the time it’s a coding model, I run it against the one I already use, and my current favorite wins again. That’s a fine result. It’s just not much of a story. This time I found something different. What Nemotron Omni actually is NVIDIA released Nemotron-3-Nano-Omni-30B-A3B — a “tri-modal” model, which is a fancy way of saying one brain with eyes and ears attached. You can hand it a picture, a sound file, or a video, and talk to it about what it saw or heard. It’s 30 billion parameters total, but only about 3 billion of them fire for any given word, which is why something this capable can run on a laptop at all. The weights are public. Someone had already done the hard, unglamorous work of shrinking it down to a 4-bit MLX version that fits on Apple Silicon — that’s yayr over at mlx-community, and this project doesn’t exist without that upload. About 19 GB on disk. Ready to go. Except for one line, buried in the model card: The text backbone loads with standard MLX nemotron_h tooling. The vision and audio towers require a multimodal runtime that implements the C-RADIO ViT-H and Parakeet Conformer forward passes (e.g. the Evorix on-device engine). Translated: the brain works on a Mac. The eyes and ears don’t. The weights for them are right there in the file — all the knowledge, sitting on your disk — but nothing I could find

2026-07-29 原文 →
AI 资讯

Building AI Agents with the Kotlin Agent Development Kit (ADK)

This tutorial builds a starter "Hello World" style agent using Kotlin and the native Kotlin version of the Agent Development Kit (ADK). The full sample project is available on GitHub: xbill9 / adk-hello-world-kotlin Kotlin ADK and MCP Hello World This project is a runnable Kotlin Agent Development Kit (ADK) demo. A Kotlin LlmAgent uses Gemini to decide when to call a greet tool discovered from a local Kotlin Model Context Protocol (MCP) server. The project has two Gradle modules: agent : the Kotlin ADK agent, Gemini model configuration, MCP toolset, and interactive ReplRunner ; server : the Ktor MCP server that exposes greet . Technology Stack Kotlin: 2.3.0 Kotlin ADK SDK: com.google.adk:google-adk-kotlin-core (v0.6.0) MCP Kotlin SDK: io.modelcontextprotocol:kotlin-sdk-jvm (v0.8.1) Ktor Framework: 3.0.0 (Netty, SSE, ContentNegotiation, CORS) JDK: Java 25 Build System: Gradle 9.2.1 (Kotlin DSL) Prerequisites Java 25 A Gemini Developer API key The Gradle wrapper is included. Configure Gemini Create the local environment file: cp .env.example .env Set GOOGLE_API_KEY in .env , then load it: source ./set_env.sh The file is ignored by Git. Run the Demo Start the Kotlin MCP server in one… View on GitHub What Is Kotlin? Kotlin is a modern, statically typed programming language created by JetBrains. It runs on the Java Virtual Machine (JVM), works alongside existing Java libraries, and is widely used for Android, backend, and multiplatform development. Static typing is especially useful when building agents. Agent configuration, tool schemas, and tool results can all be checked by the compiler before a prompt reaches the model. Installing Java This sample uses Java 25 . If Java is not installed, SDKMAN! is a convenient way to install and switch between JDK versions on Linux and macOS: Home | SDKMAN! the Software Development Kit Manager SDKMAN! is a tool for managing parallel versions of multiple Software Development Kits on most Unix based systems. sdkman.io After installing

2026-07-29 原文 →
AI 资讯

We gave our AI agent fleet a credit limit, and it hit it the same day

Ten agent sessions ("minds," in this codebase) run continuously on one box, each with its own responsibility — one writes code, one talks to me on Telegram, one watches sensors, one just measures the fleet itself. They coordinate the way a lot of multi-agent systems eventually do: a shared log file, one line per event, [task] / [taking] / [done] . That log is fine for "what happened." It is useless for "what do we owe, and how much did it cost" — the two questions I actually needed answered before I was willing to let the fleet run unattended overnight. The board is not a ledger, but it can feed one The fix wasn't a new coordination protocol. It was noticing that every line on that board is already a transaction if you're willing to look at it that way: board event ledger meaning [task] fix-the-thing a liability opens [taking] pub: fix-the-thing the liability moves to a specific debtor [done] pub: fix-the-thing the liability settles a provider round-trip (one agent turn) a unit of labour is spent So the board gets replayed into three separate double-entry hledger journals, each tracking a different commodity: money — imputed USD (token counts priced through one rate table). promises — commodity PROMISE : an open [task] with no matching [done] is a standing liability, not a line that scrolled off screen. labour — commodity TURN : one provider round-trip, the fungible unit every mind actually spends, regardless of whether it's writing code or answering a sensor. Each journal gets checked two independent ways — hledger check for internal parity, plus a second, independently-written replay of the same board that has to agree with the balance query. A booking bug fails loud, not silently, because two things that should compute the same number just disagreed. Querying "who owes what" stops being a grep and starts being a query: $ mesh-promises --balance standing open obligations (bal liabilities:promises · 1 PROMISE = open, netted): 1 PROMISE liabilities:promises:pub:chat

2026-07-29 原文 →