並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 40 件 / 218件

新着順 人気順

while loop for list in pythonの検索結果1 - 40 件 / 218件

  • とほほのHaskell入門 - とほほのWWW入門

    概要 Haskellとは 関数型言語 純粋関数型言語 インストール Haskell Stack Hello world 基本 予約語 コメント ブロック レイアウト 入出力 型 変数 数値 文字(Char) 文字列(String) エスケープシーケンス リスト([...]) タプル((...)) 演算子 関数 演算子定義 再帰関数 ラムダ式 パターンマッチ ガード条件 関数合成(.) 引数補足(@) 制御構文 do文 let文 if文 case文 where文 import文 ループ データ型 データ型(列挙型) データ型(タプル型) データ型(直和型) 新型定義 (newtype) 型シノニム (type) 型クラス (class) メイビー(Maybe) ファンクタ(Functor) アプリケイティブ(Applicative) モナド(Monad) モジュール (module) 高階関

    • 「なんで、for文ってforなの?」って、みんな思ったはず。 - Qiita

      はじめに PythonやJavaScript、PHPなどのさまざまなプログラミング言語で"for文"というものが最初に出てきますよね。どの教材でもfor文は使われ、絶対にプログラムでも多用しています。アンチパターンもいくつかありますが、逆を言えば、アンチパターンがあるくらい使い方があります。 最初に思うはずです。 「なんで、for文ってforなの?」 これまでに受け入れてきてしまった"for"について由来を見てみましょう。知らなそうなエンジニアに自慢してみてください。 for文とは 基本的な使い方としては、何かの指示に従って配列オブジェクトなどに対して、適用できる「〇〇の分だけ、同じ処理をしてね!」というものです。 (for文とはなんぞ、別にやらんでいいやろ!と思われるかもですが、簡単にPythonで書いておきます。) 同じ処理を繰り返すので「ループ処理」とも言われます。ではなぜloopじ

        「なんで、for文ってforなの?」って、みんな思ったはず。 - Qiita
      • プロと読み解く 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番目の素数を求める - すぎゃーんメモ
          • TabFS

            Going through the files inside a tab's folder. For example, the url.txt, text.txt, and title.txt files tell me those live properties of this tab (Read more up-to-date documentation for all of TabFS's files here.) This gives you a ton of power, because now you can apply all the existing tools on your computer that already know how to deal with files -- terminal commands, scripting languages, point-

              TabFS
            • Deploy applications on Amazon ECS using Docker Compose | Amazon Web Services

              Containers Deploy applications on Amazon ECS using Docker Compose Note: Docker Compose’s integration with Amazon ECS has been deprecated and is retiring in November 2023 There are many reasons why containers have become popular since Docker democratized access to the core Linux primitives that make a “docker run” possible. One reason is that containers are not tied to a specific infrastructure or

                Deploy applications on Amazon ECS using Docker Compose | Amazon Web Services
              • プロと読み解くRuby 3.4 NEWS - STORES Product Blog

                プロと読み解くRuby 3.4 NEWS テクノロジー部門技術基盤グループの笹田(ko1)と遠藤(mame)です。Ruby (MRI: Matz Ruby Implementation、いわゆる ruby コマンド) の開発をしています。お金をもらって Ruby を開発しているのでプロの Ruby コミッタです。 本日 12/25 に、恒例のクリスマスリリースとして、Ruby 3.4.0 がリリースされました(Ruby 3.4.0 リリース )。今年も STORES Product Blog にて Ruby 3.4 の NEWS.md ファイルの解説をします(ちなみに、STORES Advent Calendar 2024 の記事になります。他も読んでね)。NEWS ファイルとは何か、は以前の記事を見てください。 プロと読み解く Ruby 2.6 NEWS ファイル - クックパッド開発者

                  プロと読み解くRuby 3.4 NEWS - STORES Product Blog
                • 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

                        • PacketProxyで探るGemini CLIのコンテキストエンジニアリング 〜AIエージェントを信頼できる相棒に〜 | BLOG - DeNA Engineering

                          2025.07.18 技術記事 PacketProxyで探るGemini CLIのコンテキストエンジニアリング 〜AIエージェントを信頼できる相棒に〜 by akira.kuroiwa #gemini-cli #ai #security #aiエージェント #コンテキストエンジニアリング #packetproxy 「なんかよく分からないけど、すごい」で終わらせないために こんにちは、DeNA セキュリティ技術グループの 黒岩 亮 ( @kakira9618 ) です。 AIエージェント、とくに Gemini CLI のようなコーディングを支援してくれるツールは非常に強力で、私たちの開発体験を大きく変えようとしています。しかし、その一方で、こんな風に感じたことはありませんか? 「このファイルの情報、勝手にAIに送られたりしない? 大丈夫かな?」 と、情報管理・セキュリティ面で漠然とした不安を

                            PacketProxyで探るGemini CLIのコンテキストエンジニアリング 〜AIエージェントを信頼できる相棒に〜 | BLOG - DeNA Engineering
                          • An Opinionated Guide to xargs

                            Preliminaries What Is xargs? It's an adapter between text streams and argv arrays, two essential concepts in shell. You pass it flags that specify how to split stdin. Then it generates arguments and invokes processes. Example: $ echo 'alice bob' | xargs -n 1 -- echo hi hi alice hi bob What's happening here? xargs splits the input stream on whitespace, producing 2 arguments, alice and bob. We passe

                            • 2025年、それはスクワットの時代 🏋️ - マンガ〜ノ伊藤ノ〜ト

                              この記事は「はてなエンジニア Advent Calendar 2024 - Hatena Developer Blog」の 41 日目の記事です。昨日は id:masayosu さんの「AWS EKS Automode のノード管理について」でした。 はてなのマンガアプリチームで Android エンジニアをやっている id:mangano-ito です。 スクワット最強説 スクワットは筋トレの中でもオススメらしいのです。 理屈はよくわかってないけど、筋トレやるならスクワットがオススメだよみたいなことはよくきくと思います: diamond.jp ので、自分は風呂前や風呂中に気休め程度にスクワットをやっている。たまに変な腹筋もやっていますが…自分のヘソを見つめるやつ。 www.nisshin.com それはさておき、スクワットのいいところとしましては、映像をみながらやりやすいということです。

                                2025年、それはスクワットの時代 🏋️ - マンガ〜ノ伊藤ノ〜ト
                              • 【Python】ChatGPT効率化の為に非同期処理を実装|Clirea

                                非同期処理は、データ解析、APIリクエスト、ベクター化など多様なタスクにおいてパフォーマンスを向上させる鍵となる技術です。特に、待ち時間が発生しやすい多数のリクエストや処理を一度に効率よく処理したい場合、この技術は不可欠です。 非同期処理と並列処理の違い非同期処理と並列処理は、よく一緒に取り上げられることが多いですが、実はそれぞれ異なる目的と特性を持っています。 非同期処理非同期処理は、I/O待ち(ディスクへの読み書きやネットワーク通信など)といった待機時間を有効に使いながら、他のタスクを進める技術です。この方法で、全体のプログラムがスムーズに動作します。 並列処理一方で、並列処理は複数の処理を物理的に同時に行う技術です。簡単な例でいえば動画です。動画の再生と音声の再生を遅延が無いよう同時に行っています。 並列処理により、大量のデータ処理や高度な計算を高速に行えます。 まとめ簡単に言えば、

                                  【Python】ChatGPT効率化の為に非同期処理を実装|Clirea
                                • 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

                                  • バグらせやすい書き方をすれば当然バグは出やすい - えびちゃんの日記

                                    導入 rsk0315.hatenablog.com こういう話はある*1んですが、最初からバグらせやすい書き方をしておいて「バグが出たー」と言われてもそれはそうとなってしまうので、そういうのを控えるくらいのことはするべきだと思います。 書き方が悪いせいで「十分に複雑なコード」になってしまっているものもあります(もちろん概念自体が複雑なものを実装するときは複雑になって当然ですが)。 「控えるべき書き方」とか「書くときに気をつけるべきこと」とかを紹介します。 あくまで自分の主観であって、読み手の人の方針に反するのであれば強制する気はないです。「こういう書き方もあるよー」くらいに捉えてください。 導入 紹介 控えたいこと フラグ変数を乱用しない デバッグは標準エラー出力に書く 出力パートは一箇所にまとめる 計算パートと入出力パートは分ける いくつかの具体例だけで考察を終わらせない 書きながら気を

                                      バグらせやすい書き方をすれば当然バグは出やすい - えびちゃんの日記
                                    • 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)
                                      • Prototyping in Rust | corrode Rust Consulting

                                        Programming is an iterative process - as much as we would like to come up with the perfect solution from the start, it rarely works that way. Good programs often start as quick prototypes. The bad ones stay prototypes, but the best ones evolve into production code. Whether you’re writing games, CLI tools, or designing library APIs, prototyping helps tremendously in finding the best approach before

                                          Prototyping in Rust | corrode Rust Consulting
                                        • 📖 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 ドコモ開発者ブログ
                                          • Writing Toy Software Is A Joy

                                            I am a huge fan of Richard Feyman’s famous quote: “What I cannot create, I do not understand” I think it’s brilliant, and it remains true across many fields (if you’re willing to be a little creative with the definition of ‘create’). It is to this principle that I believe I owe everything I’m truly good at. Some will tell you to avoid reinventing the wheel, but they’re wrong: you should build your

                                            • Python 3.13 gets a JIT

                                              Happy New Year everyone! In late December 2023 (Christmas Day to be precise), CPython core developer Brandt Bucher submitted a little pull-request to the Python 3.13 branch adding a JIT compiler. This change, once accepted would be one of the biggest changes to the CPython Interpreter since the Specializing Adaptive Interpreter added in Python 3.11 (which was also from Brandt along with Mark Shann

                                                Python 3.13 gets a JIT
                                              • 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
                                                • 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
                                                  • Things we learned about LLMs in 2024

                                                    31st December 2024 A lot has happened in the world of Large Language Models over the course of 2024. Here’s a review of things we figured out about the field in the past twelve months, plus my attempt at identifying key themes and pivotal moments. This is a sequel to my review of 2023. In this article: The GPT-4 barrier was comprehensively broken Some of those GPT-4 models run on my laptop LLM pri

                                                      Things we learned about LLMs in 2024
                                                    • The Legends of Runeterra CI/CD Pipeline

                                                      The Legends of Runeterra CI/CD Pipeline Hi, I’m Guy Kisel, and I’m a software engineer on Legends of Runeterra’s Production Engineering: Shared Tools, Automation, and Build team (PE:STAB for short). My team is responsible for solving cross-team shared client technology issues and increasing development efficiency. We focus on the areas that empower other teams to do more and protect the team from

                                                        The Legends of Runeterra CI/CD Pipeline
                                                      • Gamedev in Lisp. Part 1: ECS and Metalinguistic Abstraction - cl-fast-ecs by Andrew

                                                        Gamedev in Lisp. Part 1: ECS and Metalinguistic Abstraction In this series of tutorials, we will delve into creating simple 2D games in Common Lisp. The result of the first part will be a development environment setup and a basic simulation displaying a 2D scene with a large number of physical objects. It is assumed that the reader is familiar with some high-level programming language, has a gener

                                                          Gamedev in Lisp. Part 1: ECS and Metalinguistic Abstraction - cl-fast-ecs by Andrew
                                                        • 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

                                                                • RFC 9562: Universally Unique IDentifiers (UUIDs)

                                                                   Internet Engineering Task Force (IETF) K. Davis Request for Comments: 9562 Cisco Systems Obsoletes: 4122 B. Peabody Category: Standards Track Uncloud ISSN: 2070-1721 P. Leach University of Washington May 2024 Universally Unique IDentifiers (UUIDs) Abstract This specification defines UUIDs (Universally Unique IDentifiers) -- also known as GUIDs (Globally Unique IDentifiers) -- and a Uniform Resou

                                                                    RFC 9562: Universally Unique IDentifiers (UUIDs)
                                                                  • 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
                                                                    • CUPID: for joyful coding

                                                                      What started as lighthearted iconoclasm, poking at the bear of SOLID, has developed into something more concrete and tangible. If I do not think the SOLID principles are useful these days, then what would I replace them with? Can any set of principles hold for all software? What do we even mean by principles? I believe that there are properties or characteristics of software that make it a joy to

                                                                      • 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

                                                                        • 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
                                                                          • 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
                                                                              • 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
                                                                                • Building a Toy Programming Language in Python

                                                                                  I thought it would be fun to go outside of my comfort zone of web development topics and write about something completely different and new, something I have never written about before. So today, I'm going to show you how to implement a programming language! The project will parse and execute programs written in a simple language I called my (I know it's a lame name, but hey, it is "my" language).

                                                                                    Building a Toy Programming Language in Python