並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 24 件 / 24件

新着順 人気順

python programming if elif elseの検索結果1 - 24 件 / 24件

  • 大実験!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
    • Knuth: The Art of Computer Programming の話 | IIJ Engineers Blog

      2002年から約10年 IIJ技術研究所長. 年を取ってからは古い計算機や昔の計算法に興味が増し, シミュレーターを作ってそのプログラムを書いたり. 近頃はKnuthのTAOCPにあった問題のプログラムなどに挑戦したりしている. 【IIJ 2022 TECHアドベントカレンダー 12/5(月)の記事です】 クリスマスといえば, 英国王立研究所が1825年から続けている「クリスマス講演」が有名で, 岩波文庫にあるFaradayの「ロウソクの科学」はその1860年の講演だ. それに比べればまだ20年くらいだが, スタンフォード大学のKnuth教授も毎年「クリスマス講義」を続けている. しかし今回のブログはそのKnuthによる大著, The Art of Computer Programming(以後TAOCP)が話題である. 上段の左の横積みは, 英語版TAOCPの, 上から第1, 2, 3,

        Knuth: The Art of Computer Programming の話 | IIJ Engineers 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

        • NumPyroによる項目反応理論と垂直尺度化の実装方法を解説。学年をまたいだ学力調査など、異なるテスト結果を正しく比較したい人、必見! - ドワンゴ教育サービス開発者ブログ

          目次 目次 ZEN Studyにおける学力定量化の試みと狙い 項目反応理論とベイズ推定のおさらい NumPyroの概要 NumPyroによるIRTモデルの実装 環境構築 モデル定義と計算実行 人工データの生成 サンプラーの指定とサンプリングの実行 サンプリング結果の確認 事後サンプリングの可視化 ArviZの利用 トレースプロット 自己相関 フォレストプロット 事後予測モデルチェック ベイズ的 $p$ 値 垂直尺度化のためのモデル拡張 多群IRTモデルの実装 固定項目パラメタ法の実装 落ち穂拾い【MCMCの実用上の注意点】 おわりに We are hiring! ZEN Studyにおける学力定量化の試みと狙い こんにちは。ドワンゴ教育事業本部のデータサイエンティストの板宮です。主に学力測定基盤の開発を担当しています。 ドワンゴの教育事業本部では、ZEN Studyと呼ばれる、N高グループ

            NumPyroによる項目反応理論と垂直尺度化の実装方法を解説。学年をまたいだ学力調査など、異なるテスト結果を正しく比較したい人、必見! - ドワンゴ教育サービス開発者ブログ
          • 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
            • 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
              • Fizz Buzz with Cosines - Susam Pal

                Fizz Buzz is a counting game that has become oddly popular in the world of computer programming as a simple test of basic programming skills. The rules of the game are straightforward. Players say the numbers aloud in order beginning with one. Whenever a number is divisible by 3, they say 'Fizz' instead. If it is divisible by 5, they say 'Buzz'. If it is divisible by both 3 and 5, the player says

                • ​Getting Started with Python

                  Python is a powerful programming language that provides many packages that we can use. Using the versatile Python programming language, we can develop the following: AutomationDesktop applicationAndroidWebIoT home automationData Science and the list goes on.In this article, our primary focus will be knowing how to start learning Python and the essentials required to be a data scientist. Below is t

                    ​Getting Started with Python
                  • 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

                    • Dynamic Programming is not Black Magic - Quentin Santos

                      This year’s Advent of Code has been brutal (compare the stats of 2023 with that of 2022, especially day 1 part 1 vs. day 1 part 2). It included a problem to solve with dynamic programming as soon as day 12, which discouraged some people I know. This specific problem was particularly gnarly for Advent of Code, with multiple special cases to take into account, making it basically intractable if you

                        Dynamic Programming is not Black Magic - Quentin Santos
                      • 12 Languages in 12 Months

                        I stumbled across Exercism last year and was immediately charmed. It's a website devoted to teaching programming languages. It's got a great UI, offers free mentoring (by a human!), and is entirely open source. Last January, they announced a new program called 12in23, where they challenged participants to try 12 new programming languages in 2023. Each month would have a theme (such as "Analytical

                          12 Languages in 12 Months
                        • 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.
                          • データサイエンティストとエンジニアがチームプレイでいい感じにプロダクトをつくるためには? - なんちゃってClean Architectureとテストを添えて - Lean Baseball

                            このエントリーを書いてる今日(9/29)と明日で有給消化期間が終わるマンです. 20日間, Banksy展を楽しんだ&新しいメガネを求めて新宿に行った以外, 地元の杉並区〜吉祥寺エリアからほぼ動きませんでした. Stay Home的な意味合いもあるのですが, 10/16(土)にPyCon JP 2021でお話をする事もあり, その準備(と信長の野望*1)に多くの時間を割いていました. PyCon JP 2021からトーク紹介 #pyconjp 「実践Streamlit & Flask - AIプロジェクトのプロトタイピングから本番運用までをいい感じにするPythonicなやりかた」 Web programmingトラックのIntermediate向けトークです。 楽しみですね。チケットはconnpassで発売中!(固定ツイート参照ください)— PyCon JP (@pyconjapan)

                              データサイエンティストとエンジニアがチームプレイでいい感じにプロダクトをつくるためには? - なんちゃってClean Architectureとテストを添えて - Lean Baseball
                            • RWKV-World-V2をPythonから日本語で操作する|shi3z

                              RKWV-World-V2の出来があまりにも良いのでPythonで使う方法をメモっておきます。 基本的にこのGradioの内容をいつものLLMベンチマークの形式にしただけ import os, gc, copy, torch from datetime import datetime from huggingface_hub import hf_hub_download from pynvml import * ctx_limit = 2000 title = "RWKV-5-World-1B5-v2-20231025-ctx4096" os.environ["RWKV_JIT_ON"] = '1' os.environ["RWKV_CUDA_ON"] = '1' # if '1' then use CUDA kernel for seq mode (much faster) from r

                                RWKV-World-V2をPythonから日本語で操作する|shi3z
                              • A from-scratch tour of Bitcoin in Python

                                I find blockchain fascinating because it extends open source software development to open source + state. This seems to be a genuine/exciting innovation in computing paradigms; We don’t just get to share code, we get to share a running computer, and anyone anywhere can use it in an open and permissionless manner. The seeds of this revolution arguably began with Bitcoin, so I became curious to dril

                                • Can GPT-4 *Actually* Write Code?

                                  Since ChatGPT came out I’ve seen quite a lot of people posting about its capability to write code. People have posted about how they had it design and implement a number puzzle game (without realizing that that game it “invented” already exists), how they’ve had it clone pong, and hell I’ve even used it to write a few simple python utility scripts. It’s very capable, and a quite useful tool. But,

                                    Can GPT-4 *Actually* Write Code?
                                  • 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

                                    • JSON is not JSON Across Languages | Dochia CLI Blog

                                      Introduction: These Aren’t the JSONs You’re Looking For JSON (JavaScript Object Notation) was designed as a simple, lightweight, and human-readable data interchange format, often positioned as a more accessible alternative to XML. It has become the de facto standard for web APIs and system integration. However, while the specification itself is straightforward, different programming languages and

                                        JSON is not JSON Across Languages | Dochia CLI Blog
                                      • Exhaustive Union Matching in Python - Preferred Networks Research & Development

                                        Pattern matching on algebraic data types is a powerful technique to process a given input and many programming languages have adopted it in one way or another. A check on whether a given match is “exhaustive”, i.e., covers all possible inputs, is helpful to avoid bugs when the set of possible inputs is extended; for example, when new enumeration values are added. In this blog post I will first bri

                                          Exhaustive Union Matching in Python - Preferred Networks Research & Development
                                        • 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,

                                          • Why F#?

                                            Hacker. Emacs fanatic. Lover of parentheses. Firebrand. Just another programmer with too many opinions. I’m not the best, but I’m pretty good. If someone had told me a few months ago I’d be playing with .NET again after a 15+ years hiatus I probably would have laughed at this.1 Early on in my career I played with .NET and Java, and even though .NET had done some things better than Java (as it had

                                              Why F#?
                                            • Timsort — the fastest sorting algorithm you’ve never heard of

                                              Timsort — the fastest sorting algorithm you’ve never heard of Photo by Andrew Meehan / Unsplash Timsort: A very fast , O(n log n), stable sorting algorithm built for the real world — not constructed in academia. Image from here.Timsort is a sorting algorithm that is efficient for real-world data and not created in an academic laboratory. Tim Peters created Timsort for the Python programming langua

                                                Timsort — the fastest sorting algorithm you’ve never heard of
                                              • 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

                                                • Improving Diffusers Package for High-Quality Image Generation | Towards Data Science

                                                  Overcoming token size limitations, custom model loading, LoRa support, textual inversion support, and more Stable Diffusion WebUI from AUTOMATIC1111 has proven to be a powerful tool for generating high-quality images using the Diffusion model. However, while the WebUI is easy to use, data scientists, machine learning engineers, and researchers often require more control over the image generation p

                                                    Improving Diffusers Package for High-Quality Image Generation | Towards Data Science
                                                  1