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

标签:#programming

找到 1578 篇相关文章

AI 资讯

OpenAI Just Bought Gitpod: The AI IDE Wars Are Officially On

OpenAI just bought a cloud company, and if you only read the headline you'd miss the point. This deal tells you exactly where AI coding is heading: out of your editor and into the cloud. Here's what happened and why it matters. What OpenAI actually bought On June 11, 2026, OpenAI announced it's acquiring Ona, a German startup you might know by its old name, Gitpod. Terms weren't disclosed, and the deal still needs regulatory approval before it closes. Ona builds secure cloud environments where code can run. That's the whole reason OpenAI wanted it. Its Codex coding agent has grown fast, now past 5 million weekly active users, up from 3 million in April, and the jobs those agents run have gotten much longer. Tasks that used to take a few minutes now stretch into hours, sometimes days. An agent that works for hours can't live on your laptop. Close the lid and it dies. It needs a persistent place in the cloud to keep running. That's what Ona gives Codex, and notably, Ona's platform can run inside a customer's own cloud, which matters for enterprises that won't send code elsewhere. Ona's enterprise usage reportedly grew 13-fold this year, with clients like major banks and pharma companies. Why this is a bigger deal than it looks For years, AI coding meant an assistant inside your editor. Autocomplete, a chat panel, quick edits. The editor was the product. That era is ending. When agents run for hours on their own, the important question isn't "how good is the autocomplete." It's "where does the agent run, and for how long." The battleground is shifting from the editor to persistent cloud execution, and OpenAI just bought its way into that fight. The wider war OpenAI isn't alone in this move, which is why it feels like a real war now. Cursor already added cloud agents that run tasks without tying up your machine. Devin, from Cognition, was built cloud-first as an autonomous engineer from day one. Anthropic's Claude Code runs long, multi-step jobs and connects into your t

2026-07-21 原文 →
AI 资讯

Strings look simple... until they surprise you.

Strings & Text Processing: Text Isn't as Simple as It Looks If someone asks you what's the simplest type of data in programming, there's a good chance you'll say strings . After all, they're just text. A person's name is a string. An email address is a string. A password is a string. Even the message you're reading right now is just a collection of strings. At first glance, there doesn't seem to be much to learn. You create a string, print it, compare it with another string, and move on. But after writing a few programs, things start getting... strange. You convert "hello" into uppercase, yet the original string somehow stays the same. An emoji that looks like a single character suddenly reports a length of 2 . Joining thousands of small strings together makes your program unexpectedly slower. And then someone introduces you to something called Regex , which looks less like code and more like an ancient spell. None of these are bugs. They're simply the result of how strings actually work behind the scenes. In this lesson, we'll uncover those hidden details one by one. Surprise #1: Why Didn't the String Change? Take a look at this code. const original = " hello " ; const shouted = original . toUpperCase (); console . log ( original ); console . log ( shouted ); What would you expect the output to be? Many beginners think the output will look like this: HELLO HELLO But that's not what happens. Instead, JavaScript prints: hello HELLO The original string remains exactly as it was. Why? Because strings are immutable . What Does "Immutable" Mean? The word immutable simply means: Once something is created, it cannot be changed. Think of a printed book. If you want every occurrence of the word hello to become HELLO , you don't magically change the ink that's already on the paper. Instead, you print a new copy with the updated text. Strings behave in a similar way. Whenever you use methods like: toUpperCase() toLowerCase() replace() concat() the original string stays untouch

2026-07-21 原文 →
AI 资讯

From text-JSON parsing to Claude tool use in JobSearch

My job-search tool had five functions whose only purpose was fixing JSON that Claude had just written. _clean_json_text , _fix_unescaped_newlines , _fix_single_quotes , _strip_markdown_wrapper , _extract_and_parse_json . There was also a sixth, _retry_json_fix , which took the broken JSON and sent it back to the model with a polite request to fix its own mess. I wrote every one of them, one bug at a time, over weeks. I was a little proud of them. That was the problem. How you end up with five parsers JobSearch is my personal tool, in production, single user: me. It ingests job offers from nine boards, and when I press "Analyze", Claude reads the offer against my CV and returns a structured verdict: score, recommendation, career track, the English level the ad actually requires. That verdict has to be JSON, because everything downstream is a database row, not prose. The first version did what every tutorial does. Ask the model for JSON in the prompt, take response.content[0].text , run json.loads on it. It worked in the demo and then production started teaching me things. The model wrapped the JSON in markdown fences, so I wrote a function to strip them. Sometimes it used single quotes, so I wrote a function to fix those. Then a description with a line break inside a string, so I wrote _fix_unescaped_newlines . Then a NaN where a number should be. Every fix was five lines, obviously correct, and came with its own tests. I still have the test names in the git history and they read like a confession: test_removes_trailing_commas , test_replaces_nan_with_null , test_replaces_infinity , test_unclosed_fence_still_strips_opening . By April the parsing layer was around 250 lines with seven strategies, chained, each catching what the previous one let through. The last resort was the AI self-repair call: if nothing parsed, send the broken output back and ask the model to repair it. A second API call, with real latency and real cost, to fix a formatting problem the first call

2026-07-21 原文 →
AI 资讯

Kubernetes Health Probes: Liveness, Readiness, and Startup Explained

You've deployed your app to Kubernetes. The pod starts — then it gets killed. Or it's running but no traffic reaches it. Or it takes 90 seconds to initialize and gets restarted in a loop. Every one of these problems traces back to the same root cause: misconfigured or missing health probes . Kubernetes gives you three types of probes: livenessProbe , readinessProbe , and startupProbe . Each serves a different purpose. Mix them up and your pods restart in infinite loops. Get them right and your deployments self-heal, scale correctly, and handle rolling updates without a single dropped request. Here's what each probe does, when to use it, and how to configure it for a real production service. 1. Liveness Probe: Is the Container Alive? The liveness probe answers one question: "Is this container still running correctly?" If the probe fails, kubelet kills the container and restarts it. livenessProbe: httpGet: path: /healthz port: 8080 initialDelaySeconds: 5 periodSeconds: 10 failureThreshold: 3 Use liveness probes for deadlock detection . If your app enters a state where it's alive but not making progress (a goroutine leak, a stuck mutex, an infinite loop), the liveness probe exposes that and triggers a restart. The #1 mistake people make: using the liveness probe to check external dependencies like databases or upstream APIs. Don't do this. If your database is down and your liveness probe fails, Kubernetes will restart your pod — but the database is still down. Restarting the app doesn't help, and now you have a crash loop on top of a DB outage. That's worse. Liveness probes should only check internal process health. Not database connectivity, not Redis, not upstream services. 2. Readiness Probe: Is the Container Ready for Traffic? The readiness probe answers: "Should this pod receive traffic?" If it fails, the pod is removed from all Service endpoints. It is not restarted. readinessProbe: httpGet: path: /ready port: 8080 periodSeconds: 5 failureThreshold: 2 successThre

2026-07-21 原文 →
AI 资讯

Why environment variables don’t suppress WP-CLI PHP Deprecated warnings — the phar + shebang path and a three-part structural fix

A previous post covered how to absorb PHP 8.2 Deprecated warnings from WP-CLI using a three-layer defense . The approach — prepending WP_CLI_PHP_ARGS to set error_reporting — works in many environments. But a case came up where Deprecated warnings wouldn’t disappear despite the same configuration. Tracing the cause revealed a structural reason why the environment variable never arrived. This post records that root cause and the three-part fix added in v1.6.8. Why environment variables don’t arrive — the phar + shebang execution path An agency reported that on Xserver, plugin list retrieval was failing across multiple sites (referred to here as "site A / site B") with a large volume of Deprecated messages. We reproduced the same behavior on our own Xserver setup (PHP 8.2.30, WP-CLI 2.7.1) and traced the execution path. Xserver’s /usr/bin/wp is a phar binary. Inside, it starts with a #!/usr/bin/env php shebang, so the actual startup sequence looks like this: shell → /usr/bin/wp (shebang: #!/usr/bin/env php) ↓ env locates php and starts it ↓ php loads the phar → WP-CLI runs In this path, WP_CLI_PHP_ARGS is never read as a PHP startup option. WP_CLI_PHP_ARGS is supposed to let WP-CLI pass a -d flag to PHP, but when PHP itself is launched via shebang, control never reaches the point where WP-CLI can inject that flag into PHP’s invocation. # doesn’t work — /usr/bin/wp on Xserver is a shebang-launched phar WP_CLI_PHP_ARGS = "-d error_reporting='E_ALL & ~E_DEPRECATED'" wp plugin list --format = json # works — -d goes directly to the php binary php -d error_reporting = 'E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED' /tmp/wp-cli-2.7.1.phar plugin list --format = json We verified this against our production setup: with the first form, 407 Deprecated lines remained; with the second, 0. Pillar A — detecting the php-direct path and injecting -d The fix: inspect wp_cli_path for whether it’s a php-direct invocation, and if so, inject -d error_reporting immediately after the PHP

2026-07-21 原文 →
AI 资讯

Structured Logging in Node.js: How a Business ID Became My correlationId

I've been working in software for more than 15 years. This is the first piece I've decided to write about the job. I picked this topic because it was a small, real problem that cost me time more than once, until I finally stopped and fixed it properly. Quick disclaimer: this isn't distributed tracing or multi-service observability. It's a targeted fix for one specific problem: correlating logs within a single Step Function execution. If your scenario is different, the problem takes a different shape. What matters here is the reasoning, not the recipe. Quick context for anyone who doesn't work with serverless: AWS Step Functions is an orchestration service. You design a workflow as a state machine (JSON), and each state usually triggers an AWS Lambda (a function that runs on demand, no server to manage). In my case, a request kicks off a state machine execution that passes through several Lambdas in sequence: some do validation, others call external services, and one waits on a callback response before moving on. The fix turned out to be simpler than it sounds: a field Step Functions already offered for free, and I just wasn't using it. A request was processed 120 days ago. The customer calls: "Did you receive my request? I never heard back." You open the AWS Console. The Step Functions execution is already gone. Execution history only sticks around for 90 days, and even within that window, finding one specific execution among thousands is already a hassle. That leaves CloudWatch, with logs from every Lambda in the pipeline. You have one piece of data: the case ID. But every Lambda logged its own way: no standard, no correlation between them. To reconstruct what happened, you have to open each function's logs in the order the workflow probably ran, and piece it together by hand. It wasn't the error itself that hurt. It was the time lost just organizing the logs before you could actually start investigating. The Chaos The pipeline wasn't huge, but it wasn't trivial ei

2026-07-21 原文 →
AI 资讯

Your Application Is Ready... According to Whom?

Over the past few years, AI has fundamentally changed how software gets built. Teams can go from an idea to a working application in a fraction of the time it used to take, and founders can create products with resources that would have been unimaginable just a few years ago. That's an incredible shift, and I think it's one of the most exciting changes our industry has seen. What hasn't changed, though, is the question that comes after the application is built: Is it actually ready? Throughout my career, I've been involved in delivering enterprise software across many different industries and organizations. One thing I've learned is that there isn't a single definition of what makes an application "ready." If you ask six different stakeholders whether a system is ready, you'll probably get six different answers—and they're all likely to be valid. That's because each person is looking at the software through the lens of the outcome they're responsible for: A founder may be wondering whether the application can handle the growth they're hoping for over the next year. A CTO is often focused on where the biggest technical risks are and what should be improved first. An engineering leader is thinking about production readiness, security, reliability, and operational support. An agency inheriting a client application wants to understand what they're taking ownership of before making commitments. An acquirer is trying to estimate the cost of technical debt An Investor wants confidence that the technology is creating long-term value rather than future expense. Those perspectives are different because the questions they're trying to answer are different. The challenge is that we often evaluate all software the same way. Traditional assessments tend to focus on the health of the codebase. They look at architecture, security, maintainability, testing, complexity, and technical debt. Those are all important, and they should absolutely be part of any technical review. But they'r

2026-07-21 原文 →
AI 资讯

Uma Máquina, Duas Contas Claude, Zero Estado Compartilhado

Vi um post legal esses dias sobre rodar duas contas do Claude Code na mesma máquina compartilhando tudo entre elas: mesmas skills, mesmos servidores MCP, mesmos hooks. O artigo era: "Um cérebro, duas carteiras" Eu rodo, exatamente o oposto, e acho que pra muita gente o oposto é a escolha certa. Minhas duas contas não são uma pessoal e uma reserva pra quando os créditos acabam. Uma é pessoal, outra é de trabalho. A última coisa que eu quero é meus MCP servers de trabalho, meus hooks de trabalho e meu histórico de projeto de trabalho vazando pras sessões pessoais. Então em vez de ligar as duas, eu mantenho elas separadas de propósito . O setup inteiro O Claude Code guarda o estado num diretório de config ( ~/.claude por padrão) e lê a variável CLAUDE_CONFIG_DIR pra apontar pra outro lugar. Esse é o único mecanismo que você precisa. Sem shim, sem symlink, sem jq . bash # ~/.zshrc # Claude Code: contas isoladas (pessoal vs trabalho) # Cada uma usa um CLAUDE_CONFIG_DIR proprio -> credenciais/sessao separadas. # ~/.claude = pessoal (default) # ~/.claude-work = trabalho claude-work () { CLAUDE_CONFIG_DIR = " $HOME /.claude-work" claude " $@ " ; } claude-personal () { CLAUDE_CONFIG_DIR = " $HOME /.claude" claude " $@ " ; } # 'claude' sozinho continua sendo a conta pessoal. source ~/.zshrc claude-work # pede login OAuth da conta de trabalho, uma vez só Usei funções de shell em vez de alias por um motivo: a função repassa "$@" limpo, então claude-work --resume abc e claude-work chat funcionam sem a variável de ambiente vazar pra nada mais no shell. Um alias faria quase o mesmo aqui, mas a função deixa a passagem de argumentos explícita. É isso. claude puro é pessoal. claude-work é trabalho. Nada é compartilhado, e é aí que mora a graça. Por que eu não compartilho o cérebro A versão de cérebro compartilhado faz symlink de skills , plugins , settings.json e dá merge no bloco mcpServers entre as duas contas pra elas se comportarem igual. Se as suas duas contas são de fato a mesm

2026-07-21 原文 →
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 原文 →