並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 20 件 / 20件

新着順 人気順

python if else elif questionsの検索結果1 - 20 件 / 20件

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

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

      俺が考える最強の「麻雀点数申告練習アプリケーション」を作ってみる ~ Pythonによる麻雀点数計算問題の自動生成と音声による点数申告 ~ - エムスリーテックブログ
    • OpenAI API ドキュメント 日本語訳|#2 GET STARTED 後編|ゑぐみかるちゃあ

      OpenAI API ドキュメントの日本語訳をこちらでまとめます。文字量の多いドキュメントなので、セクションごとに記事を分割しています。 今回は「GET STARTED 」のセクションからLibraries 、Models、TutorialsそしてUsage policiesを抜粋した後編です。 基本 DeepLで翻訳して、気になるところだけ書き換えています(ほぼ気になるところがないのが、DeepLのすごいところ)。原文との突き合わせができるようにはじめに原文を入れてますので、間違いなど見つけられましたら、ぜひご指摘ください。ご指摘箇所は随時反映させていただきます。 原文のリンクが有効になってますので、それぞれ必要な場合は原文リンクの方を参照ください。 前回のおさらいはこちら Python library|Python ライブラリWe provide a Python library, w

        OpenAI API ドキュメント 日本語訳|#2 GET STARTED 後編|ゑぐみかるちゃあ
      • ElasticsearchとKibela APIを使ってSlackでのCSお問い合わせ対応業務を改善した話 - BASEプロダクトチームブログ

        この記事はBASE Advent Calendar 2020の11日目の記事です。 devblog.thebase.in BASE株式会社 Data Strategy チームの@tawamuraです。 BASEではオーナーの皆様や購入者様のお問い合わせに対して、Customer Supportチームが主となって対応をしています。その中でもいくつかの技術的なお問い合わせに対しては、以下のようにSlackの専用チャンネルを通して開発エンジニアに質問を投げて回答を作成することになっています。 CSチームから調査を依頼されるお問い合わせの例 これらのCS問い合わせ対応は日々いくつも発生しており、CSお問い合わせ対応を当番制にして運用してみた話 でもあるように週ごとに持ち回り制で各部門のエンジニアが対応しているのですが、どうしても調査や対応に時間が取られてしまうという問題が発生していました。 dev

          ElasticsearchとKibela APIを使ってSlackでのCSお問い合わせ対応業務を改善した話 - BASEプロダクトチームブログ
        • ソースコード & ドキュメントに対応した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)
          • ChatGPT および API統合 のためのMCPサーバ構築|npaka

            以下の記事が面白かったので、簡単にまとめました。 ・Building MCP servers for ChatGPT and API integrations 1. はじめに「MCP」は、AIモデルに追加ツールや知識を拡張するための業界標準となりつつあるオープンプロトコルです。「リモートMCPサーバ」は、インターネット経由でモデルを新しいデータソースや機能に接続するために使用できます。 このガイドでは、プライベートデータソース (ベクターストア) からデータを読み取り、API経由でChatGPTで利用する「リモートMCPサーバ」の構築方法について説明します。 【注意】開発者モードベータ版では、完全なMCPコネクタを構築して使用できます。ProおよびPlusユーザーは、「設定 → コネクタ → 詳細設定 → 開発者モード」を有効化してください。 2. データソースの設定「リモートMCPサーバ

              ChatGPT および API統合 のためのMCPサーバ構築|npaka
            • CohereLabs/c4ai-command-r-plus · Hugging Face

              ","chat_template":[{"name":"default","template":"{{ bos_token }}{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}{% set system_message = messages[0]['content'] %}{% elif false == true %}{% set loop_messages = messages %}{% set system_message = 'You are Command-R, a brilliant, sophisticated, AI-assistant trained to assist human users by providing thorough responses. You

                CohereLabs/c4ai-command-r-plus · Hugging Face
              • Compiling typed Python

                It’s been nine whole years since PEP 484 landed and brought us types from on high. This has made a lot of people very angry and been widely regarded as a bad move1. Since then, people on the internet have been clamoring to find out: does this mean we can now compile Python to native code for more speed? It’s a totally reasonable question. It was one of my first questions when I first started worki

                • The Art and Mathematics of Genji-Kō - OranLooney.com

                  The Art and Mathematics of Genji-Kō by Oran Looney November 26, 2024 Math Visualization History Python You might think it’s unlikely for any interesting mathematics to arise from incense appreciation, but that’s only because you’re unfamiliar with the peculiar character of Muromachi (室町) era Japanese nobles. There has never been a group of people, in any time or place, who were so driven to displa

                  • Agents for Amazon Bedrock now support memory retention and code interpretation (preview) | Amazon Web Services

                    AWS News Blog Agents for Amazon Bedrock now support memory retention and code interpretation (preview) With Agents for Amazon Bedrock, generative artificial intelligence (AI) applications can run multistep tasks across different systems and data sources. A couple of months back, we simplified the creation and configuration of agents. Today, we are introducing in preview two new fully managed capab

                      Agents for Amazon Bedrock now support memory retention and code interpretation (preview) | Amazon Web Services
                    • LangChain Tools を参考に、Googleカレンダーの予定を自然言語で取り出せるエージェントを作成する - Link and Motivation Developers' Blog

                      こんにちは。リンクアンドモチベーション・データユニットの みく / Ryo Koizumi (@slpwalks) です。 ChatGPT、盛り上がっていますよね。 弊社のモチベーションクラウドシリーズにおいても既に ChatGPT API を活用した機能を2つほどリリースさせて頂きました。 まだまだ続々開発中なので、期待して頂ければと思います。 www.lmi.ne.jp www.lmi.ne.jp こちらが弊社リードエンジニア梅原による、ChatGPT連携開発の裏側が見られる資料になります。 speakerdeck.com 今日は先述の機能の裏側で使っている LangChain というライブラリの中から、 LangChain Tools という仕組みを調べる過程をご紹介した上で、OpenAI API を用いてGoogleカレンダーの予定を検索する簡単なエージェントを作成した話をします。

                        LangChain Tools を参考に、Googleカレンダーの予定を自然言語で取り出せるエージェントを作成する - Link and Motivation Developers' Blog
                      • Python behind the scenes #11: how the Python import system works

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

                        • A Deep Dive into eBPF: Writing an Efficient DNS Monitoring.

                          eBPF / XDP is an in-kernel virtual machine, provides a high-level library, instruction set and an execution environment inside the Linux kernel. It’s used in many Linux kernel subsystems, most prominently networking, tracing, debugging and security. Including to modify the processing of packets in the kernel and also allows the programming of network devices such as SmartNICs. Use cases in eBPF im

                            A Deep Dive into eBPF: Writing an Efficient DNS Monitoring.
                          • チャット入力候補モデルを使用する - Azure OpenAI in Azure AI Foundry Models

                            GPT-3.5-Turbo、GPT-4、GPT-4o シリーズのモデルは、会話インターフェイス用に最適化された言語モデルです。 これらのモデルの動作は、以前の GPT-3 モデルとは異なります。 以前のモデルはテキストインとテキストアウトでした。つまり、プロンプト文字列を受け入れ、プロンプトに追加する入力候補を返しました。 一方、最新のモデルは会話入力、メッセージ出力です。これらのモデルでは、特定のチャットのようなトランスクリプト形式で書式設定された入力が想定されています。 彼らは、チャット内でモデルによって生成されたメッセージを表す完了結果を返します。 この形式はマルチターン会話専用に設計されていますが、チャット以外のシナリオにも適しています。 この記事では、チャット補完モデルの使用を開始する方法について説明します。 最適な結果を得るには、ここで説明する手法を使用します。 以前のモデル

                              チャット入力候補モデルを使用する - Azure OpenAI in Azure AI Foundry Models
                            • Zig言語 : Zig言語に遭遇した時のメモ 2021-12

                              Zig言語 : Zig言語に遭遇した時のメモ 2021-12 はじまり Nim言語の作者がZig言語使って何かやってるというフォーラムの書き込みを見たので Zig言語を調べてみた時のメモ 関連ファイル一式 このページで出てくるソースファイルは以下で取得可能です $ git clone --recursive https://github.com/dinau/zigLearn.git 全てのフォルダにMakefileがあるので$ makeコマンドでビルド可能です zig-0.9.0用です zig-0.14.0-dev...用に修正しました (2024/10) Hello world を実行してみる https://zig-play.dev/ フィボナッチ数列 実際に実行してみる (Runボタンを押す) // zig-0.8.1 2021/12 // fib/src/main.zig cons

                              • Python behind the scenes #12: how async/await works in Python

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

                                • Automated Hydroponic System Build – Projects | Kyle Gabriel

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

                                  • PEN-200-2022受講記 & OSCP合格記 - プログラム系統備忘録ブログ

                                    PEN-200-2022コースを受講し、OSCP試験に合格できました。コースや試験の概要、これから取り組む方へのアドバイス、備忘録等の記事です。 なお、本文でも言及しますが、PEN-200コースの内容が改定されたり、OSCP試験の出題範囲が変更されたり、Bonus Pointの取得条件が変更されたりします。受講の際はご自身で最新情報をご確認ください。 分かる人向けの結果概要 PEN-200とは 私の事前知識 PEN-200コース内容やOSCP試験内容、Bonus Point条件の変化 PEN-200-2022からPEN-200-2023への変化 Bonus Pointの獲得条件の変化 OSCP試験のマシン構成の変化 PEN-200コース受講記 Exercise関係 Lab関係 サポート関係 OSCP試験受験記 OSCP試験の申込み proctoringソフトウェアの動作確認 その他受験前の

                                      PEN-200-2022受講記 & OSCP合格記 - プログラム系統備忘録ブログ
                                    • Schedule Amazon RDS stop and start using AWS Lambda | Amazon Web Services

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

                                        Schedule Amazon RDS stop and start using AWS Lambda | Amazon Web Services
                                      • LLMアキネータ対戦環境を作ってみた

                                        実装 コーディング ルールを明確化できたので、上記の仕様でコーディングを行いました。具体的には、下記の手順で実施しました。 人狼ゲーム用に作った汎用LLM応答関数をモジュール化(OpenAI API, Gemini API, Ollama APIに対応) 上記関数の入出力情報と、それ以外の部分の仕様をCalude 3.5 Sonnetに与えてコーディングを依頼 得られたPythonコードを手作業で試行錯誤しながら修正 LLM人狼よりもかなり単純なコードであり、Claudeに依頼してから動かすまでは30分もかからなかったと思います。その後の検証や微調整、キーワードリストの作成の方が何倍も時間かかりました。参考までに、この記事の執筆時点でのmain.pyのソースコードは下記のとおりです(単体では動かないので、プロンプト等の参考程度に見てください)。 main.pyのソースコード import

                                          LLMアキネータ対戦環境を作ってみた
                                        • Following up on the Python JIT

                                          Performance of Python programs has been a major focus of development for the language over the last five years or so; the Faster CPython project has been a big part of that effort. One of its subprojects is to add an experimental just-in-time (JIT) compiler to the language; at last year's PyCon US, project member Brandt Bucher gave an introduction to the copy-and-patch JIT compiler. At PyCon US 20

                                          1