並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 40 件 / 59件

新着順 人気順

python get generator lengthの検索結果1 - 40 件 / 59件

  • OSS 観光名所を貼るスレ - ぽ靴な缶

    これは はてなエンジニアアドベントカレンダー2023 2日目の記事です。 はてなエンジニア Advent Calendar 2023 - Hatena Developer Blog はてなエンジニアのカレンダー | Advent Calendar 2023 - Qiita トップバッターは緊張するけど、順番が回ってくるまで長い間ソワソワするのも嫌、という理由で例年2日目を狙うようにしている id:pokutuna です。今年も成功しました。 観光名所とは 目を閉じれば思い出す、あのコード... あの Issue... あなたが Web 系のエンジニアであれ、趣味で開発している方であれ、必要に応じてライブラリやフレームワークのコードを読むのはよくあることでしょう。公開の場で開発されているソフトウェアは、ソースコードだけでなく、開発コミュニティでの議論やバグ報告なども見ることができます。 リポ

      OSS 観光名所を貼るスレ - ぽ靴な缶
    • 【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問題の攻撃手法まとめ - こんとろーるしーこんとろーるぶい
      • OpenAI API ドキュメント 日本語訳|#1 GET STARTED 前編|Nobue Otsu|地方で老舗パン屋を第三者承継

        OpenAI API ドキュメントの日本語訳をこちらでまとめます。文字量の多いドキュメントなので、セクションごとに記事を分割しています。 今回は「GET STARTED 」のセクションからIntroduction と Quickstart を抜粋した前編です。 基本 DeepLで翻訳して、気になるところだけ書き換えています(ほぼ気になるところがないのが、DeepLのすごいところ)。原文との突き合わせができるようにはじめに原文を入れてますので、間違いなど見つけられましたら、ぜひご指摘ください。ご指摘箇所は随時反映させていただきます。 原文のリンクが有効になってますので、それぞれ必要な場合は原文リンクの方を参照ください。 Introduction|はじめに Overview|概要The OpenAI API can be applied to virtually any task that i

          OpenAI API ドキュメント 日本語訳|#1 GET STARTED 前編|Nobue Otsu|地方で老舗パン屋を第三者承継
        • 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

          • Don't write clean code, write CRISP code — Bitfield Consulting

            I’m sure we’re all in favour of “clean code”, but it’s one of those motherhood-and-apple-pie things that no one can reasonably disagree with. Who wants to write dirty code, unless maybe it’s for a porn site? The problem, of course, is that few of us can agree on what “clean code” means, and how to get there. A rule like “methods should only do one thing”, looks great on a T-shirt, but it’s not so

              Don't write clean code, write CRISP code — Bitfield Consulting
            • 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と限りなく似せる

                • Rustで将棋の局面画像生成、そしてCDN Edgeで動的生成 - すぎゃーんメモ

                  背景 先行・類似事例 自作のメリット Rustで局面画像生成 盤・駒画像の素材 画像処理 入出力 Generatorと下準備 Publish Web Appで使う CDN Edgeで動かす wasm-packでWebAssembly作成 Deno Deploy Vercel Edge Functions Cloudflare Workers Fastly Compute@Edge その他 まとめ Repository 背景 ATrium という AT Protocol のためのライブラリを自作している が、まったくドッグフーディングしていなかった ので、Blueskyに詰将棋の問題を放流するBotを作ってみることにした gfx氏が作ったBot を参考に というわけで、詰将棋の問題の局面を画像で投稿したい が、あまり自分好みの画像を生成できるライブラリやWebサービス等がない ので、結局それ

                    Rustで将棋の局面画像生成、そしてCDN Edgeで動的生成 - すぎゃーんメモ
                  • 【全2回】AWS Lambda x FastAPIによるPythonモダンAPI開発のすゝめ 2 - RAKSUL TechBlog

                    はじめに 対象読者 あまり説明しないこと 前提とするバージョン 参考となるレポジトリ 3. アーキテキチャ及びディレクトリ構造 オニオンアーキテクチャを採用 オニオンアーキテクチャとは 誕生の背景 依存関係逆転の原則の活用 採用理由 参考になった記事 ディレクトリ構造 全体の構成 api schema apiとusecaseの間のデータ構造を提供する役割 schemaはパスオペレーション関数のリクエストとレスポンスの構造を提供する役割 usecase domain infrastructure core container_config exception 参考にしたもの まとめ はじめに ラクスルグループのノバセルで新卒2年目のエンジニアをしています田村(tamtam)です。 第1回では、AWS Lambda x FastAPIによるPythonモダンAPI開発を実現する上で役立つであろ

                      【全2回】AWS Lambda x FastAPIによるPythonモダンAPI開発のすゝめ 2 - RAKSUL TechBlog
                    • NETGEAR社製ルーターにおける認証不要の任意コード実行の技術的解説(PSV-2022-0044) - GMO Flatt Security Blog

                      ※本記事は先立って公開された英語版記事を翻訳し、日本語圏の読者向けに一部改変したものです。 画像出典: https://www.netgear.com/business/wifi/access-points/wac124/ はじめに こんにちは、株式会社Flatt Securityのstypr(@stereotype32)です。 一昨年、日本のOSS製品で発見された0day脆弱性に関する技術解説をブログに書きました。 それ以来、私は様々な製品に多くの脆弱性を発見してきました。残念ながら私が見つけたバグのほとんどはすぐに修正されなかったので、今日まで私が見つけた、技術的に興味深い脆弱性の情報を共有する機会がありませんでした。 本記事では、NETGEAR社のWAC124(AC2000)ルーターにおいて、様々な脆弱性を発見し、いくつかの脆弱性を連鎖させて、前提条件なしに未認証ユーザーの立場からコ

                        NETGEAR社製ルーターにおける認証不要の任意コード実行の技術的解説(PSV-2022-0044) - GMO Flatt Security 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

                        • LINE LLMをMacで動かす - きしだのHatena

                          先日、LINE(現LINEヤフー)のNLP Foundation Devチームから日本語言語モデルが公開されました。(以降LINE LLMと表記します) 36億パラメータの日本語言語モデルを公開しました Instruction Tuningにより対話性能を向上させた3.6B日本語言語モデルを公開します でも「NVIDIAのGPUがないと動かないんでしょ」と、試していない人も多いんではないでしょうか。 そこでこのブログでは、MacでLINE LLMを動かす手順をまとめたいと思います。 Windowsや他のLLMでもほぼ同じ手順で動かせるはずです。 次のような手順で進めます。 pythonインストール ライブラリインストール 1.7Bのサンプルコードを動かす チャットインタフェースで1.7Bを動かす CTranslateによる3.6B llama.cppによる3.6B Pythonインストール

                            LINE LLMをMacで動かす - きしだのHatena
                          • 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 / 西見 公宏
                              • 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)

                                  Version 1.108 is now available! Read about the new features and fixes from December. 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 t

                                    May 2025 (version 1.101)
                                  • Font with Built-In Syntax Highlighting

                                    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 mean not relying on frameworks, generators or 3rd party scripts that modify the DOM). Let's say, I want to make a blog. What are the actual things that prevent me from making—and maintaining—it by hand? What would it take t

                                    • 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
                                        • Node.js — Node.js 24.0.0 (Current)

                                          2025-05-06, Version 24.0.0 (Current), @RafaelGSS and @juanarbol We’re excited to announce the release of Node.js 24! This release brings several significant updates, including the upgrade of the V8 JavaScript engine to version 13.6 and npm to version 11. Starting with Node.js 24, support for MSVC has been removed, and ClangCL is now required to compile Node.js on Windows. The AsyncLocalStorage API

                                            Node.js — Node.js 24.0.0 (Current)
                                          • JavaScript needs more helper functions for iteration (map, filter, etc.) – where should we put them?

                                            JavaScript needs more helper functions for iteration (map, filter, etc.) – where should we put them? Iteration is a standard that connects operations with data containers: Each operation that follows this standard, can be applied to each data container that implements this standard. In this blog post: We first explore three questions: How does JavaScript’s iteration work? What are its quirks? What

                                            • Real-world gen AI use cases from the world's leading organizations | Google Cloud Blog

                                              AI is here, AI is everywhere: Top companies, governments, researchers, and startups are already enhancing their work with Google's AI solutions. Published April 12, 2024; last updated October 9, 2025. Automotive & Logistics Business & Professional Services Financial Services Healthcare & Life Sciences Hospitality & Travel Manufacturing, Industrial & Electronics Media, Marketing & Gaming Public Sec

                                                Real-world gen AI use cases from the world's leading organizations | Google Cloud Blog
                                              • How I Use AI: Meet My Promptly Hired Model Intern

                                                written on January 30, 2025 After Musk’s acquisition of Twitter, many people I respect and follow moved to Bluesky. I created an account there and made an honest attempt of making it my primary platform. Sadly, I found Bluesky to be surprisingly hostile towards AI content. There is an almost religious resistance to AI on there, at least in whatever corner of the platform I ended up in. Despite the

                                                  How I Use AI: Meet My Promptly Hired Model Intern
                                                • 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

                                                    • Shai Hulud Strikes Again (v2) - Socket

                                                      Shai Hulud Strikes Again (v2)Another wave of Shai-Hulud campaign has hit npm with more than 500 packages and 700+ versions affected. Update: November 26, 2025 PostHog has published a detailed post mortem describing how one of its GitHub Actions workflows was abused as an initial access vector for Shai Hulud v2. An attacker briefly opened a pull request that modified a script executed via pull_requ

                                                        Shai Hulud Strikes Again (v2) - Socket
                                                      • 【テスト自動化】APIテストの自動化ツールを調査してみた - RAKUS Developers Blog | ラクス エンジニアブログ

                                                        勤怠サービスの開発チームに所属しているkarabishです。 テストに関するある課題を解決するためにAPIテストの自動化ツールを調査しました。まだチーム内に展開していないのですが、調査結果のうちツールの選定に関する部分を備忘録として残しておこうと思います。 なぜAPIテストを自動化するのか ツールの選定方針 調査したツールたち 調査方法 調査結果 Tavern テストシナリオ テスト実行 scenarigo テストシナリオ テスト実行 runn テストシナリオ テスト実行 karate テストシナリオ テスト実行 stepci テストシナリオ テスト実行 調査しなかったツールたち まとめ なぜAPIテストを自動化するのか 36協定の計算などの負荷が重たい処理はpub/subアーキテクチャを利用して非同期で処理していました。ただ、publish側とsubscribe側それぞれのユニットテスト

                                                          【テスト自動化】APIテストの自動化ツールを調査してみた - RAKUS Developers Blog | ラクス エンジニアブログ
                                                        • 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
                                                          • xvw.lol - Why I chose OCaml as my primary language

                                                            This article is a translation, the original version is available here. I started using the OCaml language regularly around 2012, and since then, my interest and enthusiasm for this language have only grown. It has become my preferred choice for almost all my personal projects, and it has also influenced my professional choices. Since 2014, I have been actively participating in public conferences d

                                                            • Implementing RSA in Python from Scratch

                                                              Implementing RSA in Python from Scratch Build RSA encryption in Python from first principles — key generation, Extended Euclidean Algorithm, and modular exponentiation explained with working code. This is the math that actually runs behind every HTTPS connection you make. I've seen a lot of articles explaining the general principles of asymmetric cryptography, but not many that give easy-to-unders

                                                                Implementing RSA in Python from Scratch
                                                              • 理想の英語アプリが無かったので作った - OpenAI TTS API, Gradio🚀

                                                                はじめに:パーソナライズされた英語リスニング教材の必要性 英語学習、特にリスニング力の向上において、自身の興味やレベルに合致した教材を見つけることは重要な要素です。しかし、市販の教材やオンラインサービスでは、特定のトピックや細かなレベル調整に対応しきれないケースが多くありました。 私自身、特定の専門分野に関する議論を、自身の英語レベルに適した難易度で聞きたいと考えていましたが、既存の教材ではなかなか見つけることができませんでした。 この課題を解決するため、「自分の興味・レベルに合わせて、リスニング教材を生成できるツール」の必要性を感じ、開発に至りました。本記事では、その開発経緯、技術的な実装について共有します。 デモ動画 課題設定:理想的な英語リスニング教材の要件 開発にあたり、理想的なリスニング教材に必要な要件を以下のように定義しました。 トピックの自由度: ユーザーが任意のキーワードを

                                                                  理想の英語アプリが無かったので作った - OpenAI TTS API, Gradio🚀
                                                                • bytecode interpreters for tiny computers ⁑ Dercuano

                                                                  Introduction: Density Is King (With a Tiny VM) I've previously come to the conclusion that there's little reason for using bytecode in the modern world, except in order to get more compact code, for which it can be very effective. So, what kind of a bytecode engine will give you more compact code? Suppose I want a bytecode interpreter for a very small programming environment, specifically to minim

                                                                  • Supercharge SQLite with Ruby functions

                                                                    An interesting twist in my recent usage of SQLite was the fact that I noticed my research scripts and the database intertwine more. SQLite is unique in that it really lives in-process, unlike standalone database servers. There is a feature to that which does not get used very frequently, but can be indispensable in some situations. By the way, the talk about the system that made me me to explore S

                                                                    • Laurence Tratt: Retrofitting JIT Compilers into C Interpreters

                                                                      C interpreters are a common language implementation technique and the basis for the reference implementations of languages such as Lua, Ruby, and Python. Unfortunately, C interpreters are slow, especially compared to language implementations powered by JIT compilers. In this post I’m going to show that it is possible to take C interpreters and, by changing a tiny proportion of code, automatically

                                                                      • The AI-Native Software Engineer

                                                                        An AI-native software engineer is one who deeply integrates AI into their daily workflow, treating it as a partner to amplify their abilities. This requires a fundamental mindset shift. Instead of thinking “AI might replace me” an AI-native engineer asks for every task: “Could AI help me do this faster, better, or differently?”. The mindset is optimistic and proactive - you see AI as a multiplier

                                                                          The AI-Native Software Engineer
                                                                        • Nejumi LLMリーダーボード Neo の LLMベンチマークの使い方|npaka

                                                                          この入門記事は、「Weights & Biases」のご支援により提供されています。Weights & Biases JapanのNoteでは他にも多くの有用な記事が掲載されていますので是非ご覧ください。 1. Nejumi LLMリーダーボード Neo「Nejumi LLMリーダーボード Neo」は、日本語LLMの能力評価ランキングです。「llm-jp-eval」「MT-Bench」という2つのLLMベンチマークで評価します。 2. 評価項目評価項目は、次のとおりです。 2-1. llm-jp-eval「llm-jp-eval」は、一問一答形式の言語理解を評価するベンチマークです。12種類のデータセットを100問ずつ全1200問で正解・不正解 (0 or 1) を評価し、平均値を算出します。 ・NLI (自然言語推論): Jamp(exact), JaNLI(exact), JN

                                                                            Nejumi LLMリーダーボード Neo の LLMベンチマークの使い方|npaka
                                                                          • Ubuntu 24.04 LTS (Noble Numbat) Release Notes

                                                                            Noble Numbat Release Notes Table of Contents Introduction New features in 24.04 LTS Known Issues Official flavours More information Introduction These release notes for Ubuntu 24.04 LTS (Noble Numbat) provide an overview of the release and document the known issues with Ubuntu and its flavours. For details of the changes applied since 24.04, please see the 24.04.2 change summary. Support lifespan

                                                                            • Getting the World Record in HATETRIS

                                                                              Tetris That Hates You StickManStickMan #611, by Sam Hughes. HATETRIS is a version of Tetris written in 2010 by programmer and sci-fi author Sam Hughes. According to his initial description of the game: This is bad Tetris. It’s hateful Tetris. It’s Tetris according to the evil AI from “I Have No Mouth And I Must Scream”. (And if you aren’t familiar with Tetris at all, and don’t know the rules or pi

                                                                              • Breaking CityHash64, MurmurHash2/3, wyhash, and more... | orlp.net

                                                                                Hash functions are incredibly neat mathematical objects. They can map arbitrary data to a small fixed-size output domain such that the mapping is deterministic, yet appears to be random. This “deterministic randomness” is incredibly useful for a variety of purposes, such as hash tables, checksums, monte carlo algorithms, communication-less distributed algorithms, etc, the list goes on. In this art

                                                                                • How To Finetune GPT Like Large Language Models on a Custom Dataset - Lightning AI

                                                                                  ← Back to blog How To Finetune GPT Like Large Language Models on a Custom Dataset Posted on May 19, 2023 by JP Hennessy - Blog, Tutorials Takeaways Learn how to finetune large language models (LLMs) on a custom dataset. We will be using Lit-GPT, an optimized collection of open-source LLMs for finetuning and inference. It supports – LLaMA 2, Falcon, StableLM, Vicuna, LongChat, and a couple of other

                                                                                    How To Finetune GPT Like Large Language Models on a Custom Dataset - Lightning AI