Ian Williams

34 papers A 3C 3Journal 13Unranked 15
YearRankTypeTitle / Venue / Authors
2024 conf
ICOIN
Zeeshan Khattak, Waqas ur Rahman, Ian Williams
2024 conf
BioCAS
Peilong Feng, Martin Lombard, Jiaqi Ge, Berkay Özbek, Haotian Yuan, Ian Williams, Timothy G. Constandinou
2023 J jnl
IEEE Trans. Cogn. Dev. Syst.
Harry J. Davies, Ian Williams, Ghena Hammour, Metin Yarici, Michael J. Stacey, Barry M. Seemungal, Danilo P. Mandic
2022 conf
BioCAS
Vichaya Manatchinapisit, Adrien Rapeaux, Ian Williams, Timothy G. Constandinou
2022 J jnl
Dagstuhl Reports
Frank Kargl, Ioannis Krontiris, André Weimerskirch, Ian Williams
2022 J jnl
Games Cult.
Ian Williams, Samuel Tobin
2022 conf
EMBC
Harry J. Davies, Ian Williams, Danilo P. Mandic
2022 J jnl
IEEE Trans. Biomed. Eng.
Harry J. Davies, Patrik Bachtiger, Ian Williams, Philip L. Molyneaux, Nicholas S. Peters, Danilo P. Mandic
2020 J jnl
Sensors
Harry J. Davies, Ian Williams, Nicholas S. Peters, Danilo P. Mandic
2020 C conf
ISCAS
Tobi Delbruck, Ibrahim Abe M. Elfadel, Shahzad Muzaffar, Germain Haessig, Bo Wang, Amine Bermak, Rui Graca, Luis A. Camuñas-Mesa, Bathiya Senevirathna, Pamela Abshire, Bernabé Linares-Barranco, Saeed Afshar, Shih-Chii Liu, Runchun Mark Wang, Piotr Dudek, Stephen J. Carey, José M. de la Rosa, Marc Dandin, Sheung Lu, Vincent Frick, Teresa Serrano-Gotarredona, Paula López, Melika Payvand, Advait Madhavan, Eric R. Fossum, Juan Camilo Vasquez Tieck, Ian Williams, Yan Liu, Timothy G. Constandinou, Alexander Serb, Ricardo Carmona-Galán, Robert Nawrocki, Walter D. Leon-Salas
2020 conf
AICAS
Pasquale Davide Schiavone, Davide Rossi, Yan Liu, Simone Benatti, Song Luan, Ian Williams, Luca Benini, Timothy G. Constandinou
2020 J jnl
IEEE Trans. Biomed. Circuits Syst.
Ian Williams, Emma Brunton, Adrien Rapeaux, Yan Liu, Song Luan, Kianoush Nazarpour, Timothy G. Constandinou
2019 J jnl
CoRR
Jonathan Shen, Patrick Nguyen, Yonghui Wu, Zhifeng Chen, Mia Xu Chen, Ye Jia, Anjuli Kannan, Tara N. Sainath, Yuan Cao, Chung-Cheng Chiu, Yanzhang He, Jan Chorowski, Smit Hinsu, Stella Laurenzo, James Qin, Orhan Firat, Wolfgang Macherey, Suyog Gupta, Ankur Bapna, Shuyuan Zhang, Ruoming Pang, Ron J. Weiss, Rohit Prabhavalkar, Qiao Liang, Benoit Jacob, Bowen Liang, HyoukJoong Lee, Ciprian Chelba, Sébastien Jean, Bo Li, Melvin Johnson, Rohan Anil, Rajat Tibrewal, Xiaobing Liu, Akiko Eriguchi, Navdeep Jaitly, Naveen Ari, Colin Cherry, Parisa Haghani, Otavio Good, Youlong Cheng, Raziel Alvarez, Isaac Caswell, Wei-Ning Hsu, Zongheng Yang, Kuan-Chieh Wang, Ekaterina Gonina, Katrin Tomanek, Ben Vanik, Zelin Wu, Llion Jones, Mike Schuster, Yanping Huang, Dehao Chen, Kazuki Irie, George F. Foster, John Richardson, Klaus Macherey, Antoine Bruguier, Heiga Zen, Colin Raffel, Shankar Kumar, Kanishka Rao, David Rybach, Matthew Murray, Vijayaditya Peddinti, Maxim Krikun, Michiel Bacchiani, Thomas B. Jablin, Robert Suderman, Ian Williams, Benjamin Lee, Deepti Bhatia, Justin Carlson, Semih Yavuz, Yu Zhang, Ian McGraw, Max Galkin, Qi Ge, Golan Pundak, Chad Whipkey, Todd Wang, Uri Alon, Dmitry Lepikhin, Ye Tian, Sara Sabour, William Chan, Shubham Toshniwal, Baohua Liao, Michael Nirschl, Pat Rondon
2019 conf
BioCAS
Ian Williams, Adrien Rapeaux, Jack Pearson, Kianoush Nazarpour, Emma Brunton, Song Luan, Yan Liu, Timothy G. Constandinou
2019 J jnl
ISPRS Int. J. Geo Inf.
Lu Wang, Gabby Lee, Ian Williams
2018 A conf
INTERSPEECH
Ian Williams, Anjuli Kannan, Petar S. Aleksic, David Rybach, Tara N. Sainath
2018 C conf
ICT4AWE
Kiran Gopinathan, Nikolaos Alexandros Kaloumenos, Kinnari Ajmera, Alexandru Matei, Ian Williams, Andrew Davis
2018 A conf
INTERSPEECH
Leonid Velikovich, Ian Williams, Justin Scheiner, Petar S. Aleksic, Pedro J. Moreno, Michael Riley
2017 J jnl
IEEE Trans. Biomed. Circuits Syst.
Yan Liu, Song Luan, Ian Williams, Adrien Rapeaux, Timothy G. Constandinou
2017 A conf
INTERSPEECH
Ian Williams, Petar S. Aleksic
2016 conf
BioCAS
Ian Williams, Adrien Rapeaux, Yan Liu, Song Luan, Timothy G. Constandinou
2016 conf
BioCAS
Song Luan, Yan Liu, Ian Williams, Timothy G. Constandinou
2016 conf
BioCAS
Zack Frehlick, Ian Williams, Timothy G. Constandinou
2016 conf
SLT
Justin Scheiner, Ian Williams, Petar S. Aleksic
2015 conf
EMBC
Adrien Rapeaux, Konstantin Nikolic, Ian Williams, Amir Eftekhar, Timothy G. Constandinou
2015 J jnl
PLoS Comput. Biol.
Changwang Zhang, Shi Zhou, Elisabetta Groppelli, Pierre Pellegrino, Ian Williams, Persephone Borrow, Benjamin M. Chain, Clare Jolly
2015 J jnl
CoRR
Changwang Zhang, Shi Zhou, Elisabetta Groppelli, Pierre Pellegrino, Ian Williams, Persephone Borrow, Benjamin M. Chain, Clare Jolly
2015 conf
BioCAS
Ian Williams, Song Luan, Andrew Jackson, Timothy G. Constandinou
2013 J jnl
IEEE Trans. Biomed. Circuits Syst.
Ian Williams, Timothy G. Constandinou
2013 conf
EMBC
Ian Williams, Timothy G. Constandinou
2012 C conf
ISCAS
Ian Williams, Timothy G. Constandinou
2010 J jnl
IEEE Instrum. Meas. Mag.
Ian Williams, Susan Moran
1990 conf
ECHT
Patricia Baird, Jacqueline Covo, Ben Shneiderman, Ian Williams, Renee Deter
1988 conf
UK Hypertext
Peter Cooke, Ian Williams
redb/s3_utils.py
← Index redb/s3_utils.py python
"""
S3 and file utility functions for REDB.

Contains MinIO/S3 client creation, S3 key generation,
file download, and archive extraction helpers.
"""
import os
import tempfile
from typing import Optional, List

from minio import Minio
from minio.error import S3Error


def get_minio_client():
    """Create and return a Minio client using credentials from .env file"""
    return Minio(
        endpoint=os.getenv("S3_ENDPOINT"),
        access_key=os.getenv("S3_ACCESS_KEY"),
        secret_key=os.getenv("S3_SECRET_KEY"),
        secure=os.getenv("S3_SECURE", "false").lower() == "true"
    )


def generate_s3_key_from_hash(sample_hash: str) -> str:
    """
    Generate S3 key from hash using sharding structure.
    Example: 09f7d02a3c2382199458c98a62b045145ee54ab6aba86166aecf3d10c3c1444c
    becomes: 09/f7/09f7d02a3c2382199458c98a62b045145ee54ab6aba86166aecf3d10c3c1444c.zip
    """
    if len(sample_hash) < 4:
        raise ValueError(f"Hash too short for sharding: {sample_hash}")

    # Create sharded path: first 2 chars / next 2 chars / full_hash.zip
    return f"{sample_hash[:2]}/{sample_hash[2:4]}/{sample_hash}.zip"


def download_s3_object(s3_bucket: str, s3_key: str, temp_dir: str, logger=None) -> Optional[str]:
    """
    Download an object from S3 to a local temporary directory and return the local path.
    If the .zip file is not found, automatically tries .7z as a fallback for legacy uploads.
    """
    try:
        minio_client = get_minio_client()
        local_path = os.path.join(temp_dir, os.path.basename(s3_key))

        # Download the file
        minio_client.fget_object(s3_bucket, s3_key, local_path)

        return local_path
    except S3Error as e:
        # If .zip not found and error is NoSuchKey, try .7z fallback
        if e.code == 'NoSuchKey' and s3_key.endswith('.zip'):
            s3_key_7z = s3_key[:-4] + '.7z'  # Replace .zip with .7z
            if logger:
                logger.info(f".zip not found, trying .7z fallback: {s3_key_7z}")
            try:
                local_path_7z = os.path.join(temp_dir, os.path.basename(s3_key_7z))
                minio_client.fget_object(s3_bucket, s3_key_7z, local_path_7z)
                if logger:
                    logger.info(f"Successfully downloaded .7z fallback: {s3_key_7z}")
                return local_path_7z
            except S3Error as e2:
                if logger:
                    logger.error(f"Failed to download S3 object {s3_key} (tried both .zip and .7z): {e2}")
                else:
                    print(f"[ERROR] Failed to download S3 object {s3_key} (tried both .zip and .7z): {e2}")
                return None
        else:
            if logger:
                logger.error(f"Failed to download S3 object {s3_key}: {e}")
            else:
                print(f"[ERROR] Failed to download S3 object {s3_key}: {e}")
            return None


def extract_fat_slices(macho, output_dir: str, logger) -> List[tuple]:
    """
    Extract slices from FAT Mach-O binary using machofile's dump_slices() API.

    Args:
        macho: Parsed machofile.UniversalMachO object
        output_dir: Directory to write slice files
        logger: Logger instance

    Returns:
        List of (arch_name, slice_path, slice_sha256, slice_md5, slice_sha1) tuples
    """
    result = []
    try:
        # Use machofile's dump_slices API (v2026.2.5+)
        slices = macho.dump_slices(output_dir=output_dir)
        logger.debug(f"Extracted {len(slices)} slices from FAT binary")

        for arch_name, slice_path in slices:
            # Get hash info for this slice from machofile
            general_info = macho.get_general_info(arch=arch_name)
            slice_sha256 = general_info.get('SHA256')
            slice_md5 = general_info.get('MD5')
            slice_sha1 = general_info.get('SHA1')
            result.append((arch_name, slice_path, slice_sha256, slice_md5, slice_sha1))
            logger.debug(f"Slice {arch_name}: {slice_sha256}")

    except Exception as e:
        logger.error(f"Error extracting FAT slices: {e}")

    return result