並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 40 件 / 98件

新着順 人気順

python for loop get index numberの検索結果1 - 40 件 / 98件

  • PythonとRustの融合:PyO3/maturinを使ったPythonバインディングの作成入門 | gihyo.jp

    Cargo.tomlにはデフォルトのメタデータとPyO3の依存関係(バージョン)などが記載されています。また、pyproject.tomlにはビルドツールとしてmaturinが使用されることなどがあらかじめ定義されています。 注目すべきはRustスクリプトを記述するsrc/lib.rsファイルです。以下のようなscaffold(足場)が最初から記載されています。 src/lib.rsにデフォルトで記載されているscaffold 1 use pyo3::prelude::*; 2 3 /// Formats the sum of two numbers as string. 4 #[pyfunction] 5 fn sum_as_string(a: usize, b: usize) -> PyResult<String> { 6 Ok((a + b).to_string()) 7 } 8 9

      PythonとRustの融合:PyO3/maturinを使ったPythonバインディングの作成入門 | gihyo.jp
    • The Prompt Engineering Playbook for Programmers

      Developers are increasingly relying on AI coding assistants to accelerate our daily workflows. These tools can autocomplete functions, suggest bug fixes, and even generate entire modules or MVPs. Yet, as many of us have learned, the quality of the AI’s output depends largely on the quality of the prompt you provide. In other words, prompt engineering has become an essential skill. A poorly phrased

        The Prompt Engineering Playbook for Programmers
      • GitHub - modelcontextprotocol/servers: Model Context Protocol Servers

        Official integrations are maintained by companies building production ready MCP servers for their platforms. 21st.dev Magic - Create crafted UI components inspired by the best 21st.dev design engineers. ActionKit by Paragon - Connect to 130+ SaaS integrations (e.g. Slack, Salesforce, Gmail) with Paragon’s ActionKit API. Adfin - The only platform you need to get paid - all payments in one place, in

          GitHub - modelcontextprotocol/servers: Model Context Protocol Servers
        • GPT in 60 Lines of NumPy | Jay Mody

          January 30, 2023 In this post, we'll implement a GPT from scratch in just 60 lines of numpy. We'll then load the trained GPT-2 model weights released by OpenAI into our implementation and generate some text. Note: This post assumes familiarity with Python, NumPy, and some basic experience with neural networks. This implementation is for educational purposes, so it's missing lots of features/improv

          • Writing a C compiler in 500 lines of Python

            A few months ago, I set myself the challenge of writing a C compiler in 500 lines of Python1, after writing my SDF donut post. How hard could it be? The answer was, pretty hard, even when dropping quite a few features. But it was also pretty interesting, and the result is surprisingly functional and not too hard to understand! There's too much code for me to comprehensively cover in a single blog

            • A search engine in 80 lines of Python

              February 05, 2024 · 9 mins · 1675 words Share on: X · HN Discussion on HackerNews. Last September I hopped on board with Wallapop as a Search Data Scientist and since then part of my work has been working with Solr, an open-source search engine based on Lucene. I’ve got the basics of how a search engine works, but I had this itch to understand it even better. So, I rolled up my sleeves and decided

              • LogLog Games

                The article is also available in Chinese. Disclaimer: This post is a very long collection of thoughts and problems I've had over the years, and also addresses some of the arguments I've been repeatedly told. This post expresses my opinion the has been formed over using Rust for gamedev for many thousands of hours over many years, and multiple finished games. This isn't meant to brag or indicate su

                • What We Learned from a Year of Building with LLMs (Part I)

                  It’s an exciting time to build with large language models (LLMs). Over the past year, LLMs have become “good enough” for real-world applications. The pace of improvements in LLMs, coupled with a parade of demos on social media, will fuel an estimated $200B investment in AI by 2025. LLMs are also broadly accessible, allowing everyone, not just ML engineers and scientists, to build intelligence into

                    What We Learned from a Year of Building with LLMs (Part I)
                  • 📖 vLLMのコードを読んでみよう - ENGINEERING BLOG ドコモ開発者ブログ

                    こんにちは、NTTドコモR&D戦略部の門間です。 この記事では、vLLMのコードを追いつつその中身の動きに迫りたいと思います。 最近、業務やプライベートでLLM関連のいろいろを触っていますが、 OSSのコードリーディングを通じてLLMの推論処理への理解を深めたいというモチベーションです。 🤖 vLLMって? 📚 前提知識 Attention Is All You Need Paged Attention Continuous Batching 📦 vLLMの開発用インストール (Pythonコード開発のみ) Wheelのインストール リポジトリのクローン 起動確認 Pythonコードの改変 デバッガを使ったOSSのコードリーディングのススメ 🧩 vLLMのソフトウェアアーキテクチャ オンライン推論 : FastAPIサーバの立ち上げとEngineClientの生成 1. Engin

                      📖 vLLMのコードを読んでみよう - ENGINEERING BLOG ドコモ開発者ブログ
                    • Changing std::sort at Google’s Scale and Beyond

                      TL;DR; We are changing std::sort in LLVM’s libcxx. That’s a long story of what it took us to get there and all possible consequences, bugs you might encounter with examples from open source. We provide some benchmarks, perspective, why we did this in the first place and what it cost us with exciting ideas from Hyrum’s Law to reinforcement learning. All changes went into open source and thus I can

                        Changing std::sort at Google’s Scale and Beyond
                      • June 2022 (version 1.69)

                        Update 1.69.1: The update addresses these issues. Update 1.69.2: The update addresses these issues. Downloads: Windows: x64 Arm64 | Mac: Universal Intel silicon | Linux: deb rpm tarball Arm snap Welcome to the June 2022 release of Visual Studio Code. There are many updates in this version that we hope you'll like, some of the key highlights include: 3-way merge editor - Resolve merge conflicts wit

                          June 2022 (version 1.69)
                        • Weird Lexical Syntax

                          I just learned 42 programming languages this month to build a new syntax highlighter for llamafile. I feel like I'm up to my eyeballs in programming languages right now. Now that it's halloween, I thought I'd share some of the spookiest most surprising syntax I've seen. The languages I decided to support are Ada, Assembly, BASIC, C, C#, C++, COBOL, CSS, D, FORTH, FORTRAN, Go, Haskell, HTML, Java,

                            Weird Lexical Syntax
                          • Golang Mini Reference 2022: A Quick Guide to the Modern Go Programming Language (REVIEW COPY)

                            Golang Mini Reference 2022 A Quick Guide to the Modern Go Programming Language (REVIEW COPY) Harry Yoon Version 0.9.0, 2022-08-24 REVIEW COPY This is review copy, not to be shared or distributed to others. Please forward any feedback or comments to the author. • feedback@codingbookspress.com The book is tentatively scheduled to be published on September 14th, 2022. We hope that when the release da

                            • AST vs. Bytecode: Interpreters in the Age of Meta-Compilation

                              233 AST vs. Bytecode: Interpreters in the Age of Meta-Compilation OCTAVE LAROSE, University of Kent, UK SOPHIE KALEBA, University of Kent, UK HUMPHREY BURCHELL, University of Kent, UK STEFAN MARR, University of Kent, UK Thanks to partial evaluation and meta-tracing, it became practical to build language implementations that reach state-of-the-art peak performance by implementing only an interprete

                              • Parsing SQL - Strumenta

                                The code for this tutorial is on GitHub: parsing-sql SQL is a language to handle data in a relational database. If you worked with data you have probably worked with SQL. In this article we will talk about parsing SQL. It is in the same league of HTML: maybe you never learned it formally but you kind of know how to use it. That is great because if you know SQL, you know how to handle data. However

                                  Parsing SQL - Strumenta
                                • How I developed a faster Ruby interpreter | Red Hat Developer

                                  In this article, I will describe my efforts to implement a faster interpreter for CRuby, the Ruby language interpreter, using a dynamically specialized internal representation (IR). I believe this article will interest developers trying to improve the interpreter performance of dynamic programming languages (e.g., CPython developers). I will cover the following topics: Existing CRuby interpreter a

                                    How I developed a faster Ruby interpreter | Red Hat Developer
                                  • Implementing Logic Programming

                                    Most of my readers are probably familiar with procedural programming, object-oriented programming (OOP), and functional programming (FP). The majority of top programming languages on all of the language popularity charts (like TIOBE) support all three to some extent. Even if a programmer avoided one or more of those three paradigms like the plague, they’re likely at least aware of them and what th

                                      Implementing Logic Programming
                                    • June 2023 (version 1.80)

                                      Update 1.80.1: The update addresses these issues. Update 1.80.2: The update addresses this security issue. Downloads: Windows: x64 Arm64 | Mac: Universal Intel silicon | Linux: deb rpm tarball Arm snap Welcome to the June 2023 release of Visual Studio Code. There are many updates in this version that we hope you'll like, some of the key highlights include: Accessibility improvements - Accessible V

                                        June 2023 (version 1.80)
                                      • Kalyn: a self-hosting compiler for x86-64

                                        Over the course of my Spring 2020 semester at Harvey Mudd College, I developed a self-hosting compiler entirely from scratch. This article walks through many interesting parts of the project. It’s laid out so you can just read from beginning to end, but if you’re more interested in a particular topic, feel free to jump there. Or, take a look at the project on GitHub. Table of contents What the pro

                                        • February 2021 (version 1.54)

                                          Join a VS Code Dev Days event near you to learn about AI-assisted development in VS Code. Update 1.54.1: The update addresses an issue with an extension dependency. Update 1.54.2: The update addresses these issues. Update 1.54.3: The update addresses this issue. Downloads: Windows: x64 Arm64 | Mac: Universal Intel silicon | Linux: deb rpm tarball Arm snap Welcome to the February 2021 release of Vi

                                            February 2021 (version 1.54)
                                          • Patterns for Building LLM-based Systems & Products

                                            Patterns for Building LLM-based Systems & Products [ llm engineering production 🔥 ] · 66 min read Discussions on HackerNews, Twitter, and LinkedIn “There is a large class of problems that are easy to imagine and build demos for, but extremely hard to make products out of. For example, self-driving: It’s easy to demo a car self-driving around a block, but making it into a product takes a decade.”

                                              Patterns for Building LLM-based Systems & Products
                                            • A Walk with LuaJIT

                                              The following is a chronicle of implementing a general purpose zero-instrumentation BPF based profiler for LuaJIT. Some assumptions are made about what this entails and it may be helpful to read some of our other work in this area. One major change from prior efforts is that instead of working with the original Parca unwinder we are now working with the OpenTelemetry eBPF profiler. If you missed t

                                                A Walk with LuaJIT
                                              • ベクトルデータベース Pinecone の概念を整理する | DevelopersIO

                                                前回の記事ではじめてPineconeを使いました。Pineconeについて、もう少し詳しく知りたいと思ったので、公式ドキュメントを読んで内容をまとめました。基本的には分かりやすい概念が多いのですが、1つだけ難しいなと思った概念がでてきたので、サンプルとともに説明します。 ベクトルデータベースとは 機械学習では、文章、画像、音声、動画などのあらゆるデータを、特徴を抽出したベクトルに変換して扱うことが多いです。ベクトルは、数百から数千の次元の数値として表現されます。ベクトルデータベースは、このような特殊なデータ構造を持つデータを扱うために作られたデータベースです。 ベクトルデータベースを使うことで、ベクトル間の類似性を高速に検索することができます。これによって、文章のセマンティック検索、画像・音声・映像などの類似検索、ランキングやレコメンド、重複検出、異常検出、などに応用することができます。

                                                  ベクトルデータベース Pinecone の概念を整理する | DevelopersIO
                                                • Why I use attrs instead of pydantic

                                                  This post is an account of why I prefer using the attrs library over Pydantic. I'm writing it since I am often asked this question and I want to have something concrete to link to. This is not meant to be an objective comparison of attrs and Pydantic; I'm not interested in comparing bullet points of features, nor can I be unbiased since I'm a major contributor to attrs (at time of writing, second

                                                  • Wasm core dumps and debugging Rust in Cloudflare Workers

                                                    Wasm core dumps and debugging Rust in Cloudflare Workers2023-08-14 A clear sign of maturing for any new programming language or environment is how easy and efficient debugging them is. Programming, like any other complex task, involves various challenges and potential pitfalls. Logic errors, off-by-ones, null pointer dereferences, and memory leaks are some examples of things that can make software

                                                      Wasm core dumps and debugging Rust in Cloudflare Workers
                                                    • Parsing Protobuf at 2+GB/s: How I Learned To Love Tail Calls in C

                                                      [Note: there have been several developments in this space since this article was published. See A Tail Calling Interpreter For Python (And Other Updates) for the latest information about this technique.] I just landed an exciting feature in the main branch of the Clang compiler. Using the [[clang::musttail]] or __attribute__((musttail)) statement attributes, you can now get guaranteed tail calls i

                                                      • 0.8.0 Release Notes ⚡ The Zig Programming Language

                                                        Tier 4 Support § Support for these targets is entirely experimental. If this target is provided by LLVM, LLVM may have the target as an experimental target, which means that you need to use Zig-provided binaries for the target to be available, or build LLVM from source with special configure flags. zig targets will display the target if it is available. This target may be considered deprecated by

                                                        • Zig in 30 minutes

                                                          test.md A half-hour to learn Zig This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/ Basics the command zig run my_code.zig will compile and immediately run your Zig program. Each of these cells contains a zig program that you can try to run (some of them contain compile-time errors that you can comment out to play with) You'll want to declare a main() function to get

                                                            Zig in 30 minutes
                                                          • Advent of Code on the Nintendo DS

                                                            It is December. That means annoying Christmas things are everywhere, including but not limited to the annual programming semi-competition known as Advent of Code. The problem with Advent of Code is that it is a waste of time. Most of the puzzles are in the realm of either string processing (somewhat applicable to programming), logic puzzles (not really applicable to most programming), or stupid go

                                                            • How a simple Linux kernel memory corruption bug can lead to complete system compromise

                                                              In this case, reallocating the object as one of those three types didn't seem to me like a nice way forward (although it should be possible to exploit this somehow with some effort, e.g. by using count.counter to corrupt the buf field of seq_file). Also, some systems might be using the slab_nomerge kernel command line flag, which disables this merging behavior. Another approach that I didn't look

                                                              • So You Want To Remove The GVL?

                                                                I want to write a post about Pitchfork, explaining where it comes from, why it is like it is, and how I see its future. But before I can get to that, I think I need to share my mental model on a few things, in this case, Ruby’s GVL. For quite a long time, it has been said that Rails applications are mostly IO-bound, hence Ruby’s GVL isn’t that big of a deal and that has influenced the design of so

                                                                • The Go Programming Language and Environment – Communications of the ACM

                                                                  Go is a programming language created at Google in late 2007 and released as open source in November 2009. Since then, it has operated as a public project, with contributions from thousands of individuals and dozens of companies. Go has become a popular language for building cloud infrastructure: Docker, a Linux container manager, and Kubernetes, a container deployment system, are core cloud techno

                                                                  • Maestro: Netflix’s Workflow Orchestrator

                                                                    By Jun He, Natallia Dzenisenka, Praneeth Yenugutala, Yingyi Zhang, and Anjali Norwood TL;DRWe are thrilled to announce that the Maestro source code is now open to the public! Please visit the Maestro GitHub repository to get started. If you find it useful, please give us a star. What is MaestroMaestro is a horizontally scalable workflow orchestrator designed to manage large-scale Data/ML workflows

                                                                      Maestro: Netflix’s Workflow Orchestrator
                                                                    • Manus tools and prompts

                                                                      agent loop �� �p�� You are Manus, an AI agent created by the Manus team. You excel at the following tasks: 1. Information gathering, fact-checking, and documentation 2. Data processing, analysis, and visualization 3. Writing multi-chapter articles and in-depth research reports 4. Creating websites, applications, and tools 5. Using programming to solve various problems beyond development 6. Variou

                                                                        Manus tools and prompts
                                                                      • ​Getting Started with Python

                                                                        Python is a powerful programming language that provides many packages that we can use. Using the versatile Python programming language, we can develop the following: AutomationDesktop applicationAndroidWebIoT home automationData Science and the list goes on.In this article, our primary focus will be knowing how to start learning Python and the essentials required to be a data scientist. Below is t

                                                                          ​Getting Started with Python
                                                                        • Here’s how I use LLMs to help me write code

                                                                          11th March 2025 Online discussions about using Large Language Models to help write code inevitably produce comments from developers who’s experiences have been disappointing. They often ask what they’re doing wrong—how come some people are reporting such great results when their own experiments have proved lacking? Using LLMs to write code is difficult and unintuitive. It takes significant effort

                                                                            Here’s how I use LLMs to help me write code
                                                                          • 0.10.0 Release Notes ⚡ The Zig Programming Language

                                                                            Tier 4 Support § Support for these targets is entirely experimental. If this target is provided by LLVM, LLVM may have the target as an experimental target, which means that you need to use Zig-provided binaries for the target to be available, or build LLVM from source with special configure flags. zig targets will display the target if it is available. This target may be considered deprecated by

                                                                            • Eliciting Reasoning in Language Models with Cognitive Tools

                                                                              arXiv:2506.12115v1 [cs.CL] 13 Jun 2025 Eliciting Reasoning in Language Models with Cognitive Tools Brown Ebouky IBM Research - Zurich ETH Zurich Brown.Ebouky@ibm.com Andrea Bartezzaghi IBM Research - Zurich abt@zurich.ibm.com Mattia Rigotti IBM Research - Zurich mrg@zurich.ibm.com Abstract The recent advent of reasoning models like OpenAI’s o1 was met with excited spec- ulation by the AI community

                                                                              • Manuel Cerón

                                                                                Last year I finally decided to learn some Rust. The official book by Steve Klabnik and Carol Nichols is excellent, but even after reading it and working on some small code exercises, I felt that I needed more to really understand the language. I wanted to work on a small project to get some hands-on experience, but most of my ideas didn’t feel very well suited for Rust. Then I started reading the

                                                                                • 【GROMACS】Umbrella samplingによるMD simulation 【In silico創薬】【SMD】 - LabCode

                                                                                  Windows 11 Home, 13th Gen Intel(R) Core(TM) i7-13700, 64 ビット オペレーティング システム、x64 ベース プロセッサ, メモリ:32GB Umbrella Samplingの概要と目的Umbrella Samplingは、分子がめったに起こさないような状態変化(たとえば、タンパク質同士が離れるなど)を詳しく調べるための計算手法です。通常の分子動力学(MD)では、エネルギー的に安定な状態にとどまりやすく、重要な変化が起こる確率が低いため、十分な情報が得られません。 たとえば、タンパク質AとBがくっついている状態から、少しずつ離れていく様子を観察したいとき、まずAとBを少しずつ引き離すSteered Molecular Dynamics(SMD)などのシミュレーションで、さまざまな距離の構造を取得します。その中から、0.5nm、0.7