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

标签:#file

找到 9 篇相关文章

AI 资讯

File System Management in Dart

It's a good time to also investigate a bit the dart I/O interfaces, especially the one related to files. The dart:io package must be imported to deal with files and directories in Dart. import 'dart:io' ; A file in Dart is an object instantiated by the File class . This object can be created by simply invoking the default constructor , where its argument will be a String . // default constructor can be used // to create a new object pointing to // a local file. File myFile = File ( "./file1.test" ); fromRawPath() is another constructor, it opens a file based on an List<Uint8> ( Uint8List ), this kind of data is usually generated by utf8.encode or ascii.encode . // fromRawPath constructor can be used // to open a file based on a raw path, // an Uint8list. File myFile2 = File . fromRawPath ( ascii . encode ( "./file2.test" ); ); Finally, the fromUri() constructor will open a file based on an Uri object. // fromUri is another construct that // can be used to open a file based on // an Uri. File myFile3 = File . fromUri ( Uri . file ( "./file3.test" ) ); Now the file object has been created, many attributes and methods are available to control it. Let check first the attributes. In the previous examples, all objects are using a relative path, when the object is returned, the absolute path attribute is set. It is the absolute path representation of the data previously passed. print ( myFile1 . absolute ); print ( myFile2 . absolute ); print ( myFile3 . absolute ); $ dart run File: '/home/user/tmp/cboring/./file1.test' File: '/home/user/tmp/cboring/./file2.test' File: '/home/user/tmp/cboring/file3.test' The original path passed as first argument can be retrieved with the path attribute . print ( myFile1 . path ); print ( myFile2 . path ); print ( myFile3 . path ); $ dart run ./file1.test ./file2.test file3.test The file object can also returns an Uri object with the help of the uri attribute . // this is a closure helper to show // the properties from an Uri object and //

2026-09-01 原文 →
AI 资讯

Bundler Quiz!

(Translated from the Japanese article .) This is a quiz about Ruby's Bundler! Add 8 characters to the following Gemfile so that bundle install fails (with non-zero exit code) for the second time or later. source "https://rubygems.org" gemspec Notes: Bundler is a fairly recent version (approximately version 3 or later). The first invocation succeeds. If you find the answer (on your own), please send me a direct message on ruby.social or email, etc.! Wrong Answers An invalid URL like https://rubygems.org12345678 : It doesn't fail since Bundler doesn't refer to the URL. An invalid URL and gems: It fails on the first run. It must fail only on the second or later runs. License Copyright (C) 2026 gemmaro Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty.

2026-07-26 原文 →
AI 资讯

Showcasing Your GitHub Profile: A Guide to Effective Presentation

Showcasing Your GitHub Profile: A Guide to Effective Presentation In the world of software development, GitHub profiles serve as a modern-day portfolio, showcasing a developer's skills, projects, and contributions. Whether you are a seasoned developer or just starting out, presenting your GitHub profile effectively can make a significant difference in your professional journey. In this article, we will explore the essential elements of a compelling GitHub profile and provide tips to make your profile stand out in the crowded digital landscape. Understanding the Importance of Your GitHub Profile GitHub is more than just a repository hosting service; it is a platform where developers can collaborate, share their work, and build a professional network. Your GitHub profile is often the first impression a potential employer or collaborator will have of your technical capabilities. A well-crafted profile not only highlights your technical prowess but also your ability to communicate and work within a team. Key Elements of a Compelling GitHub Profile 1. Profile Picture and Bio First impressions matter, even in the digital world. Your profile picture should be professional and clear, giving a face to the name behind the code. Accompanying your picture should be a concise bio that succinctly describes who you are, your interests, and your areas of expertise. This personal touch can make your profile more relatable and memorable. 2. Featured Projects Highlighting a few key projects on your GitHub profile can effectively demonstrate your skills and interests. Choose projects that not only showcase your technical abilities but also reflect your passion and creativity. Provide a clear description of each project, the technologies used, and your specific contributions. This level of detail can help potential employers understand the depth of your knowledge and experience. 3. Consistent Activity An active GitHub profile signals to others that you are engaged in the development com

2026-07-09 原文 →
AI 资讯

The Markdown File That Beat a $50M Vector Database: Separating Storage and Search in Agent Memory

In the rush to build AI agents, we defaulted to complex vector databases. But high-traffic platforms are converging on a simpler, more robust foundation: plain files. Most long-term agent memory setups are massively over-engineered. When developers start building LLM applications, the default prescription is almost always: "Spin up a managed vector database and build a RAG pipeline." But if you look at the highest-traffic production agent platforms (like Claude Code, Manus, and OpenClaw), a quieter trend has emerged. They are bypassing the enterprise embeddings store and using plain markdown files as their primary memory substrate. This is not a regression to simplicity. Done well, it is a stronger engineering foundation because files are inspectable, diffable, portable, and git-native. But a folder of plain text notes with no structure is just a slow, poorly indexing database. To make a file-first architecture work at scale, you must follow a fundamental system design principle: separate storage from search . The Core Invariant: Storage vs. Search The single highest-leverage decision you can make in agent memory design is treating your storage layer and search indexes as completely separate systems. Storage (Canonical Source of Truth): Versioned, human-readable files (Markdown + YAML frontmatter). Search (Derived Index): Derived search structures (vector databases, full-text BM25 indexes, entity graphs, keyword indexes). In this architecture, every search index is treated as a disposable artifact. You can delete your vector embeddings database or rebuild your entity graph at any time, with zero loss of underlying memory. This buys you three advantages: Auditability for free: By storing memories in text files, you can version-control them using Git. Every memory update, supersession, or correction is diffable, attributable, and reversible without any custom database versioning logic. Algorithmic freedom: Swap your embedding models, adjust your chunking strategies, o

2026-07-02 原文 →
AI 资讯

Security Profiles Operator hits v1 with stable APIs and a hardening pass

After several years carrying a beta tag, the Kubernetes Security Profiles Operator went 1.0.0 on June 26, freezing eight CRD APIs and clearing a third-party security audit with no criticals. For cluster admins, the practical effect is small but consequential: the syscall and LSM profile a workload runs under is now declared on APIs that will not move under your feet. The release was announced by Sascha Grunert of Red Hat on the CNCF blog. SPO is the Kubernetes operator that manages seccomp, SELinux and AppArmor profiles as cluster-scoped objects, then attaches them to pods. Until now the value proposition was good and the API was provisional. v1.0.0 nails the second half down. What's actually stable All eight CRDs graduated to v1, including SeccompProfile , ProfileRecording , SelinuxProfile , RawSelinuxProfile , and the AppArmor profile type. Conversion webhooks ship with the release, so a cluster running earlier API versions can roll forward without scheduling downtime. The older versions remain available and are slated for removal in a future release. The migration is on the clock, not on fire. The audit pass came with some shape changes that are worth reading before you upgrade. SelinuxProfile swapped its boolean permissive field for a mode enum with Enforcing and Permissive values, which means any GitOps templates that hard-coded permissive: true need a rewrite. RawSelinuxProfile is now gated by an enableRawSelinuxProfiles configuration flag and a validating admission webhook, so the most privileged path through the operator is off by default. AppArmor inputs run through strict regex validation, raw policy payloads are capped at 500 KB, and the eBPF profile recorder picked up explicit resource limits. Why a cluster team should care The point of an operator like this is to take the profile out of the host's filesystem and into the API. That changes the blast radius of "we shipped a container with no profile at all." With SPO and a workload-attached profile, the r

2026-06-27 原文 →
开发者

Memory Profiling: Valgrind & Heaptrack trên WSL2 vs Native Linux

Là một developer thường xuyên đối mặt với các lỗi memory leak trong hệ thống C++/Rust, việc chọn môi trường profiling là yếu tố sống còn. Nếu bạn đang cân nhắc giữa việc chạy Valgrind hay Heaptrack trên WSL2 so với Native Linux (hoặc máy trạm có RAM SO-DIMM nâng cấp được), đây là những trải nghiệm thực tế từ quá trình debugging. Hiệu năng Valgrind và Heaptrack: Sự khác biệt rõ rệt Khi sử dụng valgrind --tool=memcheck , tốc độ thực thi thường giảm xuống còn 10-50 lần so với bình thường. Trên Native Linux , việc quản lý bộ nhớ diễn ra trực tiếp trên kernel, giúp các công cụ này hoạt động ổn định nhất. Ngược lại, trên WSL2 , do lớp ảo hóa và cơ chế quản lý memory của Microsoft, bạn sẽ thấy overhead đáng kể hơn. Đặc biệt là khi tạo Heaptrack flame graph , việc phân tích bộ nhớ lớn có thể khiến WSL2 bị giới hạn bởi file .wslconfig nếu không cấu hình đủ RAM.\n Lệnh thực thi nhanh: # Chạy Valgrind trên hệ thống của bạn valgrind --leak-check = full --show-leak-kinds = all ./your_app # Sử dụng Heaptrack để lấy flame graph chi tiết hơn heaptrack ./your_app WSL2 Overhead và bài toán phần cứng (Onboard vs SO-DIMM) Một vấn đề thực tế là khi profiling các ứng dụng nặng, bộ nhớ hệ thống bị chiếm dụng cực nhanh. Nếu bạn đang dùng laptop với RAM onboard 16GB , việc chạy đồng thời Docker + IDE + Valgrind trên WSL2 dễ dàng dẫn đến tình trạng swap liên tục do giới hạn cứng của phần cứng. Từ kinh nghiệm thực tế, nếu công việc yêu cầu profiling chuyên sâu thường xuyên, một chiếc máy có RAM SO-DIMM cho phép nâng cấp lên 32GB hoặc 64GB sẽ là cứu cánh tuyệt vời. Bạn có thể tham khảo thêm về sự khác biệt giữa ReviewLaptop để hiểu rõ tại sao việc chọn đúng loại RAM lại quan trọng cho workflow của một developer. Bảng so sánh nhanh: | Đặc điểm | Native Linux | WSL2 (Ubuntu) | --- | --- | --- | | Speed Overhead | Thấp hơn (Direct Kernel) | Memory Management | Trực tiếp, ổn định | Có lớp ảo hóa, dễ bị giới hạn bởi .wslconfig | | Flame Graph Rendering | Mượt mà | Đôi khi chậm do I/O file qua hệ th

2026-06-19 原文 →
AI 资讯

The complete guide to claude code configuration file

What Is a Claude Code Configuration File? A Claude Code configuration file is a structured file — either CLAUDE.md (a Markdown document) or settings.json (a JSON schema file) — that controls how the Claude Code AI coding assistant behaves within a project or organization. These files define the agent's permissions, memory context, tool access, allowed shell commands, and behavioral guardrails. Without them, Claude Code operates with broad defaults that may not align with your security posture or project conventions. Claude Code reads configuration from multiple locations in a defined hierarchy: a global user-level ~/.claude/settings.json , a project-level .claude/settings.json at the repo root, and one or more CLAUDE.md files that can be nested in subdirectories. The agent merges these at startup, with project-level settings taking precedence over global ones. Understanding that hierarchy isn't optional — it's the foundation of any serious deployment. Why Claude Code Configuration Files Matter in 2026 Claude Code has moved from a tool used by individual engineers to something teams are deploying org-wide, running in CI/CD pipelines, and integrating with production infrastructure. That shift changes the risk profile completely. A misconfigured agent with shell access and no guardrails isn't a productivity tool anymore — it's a liability. Anthropic's own documentation on Claude Code security acknowledges that the agent can execute terminal commands, read and write files, and make network requests. By default, many of these capabilities require per-operation approval, but configuration files can silently expand those permissions across an entire organization if applied at the global or enterprise policy layer. The CISA and NSA joint guidance on AI-assisted development tools (published in late 2024) specifically flagged AI coding assistants as a new attack surface for supply chain compromise — the concern being that an agent with write access to source files and no beha

2026-06-10 原文 →