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

标签:#RAM

找到 1658 篇相关文章

AI 资讯

GPT vs Claude vs DeepSeek на одних задачах: регулярка, рефакторинг, SQL

На прошлой неделе DeepSeek отказался писать мне регулярку. Не «не смог», а вежливо объяснил, что регулярка тут плохая идея, и предложил цикл. Тогда я поймал себя на том, что уже год сравниваю модели «на глаз»: одна затупила — скопировал промпт в соседнюю вкладку, посмотрел, сделал выводы из ничего. Надоело. Я устроил маленький честный замер: три типовые задачи из моих рабочих будней, буквально один и тот же промпт, три модели. Про сетап — один абзац, чтобы дальше не отвлекаться. Хотелось убрать переменную «у одной вкладки отвалился VPN, у другой слетела сессия», поэтому гонял всё в одном окне через агрегатор; ссылка будет внизу, здесь она не важна. Важно одно: модель переключается прямо над полем ввода, так что все три участника получали идентичный текст без копипасты между сервисами. Участники: GPT (флагман, GPT-5-класс), Claude, DeepSeek. Задача 1. Регулярка: split CSV-строки, не ломая кавычки Промпт: «Напиши JS-регулярку, чтобы разбить строку CSV по запятым, но запятые внутри двойных кавычек разделителями не считать». Классическая ловушка: наивный split(',') рвёт поле "Иванов, Иван" пополам. GPT сразу выдал вариант с lookahead: const parts = row . split ( /, (?=(?:[^ " ] *" [^ " ] *" ) * [^ " ] *$ ) / ); Работает. Правда, на моём проверочном кейсе с экранированной кавычкой "" внутри поля — уже нет. Но я такого и не просил, засчитываю. Claude дал ту же регулярку, но с примечанием: lookahead на каждой запятой пробегает хвост строки, на длинных строках это квадратично, для продакшена берите csv-parse . Занудно, но по делу — я однажды именно такую конструкцию ловил на таймауте. DeepSeek — это тот самый отказ, с которого всё началось. Регулярку писать не стал, предложил цикл с флагом «мы внутри кавычек» — мол, так надёжнее. Формально это даже честнее, но задание было «напиши регулярку», и выдал он её только после уточнения. Итог раунда: GPT и Claude ровно, Claude на полбалла впереди за предупреждение. Задача 2. Рефакторинг: функция скидок с вложенными if Скормил всем

2026-07-20 原文 →
AI 资讯

Stop Coding, Start Directing: The Paradigm Shift for Every Software Engineer

DISCLAIMER: This post was written entirely by me! I used AI for a little research, spelling, grammar, and comprehension checks. This post was originally shared on Hackernoon Entertain me for a moment, let's appreciate where we are today by understanding where we've been… or at least, where I've been. I remember when I first learned to code. I was bad, like really bad. But I was so curious! It all started by writing some VBA in an MS Access Database to create an IT Inventory app in the late 90s. Then I learned JavaScript, ASP (without the .Net), then C#, .Net ( I still have my .Net for Dummies book, see below) , jQuery, Python, Java, Angular, ReactJS, and Python again (yeah, had to relearn that one for some reason), and I'm sure there are others in there I forgot about. Learning to write code was rewarding! There were those days I'd spend hours on a bug, only to realize I didn't initialize the variable or forgot a semicolon. I learned .Net over a weekend thanks to the above book. I never became an artist of the craft, like some of my colleagues have (you know who you are: Josh, Kevin, and many others), but I knew how to build anything. I loved that ability: I could build anything. Pure joy! If you haven't had the joy of learning to code, do your best to learn it, because you can't prompt your way to being a Senior Engineer . As I progressed in my career, I became an architect and senior lead. I started off by leading a single engineering team, and now I support large programs and teams. All the while, I never let go of hands-on-code. I still love coding for work and my myriad of side projects. Then, a few years ago, this GenAI thing showed up. Put me in that group of: oh-no-there-goes-my-joy. Joy, yes, not my job. I love my job because I get to do what I love. I loved the dramatic rollercoasters: architecting a perfect solution, realizing it's wrong, getting to write every line of code, chasing impossible bugs, panicking with deadlines, late nights chasing hot fixes,

2026-07-20 原文 →
AI 资讯

How Generalized Inverted Index works internally in Postgre SQL

Regular Indexing works on a column level; it indexes the entire column value, but if you want to index each value in one row, then the GIN indexing technique is used. GIN can index each element of JSON stored in a JSONB field How Postgres creates a GIN file physically, what is the format of that file, how that file is retrieved in RAM while fetching records, what data types are used, and how Postgres calculates the exact address of an element of JSON are all explained in the article submitted by /u/Ok_Stomach6651 [link] [留言]

2026-07-20 原文 →
AI 资讯

Everything Claude Code: How One AI Assistant Becomes a Full Engineering Team

Everything Claude Code: How One AI Assistant Becomes a Full Engineering Team Most developers use AI coding assistants in the same way. They open a repository and type: Build this feature. The assistant reads a few files, generates code, and reports that the task is finished. Sometimes the result is impressive. Sometimes it solves the wrong problem with perfectly formatted code. The issue is not always the intelligence of the model. The issue is the workflow around it. A single prompt often expects one AI assistant to behave like: a product planner a software architect a frontend developer a backend developer a security engineer a test engineer a debugger a code reviewer a release manager Real engineering teams do not work that way. They divide responsibility. One person plans. Another implements. Someone reviews security. Someone tests edge cases. Someone challenges the architecture. The final result improves because different people examine the same work from different angles. That is the idea behind Everything Claude Code , often shortened to ECC . ECC is an open-source collection of specialized AI agents, reusable skills, commands, security tooling, hooks, memory systems, and development workflows designed to turn Claude Code into something closer to an AI software engineering team. Instead of asking one general-purpose assistant to do everything in one pass, ECC separates software development into focused roles. That architectural idea is more important than any individual command. This article explains how ECC works, why developers are excited about it, how to install only what you need, and what security boundaries you should establish before giving any AI agent access to a real codebase. What Is Everything Claude Code? Everything Claude Code is not a new language model. It does not replace Claude. It is a workflow and configuration layer built around Claude Code. Think of Claude Code as one highly capable engineer. ECC attempts to turn that engineer into a co

2026-07-20 原文 →
开发者

is programming a good hobby?

so I have bee thinking about getting into programming but kinda feel like I wouldn't worth the time, but that thought was formed using my limited knowledge in programming, submitted by /u/Eastern_Manager5960 [link] [留言]

2026-07-20 原文 →
AI 资讯

Understanding Callback Functions in JavaScript

Introduction A callback function is one of the most important concepts in JavaScript. It allows one function to execute another function after completing a task. Callback functions are widely used in JavaScript for handling asynchronous operations such as API requests, file reading, event handling, and timers. What is a Callback Function? A callback function is a function that is passed as an argument to another function and is executed later. In simple words: A callback is a function that is called after another function finishes its work. Syntax function greeting () { console . log ( " Good Morning! " ); } function welcome ( callback ) { console . log ( " Welcome! " ); callback (); } welcome ( greeting ); Output Welcome! Good Morning! Explanation greeting() is the callback function. welcome() accepts a function as a parameter. callback() executes the greeting function after printing "Welcome!". Real-Life Example Imagine you order food at a restaurant. You place the order. The chef prepares the food. After the food is ready, the waiter serves it. Here, serving the food happens only after preparation is complete. This is exactly how callback functions work. Example 1: Email Sending function emailSent () { console . log ( " Email Sent Successfully! " ); } function sendEmail ( callback ) { console . log ( " Sending Email... " ); callback (); } sendEmail ( emailSent ); Output Sending Email... Email Sent Successfully! Example 2: Download File function downloadComplete () { console . log ( " Download Complete! " ); } function downloadFile ( callback ) { console . log ( " Downloading File... " ); callback (); } downloadFile ( downloadComplete ); Output Downloading File... Download Complete! Why Do We Use Callback Functions? Callback functions are useful because they: Execute code only after another task finishes. Improve code reusability. Handle asynchronous operations. Make event handling easier. Help avoid repeating code. Where Are Callback Functions Used? Some common u

2026-07-20 原文 →
AI 资讯

OpenAI Agents SDK: Building Production AI Agents (2026)

The OpenAI Agents SDK (formerly Swarm, released as stable in early 2026) is a Python library for building multi-agent AI systems. Unlike LangChain's abstraction-heavy approach or CrewAI's role-playing model, the Agents SDK exposes five clean primitives and gets out of the way. This guide covers everything from setup to production deployment, including handoffs, guardrails, sessions, and tracing. Installing and Configuring pip install openai-agents Python 3.10+ required. Set your API key: export OPENAI_API_KEY = sk-... The SDK also works with non-OpenAI models via LiteLLM — more on that later. The Five Core Primitives Agent → LLM + system instructions + tools + handoffs Runner → executes the agent loop (sync or async) Tools → Python functions the agent can call Handoffs → transfer control to another agent Guardrails → validate input/output before processing Sessions → persistent conversation state Your First Agent from agents import Agent , Runner agent = Agent ( name = " Code Reviewer " , instructions = """ You are a senior Python developer reviewing code for correctness, security issues, and adherence to PEP 8. Be specific and actionable. """ ) result = Runner . run_sync ( agent , " Review this function: def add(a,b): return a+b " ) print ( result . final_output ) Runner.run_sync() is the blocking version. Use await Runner.run() in async contexts. Tools: Extending What Agents Can Do The @function_tool decorator converts any Python function into a tool the agent can call. The docstring becomes the tool's description — write it clearly: from agents import Agent , Runner , function_tool import subprocess import os @function_tool def run_tests ( test_path : str ) -> str : """ Run pytest on the specified test file or directory. Args: test_path: Relative path to test file or directory (must be within ./tests/) """ # Security: restrict to tests/ directory only safe_path = os . path . join ( " ./tests " , os . path . basename ( test_path )) if not os . path . exists ( safe

2026-07-20 原文 →
AI 资讯

When Does a Prompt Become an Undocumented Program?

When we first decided to bring AI into analysts’ work, the task seemed fairly down-to-earth. The company has several development teams and roughly fifteen analysts. They collect requirements, prepare tasks, describe changes in Confluence, think through testing, and help align future implementation with both business and development. A lot of this work is repetitive, so giving analysts a tool that could prepare first drafts felt like an obvious idea. The problem is that a document in this kind of process almost never stands on its own. The same change exists in Jira, in Confluence, in mockups, in test scenarios, and in technical notes. Sometimes there are also separate instructions for making changes in the codebase. Each artifact has its own purpose, but all of them describe the same future system behavior. If the wording drifts apart, that can go unnoticed for several days, until different people begin working from different versions. A typical case looked roughly like this (the details and names are changed, but the mechanism is real). Jira said that a status field could have three values: draft , active , and archived . Confluence still contained an older table with only two values, while the test scenario also checked for disabled , which had been discussed early on and later rejected. The developer implemented what was written in Jira. The tester opened the scenario and filed a defect because disabled was missing. Only after that did the analyst compare the documents and realize that each of them preserved a different version of the decision. Nothing catastrophic happened. We simply had to go through the documentation again, update the tests, clarify the task, explain to the developer that the code did not need to change, and send the package through review one more time. It’s exactly these “nothing serious” moments that add up to delays, when the same task travels two or three times between an analyst, a developer, and a tester. At some point, it becomes diffi

2026-07-20 原文 →
AI 资讯

Operating on a Minimal Two-Core Postgres Instance

Running a production database on a minimal two-core PostgreSQL instance presents unique engineering challenges. In resource-constrained environments, default configurations quickly lead to CPU exhaustion, memory thrashing, and high latency. To maintain stable performance, you must aggressively manage resource allocation and optimize query execution plans. The first critical area is connection management. PostgreSQL allocates a separate operating system process for each connection. On a two-core machine, allowing hundreds of concurrent connections will cause severe context switching overhead, degrading performance significantly. You should restrict maximum connections to a low double-digit number and implement a connection pooler like PgBouncer. A pooler ensures that incoming traffic queuing happens outside the database engine, allowing the CPU to focus on executing active queries rather than managing process states. Memory allocation parameters require precise tuning on limited hardware. The shared buffers parameter, which dictates how much memory PostgreSQL uses for caching data, should typically be set to twenty-five percent of total system RAM. However, work memory is where many developers run into trouble. The work memory setting determines the amount of memory used by internal sort operations and hash tables before writing to temporary disk files. Since this memory is allocated per query operation, a complex query with multiple joins can consume many times the configured value. On a two-core instance with limited RAM, setting this value too high can trigger the out-of-memory killer, while setting it too low forces slow disk-based sorting. You must analyze your heaviest queries and find a balanced value that prevents disk thrashing without exhausting system memory. Query optimization becomes a daily necessity when compute resources are scarce. You must regularly inspect query execution plans using the explain analyze command to identify sequential scans on large

2026-07-20 原文 →