DConf '25 | Building a 3D Game Engine with D | Lewis Nicolle
submitted by /u/aldacron [link] [留言]
找到 1407 篇相关文章
submitted by /u/aldacron [link] [留言]
I spent three days wondering why my MCP server would just... stop. No crash logs. No error messages. Clients connected fine, then after a few hours, every tool call returned silence. Turns out the Model Context Protocol (MCP) spec doesn't force you to handle errors — it assumes you will. But the reference implementations are minimal. Your server starts healthy, then bit by bit, things go wrong. A network blip. A malformed tool argument. An external API timeout. And suddenly your AI agent is staring at a blank response. Here's the pattern I ended up with. It's not clever. It just works. The Fix Start with a wrapper around your tool handlers. Every MCP server framework has some kind of tool registration — this works for the official Python SDK, the TypeScript SDK, and most community frameworks: from mcp.server import Server from mcp.types import ErrorData , INTERNAL_ERROR , INVALID_PARAMS import traceback import json class ResilientMCPServer ( Server ): """ An MCP server that doesn ' t silently die. """ async def call_tool ( self , name : str , arguments : dict ): try : result = await super (). call_tool ( name , arguments ) return result except ( ConnectionError , TimeoutError ) as e : # Network-level issues — reconnect and retry self . _reconnect () return self . _error_response ( f " Connection lost while executing { name } : { e } " ) except ValueError as e : # Bad arguments from the client — tell them clearly return self . _error_response ( f " Invalid arguments for { name } : { e } " , code = INVALID_PARAMS ) except Exception as e : # Everything else — log, don't crash traceback . print_exc () return self . _error_response ( f " Tool { name } failed: { e } " , code = INTERNAL_ERROR ) def _error_response ( self , message : str , code : int = INTERNAL_ERROR ): return { " content " : [{ " type " : " text " , " text " : f " ERROR: { message } " }], " isError " : True } def _reconnect ( self ): """ Reset transport layer without restarting the server. """ # Your recon
submitted by /u/iamgioh [link] [留言]
There’s not much information yet unfortunately. The PAT-related accounts do not seem to be limited to Korean ones, so be aware. submitted by /u/MirdovKron [link] [留言]
submitted by /u/BlondieCoder [link] [留言]
StarDeck lets you search, tag, filter, and sort your starred GitHub repos from a Chrome side panel. Everything stays locally in your browser. submitted by /u/Whole-Steak1255 [link] [留言]
I usually write here about Next.js, caching, and the bugs that steal your sleep. But this post is...
I gotta say, i Spent a Month Testing Chinese AI APIs — Here's What Actually Wins Look, I'm just an indie hacker trying to ship products without going broke. For the past month I've been obsessively running the four biggest Chinese AI model families — DeepSeek, Qwen, Kimi, and GLM — through every test I could think of. And honestly? I wish someone had given me a breakdown like this before I started. So here's my attempt. No corporate fluff, no hand-wavy "it depends" answers. Just real data from someone who actually pays these bills. Why I Even Started Looking at Chinese Models Honestly, I was a GPT-4o loyalist for the longest time. Then I saw my December API bill and nearly choked. $400+ for what amounted to a few chatbot features and some content generation. That's when a friend told me to check out DeepSeek and Qwen. I was skeptical. Like, REALLY skeptical. Chinese models in 2023 were a joke for English tasks. But I kept hearing whispers from other indie hackers about how good things had gotten. So I decided to actually test them properly through Global API's unified endpoint (more on that later). What I found kinda blew my mind. The Quick Cheat Sheet Here's the TL;DR table I wish existed when I started. I'm putting it up top because, lets be real, you probably just want the bottom line: Feature DeepSeek Qwen Kimi GLM Developer DeepSeek (幻方) Alibaba (阿里) Moonshot AI (月之暗面) Zhipu AI (智谱) Price Range $0.25-$2.50/M $0.01-$3.20/M $3.00-$3.50/M $0.01-$1.92/M Best Budget Pick V4 Flash @ $0.25/M Qwen3-8B @ $0.01/M N/A GLM-4-9B @ $0.01/M Best Overall V4 Flash @ $0.25/M Qwen3-32B @ $0.28/M K2.5 @ $3.00/M GLM-5 @ $1.92/M Code Generation ⭐⭐⭐⭐⭐ ⭐⭐⭐⭐ ⭐⭐⭐⭐ ⭐⭐⭐ Chinese Language ⭐⭐⭐⭐ ⭐⭐⭐⭐ ⭐⭐⭐⭐⭐ ⭐⭐⭐⭐⭐ English Language ⭐⭐⭐⭐⭐ ⭐⭐⭐⭐ ⭐⭐⭐⭐ ⭐⭐⭐⭐ Reasoning ⭐⭐⭐⭐ ⭐⭐⭐⭐ ⭐⭐⭐⭐⭐ ⭐⭐⭐⭐ Speed ⭐⭐⭐⭐⭐ ⭐⭐⭐⭐ ⭐⭐⭐ ⭐⭐⭐⭐ Vision/Multimodal Limited ✅ (VL, Omni) ❌ ✅ (GLM-4.6V) Context Window Up to 128K Up to 128K Up to 128K Up to 128K API Compatibility OpenAI ✅ OpenAI ✅ OpenAI ✅ OpenAI ✅ Alright, now let me act
I spent the better part of the last decade writing enough boilerplate code to regret it. In the early PHP days, it was FTPing files; in the modern era, it's writing custom Python scripts just to check if a new Claude model is out or to see if my prompt is going to blow my budget on tokens. We have reached a point where we are building 'agentic workflows,' yet the first thing every developer does when they want an agent to interact with Anthropic is write an API wrapper. It's redundant work. If you're using Claude in Cursor or Claude Desktop, the model should be able to talk to its own source. The Anthropic MCP server changes this by turning the Messages API into a set of tools rather than a separate integration task. It turns your AI agent into an orchestration layer for the API itself. The problem with 'Just use the API' When you're building with LLMs, there's a hidden tax: context management and cost uncertainty. You send a prompt, it works. You send a slightly larger one, it hits a context limit or costs three times what you expected. If your agent has access to the count_tokens tool via MCP, the workflow changes fundamentally. Instead of blindly sending massive payloads and praying to the provider gods, the agent can 'pre-flight' a prompt. It can look at the messages array, calculate the input token count, and decide—without human intervention—whether it needs to truncate context or if it's safe to proceed. This isn't just about convenience; it's about building reliable, autonomous systems that don't fail halfway through a complex reasoning task because they hit a hard limit. Managing the heavy lifting: Batching as a first-class citizen The most underrated tool in this set is create_batch_message . If you've worked with Anthropic's batch API, you know it’s the only way to handle high-volume, independent requests without destroying your budget. It's 50% cheaper than standard requests. But managing batches traditionally is a pain in the neck. You have to submit th
submitted by /u/mitousa [link] [留言]
I watched this video and I want to apply some code that I didn't understand in this way. Does anyone have any knowledge about this? submitted by /u/Every-Pitch2616 [link] [留言]
One day the browser automation flow started failing right after plugin updates with NameError: name 'plugin_form_selectors' is not defined in the post-update "residual check" step. The refactor that introduced this had landed back in v1.6.1. The error didn't surface until many rounds later. Reading the code, the cause is obvious in seconds — but nobody hit it for ages, because Python's lazy evaluation kept the leftover reference hidden until exactly the right execution path ran. This post walks through what the bug was and how we structurally prevented its kind via an AST static-analysis test. What happened — a reference that crossed a scope boundary browser_utils.py has two functions involved: run_browser_update_flow() , which orchestrates the whole update flow, and browser_update_remaining_plugins() , which handles only the plugin-update logic. The list of plugin-form selector candidates, plugin_form_selectors , used to be a local variable inside run_browser_update_flow() . In the v1.6.1 refactor — "let's split plugin update into its own function" — we created browser_update_remaining_plugins() and moved the plugin_form_selectors definition into it . # After v1.6.1 refactor def browser_update_remaining_plugins ( page , site , update_url ): plugin_form_selectors = [ # ← defined here ' #update-plugins-table-wrap form ' , ' form[name= " upgrade-plugins " ] ' , ' form[action*= " do-plugin-upgrade " ] ' , ' .plugins-php form ' , ] # ... update logic ... def run_browser_update_flow ( site , page ): # ... call to plugin updater ... browser_update_remaining_plugins ( page , site , update_url ) # ★ post-update "residual check" still uses the old local name for selector in plugin_form_selectors : # NameError if page . locator ( selector ). count () > 0 : pending_browser . append (...) The " after updating, make sure no plugin update forms are still visible " residual check stayed in run_browser_update_flow() . During the refactor, the call to extract this loop alongside the
While we can build simple applications without using classes using PySide6, But in big applications and Massive coding systems We should use Classes But why? To understand why do we need classes in PySide6 We should first see the Python code First from PySide6.QtWidgets import QApplication , QWidget , QPushButton , QLineEdit import sys class MainWindow ( QWidget ): def __init__ ( self ): super (). __init__ () button1 = QPushButton ( " Button 1 " ) input = QLineEdit () if __name__ == " __main__ " : app = QApplication ( sys . argv ) window = MainWindow () window . show () app . exec () Before talking about why do we need Classes for PySide6 Let's Explain the code first line by line The imports first thing we make the imports we do need: from PySide6.QtWidgets import QApplication, QWidget, QPushButton, QLineEdit The QApplication Is the simply the application we will make, Like empty app on the RAM it do nothing but it's on the RAM if it's alone And the QWidget Is the Blank screen That will be placed on the Empty Application in the RAM The QPushButton Is like any button we are saying in any app Like the Subscribe button on YouTube or like Post button on Twitter QLineEdit is the input bar, Like the input bar of ChatGPT where you put on it your prompt or like The input bar in WhatsApp Where you type any thing on it to send it to your friends The class And finally The thing You clicked on the post for First thing we define the class How can we define it? Why do we need to define it? Why do even we want it? Who created it? (NOOO IAM JUST KIDDING) We can simply define the class in python by just typing class That's it just class then the name of it For Example MainWindow and then a little semi-colon : OR EVEN WE GIVE IT A Parents And Why do we need to define it, For simply use it BRILLIANT RIGHT? And we want the classes in PySide6 for give it a parents QWidget or even QMainWindow , And we will explain both of them right now but before it Let's explain first what does parents
submitted by /u/stronghup [link] [留言]
As developers, we all want AI to review our code. But sending proprietary, unreleased code to third-party cloud APIs (like OpenAI or Anthropic) isn't always an option—especially if you're working on client projects or under strict NDAs. I wanted an AI code reviewer that was 100% private , free , and actually understood the context of my entire project . So, I built one using Python and Ollama . Here’s a look at what it does and how you can use it! What it does It’s a CLI tool that uses local LLMs (like qwen2.5-coder or llama3 ) to review your code. No API keys, no subscriptions, and zero data leaves your machine. But I didn't want to just paste code snippets into a terminal. I wanted a tool that actually fits into a developer's workflow. Here is what it supports: 1. Review an Entire Codebase Just point it at your project folder. The app will recursively gather your files, automatically ignoring bulky folders like node_modules , .git , vendor , and .next , and give you a full architectural review. python3 app.py ./my-project/ 2. Review Pull Requests Automatically Want to review a PR? Just pass the GitHub PR URL. The tool auto-detects that it's a diff, fetches the changes, and switches into "PR Review Mode." Instead of looking at architecture, it zeroes in on the + lines to find bugs, edge cases, and missing tests introduced by the PR. python3 app.py https://github.com/facebook/react/pull/30000 (Working on a private repo? Just pipe it: gh pr diff 123 | python3 app.py ) 3. Pipe Anything Into It You can pipe individual files, diffs, or snippets straight from your terminal. cat src/main.py | python3 app.py 🛠️ How to run it yourself Install Ollama and pull a solid coding model: ollama pull qwen2.5-coder Clone the repo and install the requirements: pip install -r requirements.txt Run it! python3 app.py ./your-code 💡 The Magic Under the Hood The script dynamically switches its prompt based on what you feed it. If you give it a directory, it looks for separation of concerns
Please read the 'How is this possible?' page, and the full interactive walkthrough to see how this is all done. Did you use AI? The site copy and explanations hand-edited by me pressing my keyboard buttons. I find AI writing to be cringeworthy and bland. However, AI did help a lot with churning out the code. It's definitely 'my code' - LLM-assisted, but not 'vibe-coded'. This is an entirely novel project and I don't think you could (or should) point an LLM at this and press 'Go' My full thoughts on the use of AI in this project are available to read here submitted by /u/Putrid-Bench5056 [link] [留言]
My 2nd article this week, I'm supposed to keep it to just once per week but whateverrr, I've had this...
Hey what's up guys👋🏻 Remember our last Perfect Circle challenge? We had some amazing attempts! While...
The interesting part here is not AI can generate an app. That part is becoming less surprising. The harder question is what happens after the demo works. My read is that AI has compressed the prototype phase, but it has not removed the production phase. If anything, it exposes weak engineering practices faster. When you use AI-generated code, what do you require before it can reach production? submitted by /u/Few-Garlic2725 [link] [留言]
Startle the snake by striking the grass. — The 36 Stratagems, Stomp the Grass to Scare the...