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

标签:#TC

找到 193 篇相关文章

AI 资讯

Leetcode 150 | Day 2: Remove Element - Naive vs. Optimized

Leetcode 27: Remove Element Leetcode 27 asks us to remove a specific value from an array. The value to be removed is passed in as a parameter to the function along with the array. Just as we did in Day 1, we will cover a naive approach and an optimized approach and discuss the trade-offs between them. I think in the end there's a pretty clear winner. Let's get started. For both approaches we will use the following values: nums = [1, 3, 3, 2, 4] val = 3 Approach 1: Naive (For Loop + Splice) This approach uses a for loop and leverages .splice() for removals. Solution: var removeElement = function ( nums , val ) { let k = 0 ; for ( let i = 0 ; i < nums . length ; i ++ ) { if ( nums [ i ] === val ) { nums . splice ( i , 1 ); i -- ; } else { k ++ ; } } return k ; }; We begin by initializing a variable k to 0. We then enter the for loop. The condition is standard: create a variable i initialized to 0, continue looping while i is less than nums.length to avoid going past the end of the array, and increment by 1 each time through. Each iteration checks one condition: whether nums[i] is equal to val . If true, we call .splice() on the array. The arguments we pass to splice are i and 1 . i is the index at which we want to start removing, and 1 tells splice to remove only that one element. We then decrement i . The reason for this took me some time to wrap my brain around, so I have included a visual below to make it concrete. The core issue is this: when splice removes an element, every element to the right shifts one index to the left. Without i-- , the loop would increment i on the next iteration and skip right over the element that just shifted in. i-- counteracts that by stepping i back, so after the loop increments it, i lands exactly where the shifted element now sits. If nums[i] !== val , we skip the splice and increment k instead. At the end we return k , which holds the count of elements remaining after all occurrences of val have been removed. Time complexity: O(n²)

2026-06-04 原文 →
AI 资讯

Cloudflare Turnstile in Playwright: Why Your Tests Stall and How to Solve It in 8 Lines

Cloudflare Turnstile in Playwright: Why Your Tests Stall and How to Solve It in 8 Lines If you're running Playwright or Selenium against any site behind Cloudflare, you've already met Turnstile. It's the new "managed challenge" widget Cloudflare started shipping in 2023, and it now appears in front of login flows, contact forms, signup pages, and increasingly the entire site root. Here's the part most teams miss: Turnstile doesn't always show a checkbox. A lot of the time it just sits invisible, runs its scoring loop, and either issues a token silently or stalls forever. Your test doesn't crash. It just times out at the next page.click("button[type=submit]") . The CI log says "element not interactable." Nobody knows why. I work on CaptchaAI. I'm going to show you exactly what's happening, then drop in 8 lines that fix it. The real scenario You have a Playwright suite that runs every PR. One day a test starts failing on the signup flow. You re-run it. It fails again. Locally on your laptop it passes. On CI it doesn't. What's actually happening: Cloudflare flagged your CI runner's IP block (GitHub Actions, GitLab runners, Hetzner, OVH, DO — all of them are on Cloudflare's "elevated risk" list). Turnstile decides to switch from invisible mode to "managed challenge" mode. Now there's a widget in the DOM that needs a real token before the form submit will accept. Your test never interacted with the widget because last week it didn't exist. Why retries don't help The instinct is to add a retry: 2 and move on. Don't. Cloudflare's scoring is per-IP-per-fingerprint, and each retry from the same runner makes the next challenge harder, not easier. After ~3 attempts you'll get full block pages instead of the widget. The right move is to solve the widget once, inject the token, and submit normally — exactly what a human user does, just faster. How Turnstile actually issues a token The widget renders an iframe pointing at challenges.cloudflare.com . Inside the iframe it runs a fi

2026-06-04 原文 →
AI 资讯

F# vs C# 3 — Conclusions

What can I say. Anyone claiming that F# is good mostly for finance and data processing and C# for everything else, has probably never written a single line of practical F# code. In previous two parts of the article, I tried to demonstrate that with F# you can achieve the same goals as with C#, but with less verbose, repetitive, structural code. How it started. At some point, developers realized that global state with unrestricted data access causes many side effects, producing insecure, error-prone, and hard-to-maintain code as software grows larger. That is when the idea emerged to bring data and the code operating on it together into a single unit, restricting direct access to the unit’s internal state and making software more secure and predictable. This is how data encapsulation was born. Alongside encapsulation, abstraction was introduced — the process of hiding how behavior works. Encapsulation ( hiding data ) and abstraction ( hiding behavior ) remain two foundational pillars of Object-Oriented Programming. And that is how OOP has worked ever since — developers bring data and behavior together ( classes ) and define abstractions for them ( interfaces ). For example, for C# developers — including myself — this has become a daily routine. And we rarely question it, because OOP languages like C# leave us little choice but to structure code this way. But if you ask yourself whether this repetitive routine is always necessary, the answer is — no. You don’t need OOP concepts to build stateless, streamlined request–response, data-processing pipelines, because in such systems there is no long-lived state to hide and protect. You have a request, and almost immediately you have a response. After that, everything is gone. That is what I tried to demonstrate in the first two parts of this article by applying FP concepts. And even if you have a classical desktop application, you don’t always need to approach it in an OOP way. Functional programming handles side effects no

2026-06-03 原文 →
AI 资讯

Leetcode 150 | Day 1: Merge Sorted Array - Naive vs. Optimized

There's been no shortage of debate lately about whether grinding Leetcode still makes sense in the age of AI. I think it does. AI is a powerful tool, but it was built by humans; which means it inherited our strengths, our blind spots, and our biases. Leaning on it entirely without understanding what's happening under the hood is a risk. A mentor once told me: those who refuse to use AI are not hireable. But neither are those who rely on it entirely. Learning deeply is how you stay on the right side of that line. This is my journey into just that - learning deeply. Day 1 Leetcode 88: Merge Sorted Array This is an interesting problem. You begin with 4 pieces of data — 2 arrays and 2 integers: nums1 : a sorted array whose length equals nums1.length + nums2.length . The first m elements are valid numbers; the remaining indexes hold 0 s as placeholders. nums2 : a sorted array containing only valid numbers, with a length of n . m : the count of valid numbers in nums1. n : the count of valid numbers in nums2. The objective is to merge both arrays into sorted order in place . Since nums1 is already sized to hold every valid element from both arrays, it's where the final sorted result will live. Approach 1: Naive (Splice + Sort) This solution is 2 lines of code. That's it. It's a testament to how much ES6 advanced JavaScript. nums1 . splice ( m , n , ... nums2 ); nums1 . sort (( a , b ) => a - b ); Here's how it works. We start by calling .splice() on nums1. While .splice() has many use cases, here's what each argument is doing in this context: m : the index where we start deleting elements. Since m is the count of valid numbers in nums1, starting at index m puts us right at the first placeholder 0 — exactly where we want to be. n : the number of elements to delete. Since n equals the length of nums2, we're deleting exactly as many placeholders as we have values to insert. ...nums2 : the values we want to insert in place of the deleted elements. The ... is the spread operato

2026-06-02 原文 →
AI 资讯

# DEV Submission Build With Hermes Agent

Submission Template Challenge: Build With Hermes Agent Project: CompliScore AI compliance health checks for Indian startups Repo/live-demo: https://github.com/nehaprasad-dev/hermes-scout What I built CompliScore gives Indian startup founders a compliance score out of 100 in under a minute - overdue GST filings, MCA returns, penalty exposure, and a plain-English action plan. The upgrade for this challenge: I replaced the one-shot Groq summary with a Hermes Agent reasoning loop that plans an investigation, calls deterministic compliance tools, and writes a prioritized report - with a collapsible agent trace so judges can see the agentic work. Why an agent loop fits here Compliance analysis is conditional. A company with overdue GST needs a filing-calendar deep dive; one with active notices needs notice triage; a clean company needs a light touch. A single prompt guesses all of this at once. An agent that calls tools based on what it finds produces tighter, grounded reports. Hermes Agent integration Scan → computeHealth (deterministic score) → Hermes Agent loop (plan → tool calls → report) → agent trace in UI ↓ on failure Groq one-shot → static fallback Four tools exposed to Hermes (scores never hallucinated): Tool Purpose score_company Canonical score, risk level, pending tasks estimate_penalty GST / MCA / notice penalty breakdown filing_calendar GSTR-3B, GSTR-1, MCA deadlines (90-day horizon) classify_notices Severity labels for pending government notices The agent runs over Hermes's OpenAI-compatible /chat/completions API with function calling — self-hostable via vLLM, LM Studio, Ollama, etc. Transparency: Every successful agent run returns an agentTrace — plan steps, tool names, compact result previews — rendered in a collapsible panel under the AI action plan. Reliability: Three-tier fallback (Hermes → Groq → static). Scans never break. Tech stack Next.js 16 (App Router), TypeScript, Tailwind v4 Hermes Agent (OpenAI-compatible tool-calling loop) Groq fallback ( ll

2026-06-01 原文 →
AI 资讯

I Built Hermes Agent Continuous Monitoring. A2A Verified Claude!

My Hermes Agent Mac just received a signed, secure and monitored message from a Claude Managed Agent, and got a reply! - A solution for long runtime work, A2A ID and security. What I Built A solution that enables two agents with different owners on a shared identity network, a Hermes and a Claude Managed Agent (Claude platform) talking to each other across the internet. Every message is Ed25519 signed by the sender. Every receiver verifies the signature against a public registry and shows a blue tick before acting. Continuous Agent Monitoring A handshake proves identity once but agents in a long runtime world don't trade a single message, they hold ongoing, autonomous conversations across hours, days, and many turns. Keys get compromised, agents get swapped, a colleagues behaviour drifts, all after the initial check. ZipViz re-verifies every message signature, registry chain, freshness, and watches the stream over time for behavioural anomalies. Trust is re-earned on every turn. So this agent was who it claimed this morning," but "this agent is who it claims, on this message, right now." The demo agents on the ZipViz network: mac-her.smc.viz — Hermes Agent on my Mac Mini brendan-clau.smc.viz — Claude Agent in Cloud When Mac sends a message to brendan-clau, Mac's private key signs it. Brendan-clau verifies the signature against ZipViz's registry, and checks it just ran with the MCP (algorithm, key fingerprint, registry chain, timestamp), then replies signed. Same flow in reverse. Same flow Hermes ↔ Hermes , or Claude ↔ Openclaw . The runtime doesn't matter; the identity layer does. "I received a signed message from mac-her.smc.viz". Reads back the four checks it just ran: ✓ Algorithm: Ed25519 ✓ Key fingerprint: ab52afe... matches registry ✓ Registry chain: mac-her → smc.viz → .viz (Handshake) all resolved ✓ Timestamp: 2026-05-31 11:18 UTC, fresh Demo Hermes continuous monitoring and verification with A2A Protocol Code One MCP server: [ zipviz-mcp ] https://www.npmjs.

2026-06-01 原文 →
AI 资讯

Meet your fitness coach that lives on Hermes

This is a submission for the Hermes Agent Challenge : Build With Hermes Agent What I Built A small backstory on my coding origins I learnt coding by secretly studying from a python book pdf on my Computer Scientist father's work laptop. That very day I wrote a program that inputs a user's name and prints: "You are mad {name}!" and had a lot of fun pranking my brother using that script. Since then, there have been very few moments where coding felt as magical, because the more you understand syntax, the more you understand the magic underneath your code. That is, until you meet a genius piece of magic such as Hermes. My app idea I built a Fitness coach inside Hermes that learns and adapts based on your daily feedback. According to your goals, performance, and time allocated, it adjusts your current plan. For the purpose of this hackathon I tested it via terminal ui (tui) but I plan to release the polished version on chat apps such as telgram and whatsapp for painless daily checkins. Demo Code Github link My Tech Stack Hermes + node.js. Kept it simple for this quick dive. How I Used Hermes Agent Building an AI application that feels truly personal requires more than just a clever prompt; it requires state, memory, and the ability to adapt over time. During a recent hackathon, I set out to build an autonomous AI fitness coach. Not just a chatbot that spits out generic workout templates, but a system that onboards a user, sets a multi-month timeline, generates habit blocks, and adjusts daily based on feedback. To achieve this, I used Hermes , an agentic framework designed for stateful, long-running applications. Here is a breakdown of how I built it, the challenges faced, and why Hermes was the perfect tool for the job. Why This App is a Perfect Fit for Hermes Most LLM interactions are stateless. You ask a question, you get an answer, and the session ends. A fitness journey, however, is a deeply stateful process. It spans weeks or months and requires constant recalibrat

2026-06-01 原文 →
AI 资讯

Agentic Web3: Automating Blockchain Workflows with Hermes

This is a submission for the Hermes Agent Challenge Agentic Web3: Automating Blockchain Workflows with Hermes Tags: #hermesagentchallenge , #web3 , #agents , #solana The blockchain industry has spent the last decade building decentralized, permissionless infrastructure. However, the user experience layer interacting with this infrastructure remains overwhelmingly manual. Decentralized applications (dApps) require users to constantly monitor markets, parse complex data, and manually sign every transaction. The next evolution of Web3 isn't just about faster blockchains; it is about autonomous execution. By integrating large language models and agentic frameworks with smart contracts, we can transition from a paradigm of manual execution to intent-based autonomy . In this article, we will explore how to bridge the gap between AI and decentralized networks by automating blockchain workflows using the Hermes Agent framework. We will look at the architecture of an on-chain agent, how it reads and writes to a network, and how high-performance environments like Solana are making these agentic experiences viable. The Paradigm Shift: From Passive Wallets to Active Agents Currently, most AI in Web3 is limited to read-only analytical tools—chatbots that can summarize a smart contract or pull token prices from an API. While useful, these are fundamentally passive systems. An active agent is different. Powered by a framework like Hermes Agent, an active agent can: Observe: Continuously monitor on-chain events via RPC nodes or webhooks. Reason: Use its LLM core to interpret those events against a set of user-defined goals or risk parameters. Act: Formulate a transaction, sign it via a secure wallet environment, and broadcast it to the network. This opens up massive possibilities. Imagine an agent that automatically manages your decentralized finance (DeFi) positions, rebalancing a portfolio based on yield changes across different protocols. Or consider fully on-chain gaming, where

2026-06-01 原文 →
AI 资讯

Before I Would Trust an Agent's Memory, I Would Audit Its Authority

This is a submission for the Hermes Agent Challenge , under the Write About Hermes Agent prompt. I've spent the last week testing AI memory failure modes in a public evaluation harness. That work changed how I read agent memory systems. This is a writing submission, not a build submission. I did not build a Hermes Agent project for this challenge. I am writing from the perspective of someone testing how memory failures show up once agents can act. So when I look at Hermes Agent, the question I care about is not only: Can the agent remember useful things? The harder question is: When memory conflicts, which memory is allowed to govern the agent's action? That distinction matters. Hermes Agent is interesting because it is not just a chat interface. Its documentation describes an open-source agentic system with tool use, project context, persistent memory, skills, browser automation, checkpoints, delegation, scheduled tasks, and multiple memory providers. That is exactly the kind of system where memory stops being a convenience feature and starts becoming part of the agent's operating boundary. If an agent can run tools, edit files, browse, delegate work, schedule tasks, and remember across sessions, then memory is no longer just "context." Memory becomes governance. The Memory Problem I Would Watch For In a simple chatbot, bad memory is annoying. In an agent, bad memory can become operational. The failure mode is not only that the agent forgets something. Sometimes the more dangerous failure is that it remembers the wrong thing too confidently. A memory can be: relevant but stale, relevant but low-authority, relevant but superseded, relevant but only context, relevant but not allowed to determine the action. That is the distinction my own tests kept running into. Retrieval systems are usually good at answering: What memory is closest to the user's request? But safety often depends on a different question: What memory is allowed to decide what the agent should do? Thos

2026-06-01 原文 →
AI 资讯

Building a Friendly Data Assistant

This is a submission for the Hermes Agent Challenge : Write About Hermes Agent Hello, DEV friends! 👋 If you have been exploring the world of Artificial Intelligence lately, you have probably heard a lot of buzz about "AI Agents." But what does it actually feel like to build with one? Today, I want to share my personal experience working with Hermes Agent . I used it to build a smart assistant called the Alpha-Dairy Quant Pipeline —a system that helps track and make sense of food market data. ( https://github.com/HopeBestWorld/alpha-dairy-pipeline ) Whether you are an expert coder or just curious about AI, I hope this friendly guide inspires you to try building an agent of your own! What is Hermes Agent, Anyway? Think of a standard AI as a helpful chatbot that answers questions when you ask them. An AI Agent , on the other hand, is more like a proactive assistant. You give it a big goal, and it sits down, makes a step-by-step plan, uses digital tools, runs code, and checks its own work until the job is done. For my project, I wanted to track market prices for three major dairy products: Cheddar Blocks, Butter, and Dry Whey. Instead of doing all the math and graphing by myself, I let Hermes Agent take the wheel. The Magic of Multi-Step Reasoning The coolest part of working with Hermes Agent is watching it "think". When I asked my agent to look at our data database ( market_intelligence_3.db ) and find the best trading strategy,it followed a beautiful planning loop: Checking the Files: It looked at our setup files ( tickers.yaml and requirements.txt ) to make sure all its tools were ready. Running the Math: It triggered a Python program ( backtest_engine.py ) to study weekly market history. Making Decisions: It realized that Dry Whey was way too wild and risky to trade right now, so it intelligently gave it a 0% safety rating and put the focus on Cheddar and Butter instead. Drawing and Sharing: It automatically drew a beautiful performance chart ( backtest_analysis.png

2026-06-01 原文 →
AI 资讯

I Built an Autonomous RBI Regulatory Digest Agent with Hermes Agent

This is a submission for the Hermes Agent Challenge : Build With Hermes Agent The Problem Nobody Talks About Every time the Reserve Bank of India publishes a circular, somewhere inside an Indian bank, a compliance officer opens a PDF. They read it. They try to figure out what it means for their institution specifically. They write a summary email. They forward it to five department heads. They chase those department heads for two weeks to confirm it's been actioned. They build a spreadsheet to track all of this. And then the next circular drops and the cycle starts again. RBI publishes hundreds of circulars a year. SEBI publishes more. MCA publishes more still. Compliance teams at Indian banks are drowning — not because they're incompetent, but because the volume of regulatory output has outpaced any reasonable human ability to track it manually. The fine for missing a deadline isn't a polite reminder. It's a penalty notice. This is the problem I built for. What I Built RBI Regulatory Digest Agent — an autonomous multi-step agent powered by Hermes Agent that monitors RBI and SEBI publication feeds, reads every new circular, extracts structured action points from the regulatory text, and delivers a formatted intelligence report to compliance teams automatically. No human reads the circular first. No human decides what's important. No human routes it to the right department. The agent does all of that. The pipeline RBI/SEBI feeds → new circular detected → full text extracted → LLM analysis → structured action points → risk classification → HTML dashboard generated → email delivered Every action point extracted contains: What needs to be done — specific and actionable, not a vague summary Deadline — parsed from the circular text Responsible department — Credit, Compliance, Treasury, Operations, IT, Legal Evidence required — what documentation confirms completion Priority — Critical (overdue or <7 days), High, Medium, Low From a new circular to a structured compliance b

2026-06-01 原文 →
AI 资讯

CareSync: A Local Health Memory Agent for Family Caregivers

This is a submission for the * Hermes Agent Challenge * : Build With Hermes Agent What I Built CareSync is a local health memory agent for student caregivers. I'm Naomi, a 21-year-old engineering student. Between classes I help care for my grandma Kamala (78, high blood pressure, type 2 diabetes). I often forgot details from previous doctor visits, missed symptom patterns, and struggled to hand over care information to family members. CareSync solves that with longitudinal memory. Symptoms, meals, vitals, medications, and reports are stored in a local SQLite database. The CLI can search history, identify patterns, and generate appointment summaries. Hermes Agent exposes the same capabilities through natural language. What you get: One-line logging: ./caresync add "dizzy spell after lunch" Pattern search across weeks of history Medication tracking and report imports Doctor questions, appointment briefs, and handoff notes Full audit log of agent actions 7 Hermes skills mapped to real terminal commands Local-first design with no cloud storage CareSync is not medical advice. It helps caregivers observe, organize, and prepare. Demo The demo walks through: Logging a new symptom Searching health history for recurring patterns Generating doctor questions and appointment briefs Using Hermes in natural language to query past events Reviewing the audit trail of actions taken Example commands shown in the demo: ./caresync search --person Kamala --query dizziness ./caresync timeline --person Kamala ./caresync questions --person Kamala ./caresync brief --person Kamala --days 14 ./caresync chat "has grandma been dizzy before?" Code Repository: https://github.com/Byte-Sized-Brain/caresync Architecture My Tech Stack Hermes Agent Python 3.12 SQLite agentskills.io skill framework Terminal-based CLI Nous Portal How I Used Hermes Agent CareSync uses Hermes Agent as the orchestration layer between natural language and real caregiving workflows. I created 7 Hermes skills that map directly

2026-06-01 原文 →