yokaze.github.io
  • About
  • Software

プログラミング

    • Sep 26, 2018
    • 2018

    clang で初期化されていない変数を使った場合に警告を出す (-Wuninitialized)

    clang で初期化されていない変数を使った場合に警告を出すには、-Wuninitialized オプションを指定します。 // Program 1 #include <stdio.h> int main(void) { int x; printf("%d\n", x); return 0; }
    Read More…
    • Sep 25, 2018
    • 2018

    lldb のコマンドのオプションを読み解く

    lldb のコマンドのヘルプを確認すると、複数の構文が表示されることがあります。 次の例では、ソースコードの情報を取得する source info コマンドについて3つの構
    Read More…
    • Sep 18, 2018
    • 2018

    pybind11 で Python の print 文を使う

    pybind11 の pybind11::print 文を使うと、C++ のプログラム上で Python のオブジェクトの値を表示できます。 sample.cpp #include <pybind11/embed.h>#include <pybind11/pybind11.h> namespace py = pybind11; int main(void) { py::scoped_interpreter interpreter; py::module sys_module = py::module::import("sys"); py::print(sys_module); return 0; } $ # M1 Mac (Ventura) + Python 3.9.6 + pybind11 2.10.3
    Read More…
    • Sep 7, 2018
    • 2018

    clang でループ式が実行されない場合に警告を出す (-Wunreachable-code-loop-increment)

    clang でループ式が実行されない場合に警告を出すには、-Wunreachable-code-loop-increment オプションを指定します。 sample.cpp
    Read More…
    • Apr 12, 2018
    • 2018

    pyscience11 で C++ から SciPy と Matplotlib を使う

    私事ですが、GitHub で pyscience11 というライブラリを公開しています。 このライブラリは Header-Only で、C++ から NumPy, SciPy, Matplotlib を手軽に使うことができます。 動作には pybind11 が
    Read More…
    • Mar 8, 2018
    • 2018

    pybind11 でキーワード引数 (kwargs) を使う

    pybind11 でキーワード引数 (kwargs) を指定するには、pybind11::arg を使います。 sample.cpp #include <pybind11/embed.h>#include <pybind11/pybind11.h> namespace py = pybind11; int main() { // python インタプリタを起動する py::scoped_interpreter interpreter; // numpy の各種オブ
    Read More…
    • Mar 5, 2018
    • 2018

    pybind11 で main モジュール上に関数を定義する

    pybind11 で main モジュール上に関数を定義するには、pybind11::module::def 関数を使います。 次の例では、C++ で定義した hello 関数を Python スク
    Read More…
    • Feb 28, 2018
    • 2018

    二重ポインタの const 早見表

    多重ポインタの const の付け方をまとめました。 まずは普通のポインタから。 int main() { const int* x = new int(0); // ポインタの指す内容を書き換えることができない int* const y = new
    Read More…
    • Feb 24, 2018
    • 2018

    pybind11 上の matplotlib で macosx バックエンドを使う

    macOS 上で matplotlib を立ち上げると、Python is not installed as a framework というエラーが出ることがあります。 この問題は(環境によるのかもしれませんが)以下の方法で再現
    Read More…
    • Feb 12, 2018
    • 2018

    mac に xtensor をインストールする

    xtensor は C++ で多次元配列を扱うためのライブラリです。 このライブラリは Homebrew または Anaconda を使ってインストールすることができます。 Homebrew でインストール Homebrew は mac 環境の
    Read More…
  • Previous
  • Next
LATESTS
k8s のための jq & yq テクニック reduce/entry 編 yq コマンドで Kubernetes の YAML を操作する kind 環境に Grafana をデプロイする kind 環境に Prometheus をデプロイする Sliced Wasserstein GMM を実装してみた TensorFlow 2.0 で混合ガウス分布 (GMM) を推定する 線形位相空間の原点の近傍が併呑集合であることを証明する TensorFlow 2.0 で非負値行列因子分解 (NMF) を解く TensorFlow 2.0 で Variable を ndarray に変換する Monge-Kantorovich の問題を SciPy で解く
CATEGORY
プログラミング 機械学習 写真
AUTHOR
   夜風
 chrofieyue    yokaze
みならい k8s エンジニア / FUJIFILM X-T2 / 登山 / 心理学 / ヤマノススメ / ゆるキャン

© Rue Yokaze  

Powered by Hugo.

Beg designed by Daisuke Tsuji.