【强化学习】解决gym安装Atari2600环境gym[atari,accept-rom-license] RuntimeError 无法下载Roms的问题

news2024/11/15 23:27:34

先上Roms.tar.gz安装地址:Roms.tar.gz 以下内容是解决问题的思路,如果已经完全知道问题原因可以直接跳过


安装gym[accept-rom-license]时会出现安装失败的情况:
先是卡在:Building wheel for AutoROM.accept-rom-license
在这里插入图片描述
然后是显示安装失败:

RuntimeError:erminating attempt to download ROMs after 180 seconds, this has failed, please report it.

在这里插入图片描述

根据github上查的解决方法GitHub:
使用 --verbose 查看具体安装时参数

pip install gym[accept-rom-license] --verbose

发现是卡在了running install_scripts
在这里插入图片描述然后在下面的一个回答建议直接使用autorom安装
在这里插入图片描述
在这里插入图片描述
打开AutoRom的github地址:AutoROM
执行命令:

pip install autorom
AutoROM --accept-license

在这里插入图片描述

我去,还是下不动,完全是0bits。。。。。。。
查看其代码(src/AutoROM.py)

#!/usr/bin/env python3
import hashlib
import io
import os
import pathlib
import sys
import tarfile
import time
import warnings

import click
import requests

if os.name == "nt":
    try:
        import libtorrent as lt
    except ImportError as e:
        raise ImportError(
            "It seems that you are trying to install the Atari ROMs on Windows. While this is not supported, the DLL error can be solved by installing the OpenSSL DLLs from: https://slproweb.com/products/Win32OpenSSL.html"
        ) from e
else:
    import libtorrent as lt

from collections import namedtuple
from typing import Dict

if sys.version_info < (3, 9):
    import importlib_resources as resources
else:
    import importlib.resources as resources

CHECKSUM_MAP: Dict[str, str] = {
    "4b27f5397c442d25f0c418ccdacf1926": "adventure",
    "35be55426c1fec32dfb503b4f0651572": "air_raid",
    "f1a0a23e6464d954e3a9579c4ccd01c8": "alien",
    "acb7750b4d0c4bd34969802a7deb2990": "amidar",
    "de78b3a064d374390ac0710f95edde92": "assault",
    "89a68746eff7f266bbf08de2483abe55": "asterix",
    "ccbd36746ed4525821a8083b0d6d2c2c": "asteroids",
    "826481f6fc53ea47c9f272f7050eedf7": "atlantis2",
    "9ad36e699ef6f45d9eb6c4cf90475c9f": "atlantis",
    "8556b42aa05f94bc29ff39c39b11bff4": "backgammon",
    "00ce0bdd43aed84a983bef38fe7f5ee3": "bank_heist",
    "819aeeb9a2e11deb54e6de334f843894": "basic_math",
    "41f252a66c6301f1e8ab3612c19bc5d4": "battle_zone",
    "79ab4123a83dc11d468fb2108ea09e2e": "beam_rider",
    "136f75c4dd02c29283752b7e5799f978": "berzerk",
    "0a981c03204ac2b278ba392674682560": "blackjack",
    "c9b7afad3bfd922e006a6bfc1d4f3fe7": "bowling",
    "c3ef5c4653212088eda54dc91d787870": "boxing",
    "f34f08e5eb96e500e851a80be3277a56": "breakout",
    "028024fb8e5e5f18ea586652f9799c96": "carnival",
    "b816296311019ab69a21cb9e9e235d12": "casino",
    "91c2098e88a6b13f977af8c003e0bca5": "centipede",
    "c1cb228470a87beb5f36e90ac745da26": "chopper_command",
    "0ef64cdbecccb7049752a3de0b7ade14": "combat",
    "55ef7b65066428367844342ed59f956c": "crazy_climber",
    "8cd26dcf249456fe4aeb8db42d49df74": "crossbow",
    "106855474c69d08c8ffa308d47337269": "darkchambers",
    "0f643c34e40e3f1daafd9c524d3ffe64": "defender",
    "f0e0addc07971561ab80d9abe1b8d333": "demon_attack",
    "36b20c427975760cb9cf4a47e41369e4": "donkey_kong",
    "368d88a6c071caba60b4f778615aae94": "double_dunk",
    "5aea9974b975a6a844e6df10d2b861c4": "earthworld",
    "71f8bacfbdca019113f3f0801849057e": "elevator_action",
    "94b92a882f6dbaa6993a46e2dcc58402": "enduro",
    "6b683be69f92958abe0e2a9945157ad5": "entombed",
    "615a3bf251a38eb6638cdc7ffbde5480": "et",
    "b8865f05676e64f3bec72b9defdacfa7": "fishing_derby",
    "30512e0e83903fc05541d2f6a6a62654": "flag_capture",
    "8e0ab801b1705a740b476b7f588c6d16": "freeway",
    "081e2c114c9c20b61acf25fc95c71bf4": "frogger",
    "4ca73eb959299471788f0b685c3ba0b5": "frostbite",
    "211774f4c5739042618be8ff67351177": "galaxian",
    "c16c79aad6272baffb8aae9a7fff0864": "gopher",
    "8ac18076d01a6b63acf6e2cab4968940": "gravitar",
    "f16c709df0a6c52f47ff52b9d95b7d8d": "hangman",
    "f0a6e99f5875891246c3dbecbf2d2cea": "haunted_house",
    "fca4a5be1251927027f2c24774a02160": "hero",
    "7972e5101fa548b952d852db24ad6060": "human_cannonball",
    "a4c08c4994eb9d24fb78be1793e82e26": "ice_hockey",
    "e51030251e440cffaab1ac63438b44ae": "jamesbond",
    "718ae62c70af4e5fd8e932fee216948a": "journey_escape",
    "3276c777cbe97cdd2b4a63ffc16b7151": "joust",
    "5428cdfada281c569c74c7308c7f2c26": "kaboom",
    "4326edb70ff20d0ee5ba58fa5cb09d60": "kangaroo",
    "6c1f3f2e359dbf55df462ccbcdd2f6bf": "keystone_kapers",
    "0dd4c69b5f9a7ae96a7a08329496779a": "king_kong",
    "eed9eaf1a0b6a2b9bc4c8032cb43e3fb": "klax",
    "534e23210dd1993c828d944c6ac4d9fb": "koolaid",
    "4baada22435320d185c95b7dd2bcdb24": "krull",
    "5b92a93b23523ff16e2789b820e2a4c5": "kung_fu_master",
    "8e4cd60d93fcde8065c1a2b972a26377": "laser_gates",
    "2d76c5d1aad506442b9e9fb67765e051": "lost_luggage",
    "e908611d99890733be31733a979c62d8": "mario_bros",
    "ed2218b3075d15eaa34e3356025ccca3": "maze_craze",
    "df62a658496ac98a3aa4a6ee5719c251": "miniature_golf",
    "3347a6dd59049b15a38394aa2dafa585": "montezuma_revenge",
    "aa7bb54d2c189a31bb1fa20099e42859": "mr_do",
    "87e79cd41ce136fd4f72cc6e2c161bee": "ms_pacman",
    "36306070f0c90a72461551a7a4f3a209": "name_this_game",
    "113cd09c9771ac278544b7e90efe7df2": "othello",
    "fc2233fc116faef0d3c31541717ca2db": "pacman",
    "7e52a95074a66640fcfde124fffd491a": "phoenix",
    "6d842c96d5a01967be9680080dd5be54": "pitfall2",
    "3e90cf23106f2e08b2781e41299de556": "pitfall",
    "60e0ea3cbe0913d39803477945e9e5ec": "pong",
    "4799a40b6e889370b7ee55c17ba65141": "pooyan",
    "ef3a4f64b6494ba770862768caf04b86": "private_eye",
    "484b0076816a104875e00467d431c2d2": "qbert",
    "393948436d1f4cc3192410bb918f9724": "riverraid",
    "ce5cc62608be2cd3ed8abd844efb8919": "road_runner",
    "4f618c2429138e0280969193ed6c107e": "robotank",
    "240bfbac5163af4df5ae713985386f92": "seaquest",
    "dd0cbe5351551a538414fb9e37fc56e8": "sir_lancelot",
    "b76fbadc8ffb1f83e2ca08b6fb4d6c9f": "skiing",
    "e72eb8d4410152bdcb69e7fba327b420": "solaris",
    "72ffbef6504b75e69ee1045af9075f66": "space_invaders",
    "b702641d698c60bcdc922dbd8c9dd49c": "space_war",
    "a3c1c70024d7aabb41381adbfb6d3b25": "star_gunner",
    "a9531c763077464307086ec9a1fd057d": "superman",
    "4d7517ae69f95cfbc053be01312b7dba": "surround",
    "42cdd6a9e42a3639e190722b8ea3fc51": "tennis",
    "b0e1ee07fbc73493eac5651a52f90f00": "tetris",
    "0db4f4150fecf77e4ce72ca4d04c052f": "tic_tac_toe_3d",
    "fc2104dd2dadf9a6176c1c1c8f87ced9": "time_pilot",
    "fb27afe896e7c928089307b32e5642ee": "trondead",
    "7a5463545dfb2dcfdafa6074b2f2c15e": "turmoil",
    "085322bae40d904f53bdcc56df0593fc": "tutankham",
    "a499d720e7ee35c62424de882a3351b6": "up_n_down",
    "3e899eba0ca8cd2972da1ae5479b4f0d": "venture",
    "539d26b6e9df0da8e7465f0f5ad863b7": "video_checkers",
    "f0b7db930ca0e548c41a97160b9f6275": "video_chess",
    "3f540a30fdee0b20aed7288e4a5ea528": "video_cube",
    "107cc025334211e6d29da0b6be46aec7": "video_pinball",
    "cbe5a166550a8129a5e6d374901dffad": "warlords",
    "7e8aa18bc9502eb57daaf5e7c1e94da7": "wizard_of_wor",
    "ec3beb6d8b5689e867bafb5d5f507491": "word_zapper",
    "c5930d0e8cdae3e037349bfa08e871be": "yars_revenge",
    "eea0da9b987d661264cce69a7c13c3bd": "zaxxon",
}


status_meaning = {
    1: "checking files",
    2: "downloading metadata",
    3: "download",
    4: "finished",
    5: "seeding",
    6: "error, please report",
    7: "checking resumedata",
}


def torrent_tar():
    # specify the save path
    save_path = os.path.dirname(__file__)
    save_file = os.path.join(save_path, "./Roms.tar.gz")

    # magnet uri
    uri = "magnet:?xt=urn:btih:a606d1dabf28e794cbc0f88f10d0b8225dc854b4&dn=Roms.tar.gz&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce&tr=http%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce&tr=udp%3A%2F%2F9.rarbg.com%3A2810%2Fannounce&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A6969%2Fannounce&tr=http%3A%2F%2Ftracker.openbittorrent.com%3A80%2Fannounce&tr=udp%3A%2F%2Fopentracker.i2p.rocks%3A6969%2Fannounce&tr=https%3A%2F%2Fopentracker.i2p.rocks%3A443%2Fannounce&tr=udp%3A%2F%2Fopen.stealth.si%3A80%2Fannounce&tr=udp%3A%2F%2Ftracker.torrent.eu.org%3A451%2Fannounce&tr=udp%3A%2F%2Ftracker2.dler.org%3A80%2Fannounce&tr=udp%3A%2F%2Ftracker.tiny-vps.com%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.moeking.me%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.dler.org%3A6969%2Fannounce&tr=udp%3A%2F%2Fpublic.tracker.vraphim.com%3A6969%2Fannounce&tr=udp%3A%2F%2Fp4p.arenabg.com%3A1337%2Fannounce&tr=udp%3A%2F%2Fopen.demonii.com%3A1337%2Fannounce&tr=udp%3A%2F%2Fmovies.zsw.ca%3A6969%2Fannounce&tr=udp%3A%2F%2Fipv4.tracker.harry.lu%3A80%2Fannounce&tr=udp%3A%2F%2Ffe.dealclub.de%3A6969%2Fannounce&tr=udp%3A%2F%2Fexplodie.org%3A6969%2Fannounce&tr=udp%3A%2F%2Fexodus.desync.com%3A6969%2Fannounce&tr=udp%3A%2F%2Fbt2.archive.org%3A6969%2Fannounce&tr=udp%3A%2F%2Fbt1.archive.org%3A6969%2Fannounce&tr=udp%3A%2F%2F6ahddutb1ucc3cp.ru%3A6969%2Fannounce&tr=https%3A%2F%2Ftracker.nanoha.org%3A443%2Fannounce&tr=https%3A%2F%2Ftracker.lilithraws.org%3A443%2Fannounce&tr=https%3A%2F%2Ftr.burnabyhighstar.com%3A443%2Fannounce&tr=http%3A%2F%2Fvps02.net.orel.ru%3A80%2Fannounce&tr=http%3A%2F%2Ftracker2.dler.org%3A80%2Fannounce&tr=http%3A%2F%2Ftracker.mywaifu.best%3A6969%2Fannounce&tr=http%3A%2F%2Ftracker.files.fm%3A6969%2Fannounce&tr=http%3A%2F%2Ftracker.dler.org%3A6969%2Fannounce&tr=http%3A%2F%2Ft.overflow.biz%3A6969%2Fannounce&tr=udp%3A%2F%2Fzecircle.xyz%3A6969%2Fannounce&tr=udp%3A%2F%2Fyahor.ftp.sh%3A6969%2Fannounce&tr=udp%3A%2F%2Fvibe.sleepyinternetfun.xyz%3A1738%2Fannounce&tr=udp%3A%2F%2Fuploads.gamecoast.net%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker1.bt.moack.co.kr%3A80%2Fannounce&tr=udp%3A%2F%2Ftracker.theoks.net%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.tcp.exchange%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.swateam.org.uk%3A2710%2Fannounce&tr=udp%3A%2F%2Ftracker.srv00.com%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.skyts.net%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.publictracker.xyz%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.pomf.se%3A80%2Fannounce&tr=udp%3A%2F%2Ftracker.openbtba.com%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.monitorit4.me%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.lelux.fi%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.leech.ie%3A1337%2Fannounce&tr=udp%3A%2F%2Ftracker.joybomb.tw%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.jonaslsa.com%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.filemail.com%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.ddunlimited.net%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.bitsearch.to%3A1337%2Fannounce&tr=udp%3A%2F%2Ftracker.auctor.tv%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.artixlinux.org%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.army%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.altrosky.nl%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.4.babico.name.tr%3A3131%2Fannounce&tr=udp%3A%2F%2Ftracker-udp.gbitt.info%3A80%2Fannounce&tr=udp%3A%2F%2Ftorrents.artixlinux.org%3A6969%2Fannounce&tr=udp%3A%2F%2Ftorrentclub.space%3A6969%2Fannounce&tr=udp%3A%2F%2Fthouvenin.cloud%3A6969%2Fannounce&tr=udp%3A%2F%2Ftamas3.ynh.fr%3A6969%2Fannounce&tr=udp%3A%2F%2Fsmtp-relay.odysseylabel.com.au%3A6969%2Fannounce&tr=udp%3A%2F%2Fsanincode.com%3A6969%2Fannounce&tr=udp%3A%2F%2Frun.publictracker.xyz%3A6969%2Fannounce&tr=udp%3A%2F%2Frun-2.publictracker.xyz%3A6969%2Fannounce&tr=udp%3A%2F%2Frep-art.ynh.fr%3A6969%2Fannounce&tr=udp%3A%2F%2Frekcart.duckdns.org%3A15480%2Fannounce&tr=udp%3A%2F%2Fqtstm32fan.ru%3A6969%2Fannounce&tr=udp%3A%2F%2Fpublic.publictracker.xyz%3A6969%2Fannounce&tr=udp%3A%2F%2Fpsyco.fr%3A6969%2Fannounce&tr=udp%3A%2F%2Fopen.tracker.ink%3A6969%2Fannounce&tr=udp%3A%2F%2Fopen.free-tracker.ga%3A6969%2Fannounce&tr=udp%3A%2F%2Fopen.dstud.io%3A6969%2Fannounce&tr=udp%3A%2F%2Fnew-line.net%3A6969%2Fannounce&tr=udp%3A%2F%2Fmoonburrow.club%3A6969%2Fannounce&tr=udp%3A%2F%2Fmirror.aptus.co.tz%3A6969%2Fannounce&tr=udp%3A%2F%2Fmail.zasaonsk.ga%3A6969%2Fannounce&tr=udp%3A%2F%2Fmail.artixlinux.org%3A6969%2Fannounce&tr=udp%3A%2F%2Fmadiator.com%3A6969%2Fannounce&tr=udp%3A%2F%2Fleefafa.tk%3A6969%2Fannounce&tr=udp%3A%2F%2Flaze.cc%3A6969%2Fannounce&tr=udp%3A%2F%2Fkokodayo.site%3A6969%2Fannounce&tr=udp%3A%2F%2Fkeke.re%3A6969%2Fannounce&tr=udp%3A%2F%2Fhtz3.noho.st%3A6969%2Fannounce&tr=udp%3A%2F%2Ffh2.cmp-gaming.com%3A6969%2Fannounce&tr=udp%3A%2F%2Ff1sh.de%3A6969%2Fannounce&tr=udp%3A%2F%2Fepider.me%3A6969%2Fannounce&tr=udp%3A%2F%2Felementsbrowser.com%3A6969%2Fannounce&tr=udp%3A%2F%2Fdownload.nerocloud.me%3A6969%2Fannounce&tr=udp%3A%2F%2Fcutscloud.duckdns.org%3A6969%2Fannounce&tr=udp%3A%2F%2Fconcen.org%3A6969%2Fannounce&tr=udp%3A%2F%2Fchouchou.top%3A8080%2Fannounce&tr=udp%3A%2F%2Fcarr.codes%3A6969%2Fannounce&tr=udp%3A%2F%2Fcamera.lei001.com%3A6969%2Fannounce&tr=udp%3A%2F%2Fbuddyfly.top%3A6969%2Fannounce&tr=udp%3A%2F%2Fbubu.mapfactor.com%3A6969%2Fannounce&tr=udp%3A%2F%2Fbt.ktrackers.com%3A6666%2Fannounce&tr=udp%3A%2F%2Fblack-bird.ynh.fr%3A6969%2Fannounce&tr=udp%3A%2F%2Fben.kerbertools.xyz%3A6969%2Fannounce&tr=udp%3A%2F%2Fbananas.space%3A6969%2Fannounce&tr=udp%3A%2F%2Fastrr.ru%3A6969%2Fannounce&tr=udp%3A%2F%2Fapp.icon256.com%3A8000%2Fannounce&tr=udp%3A%2F%2Fadmin.videoenpoche.info%3A6969%2Fannounce&tr=udp%3A%2F%2Fadmin.52ywp.com%3A6969%2Fannounce&tr=udp%3A%2F%2Faarsen.me%3A6969%2Fannounce&tr=udp%3A%2F%2F960303.xyz%3A6969%2Fannounce&tr=https%3A%2F%2Fxtremex.herokuapp.com%3A443%2Fannounce&tr=https%3A%2F%2Ftracker2.ctix.cn%3A443%2Fannounce&tr=https%3A%2F%2Ftracker1.520.jp%3A443%2Fannounce&tr=https%3A%2F%2Ftracker.tamersunion.org%3A443%2Fannounce&tr=https%3A%2F%2Ftracker.kuroy.me%3A443%2Fannounce&tr=https%3A%2F%2Ftracker.gbitt.info%3A443%2Fannounce&tr=https%3A%2F%2Ftracker.foreverpirates.co%3A443%2Fannounce&tr=https%3A%2F%2Ftracker.expli.top%3A443%2Fannounce&tr=https%3A%2F%2Ftr.abir.ga%3A443%2Fannounce&tr=https%3A%2F%2Ftr.abiir.top%3A443%2Fannounce&tr=https%3A%2F%2F1337.abcvg.info%3A443%2Fannounce&tr=http%3A%2F%2Fwepzone.net%3A6969%2Fannounce&tr=http%3A%2F%2Ftracker4.itzmx.com%3A2710%2Fannounce&tr=http%3A%2F%2Ftracker3.itzmx.com%3A6961%2Fannounce&tr=http%3A%2F%2Ftracker3.ctix.cn%3A8080%2Fannounce&tr=http%3A%2F%2Ftracker1.itzmx.com%3A8080%2Fannounce&tr=http%3A%2F%2Ftracker1.bt.moack.co.kr%3A80%2Fannounce&tr=http%3A%2F%2Ftracker.skyts.net%3A6969%2Fannounce&tr=http%3A%2F%2Ftracker.lelux.fi%3A80%2Fannounce&tr=http%3A%2F%2Ftracker.gbitt.info%3A80%2Fannounce&tr=http%3A%2F%2Ftracker.edkj.club%3A6969%2Fannounce&tr=http%3A%2F%2Ftracker.bt4g.com%3A2095%2Fannounce&tr=http%3A%2F%2Ftorrenttracker.nwc.acsalaska.net%3A6969%2Fannounce&tr=http%3A%2F%2Ft.acg.rip%3A6699%2Fannounce&tr=http%3A%2F%2Fopen.tracker.ink%3A6969%2Fannounce&tr=http%3A%2F%2Fopen.acgnxtracker.com%3A80%2Fannounce&tr=http%3A%2F%2Fjp.moeweb.pw%3A6969%2Fannounce&tr=http%3A%2F%2Fincine.ru%3A6969%2Fannounce&tr=http%3A%2F%2Ffxtt.ru%3A80%2Fannounce&tr=http%3A%2F%2Fbt.okmp3.ru%3A2710%2Fannounce&tr=http%3A%2F%2F1337.abcvg.info%3A80%2Fannounce"

    # libtorrent params
    ses = lt.session()
    params = lt.parse_magnet_uri(uri)
    params.save_path = save_path
    handle: lt.torrent_handle = ses.add_torrent(params)

    # download roms as long as state is not seeding
    timeit = 0
    while handle.status().state not in {4, 5}:
        if timeit >= 360:
            raise RuntimeError(
                "Terminating attempt to download ROMs after 180 seconds, this has failed, please report it."
            )

        if timeit % 5 == 0:
            if timeit >= 180:
                print(
                    "Have been attempting to download for more than 180 seconds, consider terminating?",
                    file=sys.stderr,
                )

            status: lt.torrent_status = handle.status()
            print(
                f"time={timeit} / 180 seconds - Trying to download atari roms\n"
                f"\tcurrent status={status_meaning.get(status.state, 'unknown')} ({status.state})\n"
                f"\ttotal downloaded bytes={status.total_download}\n"
                f"\ttotal payload download={status.total_payload_download}\n"
                f"\ttotal failed bytes={status.total_failed_bytes}",
                file=sys.stderr,
            )

        # some sleep helps
        time.sleep(1.0)
        timeit += 1

    # seed for 20 seconds to help the network
    if handle.status().state in {4, 5}:
        print(
            "Download complete, seeding for 20 seconds to assist torrent network.",
            file=sys.stderr,
        )
        time.sleep(20.0)
        print("Seeding completed.", file=sys.stderr)

    return save_file


def verify_installation(package, checksum_keys):
    for file in os.listdir(package):
        if not file.endswith(".bin"):
            continue

        rom_path = os.path.join(package, file)
        hash = hashlib.md5(open(rom_path, "rb").read()).hexdigest()

        if not hash in checksum_keys:
            return False

        checksum_keys.remove(hash)

    return len(checksum_keys) == 0


# Extract each valid ROM into each dir in installation_dirs
def extract_roms_from_tar(buffer, packages, checksum_map, quiet):
    with tarfile.open(fileobj=buffer) as tarfp:
        for member in tarfp.getmembers():
            if not (member.isfile() and member.name.endswith(".bin")):
                continue

            # Read file from archive
            fp = tarfp.extractfile(member)
            bytes = fp.read()

            # Get hash
            md5 = hashlib.md5()
            md5.update(bytes)
            hash = md5.hexdigest()

            if hash not in checksum_map:
                warnings.warn(f"File {member.name} not supported.")
                continue

            # Get filename from checksum map
            # Filenames are ROM.bin, get ROM
            rom = checksum_map[hash]

            # Write ROM to output folders
            for package in packages:
                file_name = pathlib.Path(package.format.format(rom=rom))
                rom_path = package.path / file_name

                if not rom_path.parent.exists():
                    rom_path.parent.mkdir(parents=True)

                with rom_path.open("wb") as romfp:
                    romfp.write(bytes)
                if not package.filter(str(rom_path)):
                    rom_path.unlink()
                    continue

                if not quiet:
                    print(f"Installed {rom_path}")

            # Cross off this ROM
            del checksum_map[hash]


SupportedPackage = namedtuple("SupportedPackage", ["path", "format", "filter"])


def find_supported_packages():
    installation_dirs = []

    # Try and find AutoROM.roms
    try:
        installation_dirs.append(
            SupportedPackage(
                resources.files("AutoROM") / "roms", "{rom}.bin", lambda _: True
            )
        )
    except ModuleNotFoundError:
        pass
    except TypeError:
        warnings.warn(
            "ale-py package seems to be empty. Perhaps try reinstalling ale-py."
        )

    # Try and find multi-agent-ale-py
    try:
        # Assume all ROMs are supported
        installation_dirs.append(
            SupportedPackage(
                resources.files("multi_agent_ale_py") / "roms",
                "{rom}.bin",
                lambda _: True,
            )
        )
    except ModuleNotFoundError:
        pass
    except TypeError:
        warnings.warn(
            "multi-agent-ale-py package seems to be empty. Perhaps try reinstalling multi-agent-ale-py."
        )

    return installation_dirs


def main(accept_license, source_file, install_dir, quiet):
    if install_dir is not None:
        packages = [
            SupportedPackage(pathlib.Path(install_dir), "{rom}.bin", lambda _: True)
        ]
    else:
        packages = find_supported_packages()

        if len(packages) == 0:
            raise LookupError("Unable to find ale-py or multi-ale-py, quitting.")

    print("AutoROM will download the Atari 2600 ROMs.\nThey will be installed to:")
    for package in packages:
        print(f"\t{package.path.resolve()}")
    print("\nExisting ROMs will be overwritten.")

    if not accept_license:
        license_msg = (
            "\nI own a license to these Atari 2600 ROMs.\n"
            "I agree to not distribute these ROMs and wish to proceed:"
        )
        if not click.confirm(license_msg, default=True):
            return

    # Make sure directories exist
    for package in packages:
        if not package.path.exists():
            package.path.mkdir()

    # Create copy of checksum map which will be mutated
    checksum_map = dict(CHECKSUM_MAP)
    try:
        if all(
            verify_installation(package.path, list(checksum_map.keys()))
            for package in packages
        ):
            return

        with open(torrent_tar() if source_file is None else source_file, "rb") as fh:
            buffer = io.BytesIO(fh.read())
            extract_roms_from_tar(buffer, packages, checksum_map, quiet)

    except tarfile.ReadError:
        if source_file is None:
            print("Failed to read tar archive. Check your network connection?")
        else:
            print("Failed to read tar archive. Verify your source file?")
        return
    except requests.ConnectionError:
        print("Network connection error. Check your network settings?")
        return

    # Print missing ROMs
    for rom in checksum_map.values():
        print(f"Missing: {rom}")
    print("Done!")


@click.command()
@click.option(
    "-v",
    "-y",
    "--accept-license",
    is_flag=True,
    default=False,
    type=bool,
    help="Accept license agreement.",
)
@click.option(
    "-d",
    "--install-dir",
    default=None,
    type=click.Path(exists=True),
    help="User specified install directory.",
)
@click.option(
    "-s",
    "--source-file",
    default=None,
    type=click.Path(exists=True),
    help="User specified .tar.gz source file.",
)
@click.option(
    "--quiet", is_flag=True, default=False, help="Suppress installation output."
)
def cli(accept_license, source_file, install_dir, quiet):
    main(accept_license, source_file, install_dir, quiet)


if __name__ == "__main__":
    cli()
    # main(True, None, None, False)

发现是要下载一个叫 Roms.tar.gz 的文件
下载是使用一个磁力链接下载:

magnet:?xt=urn:btih:a606d1dabf28e794cbc0f88f10d0b8225dc854b4&dn=Roms.tar.gz&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce&tr=http%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce&tr=udp%3A%2F%2F9.rarbg.com%3A2810%2Fannounce&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A6969%2Fannounce&tr=http%3A%2F%2Ftracker.openbittorrent.com%3A80%2Fannounce&tr=udp%3A%2F%2Fopentracker.i2p.rocks%3A6969%2Fannounce&tr=https%3A%2F%2Fopentracker.i2p.rocks%3A443%2Fannounce&tr=udp%3A%2F%2Fopen.stealth.si%3A80%2Fannounce&tr=udp%3A%2F%2Ftracker.torrent.eu.org%3A451%2Fannounce&tr=udp%3A%2F%2Ftracker2.dler.org%3A80%2Fannounce&tr=udp%3A%2F%2Ftracker.tiny-vps.com%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.moeking.me%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.dler.org%3A6969%2Fannounce&tr=udp%3A%2F%2Fpublic.tracker.vraphim.com%3A6969%2Fannounce&tr=udp%3A%2F%2Fp4p.arenabg.com%3A1337%2Fannounce&tr=udp%3A%2F%2Fopen.demonii.com%3A1337%2Fannounce&tr=udp%3A%2F%2Fmovies.zsw.ca%3A6969%2Fannounce&tr=udp%3A%2F%2Fipv4.tracker.harry.lu%3A80%2Fannounce&tr=udp%3A%2F%2Ffe.dealclub.de%3A6969%2Fannounce&tr=udp%3A%2F%2Fexplodie.org%3A6969%2Fannounce&tr=udp%3A%2F%2Fexodus.desync.com%3A6969%2Fannounce&tr=udp%3A%2F%2Fbt2.archive.org%3A6969%2Fannounce&tr=udp%3A%2F%2Fbt1.archive.org%3A6969%2Fannounce&tr=udp%3A%2F%2F6ahddutb1ucc3cp.ru%3A6969%2Fannounce&tr=https%3A%2F%2Ftracker.nanoha.org%3A443%2Fannounce&tr=https%3A%2F%2Ftracker.lilithraws.org%3A443%2Fannounce&tr=https%3A%2F%2Ftr.burnabyhighstar.com%3A443%2Fannounce&tr=http%3A%2F%2Fvps02.net.orel.ru%3A80%2Fannounce&tr=http%3A%2F%2Ftracker2.dler.org%3A80%2Fannounce&tr=http%3A%2F%2Ftracker.mywaifu.best%3A6969%2Fannounce&tr=http%3A%2F%2Ftracker.files.fm%3A6969%2Fannounce&tr=http%3A%2F%2Ftracker.dler.org%3A6969%2Fannounce&tr=http%3A%2F%2Ft.overflow.biz%3A6969%2Fannounce&tr=udp%3A%2F%2Fzecircle.xyz%3A6969%2Fannounce&tr=udp%3A%2F%2Fyahor.ftp.sh%3A6969%2Fannounce&tr=udp%3A%2F%2Fvibe.sleepyinternetfun.xyz%3A1738%2Fannounce&tr=udp%3A%2F%2Fuploads.gamecoast.net%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker1.bt.moack.co.kr%3A80%2Fannounce&tr=udp%3A%2F%2Ftracker.theoks.net%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.tcp.exchange%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.swateam.org.uk%3A2710%2Fannounce&tr=udp%3A%2F%2Ftracker.srv00.com%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.skyts.net%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.publictracker.xyz%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.pomf.se%3A80%2Fannounce&tr=udp%3A%2F%2Ftracker.openbtba.com%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.monitorit4.me%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.lelux.fi%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.leech.ie%3A1337%2Fannounce&tr=udp%3A%2F%2Ftracker.joybomb.tw%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.jonaslsa.com%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.filemail.com%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.ddunlimited.net%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.bitsearch.to%3A1337%2Fannounce&tr=udp%3A%2F%2Ftracker.auctor.tv%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.artixlinux.org%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.army%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.altrosky.nl%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.4.babico.name.tr%3A3131%2Fannounce&tr=udp%3A%2F%2Ftracker-udp.gbitt.info%3A80%2Fannounce&tr=udp%3A%2F%2Ftorrents.artixlinux.org%3A6969%2Fannounce&tr=udp%3A%2F%2Ftorrentclub.space%3A6969%2Fannounce&tr=udp%3A%2F%2Fthouvenin.cloud%3A6969%2Fannounce&tr=udp%3A%2F%2Ftamas3.ynh.fr%3A6969%2Fannounce&tr=udp%3A%2F%2Fsmtp-relay.odysseylabel.com.au%3A6969%2Fannounce&tr=udp%3A%2F%2Fsanincode.com%3A6969%2Fannounce&tr=udp%3A%2F%2Frun.publictracker.xyz%3A6969%2Fannounce&tr=udp%3A%2F%2Frun-2.publictracker.xyz%3A6969%2Fannounce&tr=udp%3A%2F%2Frep-art.ynh.fr%3A6969%2Fannounce&tr=udp%3A%2F%2Frekcart.duckdns.org%3A15480%2Fannounce&tr=udp%3A%2F%2Fqtstm32fan.ru%3A6969%2Fannounce&tr=udp%3A%2F%2Fpublic.publictracker.xyz%3A6969%2Fannounce&tr=udp%3A%2F%2Fpsyco.fr%3A6969%2Fannounce&tr=udp%3A%2F%2Fopen.tracker.ink%3A6969%2Fannounce&tr=udp%3A%2F%2Fopen.free-tracker.ga%3A6969%2Fannounce&tr=udp%3A%2F%2Fopen.dstud.io%3A6969%2Fannounce&tr=udp%3A%2F%2Fnew-line.net%3A6969%2Fannounce&tr=udp%3A%2F%2Fmoonburrow.club%3A6969%2Fannounce&tr=udp%3A%2F%2Fmirror.aptus.co.tz%3A6969%2Fannounce&tr=udp%3A%2F%2Fmail.zasaonsk.ga%3A6969%2Fannounce&tr=udp%3A%2F%2Fmail.artixlinux.org%3A6969%2Fannounce&tr=udp%3A%2F%2Fmadiator.com%3A6969%2Fannounce&tr=udp%3A%2F%2Fleefafa.tk%3A6969%2Fannounce&tr=udp%3A%2F%2Flaze.cc%3A6969%2Fannounce&tr=udp%3A%2F%2Fkokodayo.site%3A6969%2Fannounce&tr=udp%3A%2F%2Fkeke.re%3A6969%2Fannounce&tr=udp%3A%2F%2Fhtz3.noho.st%3A6969%2Fannounce&tr=udp%3A%2F%2Ffh2.cmp-gaming.com%3A6969%2Fannounce&tr=udp%3A%2F%2Ff1sh.de%3A6969%2Fannounce&tr=udp%3A%2F%2Fepider.me%3A6969%2Fannounce&tr=udp%3A%2F%2Felementsbrowser.com%3A6969%2Fannounce&tr=udp%3A%2F%2Fdownload.nerocloud.me%3A6969%2Fannounce&tr=udp%3A%2F%2Fcutscloud.duckdns.org%3A6969%2Fannounce&tr=udp%3A%2F%2Fconcen.org%3A6969%2Fannounce&tr=udp%3A%2F%2Fchouchou.top%3A8080%2Fannounce&tr=udp%3A%2F%2Fcarr.codes%3A6969%2Fannounce&tr=udp%3A%2F%2Fcamera.lei001.com%3A6969%2Fannounce&tr=udp%3A%2F%2Fbuddyfly.top%3A6969%2Fannounce&tr=udp%3A%2F%2Fbubu.mapfactor.com%3A6969%2Fannounce&tr=udp%3A%2F%2Fbt.ktrackers.com%3A6666%2Fannounce&tr=udp%3A%2F%2Fblack-bird.ynh.fr%3A6969%2Fannounce&tr=udp%3A%2F%2Fben.kerbertools.xyz%3A6969%2Fannounce&tr=udp%3A%2F%2Fbananas.space%3A6969%2Fannounce&tr=udp%3A%2F%2Fastrr.ru%3A6969%2Fannounce&tr=udp%3A%2F%2Fapp.icon256.com%3A8000%2Fannounce&tr=udp%3A%2F%2Fadmin.videoenpoche.info%3A6969%2Fannounce&tr=udp%3A%2F%2Fadmin.52ywp.com%3A6969%2Fannounce&tr=udp%3A%2F%2Faarsen.me%3A6969%2Fannounce&tr=udp%3A%2F%2F960303.xyz%3A6969%2Fannounce&tr=https%3A%2F%2Fxtremex.herokuapp.com%3A443%2Fannounce&tr=https%3A%2F%2Ftracker2.ctix.cn%3A443%2Fannounce&tr=https%3A%2F%2Ftracker1.520.jp%3A443%2Fannounce&tr=https%3A%2F%2Ftracker.tamersunion.org%3A443%2Fannounce&tr=https%3A%2F%2Ftracker.kuroy.me%3A443%2Fannounce&tr=https%3A%2F%2Ftracker.gbitt.info%3A443%2Fannounce&tr=https%3A%2F%2Ftracker.foreverpirates.co%3A443%2Fannounce&tr=https%3A%2F%2Ftracker.expli.top%3A443%2Fannounce&tr=https%3A%2F%2Ftr.abir.ga%3A443%2Fannounce&tr=https%3A%2F%2Ftr.abiir.top%3A443%2Fannounce&tr=https%3A%2F%2F1337.abcvg.info%3A443%2Fannounce&tr=http%3A%2F%2Fwepzone.net%3A6969%2Fannounce&tr=http%3A%2F%2Ftracker4.itzmx.com%3A2710%2Fannounce&tr=http%3A%2F%2Ftracker3.itzmx.com%3A6961%2Fannounce&tr=http%3A%2F%2Ftracker3.ctix.cn%3A8080%2Fannounce&tr=http%3A%2F%2Ftracker1.itzmx.com%3A8080%2Fannounce&tr=http%3A%2F%2Ftracker1.bt.moack.co.kr%3A80%2Fannounce&tr=http%3A%2F%2Ftracker.skyts.net%3A6969%2Fannounce&tr=http%3A%2F%2Ftracker.lelux.fi%3A80%2Fannounce&tr=http%3A%2F%2Ftracker.gbitt.info%3A80%2Fannounce&tr=http%3A%2F%2Ftracker.edkj.club%3A6969%2Fannounce&tr=http%3A%2F%2Ftracker.bt4g.com%3A2095%2Fannounce&tr=http%3A%2F%2Ftorrenttracker.nwc.acsalaska.net%3A6969%2Fannounce&tr=http%3A%2F%2Ft.acg.rip%3A6699%2Fannounce&tr=http%3A%2F%2Fopen.tracker.ink%3A6969%2Fannounce&tr=http%3A%2F%2Fopen.acgnxtracker.com%3A80%2Fannounce&tr=http%3A%2F%2Fjp.moeweb.pw%3A6969%2Fannounce&tr=http%3A%2F%2Fincine.ru%3A6969%2Fannounce&tr=http%3A%2F%2Ffxtt.ru%3A80%2Fannounce&tr=http%3A%2F%2Fbt.okmp3.ru%3A2710%2Fannounce&tr=http%3A%2F%2F1337.abcvg.info%3A80%2Fannounce

使用迅雷解析这个链接,发现解析不了
在这里插入图片描述
Github里说可以直接使用这个文件安装Atari2600

AutoROM --source-file /path/to/roms.tar.gz

这里提供好不容易找到的 Roms.tar.gz 文件下载 Roms.tar.gz


END

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/360342.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

非常优秀的网站设计案例,设计师必备

厚积才能薄发&#xff0c;一个优秀的设计师的天性一定是想要获得更多网站设计灵感&#xff0c;擅于为新项目寻找创意切入点、搜索设计参考资源、最新的设计趋势。今天为大家带来了一组免费可商用的网站设计案例&#xff0c;通过这些网站设计案例&#xff0c;你可以获得&#xf…

To prevent a memory leak, the JDBC Driver has been forcibly unregistered.

java项目发布到kubernetes集群中&#xff0c;报错 SEVERE: The web application [] registered the JDBC driver [com.alibaba.druid.proxy.DruidDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has …

Obsidium一键编码作业,Obsidia惊人属性

Obsidium一键编码作业,Obsidia惊人属性 每个区域都包含几个可定制的功能&#xff0c;允许用户确定如何完全执行应用程序的安全性。Obsidia的功能区允许用户存储任何调整或一键编码作业。 Obsidia惊人属性&#xff1a; 代码虚拟化&#xff1a;代码虚拟化允许您转换程序代码的特定…

【电商】库存管理

库存管理&#xff0c;简单的说&#xff0c;就是管理商品和数量之间的关系。库存系统是电商后台系统中不可或缺的一部分 在电商系统中商品库存是非常重要的&#xff0c;在财务进销存系统中也梳理过存货的内容&#xff0c;在销售系统和仓库中的库存有什么区别&#xff1f; 一、什…

SSH 服务支持弱加密算法

漏洞扫描有SSH 服务支持弱加密算法&#xff0c;解决方案有两个&#xff1a; 方案一&#xff1a;修改 SSH 配置文件&#xff0c;添加加密算法&#xff1a; vi /etc/ssh/sshd_config 最后添加一下内容&#xff08;去掉 arcfour、arcfour128、arcfour256 等弱加密算法&#xff09;…

教你数分钟内创建并运行一个 DolphinScheduler Workflow

点击蓝字 关注我们作者 | 鲍亮&#xff0c;Apache DolphinScheduler PMC Member01Workflow是什么&#xff1f;对于数仓场景和数据湖场景来说&#xff0c;最显著的特点就是数据处理的长流程和高复杂度任务依赖关系&#xff0c;从源数据采集到最终报表数据的生成&#xff0c;中间…

边玩边学,13个 Python 小游戏真有趣啊(含源码)

经常听到有朋友说&#xff0c;学习编程是一件非常枯燥无味的事情。其实&#xff0c;大家有没有认真想过&#xff0c;可能是我们的学习方法不对&#xff1f; 比方说&#xff0c;你有没有想过&#xff0c;可以通过打游戏来学编程&#xff1f; 今天我想跟大家分享几个Python小游…

Docker网络模式解析

目录 前言 一、常用基本命令 &#xff08;一&#xff09;查看网络 &#xff08;二&#xff09;创建网络 &#xff08;三&#xff09;查看网络源数据 &#xff08;四&#xff09;删除网络 二、网络模式 &#xff08;一&#xff09;总体介绍 &#xff08;二&#xff09…

使用SpringBoot实现无限级评论回复功能

评论功能已经成为APP和网站开发中的必备功能。本文采用springbootmybatis-plus框架,通过代码主要介绍评论功能的数据库设计和接口数据返回。我们返回的格式可以分两种方案,第一种方案是先返回评论,再根据评论id返回回复信息,第二种方案是将评论回复直接封装成一个类似于树的数据…

Coremail新春分享会:解读Coremail产品新亮点、邮件安全新趋势

2月15日&#xff0c;由Coremail主办的 “新年‘邮’新意 Coremail新春分享会”在线上直播间重磅开启&#xff01;现场分享精彩纷呈&#xff0c;好礼持续放送&#xff0c;场面火爆&#xff0c;收获观众过万点赞&#xff01; 直播现场 嘉宾分享了哪些行业干货&#xff1f;直播现场…

大数据开发-Linux环境搭建

1、操作系统 1.1 计算机原理 冯诺依曼结构&#xff1a;把程序当作数据存储在计算机存储设备中。 冯诺依曼三个基本原则&#xff1a; 采用二进制逻辑程序存储执行计算机由五个部分组成&#xff1a;运算器、控制器、储存器、输入和输出设备 计算机由软件和硬件组成&#xff0c…

图床(Typora + uPic/PicGo+ 七牛云)

图床&#xff08;Typora uPic/PicGo 七牛云&#xff09; 笔者平时使用 Typora 编写 markdown 文档&#xff0c;文档中常常会放置图片&#xff0c;如果文档不需要分享的话&#xff0c;其实讲图片存放在本地就可以了。由于我有在多台机器编写 markdown 笔记&#xff0c;还有将…

OAK相机跑各种yolo模型的检测帧率和深度帧率

编辑&#xff1a;OAK中国 首发&#xff1a;oakchina.cn 喜欢的话&#xff0c;请多多&#x1f44d;⭐️✍ 内容可能会不定期更新&#xff0c;官网内容都是最新的&#xff0c;请查看首发地址链接。 ▌前言 Hello&#xff0c;大家好&#xff0c;这里是OAK中国&#xff0c;我是助手…

Python字符串处理 -- 内附蓝桥题:门牌制作,卡片

字符串处理 ~~不定时更新&#x1f383;&#xff0c;上次更新&#xff1a;2023/02/20 &#x1f5e1;常用函数&#xff08;方法&#xff09; 1. s.count(str) --> 计算字符串 s 中有多少个 str 举个栗子&#x1f330; s "1354111" print(s.count(1)) # 答案为…

Docker 安装nacos并且配置数据库持久化(无脑CV版)

我们以运行ruoyi-cloud项目为例子 在安装之前请注意版本对应问题 https://github.com/alibaba/spring-cloud-alibaba/wiki/%E7%89%88%E6%9C%AC%E8%AF%B4%E6%98%8E 由于我的是2021.0.4.0&#xff0c;因此安装2.0.4版本 否则可能会出现以下错误 在若依的issue有解决方案https:…

UnsupportedOperationException

原因&#xff1a;返回值为list时&#xff0c;返回值类型应为具体的类型参考文章&#xff1a;(139条消息) mybatis中返回结果类型为集合类型&#xff08;List、Map&#xff09;_毒毒毒毒丶的博客-CSDN博客_mybatis返回list<map>集合UnsupportedOperationException 是用于表…

【蓦然回首忆Java·基础卷Ⅱ】

文章目录对象内存解析方法的参数传递机制关键字&#xff1a;package、importpackage(包)JDK中主要的包介绍import(导入)JavaBeanUML类图继承的一些细节封装性中的4种权限修饰关键字&#xff1a;supersuper的理解super的使用场景子类中调用父类被重写的方法子类中调用父类中同名…

追梦之旅【数据结构篇】——详解C语言动态实现顺序表

详解C语言动态实现顺序表~&#x1f60e;前言&#x1f64c;顺序表概念及结构&#x1f64c;功能函数的具体实现分析&#xff1a;&#x1f64c;尾插函数具体实现&#xff1a;尾删函数具体实现&#xff1a;头插函数具体实现&#xff1a;头删插函数具体实现&#xff1a;任意插函数具…

EM算法总结

目录 一。Jensen不等式&#xff1a;若f是凸函数 二。最大似然估计 三。二项分布的最大似然估计 四。进一步考察 1.按照MLE的过程分析 2.化简对数似然函数 3.参数估计的结论 4.符合直观想象 五。从直观理解猜测GMM的参数估计 1.问题&#xff1a;随机变量无法直接…

SQL90 纠错3

描述OrderItems表含有order_num订单号order_numa002a002a002a004a007【问题】将下面代码修改正确后执行SELECT order_num, COUNT(*) AS items FROM OrderItems GROUP BY items HAVING COUNT(*) > 3 ORDER BY items, order_num;【示例结果】返回订单号order_num和出现的次数i…