並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 40 件 / 76件

新着順 人気順

if else in list generator pythonの検索結果1 - 40 件 / 76件

  • 【2020年】CTF Web問題の攻撃手法まとめ - こんとろーるしーこんとろーるぶい

    はじめに 対象イベント 読み方、使い方 Remote Code Execution(RCE) 親ディレクトリ指定によるopen_basedirのバイパス PHP-FPMのTCPソケット接続によるopen_basedirとdisable_functionsのバイパス JavaのRuntime.execでシェルを実行 Cross-Site Scripting(XSS) nginx環境でHTTPステータスコードが操作できる場合にCSPヘッダーを無効化 GoogleのClosureLibraryサニタイザーのXSS脆弱性 WebのProxy機能を介したService Workerの登録 括弧を使わないXSS /記号を使用せずに遷移先URLを指定 SOME(Same Origin Method Execution)を利用してdocument.writeを順次実行 SQL Injection MySQ

      【2020年】CTF Web問題の攻撃手法まとめ - こんとろーるしーこんとろーるぶい
    • LLMフレームワークのセキュリティリスク - LangChain, Haystack, LlamaIndex等の脆弱性事例に学ぶ - GMO Flatt Security Blog

      はじめに こんにちは。GMO Flatt Security株式会社セキュリティエンジニアの森(@ei01241)です。 近年、大規模言語モデル(LLM)の進化により、チャットボット、データ分析・要約、自律型エージェントなど、多岐にわたるAIアプリケーション開発が進んでいます。LangChainやLlamaIndexのようなLLMフレームワークは、LLM連携や外部データ接続などを抽象化し開発効率を向上させる一方、その利便性の背後には新たなセキュリティリスクも存在します。 本稿では、LLMフレームワークを利用・開発する際に発生しやすい脆弱性を具体的なCVEを交えて解説し、それぞれ脆弱性から教訓を学びます。そして、それらの教訓から開発者が知っておくべき対策案についても紹介します。 また、GMO Flatt SecurityはLLMを活用したアプリケーションに対する脆弱性診断・ペネトレーションテス

        LLMフレームワークのセキュリティリスク - LangChain, Haystack, LlamaIndex等の脆弱性事例に学ぶ - GMO Flatt Security Blog
      • Why, after 6 years, I’m over GraphQL

        GraphQL is an incredible piece of technology that has captured a lot of mindshare since I first started slinging it in production in 2018. You won’t have to look far back on this (rather inactive) blog to see I have previously championed this technology. After building many a React SPA on top of a hodge podge of untyped JSON REST APIs, I found GraphQL a breath of fresh air. I was truly a GraphQL h

        • 俺が考える最強の「麻雀点数申告練習アプリケーション」を作ってみる ~ Pythonによる麻雀点数計算問題の自動生成と音声による点数申告 ~ - エムスリーテックブログ

          こちらはエムスリー Advent Calendar 2023 1日目の記事です。 Overview エムスリーエンジニアリンググループ AI・機械学習チームでソフトウェアエンジニアをしている中村(po3rin) です。趣味は麻雀でフリー雀荘で毎年200半荘以上打ちます。好きな麻雀プロは園田賢さんです。 麻雀を始めるときに一番の障壁になるのは点数計算ではないでしょうか? 特に符計算が初心者の関門のようです。一方私のような初中級者でも突然のレアな点数申告にまごつくことがあります。 そこで、今回はその人に合った麻雀の点数計算問題(主に符計算が焦点となる問題)を生成して、自分で点数計算&点数申告の練習をする方法を探求したのでその紹介をします。麻雀用語が少しだけ登場するので、対象読者は麻雀を少しでもかじったことのあるエンジニアの方です。 Overview 麻雀の点数計算の難しさ 現状の点数計算の練習

            俺が考える最強の「麻雀点数申告練習アプリケーション」を作ってみる ~ Pythonによる麻雀点数計算問題の自動生成と音声による点数申告 ~ - エムスリーテックブログ
          • 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
            • neue cc - Claudia - Anthropic ClaudeのC# SDKと現代的なC#によるウェブAPIクライアントの作り方

              AI関連、競合は現れども、性能的にやはりOpenAI一強なのかなぁというところに現れたAnthropic Claude 3は、確かに明らかに性能がいい、GPT-4を凌駕している……!というわけで大いに気に入った(ついでに最近のOpenAIのムーブが気に入らない)ので、C#で使い倒していきたい!そこで、まずはSDKがないので非公式SDKを作りました。こないだまでプレビュー版を流していたのですが、今回v1.0.0として出します。ライブラリ名は、Claudeだから、Claudiaです!.NET全般で使えるのと、Unity(Runtime/Editor双方)でも動作確認をしているので、アイディア次第で色々活用できると思います。 GitHub - Cysharp/Claudia 今回のSDKを作るにあたっての設計指針の一番目は、公式のPython SDKやTypeScript SDKと限りなく似せる

              • Fish 4.0: The Fish Of Theseus

                About two years ago, our head maintainer @ridiculousfish opened what quickly became our most-read pull request: #9512 - Rewrite it in Rust Truth be told, we did not quite expect that to be as popular as it was. It was written as a bit of an in-joke for the fish developers first, and not really as a press release to be shared far and wide. We didn’t post it anywhere, but other people did, and we go

                • 【Python 3.12】型ヒント機能がいつの間にか進化していたので、慌ててキャッチアップする - ABEJA Tech Blog

                  ABEJA でプロダクト開発を行っている平原です。 先日、バックエンドで使っているGo言語のお勉強しようと「go言語 100Tips ありがちなミスを把握し、実装を最適化する」を読んでいました。その中でinterfaceは(パッケージを公開する側ではなく)受け側で定義するべきという記述を見つけてPythonでも同じことできないかと調べていると(PythonではProtocolを使うとうまくいきそうです。)、どうやら型ヒント機能がかなりアップデートされていることに気づき慌てて再入門しました。(3.7, 3.8あたりで止まってました。。) この記事では、公式ドキュメントを見ながら適当にコードを書き散らし、どの機能はどこまで使えるのか試してみたことをまとめてみました。 docs.python.org 環境 Python: 3.12.1 エディタ: Visual Studio Code Pylan

                    【Python 3.12】型ヒント機能がいつの間にか進化していたので、慌ててキャッチアップする - ABEJA Tech Blog
                  • 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とOpenStreetMapで学ぶ経路システム開発入門 - uepon日々の備忘録

                      前回はGoogle Map APIを使用して開発を行いましたが、今回はOpenStreetMapを使用した似たようなことにチャレンジしてみようと思います。Pythonを使ってOpenStreetMapの経路検索URLを生成する方法ことを目的とします。 参考 uepon.hatenadiary.com オープンストリートマップ(OpenStreetMap)とは? オープンストリートマップ(英語: OpenStreetMap、OSM)は、自由に利用でき、なおかつ編集機能のある世界地図を作るオープンコラボレーションプロジェクトである。GPS機能を持った携帯機器、空中写真、衛星画像、他の地理情報システムからのデータをもとに作られていくのが基本だが、編集ツール上で道1本から手入力での追加も可能である。与えられた画像とベクトルデータセットはオープンデータベースライセンス(ODbL)1.0のもと再利用可

                        【実践】PythonとOpenStreetMapで学ぶ経路システム開発入門 - uepon日々の備忘録
                      • 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

                        • Lessons from Writing a Compiler

                          The prototypical compilers textbook is: 600 pages on parsing theory. Three pages of type-checking a first-order type system like C. Zero pages on storing and checking the correctness of declarations (the “symbol table”). Zero pages on the compilation model, and efficiently implementing separate compilation. 450 pages on optimization and code generation. The standard academic literature is most use

                          • データ検証ライブラリPydanticの紹介 | gihyo.jp

                            寺田 学(@terapyon)です。2025年10月の「Python Monthly Topics」は、データ検証ライブラリのPydanticを紹介します。 型安全とデータ構造 主題のPydanticの説明に入る前に、Pythonにおける型安全の考え方とデータ構造についておさらいしておきます。 型安全のための型ヒント Pythonは動的型付け言語です。型を宣言せずにコーディングすることができますが、型ヒントを書くことで型安全にコーディングできます。最近のPythonコードには型ヒントが書かれていることが多くなっているかと思います。 本連載(Python Monthly Topics)でも過去に型ヒント関係のトピックを扱っていますので、参照してください。 2022年9月:Python最新バージョン対応!より良い型ヒントの書き方 2024年11月:Python型ヒントの動向と新しい機能の紹介

                              データ検証ライブラリPydanticの紹介 | 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
                              • 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
                                • ChatGPT風の画面を表示できるChatbot UIをFastAPIで作成した自作LangChainサーバに接続させる方法|mah_lab / 西見 公宏

                                  ChatGPT風の画面を表示するOSSがいくつか出てきている中で、コードの読みやすさと操作性を比較した上でオススメしたいのが、Next.jsで書かれているChatbot UIというOSSだ。 ローカルでサクッと起動ができ、立ち上がるとこんな画面が表示される。 ChatGPTの画面とうり二つOpenAIのAPI Keyを入力すれば簡単にOpenAIのチャットモデルと接続される。API接続のChatGPTなので、本家のChatGPTよりはやりとりできる文字量が制限されるものの、本家のChatGPTではセンシティブな情報を扱うことができないため、API接続のUIにも価値はある。 ところでこのChatbot UI、ソースコードを読んでみると環境変数でAPI接続先を差し替えることができるようになっている。process.env.OPENAI_API_HOSTの部分だ。 utils/app/const

                                    ChatGPT風の画面を表示できるChatbot UIをFastAPIで作成した自作LangChainサーバに接続させる方法|mah_lab / 西見 公宏
                                  • 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
                                    • The yaml document from hell

                                      written by Ruud van Asseldonk published 11 January 2023 For a data format, yaml is extremely complicated. It aims to be a human-friendly format, but in striving for that it introduces so much complexity, that I would argue it achieves the opposite result. Yaml is full of footguns and its friendliness is deceptive. In this post I want to demonstrate this through an example. This post is a rant, and

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

                                            • May 2025 (version 1.101)

                                              Release date: June 12, 2025 Security update: The following extension has security updates: ms-python.python. Update 1.101.1: The update addresses these issues. Update 1.101.2: The update addresses these issues. Downloads: Windows: x64 Arm64 | Mac: Universal Intel silicon | Linux: deb rpm tarball Arm snap Welcome to the May 2025 release of Visual Studio Code. There are many updates in this version

                                                May 2025 (version 1.101)
                                              • 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
                                                • 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
                                                  • 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

                                                    • 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
                                                      • Pydantic AIで作る!実践Text-to-SQLシステム構築ガイド 〜自然言語によるデータ抽出の自動化で分析業務を効率化〜

                                                        Pydantic AIで作る!実践Text-to-SQLシステム構築ガイド 〜自然言語によるデータ抽出の自動化で分析業務を効率化〜 こんにちは、Ubieでアナリティクスエンジニア/データアナリストをしているmatsu-ryuです。 普段は、Ubieが提供するサービスから得られる様々なデータを活用し、「テクノロジーで人々を適切な医療に案内する」というミッションの実現に向けて取り組んでいます。 皆さんの職場では、こんなやり取りはありませんか? 「先月のカテゴリ別売上トップ3、都道府県別で出せますか?」 「レビュー評価が星1つの商品のリストと、その商品を買ったユーザーのリストをお願いします。」 データドリブンな意思決定が重視される昨今、こうしたデータ抽出・分析の依頼は日常的に発生します。しかし、その裏側では多くの組織が共通の課題を抱えています。 SQLの壁: 分析したい人が必ずしもSQLを書ける

                                                          Pydantic AIで作る!実践Text-to-SQLシステム構築ガイド 〜自然言語によるデータ抽出の自動化で分析業務を効率化〜
                                                        • 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

                                                          • Rustacean のための F# 入門

                                                            また、 F# の decimal 型は Rust には標準で存在しませんが、 5m という書き方をします。 数字の間に _ を入れて読みやすくすることができるのも同様です。 let num = 8_000_000; その他の型について ... F# の char は Rust の char に似ていますが、 前者が UTF-16 なのに対し、 Rust の char は UTF-32 で常に 4bytes です。これは、 Rust とは違い、 char の配列がほぼそのまま string として扱えることを示しています。 Rust の unit と F# の unit は両方とも () で表され、役割も同じです。 文字列型に関しては Rust には色々あるので、簡単な比較はできませんが、 string は immutable な char の配列で、 mutable に扱いたい場合は St

                                                              Rustacean のための F# 入門
                                                            • 0.10.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

                                                              • 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

                                                                • Writing documentation for your house

                                                                  Luke Hsiao published 2023-11-26 updated 2024-12-25 5 min read Have you considered writing technical documentation for your house? As a first time homeowner, there have been numerous times where I wish I had some documentation to reference for a whole slew of scenarios. As an engineer, I write documentation all the time to answer these questions and build up a knowledge base other team members can

                                                                  • 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

                                                                    • Ordering Movie Credits With Graph Theory

                                                                      At Endcrawl we're always thinking about the hard work that goes into making film and TV, and how that work translates to on-screen credits. A feature film may involve thousands of people, hundreds of distinct job titles or "roles," and dozens of departments. So there's plenty for a producer to worry about, like: Did we forget or misspell a name? Is this the correct way to credit that role? Do all

                                                                        Ordering Movie Credits With Graph Theory
                                                                      • Enumerating and analyzing 40+ non-V8 JavaScript implementations | notes.eatonphil.com

                                                                        Enumerating and analyzing 40+ non-V8 JavaScript implementations V8 is, I'm sure, the most used implementation of JavaScript today. Used in Chrome, (and by extension) Microsoft Edge, Node.js, etc. Safari's JavaScriptCore and Firefox's SpiderMonkey are also contenders for extremely mainstream implementations. But what else is out there? What if I want to embed JavaScript in a C program, or a Go prog

                                                                        • 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

                                                                          • Transformer models: an introduction and catalog — 2023 Edition

                                                                            Transformer models: an introduction and catalog — 2023 Edition January 16, 2023 52 minute read This post is now an ArXiV paper that you can print and cite. Update 05/2023 Another pretty large update after 4 months. I was invited to submit the article to a journal, so I decided to enlist some help from some LinkedIn colleages and completely revamp it. First off, we added a whole lot of new models,

                                                                              Transformer models: an introduction and catalog — 2023 Edition
                                                                            • August 2021 (version 1.60)

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

                                                                                August 2021 (version 1.60)
                                                                              • The Curse of Knowing How, or; Fixing Everything | Blog

                                                                                import Banner from "@components/Banner.astro"; It starts innocently. You rename a batch of files with a ten-line Python script, or you alias a common git command to shave off two keystrokes. Maybe you build a small shell function to format JSON from the clipboard. You're not even trying to be clever. You're just solving tiny problems. Making the machine do what it should have done in the first pla

                                                                                • Implementing RSA in Python from Scratch

                                                                                  Photo by Chris Ried / Unsplash I'm sure many programmers, particularly web developers have heard of the RSA cryptography system. RSA is an asymmetric cryptography system, meaning that one key is used for encryption and the other for decryption. I've seen a lot of articles explaining the general principles of asymmetric cryptography, but I have not seen any that give easy-to-understand explanations

                                                                                    Implementing RSA in Python from Scratch