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

标签:#tor

找到 1087 篇相关文章

AI 资讯

Python Itertools: 10 Tricks for Cleaner Code

Python Itertools: 10 Tricks for Cleaner Code tags: python, programming, tips, tutorial tags: python, programming, tips, tutorial Python Itertools: 10 Tricks for Cleaner Code You’ve probably written a loop that felt like it was dragging your code into the mud. Maybe you concatenated lists with + , zipped mismatched iterables and lost data, or manually tracked indices to count items. Before you add another for loop to your script, consider this: Python’s itertools module is a hidden superpower that can turn messy iteration logic into elegant, memory-efficient, and readable one-liners. Mastering itertools doesn’t just make your code cleaner—it makes it faster, especially when working with large datasets or infinite sequences. Let’s dive into 10 practical tricks you can use today to write better Python code. 1. Chain Multiple Lists Without Copying Memory When you need to merge several lists, the + operator creates a new list in memory. That’s wasteful for large datasets. Instead, use itertools.chain() , which yields items lazily—only when you need them. from itertools import chain list1 = [ 1 , 2 , 3 ] list2 = [ 4 , 5 ] list3 = [ 6 ] merged = chain ( list1 , list2 , list3 ) for item in merged : print ( item ) # 1, 2, 3, 4, 5, 6 This approach is memory-efficient and ideal for streaming or processing huge collections [6]. 2. Zip Uneven Lists Without Losing Data The built-in zip() stops when the shortest iterable ends. But what if you want to keep going and fill in missing values? Use itertools.zip_longest() with a fillvalue . from itertools import zip_longest names = [ " Alice " , " Bob " ] ids = [ 101 , 102 , 103 ] for name , id in zip_longest ( names , ids , fillvalue = " Unknown " ): print ( f " { name } : { id } " ) Output: Alice: 101 Bob: 102 Unknown: 103 This is perfect for aligning mismatched data streams [3]. 3. Generate Infinite Counters Gracefully Need a counter that never stops? itertools.count() gives you an infinite iterator starting from a specified value. A

2026-07-30 原文 →
AI 资讯

Getting Started with Ant Design — Build Your First React UI in 15 Minutes

What Is Ant Design? Ant Design (antd) is a React UI library built by Alibaba's Ant Group. It's the most starred React component library on GitHub from China, with over 90k stars — yet surprisingly undercovered in the English-speaking developer community. If you've used Material UI or Chakra UI, Ant Design is the Chinese equivalent, but with its own design philosophy: consistent, predictable, and packed with enterprise-grade components out of the box. Fun fact: Alibaba, Tencent, Baidu, and most Chinese tech companies use Ant Design in production. It powers dashboards that serve hundreds of millions of users. Why Ant Design Over MUI? Feature Ant Design Material UI Components 60+ 50+ Table (Pro) Built-in sorting, filtering, pagination, row selection Requires manual wiring Form validation Declarative, built-in Requires react-hook-form or Formik Tree-shaking Supported (v5) Supported Bundle size (min) ~200KB gzipped ~140KB gzipped Documentation Chinese-first, English translations available English-first Design system Ant Design System (custom) Material Design (Google) Ant Design wins on out-of-the-box productivity — especially for data-heavy apps like admin panels and dashboards. MUI wins on bundle size and first-party English docs. Installation npm install antd @ant-design/icons No peer dependencies beyond React 16+. Your First Ant Design Component import React from " react " ; import { Button , Space } from " antd " ; import { SearchOutlined , DownloadOutlined } from " @ant-design/icons " ; export default function App () { return ( < Space > < Button type = "primary" icon = { < SearchOutlined /> } > Search </ Button > < Button icon = { < DownloadOutlined /> } > Download </ Button > < Button type = "dashed" > Dashed </ Button > < Button type = "link" > Link </ Button > </ Space > ); } That's it. Five button variants with zero CSS. Building a Data Table in 5 Minutes import React , { useState , useMemo } from " react " ; import { Table , Input } from " antd " ; const data

2026-07-30 原文 →
AI 资讯

Gubernator Weekly Update: CoreDNS Aqueducts, SRE Stack, Network Topology & Cluster Auto-Updates!

Gubernator Weekly Update: CoreDNS Aqueducts, SRE Stack, Network Topology & Cluster Auto-Updates! Gubernator Weekly Update Banner Review Gubernator Weekly Update Banner What an intense week for Gubernator (gbnt)! If you're new here, Gubernator is the "Goldilocks" container orchestrator that bridges the gap between Docker Swarm's simplicity (native Compose support, simple node joining) and Nomad's scheduling flexibility (hardware targeting, labels, task-based management). Over the past 7 days, Gubernator evolved from a single-node engine into a production-ready cluster ecosystem. Here is a breakdown of everything shipped this week! 1. Ingress & Service Discovery ("The Aqueducts") One of our biggest milestones this week was shipping automated internal DNS resolution and edge ingress routing: CoreDNS Integration: Every node running Gubernator can now deploy CoreDNS. Containers across all hosts can resolve internal service IPs using dynamic domain names (.gbnt.test). As containers spin up or die, Gubernator's manager updates CoreDNS records in real-time. Caddy Ingress: Exposing web services is now effortless. Services deployed with routing labels are automatically proxied by Caddy, managing SSL and HTTP/HTTPS ingress dynamically. 2. SRE Observability Suite (gbnt monitor init) Observability shouldn't require writing 500 lines of YAML. With a single command, gbnt monitor init, Gubernator deploys a complete, production-grade observability stack: Prometheus & cAdvisor: Detailed container and host-level metrics collection (CPU, RAM, Network I/O). Loki & Promtail: Centralized log aggregation across all containers. Grafana: Pre-configured dashboards for instant visualization out of the box. Jaeger Tracing: Full OpenTelemetry distributed tracing support (OTLP gRPC :4317 & HTTP :4318). Interactive Network Topology (Weave Scope Integration) Understanding how containers talk to each other across a distributed cluster can be tough. We integrated Weave Scope directly into the Flutter

2026-07-30 原文 →
AI 资讯

How StayPresent's Logging Works (Without Breaking Yours)

A guide to python isolated logging with StayPresent's dedicated logger — no root logger mutation, what gets logged, and how to configure it. How StayPresent's Logging Works (Without Breaking Yours) A surprisingly common way for a third-party package to quietly break your application's logging is by calling logging.basicConfig() somewhere in its own code — which mutates the root logger and can silently change formatting, duplicate output, or override handlers you already configured for your own loggers. StayPresent avoids this entirely through python isolated logging : everything it logs goes through its own dedicated logger, never the root one. Table of Contents The Problem with logging.basicConfig() StayPresent's Dedicated Logger What Gets Logged, and at What Level Adjusting Verbosity Attaching Your Own Handler Logging During Multi-Bot Runs Logging During Shutdown Full Example Best Practices Common Mistakes FAQs Conclusion The Problem with logging.basicConfig() logging.basicConfig() configures the root logger, which every other logger in your process falls back to unless it's explicitly configured otherwise. If your bot calls it once at startup, and a dependency somewhere else in your stack calls it again, whichever call happens first usually "wins" silently — no error, just unexpected formatting or duplicate log lines that are hard to trace back to their cause. A well-behaved library avoids touching the root logger at all, and instead logs through its own named logger. StayPresent's Dedicated Logger StayPresent logs exclusively through a logger named "staypresent" , configured with a single dedicated StreamHandler and logger.propagate = False . It never calls logging.basicConfig() , and it never touches the root logger in any way. This means it cannot clobber, duplicate, or reformat log output your own script has already configured for its own, unrelated loggers — StayPresent's logs and your bot's logs coexist without interfering with each other. What Gets Logged,

2026-07-30 原文 →
AI 资讯

Why scheduled posts don't publish on time — inspecting WP-Cron with WP-CLI

A post scheduled to publish at a specific time doesn't go live when expected. A plugin's recurring email notification never arrives. This tends to happen on low-traffic sites, and there's a specific reason for it. Note: WP-Cron is WordPress’s built-in scheduling system. It sounds like the OS-level cron daemon, but the underlying mechanism is quite different. WordPress’s WP-Cron doesn’t work like a real OS cron daemon. On every page load, WordPress checks whether any scheduled task is past its due time and, if so, runs it. This is what's known as "pseudo-cron" — and its weakness is that nothing runs without a page visit . Schedule a post to publish at 3am on a site with little overnight traffic, and the publish task can sit unexecuted until the next visitor happens to load a page. WP-CLI lets you look inside this otherwise invisible system and run exactly the task you need, right now. Listing what's scheduled wp cron event list hook next_run_gmt recurrence publish_future_post 2026-06-20 03:00:00 - wp_version_check 2026-06-20 06:12:00 12 hours wp_scheduled_delete 2026-06-21 00:00:00 daily hook is the task's identifier, next_run_gmt is the next scheduled run time in UTC, and recurrence is the repeat interval. If publish_future_post is still listed despite its time having already passed, that confirms the task is overdue simply because no page load has triggered it yet. Running a task right now To trigger a specific task immediately: # Run a specific hook right now wp cron event run publish_future_post # Run every overdue task at once wp cron event run --due-now --due-now finds every task whose scheduled time has passed but hasn't run yet, and executes all of them. Instead of waiting for a visitor to trigger the check, this one command runs the post publish, the email notification, or whatever else is pending. Confirming WP-Cron itself is working wp cron test This checks whether the WP-Cron scheduler is functioning at all. On sites where wp-config.php has define('DISABL

2026-07-30 原文 →
AI 资讯

Build a Typed Training Data Client in TypeScript with intervals-icu

If your training dashboard starts as one HTTP request and grows into athletes, activities, wellness, workouts, gear, and performance data, a hand-written fetch wrapper becomes expensive to maintain. Every new endpoint adds another URL, another response shape, and another place to get authentication or retry behavior wrong. This tutorial shows a small, reproducible path with intervals-icu , an open-source TypeScript client for the Intervals.icu API . The goal is not to build a complete training application. It is to establish a typed client, choose the right authentication boundary, call one service, and understand what changes when you move from version 1 to version 2 of the library. TL;DR Install the stable npm package, create an IntervalsClient with an API key or OAuth access token, and use service accessors such as client.athletes or client.activities. Version 2 uses typed service methods, retries selected transient failures, and defaults requests to the authenticated athlete. Prerequisites You need: Node.js 18 or newer. npm. An Intervals.icu account with an API key, or an OAuth access token for an application acting for other users. A TypeScript project that can run ESM modules. The published package is intervals-icu version 2.2.1, and its package metadata declares Node.js >=18.0.0. The repository is public and licensed under MIT. The examples below target that stable package version, not an unreleased default-branch change. Install the stable client Create a small project and pin the package version used in this tutorial: mkdir intervals-demo cd intervals-demo npm init -y npm install intervals-icu@2.2.1 npm install -D typescript tsx The package publishes both ESM and CommonJS entry points and exposes TypeScript declarations from its package root. Add a script so a .ts file can run without a separate build step: { "type" : "module" , "scripts" : { "start" : "tsx src/index.ts" } } Create the smallest useful client Create src/index.ts. Keep the credential outside

2026-07-29 原文 →
AI 资讯

A Dead Man's Switch for Your Monitoring Stack

Your monitoring catches problems on everything except itself. Here is how an always-firing Watchdog alert plus an external heartbeat check turns silence into a signal, so you find out when your own alerting dies. TL;DR A monitoring system can't reliably monitor its own failure, so use a dead man's switch. Create an always-firing Prometheus Watchdog alert and route it to an independent external heartbeat service. As long as the monitoring pipeline is working, the Watchdog continuously refreshes the heartbeat. If Prometheus, Alertmanager, or the delivery path fails, the heartbeat stops and the external service alerts you through a separate channel. The key is independence: the system responsible for detecting that your monitoring is down must not depend on the monitoring stack itself. One of the traps of creating alerts on a monitoring stack is the hidden assumption that the mechanism evaluating the alert is running properly and has the ability to evaluate it. Prometheus watches your hosts and Alertmanager delivers the warnings. But what watches Prometheus? If something goes wrong and the monitoring stack fails in the middle of the night, no alerts are going out but there is definitely a problem. That is the failure mode that you should be most concerned about, because it is the one your monitoring cannot report on. The fix is an old idea with a grim name: a dead man's switch. A train's dead man's switch stops the train when the operator stops holding it down. The safe state requires continuous positive action, while the absence of that action is what triggers the response. Applied to monitoring, it means building one alert whose silence is itself the alarm. Step one: an alert that always fires This feels backwards the first time you see it, and it took me a little time to get it right. Basically, you create an alert with a condition that is always true, so it fires constantly, forever, on purpose. In the Prometheus world this is conventionally called Watchdog. - aler

2026-07-29 原文 →
AI 资讯

Handling Asynchronous Webhook Notifications & Callbacks in Joget via BeanShell

Handling Asynchronous Webhook Notifications & Callbacks in Joget via BeanShell When integrating Joget DX with external platforms—such as payment gateways, SMS providers, or ERP systems—requests are often processed asynchronously. The external system accepts a request immediately and dispatches an HTTP POST webhook callback to Joget minutes or hours later when processing completes. Receiving webhook callbacks inside BeanShell API endpoints requires two key tasks: Safe Variable Type Coercion: Handling parameter arrays ( String[] ) versus single strings ( String ) safely without throwing ClassCastException . FormDataDao Persistence: Saving or updating the notification payload inside a Joget form database table using FormDataDao . In this guide, we'll write a defensive Java/BeanShell script that receives asynchronous webhook callbacks and logs them cleanly into Joget. Architecture Overview Webhook Endpoint: An external system hits your Joget API endpoint with callback parameters (e.g. process_id , status , response_payload , recipient ). Type Extraction: A safe helper function handles parameter type variations (whether passed via URL query params or JSON request bodies). FormDataDao Save: Instead of executing raw JDBC queries, the script uses FormDataDao to persist a FormRowSet directly into Joget's form storage engine. The BeanShell Script Place this code inside your API Builder BeanShell script or custom REST endpoint: import org.joget.apps.app.service.AppUtil ; import org.joget.apps.form.dao.FormDataDao ; import org.joget.apps.form.model.FormRow ; import org.joget.apps.form.model.FormRowSet ; import org.joget.commons.util.LogUtil ; import java.util.UUID ; // 1. Safe Type Extraction Helper public String safeExtract ( Object param ) { if ( param == null ) return "" ; try { if ( param instanceof String []) { String [] arr = ( String []) param ; return arr . length > 0 ? arr [ 0 ] : "" ; } if ( param instanceof String ) { return ( String ) param ; } } catch ( Throwable t

2026-07-29 原文 →
AI 资讯

Generating Multilingual HTML Reports with Attachment Download Links in Joget

Generating Multilingual HTML Reports with Attachment Download Links in Joget Creating customized executive report summaries in Joget DX often requires more than simple database lists. Real-world business reports frequently need to join multiple tables, translate status labels based on the user's active locale ( #platform.currentLocale# ), and generate secure file download links for form attachments. In this guide, we'll build a Java/BeanShell script that queries main records and history logs, resolves internationalization ( i18n ) message keys dynamically, and generates interactive HTML reports embedded with secure attachment links. Key Components Dynamic i18n Translation: Uses AppUtil.processHashVariable("#i18n.key#", null, null, null) to convert database status codes into localized text matching the user's language setting. File Attachment Links: Formats secure file download URLs ( /jw/web/client/app/{appId}/{version}/form/download/{tableName}/{recordId}/{fileName} ) so users can open uploaded documents directly from the report summary. Multi-Table SQL Join: Merges main request details, audit transaction history, and custom review tables into a clean HTML document layout. The BeanShell Script Place this code inside a BeanShell Form Bounding Box or an HTML Report Generator tool step: import java.sql.Connection ; import java.sql.PreparedStatement ; import java.sql.ResultSet ; import java.net.URLEncoder ; import javax.sql.DataSource ; import org.joget.apps.app.service.AppUtil ; import org.joget.apps.app.model.AppDefinition ; import org.joget.commons.util.LogUtil ; // Helper: Resolve i18n hash variables dynamically public String getLocalizedText ( String messageKey ) { if ( messageKey == null || messageKey . isEmpty ()) return "" ; String hashVariable = "#i18n." + messageKey + "#" ; return AppUtil . processHashVariable ( hashVariable , null , null , null ); } String recordId = "#requestParam.id#" ; if ( recordId == null || recordId . trim (). isEmpty ()) { return "<di

2026-07-29 原文 →
AI 资讯

How to Update Joget App Environment Variables Programmatically in BeanShell

How to Update Joget App Environment Variables Programmatically in BeanShell In Joget DX, App Environment Variables are commonly used to store global configuration values—such as API endpoints, tax rates, batch counter sequences, or feature flags. While administrators can update these variables manually through Joget App Center, enterprise workflows often need to update environment variables programmatically (for example, incrementing a daily batch sequence counter or updating an OAuth access token). In this guide, we'll write a short BeanShell script using Joget's EnvironmentVariableDao to fetch and update App Environment Variables dynamically. How It Works Obtain App Context: AppUtil.getCurrentAppDefinition() retrieves the active application definition. Access the DAO Bean: AppUtil.getApplicationContext().getBean("environmentVariableDao") retrieves Joget's internal DAO for environment variables. Load & Update: environmentVariableDao.loadById(envVarId, appDef) retrieves the target variable instance. Modifying .setValue() and executing environmentVariableDao.update(envVar) persists the updated value immediately. The Code Place this BeanShell snippet inside a BeanShell Tool workflow step or a Form Post-Processing Tool : import org.joget.apps.app.dao.EnvironmentVariableDao ; import org.joget.apps.app.model.AppDefinition ; import org.joget.apps.app.model.EnvironmentVariable ; import org.joget.apps.app.service.AppUtil ; import org.joget.commons.util.LogUtil ; public void updateAppEnvironmentVariable ( String variableId , String newValue ) { AppDefinition appDef = AppUtil . getCurrentAppDefinition (); if ( appDef != null ) { // Retrieve Joget's Environment Variable DAO bean EnvironmentVariableDao envDao = ( EnvironmentVariableDao ) AppUtil . getApplicationContext (). getBean ( "environmentVariableDao" ); // Load target environment variable by ID EnvironmentVariable envVar = envDao . loadById ( variableId , appDef ); if ( envVar != null ) { LogUtil . info ( "EnvVar Manager

2026-07-29 原文 →
AI 资讯

Custom Cell Renderers & Action Buttons in Joget Spreadsheet Elements

Custom Cell Renderers & Action Buttons in Joget Spreadsheet Elements The built-in Spreadsheet Element in Joget DX provides a spreadsheet-like interface for managing tabular records inside forms. However, standard spreadsheet columns only support basic text or dropdown inputs out of the box. If you want to add row-level action buttons (like a Delete Row button) or turn plain cell text into an interactive Modal Popup Link , you can supply custom Handsontable renderer functions directly inside your Spreadsheet column properties. In this guide, we'll look at two practical examples: adding a custom row-deletion button and rendering interactive drill-down links. Example 1: Adding a Custom Delete Row Button In your Joget Spreadsheet element, open column properties for an action column and configure the custom renderer function below: {{ renderer : function ( instance , td , row , col , prop , value , cellProperties ) { // Render custom HTML button inside the cell td . innerHTML = " <button type='button' class='btn-delete-row'>Delete</button> " ; td . style . textAlign = " center " ; // Attach click handler to remove the target row from the Handsontable instance const btn = td . querySelector ( " .btn-delete-row " ); btn . onclick = function ( e ) { e . preventDefault (); e . stopPropagation (); // Get underlying Handsontable instance from the form field const hotInstance = FormUtil . getField ( " your_spreadsheet_field_id " ). data ( " hot " ); if ( hotInstance ) { hotInstance . alter ( " remove_row " , row ); } }; } }} Key Highlights: instance.alter("remove_row", row) removes the target row directly from the underlying data model. e.stopPropagation() prevents Handsontable from entering cell-edit mode when the button is clicked. Example 2: Interactive Drill-Down Popup Links To display a clickable link in a grid cell that opens a detailed record inside a Joget modal dialog (popup iframe), use this cell renderer: {{ renderer : function ( instance , td , row , col , prop , va

2026-07-29 原文 →
AI 资讯

The 8 Most Expensive Unit Conversion Mistakes in Engineering History — and the Software Bugs That Caused Them

TL;DR Eight engineering disasters. Zero arithmetic errors. Every single one was caused by two numbers — both correct, both carefully computed — meaning different things on opposite sides of a software interface. One cost $65 billion. Another killed 28 soldiers because 0.1 can't be represented in binary. The fix is never the math. The fix is the label. There is a particular kind of silence in a control room when someone realizes the number on the screen is in the wrong unit. It lasts about two seconds. Then it's replaced by the kind of noise nobody wants to hear. On September 23, 1999, that silence happened at the Jet Propulsion Laboratory in Pasadena, California. The Mars Climate Orbiter had just disappeared behind the planet. Telemetry showed the spacecraft at 57 kilometers above the surface. It was supposed to be at 140. The silence was four seconds long. Then someone said "oh no" — the official NASA transcript uses a stronger word — and $327 million of aluminum, titanium, and human effort disintegrated into the Martian atmosphere. What follows are eight stories about the same bug, wearing different uniforms. Some are famous. Some you've never heard of. Two of them are pure software failures that every developer who's ever written for (let i = 0; i < 10; i += 0.1) has come within a rounding error of replicating. 1. The Patriot Missile — When 0.1 Is Not 0.1 (1991) Let's start with the one that belongs in every CS curriculum. Because this isn't a "unit conversion" error in the traditional sense — nobody confused meters and feet. The error was in the way a computer counted time. And it killed 28 American soldiers in a warehouse in Dhahran, Saudi Arabia. The MIM-104 Patriot missile system tracks incoming targets using a phased-array radar. The radar scans the sky, and the fire-control computer predicts where the target will be when the interceptor arrives. That prediction depends on knowing exactly when the radar echo returned. Time is measured by the system's interna

2026-07-29 原文 →
AI 资讯

Locked out of wp-admin? Why WP-CLI works when `wp-login.php` doesn’t

A forgotten password, a security plugin that blocked your own IP by mistake, a plugin bug that turns the admin screen white — the causes vary, but the result is the same: you can’t log in to wp-admin. Note: WP-CLI is a command-line tool for managing WordPress, invoked as wp . It operates directly on the server, without going through a browser. This is exactly the situation where WP-CLI is useful. It works here because it never touches wp-login.php — it reads and writes the WordPress database and filesystem directly, so a broken login screen doesn’t affect it at all. Why WP-CLI keeps working when wp-admin doesn't A normal login follows the path: browser → wp-login.php → authentication → wp-admin. If anything along that path is broken — a plugin throwing a fatal error during authentication, a security plugin blocking your IP, a fatal error in the admin theme — the login itself can’t complete. WP-CLI connects over SSH and reads/writes the wp_users and wp_options tables (and the filesystem) directly. The code in wp-login.php is never executed, so problems on that path don’t matter. This does require that SSH access itself still works — on most hosting providers, SSH is a separate access path from the admin dashboard, so it usually still works even when wp-admin doesn’t. Scenario 1: Forgotten password # List administrator accounts wp user list --role = administrator --fields = ID,user_login,user_email # Overwrite the password directly wp user update 1 --user_pass = 'a-strong-new-password' wp user update writes the new password directly to the database row — no password-reset email, no token, no waiting on a delivery that might land in spam or not arrive at all. Scenario 2: A security plugin blocked your own IP Login-attempt-limiting plugins occasionally misclassify legitimate activity as an attack and add the working IP to a block list. # Deactivate the plugin responsible for the block wp plugin deactivate <plugin-causing-the-lockout> # Re-enable it later, after reviewin

2026-07-29 原文 →
AI 资讯

A Simple Git Workflow for Small Teams

Introduction Small teams don't need GitFlow or other complex branching models. They need a workflow that's easy to understand, quick to execute, and minimizes merge headaches. Here's a practical workflow I've used with teams of 2-8 developers. The Core Idea: Main and Short-Lived Feature Branches We keep it simple with one long-lived branch ( main ) and short-lived feature branches. Every change starts from main and is merged back as soon as it's ready. git checkout main git pull git checkout -b feature/my-feature Branch Naming Convention Use a consistent prefix to keep branches organized: feature/ for new features fix/ for bug fixes chore/ for maintenance tasks Example: feature/user-authentication , fix/login-error The Workflow Step by Step 1. Start from an Up-to-Date Main Before creating a branch, make sure your local main is up to date: git checkout main git pull --rebase 2. Create a Feature Branch git checkout -b feature/awesome-feature 3. Make Small, Frequent Commits Commit early and often. Each commit should represent a logical unit of work. git add . git commit -m "Add user model with email validation" 4. Push and Open a Pull Request Even if the branch isn't finished, pushing early allows others to see your progress. git push -u origin feature/awesome-feature Then open a PR against main . Keep PRs small (under 400 lines if possible). 5. Keep Your Branch Updated If main moves forward, rebase your branch to avoid conflicts later: git checkout feature/awesome-feature git rebase main # resolve conflicts if any git push --force-with-lease --force-with-lease is safer than --force because it prevents overwriting others' work. 6. Code Review At least one other team member reviews the PR. Look for logic errors, readability, and test coverage. 7. Merge via Squash Merge When the PR is approved, use squash merge to keep main history clean: git checkout main git pull git merge --squash feature/awesome-feature git commit -m "Add awesome feature" Or use the GitHub/GitLab squ

2026-07-29 原文 →
AI 资讯

Building Local AI Agents in Java with Tools4AI and Ollama: An Insurance Claims Use Case

Tools4AI is a 100% Java agentic AI framework that turns any annotated Java method into an AI-callable action. Ollama runs open models like Llama 3.1 and Phi-4 locally and exposes an OpenAI-compatible API. Point Tools4AI at http://localhost:11434/v1 and you get a fully offline, on-premise AI agent — no data ever leaves your network. In this tutorial we build an insurance claims triage agent that reads a claimant's free-text incident report, routes it to the right business action, extracts structured data, gates high-value payouts behind a human approval, and records a compliance audit trail. Who is this for? Java developers, solution architects, and engineering leaders in regulated industries (insurance, banking, healthcare) who want agentic AI without sending sensitive data to a third-party API . Table of Contents Why local AI agents matter for insurance Insurance runs on personally identifiable information (PII) : names, addresses, policy numbers, medical details, vehicle data, and loss descriptions. Sending that data to a hosted LLM API creates regulatory, contractual, and reputational risk. At the same time, claims teams are drowning in unstructured text — First Notice of Loss (FNOL) reports, adjuster notes, emails, and call transcripts. A local AI agent solves both problems at once: Data never leaves your premises. The model runs on your own hardware via Ollama. Deterministic business logic stays in Java. The LLM decides what to do; your audited, tested Java code decides how . Human-in-the-loop and audit trails are first-class, so you can satisfy compliance reviewers. That combination — private inference plus governed execution — is exactly what Tools4AI + Ollama gives you. What is Tools4AI? Tools4AI ( io.github.vishalmysore:tools4ai on Maven Central) is a lightweight, pure-Java agentic AI framework and ADK. Its core idea is simple and powerful: Annotate a Java class with @Agent and its methods with @Action . Tools4AI scans the classpath, and at runtime it maps

2026-07-29 原文 →
AI 资讯

The union drive at the Wikimedia Foundation is expanding

In June, UK staff at the nonprofit that runs Wikipedia became the first to announce their intentions to form a union. Now, US-based employees at the Wikimedia Foundation are joining the union drive, but management at the nonprofit have declined to voluntarily recognize their union. "While the Wikimedia Foundation touts to the public that they […]

2026-07-29 原文 →
AI 资讯

Run and Compare AI Evaluations with a CLI for Developers and Coding Agents

TL;DR: This walkthrough shows how developers and coding agents can use Quantiles , an open-source AI evaluation platform licensed under Apache 2.0, to quickly run, analyze, and compare AI evaluations locally. We'll use the SimpleQA Verified benchmark as an example throughout this post, letting you follow the commands, inspect the evaluation results, and configure your own model for the same workflow. Running an AI evaluation is rarely as simple as sending prompts to a model. Developers must connect datasets, model APIs, scoring logic, result storage, and comparison tooling before they can answer a basic question: did the system get better? When those pieces are spread across scripts, notebooks, and logs, every rerun becomes harder to reproduce and diagnose. A score alone cannot reveal whether the model changed or whether the dataset, prompt, scorer, or sample set changed with it. Quickstart: Run an example benchmark The Quantiles CLI is called qt on the command line. A simple curl ... | bash command supports macOS and Linux on X86-64 and Arm64 systems. First, use it to install the CLI: curl -fsSL https://cli.quantiles.io/install.sh | bash If you don't want to run code directly sourced from the internet, see the install.sh source code first. Next, let’s run a built-in benchmark from start to finish using a single command. SimpleQA Verified is a 1,000-prompt benchmark created by Google DeepMind and Google Research. It re-curates questions from OpenAI's SimpleQA benchmark to reduce problems such as incorrect labels, topical bias, redundant questions, and ambiguous source evidence. Each example includes a short factual question in problem , its reference answer , topic and answer-type metadata, and supporting URLs. Use the following command to run simpleqa-verified using the built-in Quantiles demo model, which doesn't incur any usage charges: qt run simpleqa-verified Results from the demo model are intended only to demonstrate the evaluation workflow because its output

2026-07-29 原文 →