並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 40 件 / 187件

新着順 人気順

python 3 if else syntaxの検索結果1 - 40 件 / 187件

  • 【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問題の攻撃手法まとめ - こんとろーるしーこんとろーるぶい
    • ChatGPT APIを取り巻くライブラリ 〜LangChainとguidanceの紹介 | gihyo.jp

      こんにちは! 逆瀬川(@gyakuse)です! 前回はOpenAIが公開しているChat APIとWhisper APIを用いて議事録文字起こしアプリケーションを作ってみました。今回は、Chat APIを便利に使うためのライブラリであるLangChainとguidanceを紹介していきます。 なぜ便利に使うためのライブラリが必要なのか? 単純にChat APIにリクエストを送るだけであれば、各言語に用意されたライブラリを使うだけで良いでしょう。たとえば、Pythonにおいてはopenai-pythonが用意されています。前回紹介したとおり、Chat APIを使うだけなら以下のようなリクエストを作るだけで済みます。 import openai openai.api_key = "sk-..." # APIキー completion = openai.ChatCompletion.create

        ChatGPT APIを取り巻くライブラリ 〜LangChainとguidanceの紹介 | gihyo.jp
      • Python普及しろ協会に入会したい

        この記事はタナイ氏によるPython滅ぼす協会に入会したいを読んでから執筆したものです。 この記事の趣旨はPython滅ぼす協会に入会したいに対する反論という形をとりながら、タナイ氏により「バカの言語」と揶揄され、「使ってエンジニアを名乗るというのは」「滑稽」とまで言われたPythonの立場を再考することです。 追記 本記事は「Pythonはこれだけ優れた言語だからみんな使おう!」というものではなく「言うほど酷くないと思うよ」程度のものです。 型アノテーションがあるからと言って静的型付けを軽視しているわけでもなければ、map関数をもってmapメソッドを不要だと言っているわけでもありません。 この記法は嫌い〜この記法が好き〜と表明することは個人の自由ですが、同様に「この記法は実はこういう意味があって〜」という意見があればそれを聞いた上で、物事を判断して欲しいです。もちろん、聞いても意見が変わ

          Python普及しろ協会に入会したい
        • Building a tiny Linux from scratch

          Last week, I built a tiny Linux system from scratch, and booted it on my laptop! Here’s what it looked like: Let me tell you how I got there. I wanted to learn more about how the Linux kernel works, and what’s involved in booting it. So I set myself the goal to cobble together the bare neccessities required to boot into a working shell. In the end, I had a tiny Linux system with a size of 2.5 MB,

            Building a tiny Linux from scratch
          • プロと読み解く Ruby 3.1 NEWS - クックパッド開発者ブログ

            技術部の笹田(ko1)と遠藤(mame)です。クックパッドで Ruby (MRI: Matz Ruby Implementation、いわゆる ruby コマンド) の開発をしています。お金をもらって Ruby を開発しているのでプロの Ruby コミッタです。 本日 12/25 に、ついに Ruby 3.1.0 がリリースされました(Ruby 3.1.0 リリース )。今年も Ruby 3.1 の NEWS.md ファイルの解説をします。NEWS ファイルとは何か、は以前の記事を見てください。 プロと読み解く Ruby 2.6 NEWS ファイル - クックパッド開発者ブログ プロと読み解くRuby 2.7 NEWS - クックパッド開発者ブログ プロと読み解くRuby 3.0 NEWS - クックパッド開発者ブログ 本記事は新機能を解説することもさることながら、変更が入った背景や苦労な

              プロと読み解く Ruby 3.1 NEWS - クックパッド開発者ブログ
            • Agentic Coding Recommendations

              written on June 12, 2025 There is currently an explosion of people sharing their experiences with agentic coding. After my last two posts on the topic, I received quite a few questions about my own practices. So, here goes nothing. Preface For all intents and purposes, here’s what I do: I predominently use Claude Code with the cheaper Max subscription for $100 a month 1. That works well for severa

                Agentic Coding Recommendations
              • Claude Codeの指示忘れ問題を解決!HooksでPython環境をpip禁止&uv統一にする

                Claude Codeで開発していると、こんな問題に遭遇しませんか? CLAUDE.mdに「uvを使って」や「uvの具体的な環境構築ガイド」を書いても、ルールを無視してpipを使われてしまう 仮想環境をアクティベートするのを忘れ、Python実行でエラーが頻発する。そして別のActivateされていた環境が汚される 長いやり取りの途中で、AIがプロジェクトのルールを忘れてしまう CLAUDE.mdに詳細な環境構築手順やuvパッケージマネージャーの使用を記載していても、Claude Codeが一貫してそのルールを守ってくれることはなかったです。 しかし、Claude Code Hooksを使うことで、指示忘れの問題を解決できました! この記事では、実際にPython環境のパッケージマネージャーを強制的にuvに統一するためのHooksスクリプトを公開し、Hooksのメリット等を解説します。 例

                  Claude Codeの指示忘れ問題を解決!HooksでPython環境をpip禁止&uv統一にする
                • GPT-5 の新パラメータとツール|npaka

                  以下の記事が面白かったので、簡単にまとめました。 ・GPT-5 New Params and Tools - OpenAI Cookbook 1. verbosity1-1. 概要「verbosity」は、出力トークン数を調節できます。 ・low : 簡潔なUX、簡潔な文章 ・medium (デフォルト) : バランスの取れた詳細 ・high : 詳細な情報。監査、教育、引き継ぎに最適 1-2. verbosityの効果の確認プロンプトを一定に保ったまま、「verbosity」を変更することで、効果を確認できます。 response = client.responses.create( model="gpt-5", input="人生、宇宙、そして万物に関する究極の問いに対する答えは何でしょうか?", text={ "verbosity": "low" } ) print(response

                    GPT-5 の新パラメータとツール|npaka
                  • プロと読み解くRuby 3.4 NEWS - STORES Product Blog

                    プロと読み解くRuby 3.4 NEWS テクノロジー部門技術基盤グループの笹田(ko1)と遠藤(mame)です。Ruby (MRI: Matz Ruby Implementation、いわゆる ruby コマンド) の開発をしています。お金をもらって Ruby を開発しているのでプロの Ruby コミッタです。 本日 12/25 に、恒例のクリスマスリリースとして、Ruby 3.4.0 がリリースされました(Ruby 3.4.0 リリース )。今年も STORES Product Blog にて Ruby 3.4 の NEWS.md ファイルの解説をします(ちなみに、STORES Advent Calendar 2024 の記事になります。他も読んでね)。NEWS ファイルとは何か、は以前の記事を見てください。 プロと読み解く Ruby 2.6 NEWS ファイル - クックパッド開発者

                      プロと読み解くRuby 3.4 NEWS - STORES Product Blog
                    • 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
                      • OOP: the worst thing that happened to programming

                        > BTC: bc1qs0sq7agz5j30qnqz9m60xj4tt8th6aazgw7kxr ETH: 0x1D834755b5e889703930AC9b784CB625B3cd833E USDT(Tron): TPrCq8LxGykQ4as3o1oB8V7x1w2YPU2o5n Ton: UQAtBuFWI3H_LpHfEToil4iYemtfmyzlaJpahM3tFSoxomYQ Doge: D7GMQdKhKC9ymbT9PtcetSFTQjyPRRfkwTdismiss OOP: the worst thing that happened to programming [2/24/2025] In this article, we will try to understand why OOP is the worst thing that happened to prog

                          OOP: the worst thing that happened to programming
                        • 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

                          • Your URL Is Your State

                            Couple of weeks ago when I was publishing The Hidden Cost of URL Design I needed to add SQL syntax highlighting. I headed to PrismJS website trying to remember if it should be added as a plugin or what. I was overwhelmed with the amount of options in the download page so I headed back to my code. I checked the file for PrismJS and at the top of the file, I found a comment containing a URL: /* http

                            • 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
                              • Ruby Parser開発日誌 (1) - かねこにっき

                                Error Tolerant parserに関するアイデア 9月半ばに行われたRubyKaigi 2022以来、3ヶ月くらいError Tolerant parserについて調べたり考えたり実装をしたりしています。 途中でもいいからなにかにアウトプットしておくとよいというアドバイスをもらったので、今現在の状況や考えていることを書いておこうと思います。 Error Tolerant parserとは? どうしてそれが欲しいの? 通常parserはユーザーの入力を受け取り その入力がそのプログラミング言語にとって、validなものか否かをチェック validな場合、その後の工程にとって都合のいいデータ構造(例えばAST)に変換し、後工程に渡す invalidな場合、Syntax Errorをレポートする といった処理を行います。 しかしIDEやLSP(Language Server Proto

                                  Ruby Parser開発日誌 (1) - かねこにっき
                                • 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

                                  • 型安全かつシンプルなAgentフレームワーク「PydanticAI」の実装を解剖する - ABEJA Tech Blog

                                    はじめに こちらはABEJAアドベントカレンダー2024 12日目の記事です。 こんにちは、ABEJAでデータサイエンティストをしている坂元です。最近はLLMでアプローチしようとしていたことがよくよく検証してみるとLLMでは難しいことが分かり急遽CVのあらゆるモデルとレガシーな画像処理をこれでもかというくらい詰め込んだパイプラインを実装することになった案件を経験して、LLMでは難しそうなことをLLM以外のアプローチでこなせるだけの引き出しとスキルはDSとしてやはり身に付けておくべきだなと思うなどしています(LLMにやらせようとしていることは大抵難しいことなので切り替えはそこそこ大変)。 とはいうものの、Agentの普及によってより複雑かつ高度な推論も出来るようになってきています。弊社の社内外のプロジェクト状況を見ていても最近では単純なRAG案件は減りつつあり、計画からアクションの実行、結果

                                      型安全かつシンプルなAgentフレームワーク「PydanticAI」の実装を解剖する - ABEJA Tech Blog
                                    • How to create Skills for Claude: steps and examples | Claude

                                      Skills are custom instructions that extend Claude's capabilities for specific tasks or domains. When you create a skill via a SKILL.md file, you're teaching Claude how to handle specific scenarios more effectively. The power of skills lies in their ability to encode institutional knowledge, standardize outputs, and handle complex multi-step workflows that would otherwise require repeated explanati

                                        How to create Skills for Claude: steps and examples | Claude
                                      • 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
                                        • ISUCON13にLLM活用担当で参戦しました - LayerX エンジニアブログ

                                          こんにちは、LayerX CTOの@y_matsuwitterです。最近はパン作りにハマっています。無心に小麦と酵母の声を聞くことで精神の安寧を求めています。 この記事は LayerXテックアドカレ2023 19日目の記事です。前回は @shota_tech が「Go の linter 雰囲気で使っていたから調べ直した #LayerXテックアドカレ」を書いてくれました。次回はEMオフィスの@serimaより「Engineering Officeの話」がポストされる予定なのでご期待ください。 ISUCON13 昨日開催のISUCONに参加してきました。とても楽しい問題ですし、これだけの人数での開催を支えている運営の皆さんには頭が上がりません。個人でもLayerXとしてもスポンサーさせていただきました。ありがとうございます! 10年近く一緒に出場している.datというチームで、私はプロンプトを

                                            ISUCON13にLLM活用担当で参戦しました - LayerX エンジニアブログ
                                          • Replit — Comparing Code Editors: Ace, CodeMirror and Monaco

                                            EngineeringInfrastructureAce, CodeMirror, and Monaco: A Comparison of the Code Editors You Use in the Browser I’ve been working on Replit for roughly six years now, and as the team has grown, I’ve focused on the IDE (what we call the workspace) portion of the product. Naturally, I was increasingly preoccupied with the code editor. While we’ve considered creating a code editor that meets our needs,

                                              Replit — Comparing Code Editors: Ace, CodeMirror and Monaco
                                            • 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
                                              • Prototyping in Rust | corrode Rust Consulting

                                                Programming is an iterative process. As much as we would like to come up with the perfect solution from the start, it rarely works that way. Good programs often begin as quick prototypes. While many experiments remain prototypes, the best programs can evolve into production code. Whether you’re writing games, CLI tools, or designing library APIs, prototyping helps tremendously in finding the best

                                                  Prototyping in Rust | corrode Rust Consulting
                                                • 2025: The year in LLMs

                                                  31st December 2025 This is the third in my annual series reviewing everything that happened in the LLM space over the past 12 months. For previous years see Stuff we figured out about AI in 2023 and Things we learned about LLMs in 2024. It’s been a year filled with a lot of different trends. The year of “reasoning” The year of agents The year of coding agents and Claude Code The year of LLMs on th

                                                    2025: The year in LLMs
                                                  • Tools: Code Is All You Need

                                                    written on July 03, 2025 If you’ve been following me on Twitter, you know I’m not a big fan of MCP (Model Context Protocol) right now. It’s not that I dislike the idea; I just haven’t found it to work as advertised. In my view, MCP suffers from two major flaws: It isn’t truly composable. Most composition happens through inference. It demands too much context. You must supply significant upfront in

                                                      Tools: Code Is All You Need
                                                    • Data Contractに向けたProtocol Buffersの調査 - yasuhisa's blog

                                                      背景: データ品質を担保するにはデータソースの品質が重要 データソースの品質を担保する手段としてのData Contract Data Contractの表現方法の一つとしてのProtocol Buffers Data ContractとしてProtocol Buffersを使う データの入出力を一箇所に集約、Protocol Buffersで抑えるパターン ストレージのスキーマをProtocol Buffersで抑えるパターン 発展的な話題 & 読書会の案内 参考文献 背景: データ品質を担保するにはデータソースの品質が重要 私はデータエンジニアをしており、DWHやデータマートのデータ品質について考えることが多い。BigQueryなどにデータが取り込まれた後のレイヤリングやテスト、改善に向けたデータ品質の可視化について、以前発表した。 データが取り込まれた後の整理は進んでいるものの、やは

                                                        Data Contractに向けたProtocol Buffersの調査 - yasuhisa's blog
                                                      • Announcing TypeScript 4.8 - TypeScript

                                                        Today we’re excited to announce the release of TypeScript 4.8! If you’re not yet familiar with TypeScript, it’s a language that builds on JavaScript and adds syntax for types. These types let you put your expectations and assumptions into your code, and those assumptions can then be checked by the TypeScript type-checker. This checking can help avoid typos, calling uninitialized values, mixing up

                                                          Announcing TypeScript 4.8 - TypeScript
                                                        • 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)
                                                            • March 2025 (version 1.99)

                                                              Update 1.99.1: The update addresses these security issues. Update 1.99.2: The update addresses these issues. Update 1.99.3: The update addresses these issues. Downloads: Windows: x64 Arm64 | Mac: Universal Intel silicon | Linux: deb rpm tarball Arm snap Welcome to the March 2025 release of Visual Studio Code. There are many updates in this version that we hope you'll like, some of the key highligh

                                                                March 2025 (version 1.99)
                                                              • 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

                                                                • Vibe physics: The AI grad student

                                                                  Can AI do theoretical physics? In this guest post, professor of physics Matthew Schwartz decided to find out by supervising Claude through a real research calculation, start to finish, without ever touching a file himself. His account of what happened is below. SummaryI guided Claude Opus 4.5 through a real theoretical physics calculation, encapsulating the complexity of code and computations behi

                                                                    Vibe physics: The AI grad student
                                                                  • 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

                                                                    • 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
                                                                      • krish's blog • Parsing JSON in 500 lines of Rust

                                                                        Last semester at university, I took a course called "Syntax-Based Tools and Compilers". It focused on building a scanner, parser, compiler, and so on for a language called PL0. We used Python in the course, but I was really interested in learning Rust at the time. So, I decided to embark on a side project (yes, another one!). This time, I wanted to build a JSON parser in Rust. My goal was to test

                                                                          krish's blog • Parsing JSON in 500 lines of Rust
                                                                        • Python is a Compiled Language

                                                                          This blog post hopes to convince you that Python is a compiled language. And by “Python”, I don’t mean alternate versions of Python like PyPy, Mypyc, Numba, Cinder, or even Python-like programming languages like Cython, Codon, Mojo1—I mean the regular Python: CPython! The Python that is probably installed on your computer right now. The Python that you got when you searched “python” on Google and

                                                                          • Xilem: an architecture for UI in Rust

                                                                            Rust is an appealing language for building user interfaces for a variety of reasons, especially the promise of delivering both performance and safety. However, finding a good architecture is challenging. Architectures that work well in other languages generally don’t adapt well to Rust, mostly because they rely on shared mutable state and that is not idiomatic Rust, to put it mildly. It is sometim

                                                                            • 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)
                                                                              • I Made Zig Compute 33 Million Satellite Positions in 3 Seconds. No GPU Required.

                                                                                Update: I've since added multithreading and pushed astroz to 326M propagations/sec. Read the follow-up → I've spent the past month optimizing SGP4 propagation and ended up with something interesting: astroz is now the fastest general purpose SGP4 implementation I'm aware of, hitting 11-13M propagations per second in native Zig and ~7M/s through Python with just pip install astroz. This post breaks

                                                                                  I Made Zig Compute 33 Million Satellite Positions in 3 Seconds. No GPU Required.
                                                                                • 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