Monkey Work Memo2

Saori Yoshimoto work notes since 2018

Thursday, November 19, 2026

[DOS]FFmpeg: Creating a video from a sequence (tested on Win11)

■Installing FFmpeg on Windows

-Install using winget 
  1. Press "Windows key + R" on your keyboard, type "cmd", and open the Command Prompt.
  2. Enter the following command and press the Enter key:
    winget install --id Gyan.FFmpeg -e
  3. Restart the command prompt and check the version to verify that it is working correctly:

    ffmpeg -version
  4. Confirming the installation location:
    where ffmpeg

■Creating a movie from a sequence by FFmpeg

Sunday, November 15, 2026

[VEX] Pick one from the array and remove it. / pop() , removevalue()

1. 配列の「末尾」から順に取り出して削除する場合

配列の末尾を pop() で取り出すと、自動的に配列のサイズが1つずつ縮小するため、最も安全かつ高速な方法です。 [1]
int myarray[] = {10, 20, 30, 40};

// 配列が空になるまでループ
while (len(myarray) > 0) {
    // 末尾の値を取り出して、配列から削除する
    int current_item = pop(myarray);
    
    // ここで取り出した値(current_item)を使った処理を行う
    printf("%d\n", current_item);
}
コードは注意してご使用ください。
2. 配列の「任意の値」を順に取り出して削除する場合
指定した値を配列から検索して削除したい場合は、removevalue() を使用します。 [1]
int myarray[] = {10, 20, 30, 40};
int target_values[] = {20, 40}; // 削除して処理したい値のリスト

// 削除対象の配列の要素数ぶん繰り返す
foreach (int val; target_values) {
    // 値が存在するかチェック
    if (find(myarray, val) != -1) {
        // 値を取り出し(削除)
        removevalue(myarray, val);
        
        // ここで取り出した値(val)を使った処理を行う
        printf("Processed & removed: %d\n", val);
    }
}
コードは注意してご使用ください。

どちらの手法を使うべきか?
  • pop() は配列の順序を気にせず、すべての要素を順番に処理して消し去りたい場合に最適です。
  • removevalue() は「この特定の値を配列から探して処理し、配列からは除外しておきたい」という場合に使えます。

Wednesday, June 26, 2024