並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 40 件 / 129件

新着順 人気順

python if or else statementの検索結果1 - 40 件 / 129件

  • PythonでDDDやってみた💪 - techtekt

    はじめに 実行環境 ディレクトリ構造 app migrations/model pyproject.toml ソースコードと簡単な解説 app/core app/core/abstract app/core/decorator app/core/exception app/core/interface app/core/middleware app/core/mixin app/ddd app/ddd/application app/ddd/application/schema app/ddd/application/schema/studnet app/ddd/application/usecase app/ddd/application/usecase/student app/ddd/domain app/ddd/domain/student app/ddd/infra app/ddd

      PythonでDDDやってみた💪 - techtekt
    • 大実験!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のGraphRAG+Neo4jで簡単にKnowledge Graphを可視化する - Taste of Tech Topics

        こんにちは。データサイエンティストチームYAMALEXのSsk1029Takashiです。 LLMが広く使用されるようになってから、RAGに関する研究も増加し、RAGを拡張する手法の研究も多く出ました。 その中でもテキストをグラフデータとして扱いRAGの元データとする手法をGraphRAGと言います。 今回はその中の一つであるMicrosoftが提唱しているGraphRAGの手法を使っていきます。 www.microsoft.com MicrosoftからはGraphRAGを使用できる実装もPythonライブラリとして発表されています。 ライブラリではグラフデータはあくまでRAGの元データとして使用していますが、せっかくテキストからグラフが生成できるのであれば、テキストマイニングしてみたくなるものです。 そこで、本記事ではこの手法で作成したグラフをグラフDBの一つであるNeo4jに投入して

          MicrosoftのGraphRAG+Neo4jで簡単にKnowledge Graphを可視化する - Taste of Tech Topics
        • Introducing Ezno

          Ezno is an experimental compiler I have been working on and off for a while. In short, it is a JavaScript compiler featuring checking, correctness and performance for building full-stack (rendering on the client and server) websites. This post is just an overview of some of the features I have been working on which I think are quite cool as well an overview on the project philosophy ;) It is still

            Introducing Ezno
          • ソースコード & ドキュメントに対応した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

              • Moving off of TypeScript

                We Love You, TypeScriptFor nearly five years now, Motion has operated in a large TypeScript monorepo. At its peak, it was roughly ~2.5 million lines of code after excluding comments, node_modules, etc. To manage this, we used Vercel’s rather excellent Turborepo build system. This is not a blog post hating on TypeScript — quite the opposite! Motion would likely not even have survived until today wi

                  Moving off of TypeScript
                • 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
                  • 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
                    • Choose Postgres queue technology

                      Introduction⌗ Postgres queue tech is a thing of beauty, but far from mainstream. Its relative obscurity is partially attributable to the cargo cult of “scale”. The scalability cult has decreed that there are several queue technologies with greater “scalability” than Postgres, and for that reason alone, Postgres isn’t suitably scalable for anyone’s queuing needs. The cult of scalability would rathe

                        Choose Postgres queue technology
                      • 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
                        • 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
                            • 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

                              • 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

                                      • 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
                                          • Better Fbx Importer & Exporter

                                            About Virus WarningThe Bitdefender Enterprise Support Team has verified that it is a false positive, here is the reply: Hello, Thank you for contacting the Bitdefender Enterprise Support Team. We have received an update from our laboratories. The files are clean and detection should be removed in the next couple of updates. Please let us know if there is anything else we can assist you with or if

                                              Better Fbx Importer & Exporter
                                            • 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

                                                • PyTorch discloses malicious dependency chain compromise over holidays

                                                  HomeNewsSecurityPyTorch discloses malicious dependency chain compromise over holidays PyTorch has identified a malicious dependency with the same name as the framework's 'torchtriton' library. This has led to a successful compromise via the dependency confusion attack vector. PyTorch admins are warning users who installed PyTorch-nightly over the holidays to uninstall the framework and the counter

                                                    PyTorch discloses malicious dependency chain compromise over holidays
                                                  • 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
                                                    • The OpenSSL punycode vulnerability (CVE-2022-3602): Overview, detection, exploitation, and remediation | Datadog Security Labs

                                                      emerging threats and vulnerabilities The OpenSSL punycode vulnerability (CVE-2022-3602): Overview, detection, exploitation, and remediation November 1, 2022 emerging vulnerability On November 1, 2022, the OpenSSL Project released a security advisory detailing a high-severity vulnerability in the OpenSSL library. Deployments of OpenSSL from 3.0.0 to 3.0.6 (included) are vulnerable and are fixed in

                                                        The OpenSSL punycode vulnerability (CVE-2022-3602): Overview, detection, exploitation, and remediation | Datadog Security Labs
                                                      • 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

                                                        • Why pipes sometimes get "stuck": buffering

                                                          Here’s a niche terminal problem that has bothered me for years but that I never really understood until a few weeks ago. Let’s say you’re running this command to watch for some specific output in a log file: tail -f /some/log/file | grep thing1 | grep thing2 If log lines are being added to the file relatively slowly, the result I’d see is… nothing! It doesn’t matter if there were matches in the lo

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

                                                              • Solving Quantitative Reasoning Problems With Language Models

                                                                Solving Quantitative Reasoning Problems with Language Models Aitor Lewkowycz∗, Anders Andreassen†, David Dohan†, Ethan Dyer†, Henryk Michalewski†, Vinay Ramasesh†, Ambrose Slone, Cem Anil, Imanol Schlag, Theo Gutman-Solo, Yuhuai Wu, Behnam Neyshabur∗, Guy Gur-Ari∗, and Vedant Misra∗ Google Research Abstract Language models have achieved remarkable performance on a wide range of tasks that require

                                                                • Terraform実行ユーザー用の最小権限の原則を支援するPike触ってみた | フューチャー技術ブログ

                                                                  はじめにTIG 真野です。Terraform連載2025の2日目です。 Pikeを触ってみた記事です。 PikeとはPike は James Woolfendenさんによって開発されたTerraformのコードを静的解析し、その terraform apply に必要な最小権限の原則に則ったIAMポリシーを生成するツールです。直接 .tf のコードをスキャンするというところが、良さそうと思ったポイントです。 Terraformを用いてインフラ構築する際には、強めの権限(本来は不要であるサービスの作成権限など)を付与して行うことが多いと思います。そのため、万が一のセキュリティ事故や誤操作で思いがけない結果に繋がる懸念がありました。しかし、最小権限の原則を忠実に守ろうとすると難易度・対応コストが高くなるため、ある程度割り切った運用を採用することが多いように思えます(もちろん、開発時は大きめを許

                                                                    Terraform実行ユーザー用の最小権限の原則を支援するPike触ってみた | フューチャー技術ブログ
                                                                  • The future of 32-bit support in the kernel

                                                                    Welcome to LWN.net The following subscription-only content has been made available to you by an LWN subscriber. Thousands of subscribers depend on LWN for the best news from the Linux and free software communities. If you enjoy this article, please consider subscribing to LWN. Thank you for visiting LWN.net! Arnd Bergmann started his Open Source Summit Europe 2025 talk with a clear statement of po

                                                                    • 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 write a linter using tree-sitter in an hour

                                                                        This article was discussed on Hacker News. This is a continuation of my last post on how to write a tree-sitter grammar in an afternoon. Building on the grammar we wrote, now we’re going to write a linter for Imp, and it’s even easier! The final result clocks in less than 60 SLOC and can be found here. Recall that tree-sitter is an incremental parser generator. That is, you give it a description o

                                                                        • In Praise of dhh

                                                                          In Praise of dhh November 8, 2025 | #tech #politics A reflection on Ruby’s past, present, and future. This is a long essay. I strongly recommend you read it from the beginning, but to help navigate it I have created this table of contents. Prologue The Past How I Learned To Love Ruby A Breath Of Fresh Air A Shared Worldview The Present Tragedy Strikes Recent Conflict In The Community Strength and

                                                                          • 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

                                                                              • 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

                                                                                • A guide to React design patterns - LogRocket Blog

                                                                                  Editor’s note: This guide to React design patterns was last reviewed for accuracy by Isaac Okoro on 12 April 2024. The article was also updated to add four more design patterns, covering prop combination, controlled components, forwardRefs, and conditional rendering. It was previously updated to include information about the render props pattern and state reducer pattern. Check out this article fo

                                                                                    A guide to React design patterns - LogRocket Blog