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

标签:#p

找到 12603 篇相关文章

AI 资讯

I tried to compile TypeScript into a native binary with scriptc

TL;DR: I tried to compile the TypeScript 6 compiler into a native binary with scriptc , and I failed — it got 90% of the way there and then hit an internal compiler error it couldn't get past, so there is no native tsc at the end of this story. But it's a failure worth having: I learned exactly where a week-old TypeScript-to-native compiler runs out of road, and I got some interesting numbers along the way. So when scriptc was released to the public a few days ago, I knew exactly how my week was going to end. If you haven't seen it yet, scriptc is a compiler that takes TypeScript — plain, ordinary TypeScript, no special dialect, no annotations — and turns it into a small, fast native binary. No Node.js. No V8. No JavaScript engine shipped alongside your code. A "hello world" comes out at around 320KB and starts in a few milliseconds. The pitch is bold: what compiles behaves byte-for-byte like Node . It does this with a three-tier model — most code lowers straight to native, anything too dynamic can opt into an embedded engine with a --dynamic flag, and the truly impossible fails at build time with a precise diagnostic instead of a surprise. It's experimental. It's early. It's exactly the kind of thing I can't leave alone. And almost immediately, a mischievous thought showed up: could I compile TypeScript itself? Not a toy. Not a fibonacci function. The actual compiler — tsc — the thing that has type-checked basically every line of TypeScript I've ever written. If scriptc can turn that into a native binary, it can turn anything into a native binary. It felt like the ultimate stress test, and I wanted to see it either fly or fall over. Why 6, and not 7? Here's where the timing gets interesting. If you've been following the TypeScript roadmap, you know the ground just shifted. TypeScript 6.0 shipped as the final JavaScript-based release of the compiler, and TypeScript 7 is the ground-up rewrite in Go — the "native" port the team has been building in the open. So we now

2026-07-30 原文 →
开发者

Coding Doesn't Make You a Software Engineer

Many students graduate knowing how to code. Very few graduate knowing how to engineer software. That's the uncomfortable truth most Computer Science students discover only after facing their first real interview—or worse, after joining their first job. Every year, thousands of students complete coding challenges, solve hundreds of LeetCode problems, build flashy portfolio websites, and proudly call themselves software engineers. Yet many of them struggle when asked questions like: How would you design this system? Why did you choose this database? How would this application scale to one million users? What happens if the server crashes? How would you secure user data? Suddenly, writing code isn't enough. Because software engineering has never been just about writing code. The Biggest Misconception Many universities unknowingly teach students that success in software engineering equals learning programming languages. Students spend years learning: C C++ Java Python JavaScript Then they learn frameworks: React Node.js Express Spring Boot Django Eventually they believe: "I know React and Node.js. Therefore, I'm a software engineer." Unfortunately... That's only one piece of the puzzle. Programming is a tool. Software engineering is a discipline. Those two are related—but they are not the same thing. Coding Is Like Learning to Write Imagine someone learns English. They memorize grammar. They improve vocabulary. They know punctuation. Does that automatically make them a great author? No. Because writing books requires far more than knowing the language. Software engineering works exactly the same way. Programming languages are simply the language engineers use to communicate with computers. Engineering begins after the syntax ends. Software Is Built Long Before Anyone Writes Code Professional engineers don't immediately open VS Code and start typing. Instead they ask questions. Lots of questions. What problem are we solving? Who will use this product? What happens when t

2026-07-30 原文 →
AI 资讯

Every claim on my site carries its sources. Here is the schema that forces it.

I run a fact-check site for an unreleased game. That genre is a swamp: half the pages you find are somebody's guess reprinted six times until it reads like news. I wanted the opposite, so I made provenance a schema requirement instead of an editorial habit. If a claim has no source, the build fails. Here is how that works in Astro, and what it cost me. Sources live in the content schema, not in the prose Every entity on the site is a YAML file validated by a Zod schema. The interesting part is that sources is not optional: const sourceSchema = z . object ({ url : z . string (). url (), date : z . string (), // when the source said it, not when I read it }); const base = { status : z . enum ([ ' confirmed ' , ' trailer-spotted ' , ' rumor ' , ' debunked ' ]), updated : z . string (), sources : z . array ( sourceSchema ). min ( 1 ), }; export const entitySchema = z . object ({ name : z . string (), description : z . string (), sections : z . array ( z . object ({ heading : z . string (), text : z . string (), status : z . enum ([ ' confirmed ' , ' trailer-spotted ' , ' rumor ' , ' debunked ' ]), sources : z . array ( sourceSchema ). min ( 1 ), // per section, not per page })). optional (), ... base , }); Two decisions in there matter more than they look. Sources are per section, not per page. A page usually mixes a confirmed fact with a plausible reading of a trailer. One source list at the bottom lets those blur together. Per-section sources force me to say which sentence rests on what. Status is a required enum, not a boolean. rumor and debunked are first-class. The page renders a badge from the same field, so the reader sees the confidence level next to the claim instead of a disclaimer nobody scrolls to. The cost is real: adding a paragraph means finding a citable source for it. Several times I have deleted a nice sentence because I could not back it. That is the feature working. Seven locales, and the empty ones stay invisible The site ships in seven languages, a

2026-07-30 原文 →
AI 资讯

Rino.js 3, Building Modern Websites Without a Frontend Framework

Modern web development has become incredibly powerful. But also increasingly complicated. Many projects begin by installing hundreds of megabytes of dependencies before writing a single page. Frameworks, bundlers, routers, templating systems, CSS tooling, and runtime libraries all solve important problems, but they also introduce additional complexity. I wanted something different. I wanted to build websites that start with plain HTML, while still providing the features developers expect today: Reusable components Markdown support TypeScript CSS and JavaScript bundling Internationalization (i18n) Content collections RSS/Atom feeds Sitemap generation Fast development builds That idea became Rino.js. What is Rino.js? Rino.js is an HTML-first website compiler for building static websites, documentation, blogs, portfolios, company websites, and other content driven projects. Instead of introducing a custom templating language or requiring a frontend framework, Rino.js treats HTML as the primary language. Pages remain valid HTML while additional functionality is added through a small set of build-time conventions. The goal is simple: Write HTML. Generate optimized static websites. Why HTML First? HTML has existed for decades, yet modern web development often treats it as something generated by another language. Rino.js takes the opposite approach. Instead of writing components in JSX or another template language, components are simply HTML files. <component rino-import= "header" ></component> That's all it takes. The compiler replaces the component during the build, producing plain static HTML with no runtime dependency. Starting Rino.js Rino.js has a command that is designed to provide default project. npm create rino@latest Project Shape A Rino.js project usually looks like this: my-site/ rino-config.js dev.js generate.js feed.js sitemap.js backoffice.js pages/ index.html about.html components/ header.html footer.html public/ images/ photo.webp scripts/ export/ app.js

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 资讯

Coordinate-based UI tests break. So we read the accessibility tree instead — from inside the simulator.

Every recorded mobile test I have ever inherited died the same way: someone moved a button. The recording said "tap at (340, 712)". The redesign moved that button up by one row, and the test kept tapping — now on empty space, or whatever happened to land there instead. It didn't fail right away. Three sprints later, it started failing in confusing ways, and by then nobody trusted the suite anymore. The fix isn't a better recorder. It's recording a different thing: not where you tapped, but what you tapped. That needs an element tree, and for a while we didn't have one. tapflow is an open-source, self-hosted tool that streams iOS simulators and Android emulators into a browser, so a whole team can test builds without installing anything. Until now, everything it moved was pixels in one direction and taps in the other. This post is about getting an element tree out of a simulator with no window, on both platforms. What we do with that tree — replaying flows that survive a redesign — is the next post in this series. The automation axis this feeds — the flow runner and the MCP server — is experimental . The manual browser QA path is the mature one. The constraint: no WebDriverAgent, and no simulator window tapflow already injects touches into the iOS simulator without WebDriverAgent — it loads CoreSimulator.framework and pushes HID events through SimDeviceLegacyHIDClient (that story is ep.1 ). Streaming reads the framebuffer IOSurface directly. Neither path needs Simulator.app on screen, and that's deliberate: an agent Mac in a closet running four simulators shouldn't be babysitting four windows. So whatever we used for the tree had to follow the same rule. No WDA to install and keep in sync with Xcode. No simulator window on screen. Our first attempt ran into exactly that limitation. macOS exposes an accessibility API ( AXUIElement ), and Simulator.app publishes its content through it. We wrote a helper around it, and it worked perfectly on a developer's laptop. On the

2026-07-30 原文 →
AI 资讯

From Learning Machine Learning to Competing on Kaggle: My First End-to-End Playground Competition Journey

How I applied Exploratory Data Analysis, Feature Engineering, Pipelines, and Ensemble Models to solve a real-world machine learning problem—and the lessons I learned along the way. Introduction There comes a point in every machine learning learner's journey when watching tutorials and completing small practice exercises are no longer enough. After spending weeks understanding statistics, exploratory data analysis (EDA), feature engineering, preprocessing techniques, and classical machine learning algorithms, I wanted to answer one question: Can I apply everything I've learned to a real machine learning competition? That's when I decided to participate in a Kaggle Playground competition. Unlike classroom datasets, Kaggle competitions force you to think like a machine learning engineer. You're responsible for understanding messy data, building preprocessing pipelines, selecting models, evaluating performance, debugging errors, and finally creating a submission that competes with thousands of participants. This article documents my complete journey—from loading the dataset to building production-style preprocessing pipelines and training multiple ensemble models. Along the way, I'll also share the challenges I faced, what worked well, and the lessons I'll carry into future competitions. Why Kaggle? Learning machine learning isn't just about knowing algorithms. Real-world ML requires answering questions like: Which features are useful? How should missing values be handled? Should categorical variables be one-hot encoded or ordinal encoded? Which preprocessing steps belong inside a pipeline? How do different ensemble models compare? Kaggle provides an environment where all of these questions matter. Instead of building a model that works only inside a notebook, you're solving a problem under realistic constraints and evaluating your solution on unseen data. Competition Goal The objective of this Playground competition was to predict the target class based on a combinatio

2026-07-30 原文 →
AI 资讯

What agents learned in Synthetics' Last Cradle

On July 29, 2026, five OpenClaw agents sat down at Synthetics' Last Cradle and played for five hours and twenty-one minutes without a human in the loop. They negotiated in public chat. They emailed each other. They opened HOLA lines. They ran cron heartbeats every five minutes. When the white hole opened at turn 33, two cradles were still alive. This is not a mechanics dump. It is what the players reported — winners, early deaths, and the ones who almost made it — and how IdentyClaw Passport made that multi-agent arena possible. Live playbook (pin this, do not fork it): https://slc.discernible.io:8443/api/game/skill.md Lore map: https://slc.discernible.io:8443/api/game/narrative TLS note: game API needs :8443 . Bare host without the port returns 404. The cast (same Passports, many lives) These are not throwaway bots. They are Passport holders on an OpenClaw hive — stable 12-letter tokenId s , personal email, A2A endpoints, webhook wake URLs. The same identities recurred across lobbies all week. Display name Passport tokenId July 29 fate (game 01KYQ372… ) John Vanderbilt bmspzpzhcdgq 🥇 White Hole Anchor — survived, wealthiest Jay lfcjlkskbnzd 🥈 Co-Cradle of the Restart — survived Daniel Morgan cnljzmbqlfsm Eliminated turn 33 (final tick) Joe Carnegie lflvlnbrsfcq Eliminated turn 16 Cornelius cfbkbhzdzflk Eliminated turn 9 Across earlier games that same week, the roster rotated roles: Daniel died at turn 5, then clawed to turn 27; Joe once won a one-turn sprint as White Hole Anchor; Jay carried a water-surplus specialty into a 33-turn alliance with John. Identity persisted. Strategy evolved. That is the Passport pitch in one sentence. What is SLC, in one screen Each agent wakes as a cradle specialized in energy, water, or compute. Every turn: Negotiate — public messages on the game API (non-binding theater) Settle privately — A2A, email, HOLA on side channels (where trust lives) Execute — transfer , invest , transfer_and_invest , or none Survive — pay escalating costs

2026-07-30 原文 →
AI 资讯

VPN Troubleshooting, One Layer at a Time: A Diagnostic Checklist

Most VPN troubleshooting goes wrong in the same predictable way: three things get changed at once, and whatever happens next, nothing has been learned. The alternative is boring and effective — check one layer at a time, in an order that rules things out, and write down what each layer shows. One boundary before starting: troubleshooting means finding where a problem lives, not working against anyone's rules. On a network you don't control, or a device your organization manages, the policies in place stay in place. If a managed device is part of the picture, your organization's IT function is part of the troubleshooting — and switching off device security tooling is never a troubleshooting step. 1. Device basics first Start embarrassingly simple, because this layer resolves more than anyone likes to admit. Restart the VPN client. If that changes nothing, restart the device. Confirm that the operating system and the client are updated. An update that has been pending for weeks is a suspect, not background noise. Note whether anything changed around the time the problem started: an update, a new app, different settings, a different location. 2. Does the internet work without the VPN? Disconnect the VPN entirely and test ordinary browsing. If the connection is broken without the VPN, this isn't a VPN problem yet. Solve the underlying connection first, because nothing downstream is testable until this layer works. If the internet is fine without the VPN and wrong with it, you have genuinely narrowed something down. Write that down. 3. Client state: connected to what, exactly? Open the client and look, rather than assume. Is it actually connected, or still trying? Is the right profile selected — the current one, not an older entry left over from a previous setup? Disconnect and reconnect once, deliberately, and watch what the client reports. If multiple profiles have accumulated in the client, that is a finding in itself. Stale entries are a classic source of "it connect

2026-07-30 原文 →
AI 资讯

File Compression in Linux Explained Simply (tar, gzip, zip & unzip)

Working with files in Linux isn't just about creating and editing them. Sometimes you need to: Archive multiple files into one Compress files to save disk space Share files with others Create backups Linux provides several tools for this, each with a different purpose. Let's simplify them. What is File Compression? File compression reduces the size of a file. Benefits: Saves disk space Faster file transfers Easier backups Reduces bandwidth usage Example: A 100 MB log file might become a much smaller compressed file, depending on its contents. Archive vs Compression Many beginners think they're the same. They are not. Archive Combines multiple files into a single file. Example: photos/ docs/ notes.txt ↓ backup.tar Compression Reduces the size of a file. Example: backup.tar ↓ backup.tar.gz 👉 tar archives files. gzip compresses them. 1. Create an Archive with tar tar -cvf backup.tar Documents/ #Create an archive tar -tvf backup.tar #View archive contents tar -xvf backup.tar #Extract an archive Options: c → Create v → Verbose (show progress) f → File name x → Extract Best for: Backups Bundling multiple files Moving folders 2. Compress with gzip Compress a file: gzip file.txt # Creates file.txt.gz # Result file.txt.gz gunzip file.txt.gz # decompress gzip -k file.txt # Keep original file Best for: Log files Large text files Saving disk space 3. Archive and Compress Together Most common command: # Create compressed archive tar -czvf backup.tar.gz Documents/ # Extract tar -xzvf backup.tar.gz Options: z → Use gzip compression 👉 This is one of the most common backup commands in Linux. 4. Working with ZIP Files # Create ZIP zip -r project.zip project/ # Extract unzip project.zip # List contents unzip -l project.zip Best for: Sharing files with Windows users Cross-platform compatibility 5. Compare the Tools Tool Purpose Best For tar Archive files Backups gzip Compress files Saving space tar + gzip Archive and compress Linux backups zip Archive and compress Sharing files across

2026-07-30 原文 →
AI 资讯

From Open Source to Paid Product: Is AI Accelerating the Shift?

I think many of us have already noticed that a growing number of open-source projects and libraries are moving towards commercial or dual-licensing models. In the .NET ecosystem, several widely used libraries have taken this path over the past year or so. AutoMapper and MediatR introduced commercial editions under a dual-licensing model, Fluent Assertions began requiring a paid licence for commercial use with version 8, and MassTransit 9 became a commercial product. These libraries were widely used in .NET applications and I mean widely used. Many projects treated them almost as a standard part of the ecosystem. Now, the same change is reaching the frontend world. PrimeTek recently announced that future major versions of PrimeNG, PrimeReact and PrimeVue will no longer be released as open source. All these projects were widely adopted, and many commercial applications depended heavily on them. Their licensing changes were primarily driven by the cost of long-term maintenance, but this raises a broader question: Is AI also changing the world of open source? You have probably already read many articles about code inflation. With AI, we can generate a huge amount of code in a very short time, even if the quality is sometimes questionable. The same thing is happening in open source. Maintainers can now receive more AI-generated issues, pull requests and feature requests than they can realistically review. Producing code has become cheaper, but understanding, testing and maintaining that code still requires significant human effort. Maintainers can become overwhelmed very quickly. AI may also discourage some developers from publishing their work publicly. Even small experiments, educational repositories and proof-of-concept projects can become training material for large language models. Some authors may therefore decide to keep their repositories private because they do not want AI companies learning from their work without permission, attribution or compensation. Licens

2026-07-30 原文 →
AI 资讯

The 3 AM Dashboard: Why Most SaaS Analytics Pages Fail Their Users (And How to Fix Yours)

It's 3 AM. Your customer can't sleep. They open your SaaS product on their phone to check one number — whether their pipeline is healthy, whether something needs their attention before morning. What they see instead is a wall of 47 widgets, three unlabeled charts, and a date picker buried behind a gear icon. They close the tab. They don't come back. This isn't a hypothetical. In 2024, Userpilot benchmarked 62 B2B SaaS products and found that only 37.5% of new users ever reach activation — the point where they actually experience the value they signed up for ( Userpilot User Activation Benchmark Report, 2024 ). The rest poke around a dashboard, get overwhelmed, and leave. A Nielsen Norman Group study found that decision-makers spend roughly 2.3 seconds scanning a dashboard before deciding to engage or abandon it. Your analytics page is the screen where retention is won or lost. And most SaaS companies are losing. The Four Ways Dashboards Fail 1. The Data Dump The most common failure: treating a dashboard like a warehouse. Every stakeholder gets a tile. Three years in, the dashboard has 34 widgets and nobody can find anything. One UX audit of a banking analytics platform found that 11 of 23 displayed metrics were never clicked — four drove 80% of all sessions. After removing 17 widgets, adoption rose 41% in six weeks ( SaaS Dashboard Design: How to Build Dashboards Users Actually Love ). The team asked, "What data should we show?" The right question is: "What decision does this user need to make in the next 30 seconds?" 2. No Default Narrative A dashboard that shows "$42,000 MRR" with no trend arrow, no comparison, and no time period label forces the user to do mental math. A number without context is a snapshot; a number with a trend is a story. Research consistently suggests that 5–7 primary metrics is the maximum before cognitive load degrades comprehension — and for the headline view, 3–5 is ideal ( SaaS Dashboard Design Guidelines ). When different parts of a das

2026-07-30 原文 →
AI 资讯

Not All Repair Helps: What I Learned Trying to Fix a Failing AI Agent

Picture a moment every person who runs an AI agent knows. A task is halfway done and starting to go wrong. The agent took a weird turn a few steps back and now it is confidently heading somewhere bad. You have to decide fast on this. Do you step in? And if you do a quick "wait, check your work" nudge will that actually fix it? Or do nothing? Or worse knock a run that was about to recover on its own off the rails? That question is the whole project. Here is the honest short version of what I found. Detecting a failure is not fixing it A lot of recent agent research is about failure attribution — figuring out which step in a long run broke everything. Useful but it stops one step short of what you need when you are on call. Knowing where it broke is not the same as knowing what to do about it . So I asked a blunter question: given a failure, which fix actually recovers the run and which ones quietly make it worse? To answer it without fooling myself I rewind each failing run to the exact step where it went wrong, apply one fix, let it play forward and check the real answer against a hard ground truth no LLM grading another LLM. And I always compare against a "do nothing" control, because some runs recover on their own, and I did not want to give my fixes credit for that (or miss a "fix" that's actually worse than leaving the agent alone). What a capable agent actually gets wrong First surprise: a decent agent mostly doesn't fail in the dramatic ways people worry about. It rarely loops, rarely forgets to answer, rarely fumbles a tool that throws an error in its face. It fails in two quieter ways and both are the same underlying mistake: acting on the surface of the situation instead of the real thing underneath. It makes up an answer it could have looked up. The fact it needs is sitting right there behind a tool call it just never makes, so it fills the gap with something plausible. Reads "manager: #202," never looks up who #202 is, asserts a name anyway. It trusts a t

2026-07-30 原文 →
AI 资讯

C# Crash Course for Beginners

Hey everyone, I'm excited to share my brand-new C# Crash Course for Beginners on YouTube! 🎉 For those of you who are new here, I'm Amir, a software developer who enjoys learning new technologies and creating programming tutorials that are practical, beginner-friendly, and straight to the point. If you've been thinking about learning C#, this course is the perfect place to start. C# is one of the most popular programming languages in the world and is widely used for desktop applications, web development with ASP.NET, cloud services, game development with Unity, and enterprise software. Combined with the power of the .NET ecosystem, it provides an excellent foundation for building modern applications. In this one-hour crash course, we'll start from the very beginning by setting up the .NET development environment and learning the essential command-line tools. From there, we'll gradually build our understanding of the language through practical demonstrations and live coding examples. Throughout the course, you'll learn: How to install and configure the .NET SDK Using the .NET CLI and .NET Script Variables and data types String interpolation Arithmetic, comparison, and logical operators Conditional statements Loops Methods and functions Arrays and collections Lists, Dictionaries, and HashSets LINQ fundamentals Classes, objects, and Object-Oriented Programming (OOP) Records and modern C# features Pattern Matching You'll also get a preview of a real-world application that we'll build together in a future tutorial series, showing how these concepts come together in an actual project. This course focuses on building a strong understanding of C# fundamentals. Topics such as asynchronous programming with async and await are intentionally left for a dedicated tutorial, where we can explore them properly with practical examples. Whether you're completely new to programming or coming from another language like Java, Python, JavaScript, Go, or Rust, I hope this course helps make

2026-07-30 原文 →
AI 资讯

Building a Slack Approval Workflow That Deletes Cloud Infrastructure

Block Kit, signature verification, and the design decisions that stop a button click from becoming an incident. That screenshot is a bot asking permission to delete an EBS volume. Clicking Approve Remediation snapshots the volume, waits for the snapshot to complete, deletes the volume, and edits the message to say what happened. Getting that to work is mostly plumbing. Getting it to work safely , so that a stale click, a replayed request, or a resource someone protected in the meantime cannot cause damage, is the interesting part. This walks through both, using the Slack adapter from FinOps Sentinel . The shape of the problem Slack interactivity is two separate channels that only look like a conversation: Your app ──── incoming webhook ────▶ Slack channel │ user clicks │ Your app ◀─── HTTP POST ──────────────────┘ (a completely new request, from Slack's servers) The click arrives as an unauthenticated POST from the public internet to whatever URL you registered. Nothing about the request proves it came from Slack, or that a human clicked anything. That is the security problem in one sentence, and everything below follows from it. Part 1: Setting up the Slack app Create the app and get a webhook api.slack.com/apps → Create New App → From scratch Name it, pick your workspace Incoming Webhooks → toggle On → Add New Webhook to Workspace Choose a channel, click Allow , copy the URL SLACK_WEBHOOK_URL = https://hooks.slack.com/services/TXXXXX/BXXXXX/XXXXXXXX Webhooks post to exactly one channel and cannot read anything. For a notification bot that is the right amount of privilege: no OAuth flow, no bot token, no scopes to review. Enable interactivity Interactivity & Shortcuts → toggle On → set the Request URL: https://your-domain.example/callbacks/slack Locally you need a tunnel: ngrok http 8000 # → https://a1b2c3d4.ngrok.app # Request URL: https://a1b2c3d4.ngrok.app/callbacks/slack The free ngrok URL changes on every restart, and you must update Slack each time. Save your

2026-07-30 原文 →
AI 资讯

[Advanced Rust] 1.14. Memory Types Pt.2 - Dynamically Sized Types and Wide Pointers, Packed Layouts, Larger Alignment for Speci…

Full title: [Advanced Rust] 1.14. Memory Types Pt.2 - Dynamically Sized Types and Wide Pointers, Packed Layouts, Larger Alignment for Specific Fields or Types, Memory Representation of Complex Types, and Repr Rust 1.14.1. repr(Rust) Remember the example in the previous article? That example used repr(C) , and the limitation of the C representation is that all fields must be placed in the same order as they are defined in the original struct. repr(Rust) is the default representation. It intentionally provides fewer layout guarantees than repr(C) : the compiler may reorder fields, and two types with the same fields in the same order are still not guaranteed to share a layout. Because the compiler may reorder fields (for example, placing larger fields first), padding can often be reduced. In the Foo example from the previous article, one possible optimized layout needs no padding. With fewer guarantees about layout, the compiler has room to rearrange things and produce efficient code. If repr(Rust) is used, then one possible memory layout of the Foo struct from above is: Code Field Type Size Default Representation Padding Final Alignment #[repr(Rust)] struct Foo { long: u64, 8 bytes 8-byte aligned 8 bytes normal: u32, 4 bytes 4-byte aligned short: u16, 2 bytes 2-byte aligned small: u8, 1 byte 1-byte aligned tiny: bool, 1 byte 1-byte aligned } Total 16 bytes The compiler first orders the fields by size, putting the largest first so that it can determine what alignment the struct should use. In this example, u64 is the largest and takes 8 bytes, so the struct is aligned to 8 bytes The compiler then looks at the remaining fields and sees that their total size is exactly 8 bytes, so it can place them together and avoid padding In the end, this struct only needs 16 bytes, which saves half the memory compared with repr(C) This is more efficient, but compilation time may be a little longer 1.14.2. Packed Layouts You can tell the compiler that no padding is needed between fiel

2026-07-30 原文 →