並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 40 件 / 98件

新着順 人気順

break in if statement pythonの検索結果1 - 40 件 / 98件

  • 関数名、メソッド名、変数名でよく使う英単語のまとめ

    プログラミングをしていると関数名、メソッド名、変数名をどうするか悩みます。 ロジックより命名に時間を費やすこともざらにあります。翻訳したり、一般的な命名規則なのかいつも検索して大変です。 よく使うサイトの内容をコピってメモしておく 関数名とメソッド名の違いについて よく使う英単語のまえに、いつもごっちゃにして使っているけど、定義はこんな感じ 「関数」と「メソッド」の違い 似ているところ どちらも何か(引数)を入れると処理をして何か(戻り値)を返してくれます。 違うところ やってること自体は大差ありません。概念としては違います。 メソッドはオブジェクト指向で登場する用語で、オブジェクトの動作を定義したものです。 まずオブジェクトありきなのですね。一方の関数は、オブジェクト云々は関係ありません。 個人的な使い分け Java で登場する関数は「メソッド」です。C 言語で登場する関数は「関数」と呼

      関数名、メソッド名、変数名でよく使う英単語のまとめ
    • 大実験!ChatGPTは競プロの問題を解けるのか (2024年5月版) - E869120's Blog

      1. はじめに 2024 年 5 月 14 日、OpenAI 社から新たな生成 AI「GPT-4o」が発表され、世界に大きな衝撃を与えました。これまでの GPT-4 よりも性能を向上させただけでなく1、音声や画像のリアルタイム処理も実現し、さらに応答速度が大幅に速くなりました。「ついにシンギュラリティが来てしまったか」「まるで SF の世界を生きているような感覚だ」という感想も見受けられました。 しかし、いくら生成 AI とはいえ、競技プログラミングの問題を解くのは非常に難しいです。なぜなら競技プログラミングでは、問題文を理解する能力、プログラムを実装する能力だけでなく、より速く答えを求められる解法 (アルゴリズム) を考える能力も要求されるからです。もし ChatGPT が競技プログラミングを出来るようになれば他のあらゆるタスクをこなせるだろう、と考える人もいます。 それでは、現代最強の

        大実験!ChatGPTは競プロの問題を解けるのか (2024年5月版) - E869120's Blog
      • 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の杜 🥥
        • Why UUIDs won't protect your secrets

          This post is part of a collection on UUIDs. What is IDOR? Indirect Object Reference (IDOR) occurs when a resource can be accessed directly by its ID even when the user does not have proper authorization to access it. IDOR is a common mistake when using a separate service for storing files, such as a publicly readable Amazon S3 bucket. The web application may perform access control checks correctly

          • REST API Design Best Practices Handbook – How to Build a REST API with JavaScript, Node.js, and Express.js

            By Jean-Marc Möckel I've created and consumed many API's over the past few years. During that time, I've come across good and bad practices and have experienced nasty situations when consuming and building API's. But there also have been great moments. There are helpful articles online which present many best practices, but many of them lack some practicality in my opinion. Knowing the theory with

              REST API Design Best Practices Handbook – How to Build a REST API with JavaScript, Node.js, and Express.js
            • SaaS におけるテナントリソースへのリクエストルーティングを JWT を用いて実現する | Amazon Web Services

              Amazon Web Services ブログ SaaS におけるテナントリソースへのリクエストルーティングを JWT を用いて実現する みなさんこんにちは。ソリューションアーキテクトの福本です。 本投稿のテーマは Software as a Service(SaaS)におけるルーティングです。 SaaS ではテナントごとにサーバーなどのリソースが分離されていることがあります。そのため、各テナントに属するユーザーからのリクエストを適切なリソースへとルーティングする必要があります。 具体的なルーティングの話に入る前に、SaaS のテナント分離モデルについて説明をします。SaaS では、テナントの分離モデルとしてサイロ、プール、ブリッジモデルが存在します。また、ユーザーがサブスクライブしている利用プラン (ティア) によって、リソースの分離形態が変わるような、階層ベースの分離もあります。 サイ

                SaaS におけるテナントリソースへのリクエストルーティングを JWT を用いて実現する | Amazon Web Services
              • 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
                • ソースコード & ドキュメントに対応したGraph RAGの実装(Tree-sitter + LightRAG)

                  (module (function_definition (identifier) # ← ここに関数名「sample_func」が含まれます (parameters) (block (expression_statement (call (identifier) (argument_list (string)))))) (expression_statement (call (identifier) (argument_list)))) ノードが色々取れましたが、「function_definition」が関数、その子である「identifier」が関数名を表すため、 function_definition == 子ノード ==> identifier となっている箇所を探索すれば抽出できます(関数ではあっても「lambda」など異なる場合もあります)。 今回は上記のようにTree-si

                    ソースコード & ドキュメントに対応したGraph RAGの実装(Tree-sitter + LightRAG)
                  • 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

                    • Python 3.10から導入されたBetter error messagesの深掘り | gihyo.jp

                      鈴木たかのりです。今月のPython Monthly Topicsでは、Python 3.10から導入されたBetter error messagesについて紹介します。Better error messagesがどういったものであるかの紹介と、どのようにこのエラーメッセージが出力されているか、Python内部の処理についても触れようと思います。 Better error messagesとは Python 3.10からBetter error messagesという機能が追加されました。この機能は名前のとおり「エラーメッセージを改善」するものです。「⁠エラーメッセージの改善」により以前よりもわかりやすいエラーメッセージが出力され、ユーザーがエラーの意味に気づきやすくなりました。 例として、以下のようなリストの閉じカッコ(])を忘れたコードを実行し、出力されるエラーメッセージを見比べてみま

                        Python 3.10から導入されたBetter error messagesの深掘り | gihyo.jp
                      • Rewriting the Ruby parser

                        At Shopify, we have spent the last year writing a new Ruby parser, which we’ve called YARP (Yet Another Ruby Parser). As of the date of this post, YARP can parse a semantically equivalent syntax tree to Ruby 3.3 on every Ruby file in Shopify’s main codebase, GitHub’s main codebase, CRuby, and the 100 most popular gems downloaded from rubygems.org. We recently got approval to merge this work into C

                          Rewriting the Ruby parser
                        • Incident Metrics in SRE

                          Štěpán Davidovič Incident Metrics in SRE Critically Evaluating MTTR and Friends Boston Farnham Sebastopol Tokyo Beijing Boston Farnham Sebastopol Tokyo Beijing 978-1-098-10313-2 [LSI] Incident Metrics in SRE by Štěpán Davidovič Copyright © 2021 O’Reilly Media, Inc. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebas

                          • 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
                            • 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

                                • April 2022 (version 1.67)

                                  Join a VS Code Dev Days event near you to learn about AI-assisted development in VS Code. Update 1.67.1: The update addresses this security issue. Update 1.67.2: The update addresses these issues. Downloads: Windows: x64 Arm64 | Mac: Universal Intel silicon | Linux: deb rpm tarball Arm snap Welcome to the April 2022 release of Visual Studio Code. There are many updates in this version that we hope

                                    April 2022 (version 1.67)
                                  • 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
                                    • syntaxdesign

                                      One of the most recognizable features of a languages is its syntax. What are some of the things about syntax that matter? What questions might you ask if you were creating a syntax for your own language? Motivation A programming language gives us a way structure our thoughts. Each program, has a kind of internal structure, for example: How can we capture this structure? One way is directly, via pi

                                      • 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
                                        • Font with Built-In Syntax Highlighting

                                          Note: I received a lot of great feedback from the discussions at Mastodon and Hacker News, so I've updated the post with some improvements to the font! I've also added some further examples and acknowledgements at the end. Syntax Highlighting in Hand-Coded Websites The problem I have been trying to identify practical reasons why hand-coding websites with HTML and CSS is so hard (by hand-coding, I

                                          • Agentic GraphRAG for Commercial Contracts | Towards Data Science

                                            In every business, legal contracts are foundational documents that define the relationships, obligations, and responsibilities between parties. Whether it’s a partnership agreement, an NDA, or a supplier contract, these documents often contain critical information that drives decision-making, risk management, and compliance. However, navigating and extracting insights from these contracts can be a

                                              Agentic GraphRAG for Commercial Contracts | Towards Data Science
                                            • 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
                                                  • 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

                                                    • Accelerating Generative AI with PyTorch II: GPT, Fast – PyTorch

                                                      Blog Accelerating Generative AI with PyTorch II: GPT, Fast This post is the second part of a multi-series blog focused on how to accelerate generative AI models with pure, native PyTorch. We are excited to share a breadth of newly released PyTorch performance features alongside practical examples to see how far we can push PyTorch native performance. In part one, we showed how to accelerate Segmen

                                                        Accelerating Generative AI with PyTorch II: GPT, Fast – PyTorch
                                                      • SESでバウンスメールを確認する方法をいくつか試してみた | DevelopersIO

                                                        こんにちは、コンサル部@大阪オフィスのTodaです。 Amazon Simple Email Service(以降SES)は任意のアプリケーションからメール配信をする際、おすすめのサービスになります。 メール配信はエンドユーザ様から指定頂いた、メールアドレスに対しておこないますが、入力ミスによる受信失敗(バウンスメール)、迷惑メール報告(苦情メール)が発生する場合があり管理が必要になります。 今回は、簡易に運営者側でバウンスメールに気づける方法を試してみます。 バウンスメール対策の重要性 SESではサービスを利用して送信したメールの中でバウンスメールと苦情メールの計測をしており、一定以上になった場合、レビュー対象や配信の停止がおこなわれます。処理を維持をするためバウンスメールの対応が必要になります。 ■ バウンスに関するよくある質問 から引用 https://docs.aws.amazon

                                                          SESでバウンスメールを確認する方法をいくつか試してみた | DevelopersIO
                                                        • Why People are Angry over Go 1.23 Iterators - gingerBill

                                                          NOTE: This is based on, but completely rewritten, from a Twitter post: https://x.com/TheGingerBill/status/1802645945642799423 TL;DR It makes Go feel too “functional” rather than being an unabashed imperative language. I recently saw a post on Twitter showing the upcoming Go iterator design for Go 1.23 (August 2024). From what I can gather, many people seem to dislike the design. I wanted to give m

                                                          • Lean for JavaScript Developers — overreacted

                                                            Lean for JavaScript DevelopersSeptember 2, 2025 This is my opinionated syntax primer for the Lean programming language. It is far from complete and may contain inaccuracies (I’m still learning Lean myself) but this is how I wish I was introduced to it, and what I wish was clarified. Why Lean? This post assumes you’re already eager to learn a bit of Lean. For motivation, I humbly submit to you two

                                                              Lean for JavaScript Developers — overreacted
                                                            • 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

                                                              • Andrej Karpathy — AGI is still a decade away

                                                                The Andrej Karpathy episode. Andrej explains why reinforcement learning is terrible (but everything else is much worse), why model collapse prevents LLMs from learning the way humans do, why AGI will just blend into the previous ~2.5 centuries of 2% GDP growth, why self driving took so long to crack, and what he sees as the future of education. Watch on YouTube; listen on Apple Podcasts or Spotify

                                                                  Andrej Karpathy — AGI is still a decade away
                                                                • How to think about agent frameworks

                                                                  TL;DR: The hard part of building reliable agentic systems is making sure the LLM has the appropriate context at each step. This includes both controlling the exact content that goes into the LLM, as well as running the appropriate steps to generate relevant content.Agentic systems consist of both workflows and agents (and everything in between).Most agentic frameworks are neither declarative or im

                                                                    How to think about agent frameworks
                                                                  • Highlights from the Claude 4 system prompt

                                                                    25th May 2025 Anthropic publish most of the system prompts for their chat models as part of their release notes. They recently shared the new prompts for both Claude Opus 4 and Claude Sonnet 4. I enjoyed digging through the prompts, since they act as a sort of unofficial manual for how best to use these tools. Here are my highlights, including a dive into the leaked tool prompts that Anthropic did

                                                                      Highlights from the Claude 4 system prompt
                                                                    • 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

                                                                      • Lesser Known PostgreSQL Features

                                                                        In 2006 Microsoft conducted a customer survey to find what new features users want in new versions of Microsoft Office. To their surprise, more than 90% of what users asked for already existed, they just didn't know about it. To address the "discoverability" issue, they came up with the "Ribbon UI" that we know from Microsoft Office products today. Office is not unique in this sense. Most of us ar

                                                                          Lesser Known PostgreSQL Features
                                                                        • State of the Common Lisp ecosystem, 2020 🎉 - Lisp journey

                                                                          NEW: 9 videos (86min) about CLOS on my Common Lisp course. Out of 7h+ of content. Rated 4.7/5. Learn more and stay tuned. 🎥 I also have cool Lisp showcases on Youtube . The last ones: how to build a web app in Common Lisp, part 1 and 2. This is a description of the Common Lisp ecosystem, as of January, 2021, from the perspective of a user and contributor. The purpose of this article is both to gi

                                                                          • Introducing PyTorch Monarch – PyTorch

                                                                            We now live in a world where ML workflows (pre-training, post training, etc) are heterogeneous, must contend with hardware failures, are increasingly asynchronous and highly dynamic. Traditionally, PyTorch has relied on an HPC-style  multi-controller model, where multiple copies of the same script are launched across different machines, each running its own instance of the application (often refer

                                                                            • mod_wasm: run WebAssembly with Apache

                                                                              Apache httpd is a modular web server that powers 31% of all websites you access every day. One of its most compelling features is the ability to extend it with new modules. Developers can choose among different modules to add or remove features like CGI, TLS, PHP, and many others. Today, we announce a new Apache module to run WebAssembly modules: mod_wasm. This module opens a new set of possibilit

                                                                                mod_wasm: run WebAssembly with Apache
                                                                              • prompts.chat

                                                                                Welcome to the “Awesome ChatGPT Prompts” repository! While this collection was originally created for ChatGPT, these prompts work great with other AI models like Claude, Gemini, Hugging Face Chat, Llama, Mistral, and more. ChatGPT is a web interface created by OpenAI that provides access to their GPT (Generative Pre-trained Transformer) language models. The underlying models, like GPT-4o and GPT-o

                                                                                • NumPy 2.0.0 Release Notes — NumPy v2.4.dev0 Manual

                                                                                  Getting started What is NumPy? Installation NumPy quickstart NumPy: the absolute basics for beginners Fundamentals and usage NumPy fundamentals NumPy for MATLAB users NumPy tutorials NumPy how-tos Advanced usage and interoperability Using NumPy C-API F2PY user guide and reference manual Under-the-hood documentation for developers Interoperability with NumPy Extras Glossary Release notes 2.4.0 2.3.