並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 19 件 / 19件

新着順 人気順

if elif else statement in python codeの検索結果1 - 19 件 / 19件

  • 大実験!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
    • ソースコード & ドキュメントに対応した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.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
          • 4 Pandas Anti-Patterns to Avoid and How to Fix Them

            pandas is a powerful data analysis library with a rich API that offers multiple ways to perform any given data manipulation task. Some of these approaches are better than others, and pandas users often learn suboptimal coding practices that become their default workflows. This post highlights four common pandas anti-patterns and outlines a complementary set of techniques that you should use instea

              4 Pandas Anti-Patterns to Avoid and How to Fix Them
            • 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
                • カスタムリソースでAWS IAM Access Analyzerのアーカイブルールを自動で適用してみる - NRIネットコムBlog

                  本記事は AWSアワード受賞者祭り 17日目の記事です。 ✨🏆 16日目 ▶▶ 本記事 ▶▶ 18日目 🏆✨ はじめに アーカイブルールとは アーカイブルール概要 アーカイブルールを作成しても既存の結果には適用されない カスタムリソースによるアーカイブルールの適用 カスタムリソースとは カスタムリソースの実行タイミング CloudFormationに対してレスポンスが必要 テンプレート CloudFormationテンプレート ダミーパラメータを設定する ServiceTimeoutを利用する カスタムリソースのLambda関数のコード デプロイ手順 終わりに はじめに こんにちは、藤本です。 この度、「2025 Japan AWS Jr. Champions」、「2025 Japan All AWS Certifications Engineers」に選出いただきました。 「2025

                    カスタムリソースでAWS IAM Access Analyzerのアーカイブルールを自動で適用してみる - NRIネットコムBlog
                  • Rust on MIPS64 Windows NT 4.0

                    Introduction Some part of me has always been fascinated with coercing code to run in weird places. I scratch this itch a lot with my security research projects. These often lead me to writing shellcode to run in kernels or embedded hardware, sometimes with the only way being through an existing bug. For those not familiar, shellcode is honestly hard to describe. I don’t know if there’s a very form

                      Rust on MIPS64 Windows NT 4.0
                    • AWS公式のECSハンズオンがとても良かった!! - Qiita

                      はじめに お疲れ様です。矢儀 @yuki_ink です。 こちらのAWS公式ハンズオンをやってみました。 ECSとFargate/EC2を利用した環境構築から、CI/CDパイプラインを利用したデプロイまで、一通り体験できる素晴らしいハンズオンでした。 次のようなみなさんにおすすめです。 ECSを知識として知ってはいるが、実際に触ったことがない コンテナの何が優れているのか、実感を持っては理解できない CI/CDパイプラインでコンテナをデプロイしてみたい ハンズオンで構築する環境の構成イメージはこちら。 1. VS Code Serverの構築 このハンズオンでは、開発環境として Visual Studio Code Server (VS Code Server) を利用するとのことで、まず、CloudFormationでVS Code Serverを構築していきます。 ハンズオンページの

                        AWS公式のECSハンズオンがとても良かった!! - Qiita
                      • Vim9 script for Python Developers · GitHub

                        vim9script4pythondevelopers.md Vim9 script for Python Developers Vim9 script�Vim script��������������������������������������������������系��� def������義����������Vim script��vim9script�����使����������(vim9script���

                          Vim9 script for Python Developers · GitHub
                        • Python behind the scenes #11: how the Python import system works

                          If you ask me to name the most misunderstood aspect of Python, I will answer without a second thought: the Python import system. Just remember how many times you used relative imports and got something like ImportError: attempted relative import with no known parent package; or tried to figure out how to structure a project so that all the imports work correctly; or hacked sys.path when you couldn

                          • Introducing Amazon Kinesis Data Analytics Studio – Quickly Interact with Streaming Data Using SQL, Python, or Scala | Amazon Web Services

                            AWS News Blog Introducing Amazon Kinesis Data Analytics Studio – Quickly Interact with Streaming Data Using SQL, Python, or Scala The best way to get timely insights and react quickly to new information you receive from your business and your applications is to analyze streaming data. This is data that must usually be processed sequentially and incrementally on a record-by-record basis or over sli

                              Introducing Amazon Kinesis Data Analytics Studio – Quickly Interact with Streaming Data Using SQL, Python, or Scala | Amazon Web Services
                            • Amazon Inspectorの検出結果をリソース単位でまとめてメール通知する方法 | DevelopersIO

                              はじめに 以前、Amazon Inspectorの検出結果をAWS Security Hubを経由してメール通知する方法をご紹介しました。 Inspectorは脆弱性を検出するたびに結果を作成するため、1つのリソースに対して複数の脆弱性が見つかった場合、その数だけメール通知が発生してしまいます。例えば、100個の脆弱性が検出されると、100通のメールが送信される状況でした。 本記事では、脆弱性ごとの通知ではなく、1リソースごとに検出結果をまとめて1回の通知で済ませる方法をご紹介します。 構成は以下のとおりです。 本実装は、以下の流れで処理を行います。 Inspectorで検出結果が作成され、Security Hub経由でEventBridgeが起動します。 Firehose ストリームに検出結果が一時保存されます。 Firehose ストリームは、指定したバッファ期間内に受信したイベントを

                                Amazon Inspectorの検出結果をリソース単位でまとめてメール通知する方法 | DevelopersIO
                              • Exhaustive Union Matching in Python - Preferred Networks Research & Development

                                Pattern matching on algebraic data types is a powerful technique to process a given input and many programming languages have adopted it in one way or another. A check on whether a given match is “exhaustive”, i.e., covers all possible inputs, is helpful to avoid bugs when the set of possible inputs is extended; for example, when new enumeration values are added. In this blog post I will first bri

                                  Exhaustive Union Matching in Python - Preferred Networks Research & Development
                                • Python behind the scenes #12: how async/await works in Python

                                  Mark functions as async. Call them with await. All of a sudden, your program becomes asynchronous – it can do useful things while it waits for other things, such as I/O operations, to complete. Code written in the async/await style looks like regular synchronous code but works very differently. To understand how it works, one should be familiar with many non-trivial concepts including concurrency,

                                  • Automated Hydroponic System Build – Projects | Kyle Gabriel

                                    Last Updated: August 28, 2022 Hydroponic farming is a method of growing crops without soil, with the main benefits of environmental and nutrient control, water conservation, and reduction of labor. This technique relies on a number of technologies that the principles of automation can be applied in order to improve yield and consistency. In this article and accompanying video, I’ll show you how to

                                    • Amplified exposure: How AWS flaws made Amplify IAM roles vulnerable to takeover | Datadog Security Labs

                                      research Amplified exposure: How AWS flaws made Amplify IAM roles vulnerable to takeover April 15, 2024 aws vulnerability disclosure Key Points We identified two variants of a vulnerability in AWS Amplify that exposed identity and access management (IAM) roles associated with Amplify projects, allowing them to become assumable by anyone in the world. If the authentication component was removed fro

                                        Amplified exposure: How AWS flaws made Amplify IAM roles vulnerable to takeover | Datadog Security Labs
                                      • Schedule Amazon RDS stop and start using AWS Lambda | Amazon Web Services

                                        AWS Database Blog Schedule Amazon RDS stop and start using AWS Lambda Amazon Relational Database Service (Amazon RDS) makes it easy to set up, operate, and scale a relational database in the cloud. Traditional relational databases require time spent on capacity planning, maintenance, backup, and recovery; a substantial amount of a database administrator’s time is lost to these tasks. Amazon RDS he

                                          Schedule Amazon RDS stop and start using AWS Lambda | Amazon Web Services
                                        1