並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 40 件 / 171件

新着順 人気順

python if break for loopの検索結果1 - 40 件 / 171件

  • Minimal safe Bash script template

    Published on December 14, 2020   ·   Updated on December 16, 2020 Bash scripts. Almost anyone needs to write one sooner or later. Almost no one says “yeah, I love writing them”. And that’s why almost everyone is putting low attention while writing them. I won’t try to make you a Bash expert (since I’m not a one either), but I will show you a minimal template that will make your scripts safer. You

      Minimal safe Bash script template
    • MCPでLLMに行動させる - Terraformを例とした tfmcp の紹介 - じゃあ、おうちで学べる

      はじめに こんにちは!今回は、私が最近開発した tfmcp というツールを紹介します。これは Terraform を LLM(大規模言語モデル)から操作できるようにするツールで、Model Context Protocol (MCP) を活用しています。 github.com このブログが良ければ読者になったり、GitHub リポジトリにStarをいただけると開発の励みになります。nwiizoをフォロワーしてくれるのもありがたいです。より良いツール開発のためのフィードバックもお待ちしています! MCP とは何か? 記事を始める前に、まず MCP (Model Context Protocol) について簡単に説明しましょう。MCP についてより詳しい情報は、公式ドキュメント modelcontextprotocol.io や Anthropic の Model Context Protoc

        MCPでLLMに行動させる - Terraformを例とした tfmcp の紹介 - じゃあ、おうちで学べる
      • CPUエミュレータをRustで自作する - Don't Repeat Yourself

        この記事は Rust Advent Calendar 2020 ならびに CyberAgent Developers Advent Calendar 25日目の記事です。 今年のはじめの頃になりますが、『CPUの創り方』という本に載っている TD4 という CPU を実装してみました。TD4 は「とりあえず動作するだけの4bit CPU」の略です。この本に載っている CPU エミュレータを実際に実装してみました。ただし、本書には GUI が載っていましたが、それは省略しました。 CPUの創りかた 作者:渡波 郁発売日: 2003/10/01メディア: 単行本(ソフトカバー) 「最近話題の RISC-V などの CPU エミュレータを作ってみたいものの、いきなり作るにはハードルが高い。何か簡単なもので素振りをして CPU の動作の仕組みをまずは知りたい」という方にはかなりオススメできる教材だ

          CPUエミュレータをRustで自作する - Don't Repeat Yourself
        • プロと読み解く Ruby 3.0 NEWS - クックパッド開発者ブログ

          技術部の笹田(ko1)と遠藤(mame)です。クックパッドで Ruby (MRI: Matz Ruby Implementation、いわゆる ruby コマンド) の開発をしています。お金をもらって Ruby を開発しているのでプロの Ruby コミッタです。 本日 12/25 に、ついに Ruby 3.0.0 がリリースされました。一昨年、昨年に続き、今年も Ruby 3.0 の NEWS.md ファイルの解説をします。NEWS ファイルとは何か、は一昨年の記事を見てください(なお Ruby 3.0.0 から、NEWS.md にファイル名を変えました)。 プロと読み解く Ruby 2.6 NEWS ファイル - クックパッド開発者ブログ プロと読み解くRuby 2.7 NEWS - クックパッド開発者ブログ Ruby 3.0 は、Ruby にとってほぼ 8 年ぶりのメジャーバージョンア

            プロと読み解く Ruby 3.0 NEWS - クックパッド開発者ブログ
          • N番目の素数を求める - すぎゃーんメモ

            SNSなどで話題になっていたので調べてみたら勉強になったのでメモ。 環境 Pythonでの実装例 例1 例2 例3 エラトステネスの篩 Rustでの実装例 試し割り法 エラトステネスの篩 アトキンの篩 おまけ: GMP Benchmark 高速化のテクニック 上限個数を見積もる Wheel factorization オチ Repository References 環境 手元のMacBook Pro 13-inchの開発機で実験した。 2.8 GHz Intel Core i7 16 GB 2133 MHz LPDDR3 Pythonでの実装例 例1 最も単純に「2以上p未満のすべての数で割ってみて余りが0にならなかったら素数」とする、brute force 的なアプローチ。 import cProfile import io import pstats import sys def m

              N番目の素数を求める - すぎゃーんメモ
            • とほほのRust入門 - とほほのWWW入門

              Rustとは インストール Hello world Cargoプロジェクト キーワード コメント(//) 値 変数・定数(let, mut, const) 型 基本の型(bool, i16, char, str...) 型変換(as) 構造体(struct) 共用体(union) 列挙型(enum) タプル(tup) 配列(array) ベクタ(vec) ハッシュマップ(HashMap) 文字列(&str, String) 演算子(+ - ...) ヒープ領域(Box) スライス(&var[n..m]) 関数(fn) クロージャー(|...|{...}) マクロ(macro_rules!) 制御構文 条件分岐(if) 繰り返し(while) 繰り返し(for) ループ(loop) ループ制御(break, continue) マッチ(match) インプリメンテーション(impl) トレイ

              • 防衛省サイバーコンテスト 2025 writeup - st98 の日記帳 - コピー

                2/2に12時間というちょうどよい競技時間で開催された。21時終了だったけれども、11時45分ぐらいに最速で全完して1位🎉 第1回以来4年ぶりの優勝だ。昨年大会の第4回ではヒントの閲覧数で優勝を逃してしまって悔しい思いをしたので、雪辱を果たすことができ嬉しい。開始直後からずっと1位を独走できており、450名以上のプレイヤーがいる中で圧勝だったのも嬉しい。 昨年度や一昨年度はバルクが作問を担当していたが、今回はAGESTが担当していた。これまでの問題と比較すると全体的に易化したように思うが、解くにあたって発想の大きな飛躍を必要とするいわゆる「エスパー要素」のある問題はごく一部を除いて存在しておらず*1、よかったと思う。また、昨年度・一昨年度に引き続きwriteupは公開可能というのもよかった。 戦略というほどの戦略は立てていなかったけれども、とりあえずWebを見た後は全カテゴリを上から見て

                  防衛省サイバーコンテスト 2025 writeup - st98 の日記帳 - コピー
                • Microsoft Power Automate DesktopでRPAを実現してみる | 🌴 officeの杜 🥥

                  自分自身の個人的意見としては、エンドユーザコンピューティングは大いに結構だと思ってるけれど、一方で日本でジリジリと熱さが消えつつある国内の有象無象のRPAについては滅んだほうが良いとも思ってる。理由は後述するとして、本日良いニュースが発表されました。Power Automate Desktopについて追加費用無し無償で利用可能になるとのこと。これは既にあるMicrosoft365のEnterpriseプランなどに標準で利用できてるPower Automateのデスクトップ版のようで、Windows10に標準でついてくるようになるとのこと。 ということで、現時点のMicrosoft365で使えてるPower Automate Desktopを使ってみて、どんな感じなのか?またリリース後にその違いなどをここに記述していこうかなと思っています。また、Seleniumベースのウェブ自動化についても

                    Microsoft Power Automate DesktopでRPAを実現してみる | 🌴 officeの杜 🥥
                  • Python multiprocessing vs threading vs asyncio - JX通信社エンジニアブログ

                    エンジニアの鈴木(泰)です。 今回は、multiprocessingとthreadingとasyncioの違いとはなんだろう?という問に挑戦してみたいと思います。 この問の答えをグーグル先生に聞いてみると、非常にたくさんの情報がヒットします。しかしながら、どの情報も断片的なものばかりで(本記事もそうなのかもしれません)、色々と本を読んだりネットを漁ったりして、情報を補完しなければなりませんでした。 本記事は、僕が調べた限りの情報を集約し、この問に対する結論を1つの記事にまとめたものとなっています。 前提 マルチプロセスとは マルチスレッドとは Pythonにおけるマルチスレッド 本題 マルチプロセス(multiprocessingライブラリ)を利用したほうが良い場合 cpu_sec.py cpu_multiprocessing.py cpu_threading.py cpu_asyncio

                      Python multiprocessing vs threading vs asyncio - JX通信社エンジニアブログ
                    • 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
                      • Building LLM applications for production

                        [Hacker News discussion, LinkedIn discussion, Twitter thread] Update: My upcoming book, AI Engineering (late 2024/early 2025) will cover building aplications with foundation models in depth. A question that I’ve been asked a lot recently is how large language models (LLMs) will change machine learning workflows. After working with several companies who are working with LLM applications and persona

                          Building LLM applications for production
                        • 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

                            • Rubyで始めるAIエージェント入門 | Wantedly Engineer Blog

                              こんにちは。ウォンテッドリーの Enabling チームでバックエンドエンジニアをしている市古(@sora_ichigo_x)です。 現在、Enabling チームでは技術的な取り組みを社外にも発信すべく、メンバーが週替わりで技術ブログをリレー形式で執筆しています。前回は冨永さんによる「【計画編】 スカウト機能のマイクロサービス化を辞める判断について」でした。今回はAIエージェントを実装する話をします。 2025年に入り、「AIエージェント」という言葉が急速に浸透してきています。 そしてこれは単に利用ユーザーの関心が高まっているだけではなく、サービスを提供する側にとっても無視できない話です。主要ベンダーのSDKやAPIが次々と整備され、技術的には誰もがAIエージェントを社会実装できる環境が整いつつあります。つまり、AIが当たり前になる世界で、AI機能を持たないプロダクトは競争優位を維持でき

                                Rubyで始めるAIエージェント入門 | Wantedly Engineer Blog
                              • 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

                                • Functional programming is finally going mainstream

                                  Functional programming is finally going mainstream Object-oriented and imperative programming aren’t going away, but functional programming is finding its way into more codebases. Klint Finley // July 12, 2022 Paul Louth had a great development team at Meddbase, the healthcare software company he founded in 2005. But as the company grew, so did their bug count. That’s expected, up to a point. More

                                    Functional programming is finally going mainstream
                                  • 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)
                                    • Memory Allocation

                                      One thing that all programs on your computer have in common is a need for memory. Programs need to be loaded from your hard drive into memory before they can be run. While running, the majority of what programs do is load values from memory, do some computation on them, and then store the result back in memory. In this post I'm going to introduce you to the basics of memory allocation. Allocators

                                        Memory Allocation
                                      • CyberAgentが蒸留したDeepSeek-R1を試す|shi3z

                                        CyberAgentさんがDeepSeek-R1を日本語で蒸留し直してくれたので、その性能を試してみようと思います。 そのために、まず以下のようなコードを書きます。PythonのREPLで実行しています。 import requests import sseclient # pip install sseclient-py import json from rich.console import Console from rich.markdown import Markdown # コンソールの準備 console = Console() url = "http://localhost:8000/v1/chat/completions" headers = {"Content-Type": "application/json"} def ai(prompt): payload = { "

                                          CyberAgentが蒸留したDeepSeek-R1を試す|shi3z
                                        • 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)
                                            • Agents

                                              Intelligent agents are considered by many to be the ultimate goal of AI. The classic book by Stuart Russell and Peter Norvig, Artificial Intelligence: A Modern Approach (Prentice Hall, 1995), defines the field of AI research as “the study and design of rational agents.” The unprecedented capabilities of foundation models have opened the door to agentic applications that were previously unimaginabl

                                                Agents
                                              • TypeScript and the dawn of gradual types

                                                The FullScreenMario project burned brightly for a few short weeks in October 2013 after Boing Boing lauded it as “a pretty impressive example of what HTML5, in-browser functionality can do.” A few days later, it went viral on Reddit and by November, attention turned to scrutiny, and Nintendo took the project down with a DMCA request. Josh Goldberg speaks of his former project with a bit of pride—i

                                                  TypeScript and the dawn of gradual types
                                                • kyju.org - Piccolo - A Stackless Lua Interpreter

                                                  Piccolo - A Stackless Lua Interpreter 2024-05-01 History of piccolo A "Stackless" Interpreter Design Benefits of Stackless Cancellation Pre-emptive Concurrency Fuel, Pacing, and Custom Scheduling "Symmetric" Coroutines and coroutine.yieldto The "Big Lie" Rust Coroutines, Lua Coroutines, and Snarfing Zooming Out piccolo is an interpreter for the Lua language written in pure, mostly safe Rust with a

                                                  • 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

                                                      • krish's blog • Parsing JSON in 500 lines of Rust

                                                        Last semester at university, I took a course called "Syntax-Based Tools and Compilers". It focused on building a scanner, parser, compiler, and so on for a language called PL0. We used Python in the course, but I was really interested in learning Rust at the time. So, I decided to embark on a side project (yes, another one!). This time, I wanted to build a JSON parser in Rust. My goal was to test

                                                          krish's blog • Parsing JSON in 500 lines of Rust
                                                        • Model Context Protocol (MCP): Integrating Azure OpenAI for Enhanced Tool Integration and Prompting | Microsoft Community Hub

                                                          Model Context Protocol (MCP): Integrating Azure OpenAI for Enhanced Tool Integration and Prompting Model Context Protocol serves as a critical communication bridge between AI models and external systems, enabling AI assistants to interact directly with various services through a standardized interface. This protocol was designed to address the inherent limitations of standalone AI models by provid

                                                            Model Context Protocol (MCP): Integrating Azure OpenAI for Enhanced Tool Integration and Prompting | Microsoft Community Hub
                                                          • 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
                                                            • [ローカル環境] faster-whisperを利用してリアルタイム文字起こしに挑戦 - Qiita

                                                              Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article? はじめに WhisperAPI を利用せずにローカル環境でリアルタイム文字起こしに挑戦してみました。 本家Whisperだと音声ファイル形式以外の入力がうまくいかなかったため、faster-whisper を利用しました。 手探りで挑戦しましたので、何かご指摘がありましたらお教えいただければ幸いです。 効率的に文字起こしを行うための関連記事 [ローカル環境] faster-whisper を利用してリアルタイム文字起こしに挑戦2 [Windows] 文字起こしにデスクトップ音を利用する試み faster-whisperのパラメータを調べ

                                                                [ローカル環境] faster-whisperを利用してリアルタイム文字起こしに挑戦 - Qiita
                                                              • 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)
                                                                  • WSL2でDeepSeek-R1-Distill-Qwen-32B-Japaneseをllama.cppで試してみる|noguchi-shoji

                                                                    株価を暴落させているDeepSeekの蒸溜モデルをCyberAgentさんが追加学習したモデルであるDeepSeek-R1-Distill-Qwen-32B-Japanese。これをmomongaさんが量子化したモデル、を試してみます。 momongaさん、ありがとうございます。 使用するPCはドスパラさんの「GALLERIA UL9C-R49」。スペックは ・CPU: Intel® Core™ i9-13900HX Processor ・Mem: 64 GB ・GPU: NVIDIA® GeForce RTX™ 4090 Laptop GPU(16GB) ・GPU: NVIDIA® GeForce RTX™ 4090 (24GB) ※外付け ・OS: Ubuntu22.04 on WSL2(Windows 11) です。 1. llama.cppのセットアップllama-cpp-pyth

                                                                      WSL2でDeepSeek-R1-Distill-Qwen-32B-Japaneseをllama.cppで試してみる|noguchi-shoji
                                                                    • 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
                                                                          • July 2022 (version 1.70)

                                                                            Join a VS Code Dev Days event near you to learn about AI-assisted development in VS Code. Update 1.70.1: The update addresses these issues. Update 1.70.2: The update addresses these issues. Update 1.70.3: This update is only available for Windows 7 users and is the last release supporting Windows 7. Downloads: Windows: x64 Arm64 | Mac: Universal Intel silicon | Linux: deb rpm tarball Arm snap Welc

                                                                              July 2022 (version 1.70)
                                                                            • LLM音声対話システムの応答を高速化してみた | CyberAgent Developers Blog

                                                                              はじめまして、CyberAgent AI Lab Intaractive Agentチームの技術研究員の大平といいます。 この記事は CyberAgent Developers Advent Calendar 2023 1日目の記事です。 ChatGPTの登場以降、自然なチャット対話はAPI呼び出しだけで簡単に実装できるようになりました。 更に人間のようなインタラクションを実現しようとすれば、音声対話に発展させたいと思う方も多いかと思われます。 しかし実際にLLMを使って音声対話システムを構築してみると、そのレスポンスの遅さに不満を感じることになります。 この記事ではよくあるシンプルなLLMを用いた音声対話に対していくつかの工夫を施し、その応答速度をできるだけ早めてみようという試みになります。 よくある構成として、以下を用います。 音声認識 Google STT LLM ChatGPT 3

                                                                                LLM音声対話システムの応答を高速化してみた | CyberAgent Developers Blog
                                                                              • 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
                                                                                • python_modules.pdf

                                                                                  Python3 OpenCV / Pillow / pygame / Eel / PyDub / NumPy / matplotlib / SciPy / SymPy / gmpy2 / hashlib, passlib / Cython / Numba / ctypes / PyInstaller / curses / tqdm / JupyterLab / json / psutil / urllib / zenhan / jaconv Copyright © 2017-2025, Katsunori Nakamura 2025 8 19 Python ‘ .py’ Python Python Windows PSF Python py .py Enter macOS Linux PSF Python python3 .py Enter Anaconda Prompt Python p