並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 40 件 / 45件

新着順 人気順

std array castの検索結果1 - 40 件 / 45件

  • 2023年のコンパイル時レイトレーシング - in neuro

    これは qiita.com の12/16の記事です。やばいもう16日が終わってしまう! はじめに 太古の昔、あるC++プログラマ*1がtemplateの再帰と特殊化を使ってコンパイル時に計算ができることを「発見」*2*3したその日から、C++とコンパイル時計算は分かちがたく結びついています。 言語機能を本来意図されていなかった方法で活用する曲芸的な技巧だったコンパイル時計算は、その強力さを買われコミュニティを席巻し、C++11での constexpr の導入によりある意味で公式に認められたものとなりました。 導入当初は return 文一つだけしか持てなかった constexpr 関数は、それでも三項演算子による条件分岐や再帰によってコンパイル時計算を大いに盛り上げました。 そしてC++14で条件分岐、ループ、変数の書き換えが、C++17ではラムダが、C++20では仮想関数と動的メモリ確保

      2023年のコンパイル時レイトレーシング - in neuro
    • デジタル復調の学習を目的として、ワンセグチューナーで地デジのフルセグTSを抜く - Qiita

      Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article? お詫びと訂正 タイトルにて「ワンセグチューナー」と表記しておりますが、正しくは「ワンセグチューナーの技術を応用したSDR受信機」となります。お詫びして訂正いたします。 本題 さて、茶番はこのあたりにして(今回は使わなかったと言うだけで、本物の「ワンセグチューナー」でもフルセグを受信できるはずなので、あながちタイトが誤っているというわけではないのですが、茶番をやりたいための茶番でした)。 今回はデジタル変調の復調を学習することを目的としているので、それ以外の部分(例えば受信機のハードウェアや、リードソロモン誤り訂正のような情報理論的分野)

        デジタル復調の学習を目的として、ワンセグチューナーで地デジのフルセグTSを抜く - Qiita
      • Extending SQLite with Rust to support Excel files as virtual tables

        This article explains how SQLite can be extended with Rust. In particular, it will outline SQLite’s mechanism called virtual tables and showcase how we can use it from Rust programming language. In the end, we will have a working extension that can be dynamically loaded and used from SQLite. This article does not claim to be an exhaustive guide about extending SQLite with Rust, but I hope the read

        • 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
          • Sorting with SIMD - Blog - Tweede golf

            Google recently published a blog article and paper introducing their SIMD-accelerated sorting algorithm. SIMD stands for single instruction, multiple data. A single instruction is used to apply the same operation to multiple pieces of data. The prototypical example is addition, where one instruction can do e.g. 4 32-bit additions. A single SIMD addition should be roughly 4 times faster than perfor

              Sorting with SIMD - Blog - Tweede golf
            • kyju.org - Piccolo - A Stackless Lua Interpreter

              Piccolo - A Stackless Lua Interpreter 2024-05-01 History of piccolo A "Stackless" Interpreter Design Benefits of Stackless Cancellation Pre-emptive Concurrency Fuel, Pacing, and Custom Scheduling "Symmetric" Coroutines and coroutine.yieldto The "Big Lie" Rust Coroutines, Lua Coroutines, and Snarfing Zooming Out piccolo is an interpreter for the Lua language written in pure, mostly safe Rust with a

              • When Zig is safer and faster than Rust

                3/7/2023 When Zig is safer and faster than Rust There are endless debates online about Rust vs. Zig, this post explores a side of the argument I don't think is mentioned enough. Intro / TLDRλ I was intrigued to learn that the Roc language rewrote their standard library from Rust to Zig. What made Zig the better option? They wrote that they were using a lot of unsafe Rust and it was getting in thei

                • 0.8.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

                  • Pitfalls of Safe Rust | corrode Rust Consulting

                    When people say Rust is a “safe language”, they often mean memory safety. And while memory safety is a great start, it’s far from all it takes to build robust applications. Memory safety is important but not sufficient for overall reliability. In this article, I want to show you a few common gotchas in safe Rust that the compiler doesn’t detect and how to avoid them. Why Rust Can’t Always Help Eve

                      Pitfalls of Safe Rust | corrode Rust Consulting
                    • 配列要素数の取得 in 標準C - yohhoyの日記

                      プログラミング言語Cの次期標準C2yでは、配列要素数を安全に取得する_Countof演算子が導入される。オペランドに配列型を要求すること以外は、構文規則的にsizeof演算子とほぼ同じ。 // C2y int fibs[] = { 1, 1, 2, 3, 5, 8, 13, 21 }; static_assert(_Countof(fibs) == 8); // OK // 標準ヘッダ<stdcountof.h>で定義されるマクロ利用すると // 小文字キーワード風に countof(fibs) と記述可能となる #include <stdcountof.h> static_assert(sizeof(fibs) == countof(fibs) * sizeof(int)); // C2y void func(int data[100]) { // 関数パラメータ部の配列表記 int d

                        配列要素数の取得 in 標準C - yohhoyの日記
                      • 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

                        • Cloudflare functions with Scala.js

                          Indoor VivantsAnton Sviridov. I love reinventing the wheel and I usually use Scala for that. TL;DR We are deploying an app to Cloudflare using Scala.js We are using ScalablyTyped We are using Scala 3 heavily Code on Github Deployed app Cloudflare API bindings Welcome to the "Put ma Scala on yo cloud" series I want to say that I'm kicking off a blog series, but even I don't believe that. If I did,

                          • Rust 1.80を早めに深掘り - あずんひの日

                            本日7/26(金)にリリースされたRust 1.80の変更点を詳しく紹介します。 もしこの記事が参考になれば記事末尾から活動を支援頂けると嬉しいです。 7月25日は蒸気機関車が初めて走った日 ピックアップ 遅延初期化されるグローバル変数を書けるようになった Optionの値を条件を満たしたときだけ取り出せるようになった スライスをパニックなしに分割できるようになった 配列を含むスライスを一次元化できるようになった パターンとして終端の含まれない範囲を使えるようになった useなしにsize_of等が使えるようになった 安定化されたAPIのドキュメント LazyCell サンプル LazyLock サンプル Duration::div_duration_f32 サンプル Duration::div_duration_f64 サンプル Option::take_if サンプル Seek::se

                              Rust 1.80を早めに深掘り - あずんひの日
                            • strongly-typed-thoughts.net

                              Zig; what I think after months of using it What I like Arbitrary sized-integers and packed structs Generic types are just functions at the type level Error Union Types C interop is probably the best The build system is nice What I like less Error handling Shadowing is forbidden Compile-time duck typing No typeclasses / traits comptime is probably not as interesting as it looks No encapsulation Mem

                              • Cloudflare Workers の無料プランで画像を圧縮する

                                Cloudflare Workers の無料プランで画像を圧縮する Next.js のプロジェクトを Cloudflare にデプロイする場合、問題になるのが Vercel が提供している画像の自動圧縮機能です。これを Cloudflare でも実現するためには、Cloudflare Workers が使えそうですが、無料プランでは画像の圧縮機能を提供していません。意地でも無料で実現したいという乞食精神に乗っ取り、画像変換コードを書くことにしました。 画像の変換方法 Cloudflare Workers では、一度のリクエストで処理できる CPU 時間は 10ms です。非同期アクセスの待ち時間は含まれないので、純粋な処理時間です。高速に処理するのならネイティブコードを使うのが一番ですが、もちろん使えません。そこで、WebAssembly を使うことにしました。最近 WebAssembly

                                  Cloudflare Workers の無料プランで画像を圧縮する
                                • V Language Review (2022)

                                  V is a programming language promising to be “Simple, fast, safe, compiled. For developing maintainable software.” V has a controversial past but what is the state of V in 2022? Is V worth checking out? In this post, we’ll take a look at V as it exists in May 2022. TLDR Read the summary Rules of engagement I’ll be using the current version of V built from git which is 50ab2cfd1ae02d4f4280f38c60b8db

                                  • V8 Torque user manual · V8

                                    V8 Torque is a language that allows developers contributing to the V8 project to express changes in the VM by focusing on the intent of their changes to the VM, rather than preoccupying themselves with unrelated implementation details. The language was designed to be simple enough to make it easy to directly translate the ECMAScript specification into an implementation in V8, but powerful enough t

                                    • Trivia About Rust Types: An (Authorized) Transcription of Jon Gjengset's Twitter Thread

                                      Preface (by Jimmy Hartzell) I am a huge fan of Jon Gjengset’s Rust for Rustaceans, an excellent book to bridge the gap between beginner Rust programming skills and becoming a fully-functional member of the Rust community. He’s famous for his YouTube channel as well; I’ve heard good things about it (watching video instruction isn’t really my thing personally). I have also greatly enjoyed his Twitte

                                      • Sayonara, C++, and hello to Rust!

                                        This past May, I started a new job working in Rust. I was somewhat skeptical of Rust for a while, but it turns out, it really is all it’s cracked up to be. As a long-time C++ programmer, and C++ instructor, I am convinced that Rust is better than C++ in all of C++’s application space, that for any new programming project where C++ would make sense as the programming language, Rust would make more

                                        • [C++]WG21月次提案文書を眺める(2022年05月) - 地面を見下ろす少年の足蹴にされる私

                                          文書の一覧 JTC1/SC22/WG21 - Papers 2022 mailing2022-05 全部で36本あります。 N4912 2022-11 Kona hybrid meeting information N4913 PL22.16/WG21 agenda: 25 July 2022, Virtual Meeting P0543R1 Saturation arithmetic P0792R9 function_ref: a non-owning reference to a Callable P0901R9 Size feedback in operator new P1021R6 Filling holes in Class Template Argument Deduction P1255R7 A view of 0 or 1 elements: views::maybe P

                                            [C++]WG21月次提案文書を眺める(2022年05月) - 地面を見下ろす少年の足蹴にされる私
                                          • https://cheats.rs/rust_cheat_sheet.pdf

                                            Rust Language Cheat Sheet 26. August 2021 Contains clickable links to The Book , Rust by Example , Std Docs , Nomicon , Reference . Data Structures Data types and memory locations defined via keywords. Example Explanation struct S {} Define a struct with named fields. struct S { x: T } Define struct with named field x of type T. struct S ​(T); Define "tupled" struct with numbered field .0 of type

                                            • Safer Usage Of C++

                                              Safer Usage Of C++ This document is PUBLIC. Chromium committers can comment on the original doc. If you want to comment but can’t, ping palmer@. Thanks for reading! Google-internal short link: go/safer-cpp Authors/Editors: adetaylor, palmer Contributors: ajgo, danakj, davidben, dcheng, dmitrig, enh, jannh, jdoerrie, joenotcharles, kcc, markbrand, mmoroz, mpdenton, pkasting, rsesek, tsepez, awhalle

                                              • I'm Building a Browser for Reverse Engineers

                                                Preamble In the expanding world of AI my heart still lies in AST transforms, browser fingerprinting, and anti-bot circumvention. In fact, that's the majority of this blog's content. But my workflow always felt... primitive. I was still manually sifting through page scripts, pasting suspicious snippets into an editor, and writing bespoke deobfuscators by hand. Tools like Webcrack and deobfuscate.io

                                                • Why Today’s Python Developers Are Embracing Type Hints | Pyrefly

                                                  Python is one of the most successful programming languages out there, with it recently overtaking Javascript as the most popular language on GitHub, according to the latest GitHub Octoverse report. The report emphasises the popularity of the language in the growing fields of AI, data science and scientific computing - fields where speedy experimentation and iteration are critical, and where develo

                                                    Why Today’s Python Developers Are Embracing Type Hints | Pyrefly
                                                  • Zig 言語リファレンス

                                                    index.md これは Zig ドキュメント 0.10.1 を DeepL Pro と ChatGPT を利用して翻訳したものです。 一部 master なモノもあります、ごちゃ混ぜです 自分用に翻訳しています zig_doc_0.10.1.md Zig 言語リファレンス はじめに Zig は、堅牢で最適かつ再利用可能なソフトウェアを維持するための汎用プログラミング言語およびツールチェインです。 ロバスト メモリ不足などのエッジケースでも正しく動作する。 最適化 プログラムが最適に動作・実行されるように記述する。 再利用可能 同じコードが、制約の異なる多くの環境で動作します。 保守性 コンパイラや他のプログラマに意図を正確に伝えることができる。コードを読むためのオーバーヘッドが少なく、要件や環境の変化に強い言語です。 新しいことを学ぶのに一番効率的な方法は例を見ることであることが多いので

                                                      Zig 言語リファレンス
                                                    • cuneicode, and the Future of Text in C

                                                      Following up from the last post, there is a lot more we need to cover. This was intended to be the post where we talk exclusively about benchmarks and numbers. But, I have unfortunately been perfectly taunted and status-locked, like a monster whose “aggro” was pulled by a tank. The reason, of course, is due to a few folks taking issue with my outright dismissal of the C and C++ APIs (and not showi

                                                        cuneicode, and the Future of Text in C
                                                      • How I learned Vulkan and wrote a small game engine with it

                                                        Comments (GitHub discussion) Comments (Hacker News) tl;dr: I learned some Vulkan and made a game engine with two small game demos in 3 months. The code for the engine and the games can be found here: https://github.com/eliasdaler/edbr This article documents my experience of learning Vulkan and writing a small game/engine with it. It took me around 3 months to do it without any previous knowledge o

                                                        • Rust 1.63を早めに深掘り - あずんひの日

                                                          こんにちは、あずんひ(@aznhe21)です。今月からあずんひの活動を支援できる仕組みを導入してみました。寄付頂ける方は記事末尾からお願いします。 さて、本日8/12(金)にRust 1.63がリリースされました。 この記事ではRust 1.63での変更点を詳しく紹介します。 8/12は最初の「PC」であるIBM 5150が発売された日 ピックアップ スコープ限定スレッドが使えるようになった 関数を使って配列を初期化できるようになった 各種ロック機構が定数文脈で生成できるようになった I/Oの生ハンドルが所有権に基づいて管理できるようになった 安定化されたAPIのドキュメント array::from_fn 引数 サンプル Box::into_pin メモ BinaryHeap::try_reserve エラー サンプル BinaryHeap::try_reserve_exact エラー サ

                                                            Rust 1.63を早めに深掘り - あずんひの日
                                                          • Escaping the Chrome Sandbox Through DevTools

                                                            By ading2210 on 10/16/24 Introduction This blog post details how I found CVE-2024-6778 and CVE-2024-5836, which are vulnerabilities within the Chromium web browser which allowed for a sandbox escape from a browser extension (with a tiny bit of user interaction). Eventually, Google paid me $20,000 for this bug report. In short, these bugs allowed a malicious Chrome extension to run any shell comman

                                                              Escaping the Chrome Sandbox Through DevTools
                                                            • Qiita内のC#erのための有用な記事リファレンス(2012年~) - Qiita

                                                              Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article? PC版での閲覧を推奨。Qiita内右ペインの目次機能を活用してください 個人的まとめ記事 そのうちフルコンプする予定 とにかく手当たり次第にC#を学びたい人向け 古い情報を漁りたい方向け 公開ストックとしても作成予定。 収録した記事には以下の内容を含む → WPF関連, RX,Winform関連,Linq,Unity → その他難解なアルゴリズムやあまり知られていない用語を含む 古い記事なので、現在のC#バージョン(.net 9.0以降)ではより効率よく書き直せる場合が多い。 記事内には若干の誤りを含む可能性がある。 いいねが少ないもの

                                                                Qiita内のC#erのための有用な記事リファレンス(2012年~) - Qiita
                                                              • New C++ features in GCC 12 | Red Hat Developer

                                                                Version 12.1 of the GNU Compiler Collection (GCC) is expected to be released in April 2022. Like every major GCC release, this version will bring many additions, improvements, bug fixes, and new features. GCC 12 is already the system compiler in Fedora 36. GCC 12 will also be available on Red Hat Enterprise Linux in the Red Hat Developer Toolset (version 7) or the Red Hat GCC Toolset (version 8 an

                                                                  New C++ features in GCC 12 | Red Hat Developer
                                                                • Threads and messages with Rust and WebAssembly

                                                                  On most systems, you can implement concurrency using either threads or processes, where the main difference between the two is that threads share memory and processes don’t. Modern web browsers support concurrency through the Web Workers API. Although Web Workers are by default closer to a multi-process model, when used with WebAssembly you can opt-in to a more thread-like experience. Just like in

                                                                    Threads and messages with Rust and WebAssembly
                                                                  • [C++]enumを文字列に変換する汎用的な方法。 - 賢朽脳瘏

                                                                    2021年9月28日追記。どういうわけかアクセス数が増えているので、訪問者を混乱させないよういい加減だったサンプルを作り直した。 enumは単なる整数値に名前を付与する手段の一つだ。パラメータの意味がわかりやすくなる上、処理コストの大きな文字列を使わなくても良い便利な機能である。最近ではenum classの形で使われることが推奨されている。 enum DoW { Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, }; DoW dow = Sunday; int i = (int)dow;//i == 0 ただ例えば標準出力などにその名前の方を出力したいと思っても、ちょっと手間がかかる。enumは本質的にはただの整数値なので、例えばprintfの%sに直接enumを渡すことは出来ない。ネット上に溢れかえっている方

                                                                      [C++]enumを文字列に変換する汎用的な方法。 - 賢朽脳瘏
                                                                    • 地面を見下ろす少年の足蹴にされる私

                                                                      文書の一覧 JTC1/SC22/WG21 - Papers mailing2025-12 全部で113本あります。 もくじ N5011 Brno 2026 N5029 WG21 2025-10 Kona Admin telecon minutes N5031 WG21 2025-11 Kona Minutes of Meeting N5032 Working Draft, Standard for Programming Language C++ N5033 Editors' Report - Programming Languages - C++ P1317R2 Remove return type deduction in std::apply P1789R2 Library Support for Expansion Statements P1789R3 Library Suppor

                                                                        地面を見下ろす少年の足蹴にされる私
                                                                      • 床井研究室 - シェーダとのデータのやりとりサンプルプログラム

                                                                        別に怒ってない 卒業生に、「先生、あの時怒ってたでしょ」って言われることがあります。いや、本当に怒ったことはあるんですけど、たいていは議論しているうちにエキサイトしてきているのを「怒っている」と受け取られるんですね。内心は別に怒ってませんし、議論が終われば平静に戻ります。研究の議論とか、学生さんの提出物に対するレビューなんかは、それなりに真剣にやっているつもりなので、時にはエキサイトしてしまいます。でも別に怒っているわけではありません。それでも、私と議論すると「心を折られる」と言われてしまったのは、私の不徳の致すところなので (パワハラと取られかねませんし) もうちょっと穏便な物言いをしようと思います。昔、MIXI の友達からの紹介文に「笑いながら毒を吐く」と当時の学生さんに書かれてしまいましたから、どこか根性が曲がってるところがあるんでしょうね。学生さん相手でなくても「ブログと印象が違い

                                                                          床井研究室 - シェーダとのデータのやりとりサンプルプログラム
                                                                        • Engineering a fixed-width bit-packed Integer Vector in Rust | Luca Lombardo

                                                                          If you’ve ever worked with massive datasets, you know that memory usage can quickly become a bottleneck. While developing succinct data structures, I found myself needing to store large arrays of integers—values with no monotonicity or other exploitable patterns, that I knew came from a universe much smaller than their type’s theoretical capacity. In this post, we will explore the engineering chal

                                                                            Engineering a fixed-width bit-packed Integer Vector in Rust | Luca Lombardo
                                                                          • const vs constexpr vs consteval vs constinit in C++20

                                                                            As of C++20, we have four keywords beginning with const. What do they all mean? Are they mostly the same? Let’s compare them in this article. const vs constexpr const, our good old fried from the early days of C++ (and also C), can be applied to objects to indicate immutability. This keyword can also be added to non-static member functions, so those functions can be called on const instances of a

                                                                              const vs constexpr vs consteval vs constinit in C++20
                                                                            • Keras のモデルを使って推論できる frugally-deep を試してみた。

                                                                              はじめに C++ ヘッダオンリーのライブラリが大好きなので、しばしば色々なライブラリを探索する趣味があるのですが、frugally-deep というライブラリを見つけたので試してみました。 frugally-deep とは モダンでピュアな C++ で書かれた小さなヘッダーのみのライブラリ 非常に簡単に統合して使うことができる FunctionalPlus、Eigen、json にのみ依存しており、これらもヘッダーオンリー 逐次モデルだけでなく、関数型 API で作成された、より複雑なトポロジー計算グラフの推論(model.predict)もサポート TensorFlow の(小さな)サブセット、つまり予測をサポートするために必要な操作を再実装している TensorFlow をリンクするよりもはるかに小さいバイナリサイズ 32ビットの実行ファイルにコンパイルしても動作 システムの中で最も強

                                                                                Keras のモデルを使って推論できる frugally-deep を試してみた。
                                                                              • From Stacks to Trees: A new aliasing model for Rust

                                                                                Since last fall, Neven has been doing an internship to develop a new aliasing model for Rust: Tree Borrows. Hang on a second, I hear you say – doesn’t Rust already have an aliasing model? Isn’t there this “Stacked Borrows” that Ralf keeps talking about? Indeed there is, but Stacked Borrows is just one proposal for a possible aliasing model – and it has its fair share of problems. The purpose of Tr

                                                                                • exercises

                                                                                  Ziglings Welcome to Ziglings! This project contains a series of tiny broken programs (and one nasty surprise). By fixing them, you'll learn how to read and write Zig code. Those broken programs need your help! (You'll also save the planet from evil aliens and help some friendly elephants stick together, which is very sweet of you.) This project was initiated by Dave Gauer and is directly inspired

                                                                                    exercises